Skip to content

Instantly share code, notes, and snippets.

@Fighter19
Created October 6, 2020 12:27
Show Gist options
  • Save Fighter19/634078a65a8c10cd94463d4f616f0dfe to your computer and use it in GitHub Desktop.
Save Fighter19/634078a65a8c10cd94463d4f616f0dfe to your computer and use it in GitHub Desktop.
This is a simple "Hello World" application for BIOS development.
.code16
.text
/*
This is a simple "Hello World" application for BIOS development.
This code prints the ASCII character 'A' on the serial interface at 0x3f8
Compile with:
i386-elf-as -o bioshello.o bioshello.s
i386-elf-ld -o bios-256k.elf -T ldscript.ld bioshello.o
objcopy -O binary bios-256k.elf bios-256k.bin
And test in QEMU with:
qemu-system-i386 -M isapc -bios bios-256k.bin -d in_asm -vga std -serial stdio
Disassemble with:
i386-elf-objdump -mi386 -Maddr16,data16 -D bios-256k.elf
LD Script contains:
SECTIONS {
. = 0x0;
.text : { *(.text) }
}
*/
.org 0xa000
entryPoint:
mov $0x41, %al
mov $0x3f8, %dx
out %al,(%dx)
jmp entryPoint
.org 0xfff0
actualEp:
ljmp $0xf000,$entryPoint
.ascii "10/06/20"
.byte 0x0
.byte 0x0
.byte 0x0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment