Subversion Repositories HelenOS

Rev

Rev 4345 | Rev 4347 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4345 Rev 4346
Line 41... Line 41...
41
#include <proc/thread.h>
41
#include <proc/thread.h>
42
#include <genarch/multiboot/multiboot.h>
42
#include <genarch/multiboot/multiboot.h>
43
#include <genarch/drivers/legacy/ia32/io.h>
43
#include <genarch/drivers/legacy/ia32/io.h>
44
#include <genarch/drivers/ega/ega.h>
44
#include <genarch/drivers/ega/ega.h>
45
#include <arch/drivers/vesa.h>
45
#include <arch/drivers/vesa.h>
-
 
46
#include <genarch/drivers/i8042/i8042.h>
46
#include <genarch/kbd/i8042.h>
47
#include <genarch/kbrd/kbrd.h>
47
#include <arch/drivers/i8254.h>
48
#include <arch/drivers/i8254.h>
48
#include <arch/drivers/i8259.h>
49
#include <arch/drivers/i8259.h>
49
#include <arch/boot/boot.h>
50
#include <arch/boot/boot.h>
50
 
51
 
51
#ifdef CONFIG_SMP
52
#ifdef CONFIG_SMP
Line 147... Line 148...
147
        /* Initialize IRQ routing */
148
        /* Initialize IRQ routing */
148
        irq_init(IRQ_COUNT, IRQ_COUNT);
149
        irq_init(IRQ_COUNT, IRQ_COUNT);
149
       
150
       
150
        /* hard clock */
151
        /* hard clock */
151
        i8254_init();
152
        i8254_init();
152
               
153
       
153
#ifdef CONFIG_FB
154
#ifdef CONFIG_FB
154
        if (vesa_present())
155
        if (vesa_present())
155
            vesa_init();
156
            vesa_init();
156
        else
157
        else
157
#endif
158
#endif
-
 
159
#ifdef CONFIG_EGA
158
            ega_init(EGA_BASE, EGA_VIDEORAM);   /* video */
160
            ega_init(EGA_BASE, EGA_VIDEORAM);  /* video */
-
 
161
#else
-
 
162
            {}
-
 
163
#endif
159
       
164
       
160
        /* Enable debugger */
165
        /* Enable debugger */
161
        debugger_init();
166
        debugger_init();
162
        /* Merge all memory zones to 1 big zone */
167
        /* Merge all memory zones to 1 big zone */
163
        zone_merge_all();
168
        zone_merge_all();
Line 186... Line 191...
186
    }
191
    }
187
}
192
}
188
 
193
 
189
void arch_post_smp_init(void)
194
void arch_post_smp_init(void)
190
{
195
{
-
 
196
#ifdef CONFIG_PC_KBD
191
    devno_t devno = device_assign_devno();
197
    devno_t devno = device_assign_devno();
-
 
198
   
-
 
199
    /*
192
    /* keyboard controller */
200
     * Initialize the i8042 controller. Then initialize the keyboard
-
 
201
     * module and connect it to i8042. Enable keyboard interrupts.
-
 
202
     */
193
    (void) i8042_init((i8042_t *) I8042_BASE, devno, IRQ_KBD);
203
    indev_t *kbrdin = i8042_init((i8042_t *) I8042_BASE, devno, IRQ_KBD);
-
 
204
    if (kbrdin) {
-
 
205
        kbrd_init(kbrdin);
-
 
206
        trap_virtual_enable_irqs(1 << IRQ_KBD);
-
 
207
    }
194
 
208
   
195
    /*
209
    /*
196
     * This is the necessary evil until the userspace driver is entirely
210
     * This is the necessary evil until the userspace driver is entirely
197
     * self-sufficient.
211
     * self-sufficient.
198
     */
212
     */
199
    sysinfo_set_item_val("kbd", NULL, true);
213
    sysinfo_set_item_val("kbd", NULL, true);
Line 201... Line 215...
201
    sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
215
    sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
202
    sysinfo_set_item_val("kbd.address.physical", NULL,
216
    sysinfo_set_item_val("kbd.address.physical", NULL,
203
        (uintptr_t) I8042_BASE);
217
        (uintptr_t) I8042_BASE);
204
    sysinfo_set_item_val("kbd.address.kernel", NULL,
218
    sysinfo_set_item_val("kbd.address.kernel", NULL,
205
        (uintptr_t) I8042_BASE);
219
        (uintptr_t) I8042_BASE);
-
 
220
#endif
206
}
221
}
207
 
222
 
208
void calibrate_delay_loop(void)
223
void calibrate_delay_loop(void)
209
{
224
{
210
    i8254_calibrate_delay_loop();
225
    i8254_calibrate_delay_loop();
Line 236... Line 251...
236
 *
251
 *
237
 */
252
 */
238
void arch_grab_console(void)
253
void arch_grab_console(void)
239
{
254
{
240
#ifdef CONFIG_FB
255
#ifdef CONFIG_FB
-
 
256
    if (vesa_present())
241
    vesa_redraw();
257
        vesa_redraw();
-
 
258
    else
-
 
259
#endif
-
 
260
#ifdef CONFIG_EGA
-
 
261
        ega_redraw();
242
#else
262
#else
243
    ega_redraw();
263
        {}
244
#endif
264
#endif
245
}
265
}
246
 
266
 
247
/** Return console to userspace
267
/** Return console to userspace
248
 *
268
 *