wip: saving to continue on laptop

This commit is contained in:
Karina
2025-12-27 02:35:05 +04:00
parent 0aa7086589
commit 0d38c268b3
2 changed files with 10 additions and 18 deletions
+9 -16
View File
@@ -65,25 +65,18 @@ void kmain(Bootinfo* info) {
vmm_init(info);
kprintf("\nIM ALIVE :D");
kprintf("\nSetting up guard page test");
u64* new_stack_phys = pmm_alloc_page();
u64 stack_top = 0x40000000;
vmm_map_page(pml4_kernel, (u64)new_stack_phys, stack_top, PTE_PRESENT | PTE_RW);
__asm__ volatile (
"mov %0, %%rsp \n"
"call *%1"
:: "r"(stack_top + 4096), "r"(rectest), "D"(0) : "memory"
);
// kprintf("\nSetting up guard page test");
// u64* new_stack_phys = pmm_alloc_page();
// u64 stack_top = 0x40000000;
// vmm_map_page(pml4_kernel, (u64)new_stack_phys, stack_top, PTE_PRESENT | PTE_RW);
// kfetch();
// __asm__ volatile (
// "mov %0, %%rsp \n"
// :: "r"(stack_top + 4096)
// );
// kprintf("I cant do anything yet lol");
// kprintf("stack overflow protection test");
rectest(0);
// __asm__("ud2"); // panic :(
// rectest(0);
while (1) { __asm__("hlt"); }
}
-1
View File
@@ -56,7 +56,6 @@ def main():
c_code.append(f" .buffer = (u32*){output_name}_data")
c_code.append(f"}};")
# Сохраняем в файл
output_filename = f"{output_name}.h"
with open(output_filename, "w") as f:
f.write("\n".join(c_code))