summaryrefslogtreecommitdiff
path: root/main.ha
diff options
context:
space:
mode:
authorAlejandro Sior <aho@sior.be>2022-06-18 10:39:10 +0200
committerAlejandro Sior <aho@sior.be>2022-06-18 10:39:10 +0200
commitbd98b26786d21ffddb017ffe35ecaa4a9fd0aa4a (patch)
tree1b78a43385bf0751abab8dd2423905696fd5baab /main.ha
parent3aefeeb723b8822916fb39b7c32551c35c06e32f (diff)
boot: arbitrary location of stage 1 and identity map more memoryHEADmaster
Diffstat (limited to 'main.ha')
-rw-r--r--main.ha17
1 files changed, 14 insertions, 3 deletions
diff --git a/main.ha b/main.ha
index e640d04..d13242a 100644
--- a/main.ha
+++ b/main.ha
@@ -15,8 +15,19 @@ export fn main() void = {
};
let dest = 0x100000: uintptr: *[*]u8;
- drive::read(0, 512, dest)!;
- if (dest[511] == 0xaa) {
- term::print(&text, "\nnice!");
+ //drive::read(0, 512, dest)!;
+ //if (dest[511] == 0xaa) {
+ // term::print(&text, "\nnice!");
+ //};
+
+ let pd: *[512]u64 = (0x1000): uintptr: *[512]u64;
+ pd[511] = 0x1000 | 0x3 | 1 << 6;
+
+ // let wtf: u64 = 0o777;
+
+ let lvl4: u64 = 0o177777 << 48 | 511 << 39 | 511 << 30 | 511 << 21 | 511 << 12 | 0x0;
+ let p4: *u64 = lvl4: uintptr: *u64;
+ if (*p4 >> 12 == 0x2) {
+ term::print(&text, "poggers\n");
};
};