Mine...if it helps
Code:
[BITS 32]
global start
start:
mov esp, stack ; Sets up stack
jmp kernelboot
ALIGN 4
.mboot:
; Multiboot macros to make a few lines later more readable
MULTIBOOT_PAGE_ALIGN equ 1<<0
MULTIBOOT_MEMORY_INFO equ 1<<1
MULTIBOOT_AOUT_KLUDGE equ 1<<16
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
EXTERN _code, _bss, _end
; This is the GRUB Multiboot header. A boot signature
dd MULTIBOOT_HEADER_MAGIC
dd MULTIBOOT_HEADER_FLAGS
dd MULTIBOOT_CHECKSUM
; AOUT kludge - must be physical addresses. Make a note of these:
; The linker script fills in the data for these ones!
dd .mboot
dd _code
dd _bss
dd _end
dd start
kernelboot:
push eax ; Passes the grub info to kernel.c
push ebx
extern kmain
call kmain ; Call kernel.c
cli ; stop interrupts
jmp $
; Looks like bochs doesn't like a hlt instruction with IF=0
;hlt ; stops CPU and we're dead in the water.
global idt_load
extern idtr
idt_load:
lidt [idtr]
ret
; Stack
SECTION .bss
resb 8192
stack: