comp.lang.ada
 help / color / mirror / Atom feed
* Using GNAT in Linux kernel modules, was: Re: Free RTOS with support for Ada ?
       [not found] ` <3B0D7877.4AE1FBCC@gsde.hou.us.ray.com>
@ 2001-05-25 18:54   ` Simon Clubley
  2001-05-26  3:35     ` Gerhard Häring
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Clubley @ 2001-05-25 18:54 UTC (permalink / raw)


[Crossposted to comp.lang.ada and comp.realtime]

On Thu, 24 May 2001 16:09:11 -0500, in article
<3B0D7877.4AE1FBCC@gsde.hou.us.ray.com>, Stanley R. Allen wrote:
>
>Simon Clubley wrote:
>> 
>> Does anybody know of a free RTOS with support for programming in Ada ?
>> 
>
>I suppose you could use one of the real-time linuxes in conjunction
>with the GNU Ada compiler (GNAT).
>
>Anyway, that's the plan for our real-time Ada project.
>
>-- 
>Stanley Allen
>mailto:Stanley_R_Allen-NR@raytheon.com

I had looked at RTlinux, and noted that the implementation was via Linux
kernel modules. I was also aware (from the Ada Linux Programming book from
www.adapower.com) that you need to use a pragma to disable the Ada runtime
when doing Linux kernel modules.

However, this book does not cover kernel programming in any detail and the
GNAT reference manual just refers you to the GNORT documentation, which does
not appear to be publically available, so I had dismissed this as an option.

However, since this option is mentioned above, I wonder if I have missed
something.

Has anybody successfully implemented a Linux/RTlinux kernel module in Ada
using just the public GNAT and freely available documentation and what problems
did you have ?

Thanks for any answers.

Simon.

-- 
Simon Clubley, simon_clubley@remove_me.excite.com-Earth.UFP
Worrying idea #101: What if Microsoft goes into the Ada compiler business ?



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Using GNAT in Linux kernel modules, was: Re: Free RTOS with support for Ada ?
  2001-05-25 18:54   ` Using GNAT in Linux kernel modules, was: Re: Free RTOS with support for Ada ? Simon Clubley
@ 2001-05-26  3:35     ` Gerhard Häring
  0 siblings, 0 replies; 2+ messages in thread
From: Gerhard Häring @ 2001-05-26  3:35 UTC (permalink / raw)


>I was also aware (from the Ada Linux Programming book from
>www.adapower.com) that you need to use a pragma to disable the Ada runtime
>when doing Linux kernel modules.
>
>However, this book does not cover kernel programming in any detail and the
>GNAT reference manual just refers you to the GNORT documentation, which does
>not appear to be publically available, so I had dismissed this as an option.
>
>However, since this option is mentioned above, I wonder if I have missed
>something.
>
>Has anybody successfully implemented a Linux/RTlinux kernel module in Ada
>using just the public GNAT and freely available documentation and what problems
>did you have ?

FWIW, I have once implemented a toy Linux kernel module with the publicly
available version of GNAT. I also started to port a relatively simple Linux
kernel module to Ada (the driver for the bttv video cards).

I can tell you that it's possible. But for me, it was quite frustrating,
because I had to "fake" C a lot, I couldn't get rid of C completely because the
Linux kernel uses lots of #defines and you have to wrap these at least to Ada
functions/procedures.

It would be nice if the complete Linux kernel API were available as an Ada
binding, but this would be a tremendous effort and would have to be updated for
every new kernel version. Not quite realistic. I have only translated the C
stuff on a as-needed basis.

Wrt to the PRAGMA No_Run_Time, it wasn't available with GNAT 3.12p and I could
do without. I still don't quite get the point of it: it still lets you use
features that need the Ada runtime.

Gerhard

PS: You can't allocate stuff on the heap. (Part of) The GNAT runtime would need
to be ported to the Linux kernel environment, so that it uses kmalloc instead
of the C library's malloc.
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://highqualdev.com              public key at homepage
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-05-26  3:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <tAbP6.6660$r4.413599@www.newsranger.com>
     [not found] ` <3B0D7877.4AE1FBCC@gsde.hou.us.ray.com>
2001-05-25 18:54   ` Using GNAT in Linux kernel modules, was: Re: Free RTOS with support for Ada ? Simon Clubley
2001-05-26  3:35     ` Gerhard Häring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox