From bd98b26786d21ffddb017ffe35ecaa4a9fd0aa4a Mon Sep 17 00:00:00 2001 From: Alejandro Sior Date: Sat, 18 Jun 2022 10:39:10 +0200 Subject: boot: arbitrary location of stage 1 and identity map more memory --- main.ha | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'main.ha') 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"); }; }; -- cgit v1.2.3