Subversion Repositories HelenOS

Rev

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 <ddi/irq.h>
63
#include <ddi/irq.h>
64
#include <arch/debugger.h>
64
#include <arch/debugger.h>
65
#include <proc/thread.h>
65
#include <proc/thread.h>
66
#include <syscall/syscall.h>
66
#include <syscall/syscall.h>
67
#include <console/console.h>
67
#include <console/console.h>
68
#include <ddi/device.h>
-
 
69
#include <sysinfo/sysinfo.h>
68
#include <sysinfo/sysinfo.h>
70
#include <arch/boot/boot.h>
69
#include <arch/boot/boot.h>
71
 
70
 
72
#ifdef CONFIG_SMP
71
#ifdef CONFIG_SMP
73
#include <arch/smp/apic.h>
72
#include <arch/smp/apic.h>
Line 109... Line 108...
109
        /* Initialize IRQ routing */
108
        /* Initialize IRQ routing */
110
        irq_init(IRQ_COUNT, IRQ_COUNT);
109
        irq_init(IRQ_COUNT, IRQ_COUNT);
111
       
110
       
112
        /* hard clock */
111
        /* hard clock */
113
        i8254_init();
112
        i8254_init();
114
 
113
       
115
#ifdef CONFIG_FB
114
#ifdef CONFIG_FB
116
        if (vesa_present())
115
        if (vesa_present())
117
            vesa_init();
116
            vesa_init();
118
        else
117
        else
119
#endif
118
#endif
-
 
119
#ifdef CONFIG_EGA
120
            ega_init(EGA_BASE, EGA_VIDEORAM);   /* video */
120
            ega_init(EGA_BASE, EGA_VIDEORAM);  /* video */
-
 
121
#else
-
 
122
            {}
-
 
123
#endif
121
       
124
       
122
        /* Enable debugger */
125
        /* Enable debugger */
123
        debugger_init();
126
        debugger_init();
124
        /* Merge all memory zones to 1 big zone */
127
        /* Merge all memory zones to 1 big zone */
125
        zone_merge_all();
128
        zone_merge_all();
Line 145... Line 148...
145
    }
148
    }
146
}
149
}
147
 
150
 
148
void arch_post_smp_init(void)
151
void arch_post_smp_init(void)
149
{
152
{
150
    devno_t devno = device_assign_devno();
153
#ifdef CONFIG_PC_KBD
151
 
-
 
152
    /*
154
    /*
153
     * Initialize the keyboard module and conect it to stdin. Then
-
 
154
     * initialize the i8042 controller and connect it to kbrdin. Enable
155
     * Initialize the i8042 controller. Then initialize the keyboard
155
     * keyboard interrupts.
156
     * module and connect it to i8042. Enable keyboard interrupts.
156
     */
157
     */
-
 
158
    indev_t *kbrdin = i8042_init((i8042_t *) I8042_BASE, IRQ_KBD);
-
 
159
    if (kbrdin) {
157
    kbrd_init(stdin);
160
        kbrd_init(kbrdin);
158
    (void) i8042_init((i8042_t *) I8042_BASE, devno, IRQ_KBD, &kbrdin);
-
 
159
    trap_virtual_enable_irqs(1 << IRQ_KBD);
161
        trap_virtual_enable_irqs(1 << IRQ_KBD);
-
 
162
    }
160
 
163
   
161
    /*
164
    /*
162
     * This is the necessary evil until the userspace driver is entirely
165
     * This is the necessary evil until the userspace driver is entirely
163
     * self-sufficient.
166
     * self-sufficient.
164
     */
167
     */
165
    sysinfo_set_item_val("kbd", NULL, true);
168
    sysinfo_set_item_val("kbd", NULL, true);
166
    sysinfo_set_item_val("kbd.devno", NULL, devno);
-
 
167
    sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
169
    sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
168
    sysinfo_set_item_val("kbd.address.physical", NULL,
170
    sysinfo_set_item_val("kbd.address.physical", NULL,
169
        (uintptr_t) I8042_BASE);
171
        (uintptr_t) I8042_BASE);
170
    sysinfo_set_item_val("kbd.address.kernel", NULL,
172
    sysinfo_set_item_val("kbd.address.kernel", NULL,
171
        (uintptr_t) I8042_BASE);
173
        (uintptr_t) I8042_BASE);
-
 
174
#endif
172
}
175
}
173
 
176
 
174
void calibrate_delay_loop(void)
177
void calibrate_delay_loop(void)
175
{
178
{
176
    i8254_calibrate_delay_loop();
179
    i8254_calibrate_delay_loop();
Line 200... Line 203...
200
 *
203
 *
201
 */
204
 */
202
void arch_grab_console(void)
205
void arch_grab_console(void)
203
{
206
{
204
#ifdef CONFIG_FB
207
#ifdef CONFIG_FB
-
 
208
    if (vesa_present())
205
    vesa_redraw();
209
        vesa_redraw();
-
 
210
    else
-
 
211
#endif
-
 
212
#ifdef CONFIG_EGA
-
 
213
        ega_redraw();
206
#else
214
#else
207
    ega_redraw();
215
        {}
208
#endif
216
#endif
209
}
217
}
210
 
218
 
211
/** Return console to userspace
219
/** Return console to userspace
212
 *
220
 *