[fpc-pascal] writing device driver using FPC

Vinzent Hoefler JeLlyFish.software at gmx.net
Thu Apr 5 09:59:01 CEST 2007


On Thursday 05 April 2007 07:36, Michael Van Canneyt wrote:
> On Thu, 5 Apr 2007, Bisma Jayadi wrote:
> > Writing device driver for windows using Delphi is almost impossible
> > since Delphi can't produce .sys files. Is it the same case for FPC?
> > Can FPC produce .sys file and write device drivers for any OSes
> > (not just windows)? TIA.
>
> Well. FPC can be used to write an operating system, so writing a
> device driver is in theory possible.
>
> Mostly, this would mean writing an RTL which runs inside a kernel,
> which means writing routines to handle IO and routines to handle
> memory management from the kernel interfaces.

And it would mean writing a C to Pascal conversion of an ever changing 
kernel interface.

> I think for Unix-type interfaces that would be enough.

No. Especially with a Linux 2.6 kernel where you are supposed to link 
with some "kernel object" file and an ever changing binary interface 
mostly defined as C-macros.

At least you need an additional C-wrapper or you're really lost.

> For Windows,
> there is the additional problem of producing a .sys file, which would
> mean some changes to the internal linker.

In which way are they special? I don't have a working "objdump" here, so 
I can't say in which they are different from the "normal" executable 
files on Windows. I mean, they're still called .sys but other than in 
the old DOS-days they're also PE-executables or whatever they're 
called. ;)


Vinzent.




More information about the fpc-pascal mailing list