• Working around -freestanding limitations?

    From Hou Van Boere@21:1/5 to All on Sat Apr 1 05:26:37 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to Hou Van Boere on Sat Apr 1 14:35:23 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hou Van Boere@21:1/5 to All on Sat Apr 1 09:12:54 2023
    " -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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Niklas Holsti@21:1/5 to Hou Van Boere on Sat Apr 1 19:14:28 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hou Van Boere@21:1/5 to All on Sat Apr 1 09:45:50 2023
    yes thanks -ffreestanding, -freestanding was a typo, sorry

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hou Van Boere@21:1/5 to All on Sat Apr 1 09:42:26 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hou Van Boere@21:1/5 to All on Sat Apr 1 09:50:28 2023
    " 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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DrPi@21:1/5 to All on Sat Apr 1 18:55:36 2023
    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/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hou Van Boere@21:1/5 to All on Sat Apr 1 09:58:49 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DrPi@21:1/5 to All on Sat Apr 1 18:54:20 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DrPi@21:1/5 to All on Sat Apr 1 19:02:15 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hou Van Boere@21:1/5 to All on Sat Apr 1 09:59:15 2023
    Thanks for the link

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DrPi@21:1/5 to All on Sat Apr 1 18:59:42 2023
    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).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DrPi@21:1/5 to All on Sat Apr 1 18:29:45 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hou Van Boere@21:1/5 to All on Sat Apr 1 10:24:28 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hou Van Boere@21:1/5 to All on Sat Apr 1 11:57:16 2023
    Thanks for the fantastic help today DrPi

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DrPi@21:1/5 to All on Sat Apr 1 20:33:36 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DrPi@21:1/5 to All on Sat Apr 1 21:27:40 2023
    Le 01/04/2023 à 20:57, Hou Van Boere a écrit :
    Thanks for the fantastic help today DrPi
    You're welcome :)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From philip.munts@gmail.com@21:1/5 to All on Wed Apr 5 09:21:44 2023
    I would suggest you look at my Linux Simple I/O Library: https://github.com/pmunts/libsimpleio
    The Ada binding makes it pretty easy to build test fixtures, control devices, etc. I even used an Ada program to replace a multizone sprinkler controller.

    Next, take a look at MuntsOS Embedded Linux: https://github.com/pmunts/muntsos

    Together, they make it possible to replace many microcontroller applications with a Raspberry Pi or a BeagleBone or a PocketBeagle. With the Raspberry Pi family, it is very easy to fabricate custom boards using a Raspberry Pi Zero, CM3, or CM4 (least to
    most complex) as a CPU module. If you run Raspberry Pi OS instead of MuntsOS, it is even self hosting.

    Currently I don't have any support for IEEE-488, though I have a USB interface and and old CalComp plotter on the shelf I've been meaning to play around with.

    I'll be teaching a workshop at AdaEurope 2023 in Lisbon in June showing how all this works.

    Regards, Phil

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hou Van Boere@21:1/5 to All on Wed Apr 5 11:44:41 2023
    Thanks Phil! Huge help

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)