summaryrefslogtreecommitdiff
path: root/main.ha
blob: d13242a2d48287c5f5236cdba02e6729ce9a3400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use vga;
use term;
use rt;
use bios;
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!\n");
	for (let i = 0z; i < 10; i += 1) {
		term::print(&text, "a");
	};

	let dest = 0x100000: uintptr: *[*]u8;
	//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");
	};
};