forked from xamidev/pepperOS
28 lines
751 B
C
28 lines
751 B
C
/*
|
|
* @author xamidev <xamidev@riseup.net>
|
|
* @brief x86 architecture-dependant initialization
|
|
* @license GPL-3.0-only
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
#include <arch/x86.h>
|
|
#include <kernel.h>
|
|
|
|
/*
|
|
* x86_arch_init - Initialize x86 CPU structures
|
|
*
|
|
* This function is responsible for overriding a PAT entry
|
|
* (to put the framebuffer area in WC mode) only.
|
|
*
|
|
* Later, all architecture-dependant init (GDT, IDT, TSS, ...)
|
|
* should be initialized here, and separate function pointers
|
|
* should be set up for each arch.
|
|
*/
|
|
void x86_arch_init()
|
|
{
|
|
uint64_t pat = rdmsr(0x277);
|
|
pat &= ~(0xFFULL << 8); // Clear PAT1
|
|
pat |= (0x01ULL << 8); // PAT1 = 0x01 (WC)
|
|
wrmsr(0x277, pat);
|
|
DEBUG("Overrode PAT1 entry to set up Write-Combining");
|
|
} |