Created
October 6, 2020 12:27
-
-
Save Fighter19/634078a65a8c10cd94463d4f616f0dfe to your computer and use it in GitHub Desktop.
This is a simple "Hello World" application for BIOS development.
This file contains hidden or 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
.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