Rev 1822 | Rev 1881 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1822 | Rev 1837 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | #include "main.h" |
29 | #include "main.h" |
30 | #include <printf.h> |
30 | #include <printf.h> |
31 | #include "asm.h" |
31 | #include "asm.h" |
32 | #include "_components.h" |
32 | #include "_components.h" |
33 | #include <ofw.h> |
33 | #include <ofw.h> |
- | 34 | #include "ofwarch.h" |
|
34 | #include <align.h> |
35 | #include <align.h> |
35 | 36 | ||
36 | #define KERNEL_VIRTUAL_ADDRESS 0x400000 |
37 | #define KERNEL_VIRTUAL_ADDRESS 0x400000 |
37 | 38 | ||
38 | bootinfo_t bootinfo; |
39 | bootinfo_t bootinfo; |
Line 57... | Line 58... | ||
57 | if (!ofw_screen(&bootinfo.screen)) { |
58 | if (!ofw_screen(&bootinfo.screen)) { |
58 | printf("Error: unable to get screen properties, halting.\n"); |
59 | printf("Error: unable to get screen properties, halting.\n"); |
59 | halt(); |
60 | halt(); |
60 | } |
61 | } |
61 | bootinfo.screen.addr = ofw_translate(bootinfo.screen.addr); |
62 | bootinfo.screen.addr = ofw_translate(bootinfo.screen.addr); |
- | 63 | /* transform scanline to bytes with respect to potential alignment */ |
|
- | 64 | bootinfo.screen.scanline = bootinfo.screen.scanline*bpp2align[bootinfo.screen.bpp >> 3]; |
|
62 | 65 | ||
63 | if (!ofw_keyboard(&bootinfo.keyboard)) |
66 | if (!ofw_keyboard(&bootinfo.keyboard)) |
64 | printf("Error: unable to get keyboard properties\n"); |
67 | printf("Error: unable to get keyboard properties\n"); |
65 | 68 | ||
66 | printf("\nDevice statistics\n"); |
69 | printf("\nDevice statistics\n"); |
67 | printf(" memory: %dM\n", bootinfo.memmap.total>>20); |
70 | printf(" memory: %dM\n", bootinfo.memmap.total>>20); |
68 | printf(" screen at %P, resolution %dx%d, %d bpp (scanline %d bytes)\n", (uintptr_t) bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline); |
71 | printf(" screen at %P, resolution %dx%d, %d bpp (scanline %d bytes)\n", (uintptr_t) bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline); |
69 | printf(" keyboard at %P (size %d bytes)\n", (uintptr_t) bootinfo.keyboard.addr, bootinfo.keyboard.size); |
72 | printf(" keyboard at %P (size %d bytes)\n", (uintptr_t) bootinfo.keyboard.addr, bootinfo.keyboard.size); |
70 | 73 |