forked from CHatingPython/towos
refactor: add architecture
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#include "./gdt.hpp"
|
||||
|
||||
#include "types.hpp"
|
||||
|
||||
namespace x86_64 {
|
||||
|
||||
struct gdt_descriptor {
|
||||
u16 size;
|
||||
const void* offset;
|
||||
} PACKED;
|
||||
|
||||
void load_gdt(const gdt_entry* entries, u32 size) {
|
||||
gdt_descriptor gdtr{ static_cast<u16>((size - 1) & 0xFFFF), entries };
|
||||
|
||||
asm volatile("lgdt %0" : : "m"(gdtr));
|
||||
}
|
||||
|
||||
} // namespace x86_64
|
||||
Reference in New Issue
Block a user