comp.lang.ada
 help / color / mirror / Atom feed
* Low-level programming in Ada?
@ 2013-08-08  4:39 Paul Rubin
  2013-08-08 13:47 ` Michael Erdmann
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Paul Rubin @ 2013-08-08  4:39 UTC (permalink / raw)


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.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  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
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Michael Erdmann @ 2013-08-08 13:47 UTC (permalink / raw)



On Wed, 07 Aug 2013 21:39:58 -0700, 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.
> 
May be you should have a look at florist:

http://en.wikibooks.org/wiki/Ada_Programming/Platform/POSIX
http://www.cs.fsu.edu/~baker/florist.html

For the assembler stuff; if you really need it refer to the GNAT 
manual and what what is written in the gnuasm manual; e.g. 

http://tigcc.ticalc.org/doc/gnuasm.html



/Michael


> 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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  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
  2013-08-08 21:17 ` Bill Findlay
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Eryndlia Mavourneen @ 2013-08-08 14:59 UTC (permalink / raw)


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)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  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
@ 2013-08-08 21:17 ` Bill Findlay
  2013-08-11  7:10   ` Mike H
  2013-08-10 11:25 ` Mike H
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Bill Findlay @ 2013-08-08 21:17 UTC (permalink / raw)


Paul Rubin <no.email@nospam.invalid> 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.

You might like to have a look at the code for my KDF9 emulator, which deals
with similar issues around the representation of hardware structures:

http://www.findlayw.plus.com/KDF9/emulation/emulator.html#About

Have a look in particular at the kdf9*.ad? files.

-- 
Bill Findlay

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  2013-08-08  4:39 Low-level programming in Ada? Paul Rubin
                   ` (2 preceding siblings ...)
  2013-08-08 21:17 ` Bill Findlay
@ 2013-08-10 11:25 ` Mike H
  2013-08-13  8:14 ` Luke A. Guest
  2013-08-18  9:26 ` Paul Rubin
  5 siblings, 0 replies; 18+ messages in thread
From: Mike H @ 2013-08-10 11:25 UTC (permalink / raw)


In message <7x1u64hk2p.fsf@ruckus.brouhaha.com>, Paul Rubin 
<no.email@nospam.invalid> writes
>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.
>
I have only done it once and it is nearly 30 years since I did it, but I 
remember starting by writing a mirror of the memory map of the target 
device as an Ada package. Perhaps my memories are rose-tinted but, from 
there, it all seemed to grow naturally.

-- 
Mike
Swim? Naturally at Severn Vale
<http://www.severnvalesc.org/>


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  2013-08-08 21:17 ` Bill Findlay
@ 2013-08-11  7:10   ` Mike H
  2013-08-11  8:10     ` Simon Wright
                       ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Mike H @ 2013-08-11  7:10 UTC (permalink / raw)


In message 
<981741794397689133.903473yaldnif.w-blueyonder.co.uk@news.individual.net>
, Bill Findlay <yaldnif.w@blueyonder.co.uk> writes
>
>Have a look in particular at the kdf9*.ad? files.
>
Those were the days! A classic piece of kit. Thanks for the memory.

The Elliott 803 was of the same era (or was it slightly earlier?). A 
39-bit word and B-Line instruction modification - they don't make 'em 
like that any more ;-) I cut my programming teeth on one of those and 
have memories of being knee-deep in 5-channel punched paper tape ;-(
-- 
The thing I like best about the Internet is that no one
knows that, in reality, I am just another old dog!
Mike

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  2013-08-11  7:10   ` Mike H
@ 2013-08-11  8:10     ` Simon Wright
  2013-08-11  8:17       ` Mike H
                         ` (2 more replies)
  2013-08-11 21:12     ` Bill Findlay
  2013-08-14 17:55     ` Erik Baigar
  2 siblings, 3 replies; 18+ messages in thread
From: Simon Wright @ 2013-08-11  8:10 UTC (permalink / raw)


Mike H <postmaster@ada-augusta.demon.co.uk> writes:

> The Elliott 803 was of the same era (or was it slightly earlier?). A
> 39-bit word and B-Line instruction modification - they don't make 'em
> like that any more ;-) I cut my programming teeth on one of those and
> have memories of being knee-deep in 5-channel punched paper tape ;-(

My first paid gig was on a 920B or C - a military variant, I think. 18
bits, 15 op codes.

Later, Ferranti Bracknell had a 6-storey building with a back stairwell
which came in handy for unravelling those piles of 8-hole punched tape
you get when the middle drops out of the reel.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  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
  2 siblings, 0 replies; 18+ messages in thread
From: Mike H @ 2013-08-11  8:17 UTC (permalink / raw)


In message <ly38qgr6lg.fsf@pushface.org>, Simon Wright 
<simon@pushface.org> writes
>Later, Ferranti Bracknell had a 6-storey building with a back stairwell
>which came in handy for unravelling those piles of 8-hole punched tape
>you get when the middle drops out of the reel.
In the absence of a suitable stair well, hoola-hoops hung from the 
ceiling were a very useful tool for that purpose.

-- 
Mike
"Homo sum, humani nihil a me alienum puto" =
"I am human, (so) I (should) judge nothing of humanity to be strange."
Publius Terentius (195/185–159 BC)


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  2013-08-11  7:10   ` Mike H
  2013-08-11  8:10     ` Simon Wright
@ 2013-08-11 21:12     ` Bill Findlay
  2013-08-14 17:55     ` Erik Baigar
  2 siblings, 0 replies; 18+ messages in thread
From: Bill Findlay @ 2013-08-11 21:12 UTC (permalink / raw)


Mike H <postmaster@ada-augusta.demon.co.uk> wrote:
> In message <981741794397689133.903473yaldnif.w-blueyonder.co.uk@news.individual.net>
> , Bill Findlay <yaldnif.w@blueyonder.co.uk> writes
>> 
>> Have a look in particular at the kdf9*.ad? files.
>> 
> Those were the days! A classic piece of kit. Thanks for the memory.

Glad you like it.

> The Elliott 803 was of the same era (or was it slightly earlier?). A
> 39-bit word and B-Line instruction modification - they don't make 'em
> like that any more ;-) I cut my programming teeth on one of those and
> have memories of being knee-deep in 5-channel punched paper tape ;-(

The 803 was a few years before KDF9, and was bit serial. 
KDF9 was fully parallel and featured hardware secured multiprogramming.

-- 
Bill Findlay


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  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
  2 siblings, 0 replies; 18+ messages in thread
From: Eryndlia Mavourneen @ 2013-08-12 16:17 UTC (permalink / raw)


On Sunday, August 11, 2013 3:10:03 AM UTC-5, Simon Wright wrote:
> Mike H <postmaster@ada-augusta.demon.co.uk> writes:
> 
> . . . they don't make 'em
> > like that any more ;-) I cut my programming teeth on one of those and
> > have memories of being knee-deep in 5-channel punched paper tape ;-(
>     . . .

I only had one bout with paper tape, and that was when I was a student at the University of Tennessee.  The Physics Department had some old CDC machine with mag tapes.  The paper tape, as I recall, was the only boot device that was usable.

I ended up writing an assembler using SPITBOL on the University's IBM 360, which wrote a magnetic tape of the assembled program.  I then hand-carried that back to the Molecular Spectroscopy Lab and used a DEC PDP-11/20 (16K of 16-bit words of main storage) to punch the program to paper tape.  Then I could boot the program from the paper tape onto the CDC machine.  You can imagine my surprise, when the paper tape was read without error and the CDC booted!  LOL

-- Eryndlia (KK1T)


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  2013-08-08  4:39 Low-level programming in Ada? Paul Rubin
                   ` (3 preceding siblings ...)
  2013-08-10 11:25 ` Mike H
@ 2013-08-13  8:14 ` Luke A. Guest
  2013-08-18  9:26 ` Paul Rubin
  5 siblings, 0 replies; 18+ messages in thread
From: Luke A. Guest @ 2013-08-13  8:14 UTC (permalink / raw)


Paul Rubin <no.email@nospam.invalid> 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.

Have a look at the Ada bare bones I wrote on osdev.org wiki.

Luke

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  2013-08-11  7:10   ` Mike H
  2013-08-11  8:10     ` Simon Wright
  2013-08-11 21:12     ` Bill Findlay
@ 2013-08-14 17:55     ` Erik Baigar
  2013-08-14 18:16       ` Bill Findlay
  2 siblings, 1 reply; 18+ messages in thread
From: Erik Baigar @ 2013-08-14 17:55 UTC (permalink / raw)


Mike H wrote:
> >
> Those were the days! A classic piece of kit. Thanks for the memory.
> 
> The Elliott 803 was of the same era (or was it slightly earlier?). A
> 39-bit word and B-Line instruction modification - they don't make 'em
> like that any more ;-) I cut my programming teeth on one of those and
> have memories of being knee-deep in 5-channel punched paper tape ;-(

Hey very nice that someone mentions the Elliott machines 
here. The awareness of this architecture is near to zero.

2003 I got hands on a small mil spec computer which I reverse
engineered and reanimated. Only years later I learned, that it
is an embedded 102 (essentially 12 bit variant of the 900 series
machines which have been the successor of the 803). 

I also ported an emulator for the 920 which was written by 
two good old hands in Ada many years ago to more modern 
platforms - if interested you may have a look to my page 
regarding the project: 

    http://www.programmer-electronic-control.de

Erik.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  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
  2 siblings, 1 reply; 18+ messages in thread
From: Erik Baigar @ 2013-08-14 18:13 UTC (permalink / raw)


Simon Wright wrote:
> My first paid gig was on a 920B or C - a military variant, I think. 18
> bits, 15 op codes.

Absolutely correct. 920M and later variants (920ATC) have 
widely been used in many UK designed MIL SPEC applications. 
There is a good book from Simon Lavington on the Elliott 
company - its title is "Moving Targets"!

   Erik.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  2013-08-14 17:55     ` Erik Baigar
@ 2013-08-14 18:16       ` Bill Findlay
  2013-08-15 19:12         ` Erik Baigar
  0 siblings, 1 reply; 18+ messages in thread
From: Bill Findlay @ 2013-08-14 18:16 UTC (permalink / raw)


On 14/08/2013 18:55, in article 520BC483.20828313@baigar.de, "Erik Baigar"
<erik@baigar.de> wrote:
... 
> Hey very nice that someone mentions the Elliott machines
> here. The awareness of this architecture is near to zero.
> 
> 2003 I got hands on a small mil spec computer which I reverse
> engineered and reanimated. Only years later I learned, that it
> is an embedded 102 (essentially 12 bit variant of the 900 series
> machines which have been the successor of the 803).
> 
> I also ported an emulator for the 920 which was written by
> two good old hands in Ada many years ago to more modern
> platforms - if interested you may have a look to my page
> regarding the project:
> 
>     http://www.programmer-electronic-control.de

Hi Erik,
Do you know about Andrew Herbert's very complete 903 emulator in F#?

-- 
Bill Findlay
with blueyonder.co.uk;
use  surname & forename;




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  2013-08-14 18:13       ` Erik Baigar
@ 2013-08-14 21:19         ` Simon Wright
  0 siblings, 0 replies; 18+ messages in thread
From: Simon Wright @ 2013-08-14 21:19 UTC (permalink / raw)


Erik Baigar <erik@baigar.de> writes:

> Simon Wright wrote:
>> My first paid gig was on a 920B or C - a military variant, I
>> think. 18 bits, 15 op codes.
>
> Absolutely correct. 920M and later variants (920ATC) have 
> widely been used in many UK designed MIL SPEC applications. 
> There is a good book from Simon Lavington on the Elliott 
> company - its title is "Moving Targets"!

Rather expensive (£57 from Abe Books)! but it's on Google Books.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  2013-08-14 18:16       ` Bill Findlay
@ 2013-08-15 19:12         ` Erik Baigar
  2013-08-16 19:55           ` Erik Baigar
  0 siblings, 1 reply; 18+ messages in thread
From: Erik Baigar @ 2013-08-15 19:12 UTC (permalink / raw)


Bill Findlay wrote:

> Hi Erik,
> Do you know about Andrew Herbert's very complete 903 emulator in F#?

Yes I know about this one. My port happened earlier and Windows
is not my favorite platform  ;-)  I just like it, if everyting
can be "scripted"...

But yes, Andrew Herbert's emulator looks really great and it is 
an eye catcher.

    Erik.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  2013-08-15 19:12         ` Erik Baigar
@ 2013-08-16 19:55           ` Erik Baigar
  0 siblings, 0 replies; 18+ messages in thread
From: Erik Baigar @ 2013-08-16 19:55 UTC (permalink / raw)


Erik Baigar wrote:

> is not my favorite platform  ;-)  I just like it, if everyting
> can be "scripted"...

Just revisited Mr. Herbert's emulator and it allows scripting
as well and thus is a cool piece of software, too. Additionally 
Mr. Herbert collected a huge amount of software, documentation 
and manuals for the 900, 18 bit machines. He has far more demos 
included than there are with my port of Mr. Froggatt's emulator.

   Erik.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Low-level programming in Ada?
  2013-08-08  4:39 Low-level programming in Ada? Paul Rubin
                   ` (4 preceding siblings ...)
  2013-08-13  8:14 ` Luke A. Guest
@ 2013-08-18  9:26 ` Paul Rubin
  5 siblings, 0 replies; 18+ messages in thread
From: Paul Rubin @ 2013-08-18  9:26 UTC (permalink / raw)


Paul Rubin <no.email@nospam.invalid> writes:
> I'm wondering if anyone can suggest a reference... about low-level
> programming... in Ada.

Thanks for the various responses to this.  It looks like there is a mix
of approaches including a package that allows messing with raw pointers
like in C.  It seems practical enough, though I guess it presents
similar difficulties to static analysis.  Doing much better probably
requires cumbersome high-tech approaches.


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-08-18  9:26 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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