Subversion Repositories HelenOS

Rev

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

Rev 3808 Rev 3823
Line 140... Line 140...
140
     */
140
     */
141
    if (silo_ramdisk_image) {
141
    if (silo_ramdisk_image) {
142
        silo_ramdisk_image += bootinfo.physmem_start;
142
        silo_ramdisk_image += bootinfo.physmem_start;
143
        silo_ramdisk_image -= 0x400000;
143
        silo_ramdisk_image -= 0x400000;
144
        /* Install 1:1 mapping for the ramdisk. */
144
        /* Install 1:1 mapping for the ramdisk. */
145
        if (ofw_map((void *)((uintptr_t)silo_ramdisk_image),
145
        if (ofw_map((void *)((uintptr_t) silo_ramdisk_image),
146
            (void *)((uintptr_t)silo_ramdisk_image),
146
            (void *)((uintptr_t) silo_ramdisk_image),
147
            silo_ramdisk_size, -1) != 0) {
147
            silo_ramdisk_size, -1) != 0) {
148
            printf("Failed to map ramdisk.\n");
148
            printf("Failed to map ramdisk.\n");
149
            halt();
149
            halt();
150
        }
150
        }
151
    }
151
    }
Line 201... Line 201...
201
        /*
201
        /*
202
         * Claim and map the whole ramdisk as it may exceed the area
202
         * Claim and map the whole ramdisk as it may exceed the area
203
         * given to us by SILO.
203
         * given to us by SILO.
204
         */
204
         */
205
        (void) ofw_claim_phys(base + top, silo_ramdisk_size);
205
        (void) ofw_claim_phys(base + top, silo_ramdisk_size);
206
        (void) ofw_map(base + top, base + top, silo_ramdisk_size, -1);
206
        (void) ofw_map(bootinfo.physmem_start + base + top, base + top,
-
 
207
            silo_ramdisk_size, -1);
207
        memmove(base + top, (void *)((uintptr_t)silo_ramdisk_image),
208
        memmove(base + top, (void *)((uintptr_t)silo_ramdisk_image),
208
            silo_ramdisk_size);
209
            silo_ramdisk_size);
209
        printf("done.\n");
210
        printf("done.\n");
210
        top += silo_ramdisk_size;
211
        top += silo_ramdisk_size;
211
    }
212
    }
Line 251... Line 252...
251
     * Initialize the boot allocator.
252
     * Initialize the boot allocator.
252
     */
253
     */
253
    balloc_base = base + ALIGN_UP(top, PAGE_SIZE);
254
    balloc_base = base + ALIGN_UP(top, PAGE_SIZE);
254
    (void) ofw_claim_phys(bootinfo.physmem_start + balloc_base,
255
    (void) ofw_claim_phys(bootinfo.physmem_start + balloc_base,
255
        BALLOC_MAX_SIZE);
256
        BALLOC_MAX_SIZE);
256
    (void) ofw_map(balloc_base, balloc_base, BALLOC_MAX_SIZE, -1);
257
    (void) ofw_map(bootinfo.physmem_start + balloc_base, balloc_base,
-
 
258
        BALLOC_MAX_SIZE, -1);
257
    balloc_init(&bootinfo.ballocs, (uintptr_t)balloc_base);
259
    balloc_init(&bootinfo.ballocs, (uintptr_t)balloc_base);
258
 
260
 
259
    printf("\nCanonizing OpenFirmware device tree...");
261
    printf("\nCanonizing OpenFirmware device tree...");
260
    bootinfo.ofw_root = ofw_tree_build();
262
    bootinfo.ofw_root = ofw_tree_build();
261
    printf("done.\n");
263
    printf("done.\n");
Line 272... Line 274...
272
    printf("\nBooting the kernel...\n");
274
    printf("\nBooting the kernel...\n");
273
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS,
275
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS,
274
        bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo,
276
        bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo,
275
        sizeof(bootinfo));
277
        sizeof(bootinfo));
276
}
278
}
277
 
-