comp.lang.ada
 help / color / mirror / Atom feed
From: Eryndlia Mavourneen <eryndlia@gmail.com>
Subject: Re: Low-level programming in Ada?
Date: Thu, 8 Aug 2013 07:59:04 -0700 (PDT)
Date: 2013-08-08T07:59:04-07:00	[thread overview]
Message-ID: <2d511e4c-b017-41c9-ae31-4435ea12ecca@googlegroups.com> (raw)
In-Reply-To: <7x1u64hk2p.fsf@ruckus.brouhaha.com>

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)

  parent reply	other threads:[~2013-08-08 14:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08  4:39 Low-level programming in Ada? Paul Rubin
2013-08-08 13:47 ` Michael Erdmann
2013-08-08 14:59 ` Eryndlia Mavourneen [this message]
2013-08-08 21:17 ` Bill Findlay
2013-08-11  7:10   ` Mike H
2013-08-11  8:10     ` Simon Wright
2013-08-11  8:17       ` Mike H
2013-08-12 16:17       ` Eryndlia Mavourneen
2013-08-14 18:13       ` Erik Baigar
2013-08-14 21:19         ` Simon Wright
2013-08-11 21:12     ` Bill Findlay
2013-08-14 17:55     ` Erik Baigar
2013-08-14 18:16       ` Bill Findlay
2013-08-15 19:12         ` Erik Baigar
2013-08-16 19:55           ` Erik Baigar
2013-08-10 11:25 ` Mike H
2013-08-13  8:14 ` Luke A. Guest
2013-08-18  9:26 ` Paul Rubin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox