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