Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; File: kernel.asm
- ; Assemble and link to a Mulitboot ELF executable using:
- ; nasm -felf32 kernel.asm -o kernel.o
- ; ld -Ttext=0x100000 -melf_i386 kernel.o -o kernel.elf
- ;
- ; Run in QEMU with:
- ; qemu-system-i386 -kernel kernel.elf
- bits 32
- global _start
- MB1_MAGIC equ 0x1badb002
- MB1_FLAGS equ 0x0
- MB1_CHECKSUM equ -MB1_MAGIC
- section .text
- align 4
- dd MB1_MAGIC
- dd MB1_FLAGS
- dd MB1_CHECKSUM
- _start:
- ; Insert code here
- mov dword [0xb8000], 0x2f4b2f4f
- ; End with infinite loop
- cli
- hltloop:
- hlt
- jmp hltloop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement