blob: c71ef40cde0d57aff8722e5cb6ff29e080ea4e10 [file] [log] [blame]
swissChilid8137922021-02-17 15:34:07 -08001;;; GRUB Multiboot header, calls main() in main.c
2
3MBOOT_PAGE_ALIGN equ 1<<0
4MBOOT_MEM_INFO equ 1<<1
5MBOOT_HEADER_MAGIC equ 0x1BADB002
6
7MBOOT_HEADER_FLAGS equ MBOOT_PAGE_ALIGN | MBOOT_MEM_INFO
8MBOOT_CHECKSUM equ -(MBOOT_HEADER_MAGIC + MBOOT_HEADER_FLAGS)
9
10
11 [bits 32]
12
13 [global mboot]
14 [extern code]
15 [extern bss]
16 [extern end]
17
18mboot:
19 dd MBOOT_HEADER_MAGIC ; This tells GRUB to start executing here:
20 dd MBOOT_HEADER_FLAGS
21 dd MBOOT_CHECKSUM
22
23 dd mboot ; Current location
24 dd code ; .text section
25 dd bss ; End of .data
26 dd end ; End of kernel
27 dd start
28
29 [global start]
swissChili0b35bf22021-02-18 12:49:40 -080030 [extern kmain] ; C code
swissChilid8137922021-02-17 15:34:07 -080031
32start:
33 push ebx ; Holds multiboot header location
34
35 cli
swissChili0b35bf22021-02-18 12:49:40 -080036 call kmain
swissChilid8137922021-02-17 15:34:07 -080037 jmp $