printf spinlock + remove DEPRECATED stuff + begin separating x86 stuff

This commit is contained in:
2026-03-20 09:01:57 +01:00
parent 424b4c4632
commit 3607a7179c
12 changed files with 77 additions and 138 deletions

View File

@@ -10,4 +10,53 @@ void wrmsr(uint32_t msr, uint64_t value);
bool x86_has_msr();
void x86_arch_init();
/* Interrupt Descriptor Table */
void idt_init(void);
struct interrupt_descriptor {
uint16_t address_low;
uint16_t selector;
uint8_t ist;
uint8_t flags;
uint16_t address_mid;
uint32_t address_high;
uint32_t reserved;
} __attribute__((packed));
struct idtr {
uint16_t limit;
uint64_t base;
} __attribute__((packed));
// All general-purpose registers (except rsp) as stored on the stack,
// plus the values we pushed (vector number, error code) and the iret frame
// In reverse order because the stack grows downwards.
struct cpu_status_t {
uint64_t r15;
uint64_t r14;
uint64_t r13;
uint64_t r12;
uint64_t r11;
uint64_t r10;
uint64_t r9;
uint64_t r8;
uint64_t rbp;
uint64_t rdi;
uint64_t rsi;
uint64_t rdx;
uint64_t rcx;
uint64_t rbx;
uint64_t rax;
uint64_t vector_number;
uint64_t error_code;
uint64_t iret_rip;
uint64_t iret_cs;
uint64_t iret_flags;
uint64_t iret_rsp;
uint64_t iret_ss;
};
#endif