From 4a41e734a584e19eefa96b52a27862965f77b9a8 Mon Sep 17 00:00:00 2001 From: fslongjin Date: Mon, 25 Apr 2022 19:24:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89bug=EF=BC=8C=E5=9C=A8debian,gcc=3D10.2?= =?UTF-8?q?.1=E4=B8=8A=E7=BC=96=E8=AF=91=E5=90=8E=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E4=BC=9A=E5=9C=A8=E8=BF=9B=E7=A8=8B=E5=88=87=E6=8D=A2=E6=97=B6?= =?UTF-8?q?page=20fault?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/link.lds | 8 ++++++-- kernel/process/process.c | 6 +----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/link.lds b/kernel/link.lds index 0ffaec9b..beff2742 100644 --- a/kernel/link.lds +++ b/kernel/link.lds @@ -20,23 +20,26 @@ SECTIONS } . += KERNEL_VMA; + . = ALIGN(32768); text_start_pa = .; .text (text_start_pa): AT(text_start_pa - KERNEL_VMA) { _text = .; *(.text) + _etext = .; } - . = ALIGN(8); + . = ALIGN(32768); data_start_pa = .; .data (data_start_pa): AT(data_start_pa - KERNEL_VMA) { _data = .; *(.data) - + _edata = .; } + . = ALIGN(32768); rodata_start_pa = .; .rodata (rodata_start_pa): AT(rodata_start_pa - KERNEL_VMA) { @@ -51,6 +54,7 @@ SECTIONS .data.init_proc_union (init_proc_union_start_pa): AT(init_proc_union_start_pa - KERNEL_VMA) { *(.data.init_proc_union) } + . = ALIGN(32768); bss_start_pa = .; .bss (bss_start_pa): AT(bss_start_pa - KERNEL_VMA) { diff --git a/kernel/process/process.c b/kernel/process/process.c index 5968d1b3..9669c494 100644 --- a/kernel/process/process.c +++ b/kernel/process/process.c @@ -52,11 +52,7 @@ void __switch_to(struct process_control_block *prev, struct process_control_bloc __asm__ __volatile__("movq %0, %%fs \n\t" ::"a"(next->thread->fs)); __asm__ __volatile__("movq %0, %%gs \n\t" ::"a"(next->thread->gs)); // wrmsr(0x175, next->thread->rbp); - uint color; - if (proc_current_cpu_id == 0) - color = WHITE; - else - color = YELLOW; + } /**