add arch-specific stuff safely

This commit is contained in:
Quinten Kock 2020-12-26 23:24:33 +01:00
parent ab2ef5a415
commit 0d10e698da
1 changed files with 8 additions and 7 deletions

View File

@ -56,14 +56,15 @@ export fn zigmain() void {
const msg = std.fmt.allocPrint(alloc, "Hello {}!", .{"ziguser"});
std.log.debug("message: {}", .{msg});
// var cr3: usize = asm volatile (
// "mov %%cr3, %%rax" : [cr3] "={rax}" (-> usize) ::
// );
// std.log.info("cr3 = {x}", .{cr3});
if(@hasDecl(arch, "paging")) {
arch.paging.showActive();
arch.paging.activate();
}
// const page_lvl4 = @intToPtr(*[512]u64, cr3);
// arch.paging.showTable(page_lvl4.*);
if(@hasDecl(arch, "cpuid")) {
_ = arch.cpuid.getVendor();
_ = arch.cpuid.getName();
}
// time.displayTime(debug.AWriter) catch unreachable;