Rev 986 | Rev 1058 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 986 | Rev 1022 | ||
|---|---|---|---|
| Line 50... | Line 50... | ||
| 50 | printf("Unable to get memory map\n"); |
50 | printf("Unable to get memory map\n"); |
| 51 | halt(); |
51 | halt(); |
| 52 | } |
52 | } |
| 53 | printf("total memory %d MB\n", memmap.total >> 20); |
53 | printf("total memory %d MB\n", memmap.total >> 20); |
| 54 | 54 | ||
| 55 | // FIXME: map just the kernel |
- | |
| 56 | if (ofw_map((void *) KERNEL_PHYSICAL_ADDRESS, (void *) KERNEL_VIRTUAL_ADDRESS, memmap.total - 64 * 1024 * 1024, 0) != 0) { |
55 | if (ofw_map((void *) KERNEL_PHYSICAL_ADDRESS, (void *) KERNEL_VIRTUAL_ADDRESS, KERNEL_SIZE + KERNEL_BOOT_OFFSET, 0) != 0) { |
| 57 | 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); |
| 58 | halt(); |
57 | halt(); |
| 59 | } |
58 | } |
| 60 | 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); |
| 61 | // FIXME: relocate the kernel in real mode |
60 | // FIXME: relocate the kernel in real mode |
| Line 63... | Line 62... | ||
| 63 | 62 | ||
| 64 | // FIXME: proper hardware detection & mapping |
63 | // FIXME: proper hardware detection & mapping |
| 65 | ofw_map((void *) 0x84000000, (void *) 0xf0000000, 0x01000000, 0); |
64 | ofw_map((void *) 0x84000000, (void *) 0xf0000000, 0x01000000, 0); |
| 66 | ofw_map((void *) 0x80816000, (void *) 0xf2000000, 0x00018000, 0); |
65 | ofw_map((void *) 0x80816000, (void *) 0xf2000000, 0x00018000, 0); |
| 67 | 66 | ||
| - | 67 | void *tramp = ofw_translate(&real_mode); |
|
| - | 68 | printf("bootstrap trampoline at %L (physical %L)\n", &real_mode, tramp); |
|
| 68 | printf("Booting the kernel...\n"); |
69 | printf("Booting the kernel...\n"); |
| 69 | 70 | ||
| 70 | flush_instruction_cache(); |
71 | flush_instruction_cache(); |
| 71 | jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS + KERNEL_BOOT_OFFSET, ofw_translate(&memmap)); |
72 | jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS + KERNEL_BOOT_OFFSET, ofw_translate(&memmap), tramp); |
| 72 | } |
73 | } |