[fpc-devel]Porting FPC to another OS

Leif Ekblad leif at rdos.net
Mon Apr 22 14:39:12 CEST 2002


Pierre Muller:
> Free Pascal does not use register GS at all 
> in the assember that it generates, 

I don't think it's in the Free Pascal code, since if
I remember it correctly, it switches to another code &
data selector as soon as GO32V2 switches to FPC-code.
I can find this out by setting an breakpoint in the startup-code
of FPC though. This is in system.pp right?

> it uses register FS for accessing real mode memory
> selector set to base 0 for accessing Dos memory 
> in the startup code (v2prt0.as).
> 
> I found no 'mov ax,gs:[ecx] instruction in its internal calls.
> Thus I clearly suspect that this is in the startup code
> of all DJGPP v2 programs.
> Does this also happen with DJGPP executables,
> like the following ones in the bin\go32v2 dir:
> as.exe, ld.exe or make.exe?

They behave differently. AS and LD faults on int 31
for some reason. MAKE encounters a page-fault.
Unfortunately, some dos-extenders go beyond what
RDOS supports.
 
> If that is the case, then this comes from the startup code,
> which source you can get from DJGPP sources.
> Or maybe its in the cwsdpmi.exe server,
> unless RDOS does provide its own DPMI server.

It's not in cwsdpmi since RDOS has it's own DPMI server.

> MEM F000h:FFF0h - RESET JUMP
> Size:   5 BYTEs
> 
> So the address FFFF3 of size 2 bytes represents the last two bytes of
> that stuff, but I don't know really what means.

My guess is it's reading the BIOS segment for some reason. This would also
only work if BIOS does a far jmp at the boot vector.

BTW, how would I go about to add RDOS target to systems.pas in the
compiler? I pretty well know how to do it on my 1.0.4 release, but I don't
like to do this for every release of FPC!

Leif






More information about the fpc-devel mailing list