comp.lang.ada
 help / color / mirror / Atom feed
* How do I go about creating a minimal GNAT runtime?
@ 2009-01-24 20:47 Lucretia
  2009-01-25 11:13 ` Ludovic Brenta
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Lucretia @ 2009-01-24 20:47 UTC (permalink / raw)


Hi (again),

It's been a while, but I'm coming back to my Ada kernel again. I've
been messing with my helo_world_kernel which I built using no runtime
(see http://www.archeia.com for more info).

Having just spoken to Ludovic on #Ada, he pointed out that the gnat
tools can use a basic cross tool set, like the ones I have built
myself (again, see the above link). My toolset comprises of a gnat1
compiler and a gnatbind for my targets. I found that it does work
using the --GCC and --GNATBIND flags, and I need to make sure the
cross tools and the host tools are of the same GCC version otherwise
GNAT throws up ALI format errors.

The thing is, I've been trying to enable exceptions, but keep coming
across big problems in that the runtime requires features that are
being restricted, such as returning aggregates and assigning
composites, returning unconstrained objects which requires the
secondary stack. So, what I really need to know is, how do I create a
runtime which is restricted in this way for bare hw access?

Thanks,
Luke.



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

* Re: How do I go about creating a minimal GNAT runtime?
  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 20:30 ` xavier grave
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 23+ messages in thread
From: Ludovic Brenta @ 2009-01-25 11:13 UTC (permalink / raw)


On Jan 24, 9:47 pm, Lucretia <lucret...@lycos.co.uk> wrote:
> Hi (again),
>
> It's been a while, but I'm coming back to my Ada kernel again. I've
> been messing with my helo_world_kernel which I built using no runtime
> (seehttp://www.archeia.comfor more info).
>
> Having just spoken to Ludovic on #Ada, he pointed out that the gnat
> tools can use a basic cross tool set, like the ones I have built
> myself (again, see the above link). My toolset comprises of a gnat1
> compiler and a gnatbind for my targets. I found that it does work
> using the --GCC and --GNATBIND flags, and I need to make sure the
> cross tools and the host tools are of the same GCC version otherwise
> GNAT throws up ALI format errors.

That sounds reasonable. gnatmake (a host tool) reads the .ali files to
decide what it needs to recompile. Then it calls the cross compiler
(cross gcc), which produces new .o and .ali files, and then the cross
binder (gnatbind).

I'm not entirely sure whether gnatlink is a host-only tool, or if you
need a cross version of it. In any case you do need a cross ld.

> The thing is, I've been trying to enable exceptions, but keep coming
> across big problems in that the runtime requires features that are
> being restricted, such as returning aggregates and assigning
> composites, returning unconstrained objects which requires the
> secondary stack. So, what I really need to know is, how do I create a
> runtime which is restricted in this way for bare hw access?

I don't know the relationship (if any) between exception propagation,
exception handling and the secondary stack. Xavier Grave does :)

Have you had a look at the OS Lovelace sources? OS Lovelace supports
exceptions in th kernel; it does that by building a minimal, patched,
GNAT runtime into the kernel.

--
Ludovic Brenta.



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

* Re: How do I go about creating a minimal GNAT runtime?
  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
  1 sibling, 1 reply; 23+ messages in thread
From: Ludovic Brenta @ 2009-01-25 11:18 UTC (permalink / raw)


A few moments ago, I wrote on comp.lang.ada:
> Have you had a look at the OS Lovelace sources? OS Lovelace supports
> exceptions in th kernel; it does that by building a minimal, patched,
> GNAT runtime into the kernel.

PS. The schedule of the Ada DevRoom at FOSDEM is published:

http://www.fosdem.org/2009/schedule/tracks/ada

Xavier said he would try to add a half-hour presentation of OS
Lovelace to this schedule, so if anyone is interested in these
subjects, feel free to come by!

--
Ludovic Brenta.



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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-01-25 11:13 ` Ludovic Brenta
  2009-01-25 11:18   ` Ludovic Brenta
@ 2009-01-25 14:00   ` Lucretia
  2009-01-25 19:43     ` Ludovic Brenta
  1 sibling, 1 reply; 23+ messages in thread
From: Lucretia @ 2009-01-25 14:00 UTC (permalink / raw)


On Jan 25, 11:13 am, Ludovic Brenta <ludo...@ludovic-brenta.org>
wrote:

> That sounds reasonable. gnatmake (a host tool) reads the .ali files to
> decide what it needs to recompile. Then it calls the cross compiler
> (cross gcc), which produces new .o and .ali files, and then the cross
> binder (gnatbind).
>
> I'm not entirely sure whether gnatlink is a host-only tool, or if you
> need a cross version of it. In any case you do need a cross ld.

Seems a cross gnatlink is not required as one isn't built, looking at
the help text it seems it can take cross tools using extra flags. Yes,
a cross ld is built at the binutils stage.

> > The thing is, I've been trying to enable exceptions, but keep coming
> > across big problems in that the runtime requires features that are
> > being restricted, such as returning aggregates and assigning
> > composites, returning unconstrained objects which requires the
> > secondary stack. So, what I really need to know is, how do I create a
> > runtime which is restricted in this way for bare hw access?
>
> I don't know the relationship (if any) between exception propagation,
> exception handling and the secondary stack. Xavier Grave does :)
>
> Have you had a look at the OS Lovelace sources? OS Lovelace supports

I can't as the server is down, again.

> exceptions in th kernel; it does that by building a minimal, patched,
> GNAT runtime into the kernel.

Yes, I would like to see how he's done that.

Luke.



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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-01-25 11:18   ` Ludovic Brenta
@ 2009-01-25 14:00     ` Lucretia
  0 siblings, 0 replies; 23+ messages in thread
From: Lucretia @ 2009-01-25 14:00 UTC (permalink / raw)


On Jan 25, 11:18 am, Ludovic Brenta <ludo...@ludovic-brenta.org>
wrote:
> A few moments ago, I wrote on comp.lang.ada:
>
> > Have you had a look at the OS Lovelace sources? OS Lovelace supports
> > exceptions in th kernel; it does that by building a minimal, patched,
> > GNAT runtime into the kernel.
>
> PS. The schedule of the Ada DevRoom at FOSDEM is published:
>
> http://www.fosdem.org/2009/schedule/tracks/ada
>
> Xavier said he would try to add a half-hour presentation of OS
> Lovelace to this schedule, so if anyone is interested in these
> subjects, feel free to come by!

I can't make it unfortunately. But it would be cool if somebody could
video the presentation and upload it somewhere.

Luke.



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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-01-25 14:00   ` Lucretia
@ 2009-01-25 19:43     ` Ludovic Brenta
  0 siblings, 0 replies; 23+ messages in thread
From: Ludovic Brenta @ 2009-01-25 19:43 UTC (permalink / raw)


On Jan 25, 3:00 pm, Lucretia <lucret...@lycos.co.uk> wrote:
> On Jan 25, 11:13 am, Ludovic Brenta <ludo...@ludovic-brenta.org>
> wrote:
> > Have you had a look at the OS Lovelace sources? OS Lovelace supports
>
> I can't as the server is down, again.

www.ada-france.org is up, both for HTTP and for Monotone, and www.lovelace.fr
is up too. Are you talking about another server?

--
Ludovic Brenta.




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

* Re: How do I go about creating a minimal GNAT runtime?
  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 20:30 ` xavier grave
  2009-01-26  6:52 ` anon
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 23+ messages in thread
From: xavier grave @ 2009-01-25 20:30 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Just a few words about cross compiling. For targeting x86 hardware, I'm
using a standard GNAT GPL compiler for GNU/Linux (2007 for the moment).
I'm copying locally the run time sources and then after patch them
(thanks to quilt).

So for other target (MIPS) a simple way may be to use a native MIPS GNAT
compiler (for example in a Debian env running in Qemu) ?

I have used a cross compiler in order to target ppc405 hardware when I
was doing some tests (I will have to port lovelace when my ppc knowledge
reach a critical threshold :) ).

xavier

Lucretia a �crit :
> Hi (again),
> 
> It's been a while, but I'm coming back to my Ada kernel again. I've
> been messing with my helo_world_kernel which I built using no runtime
> (see http://www.archeia.com for more info).
> 
> Having just spoken to Ludovic on #Ada, he pointed out that the gnat
> tools can use a basic cross tool set, like the ones I have built
> myself (again, see the above link). My toolset comprises of a gnat1
> compiler and a gnatbind for my targets. I found that it does work
> using the --GCC and --GNATBIND flags, and I need to make sure the
> cross tools and the host tools are of the same GCC version otherwise
> GNAT throws up ALI format errors.
> 
> The thing is, I've been trying to enable exceptions, but keep coming
> across big problems in that the runtime requires features that are
> being restricted, such as returning aggregates and assigning
> composites, returning unconstrained objects which requires the
> secondary stack. So, what I really need to know is, how do I create a
> runtime which is restricted in this way for bare hw access?
> 
> Thanks,
> Luke.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl8y/gACgkQVIZi0A5BZF69NQCdHILKYx8wpFyamxKjcuFBnwdI
oOgAoJ2YzR1Vw1dJdPZQ48WD/NNvoZWI
=7zpM
-----END PGP SIGNATURE-----



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

* Re: How do I go about creating a minimal GNAT runtime?
  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 20:30 ` xavier grave
@ 2009-01-26  6:52 ` anon
  2009-01-26 21:36 ` anon
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 23+ messages in thread
From: anon @ 2009-01-26  6:52 UTC (permalink / raw)


Will deal with exception later.

I wrote this last time when you ask about building a Stand-Alone Ada 
Hello program. In this example all code files are written using GNAT 
Ada 95 and was tested using GNAT GPL Ada 2005, Adacore 2007
version. And Yes, I do have all source files.

##############################################################################
# Linux: script file                                                         #
#                                                                            #
#  Both GNATBIND and GNATLINK can be used but the binder output file         #
#  must be edited to move function 'main' to first routine of the            #
#  package, before linking. Required for GNAT Ada binary type of             #
#  kernels.                                                                  #
#                                                                            #
#  In this example I use an Ada partition call 'edit_bind' to preform        #
#  the move. But file can be be edited manually.                             #
#                                                                            #
##############################################################################


##############################################################################
#                                                                            #
#  'video_io' package basically a "protective-mode" video device driver      #
#  that access video memory and handles a few  simple control characters,    #
#  such as CR/LF.                                                            #
#                                                                            #
#  'test_io' package is a edited copy of GNAT.IO which defines the major     #
#  put/put_line/new_line routines.  Deleted 'Get'(s) routines.               #
#                                                                            #
##############################################################################
gnat compile video_io -gnatl >1
gnat compile text_io.adb -gnatl -a >>1

##############################################################################
#                                                                            #
#  Hello is a simple 32-bit protective-mode kernel                           #
#                                                                            #
##############################################################################
gnat make -c hello.adb -gnatl >>1
gnat bind hello.ali 

##############################################################################
#                                                                            #
# edit_bind: Moved function 'main' to top of package '_ada_main'.            #
#            So, function 'main' is first routine                            #
#                                                                            #
##############################################################################
./edit_bind b~hello.adb

##############################################################################
#                                                                            #
#  link Kernel routines into a single Stand-Alone file                       #
#                                                                            #
##############################################################################
gnat link hello.ali -e _ada_hello -T hello.lds -nostdlib
#
objdump -d hello >3
#
objcopy -R .comment -R .dynamic -R .note -S -O binary hello hello.bin
#
rm video_io.ali video_io.o text_io.ali text_io.o hello.ali hello hello.o

##############################################################################
#                                                                            #
#  compile and build the MBR boot program. calls setup routine               #
#  Then pad boot.bin to MBR size and insert boot sig.                        #
#                                                                            #
##############################################################################
gnat compile boot.adb >4
ld -o boot.exe -Ttext 0 -e _ada_boot boot.o
objcopy -R .comment -R .dynamic -R .note -S -O binary boot.exe boot.bin
#
./fix_mbr boot.bin
rm boot.ali boot.exe boot.o

##############################################################################
#                                                                            #
# compile and build the 'proctive-mode' initiator. Which calls an            #
# Ada program at a specific offset.                                          #
#                                                                            #
##############################################################################
gnat compile setup.adb >>4
ld -o setup.exe -T setup.lds --oformat binary -s -e _ada_setup setup.o 
./fix_mbr setup.exe
rm setup.ali setup.o

##############################################################################
#                                                                            #
# catenate a list of binary file into one, building a loadable kernal.       #
#   Kernel := ipl.img                                                        #
#                                                                            #
##############################################################################
./catenate ipl.img boot.bin setup.exe hello.bin
rm boot.bin setup.exe hello.bin



In <eb511600-6446-4bad-b859-0d7444416a4c@d36g2000prf.googlegroups.com>, Lucretia <lucretia9@lycos.co.uk> writes:
>Hi (again),
>
>It's been a while, but I'm coming back to my Ada kernel again. I've
>been messing with my helo_world_kernel which I built using no runtime
>(see http://www.archeia.com for more info).
>
>Having just spoken to Ludovic on #Ada, he pointed out that the gnat
>tools can use a basic cross tool set, like the ones I have built
>myself (again, see the above link). My toolset comprises of a gnat1
>compiler and a gnatbind for my targets. I found that it does work
>using the --GCC and --GNATBIND flags, and I need to make sure the
>cross tools and the host tools are of the same GCC version otherwise
>GNAT throws up ALI format errors.
>
>The thing is, I've been trying to enable exceptions, but keep coming
>across big problems in that the runtime requires features that are
>being restricted, such as returning aggregates and assigning
>composites, returning unconstrained objects which requires the
>secondary stack. So, what I really need to know is, how do I create a
>runtime which is restricted in this way for bare hw access?
>
>Thanks,
>Luke.




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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-01-24 20:47 How do I go about creating a minimal GNAT runtime? Lucretia
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 23+ messages in thread
From: anon @ 2009-01-26 21:36 UTC (permalink / raw)



For Kernels and GNAT there are three classes of exceptions.  The first two 
classes are not directly handled by GNAT Ada and must be programmed to 
be handled.

The first class of exceptions are device exceptions. Such as when a device 
stop working or is not present.  In this case, during initialization, the 
kernel could just display a message to the video or uses the speaker to 
alert the user, that there is a problem, then the kernel halts the CPU.  
After initialization normally, the device drivers could generate a 
software exception if an error occurs, that can handled by an Ada 
exception routine.

The second class of exceptions are caused by the hardware.  In this level 
there are two exceptions types: CPU, and Hardware.  The CPU type 
exceptions are predefined and are generated by the CPU, such as memory 
"Page-Faults" or an integer "Divide-by-Zero" exceptions.  Now, the 
Hardware exceptions are generated by the hardware and causes the CPU to 
generate an interrupt similar to the CPU exception.  To handle this class of 
exceptions the x86 kernel will first need to set up the "Interrupt 
Description Table" register and then use a wrapper to call the correct Ada 
interrupt handler routine. 

The x86 kernels uses the protective "LIDT" assembly statement to setup the 
Interrupt Description Table Register. This register contains a pointer to an 
jump array or table where the array is defined large enough to handle all 
CPU and Hardware interrupts (exceptions) with maybe a few extra entries 
for software interrupts.  And each entry of this array is a pointer to a 
wrapper. Which in turns call an Ada routine that processes the interrupt 
or exception. The general IDT and wrapper design is:

  IDT register => wrapper_table

  wrapper_table := ( 0 => wrapper_0'address,
                     2 => wrapper_1'address,
                     3 => wrapper_2'address,
                     ... ) ;

: Assembly code:
      wrapper_0:
               save   : all general and segment registers
               call Ada interrupt handler for exception 0
               restore: all general and segment registers
               "IRET" -- special interrupt return statement 
      wrapper_1:
               save   : all general and segment registers
               call Ada interrupt handler for exception 1
               restore: all general and segment registers
               "IRET" -- special interrupt return statement 
      ...

The reason the wrapper is used is that GNAT does not generated the 
special interrupt return statement "IRET" which is needed for all 
interrupt routines.

An example of a Hardware exception is the keyboard interrupt handler.  In 
this case, when a key is press the keyboard controller causes an CPU 
interrupt.  Then the keyboard interrupt routine would read the keystroke 
from the controller and if space is available the keystone will be stored in 
a keyboard queue. Then the routine returns and waits until the next key is 
pressed. Of course, there is another keyboard device driver routine that 
reads the keyboard queue, and passed the value to Ada.Text_IO 'GET' or 
'GET_IMMEDIATE' routines.


The third exception level is the use of Ada.Exception. In this case you may 
need to rewrite the complete package.  And due to the way GNAT was 
designed you will need to make sure that 'Run-Time Check Routines' are 
present. These routines are exceptions that are inserted by the compiler.

A 'Run-Time Check Routines' example is when the compiler encounters a 
divide statement such as:
    Z := X / Y ;

the compiler expands the statement logically to:

    if Y = 0 then
      raise CONSTRAINT_ERROR ( "divide by zero" & File & Line_Number ) ;
    end if ;
    Z := X / Y ;

and is translated to:
    if Y = 0 then
      Rcheck_03 ( File, Line_Number ) ; -- Rcheck_03 is no return procedure.
    end if ;
    Z := X / Y ;

then translated into the assembly statements.

Note: GNAT does not normally allow the use of the CPU exceptions such as 
"divide-by-zero", it checks and trap the exception before the divide 
statement is executed.


In <eb511600-6446-4bad-b859-0d7444416a4c@d36g2000prf.googlegroups.com>, Lucretia <lucretia9@lycos.co.uk> writes:
>Hi (again),
>
>It's been a while, but I'm coming back to my Ada kernel again. I've
>been messing with my helo_world_kernel which I built using no runtime
>(see http://www.archeia.com for more info).
>
>Having just spoken to Ludovic on #Ada, he pointed out that the gnat
>tools can use a basic cross tool set, like the ones I have built
>myself (again, see the above link). My toolset comprises of a gnat1
>compiler and a gnatbind for my targets. I found that it does work
>using the --GCC and --GNATBIND flags, and I need to make sure the
>cross tools and the host tools are of the same GCC version otherwise
>GNAT throws up ALI format errors.
>
>The thing is, I've been trying to enable exceptions, but keep coming
>across big problems in that the runtime requires features that are
>being restricted, such as returning aggregates and assigning
>composites, returning unconstrained objects which requires the
>secondary stack. So, what I really need to know is, how do I create a
>runtime which is restricted in this way for bare hw access?
>
>Thanks,
>Luke.




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

* Exceptions (was Re: How do I go about creating a minimal GNAT runtime?)
  2009-01-24 20:47 How do I go about creating a minimal GNAT runtime? Lucretia
                   ` (3 preceding siblings ...)
  2009-01-26 21:36 ` anon
@ 2009-02-10  2:34 ` 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
  6 siblings, 0 replies; 23+ messages in thread
From: anon @ 2009-02-10  2:34 UTC (permalink / raw)


To compile and execute a simple program that uses a raise statement 
such as in the following code:

    --
    -- Sample code
    --
    procedure test is
      begin
        raise Program_Error ;
      end test ;

you will need the following list of packages in your "rts/adainclude" and 
the *.ali stored in "rts/adalib". You will also need to build the 
"libgnat.a" by using the "ar r <list of object files>" command and store 
in the "rts/adalib" dir.


a-except.adb  -- Ada.Exceptions            Edited to conform to RM.
a-except.ads                               Simpler design. That removes
                                           most Import/Exports except for
                                           exports for the RChecks 
                                           routines.
                                           Rchecks routines defined in 
                                           body and are rewritten to use 
                                           Raise_Exception instead of 
                                           GNAT's complex algorithm. 
                              

a-unccon.ads  -- Ada.Unchecked_Conversion
ada.ads       -- Ada

s-secsta.adb  -- System.Secondary_Stack    Compiler uses this package for 
s-secsta.ads                               functions that return a string 
                                           value. Also requires
                                           System.Storage_Elements.

s-memory.adb  -- System.Memory             This is a test environmental
s-memory.ads                               package that simulates a heap
                                           Needs a true hardware memory 
                                           management.  That can handle 
                                           static and virtual system.

s-stalib.adb  -- System.Standard_Library   Defines standard Exceptions
s-stalib.ads                               and storage. Basically copied 
                                           from GNAT. 

s-stoele.adb  -- System.Storage_Elements   
s-stoele.ads

system.ads    -- System                    GNAT compiler based.

--
-- Extra packages use for output of exception message
--

g-io.adb      -- GNAT.IO                   use for Put/Put_Line/New_Line
g-io.ads                                   connects to Video_IO

gnat.ads      -- GNAT

video_io.adb  -- Video_IO                  Text/Graphic SAGA device driver
video_io.ads                              



The reason you must rewrite "Ada.Exceptions" is that it uses multiple 
c-to-os functions, which some are defined in:

System.CRTL   -- defines C RTL ( not used in an Ada only OS )
System.Memory -- defines C memory functions. ( Needs be defined 
                 Ada to CPU Memory routines first )
              -- In other words a complete memory management system 
              -- is needs to make this package fully functional, but
              -- it can be simulate by using a large array of bytes.
              -- 
cio.c         -- defines C RTS to OS for I/O operations.  Must be 
              -- converted to a complete sub-system. In my example 
              -- I used a modified "GNAT.IO" and the "Video_IO" 
              -- device driver.

Then there the "System.Soft_Links" package. Do you really need 
it.  In most cases, for the core of the kernel the answer is No!


Now there are some binder variables are procedures that needs to be 
define in Ada, they are normally found in "Initialize.c", "init.c", 
"finalize.c". In my example I create a package called "gnat_library"
to store these in Ada routines and variables.
#
#
#
rm test
gnat compile  gnat_library.adb --RTS=rts
#
gnat compile  test.adb         --RTS=rts
gnat bind     test.ali         --RTS=rts
#
# To make the routine executable, must move the "function main" to 
# the beginning of the ada_main package before compiling.
#
gnat compile  b~test.adb       --RTS=rts -gnatA -gnatWb -gnatiw -gnatws
#
#  gnatlink test.ali gnat_library.o -n -v -v --RTS=rts
#
#  Problem: Adds all gcc libraries and includes host Ada Library Path 
#           and in some case will cause linker to stop processing. So 
#           it still better to use the "gcc" program.
#
gcc  b~test.o gnat_library.o ./test.o text_io.o video_io.o --RTS=rts       \
     -o test -L./ -L/example/ada/gnat/rts/adalib/                          \
     /example/ada/gnat/rts/adalib/libgnat.a
#
#
#


In <eb511600-6446-4bad-b859-0d7444416a4c@d36g2000prf.googlegroups.com>, Lucretia <lucretia9@lycos.co.uk> writes:
>Hi (again),
>
>It's been a while, but I'm coming back to my Ada kernel again. I've
>been messing with my helo_world_kernel which I built using no runtime
>(see http://www.archeia.com for more info).
>
>Having just spoken to Ludovic on #Ada, he pointed out that the gnat
>tools can use a basic cross tool set, like the ones I have built
>myself (again, see the above link). My toolset comprises of a gnat1
>compiler and a gnatbind for my targets. I found that it does work
>using the --GCC and --GNATBIND flags, and I need to make sure the
>cross tools and the host tools are of the same GCC version otherwise
>GNAT throws up ALI format errors.
>
>The thing is, I've been trying to enable exceptions, but keep coming
>across big problems in that the runtime requires features that are
>being restricted, such as returning aggregates and assigning
>composites, returning unconstrained objects which requires the
>secondary stack. So, what I really need to know is, how do I create a
>runtime which is restricted in this way for bare hw access?
>
>Thanks,
>Luke.




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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-01-24 20:47 How do I go about creating a minimal GNAT runtime? Lucretia
                   ` (4 preceding siblings ...)
  2009-02-10  2:34 ` Exceptions (was Re: How do I go about creating a minimal GNAT runtime?) anon
@ 2009-02-16  1:41 ` Hibou57 (Yannick Duchêne)
  2009-02-21  9:11 ` Dimonax
  6 siblings, 0 replies; 23+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2009-02-16  1:41 UTC (permalink / raw)


On 24 jan, 21:47, Lucretia <lucret...@lycos.co.uk> wrote:
> Hi (again),
>
> It's been a while, but I'm coming back to my Ada kernel again. I've
> been messing with my helo_world_kernel which I built using no runtime
> (seehttp://www.archeia.comfor more info).
>
> [...]
> Luke.

It may or may not be useful, any way, there is a online documentation
on the GNAT runtime :
http://www.iuma.ulpgc.es/users/jmiranda/gnat-rts/index.htm

I use to try to patch it (big patch) too, but stoped with this attempt
(after I've understood I could not reach what I was expecting).

By the way, and as you are talking about cross compiler, do you have
some advices on how to create a cross compiler for GNAT 3.15p hosted
on Windows and targeting Linux/Debian ?



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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-01-24 20:47 How do I go about creating a minimal GNAT runtime? Lucretia
                   ` (5 preceding siblings ...)
  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
                     ` (2 more replies)
  6 siblings, 3 replies; 23+ messages in thread
From: Dimonax @ 2009-02-21  9:11 UTC (permalink / raw)


On Sat, 24 Jan 2009 12:47:54 -0800, Lucretia wrote:

> Hi (again),
> 

Hi!
 
Actually I've been learning my way around the Ada Runtime for similiar 
reasons. I say similiar because the goal is different.

I'm a demoscene hacker. Anyone who knows that is knows that a demo 
usually requires a very small footprint.(Look up the 4k demos that have 
been posted up online.)

While my goals arent that lofty, I would like to build a runtime that I 
could fit into a demo that's less than 1024k if at all possible. 64k is 
preferred.

I want the concurrency features mostly, but I love the power of the full 
typing system.

It's pretty easy to build executables using shared libraries (-bargs -
shared under gnat-gcc) that are tiny. But I need to get the whole system 
down as tiny as possible.

So, sound like we have similiar plans even though the goals are different?

Anyone else here looking to do the same?

Freejack




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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-02-21  9:11 ` Dimonax
@ 2009-02-21 16:41   ` anon
  2009-02-21 21:14     ` Dimonax
  2009-02-27 23:42   ` Randy Brukardt
  2009-03-11 12:54   ` gautier_niouzes
  2 siblings, 1 reply; 23+ messages in thread
From: anon @ 2009-02-21 16:41 UTC (permalink / raw)


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. 

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. 

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.


In <0zPnl.16758$YU2.10131@nlpi066.nbdc.sbc.com>, Dimonax <dimonax@nospam.net> writes:
>On Sat, 24 Jan 2009 12:47:54 -0800, Lucretia wrote:
>
>> Hi (again),
>> 
>
>Hi!
> 
>Actually I've been learning my way around the Ada Runtime for similiar 
>reasons. I say similiar because the goal is different.
>
>I'm a demoscene hacker. Anyone who knows that is knows that a demo 
>usually requires a very small footprint.(Look up the 4k demos that have 
>been posted up online.)
>
>While my goals arent that lofty, I would like to build a runtime that I 
>could fit into a demo that's less than 1024k if at all possible. 64k is 
>preferred.
>
>I want the concurrency features mostly, but I love the power of the full 
>typing system.
>
>It's pretty easy to build executables using shared libraries (-bargs -
>shared under gnat-gcc) that are tiny. But I need to get the whole system 
>down as tiny as possible.
>
>So, sound like we have similiar plans even though the goals are different?
>
>Anyone else here looking to do the same?
>
>Freejack
>




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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-02-21 16:41   ` anon
@ 2009-02-21 21:14     ` Dimonax
  2009-02-22  1:36       ` anon
  0 siblings, 1 reply; 23+ messages in thread
From: Dimonax @ 2009-02-21 21:14 UTC (permalink / raw)


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




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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-02-21 21:14     ` Dimonax
@ 2009-02-22  1:36       ` anon
  0 siblings, 0 replies; 23+ messages in thread
From: anon @ 2009-02-22  1:36 UTC (permalink / raw)


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 <dimonax@nospam.net> 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
>




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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-02-21  9:11 ` Dimonax
  2009-02-21 16:41   ` anon
@ 2009-02-27 23:42   ` Randy Brukardt
  2009-03-01  1:12     ` Dimonax
  2009-03-11 12:54   ` gautier_niouzes
  2 siblings, 1 reply; 23+ messages in thread
From: Randy Brukardt @ 2009-02-27 23:42 UTC (permalink / raw)


"Dimonax" <dimonax@nospam.net> wrote in message 
news:0zPnl.16758$YU2.10131@nlpi066.nbdc.sbc.com...
...
> I'm a demoscene hacker. Anyone who knows that is knows that a demo
> usually requires a very small footprint.(Look up the 4k demos that have
> been posted up online.)
>
> While my goals arent that lofty, I would like to build a runtime that I
> could fit into a demo that's less than 1024k if at all possible. 64k is
> preferred.

I can't answer this for GNAT, but there is no reason that an Ada runtime has 
to be hefty. The old Janus/Ada 83 compiler for MS-DOS could produce 
executables as small as 8K without any special tweaking (to get that size, a 
program couldn't use Text_IO or any tasking, though, so it wasn't that 
realistic).

For Windows, things are bigger, but not that much. I see a 70K executable 
for a simple test program left behind in one of my test directories. That 
program uses Text_IO but not any tasking (tasking is automatically omitted 
from the executable if not used). The tasking runtime would push the size up 
to (I think) about 150K.

But of course Janus/Ada was designed from the beginning to make code size 
the most important criteria; other compilers obviously have different goals. 
Trying to fit something into a goal it does not have isn't easy.

                                   Randy.





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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-02-27 23:42   ` Randy Brukardt
@ 2009-03-01  1:12     ` Dimonax
  2009-03-01 19:13       ` anon
  0 siblings, 1 reply; 23+ messages in thread
From: Dimonax @ 2009-03-01  1:12 UTC (permalink / raw)


On Fri, 27 Feb 2009 17:42:17 -0600, Randy Brukardt wrote:
 
> For Windows, things are bigger, but not that much. I see a 70K
> executable for a simple test program left behind in one of my test
> directories. That program uses Text_IO but not any tasking (tasking is
> automatically omitted from the executable if not used). The tasking
> runtime would push the size up to (I think) about 150K.
> 
>                                    Randy.

The easiest way to knock down the size of an Ada binary, that I know of, 
is just to use shared libraries instead of static linking. Of course that 
isnt always an option, but on systems where its supported you might want 
to give it a try.

Dimonax




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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-03-01  1:12     ` Dimonax
@ 2009-03-01 19:13       ` anon
  2009-03-02 22:07         ` Randy Brukardt
  0 siblings, 1 reply; 23+ messages in thread
From: anon @ 2009-03-01 19:13 UTC (permalink / raw)


You need to understand what this person means by "minimal GNAT runtime"
system. From his web site, he means no Linux, Windows or other OS, aka 
the Ada program is the OS and all libraries must be static.  That is, 
until he creates a dynamic or shared library loader, but that means he 
first must build a storage device driver with a file system.

A problem with GNAT and this design is that GNAT uses around 50 packages 
to build and maintain the Exceptions with the compiler forcing a number 
of these packages to be loaded. And some of these packages uses C files 
which uses the C "os_exit" and "abort" routines (OS based) to handle the 
unhanded exceptions which these files must be converted to Ada and the 
OS links be replaced. And some of these C files can exceed 4,000 lines 
of code with comments.

Also, if your talking about the GNAT Ada RTL well there are over 650 
packages in the Ada 2005 version that one has to check and may have to be 
rewrite just to take out the OS links. That around 400K for Ada 95, a lot 
more for the Ada 2005 specs of source code without comments to go 
through as stateed in some runtime documentation that is around. Then you 
have to add some code to handle the hardware exceptions that's normally 
deal with by the OS.

All of this means it a big job.  This could help to explain why Adacores 
charges $15K per years for someone to get those special runtime system 
with GNAT PRO series. 


In <Hhlql.13834$D32.13784@flpi146.ffdc.sbc.com>, Dimonax <dimonax@nospam.net> writes:
>On Fri, 27 Feb 2009 17:42:17 -0600, Randy Brukardt wrote:
> 
>> For Windows, things are bigger, but not that much. I see a 70K
>> executable for a simple test program left behind in one of my test
>> directories. That program uses Text_IO but not any tasking (tasking is
>> automatically omitted from the executable if not used). The tasking
>> runtime would push the size up to (I think) about 150K.
>> 
>>                                    Randy.
>
>The easiest way to knock down the size of an Ada binary, that I know of, 
>is just to use shared libraries instead of static linking. Of course that 
>isnt always an option, but on systems where its supported you might want 
>to give it a try.
>
>Dimonax
>




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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-03-01 19:13       ` anon
@ 2009-03-02 22:07         ` Randy Brukardt
  2009-03-03  2:00           ` anon
  0 siblings, 1 reply; 23+ messages in thread
From: Randy Brukardt @ 2009-03-02 22:07 UTC (permalink / raw)


"anon" <anon@anon.org> wrote in message 
news:R7Bql.409687$Mh5.142056@bgtnsc04-news.ops.worldnet.att.net...
> You need to understand what this person means by "minimal GNAT runtime"
> system. From his web site, he means no Linux, Windows or other OS, aka
> the Ada program is the OS and all libraries must be static.  That is,
> until he creates a dynamic or shared library loader, but that means he
> first must build a storage device driver with a file system.

I understand exactly that. But you chose to ignore my point...

> A problem with GNAT and this design is that GNAT uses around 50 packages 
> ...

...which is that GNAT is *not* designed for this sort of use. Yes, it can be 
made to fit it, sort of, but it wasn't designed to minimize code size / 
runtime size in the way that some other compilers (like Janus/Ada) were.

The old saw "Patient: it hurts if I do X. Doctor: Don't do X." surely 
applies here. If it is hard to do something with GNAT, use a more 
appropriate tool. No compiler can be good at *everything*.

...
> All of this means it a big job.  This could help to explain why Adacores
> charges $15K per years for someone to get those special runtime system
> with GNAT PRO series.

We used to have a bare-machine version of Janus/Ada, as did many other Ada 
vendors, but they were all dropped due to lack of demand. Which is probably 
why GNAT has a design that makes that hard - they didn't think it was that 
important. It takes $$$ to show that sort of interest.

                             Randy.





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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-03-02 22:07         ` Randy Brukardt
@ 2009-03-03  2:00           ` anon
  2009-03-03 22:23             ` lucretia
  0 siblings, 1 reply; 23+ messages in thread
From: anon @ 2009-03-03  2:00 UTC (permalink / raw)


First, my comments was for 'Dimonax' not you. 

Second, you know that a minimal Ada runtime is also called an 'Embedded' 
Ada runtime system. And all Ada vendors including Adacore's GNAT have a 
package or a set of packages that can produce code for most 'Embedded' 
processors including the normal Intel processors (80386 to P4). This list 
could also, include (8088 to 80286) but those processors are limited in 
demand so you may have to pay extra.  As for GNAT the GNU GCC no longer 
support 8/16 bit code so GNAT does not support those type of processors.

This set of processor should now include the current set of processors like 
the Intel Core 2 processors series when they include the Ada 2005 specs. 
And in a few months they could include the Core i7 series aka (i786).


Now, as for your 

        ">No compiler can be good at *everything*." 

statement you forget assembly, which can do everything. It's problem is that 
it not that portable and most programmers prefer the ease of a high-level 
language.

All high-level languages like "C", Java" and even "Lisp" were never 
designed to write an operating system. But C is the main workhorse language 
for todays OS. And Sun built a "Net OS" they called "JAVAOS" which was 
written entirely in Java, they have since abandoned it. 

Then if you go back to the late 1970s and 1980s a few companies such as 
"TI" and "Symbolics" used "Lisp" to create a "Lisp" Computer where the 
processor was wired to used "LISP" functions as the processor language 
and the OS was written in 100% "LISP".

So should "Ada" become the next language for a OS using only Ada? Why not! 
It just that the people who are starting down this road should know that 
its not that easy. And they may have to rewrite the entire GNAT runtime 
system, if they use GNAT as the Ada compiler system or they should get
ready to pay big time if Adacore create a new GNAT runtime.



In <gohlb1$r6h$1@munin.nbi.dk>, "Randy Brukardt" <randy@rrsoftware.com> writes:
>"anon" <anon@anon.org> wrote in message 
>news:R7Bql.409687$Mh5.142056@bgtnsc04-news.ops.worldnet.att.net...
>> You need to understand what this person means by "minimal GNAT runtime"
>> system. From his web site, he means no Linux, Windows or other OS, aka
>> the Ada program is the OS and all libraries must be static.  That is,
>> until he creates a dynamic or shared library loader, but that means he
>> first must build a storage device driver with a file system.
>
>I understand exactly that. But you chose to ignore my point...
>
>> A problem with GNAT and this design is that GNAT uses around 50 packages 
>> ...
>
>....which is that GNAT is *not* designed for this sort of use. Yes, it can be 
>made to fit it, sort of, but it wasn't designed to minimize code size / 
>runtime size in the way that some other compilers (like Janus/Ada) were.
>
>The old saw "Patient: it hurts if I do X. Doctor: Don't do X." surely 
>applies here. If it is hard to do something with GNAT, use a more 
>appropriate tool. No compiler can be good at *everything*.
>
>....
>> All of this means it a big job.  This could help to explain why Adacores
>> charges $15K per years for someone to get those special runtime system
>> with GNAT PRO series.
>
>We used to have a bare-machine version of Janus/Ada, as did many other Ada 
>vendors, but they were all dropped due to lack of demand. Which is probably 
>why GNAT has a design that makes that hard - they didn't think it was that 
>important. It takes $$$ to show that sort of interest.
>
>                             Randy.
>
>




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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-03-03  2:00           ` anon
@ 2009-03-03 22:23             ` lucretia
  2009-03-04  0:03               ` anon
  0 siblings, 1 reply; 23+ messages in thread
From: lucretia @ 2009-03-03 22:23 UTC (permalink / raw)


On Mar 3, 2:00 am, a...@anon.org (anon) wrote:

> All high-level languages like "C", Java" and even "Lisp" were never

You are joking right? C was designed to specifically to write Unix in.

BTW, I'd really wish yo signed your posts so we knew who the hell
we're talking to, rather than "anon"

Luke.



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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-03-03 22:23             ` lucretia
@ 2009-03-04  0:03               ` anon
  0 siblings, 0 replies; 23+ messages in thread
From: anon @ 2009-03-04  0:03 UTC (permalink / raw)


You better go back to school. Two guys at AT&T used C to create that OS, but 
AT&T or those guys had no claim to C.  

C came from BCPL and BCPL came from B which inturn come from language A.
Now, BCPL was design to build compilers not OS. C extented that concept to a
general purpose language, so C was NEVER designed for or by AT&T to created
AT&T OS.

And now some say that C++ which extents C has been replaced by D. But that 
not for this newsgroup.


In <512c4474-98d3-4c5f-8d08-70b5b40d09e1@d2g2000pra.googlegroups.com>, lucretia <lucretia9@lycos.co.uk> writes:
>On Mar 3, 2:00=A0am, a...@anon.org (anon) wrote:
>
>> All high-level languages like "C", Java" and even "Lisp" were never
>
>You are joking right? C was designed to specifically to write Unix in.
>
>BTW, I'd really wish yo signed your posts so we knew who the hell
>we're talking to, rather than "anon"
>
>Luke.




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

* Re: How do I go about creating a minimal GNAT runtime?
  2009-02-21  9:11 ` Dimonax
  2009-02-21 16:41   ` anon
  2009-02-27 23:42   ` Randy Brukardt
@ 2009-03-11 12:54   ` gautier_niouzes
  2 siblings, 0 replies; 23+ messages in thread
From: gautier_niouzes @ 2009-03-11 12:54 UTC (permalink / raw)


Hello,
If you are interested, I've a not-yet-working project called HAC -
description follows...
Send me a mail http://sourceforge.net/users/gdemont
----
HAC - the Hacker's Ada Compiler
===============================

Alternative name: Hello-world Ada Compiler

Objectives:
===========
 - fun!
 - produce the smallest Hello-world executable!

What HAC will never be:
=======================
 - a real, serious Ada compiler - there are enough serious ones!
 - a complete compiler - only a small subset will be covered

History:
========

- 2009: a bit further...
- 1999: translated Mac Pascal sources to Ada
- 1989: SmallAda is derived from CoPascal; works only inside
          very system-dependent environments (a Mac GUI, a DOS GUI)
----

On 21 Feb., 10:11, Dimonax <dimo...@nospam.net> wrote:

> Actually I've been learning my way around the Ada Runtime for similiar
> reasons. I say similiar because the goal is different.
>
> I'm a demoscene hacker. Anyone who knows that is knows that a demo
> usually requires a very small footprint.(Look up the 4k demos that have
> been posted up online.)
>
> While my goals arent that lofty, I would like to build a runtime that I
> could fit into a demo that's less than 1024k if at all possible. 64k is
> preferred.
>
> I want the concurrency features mostly, but I love the power of the full
> typing system.
>
> It's pretty easy to build executables using shared libraries (-bargs -
> shared under gnat-gcc) that are tiny. But I need to get the whole system
> down as tiny as possible.
>
> So, sound like we have similiar plans even though the goals are different?
>
> Anyone else here looking to do the same?
>
> Freejack




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

end of thread, other threads:[~2009-03-11 12:54 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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