Check CPUID info, switch cpu flag to Broadwell

This commit is contained in:
Justin C. Miller
2018-04-29 23:50:56 -07:00
parent 99222d8ab9
commit 2d4e7cfdee
4 changed files with 117 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
#include "kutil/memory.h"
#include "console.h"
#include "cpu.h"
#include "device_manager.h"
#include "font.h"
#include "interrupts.h"
@@ -48,6 +49,18 @@ kernel_main(popcorn_data *header)
log::init(cons);
cpu_id cpu;
log::info(logs::boot, "CPU Vendor: %s", cpu.vendor_id());
log::info(logs::boot, "CPU Family %x Model %x Stepping %x",
cpu.family(), cpu.model(), cpu.stepping());
cpu_id::regs cpu_info = cpu.get(1);
log::info(logs::boot, "LAPIC Supported: %s",
cpu_info.edx_bit(9) ? "yes" : "no");
log::info(logs::boot, "x2APIC Supported: %s",
cpu_info.ecx_bit(21) ? "yes" : "no");
page_manager *pager = new (&g_page_manager) page_manager;
pager->mark_offset_pointer(&header->frame_buffer, header->frame_buffer_length);