[syslinux] Calling between real mode and protected mode on the core32 branch

H. Peter Anvin hpa at zytor.com
Sun May 31 20:01:41 PDT 2009


Ferenc Wagner wrote:
> "H. Peter Anvin" <hpa at zytor.com> writes:
> 
>> The first argument is [...] (CS << 6)+IP in the case of core_farcall().
> 
> Is (CS << 6) an unfortunate crossing of CS*16 and CS<<4?
> 

No, it's a typo for (CS << 16).  Yes, thats << 16, not *16.

>> To break a 32-bit pointer apart into a seg:off pair, use the SEG() and
>> OFFS() macros:
>>
>> 	regs.es       = SEG(ptr);
>> 	regs.ebx.w[0] = OFFS(ptr);
> 
> How is the possible segment ambiguity resolved?

It is resolved so that the offset is in the range 0-15.  This provides
the maximum distance from the pointer (normally the beginning of the
object) until segment wraparound.  This is the same was MS-DOS C
compilers treated "huge" pointers.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.




More information about the Syslinux mailing list