diff options
| author | Alejandro Sior <aho@sior.be> | 2022-05-13 20:50:39 +0200 |
|---|---|---|
| committer | Alejandro Sior <aho@sior.be> | 2022-05-13 20:50:39 +0200 |
| commit | e50cbe8eb763cf63fb44b047d5164f6fbf07eb39 (patch) | |
| tree | 8acb610a4f33462c843f54016861780ffadc010d /real/real.ha | |
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).
Diffstat (limited to 'real/real.ha')
| -rw-r--r-- | real/real.ha | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/real/real.ha b/real/real.ha new file mode 100644 index 0000000..ee42523 --- /dev/null +++ b/real/real.ha @@ -0,0 +1,22 @@ +export type state = struct { + @offset(0) eax: u32, + @offset(4) ebx: u32, + @offset(8) ecx: u32, + @offset(12) edx: u32, + @offset(16) edi: u32, + @offset(20) esi: u32 +}; + +export let regs: state; + + +export fn clearregs() void = { + regs = state { + ... + }; +}; + +export @symbol("real.call") fn call(addr: u16) void; + +export @symbol("testt") fn testt() void; +export @symbol("drive_read_lba") fn drive_read_lba() void; |
