From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,db8388c6b42d398 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsfeed.stanford.edu!newshub.sdsu.edu!flph200.ffdc.sbc.com!prodigy.net!flph199.ffdc.sbc.com!prodigy.com!flpi107.ffdc.sbc.com!nlpi064.nbdc.sbc.com.POSTED!b5cf28ff!not-for-mail From: Dimonax Subject: Re: How do I go about creating a minimal GNAT runtime? Newsgroups: comp.lang.ada References: <0zPnl.16758$YU2.10131@nlpi066.nbdc.sbc.com> User-Agent: Pan/0.133 (House of Butterflies) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: <%8_nl.20866$Ws1.1319@nlpi064.nbdc.sbc.com> NNTP-Posting-Host: 75.48.217.250 X-Complaints-To: abuse@prodigy.net X-Trace: nlpi064.nbdc.sbc.com 1235250875 ST000 75.48.217.250 (Sat, 21 Feb 2009 16:14:35 EST) NNTP-Posting-Date: Sat, 21 Feb 2009 16:14:35 EST Organization: at&t http://my.att.net/ X-UserInfo1: [[PA@SJDPBUKRZ\XMZKNNPDAZR\VPULMVPQZKB]MPXHBTWICYFWUQBKZQLYJX\_ITFD_KFVLUN[DOM_A_NSYNWPFWNS[XV\I]PZ@BQ[@CDQDPCL^FKCBIPC@KLGEZEFNMDYMKHRL_YYYGDSSODXYN@[\BK[LVTWI@AXGQCOA_SAH@TPD^\AL\RLGRFWEARBM Date: Sat, 21 Feb 2009 21:14:35 GMT Xref: g2news1.google.com comp.lang.ada:3730 Date: 2009-02-21T21:14:35+00:00 List-Id: 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