Subversion Repositories HelenOS

Rev

Rev 4337 | Rev 4342 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4337 Rev 4341
Line 139... Line 139...
139
     */
139
     */
140
    if (silo_ramdisk_image) {
140
    if (silo_ramdisk_image) {
141
        silo_ramdisk_image += bootinfo.physmem_start;
141
        silo_ramdisk_image += bootinfo.physmem_start;
142
        silo_ramdisk_image -= 0x400000;
142
        silo_ramdisk_image -= 0x400000;
143
        /* Install 1:1 mapping for the ramdisk. */
143
        /* Install 1:1 mapping for the ramdisk. */
144
        if (ofw_map((void *)((uintptr_t)silo_ramdisk_image),
144
        if (ofw_map((void *)((uintptr_t) silo_ramdisk_image),
145
            (void *)((uintptr_t)silo_ramdisk_image),
145
            (void *)((uintptr_t) silo_ramdisk_image),
146
            silo_ramdisk_size, -1) != 0) {
146
            silo_ramdisk_size, -1) != 0) {
147
            printf("Failed to map ramdisk.\n");
147
            printf("Failed to map ramdisk.\n");
148
            halt();
148
            halt();
149
        }
149
        }
150
    }
150
    }
Line 200... Line 200...
200
        /*
200
        /*
201
         * Claim and map the whole ramdisk as it may exceed the area
201
         * Claim and map the whole ramdisk as it may exceed the area
202
         * given to us by SILO.
202
         * given to us by SILO.
203
         */
203
         */
204
        (void) ofw_claim_phys(base + top, silo_ramdisk_size);
204
        (void) ofw_claim_phys(base + top, silo_ramdisk_size);
205
        (void) ofw_map(base + top, base + top, silo_ramdisk_size, -1);
205
        (void) ofw_map(bootinfo.physmem_start + base + top, base + top,
-
 
206
            silo_ramdisk_size, -1);
206
        /*
207
        /*
207
         * FIXME If the source and destination overlap, it may be
208
         * FIXME If the source and destination overlap, it may be
208
         * desirable to copy in reverse order, depending on how the two
209
         * desirable to copy in reverse order, depending on how the two
209
         * regions overlap.
210
         * regions overlap.
210
         */
211
         */
Line 255... Line 256...
255
     * Initialize the boot allocator.
256
     * Initialize the boot allocator.
256
     */
257
     */
257
    balloc_base = base + ALIGN_UP(top, PAGE_SIZE);
258
    balloc_base = base + ALIGN_UP(top, PAGE_SIZE);
258
    (void) ofw_claim_phys(bootinfo.physmem_start + balloc_base,
259
    (void) ofw_claim_phys(bootinfo.physmem_start + balloc_base,
259
        BALLOC_MAX_SIZE);
260
        BALLOC_MAX_SIZE);
260
    (void) ofw_map(balloc_base, balloc_base, BALLOC_MAX_SIZE, -1);
261
    (void) ofw_map(bootinfo.physmem_start + balloc_base, balloc_base,
-
 
262
        BALLOC_MAX_SIZE, -1);
261
    balloc_init(&bootinfo.ballocs, (uintptr_t)balloc_base);
263
    balloc_init(&bootinfo.ballocs, (uintptr_t)balloc_base);
262
 
264
 
263
    printf("\nCanonizing OpenFirmware device tree...");
265
    printf("\nCanonizing OpenFirmware device tree...");
264
    bootinfo.ofw_root = ofw_tree_build();
266
    bootinfo.ofw_root = ofw_tree_build();
265
    printf("done.\n");
267
    printf("done.\n");
266
 
268
 
267
#ifdef CONFIG_SMP
269
#ifdef CONFIG_AP
268
    printf("\nChecking for secondary processors...");
270
    printf("\nChecking for secondary processors...");
269
    if (!ofw_cpu())
271
    if (!ofw_cpu())
270
        printf("Error: unable to get CPU properties\n");
272
        printf("Error: unable to get CPU properties\n");
271
    printf("done.\n");
273
    printf("done.\n");
272
#endif
274
#endif
Line 276... Line 278...
276
    printf("\nBooting the kernel...\n");
278
    printf("\nBooting the kernel...\n");
277
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS,
279
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS,
278
        bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo,
280
        bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo,
279
        sizeof(bootinfo));
281
        sizeof(bootinfo));
280
}
282
}
281
 
-