comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Encapsulating Ada.Direct_IO
Date: Thu, 18 Nov 2010 12:45:39 -0600
Date: 2010-11-18T12:45:39-06:00	[thread overview]
Message-ID: <ic3s8k$tjd$1@munin.nbi.dk> (raw)
In-Reply-To: 8bb3a7c0-c473-4c35-bc6e-3920ce80e6a8@q36g2000vbi.googlegroups.com

"Adam Beneschan" <adam@irvine.com> wrote in message 
news:8bb3a7c0-c473-4c35-bc6e-3920ce80e6a8@q36g2000vbi.googlegroups.com...
...
>I did notice, though, that Peter was talking about how data was stored
>in a *file*.  In the Unisys U2200 system, how were files kept,
>conceptually?  Were they streams of 8-bit bytes, or were they stored
>as 36-bit words or 9-bit bytes or what?  I'd assume that for a text
>file, when you read it in, four bytes would be stored in each word and
>the high bit of each 9-bit byte would be zeroed---whether that zero
>bit was actually stored on disk or not should be the OS's concern, not
>the program's, and I'd presume that the OS would also have to handle
>things correctly when text files are transferred from a different
>machine.

It stored text as streams of 9-bit characters. We were running on a Unix 
emulator, and there were a bunch of conversions when you communicated to the 
"normal" 8-bit world. When you think of it, it is amazing that they could 
get Unix code to run in such an environment. Just imagine all of the things 
C could do that would assume 8-bits. Us Ada people had it easy: the language 
was designed to allow use on such machines (although I think there were only 
a few such compilers built). We only ran into one language bug (for modular 
types) having to do with 1's complement math.

Perhaps this is all OBE these days, and Ada could be simplified and assume 
8-bit only. But I doubt it would make that much difference, so it probably 
wouldn't be worth the effort.

                               Randy.


What I'm leading up to, though, is that I think Peter's question is
too simple.  We're all spoiled in having to deal exclusively, or
almost exclusively, with machines with 8-bit byte addressability and
files that are unstructured sequences of 8-bit bytes.  But there are
other systems out there.  There are machines in use that are not byte-
addressable---Analog Devices 21060 series comes to mind, which uses 32-
bit words whose bytes are not individually addressable.  When reading
from a file on that system, do you want each word to hold one byte, or
four?  Even in VAX/VMS, which does run on a machine with 8-bit byte
addressibility, the OS is able to create files that have more
structure than just being sequences of bytes.  What would it mean to
instantiate Direct_IO(Character) on a file like that?  I don't think
the answer is trivial.  How did the Pick operating system treat files
conceptually?  How would Direct_IO work on one of that system's files?

Ada's designers have tried to design a language that could work on any
of those systems, and therefore I think the standard does not and
cannot answer Peter's question.  In fact, I'm not entirely sure that
his question is meaningful on platforms that don't use 8-bit bytes and/
or use files with some structure.  (It might have to be rephrased.)
In any event, I think that details like this are left up to the
implementation.  And if you were trying to do something like this on a
U2200, there is no Ada answer to the question, because you would have
to know more about the particular OS's file system and how the Ada
implementation interacts with it.

                                -- Adam 





  parent reply	other threads:[~2010-11-18 18:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17  4:44 Encapsulating Ada.Direct_IO Bryan
2010-11-17  5:20 ` Adam Beneschan
2010-11-26 15:31   ` Bryan
2010-11-17 12:25 ` Peter C. Chapin
2010-11-18  1:16   ` Randy Brukardt
2010-11-18  2:21     ` Peter C. Chapin
2010-11-18 16:36       ` Adam Beneschan
2010-11-18 18:21         ` Peter C. Chapin
2010-11-18 18:36           ` Randy Brukardt
2010-11-18 19:48           ` Adam Beneschan
2010-11-18 20:15             ` Dmitry A. Kazakov
2010-11-18  7:39     ` AdaMagica
2010-11-18 18:38       ` Randy Brukardt
2010-11-18  9:46     ` Maciej Sobczak
2010-11-18 16:31     ` Adam Beneschan
2010-11-18 17:05       ` Dmitry A. Kazakov
     [not found]         ` <ENidndoH8qoqjHvRnZ2dnUVZ_j-dnZ2d@earthlink.com>
2010-11-19  8:24           ` Dmitry A. Kazakov
2010-11-19 16:19             ` Adam Beneschan
2010-11-18 18:45       ` Randy Brukardt [this message]
2010-11-24 21:31     ` Warren
2010-11-17 22:32 ` Yannick Duchêne (Hibou57)
2010-11-17 23:03   ` Adam Beneschan
2010-11-17 23:11     ` Yannick Duchêne (Hibou57)
replies disabled

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