From 776a3710652f78b44718450406d0683974aef72a Mon Sep 17 00:00:00 2001 From: Alejandro Sior Date: Thu, 19 May 2022 08:45:26 +0200 Subject: bios: stub calls interrupt number; simplified bios.ha main interface Instead of having the bios.call stub calling a function, make it directly call an interrupt that is changed dynamically by modifying the code at runtime. Simplify the bios.ha interface and document it. Next up: implementing a high level drive interface for the BIOS using BIOS interrupts --- main.ha | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'main.ha') diff --git a/main.ha b/main.ha index edd4607..e5b2e7c 100644 --- a/main.ha +++ b/main.ha @@ -1,22 +1,23 @@ use vga; use term; use rt; -use real; +use bios; +use bios::drive; +use drive; 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!"); + term::print(&text, "hello hare world!\n"); 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); + bios::regs.eax = 6 << 8 | 1; + bios::regs.ebx = 0x43 << 8; + bios::regs.ecx = 0; + bios::regs.edx = 5 << 8 | 5; + bios::call(0x10); }; -- cgit v1.2.3