Damien Zammit via Bug reports for the GNU Hurd, le lun. 09 déc. 2024 12:17:23 
+0000, a ecrit:
> The current segmentation already adds -KERNELBASE.
> But only when accessing the memory.

I have applied this part, thanks!

> Don't forget to reload gdt.
> 
> ---
>  i386/i386/cpuboot.S | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/i386/i386/cpuboot.S b/i386/i386/cpuboot.S
> index 7e6c4770..9ac86845 100644
> --- a/i386/i386/cpuboot.S
> +++ b/i386/i386/cpuboot.S
> @@ -184,6 +185,11 @@ apboot_jmp_offset:
>       movw    $PERCPU_DS, %ax
>       movw    %ax, %gs
>  
> +     /* Reload the gdt because we changed it */
> +     lgdtl   apboot_gdt_descr

Ah, no, you don't need to reload gdt itself when the content of the
table has changed (and you would have to do that *before* setting %gs
above anyway).

> +     ljmpl   $KERNEL_CS, $2f

And the cs segment hasn't changed anyway.

Samuel

Reply via email to