Il va se passer quoi si j'ajoute ce code à mon os? #define IA32APICBASEMSR 0x1B #define…
- User
Il va se passer quoi si j'ajoute ce code à mon os? #define IA32_APIC_BASE_MSR 0x1B #define IA32_APIC_BASE_MSR_BSP 0x100 // Processor is a BSP #define IA32_APIC_BASE_MSR_ENABLE 0x800
/** returns a 'true' value if the CPU supports APIC
- and if the local APIC hasn't been disabled in MSRs
- note that this requires CPUID to be supported. */ bool check_apic() { uint32_t eax, edx; cpuid(1, &eax, &edx); return edx & CPUID_FEAT_EDX_APIC; }
/* Set the physical address for local APIC registers */ void cpu_set_apic_base(uintptr_t apic) { uint32_t edx = 0; uint32_t eax = (apic & 0xfffff0000) | IA32_APIC_BASE_MSR_ENABLE;
#ifdef PHYSICAL_MEMORY_EXTENSION edx = (apic >> 32) & 0x0f; #endif
cpuSetMSR(IA32_APIC_BASE_MSR, eax, edx); }
/**
- Get the physical address of the APIC registers page
- make sure you map it to virtual memory ;) */ uintptr_t cpu_get_apic_base() { uint32_t eax, edx; cpuGetMSR(IA32_APIC_BASE_MSR, &eax, &edx);
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.