Re: [PATCH v1 02/14] x86/realmode: make %gs == 0 an invariant
From: H. Peter Anvin
Date: Tue Jan 20 2026 - 17:52:55 EST
On 2026-01-20 14:40, David Laight wrote:
>
> Would it be better to wrap that as (say) read_abs_32() since the
> objective is to read an absolute address (using the relevant zero segment
> register) rather than to read though either fs or gs.
>
> Is this code all running in 32bit linear mode with non-zero cs/ss/ds
> segment registers and 'suitable' entries in the GDT?
> That mode makes my brain hurt :-)
> Or is there a fudge to get 16bit asm from the C.
>
The code is running in 16-bit real mode, compiled using -m16.
-hpa