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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.163.166 with SMTP id a26mr699328yhl.22.1375973945090; Thu, 08 Aug 2013 07:59:05 -0700 (PDT) X-Received: by 10.49.86.39 with SMTP id m7mr246169qez.37.1375973944988; Thu, 08 Aug 2013 07:59:04 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder02.blueworldhosting.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!fx3no1678214qab.0!news-out.google.com!he10ni877qab.0!nntp.google.com!fx3no1678203qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 8 Aug 2013 07:59:04 -0700 (PDT) In-Reply-To: <7x1u64hk2p.fsf@ruckus.brouhaha.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=129.59.203.108; posting-account=7Oy7OQoAAABhVYFOo553Cn1-AaU-bSfl NNTP-Posting-Host: 129.59.203.108 References: <7x1u64hk2p.fsf@ruckus.brouhaha.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2d511e4c-b017-41c9-ae31-4435ea12ecca@googlegroups.com> Subject: Re: Low-level programming in Ada? From: Eryndlia Mavourneen Injection-Date: Thu, 08 Aug 2013 14:59:05 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 2288 Xref: news.eternal-september.org comp.lang.ada:16706 Date: 2013-08-08T07:59:04-07:00 List-Id: On Wednesday, August 7, 2013 11:39:58 PM UTC-5, Paul Rubin wrote: > I'm wondering if anyone can suggest a reference (preferably online) > about low-level programming (e.g. for operating system implementation) > in Ada. Not about the language itself, but examples of dealing with > machine addresses, device registers, page tables, memory management, > etc., preferably without dropping to assembler more than a tiny bit. > > This isn't for a specific project or anything like that. It's just > general interest in how to do this stuff that's traditionally the domain > of C. > > Thanks. with System; package Addresses is Data_Address : constant System.Address_Type := 16#22000#; Data : Integer; for Data'Address use Data_Address; begin Data := 555; end Addresses; Of course, for device registers and the like, you will want to use record representation clauses to specify the bit fields, etc. Using these techniques will allow you to delve into the dark world of virtual-to-physical address translation, paging, or what-have-you. :-) All of this is sooooo much easier than messing around with offsets, shifts, and such in C and its offspring. -- Eryndlia (KK1T)