comp.lang.ada
 help / color / mirror / Atom feed
* Ada runtime and Linux Kernel Module
@ 2004-03-24 21:30 Rohan
  2004-03-24 21:42 ` Luke A. Guest
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rohan @ 2004-03-24 21:30 UTC (permalink / raw)


Hello!

I am in the very early stages of looking at writing a Linux kernel
module in ada for a University project.  I have looked around and it
seems to be possible, if tricky.

The Big Online Book of Linux Ada Programming
(http://www.vaxxine.com/pegasoft/homes/16.html) has some information,
and I have a test module written based on the example code there.

Any module would need to avoid anything which used the ada runtime. 
There are references to pragma no_run_time but I have found that as
long as I stear clear of using anything that requres the runtime there
is no problem even without the pragma.

However I would quite like to use exceptions and allocate veriables
from the heap.  The BOBOLAP states:

"If you have the time, you can always copy some of the standard Ada
packages to a separate directory and compile them into your GNORT
project, effectively creating your own small, custom run-time system."

I have had a play around trying to do this, but am somewhat stumbling
in the dark.  Does anybody have any pointers to how I go about this? 
Or indeed any example ADA linux module code!

Thanks

Rohan



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

* Re: Ada runtime and Linux Kernel Module
  2004-03-24 21:30 Ada runtime and Linux Kernel Module Rohan
@ 2004-03-24 21:42 ` Luke A. Guest
  2004-03-25  0:39 ` Jeff C,
  2004-03-25 20:06 ` Stephane Carrez
  2 siblings, 0 replies; 4+ messages in thread
From: Luke A. Guest @ 2004-03-24 21:42 UTC (permalink / raw)


On Wed, 24 Mar 2004 13:30:30 -0800, Rohan wrote:

> Hello!
> 
> I am in the very early stages of looking at writing a Linux kernel
> module in ada for a University project.  I have looked around and it
> seems to be possible, if tricky.

The only thing you need is the system.ads file. The rest you don't need
and won't really be able to use for OS level programming.

Another feature you *will* require is the use of "pragma
Restrictions(No_Elaboration_Code);" to force the compiler not to generate
things like functions for arrays, i.e. conversion functions for indexing.

Also, use the -gnatdg switch to see what GNAT is generating and you'll see
what I mean.

> "If you have the time, you can always copy some of the standard Ada
> packages to a separate directory and compile them into your GNORT
> project, effectively creating your own small, custom run-time system."

As I remember it, GNORT doesn't exist anymore.

I also created a gnat.adc file with the following inside it:

pragma No_Run_Time;
pragma Restrictions(No_Exceptions);

That should be all you need.

Luke.




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

* Re: Ada runtime and Linux Kernel Module
  2004-03-24 21:30 Ada runtime and Linux Kernel Module Rohan
  2004-03-24 21:42 ` Luke A. Guest
@ 2004-03-25  0:39 ` Jeff C,
  2004-03-25 20:06 ` Stephane Carrez
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff C, @ 2004-03-25  0:39 UTC (permalink / raw)


Another option is to look at something like GNAT for RTLinux.

http://rtportal.upv.es/apps/rtl-gnat/

"Rohan" <googlegroups.999.rohanuk@spamgourmet.com> wrote in message
news:a7a482f9.0403241330.368af948@posting.google.com...
> Hello!
>
> I am in the very early stages of looking at writing a Linux kernel
> module in ada for a University project.  I have looked around and it
> seems to be possible, if tricky.
>
> The Big Online Book of Linux Ada Programming
> (http://www.vaxxine.com/pegasoft/homes/16.html) has some information,
> and I have a test module written based on the example code there.
>
> Any module would need to avoid anything which used the ada runtime.
> There are references to pragma no_run_time but I have found that as
> long as I stear clear of using anything that requres the runtime there
> is no problem even without the pragma.
>
> However I would quite like to use exceptions and allocate veriables
> from the heap.  The BOBOLAP states:
>
> "If you have the time, you can always copy some of the standard Ada
> packages to a separate directory and compile them into your GNORT
> project, effectively creating your own small, custom run-time system."
>
> I have had a play around trying to do this, but am somewhat stumbling
> in the dark.  Does anybody have any pointers to how I go about this?
> Or indeed any example ADA linux module code!
>
> Thanks
>
> Rohan





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

* Re: Ada runtime and Linux Kernel Module
  2004-03-24 21:30 Ada runtime and Linux Kernel Module Rohan
  2004-03-24 21:42 ` Luke A. Guest
  2004-03-25  0:39 ` Jeff C,
@ 2004-03-25 20:06 ` Stephane Carrez
  2 siblings, 0 replies; 4+ messages in thread
From: Stephane Carrez @ 2004-03-25 20:06 UTC (permalink / raw)
  To: Rohan



Rohan wrote:
> Hello!
> 
> I am in the very early stages of looking at writing a Linux kernel
> module in ada for a University project.  I have looked around and it
> seems to be possible, if tricky.
> 

Have a look at MaRTE OS.  They have a minimal GNAT runtime.  There are
probably a lot of ideas to use from their OS design (entirely in Ada).

http://marte.unican.es/

   Stephane

-- 
         Home                           Office
E-mail: stcarrez@nerim.fr              Stephane.Carrez@solsoft.com
WWW:    http://stcarrez.nerim.net      http://www.solsoft.com
         Free the Software!             Security Policy Management




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

end of thread, other threads:[~2004-03-25 20:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-24 21:30 Ada runtime and Linux Kernel Module Rohan
2004-03-24 21:42 ` Luke A. Guest
2004-03-25  0:39 ` Jeff C,
2004-03-25 20:06 ` Stephane Carrez

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