diff --git a/src/platform/amd64/cpu.zig b/src/platform/amd64/cpu.zig index d6f09c5..1359f15 100644 --- a/src/platform/amd64/cpu.zig +++ b/src/platform/amd64/cpu.zig @@ -320,6 +320,7 @@ pub const CpuFeatures = struct { pcid: bool, smap: bool, smep: bool, + pge: bool, vendor_string: [12]u8, brand_string: [48]u8, }; @@ -343,6 +344,7 @@ pub fn detect_cpu_features() void { var pcid = false; var smap = false; var smep = false; + var pge = false; var vendor_string: [12]u8 = undefined; var brand_string: [48]u8 = undefined; @@ -361,6 +363,7 @@ pub fn detect_cpu_features() void { xsave = ecx.xsave; pcid = ecx.pcid; fxsave = edx.fxsave; + pge = edx.pge; } if (max_basic >= 0x7) { @@ -416,5 +419,6 @@ pub fn detect_cpu_features() void { .smep = smep, .vendor_string = vendor_string, .brand_string = brand_string, + .pge = pge, }; } diff --git a/src/platform/amd64/impl.zig b/src/platform/amd64/impl.zig index 1956a05..b173e99 100644 --- a/src/platform/amd64/impl.zig +++ b/src/platform/amd64/impl.zig @@ -7,7 +7,7 @@ pub const name = "amd64"; const com1 = 0x3F8; -fn com1_init() void { +fn com1_init() linksection(b.init) void { cpu.outb(com1 + 0x3, 0x80); cpu.outb(com1 + 0x0, 0x0c); cpu.outb(com1 + 0x1, 0x00); @@ -44,12 +44,13 @@ pub fn early_init() linksection(b.init) void { const f = cpu.cpu_features; std.log.info("amd64/cpu: {s}", .{&f.brand_string}); - std.log.info("amd64/cpu: vendor={s} x2apic={} la57={} nx={} pcid={} smap={} smep={} pdpe1g={} invtsc={} xsave={} fxsave={} tsc-deadline={}", .{ + std.log.info("amd64/cpu: vendor={s} x2apic={} la57={} nx={} pcid={} pge={} smap={} smep={} pdpe1g={} invtsc={} xsave={} fxsave={} tsc-deadline={}", .{ &f.vendor_string, @intFromBool(f.x2apic), @intFromBool(f.five_level_paging), @intFromBool(f.nx), @intFromBool(f.pcid), + @intFromBool(f.pge), @intFromBool(f.smap), @intFromBool(f.smep), @intFromBool(f.gib_pages),