summaryrefslogtreecommitdiff
path: root/main.ha
diff options
context:
space:
mode:
authorAlejandro Sior <aho@sior.be>2022-05-19 08:45:26 +0200
committerAlejandro Sior <aho@sior.be>2022-05-19 08:45:26 +0200
commit776a3710652f78b44718450406d0683974aef72a (patch)
tree84f1b70e07b831d13db8c53c0ab0030ec0d85c09 /main.ha
parente50cbe8eb763cf63fb44b047d5164f6fbf07eb39 (diff)
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
Diffstat (limited to 'main.ha')
-rw-r--r--main.ha17
1 files changed, 9 insertions, 8 deletions
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);
};