Rev 4339 | Rev 4342 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4339 | Rev 4341 | ||
|---|---|---|---|
| Line 74... | Line 74... | ||
| 74 | 74 | ||
| 75 | void arch_post_mm_init(void) |
75 | void arch_post_mm_init(void) |
| 76 | { |
76 | { |
| 77 | if (config.cpu_active == 1) { |
77 | if (config.cpu_active == 1) { |
| 78 | /* Initialize framebuffer */ |
78 | /* Initialize framebuffer */ |
| - | 79 | if (bootinfo.screen.addr) { |
|
| 79 | unsigned int visual; |
80 | unsigned int visual; |
| 80 | 81 | ||
| 81 | switch (bootinfo.screen.bpp) { |
82 | switch (bootinfo.screen.bpp) { |
| 82 | case 8: |
83 | case 8: |
| 83 | visual = VISUAL_INDIRECT_8; |
84 | visual = VISUAL_INDIRECT_8; |
| 84 | break; |
85 | break; |
| 85 | case 16: |
86 | case 16: |
| 86 | visual = VISUAL_RGB_5_5_5; |
87 | visual = VISUAL_RGB_5_5_5; |
| 87 | break; |
88 | break; |
| 88 | case 24: |
89 | case 24: |
| 89 | visual = VISUAL_RGB_8_8_8; |
90 | visual = VISUAL_RGB_8_8_8; |
| 90 | break; |
91 | break; |
| 91 | case 32: |
92 | case 32: |
| 92 | visual = VISUAL_RGB_0_8_8_8; |
93 | visual = VISUAL_RGB_0_8_8_8; |
| 93 | break; |
94 | break; |
| 94 | default: |
95 | default: |
| 95 | panic("Unsupported bits per pixel."); |
96 | panic("Unsupported bits per pixel."); |
| - | 97 | } |
|
| - | 98 | fb_properties_t prop = { |
|
| - | 99 | .addr = bootinfo.screen.addr, |
|
| - | 100 | .offset = 0, |
|
| - | 101 | .x = bootinfo.screen.width, |
|
| - | 102 | .y = bootinfo.screen.height, |
|
| - | 103 | .scan = bootinfo.screen.scanline, |
|
| - | 104 | .visual = visual, |
|
| - | 105 | }; |
|
| - | 106 | fb_init(&prop); |
|
| 96 | } |
107 | } |
| 97 | fb_properties_t prop = { |
- | |
| 98 | .addr = bootinfo.screen.addr, |
- | |
| 99 | .offset = 0, |
- | |
| 100 | .x = bootinfo.screen.width, |
- | |
| 101 | .y = bootinfo.screen.height, |
- | |
| 102 | .scan = bootinfo.screen.scanline, |
- | |
| 103 | .visual = visual, |
- | |
| 104 | }; |
- | |
| 105 | fb_init(&prop); |
- | |
| 106 | 108 | ||
| 107 | /* Initialize IRQ routing */ |
109 | /* Initialize IRQ routing */ |
| 108 | irq_init(IRQ_COUNT, IRQ_COUNT); |
110 | irq_init(IRQ_COUNT, IRQ_COUNT); |
| 109 | - | ||
| 110 | /* Initialize PIC */ |
- | |
| 111 | pic_init(bootinfo.keyboard.addr, PAGE_SIZE); |
- | |
| 112 | 111 | ||
| - | 112 | if (bootinfo.macio.addr) { |
|
| - | 113 | /* Initialize PIC */ |
|
| - | 114 | pic_init(bootinfo.macio.addr, PAGE_SIZE); |
|
| - | 115 | ||
| 113 | /* Initialize I/O controller */ |
116 | /* Initialize I/O controller */ |
| 114 | cuda_init(device_assign_devno(), |
117 | cuda_init(device_assign_devno(), |
| 115 | bootinfo.keyboard.addr + 0x16000, 2 * PAGE_SIZE); |
118 | bootinfo.macio.addr + 0x16000, 2 * PAGE_SIZE); |
| - | 119 | } |
|
| 116 | 120 | ||
| 117 | /* Merge all zones to 1 big zone */ |
121 | /* Merge all zones to 1 big zone */ |
| 118 | zone_merge_all(); |
122 | zone_merge_all(); |
| 119 | } |
123 | } |
| 120 | } |
124 | } |
| Line 141... | Line 145... | ||
| 141 | (uintptr_t) kernel_uarg->uspace_stack + |
145 | (uintptr_t) kernel_uarg->uspace_stack + |
| 142 | THREAD_STACK_SIZE - SP_DELTA, |
146 | THREAD_STACK_SIZE - SP_DELTA, |
| 143 | (uintptr_t) kernel_uarg->uspace_entry); |
147 | (uintptr_t) kernel_uarg->uspace_entry); |
| 144 | 148 | ||
| 145 | /* Unreachable */ |
149 | /* Unreachable */ |
| 146 | for (;;) |
150 | while (true); |
| 147 | ; |
- | |
| 148 | } |
151 | } |
| 149 | 152 | ||
| 150 | /** Acquire console back for kernel |
153 | /** Acquire console back for kernel |
| 151 | * |
154 | * |
| 152 | */ |
155 | */ |