]> wirehaze git hosting - BOS.git/blob - kernel/krl_incs/bos_init.inc

wirehaze git hosting

73e1354510ae12e80ca9c1ef0baddb1e77338e91
[BOS.git] / kernel / krl_incs / bos_init.inc
1 ;----------------------------------------------------------;
2 ; BOS kernel Christoffer Bubach, 2003-2005. ;
3 ;----------------------------------------------------------;
4 ; ;
5 ; Initiation function for BOS ;
6 ; ;
7 ;----------------------------------------------------------;
8
9
10 bos_init:
11
12 ;----------------------;
13 ; we are in pmode.. ;
14 ;----------------------;
15 mov bx, 0x0193
16 call setcursor
17 mov esi, pmode_load
18 mov bl, 0x07
19 call print
20
21 mov bx, 0x01C5
22 call setcursor
23 mov esi, pmode_load_ok
24 mov bl, 0x02
25 call print
26
27 ;----------------------;
28 ; kernel loaded.. ;
29 ;----------------------;
30 mov bx, 0x01E3
31 call setcursor
32 mov esi, kernel_load
33 mov bl, 0x07
34 call print
35
36 mov bx, 0x0215
37 call setcursor
38 mov esi, kernel_load_ok
39 mov bl, 0x02
40 call print
41
42 ;----------------;
43 ; remap PICs ;
44 ;----------------;
45 mov cl, 0x20 ; PIC 1, irq0-irq7 -> int 0x20-27.
46 mov ch, 0x28 ; PIC 2, irq8-irq15 -> int 0x28-30.
47 call remap_pics
48 call disable_irqs
49
50 mov bx, 0x0233
51 call setcursor
52 mov esi, pic_irq
53 mov bl, 0x07
54 call print
55
56 mov bx, 0x0265
57 call setcursor
58 mov esi, pic_irq_ok
59 mov bl, 0x02
60 call print
61
62 ;--------------;
63 ; setup IDT ;
64 ;--------------;
65 mov edi, u_isr ; isr.inc
66 call init_idt ; idt.inc
67 mov esi, idt_list ; idt.inc
68 call set_idt_list ; idt.inc
69
70 sti ; Interrupts back..
71
72 mov bx, 0x0283
73 call setcursor
74 mov esi, idt_mess
75 mov bl, 0x07
76 call print
77
78 mov bx, 0x02B5
79 call setcursor
80 mov esi, idt_ok
81 mov bl, 0x02
82 call print
83
84
85 ;---------------------------------------------;
86 ; enable IRQs (one after one as i code it) ;
87 ;---------------------------------------------;
88 mov cl, 1
89 call enable_irq ; Enable IRQ 1.
90
91 mov bx, 0x02D3
92 call setcursor
93 mov esi, kbd_load
94 mov bl, 0x07
95 call print
96
97 mov bx, 0x0305
98 call setcursor
99 mov esi, kbd_ok
100 mov bl, 0x02
101 call print
102
103 ;------------------------------------;
104 ; get CMOS data, set PIT to 100Hz ;
105 ; and start timer. ;
106 ;------------------------------------;
107 call get_cmos_data ; cmos.inc
108 call set_pit_freq ; timer.inc
109 mov cl, 0
110 call enable_irq ; Enable IRQ 0.
111
112 ;-------------------;
113 ; init simple MM ;
114 ;-------------------;
115 mov ebx, 0x100000 ; address of first free
116 mov ecx, [ram_amount] ; RAM. everything before
117 call init_mem ; that is reserved.
118
119 ;--------------------;
120 ; init fdc driver ;
121 ;--------------------;
122 call fdc_init ; fdc.inc
123
124
125 ;-------------------------;
126 ; return to kernel.asm ;
127 ;-------------------------;
128 ret