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). --- main.ha | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 main.ha (limited to 'main.ha') diff --git a/main.ha b/main.ha new file mode 100644 index 0000000..edd4607 --- /dev/null +++ b/main.ha @@ -0,0 +1,22 @@ +use vga; +use term; +use rt; +use real; + +export fn main() void = { + let text = vga::attach(0xb8000, 80, 25); + term::clear(&text); + term::setcolors(&text, (term::color::LMAGENTA, term::color::BLACK)); + + term::print(&text, "hello hare world!"); + for (let i = 0z; i < 10; i += 1) { + term::print(&text, "a"); + for (let j = 0z; j < 10000000; j += 1) { + yield; + }; + }; + + real::regs.edi = 0; + real::regs.esi = 0x7c00; + real::call((&real::testt): uintptr: u16); +}; -- cgit v1.2.3