Rev 964 | Rev 971 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 964 | Rev 969 | ||
---|---|---|---|
Line 50... | Line 50... | ||
50 | halt(); |
50 | halt(); |
51 | } |
51 | } |
52 | printf("total memory %d MB\n", memmap.total >> 20); |
52 | printf("total memory %d MB\n", memmap.total >> 20); |
53 | 53 | ||
54 | // FIXME: map just the kernel |
54 | // FIXME: map just the kernel |
55 | if (ofw_map((void *) KERNEL_PHYSICAL_ADDRESS, (void *) KERNEL_VIRTUAL_ADDRESS, 1024 * 1024, 0) != 0) { |
55 | if (ofw_map((void *) KERNEL_PHYSICAL_ADDRESS, (void *) KERNEL_VIRTUAL_ADDRESS, memmap.total - 16 * 1024 * 1024, 0) != 0) { |
56 | printf("Unable to map kernel memory at %L (physical %L)\n", KERNEL_VIRTUAL_ADDRESS, KERNEL_PHYSICAL_ADDRESS); |
56 | printf("Unable to map kernel memory at %L (physical %L)\n", KERNEL_VIRTUAL_ADDRESS, KERNEL_PHYSICAL_ADDRESS); |
57 | halt(); |
57 | halt(); |
58 | } |
58 | } |
59 | printf("kernel memory mapped at %L (physical %L, size %d bytes)\n", KERNEL_VIRTUAL_ADDRESS, KERNEL_PHYSICAL_ADDRESS, KERNEL_SIZE); |
59 | printf("kernel memory mapped at %L (physical %L, size %d bytes)\n", KERNEL_VIRTUAL_ADDRESS, KERNEL_PHYSICAL_ADDRESS, KERNEL_SIZE); |
60 | // FIXME: relocate the kernel in real mode |
60 | // FIXME: relocate the kernel in real mode |
61 | memcpy((void *) KERNEL_VIRTUAL_ADDRESS, KERNEL_START, KERNEL_SIZE); |
61 | memcpy((void *) KERNEL_VIRTUAL_ADDRESS, KERNEL_START, KERNEL_SIZE); |
62 | 62 | ||
63 | // FIXME: proper framebuffer mapping |
63 | // FIXME: proper framebuffer mapping |
64 | ofw_map((void *) 0x84000000, (void *) 0x84000000, 2 * 1024 * 1024, 0); |
64 | ofw_map((void *) 0x84000000, (void *) 0xf0000000, 2 * 1024 * 1024, 0); |
65 | 65 | ||
66 | printf("Booting the kernel...\n"); |
66 | printf("Booting the kernel...\n"); |
67 | 67 | ||
68 | flush_instruction_cache(); |
68 | flush_instruction_cache(); |
69 | jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, ofw_translate(&memmap)); |
69 | jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, ofw_translate(&memmap)); |