* Working around -freestanding limitations?
@ 2023-04-01 12:26 Hou Van Boere
2023-04-01 13:35 ` Simon Wright
` (2 more replies)
0 siblings, 3 replies; 19+ messages in thread
From: Hou Van Boere @ 2023-04-01 12:26 UTC (permalink / raw)
Hi Everyone.
I know there are several floss RTOS option for us but I don't really need all of the supports they offer and they just make things more complex.
Here are my goals:
1)I want to build my own circuit board with a microprocessor not microcontroller.
2)I want to run with gcc/gnatmake ... -freestanding
3)I only need the Ada 83 subset, which I guess is pretty close to Ravenscaler
What options do I have? I like to keep things small and simple when possible.
Thanks for reading
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 12:26 Working around -freestanding limitations? Hou Van Boere
@ 2023-04-01 13:35 ` Simon Wright
2023-04-01 16:12 ` Hou Van Boere
2023-04-01 16:14 ` Niklas Holsti
[not found] ` <63838a3b-16d2-4ab3-8df4-9fb02a2b700cn@googlegroups.com>
2 siblings, 1 reply; 19+ messages in thread
From: Simon Wright @ 2023-04-01 13:35 UTC (permalink / raw)
Hou Van Boere <houvanboere@gmail.com> writes:
> 2)I want to run with gcc/gnatmake ... -freestanding
-freestanding isn't an option for gnatmake; where does it come from?
> 3)I only need the Ada 83 subset, which I guess is pretty close to Ravenscaler
The Ada 83 subset is going to be larger than Ravenscar.
If you don't want an RTOS you could use one of the light runtimes,
e.g. light-cortex-m0.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 13:35 ` Simon Wright
@ 2023-04-01 16:12 ` Hou Van Boere
2023-04-01 16:29 ` DrPi
2023-04-01 16:50 ` Hou Van Boere
0 siblings, 2 replies; 19+ messages in thread
From: Hou Van Boere @ 2023-04-01 16:12 UTC (permalink / raw)
" -freestanding isn't an option for gnatmake; where does it come from?"
Ha ha, chatGPT :)
Could you tell me where to find the light runtimes? I have only worked with Ada on full desktops. Does the FSF version ship with light runtimes?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 12:26 Working around -freestanding limitations? Hou Van Boere
2023-04-01 13:35 ` Simon Wright
@ 2023-04-01 16:14 ` Niklas Holsti
2023-04-01 16:42 ` Hou Van Boere
2023-04-01 16:54 ` DrPi
[not found] ` <63838a3b-16d2-4ab3-8df4-9fb02a2b700cn@googlegroups.com>
2 siblings, 2 replies; 19+ messages in thread
From: Niklas Holsti @ 2023-04-01 16:14 UTC (permalink / raw)
On 2023-04-01 15:26, Hou Van Boere wrote:
> Hi Everyone.
>
> I know there are several floss RTOS option for us but I don't really
> need all of the supports they offer and they just make things more
> complex.
Certainly using most RTOS from Ada is more complex than using an Ada RTS
from Ada.
Do you want to use tasking at all? Or just a single thread?
> Here are my goals:
>
> 1)I want to build my own circuit board with a microprocessor not microcontroller.
Can you explain why? Input/output is often more complex with a
microprocessor (I assume you mean something that could run a PC or a
tablet) than with a microcontroller. A microprocessor may need a lot of
complex initialization and driver SW which you can get in some RTOS but
not in an Ada RTS. And I believe that circuit-board design is more
complex for microprocessors than for microcontrollers, however I have no
experience with either case.
> 2)I want to run with gcc/gnatmake ... -freestanding
>
> 3)I only need the Ada 83 subset, which I guess is pretty close to Ravenscaler
I see the Ada 83 tasking features as almost orthogonal to Ravenscar. Ada
83 has no protected objects, and all inter-task communication must be
done with rendez-vous using task entries. Ravenscar forbids task entries
and rendez-vous and substitutes protected objects. Both work, but
Ravenscar is perhaps more resistant to deadlock errors.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 16:12 ` Hou Van Boere
@ 2023-04-01 16:29 ` DrPi
2023-04-01 16:45 ` Hou Van Boere
2023-04-01 16:50 ` Hou Van Boere
1 sibling, 1 reply; 19+ messages in thread
From: DrPi @ 2023-04-01 16:29 UTC (permalink / raw)
Le 01/04/2023 à 18:12, Hou Van Boere a écrit :
> " -freestanding isn't an option for gnatmake; where does it come from?"
> Ha ha, chatGPT :)
>
I guess it is -ffreestanding :
https://stackoverflow.com/questions/17692428/what-is-ffreestanding-option-in-gcc
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 16:14 ` Niklas Holsti
@ 2023-04-01 16:42 ` Hou Van Boere
2023-04-01 16:59 ` DrPi
2023-04-01 16:54 ` DrPi
1 sibling, 1 reply; 19+ messages in thread
From: Hou Van Boere @ 2023-04-01 16:42 UTC (permalink / raw)
Thanks for your feedback Niklas. I am new to Ravenscar(just spelled it wrong today), this is very helpful.
It would be nice to have threads but I am not sure I actually need them.
I have serviced scientific instruments for 24 years now. I want to start fabricating them. I will have some bumps along the way with PCB design but I am confident that it will work out.
I have been playing around with Ada since 2012 but I still have lots to learn and I don't program in the day so it is not my strong suit. The hardware side should work out but I am worried about the software end of things. Ada is lovely but massive. There are so many features, so many libraries(some of which are abandoned). There are only so many hours in a day.
I have a subset of the language I like and if I can just control CPU address and data lines, I shouldn't need a RTOS. Trying several of them out could take a great deal of time.
I don't seem to have any extra runtimes with my install:
gnatls -v
GNATLS 11.2.0
Copyright (C) 1997-2021, Free Software Foundation, Inc.
Source Search Path:
<Current_Directory>
/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/adainclude
Object Search Path:
<Current_Directory>
/usr/lib64/gcc/x86_64-slackware-linux/11.2.0/adalib
Project Search Path:
<Current_Directory>
/usr/x86_64-slackware-linux/lib/gnat
/usr/x86_64-slackware-linux/share/gpr
/usr/share/gpr
/usr/lib/gnat
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 16:29 ` DrPi
@ 2023-04-01 16:45 ` Hou Van Boere
0 siblings, 0 replies; 19+ messages in thread
From: Hou Van Boere @ 2023-04-01 16:45 UTC (permalink / raw)
yes thanks -ffreestanding, -freestanding was a typo, sorry
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 16:12 ` Hou Van Boere
2023-04-01 16:29 ` DrPi
@ 2023-04-01 16:50 ` Hou Van Boere
2023-04-01 16:55 ` DrPi
1 sibling, 1 reply; 19+ messages in thread
From: Hou Van Boere @ 2023-04-01 16:50 UTC (permalink / raw)
" Could you tell me where to find the light runtimes? I have only worked with Ada on full desktops. Does the FSF version ship with light runtimes?"
I am just answering my own question to avoid wasting people's time. I fount this:
https://github.com/AdaCore/bb-runtimes
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 16:14 ` Niklas Holsti
2023-04-01 16:42 ` Hou Van Boere
@ 2023-04-01 16:54 ` DrPi
2023-04-01 16:58 ` Hou Van Boere
1 sibling, 1 reply; 19+ messages in thread
From: DrPi @ 2023-04-01 16:54 UTC (permalink / raw)
>> 1)I want to build my own circuit board with a microprocessor not
>> microcontroller.
>
>
> Can you explain why? Input/output is often more complex with a
> microprocessor (I assume you mean something that could run a PC or a
> tablet) than with a microcontroller. A microprocessor may need a lot of
> complex initialization and driver SW which you can get in some RTOS but
> not in an Ada RTS. And I believe that circuit-board design is more
> complex for microprocessors than for microcontrollers, however I have no
> experience with either case.
Nowadays, microprocessors are rare. Even x86 microprocessors could be
named microcontrollers since they integrate many (not all) peripherals.
High end microcontrollers are very complex to initialize. Especially
since they integrate security functionalities (like secure boot), SDRAM
controllers, PCIe controllers, Gigabit Ethernet controllers, 3D GPUs,
video encoders/decoders, camera interface, LCD interface, HDMI interface...
Even middle range microcontrollers are (very) complex.
Manufacturers provide drivers source code (in C) for all peripherals.
They also provide tools to graphically set chip configuration and output
C code to help the programmer.
Complexity depends on the chip you choose.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 16:50 ` Hou Van Boere
@ 2023-04-01 16:55 ` DrPi
2023-04-01 16:59 ` Hou Van Boere
0 siblings, 1 reply; 19+ messages in thread
From: DrPi @ 2023-04-01 16:55 UTC (permalink / raw)
Le 01/04/2023 à 18:50, Hou Van Boere a écrit :
> " Could you tell me where to find the light runtimes? I have only worked with Ada on full desktops. Does the FSF version ship with light runtimes?"
>
> I am just answering my own question to avoid wasting people's time. I fount this:
> https://github.com/AdaCore/bb-runtimes
The best way is to use Alire https://alire.ada.dev/
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 16:54 ` DrPi
@ 2023-04-01 16:58 ` Hou Van Boere
2023-04-01 17:02 ` DrPi
0 siblings, 1 reply; 19+ messages in thread
From: Hou Van Boere @ 2023-04-01 16:58 UTC (permalink / raw)
Thanks DrPi
I will probably stick with what I know. Most of the instruments I work on have Motorola chips and parallel buses. I don't think i will use SPi, IC2 or dozens of other protocols/features found in most modern circuit boards.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 16:55 ` DrPi
@ 2023-04-01 16:59 ` Hou Van Boere
0 siblings, 0 replies; 19+ messages in thread
From: Hou Van Boere @ 2023-04-01 16:59 UTC (permalink / raw)
Thanks for the link
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 16:42 ` Hou Van Boere
@ 2023-04-01 16:59 ` DrPi
0 siblings, 0 replies; 19+ messages in thread
From: DrPi @ 2023-04-01 16:59 UTC (permalink / raw)
Le 01/04/2023 à 18:42, Hou Van Boere a écrit :
> Thanks for your feedback Niklas. I am new to Ravenscar(just spelled it wrong today), this is very helpful.
>
> It would be nice to have threads but I am not sure I actually need them.
>
> I have serviced scientific instruments for 24 years now. I want to start fabricating them. I will have some bumps along the way with PCB design but I am confident that it will work out.
>
> I have been playing around with Ada since 2012 but I still have lots to learn and I don't program in the day so it is not my strong suit. The hardware side should work out but I am worried about the software end of things. Ada is lovely but massive. There are so many features, so many libraries(some of which are abandoned). There are only so many hours in a day.
>
> I have a subset of the language I like and if I can just control CPU address and data lines, I shouldn't need a RTOS. Trying several of them out could take a great deal of time.
>
> I don't seem to have any extra runtimes with my install:
Today, the easiest route is to use ARM based chips as there are
maintained runtimes for them (through Alire and bbruntimes).
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 16:58 ` Hou Van Boere
@ 2023-04-01 17:02 ` DrPi
2023-04-01 17:24 ` Hou Van Boere
0 siblings, 1 reply; 19+ messages in thread
From: DrPi @ 2023-04-01 17:02 UTC (permalink / raw)
Le 01/04/2023 à 18:58, Hou Van Boere a écrit :
> Thanks DrPi
>
> I will probably stick with what I know. Most of the instruments I work on have Motorola chips and parallel buses. I don't think i will use SPi, IC2 or dozens of other protocols/features found in most modern circuit boards.
Great chips at their time but I'm afraid you'll have hard time compiling
a dedicated GNAT compiler.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 17:02 ` DrPi
@ 2023-04-01 17:24 ` Hou Van Boere
2023-04-01 18:33 ` DrPi
0 siblings, 1 reply; 19+ messages in thread
From: Hou Van Boere @ 2023-04-01 17:24 UTC (permalink / raw)
I am sure you are right but still, you get the general idea.
Thermo Electron has pretty much bought most of the industry out. I will copy and paste, mix and match old stuff to re-implement instruments they don't care about anymore. I don't need to make anything cutting edge. The old stuff was more than good enough
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 17:24 ` Hou Van Boere
@ 2023-04-01 18:33 ` DrPi
2023-04-01 18:57 ` Hou Van Boere
0 siblings, 1 reply; 19+ messages in thread
From: DrPi @ 2023-04-01 18:33 UTC (permalink / raw)
Le 01/04/2023 à 19:24, Hou Van Boere a écrit :
> I am sure you are right but still, you get the general idea.
>
> Thermo Electron has pretty much bought most of the industry out. I will copy and paste, mix and match old stuff to re-implement instruments they don't care about anymore. I don't need to make anything cutting edge. The old stuff was more than good enough
Indeed, an interesting project.
You first need a Ada cross-compiler. Here is a link about this :
https://wiki.osdev.org/GNAT_Cross-Compiler
You also need a runtime. This is up to you to code it. You can use
bbruntimes as a template. This can request modifications on your
hardware. For example, the runtime needs a timer to track time. If your
microprocessor do not have an embedded timer, you'll have to add one on
your board.
Other links of interest :
https://forum.ada-lang.io/
https://github.com/ohenley/awesome-ada
Matrix rooms (https://matrix.org/clients) :
Ada news : https://matrix.to/#/#ada-lang:matrix.org
Ada language : https://matrix.to/#/#ada-lang:matrix.org
Alire : https://matrix.to/#/#ada-lang_Alire:gitter.im
Many other resources exist.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 18:33 ` DrPi
@ 2023-04-01 18:57 ` Hou Van Boere
2023-04-01 19:27 ` DrPi
0 siblings, 1 reply; 19+ messages in thread
From: Hou Van Boere @ 2023-04-01 18:57 UTC (permalink / raw)
Thanks for the fantastic help today DrPi
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
2023-04-01 18:57 ` Hou Van Boere
@ 2023-04-01 19:27 ` DrPi
0 siblings, 0 replies; 19+ messages in thread
From: DrPi @ 2023-04-01 19:27 UTC (permalink / raw)
Le 01/04/2023 à 20:57, Hou Van Boere a écrit :
> Thanks for the fantastic help today DrPi
You're welcome :)
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Working around -freestanding limitations?
[not found] ` <63838a3b-16d2-4ab3-8df4-9fb02a2b700cn@googlegroups.com>
@ 2023-04-05 18:44 ` Hou Van Boere
0 siblings, 0 replies; 19+ messages in thread
From: Hou Van Boere @ 2023-04-05 18:44 UTC (permalink / raw)
Thanks Phil! Huge help
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2023-04-05 18:44 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-01 12:26 Working around -freestanding limitations? Hou Van Boere
2023-04-01 13:35 ` Simon Wright
2023-04-01 16:12 ` Hou Van Boere
2023-04-01 16:29 ` DrPi
2023-04-01 16:45 ` Hou Van Boere
2023-04-01 16:50 ` Hou Van Boere
2023-04-01 16:55 ` DrPi
2023-04-01 16:59 ` Hou Van Boere
2023-04-01 16:14 ` Niklas Holsti
2023-04-01 16:42 ` Hou Van Boere
2023-04-01 16:59 ` DrPi
2023-04-01 16:54 ` DrPi
2023-04-01 16:58 ` Hou Van Boere
2023-04-01 17:02 ` DrPi
2023-04-01 17:24 ` Hou Van Boere
2023-04-01 18:33 ` DrPi
2023-04-01 18:57 ` Hou Van Boere
2023-04-01 19:27 ` DrPi
[not found] ` <63838a3b-16d2-4ab3-8df4-9fb02a2b700cn@googlegroups.com>
2023-04-05 18:44 ` Hou Van Boere
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox