[fpc-devel]An idea how to unbind OS/2 port from EMX

XHajT03 at vol.cz XHajT03 at vol.cz
Wed Mar 27 20:43:09 CET 2002

Date sent: 	Wed, 27 Mar 2002 14:54:12 +0000
From:         	"Pavel V. Ozerski" <pavel at insect.mail.iephb.ru>
Organization:  IEPhB RAS
To:           	fpc-devel at deadlock.et.tudelft.nl
Subject:      	[fpc-devel]An idea how to unbind OS/2 port from EMX

> Maybe, this way could be productive:
> 1) implement FAR16 calling conventions support;

 This would be definitely nice (and useful), but it isn't absolutely 
necessary (we can still use one of the available DLL wrappers, and be 
independent of EMX). The main problem for me is I won't probably be 
able to implement this (I have some information about this topic, but 
calling conventions aren't quite my domain, ;-) and embedding it into 
the compiler would need deeper understanding of compiler internals on 
my side :-( ). However, if you'd be able to add it, be my guest - I'm 
willing to help you any possible way.

> 2) translate OS2 API header to units;

 The OS/2 API is very extensive, of course, but the most important 
parts needed for us are already available (see units OS2Def, 
DosCalls, KbdCalls, VioCalls, MouCalls, MonCalls, PMWin, PMGPI and 
DIVE). The PM units aren't as good as the text ones probably 
(regarding compatibility with other compilers, etc.). Among more 
important parts, which are still missing, there's definitely the 
interface for TCP/IP. Another thing is replacing all EMX calls 
throughout the current RTL with the native API calls. This is needs 
some work, of course. :-(

> 3) genreate win32 PE executables/DLLs using ldw;
> 4) convert PE to LX using PE2LX from Odin

 It's definitely an interesting idea. I see some possible problems 
here, however:
 1) I'm not sure, whether the created binaries wouldn't need ODIN 
DLLs for some helpers (read: "they would most probably, IMHO").
 2) We'd probably loose any debugging possibility this way. I can 
imagine we might introduce support for a different format of debug 
information to use some other debugger instead of GDB in the future, 
but I doubt PE2LX could ever transform GNU debugging information into 
something useable.
 3) I don't know, whether text mode applications would still work 
correctly - all Win32 applications run in graphic mode under Odin (a 
special GUI window emulating the console is opened for text tools).

 Given all of this, it might still be better to try to implement our 
own linker in the future, and use something like NASM / LINK386 
combination in between.


More information about the fpc-devel mailing list