Kernel: Implement WriteCombining memory

This makes framebuffer much faster on real hardware
This commit is contained in:
2024-07-15 22:08:20 +03:00
parent 42c3fa24f0
commit 0578d41500
8 changed files with 64 additions and 20 deletions

View File

@@ -79,5 +79,6 @@ namespace CPUID
bool is_64_bit();
bool has_nxe();
bool has_pge();
bool has_pat();
}

View File

@@ -29,12 +29,17 @@ namespace Kernel
Present = (1 << 0),
ReadWrite = (1 << 1),
UserSupervisor = (1 << 2),
CacheDisable = (1 << 4),
Reserved = (1 << 9),
Execute = (1 << 15),
Used = Present | Reserved,
};
enum MemoryType
{
Normal,
WriteCombining,
WriteThrough,
};
public:
static void initialize();
@@ -93,8 +98,8 @@ namespace Kernel
void unmap_page(vaddr_t);
void unmap_range(vaddr_t, size_t bytes);
void map_range_at(paddr_t, vaddr_t, size_t bytes, flags_t);
void map_page_at(paddr_t, vaddr_t, flags_t);
void map_range_at(paddr_t, vaddr_t, size_t bytes, flags_t, MemoryType = MemoryType::Normal);
void map_page_at(paddr_t, vaddr_t, flags_t, MemoryType = MemoryType::Normal);
paddr_t physical_address_of(vaddr_t) const;
flags_t get_page_flags(vaddr_t) const;