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: Sat, 28 Jul 2018 12:18:48 +0100 Organization: A noiseless patient Spider Message-ID: References: <87in5gf9nt.fsf@nightsong.com> <87wothrqrs.fsf@nightsong.com> <87in50e71g.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="bbb0e8094028d300776d161df5575061"; logging-data="16369"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+JuTc3YhlkYT2HTMAagQAi7XQJGZA1qDY=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:B6XM0ki0MQlW4aqJB73JvFlscXc= sha1:ly9HsVlRxj/A8mJ1/Fy/hqJsirU= Xref: reader02.eternal-september.org comp.lang.ada:53999 Date: 2018-07-28T12:18:48+01:00 List-Id: Paul Rubin writes: > Simon Wright writes: >> I agree that a considerable chunk of FreeRTOS could probably be >> replaced by straightforward Ada code, but that'd be someone else's >> project! > > Thanks. I wasn't suggesting that you rewrite FreeRTOS, but rather, I > was just wondering if there were technical obstacles to doing such > such machine-level stuff in Ada. Not really: you are coming at things from underneath, so need a different mindset. The tricky part is organising context swaps, I think. GCC supports in-line assembler, so for instance you can tell whether you're in an ISR on an ARM processor (v6, v7 anyway) by an MRS instruction, and I have no doubt you can do the same for context swaps; but it's very architecture-specific. >> The RTOS part of AdaCore's embedded Ravenscar RTOSs (s-bb*.ad?) is >> about 5500 lines (1250 semicolons) of Ada. > > Fabien also Chouteau mentioned this. Does it do mostly the same stuff > as FreeRTOS? I had thought Ravenscar was deliberately very limited. Ravenscar limits what tasks/protected objects can do (for example, tasks must be declared at library level; tasks mustn't exit; no task entries; POs can only have one entry) which (a) makes it possible to argue about correctness and (b) greatly reduces the complexity of the RTS. AdaCore's RTS does considerably more than I've implemented in Cortex GNAT RTS, e.g. multiprocessing - which I think FreeRTOS would support - but it's still Ravenscar tasking.