From 169401fb319437f6b0503373a3b3a154d59246b5 Mon Sep 17 00:00:00 2001 From: acevest Date: Thu, 1 Jan 2026 12:05:23 +0800 Subject: [PATCH] =?utf8?q?=E6=94=B9=E7=94=A8=E9=93=BE=E6=8E=A5=E5=99=A8?= =?utf8?q?=E6=9D=A5=E8=AE=A1=E7=AE=97=E8=B7=B3=E5=85=A5=E4=BF=9D=E6=8A=A4?= =?utf8?q?=E6=A8=A1=E5=BC=8F=E7=9A=84ljmp=E6=8C=87=E4=BB=A4=E7=9A=84?= =?utf8?q?=E5=86=85=E6=A0=B8=E5=81=8F=E7=A7=BB=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- boot/multiboot.S | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/boot/multiboot.S b/boot/multiboot.S index 98d2b53..24f9398 100644 --- a/boot/multiboot.S +++ b/boot/multiboot.S @@ -79,16 +79,12 @@ real_kernel_entry: addl $kernel_virtual_addr_start, %esp - # 由于编译器不支持下面这种写法 - # ljmp $0x08, $p_label + kernel_virtual_addr_start + .extern p_entry_vaddr + ljmp $0x08, $p_entry_vaddr - # 所以采用下面的方法跳转 - leal p_label,%eax - addl $kernel_virtual_addr_start, %eax - movl %eax, p_label_far_ptr - ljmp *p_label_far_ptr - -p_label: +.align 4 +.global p_entry # 为了让链接器计算出 p_entry_vaddr +p_entry: leal check_kernel, %eax call *%eax -- 2.47.0