Created
February 28, 2011 04:05
-
-
Save ldunn/846922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global loader | |
extern kmain | |
; Multiboot! | |
MODULEALIGN equ 1<<0 | |
MEMINFO equ 1<<1 | |
FLAGS equ MODULEALIGN | MEMINFO | |
MAGIC equ 0x1BADB002 | |
CHECKSUM equ -(MAGIC + FLAGS) | |
section .mbheader | |
align 4 | |
MultiBootHeader: | |
dd MAGIC | |
dd FLAGS | |
dd CHECKSUM | |
section .text | |
; 16k stack | |
STACKSIZE equ 0x4000 | |
loader: | |
mov esp, stack+STACKSIZE | |
push eax | |
push ebx | |
call kmain | |
cli | |
hang: | |
hlt | |
jmp hang | |
section .bss | |
align 4 | |
stack: | |
resb STACKSIZE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment