comp.lang.ada
 help / color / mirror / Atom feed
* Where to get Zero Footprint Profile?
@ 2014-05-24 18:00 droiddermo
  2014-05-24 18:50 ` ake.ragnar.dahlgren
  0 siblings, 1 reply; 8+ messages in thread
From: droiddermo @ 2014-05-24 18:00 UTC (permalink / raw)


It is said that Zero Footprint Profile allows some restricted Ada subset to be compiled and run on bare metal (without relying on any code from standard Ada's runtime library). So for example ZFP should allow us to create operating system using Ada. Basically ZFP is a tiny runtime library, that implements only compiler's intrinsics and doesn't rely on any services that are provided by operating system. But where to get ZFP?  GNAT GPL provides only default runtime library (profile). I've googled out that some people reinvent a tiny subset of ZFP in order to make their OS experiments, like it is done here: https://github.com/Lucretia/tamp... So is there any ZFP available and where to get it, or I have to reimplement it myself?


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

* Re: Where to get Zero Footprint Profile?
  2014-05-24 18:00 Where to get Zero Footprint Profile? droiddermo
@ 2014-05-24 18:50 ` ake.ragnar.dahlgren
  2014-05-25  8:39   ` droiddermo
  0 siblings, 1 reply; 8+ messages in thread
From: ake.ragnar.dahlgren @ 2014-05-24 18:50 UTC (permalink / raw)


Have you read the information at the Ada Bare Bones site?

http://wiki.osdev.org/Ada_Bare_bones

Best regards,
Åke Ragnar Dahlgren


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

* Re: Where to get Zero Footprint Profile?
  2014-05-24 18:50 ` ake.ragnar.dahlgren
@ 2014-05-25  8:39   ` droiddermo
  2014-05-25 14:25     ` Luke A. Guest
  0 siblings, 1 reply; 8+ messages in thread
From: droiddermo @ 2014-05-25  8:39 UTC (permalink / raw)


> Have you read the information at the Ada Bare Bones site?
Yes, I have. This is exactly what is done in Tamp project (I've put the link in the first post). The article suggest to reimplement ZFP yourself by copying and editing some files from original runtime library. I'd like to have a look at the full ZFP. It seems that Adacore provide it only for their customers.




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

* Re: Where to get Zero Footprint Profile?
  2014-05-25  8:39   ` droiddermo
@ 2014-05-25 14:25     ` Luke A. Guest
  2014-05-25 18:42       ` droiddermo
  0 siblings, 1 reply; 8+ messages in thread
From: Luke A. Guest @ 2014-05-25 14:25 UTC (permalink / raw)


<droiddermo@gmail.com> wrote:
>> Have you read the information at the Ada Bare Bones site?
> Yes, I have. This is exactly what is done in Tamp project (I've put the
> link in the first post). The article suggest to reimplement ZFP yourself
> by copying and editing some files from original runtime library. I'd like
> to have a look at the full ZFP. It seems that Adacore provide it only for their customers.

They are both my projects.

You create the zfp by copying the relevant source files from the version of
gnat source you have, they are all intrinsics so don't need any rt.
Interfaces.c needs to have the subprigrams removing as they return I
constrained types, unless you enable a simple secondary stack.

Like


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

* Re: Where to get Zero Footprint Profile?
  2014-05-25 14:25     ` Luke A. Guest
@ 2014-05-25 18:42       ` droiddermo
  2014-05-25 19:34         ` Luke A. Guest
                           ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: droiddermo @ 2014-05-25 18:42 UTC (permalink / raw)


> You create the zfp by copying the relevant source files from the version of
> gnat source you have, they are all intrinsics so don't need any rt.
> Interfaces.c needs to have the subprigrams removing as they return I
> constrained types, unless you enable a simple secondary stack.
Thanks! So as far as I understood there is no ready to use ZFP available for free? Is there any good read about Ada's runtime, compiler's intrinsics and using Ada for bare bones development in general? For example I don't quite understand what is secondary stack and what it is used for. Also from reading Ada bare bones page on osdev I didn't understand why you had to disable recursive calls, is it somehow dependent on some runtime's code?




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

* Re: Where to get Zero Footprint Profile?
  2014-05-25 18:42       ` droiddermo
@ 2014-05-25 19:34         ` Luke A. Guest
  2014-05-26  0:39         ` Robert A Duff
  2014-05-26  8:26         ` Brian Drummond
  2 siblings, 0 replies; 8+ messages in thread
From: Luke A. Guest @ 2014-05-25 19:34 UTC (permalink / raw)


<droiddermo@gmail.com> wrote:
>> You create the zfp by copying the relevant source files from the version of
>> gnat source you have, they are all intrinsics so don't need any rt.
>> Interfaces.c needs to have the subprigrams removing as they return I
>> constrained types, unless you enable a simple secondary stack.
> Thanks! So as far as I understood there is no ready to use ZFP available
> for free? Is there any good read about Ada's runtime, compiler's
> intrinsics and using Ada for bare bones development in general? For
> example I don't quite understand what is secondary stack and what it is
> used for. Also from reading Ada bare bones page on osdev I didn't
> understand why you had to disable recursive calls, is it somehow
> dependent on some runtime's code?

If you grab tamp, look at the rts dir that has a zfp ready runtime using
the 4.6.x source, do a diff on the latest version in case of changes but I
doubt there will be any. It also buds using gpr files.

I probably disabled reversion as you have limited stack. There's a ton of
things you can restrict or turn off.


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

* Re: Where to get Zero Footprint Profile?
  2014-05-25 18:42       ` droiddermo
  2014-05-25 19:34         ` Luke A. Guest
@ 2014-05-26  0:39         ` Robert A Duff
  2014-05-26  8:26         ` Brian Drummond
  2 siblings, 0 replies; 8+ messages in thread
From: Robert A Duff @ 2014-05-26  0:39 UTC (permalink / raw)


droiddermo@gmail.com writes:

> ...For example I don't quite understand what is secondary stack
> and what it is used for.

The secondary stack is used for caller-unknown-sized function results.
That is, function results that are of indefinite subtype.
For example, if you have:

    function F(...) return String is
        Length: Natural := ...; -- who knows what?
        Result: String(1..Length) := (others => 'A');
    begin
        return Result;
    end F;

Then somewhere else:

    X: constant String := F(...);

then F will return its result on the secondary stack.
The caller (declaration of X) doesn't know the size of the
result of F.  So F allocates its result on the secondary stack,
and then returns the address of that result to the caller.

You can look at s-secsta.ad[sb] to see how it works by default.

If the result subtype of F were "subtype S is String(1..80);",
then it would not use the secondary stack.

- Bob

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

* Re: Where to get Zero Footprint Profile?
  2014-05-25 18:42       ` droiddermo
  2014-05-25 19:34         ` Luke A. Guest
  2014-05-26  0:39         ` Robert A Duff
@ 2014-05-26  8:26         ` Brian Drummond
  2 siblings, 0 replies; 8+ messages in thread
From: Brian Drummond @ 2014-05-26  8:26 UTC (permalink / raw)


On Sun, 25 May 2014 11:42:27 -0700, droiddermo wrote:

>> You create the zfp by copying the relevant source files from the
>> version of gnat source you have, they are all intrinsics so don't need
>> any rt. Interfaces.c needs to have the subprigrams removing as they
>> return I constrained types, unless you enable a simple secondary stack.

> Thanks! So as far as I understood there is no ready to use ZFP available
> for free? Is there any good read about Ada's runtime, compiler's
> intrinsics and using Ada for bare bones development in general? For
> example I don't quite understand what is secondary stack and what it is
> used for. Also from reading Ada bare bones page on osdev I didn't
> understand why you had to disable recursive calls, is it somehow
> dependent on some runtime's code?

There is a slightly more developed version for the AVR microprocessors, 
which appears to support a secondary stack, at 
http://sourceforge.net/projects/avr-ada/

I found it relatively easy to adapt for the TI MSP430 processors, at 
http://sourceforge.net/projects/msp430ada/

You may get some idea of what's involved by comparing these two, and 
adapting as required for your target processor. If so, please put your 
work out there so that some day, we may draw together all these disparate 
efforts into something more coherent...

Another unrelated effort targetting ARM processors, with the intent 
eventually to support the Ravenscar profile:

http://sourceforge.net/projects/arm-ada/

- Brian

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

end of thread, other threads:[~2014-05-26  8:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-24 18:00 Where to get Zero Footprint Profile? droiddermo
2014-05-24 18:50 ` ake.ragnar.dahlgren
2014-05-25  8:39   ` droiddermo
2014-05-25 14:25     ` Luke A. Guest
2014-05-25 18:42       ` droiddermo
2014-05-25 19:34         ` Luke A. Guest
2014-05-26  0:39         ` Robert A Duff
2014-05-26  8:26         ` Brian Drummond

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