comp.lang.ada
 help / color / mirror / Atom feed
From: Dimonax <dimonax@nospam.net>
Subject: Re: How do I go about creating a minimal GNAT runtime?
Date: Sat, 21 Feb 2009 21:14:35 GMT
Date: 2009-02-21T21:14:35+00:00	[thread overview]
Message-ID: <%8_nl.20866$Ws1.1319@nlpi064.nbdc.sbc.com> (raw)
In-Reply-To: X8Wnl.391570$Mh5.65742@bgtnsc04-news.ops.worldnet.att.net

On Sat, 21 Feb 2009 16:41:27 +0000, anon wrote:

> First, thing you need to do, is to decide on what you want your RTL
> system for. That we can not help you.
> 
> As for the 64k RTL, Forget it.  The size depends upon what you want the
> RTL to be able to do. And are you talking about Stand-Alone OS or using
> limited links into the OS.
> 
> Well there are many ways to try to do the job. Here are a few ideas.
> 
>   First. Use "pagma Ravenscar ;". Limits some of the RTL. In some cases,
>   it can reduce the dead code.
> 
>   Second, use "pragma Restrictions" and "pragma Suppress" to remove
>   unused packages and checks that add a large group of routines that you
>   may not need, such as exceptions. Which means, trap your own errors
>   instead of letting the compiler do it.
> 
>   Third, use simple replacement packages like GNAT.IO instead of
>   Ada.Text_IO which contains routines for files and stream I/O as well
>   as exceptions. This, is not standard but it can remove alot of dead
>   code.
> 
>   Fourth, you can always fall back and use mix languages, like using C
>   for the RTL. But at some point you will use another lang. becase GNAT
>   and other version of Ada mostly use links to the OS. for files and
>   interrupts handling.
> 
>     One person, back in the late 1990s rewote the GNAT Ada RTL packages
>     to use mostly "pragma Import" statement to the C and OS compiler
>     libraries.  But that not true Ada it C.
> 
>   And then there the obsolete feature "pragma No_Run_Time ;". This
>   statement allows the 4K footprint. Note: Will this feature be there in
>   the next version of GNAT Ada? Only time will tell.

Alright, so maybe 64k is overkill(when was the last time a 3D app ran in 
less than 64k). I have been hacking the Critical Mass Modula 3 compiler 
to get it up to par.(The build system sucks.) That can potentially 
produce 64k executables.


> 
> Now, for simpler full feature RTL (based on RM), you might rework the
> GNAT RTL, but there is not a lot that you can do. You might save a
> little memory but for the amount of time you spend, it not worth it. No
> where near the limits you are looking for.

Well, the nice thing is that the runtime footprint can be as large as I 
need it to be.(Could be gigabyte size if I were to do something that 
absurd.) Really I just need to be able to compress the generated binaries
(executables and object files) down to thier smallest size possible.
 
> The only way is to write a miminal RTL is to write a Stand-Alone OS. But
> be prepared to spend years of research and writting code just to find
> out your OS will no longer work on those PC at that time. Outdated
> before you start! You need a plan wih team that can get job done within
> a year or so. But that's a full time job.
 
Given that Gnat typically does a lot of calls out to C, is it possible to 
hack Gnat to just use system calls? Also, can the RTL be linked with 
uClibc or dietlibc to provide the requisite C API?

Maybe Adacore might want to do some experimentation with some embedded C 
libs like uClibc or a Misra C lib and tell us if they think it's 
worthwhile. I'd pay for it. 

I'm well aware of the usefullness of Pragma Restrictions in reducing 
executable size. Also such things as Pragma Discard_Names and other nifty 
things.
I'll start digging into the Gnat libraries and see what those do.

Thanks.

Freejack




  reply	other threads:[~2009-02-21 21:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-24 20:47 How do I go about creating a minimal GNAT runtime? Lucretia
2009-01-25 11:13 ` Ludovic Brenta
2009-01-25 11:18   ` Ludovic Brenta
2009-01-25 14:00     ` Lucretia
2009-01-25 14:00   ` Lucretia
2009-01-25 19:43     ` Ludovic Brenta
2009-01-25 20:30 ` xavier grave
2009-01-26  6:52 ` anon
2009-01-26 21:36 ` anon
2009-02-10  2:34 ` Exceptions (was Re: How do I go about creating a minimal GNAT runtime?) anon
2009-02-16  1:41 ` How do I go about creating a minimal GNAT runtime? Hibou57 (Yannick Duchêne)
2009-02-21  9:11 ` Dimonax
2009-02-21 16:41   ` anon
2009-02-21 21:14     ` Dimonax [this message]
2009-02-22  1:36       ` anon
2009-02-27 23:42   ` Randy Brukardt
2009-03-01  1:12     ` Dimonax
2009-03-01 19:13       ` anon
2009-03-02 22:07         ` Randy Brukardt
2009-03-03  2:00           ` anon
2009-03-03 22:23             ` lucretia
2009-03-04  0:03               ` anon
2009-03-11 12:54   ` gautier_niouzes
replies disabled

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