From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.IIfIc3CB/+nKo+wKq8+a0g.user.gioia.aioe.org!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: is there a version of unix written in Ada Date: Tue, 28 Jul 2020 17:48:46 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <27b1bda0-bf22-4bd1-a5f9-2085c8ff2014n@googlegroups.com> <5f20233c$0$24260$426a74cc@news.free.fr> NNTP-Posting-Host: IIfIc3CB/+nKo+wKq8+a0g.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:wDvsz4x9dR+T7aHrU6q/GQnG5bo= Xref: reader01.eternal-september.org comp.lang.ada:59574 List-Id: DrPi <314@drpi.fr> writes: > Ada has embedded thread scheduling. What's the usefulness of m2os ? The Ada language defines the syntax and semantics of tasking, but whether an implementation supports tasking is a different matter. If tasking is supported, there will be a runtime system that provides it, and the compiler knows how to translate the code you write into calls on that runtime system. If you write 'task T;' the code generated by GNAT (in a Ravenscar system) will call procedure Create_Restricted_Task (Priority : Integer; Stack_Address : System.Address; Size : System.Parameters.Size_Type; Sec_Stack_Address : System.Secondary_Stack.SS_Stack_Ptr; Secondary_Stack_Size : System.Parameters.Size_Type; Task_Info : System.Task_Info.Task_Info_Type; CPU : Integer; State : Task_Procedure_Access; Discriminants : System.Address; Elaborated : Access_Boolean; Chain : in out Activation_Chain; Task_Image : String; Created_Task : Task_Id); The procedure body is the business of the specific runtime system. M2OS doesn't support Ada tasking at all. Instead, it provides a set of primitive operations or API (see the web site); to create a "task", you provide an initialization procedure and a body procedure and call an API operation to register the code so that it can be called when necessary. A higher-level facility can translate your code using (some?) Ada tasking constructs into equivalent code calling the M2OS API. The advantage claimed is that the memory footprint is much reduced, so that the application will fit into a smaller MCU.