[fpc-devel]Porting FPC to another OS

Pierre Muller pierre at freepascal.org
Mon Apr 22 15:16:20 CEST 2002


At 14:39 22/04/2002 , vous avez écrit:
>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?

You should use v2prt0.as code
start assembler label.


> > 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

Some unsupported RDOS DPMI 0x31 functions?

>for some reason. MAKE encounters a page-fault.
>Unfortunately, some dos-extenders go beyond what
>RDOS supports.

But these programs should use the same loader as we do for go32v2 binaries...

For make.exe,
isn't it a test to check if page protection is supported by the DPMI server?


> > 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.

I couldn't find where this happens :(


>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!

The fact is that 1.0.6 is almost ready so its too late for that one,
after you have the choice of either submit your patches against 1.0.6 or to 
start looking at the new 1.1 compiler version.
That version should allow easier adding of targets, but I mainly 
focused on fixing bugs in 1.0.X version and trying to enhance
the text mode IDE.

BTW: do you know why the IDE don't work under RDOS,
is this for both the go32v2 and the win32 versions?





More information about the fpc-devel mailing list