From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Ada in command / control systems
Date: Wed, 27 Feb 2019 00:39:33 +0200
Date: 2019-02-27T00:39:33+02:00 [thread overview]
Message-ID: <gdlth6Fhr4qU1@mid.individual.net> (raw)
In-Reply-To: <q54dfq$1t0o$1@gioia.aioe.org>
On 19-02-27 00:10 , lyttlec wrote:
> On 2/26/19 10:50 AM, Simon Wright wrote:
>> "J-P. Rosen" <rosen@adalog.fr> writes:
>>
>>> Le 25/02/2019 à 20:21, russ lyttle a écrit :
>>
>>>> Some items need to be specified to be
>>>> allocated to EEPROM, some to RAM, etc.
>>> You can do that with address clauses.
>>
>> The compiler will straightforwardly distinguish between text, read-only,
>> read-write, and bss.
>>
>> If you need more, you can (GNAT) use pragma Linker_Section: for
>> interrupt vectors for an STM32F4,
>>
>> Vectors : array (-14 .. Ada.Interrupts.Names.FPU_IRQ) of Handler :=
>> (-9 .. -6 | -4 .. -3 => null, -- reserved
>> -14 => Dummy_Handler'Access, -- NMI
>> -13 => HardFault_Handler'Access, -- HardFault
>> -12 => Dummy_Handler'Access, -- MemManagement
>> -11 => Dummy_Handler'Access, -- BusFault
>> -10 => Dummy_Handler'Access, -- UsageFault
>> -5 => SVC_Handler'Access, -- SVCall
>> -2 => PendSV_Handler'Access, -- PendSV
>> -1 => SysTick_Handler'Access, -- SysTick
>> others => IRQ_Handler'Access)
>> with
>> Export,
>> Convention => Ada,
>> External_Name => "isr_vector";
>> pragma Linker_Section (Vectors, ".isr_vector");
>>
>> and then use the linker script to place that section appropriately.
>>
> The "use linker script" part is where I am having difficulty with gnat
> targeting a PC. Haven't tried the STM32F4 yet.
> All I've found so far, including tutorial on AdaCore, apply only to
> Windows and produce errors in Linux.
Simon is talking about targeting embedded, bare metal platforms, where
things like placing certain data or code in EEPROM, or at certain
addresses, make sense. For an OS like Windows or Linux on a PC, usually
there is no EEPROM (accessible to an application), and all special
addreses (such as I/O control registers) are reserved for OS use.
> For example the advice to use
> "-Xlinker -Wl --stack = ..." is Windows only.
Yes, the way you set the stack size of the Ada environment task is
different for each host OS (there was some discussion of this on
comp.lang.ada a while ago, and it was agreed that a portable, standard
method should be defined for Ada, such as using Pragma Storage_Size in
the main subprogram).
For Linux, I believe the environment stack size is not set when linking
the program, but through the shell "ulimit" command when starting the
program.
> We may have to give up and switch back to using Makefile, which
> probably isn't such a bad idea anyway.
I don't see how a Makefile would help with the stack-size setting. It
should be possible to pass all required command-line switches and
arguments through GPS and gprbuild.
I would recommend using a Makefile only if you must run some other tools
in connection with the build. If your build uses only gprbuild or
gnatmake, stick with the GNAT project file, or just with the gnatmake
environment variables (ADA_INCLUDE_PATH, ADA_OBJECTS_PATH).
--
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
. @ .
next prev parent reply other threads:[~2019-02-26 22:39 UTC|newest]
Thread overview: 84+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-25 6:51 Ada in command / control systems Jesper Quorning
2019-02-25 8:24 ` Dmitry A. Kazakov
2019-02-25 9:44 ` Jesper Quorning
2019-02-25 15:54 ` Dmitry A. Kazakov
2019-02-25 13:50 ` russ lyttle
2019-02-25 14:29 ` gautier_niouzes
2019-02-25 15:25 ` Simon Wright
2019-02-25 19:21 ` russ lyttle
2019-02-26 4:50 ` J-P. Rosen
2019-02-26 15:50 ` Simon Wright
2019-02-26 22:10 ` lyttlec
2019-02-26 22:39 ` Niklas Holsti [this message]
2019-02-26 23:09 ` Simon Wright
2019-02-27 13:22 ` russ lyttle
2019-02-27 14:17 ` Niklas Holsti
2019-02-27 17:49 ` russ lyttle
2019-02-25 19:53 ` Tero Koskinen
2019-02-25 20:15 ` russ lyttle
2019-03-01 14:56 ` fabien.chouteau
2019-03-01 16:58 ` Simon Wright
2019-03-01 21:19 ` russ lyttle
2019-03-01 22:32 ` fabien.chouteau
2019-03-01 23:24 ` russ lyttle
2019-02-25 21:18 ` Jesper Quorning
2019-02-26 9:28 ` Maciej Sobczak
2019-02-26 11:01 ` Dmitry A. Kazakov
2019-02-26 21:25 ` Maciej Sobczak
2019-02-27 9:33 ` Dmitry A. Kazakov
2019-02-27 20:46 ` Maciej Sobczak
2019-02-27 21:55 ` Dmitry A. Kazakov
2019-02-28 13:12 ` Maciej Sobczak
2019-02-28 17:43 ` Dmitry A. Kazakov
2019-03-01 9:22 ` Maciej Sobczak
2019-03-01 10:46 ` Dmitry A. Kazakov
2019-03-04 7:03 ` Maciej Sobczak
2019-03-04 14:38 ` Dmitry A. Kazakov
2019-03-05 9:33 ` Maciej Sobczak
2019-03-05 16:09 ` Dmitry A. Kazakov
2019-03-06 9:05 ` Maciej Sobczak
2019-03-06 14:14 ` Dmitry A. Kazakov
2019-03-07 7:02 ` Maciej Sobczak
2019-03-07 9:25 ` Dmitry A. Kazakov
2019-03-08 7:19 ` Maciej Sobczak
2019-03-08 11:08 ` Dmitry A. Kazakov
2019-03-08 17:00 ` Simon Wright
2019-03-08 17:38 ` Dmitry A. Kazakov
2019-03-05 7:18 ` G. B.
2019-03-05 9:28 ` Dmitry A. Kazakov
2019-03-05 9:51 ` Maciej Sobczak
2019-03-05 16:15 ` Dmitry A. Kazakov
2019-03-06 22:02 ` Randy Brukardt
2019-03-05 17:55 ` Niklas Holsti
2019-03-05 21:06 ` Simon Wright
2019-03-06 7:26 ` G. B.
2019-03-06 8:22 ` Dmitry A. Kazakov
2019-03-06 12:04 ` Simon Wright
2019-03-07 7:35 ` G. B.
2019-03-07 9:25 ` Dmitry A. Kazakov
2019-03-06 9:17 ` Maciej Sobczak
2019-03-08 22:45 ` russ lyttle
2019-03-09 8:16 ` Simon Wright
2019-03-09 8:59 ` Dmitry A. Kazakov
2019-03-09 18:47 ` russ lyttle
2019-03-09 20:06 ` G.B.
2019-03-09 20:38 ` Dmitry A. Kazakov
2019-03-09 18:34 ` russ lyttle
2019-03-09 19:28 ` Simon Wright
2019-03-10 21:13 ` lyttlec
2019-03-11 8:56 ` Simon Wright
2019-03-11 14:27 ` russ lyttle
2019-03-11 17:01 ` Simon Wright
2019-03-11 21:55 ` russ lyttle
2019-03-05 11:59 ` russ lyttle
2019-03-05 18:18 ` Dmitry A. Kazakov
2019-03-06 2:01 ` lyttlec
2019-03-06 8:29 ` Dmitry A. Kazakov
2019-02-26 15:54 ` Simon Wright
2019-02-26 21:43 ` Maciej Sobczak
2019-02-26 22:45 ` Simon Wright
2019-02-27 8:41 ` Dmitry A. Kazakov
2019-02-27 20:55 ` Maciej Sobczak
2019-02-27 21:26 ` Simon Wright
2019-02-27 22:08 ` Dmitry A. Kazakov
2019-02-27 11:04 ` Jesper Quorning
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox