Fix page fault

This commit is contained in:
Aren Elchinyan 2025-01-18 13:52:43 +03:00
parent b9fe67a4c9
commit 78de14d157
2 changed files with 4 additions and 5 deletions

View File

@ -19,6 +19,10 @@ typedef struct {
sections_t kernel_sections[4];
sections_t *sectons_init() {
// Why this halts cpu?
//memset(&kernel_section_bss_start, 0,
// (uint64_t)&kernel_section_bss_end -
// (uint64_t)&kernel_section_bss_start);
serial_printf("\t.text 0x%x-0x%x(%u)\n", &kernel_section_text_start,
&kernel_section_text_end,
&kernel_section_text_end - &kernel_section_text_start);
@ -43,8 +47,5 @@ sections_t *sectons_init() {
kernel_sections[3] =
(sections_t){ kernel_section_bss_start, kernel_section_bss_end };
memset(&kernel_section_bss_start, 0,
&kernel_section_bss_end - &kernel_section_bss_start);
return (sections_t *)&kernel_sections;
}

View File

@ -14,8 +14,6 @@ void kernel_main64(uint64_t *multiboot2, uint32_t magic, void *esp,
int status = multiboot2_init(multiboot2, magic);
sectons_init();
if (status) {
serial_printf("[OK]\n");
} else {