Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-03

Can I program a linux device driver with fpc?

5 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Peter Vreman
to milimeter
you wrote 5 lines
Hello, everybody Is there any possibility that we write a linux device driver with fpc? If we can, how?

In theory it should be possible. But you need to import and export the correct kernel functions. Most of the normal RTL routines can should not be used, including the heapmanager. Maybe it's better to create a minimal RTL for linux kernel development.

Peter

Reply by email

Michael Van Canneyt
to milimeter: Hello, everybody Is there any possibility that we write a linux device driver with fpc?…
milimeter wrote
Hello, everybody Is there any possibility that we write a linux device driver with fpc? If we can, how?

In theory it is possible. In practice, this has never been done. You would have to write a 'kernel-rtl' i.e. a RTL (system unit) which maps all basic functions (read/write/memory) to kernel functions. Then you can write a device driver using this RTL.

Michael.

Reply by email

James Mills
to Michael Van Canneyt
Michael Van Canneyt wrote 13 lines
On Mon, 17 Mar 2003, milimeter wrote: > Hello, everybody > > Is there any possibility that we write a linux device driver with fpc? If we > can, how? In theory it is possible. In practice, this has never been done. You would have to write a 'kernel-rtl' i.e. a RTL (system unit) which maps all basic functions (read/write/memory) to kernel functions. Then you can write a device driver using this RTL.

Could you show us how this is done ? As I'd like to use the same technique to use FPC for OS Development work... I have tried but without success... Building a minimal RTL is not easy.

cheers
James

Show quoted text 6 lines
Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Sebastian Günther
to Peter Vreman: In theory it should be possible. But you need to import and export the correct kernel…
Peter Vreman wrote
In theory it should be possible. But you need to import and export the correct kernel functions. Most of the normal RTL routines can should not be used, including the heapmanager. Maybe it's better to create a minimal RTL for linux kernel development.

This idea is quite interesting; but when doing kernel development, you are even stronger dependent on the C header files, than at doing normal development. How do you want to handle kernel structures, which don't only depend on the kernel version, but even its configuration? Perhaps some tweaking of h2pas will do the trick...?

- Sebastian

Reply by email