Tape endianness in Bob's simulator
Steven M. Schultz
sms at moe.2bsd.com
Thu Dec 31 01:52:58 AEST 1998
Robin -
> From robin at falstaf.demon.co.uk Wed Dec 30 04:31:15 1998
> What I have found:
>
> 1) Your endianness is correct, it took me a couple of sample programs
Whew - that's a relief.
> 2) There are two bugs in the use of writev. These are:
>
> 2.1) When writing the headers and data you are writing a long to the
> file where iovec only supports (I think) an unsigned short.
iovec can write as much as it wants to. To write a 'long' one
simply stuffs the _address_ of the long variable into iov_base
and "sizeof long" into iov_len. I'm not sure what you mean by
iovec only supporting a short.
> 2.2) When writing the tape marks you are writing an integer as though it
> was a long.
It isn't? Oops.
On some systms (those where "sizeof long == sizeof int") 'zero'
would be a long.
Sigh - I've been contaminated by machines where that assumption is
true.
> Now for the bad bit. I have created a root.dump then run it through
> makesimtape with the command file:
>
> /usr/root.dump 2
> * 1
>
> and it won't load from restor. I get a succession of "missing address
> (header) block" errors but I successfully detect the end of the tape and
> restor stops running, as it is supposed to do.
> So, am I doing something wrong in creating the root file? or is there
Uh, yes ;)
'dump' tapes *must* consist of 10kb records. 'restore' is expecting
10kb (or 20 sector) records and complaining about the shortness of
what it is reading.
> something still wrong with makesimtape?. This is probably a red herring
> but the distribution tapes are written with a blocksize of 20 for all of
> the data after the bootstraps whilst makesimtape only writes multiples
> of 512.
Correct. The bootblock+boot needs to be 512 byte records so the
boot rom can deal with it. The standalone programs are 1kb records
(because that's the filesystem block size and to make the 'seeking'
in the pseudo-stdio routines possible/simple).
All the _data_ files are 10kb records because that's what 'tar' and
'dump' use.
Steven
Received: (from major at localhost)
by minnie.cs.adfa.edu.au (8.9.1/8.9.1) id DAA17381
for pups-liszt; Thu, 31 Dec 1998 03:15:43 +1100 (EST)
More information about the TUHS
mailing list