From e50cbe8eb763cf63fb44b047d5164f6fbf07eb39 Mon Sep 17 00:00:00 2001 From: Alejandro Sior Date: Fri, 13 May 2022 20:50:39 +0200 Subject: boot: longmode to realmode stub This is the initial commit to the repo. It adds all the code. The last proper thing that I got working before committing is calling real mode functions from long mode using a stub. Next up, I would like to implement a disk reader abstraction over the BIOS in order to read form partitions (most notably FAT32). --- run.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 run.sh (limited to 'run.sh') diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..0e136e4 --- /dev/null +++ b/run.sh @@ -0,0 +1,22 @@ +#!/bin/sh -e + +# :Tell hare to use our custom runtime +# and linker scripts (this feature is so simple and neat :)) +export HAREPATH=. + +# :Tell the linker to add this argument to discard +# unused sections +export LDFLAGS="--gc-sections" + +# :Do the build +hare build -X^ -T+x86_64 + +# :Create a flat binary out of the elf file +# (while also removing the breaking gnu note) +objcopy \ + --remove-section .note.gnu.property \ + -I elf64-x86-64 -O binary \ + --binary-architecture=i386:x86-64 \ + boot boot.bin + +bochs -- cgit v1.2.3