]>
wirehaze git hosting - BOS.git/blob - kernel/kernel.asm
1 ;-------------------------------------------------------;
3 ;-------------------------------------------------------;
4 ; BOS 32-bit kernel, expects to be loaded at 32kb ;
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-2015 ;
11 ;-------------------------------------------------------;
15 ;---------------------------;
16 ; jump to starting point ;
17 ;---------------------------;
20 ;----------------------------------------;
21 ; 16-bit include files ;
22 ;----------------------------------------;
23 include '16bit/a20.asm' ; Function to set the a20-gate.
24 include '16bit/gdt.asm' ; Global Description Table.
25 include '16bit/idt.asm' ; The Interrupt Description Table.
26 include '16bit/mem.asm' ; Get memory size.
27 include '16bit/variables.asm' ; For/from realmode.
28 include '16bit/init16bit.asm' ; 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 init16bit
; ... :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 'int/idt.asm' ; The Interrupt Description Table.
99 include 'vga/text.asm' ; The default textmode functions.
100 include 'init/init32b.asm' ; Function that starts up BOS
101 include 'vars/strings.asm' ; All strings in english (soon).
102 include 'init/bios.asm' ; Get back to realmode and do an INT.
103 include 'init/pic.asm' ; PIC rutines.
104 include 'system/services.asm' ; System service handler (int 0x32).
105 include 'kbd/keyboard.asm' ; Keyboard ISR.
106 include 'kbd/keymap.asm' ; Keymap(s).
107 include 'shell/shell.asm' ; File with shell/kernel monitor functions.
108 include 'shell/commands.asm' ; Command table, for valid shell commands.
109 include 'int/isr.asm' ; Interrupt Service Rutines.
110 include 'int/debug.asm' ; Print contents of all regs and hang.
111 include 'init/cmos.asm' ; To get CMOS data.
112 include 'shell/clock.asm' ; Print time and date.
113 include 'init/timer.asm' ; Timer IRQ.
114 include 'vga/vga.asm' ; VGA functions.
115 ; include 'vga/font8x16.asm' ; Standard font.
116 include 'fdc/dma.asm' ; DMA code.
117 include 'fdc/fdc.asm' ; Floppy code.
118 include 'vga/mario.asm' ; Mario sprite.
119 include 'sound/speaker.asm' ; PC speaker.
120 include 'ram/mem.asm' ; Memory allocation and freeing.
121 include 'vfs/parse.asm' ; Path parser for VFS functions.