feat: initial scalable x86_64 microkernel skeleton with Limine, Rust, C HAL, and C++20 IPC

This commit is contained in:
RarDog
2026-09-02 16:47:37 +03:00
commit 9cffb01889
47 changed files with 2432 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
/* opencoreC - Thread Context Switch */
.global switch_to
.section .text
/*
* void switch_to(uint64_t **prev_rsp_ptr, uint64_t *next_rsp);
* RDI = pointer to current thread's stored RSP
* RSI = target thread's RSP
*/
switch_to:
/* Push callee-saved registers of outgoing thread */
push rbp
push rbx
push r12
push r13
push r14
push r15
/* Save current stack pointer */
mov [rdi], rsp
/* Load target stack pointer */
mov rsp, rsi
/* Pop callee-saved registers of incoming thread */
pop r15
pop r14
pop r13
pop r12
pop rbx
pop rbp
ret