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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news1.google.com!news.glorb.com!wn11feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: How do I go about creating a minimal GNAT runtime? Reply-To: no to spamers (No@email.given.org) References: <%8_nl.20866$Ws1.1319@nlpi064.nbdc.sbc.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Sun, 22 Feb 2009 01:36:38 GMT NNTP-Posting-Host: 12.65.222.219 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1235266598 12.65.222.219 (Sun, 22 Feb 2009 01:36:38 GMT) NNTP-Posting-Date: Sun, 22 Feb 2009 01:36:38 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:3731 Date: 2009-02-22T01:36:38+00:00 List-Id: Well Ada has a set of rules, for Critical Mass. that insures that the critical issues will be handle in a safe matter but Modula 3 and other languages are not force to deal with these issues. These safety factors can cause a lot of dead or not used code to be included in your project which means that Ada may not give you a small footprint that your looking for, but Ravenscar and the other pragma can decrease the footprint. As for the free GPL GNAT series using the embedded uClibc, dietlibc or Misra C libraries, you will have to write the links, or you can check with Adacore to see if the GNAT PRO series contain those libraries. If they do, you can look for a price tag of $15K or more per year to use them. As for using direct C libraries, well there are many problems. One, is the Tasking control, Ada has a set of packages to handle tasking which standard C's fork routine can only wish for. In <%8_nl.20866$Ws1.1319@nlpi064.nbdc.sbc.com>, Dimonax writes: >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 >