From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: ANN: Cortex GNAT RTS 2018-07-15 Date: Mon, 16 Jul 2018 12:56:45 +0100 Organization: A noiseless patient Spider Message-ID: References: <87in5gf9nt.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="3287f85329b59e6d5bcd46787983fc9a"; logging-data="1987"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KvD8a7IeJmOk6oy6F+B++LXcpyMMdWwM=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:cGIWlmEEEa9zMHrVN/UQxD7eHgs= sha1:W5H2rVIFZFa2aGx604de63EVwIw= Xref: reader02.eternal-september.org comp.lang.ada:53842 Date: 2018-07-16T12:56:45+01:00 List-Id: Paul Rubin writes: > Can you say about how hard it is to port GNAT RTS to a new board, > given a reasonable C environment for the board? How much code space > and ram is required? I don't know about the AdaCore RTS, but I imagine it'll be much the same as this one (after you've got to grips with the deeply nested, use-clause-happy code :-) For this one, I started on 1 July and had a working RTS (bar an issue with the board clock, discovered later) by 4 July. The issues (once you have a base RTS for one ARM board) are * startup, any RAM/Flash/FPU settings, clock * interrupts, interrupt priority range, names For the micro:bit, compiling with -O0 and assertions enabled, I get, for the RTS + other support, in a program with delays, a task, and an interrupt-handling PO, text libgcc 1380 gnat 10132 freertos 7724 libc 280 rodata gnat 1252 data gnat 220 freertos 4 bss gnat 68 freertos 340 The base RAM use (data + bss) for this program was 900 bytes. Out of the remaining RAM (15484), it used (via heap allocations) initial/interrupt stack 1024 environment task stack 1536 1 task stack 1024 others? 828 and the free heap was 11072 (those numbers don't quite add up, I think there's some overhead in the heap management maybe). I'm not sure why the environment task stack needs to be so high (it does elaboration + Ada main). The task stack could probably be lower, one outstanding job is to work out a way of measuring task stack usage.