]>
wirehaze git hosting - BOS.git/blob - kernel/kernel.asm
1 ;-------------------------------------------------------;
3 ;-------------------------------------------------------;
4 ; BOS 32-bit kernel, expects to be loaded at 64kb ;
5 ; in mem. Small amount of 16-bit code included. ;
7 ; For any comments on this code, mail me. ;
8 ; http://bos.asmhackers.net/ asmhacker@gmail.com ;
10 ; by: Christoffer Bubach, 2003-2005 ;
11 ;-------------------------------------------------------;
15 ;---------------------------;
16 ; jump to starting point ;
17 ;---------------------------;
20 ;----------------------------------------;
21 ; 16-bit include files ;
22 ;----------------------------------------;
23 include 'realmode/a20.inc' ; Function to set the a20-gate.
24 include 'realmode/gdt.inc' ; Global Description Table.
25 include 'realmode/idt.inc' ; The Interrupt Description Table.
26 include 'realmode/mem.inc' ; Get memory size.
27 include 'realmode/variables.inc' ; For/from realmode.
28 include 'realmode/do_all_16bit.inc' ; Save "go back to 16-bit"-info.
32 ;--------------------------;
33 ; 16-bit entry point ;
34 ;--------------------------;
39 ; fasm is more strict about
40 xor eax, eax ; "org 0x10000" then nasm, so
41 mov es, ax ; i have to do -0x10000 from
42 mov fs, ax ; all variable addresses while
43 mov gs, ax ; in realmode.
47 call do_all_16bit
; ... :P
51 mov [realmode_cs
], ax ; in variables.inc
53 lgdt [gdtr
] ; Load the GDT descriptor
54 lidt [idtr
] ; Load the IDT descriptor
60 jmp pword 0x08:flush
; dword in nasm
64 ;--------------------------;
65 ; 32-bit entry point ;
66 ;--------------------------;
69 mov ax, 0x10 ; refresh all segment registers
77 call bos_init
; fix everything
79 mov bx, 0x04B1 ; start the shell
92 jmp .hang
; hang, just in case..
95 ;----------------------------------------;
96 ; 32-bit include files ;
97 ;----------------------------------------;
98 include 'krl_incs/idt.inc' ; The Interrupt Description Table.
99 include 'krl_incs/text.inc' ; The default textmode functions.
100 include 'krl_incs/bos_init.inc' ; Function that starts up BOS
101 include 'krl_incs/en_mess.inc' ; All strings in english (soon).
102 include 'krl_incs/rmode_int.inc' ; Get back to realmode and do an INT.
103 include 'krl_incs/pic.inc' ; PIC rutines.
104 include 'krl_incs/sys_ints.inc' ; System specific interrupts.
105 include 'krl_incs/keyboard.inc' ; Keyboard ISR.
106 include 'krl_incs/keymap.inc' ; Keymap(s).
107 include 'krl_incs/shell.inc' ; File with shell/kernel monitor functions.
108 include 'krl_incs/commands.inc' ; Command table, for valid shell commands.
109 include 'krl_incs/isr.inc' ; Interrupt Service Rutines.
110 include 'krl_incs/debug.inc' ; Print contents of all regs and hang.
111 include 'krl_incs/cmos.inc' ; To get CMOS data.
112 include 'krl_incs/time_date.inc' ; Print time and date.
113 include 'krl_incs/timer.inc' ; Timer IRQ.
114 include 'krl_incs/vga.inc' ; VGA functions.
115 ; include 'krl_incs/font8x16.inc' ; Standard font.
116 include 'krl_incs/dma.inc' ; DMA code.
117 include 'krl_incs/fdc.inc' ; Floppy code.
118 include 'krl_incs/mario.inc' ; Mario sprite.
119 include 'krl_incs/pc_speaker.inc' ; PC speaker.
120 include 'krl_incs/mem.inc' ; Memory allocation and freeing.