Skip to content

Instantly share code, notes, and snippets.

@ldunn
Created February 28, 2011 04:05
Show Gist options
  • Save ldunn/846922 to your computer and use it in GitHub Desktop.
Save ldunn/846922 to your computer and use it in GitHub Desktop.
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