Rev 4055 | Rev 4296 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4055 | Rev 4156 | ||
|---|---|---|---|
| Line 63... | Line 63... | ||
| 63 | #include <arch/syscall.h> |
63 | #include <arch/syscall.h> |
| 64 | #include <arch/debugger.h> |
64 | #include <arch/debugger.h> |
| 65 | #include <syscall/syscall.h> |
65 | #include <syscall/syscall.h> |
| 66 | #include <console/console.h> |
66 | #include <console/console.h> |
| 67 | #include <ddi/irq.h> |
67 | #include <ddi/irq.h> |
| 68 | #include <ddi/device.h> |
- | |
| 69 | #include <sysinfo/sysinfo.h> |
68 | #include <sysinfo/sysinfo.h> |
| 70 | 69 | ||
| 71 | /** Disable I/O on non-privileged levels |
70 | /** Disable I/O on non-privileged levels |
| 72 | * |
71 | * |
| 73 | * Clean IOPL(12,13) and NT(14) flags in EFLAGS register |
72 | * Clean IOPL(12,13) and NT(14) flags in EFLAGS register |
| Line 148... | Line 147... | ||
| 148 | /* Initialize IRQ routing */ |
147 | /* Initialize IRQ routing */ |
| 149 | irq_init(IRQ_COUNT, IRQ_COUNT); |
148 | irq_init(IRQ_COUNT, IRQ_COUNT); |
| 150 | 149 | ||
| 151 | /* hard clock */ |
150 | /* hard clock */ |
| 152 | i8254_init(); |
151 | i8254_init(); |
| 153 | 152 | ||
| 154 | #ifdef CONFIG_FB |
153 | #ifdef CONFIG_FB |
| 155 | if (vesa_present()) |
154 | if (vesa_present()) |
| 156 | vesa_init(); |
155 | vesa_init(); |
| 157 | else |
156 | else |
| 158 | #endif |
157 | #endif |
| - | 158 | #ifdef CONFIG_EGA |
|
| 159 | ega_init(EGA_BASE, EGA_VIDEORAM); /* video */ |
159 | ega_init(EGA_BASE, EGA_VIDEORAM); /* video */ |
| - | 160 | #else |
|
| - | 161 | {} |
|
| - | 162 | #endif |
|
| 160 | 163 | ||
| 161 | /* Enable debugger */ |
164 | /* Enable debugger */ |
| 162 | debugger_init(); |
165 | debugger_init(); |
| 163 | /* Merge all memory zones to 1 big zone */ |
166 | /* Merge all memory zones to 1 big zone */ |
| 164 | zone_merge_all(); |
167 | zone_merge_all(); |
| Line 187... | Line 190... | ||
| 187 | } |
190 | } |
| 188 | } |
191 | } |
| 189 | 192 | ||
| 190 | void arch_post_smp_init(void) |
193 | void arch_post_smp_init(void) |
| 191 | { |
194 | { |
| 192 | devno_t devno = device_assign_devno(); |
195 | #ifdef CONFIG_PC_KBD |
| 193 | 196 | /* |
|
| 194 | /* |
- | |
| 195 | * Initialize the keyboard module and conect it to stdin. Then |
197 | * Initialize the i8042 controller. Then initialize the keyboard |
| 196 | * initialize the i8042 controller and connect it to kbrdin. Enable |
198 | * module and connect it to i8042. Enable keyboard interrupts. |
| - | 199 | */ |
|
| 197 | * keyboard interrupts. |
200 | indev_t *kbrdin = i8042_init((i8042_t *) I8042_BASE, IRQ_KBD); |
| 198 | */ |
201 | if (kbrdin) { |
| 199 | kbrd_init(stdin); |
202 | kbrd_init(kbrdin); |
| 200 | (void) i8042_init((i8042_t *) I8042_BASE, devno, IRQ_KBD, &kbrdin); |
- | |
| 201 | trap_virtual_enable_irqs(1 << IRQ_KBD); |
203 | trap_virtual_enable_irqs(1 << IRQ_KBD); |
| - | 204 | } |
|
| 202 | 205 | ||
| 203 | /* |
206 | /* |
| 204 | * This is the necessary evil until the userspace driver is entirely |
207 | * This is the necessary evil until the userspace driver is entirely |
| 205 | * self-sufficient. |
208 | * self-sufficient. |
| 206 | */ |
209 | */ |
| 207 | sysinfo_set_item_val("kbd", NULL, true); |
210 | sysinfo_set_item_val("kbd", NULL, true); |
| 208 | sysinfo_set_item_val("kbd.devno", NULL, devno); |
- | |
| 209 | sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD); |
211 | sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD); |
| 210 | sysinfo_set_item_val("kbd.address.physical", NULL, |
212 | sysinfo_set_item_val("kbd.address.physical", NULL, |
| 211 | (uintptr_t) I8042_BASE); |
213 | (uintptr_t) I8042_BASE); |
| 212 | sysinfo_set_item_val("kbd.address.kernel", NULL, |
214 | sysinfo_set_item_val("kbd.address.kernel", NULL, |
| 213 | (uintptr_t) I8042_BASE); |
215 | (uintptr_t) I8042_BASE); |
| - | 216 | #endif |
|
| 214 | } |
217 | } |
| 215 | 218 | ||
| 216 | void calibrate_delay_loop(void) |
219 | void calibrate_delay_loop(void) |
| 217 | { |
220 | { |
| 218 | i8254_calibrate_delay_loop(); |
221 | i8254_calibrate_delay_loop(); |
| Line 244... | Line 247... | ||
| 244 | * |
247 | * |
| 245 | */ |
248 | */ |
| 246 | void arch_grab_console(void) |
249 | void arch_grab_console(void) |
| 247 | { |
250 | { |
| 248 | #ifdef CONFIG_FB |
251 | #ifdef CONFIG_FB |
| - | 252 | if (vesa_present()) |
|
| 249 | vesa_redraw(); |
253 | vesa_redraw(); |
| - | 254 | else |
|
| - | 255 | #endif |
|
| - | 256 | #ifdef CONFIG_EGA |
|
| - | 257 | ega_redraw(); |
|
| 250 | #else |
258 | #else |
| 251 | ega_redraw(); |
259 | {} |
| 252 | #endif |
260 | #endif |
| 253 | } |
261 | } |
| 254 | 262 | ||
| 255 | /** Return console to userspace |
263 | /** Return console to userspace |
| 256 | * |
264 | * |