> It would be nice to hear about the rationale from a primary source.
Assembly language was deemed a last resort, especially as portability
was coming to the fore. As I wrote in A Research Unix Reader,
"Assembly language and magic constants gradually declined from the
status of the 'real truth' (v4) to utterly forgotten (v8)." In v7,
assembler usage was demoted to the bottom of syscall man pages. It
could also be found in /usr/src/libc/sys/*.s
Doug
Well, hallelujah, after much travail (I've tried this every Christmas
for at least 5 years now), I have succeeded in building vi on v7 from
2bsd. Had to patch the c compiler to enlarge the symbol table, tweak
some stuff here and there, but it finally built and installed without
any errors, yay.
Now, I just want it to do some editing, preferably in visual mode. I can
call it as ex or vi:
# ex
:
or
# vi
:
and q will exit, yay, again!
I have at least two problems:
1. It's not going "full" screen, even with TERM=vt100 or TERM=ansi set
(not that I was surprised, but it'd be nice)...
2. If I type a for append and type something, there's no way to get back
to the : prompt (ESC doesn't seem to work).
3. I'd like manpages (figure they might help with the above), but
they're on the tape as .u files?
I'm hoping this triggers some, oh yeah I remember that, type responses.
Thanks,
Will
So,
in v6, it was possible to use the mesg function from the system library
with:
ed hello.s
/ hello world using external mesg routine
.globl mesg
mov sp,r5
jsr r5,mesg; <Hello, World!\n\0>; .even
sys exit
as hello.sld -s a.out -l
a.out
Hello, World!
This was because v6 included mesg in the library, in v7, it doesn't look
like mesg is included, so doing the same thing as above requires that
code to write the message out be included and in addition system call
names are not predefined, so exit and write have to be looked up in
/usr/include/sys.s, resulting in the v7 equivalent file:
ed hello2.s
/ hello world using internal mesg routine
mov sp,r5
jsr r5,mesg; <Hello, World!\n\0>; .even
sys 1
mesg:
mov r0,-(sp)
mov r5,r0
mov r5,0f
1:
tstb (r5)+
bne 1b
sub r5,r0
com r0
mov r0,0f+2
mov $1,r0
sys 0; 9f
.data
9:
sys 4; 0:..; ..
.text
inc r5
bic $1,r5
mov (sp)+,r0
rts r5
as hello2.s
a.out
Hello, World!
My questions are:
1. Is mesg or an equivalent available in v7?
2. If not, what was the v7 way of putting strings out?
3. Why aren't the system call names defined?
4. What was the v7 way of naming system calls?
Will
All,
I've completed a new version of my "Installing and Using Research Unix
Version 7 in the SimH PDP-11/45 and 11/70 Emulators" tutorial/document
(wow, that's a mouthful). I'm calling it Version 2.0 - It is a
completely reorganized, updated, and edited version of the document.
The blog post announcement is on the blog: https://decuser.blogspot.com/
and the pdf is on google drive:
https://drive.google.com/file/d/1gDBxULlpLwezH-1RO_3ou_W7trElgSgT/view?usp=…
The new doc covers building a working v7 instance from tape files that
will run on the SimH emulator. First, the reader is led through the
restoration of a pristine v7 instance from tape to disk. Next, the
reader is led through adding a regular user, making the system
multi-user. Then, the reader is shown how to make the system
multi-session cable allowing multiple simultaneous sessions. Finally,
the system is put to use with hello world, DMR style, and the learn
system is enabled. It also includes a hyperlinked table of contents.
My hope is that the new version will be more useful than the prior
version, as well as more accurate. I really appreciate the input and
feedback y'all have given me over the intervening years.
Regards,
Will
> From: John Cowan
> Why use C syntax? What was wrong with Fortran, Lisp, or Cobol syntax,
> extended to do what you wanted?
Why do all hammers look basically the same? Because there's an 'ideal
hammer', and over time hammer design has asymtoted toward that 'ideal hammer'
design. One can't just keep improving the design indefinitely - diminishing
returns set in.
So I suspect there is, to some degree, a Platonic 'ideal syntax' for a
'classic block-structured' programming language, and to me, C came pretty
close to it.
I except LISP from that assessment, because LISP is built around a
fundamentally different model of how computations/algorithms are organized,
and C and LISP aren't directly comparable.
But that realization points to a deeper bug with the 'Platonic ideal
language' concept above, which is that languages are fundamentally, albeit at
a very deep conceptual level, tied to the basic concept of the computing
hardware they are to run on. C/COBOL/FORTRAN/etc are all for von Neumann-like
(in a broad sense) computing engines - a single thread of computation, which
happens sequentially.
But we've pushed that paradigm about as far as it can go, we're into
diminishing returns territory on that one. The future, starting with the
hardware, will be very different - and will need quite different languages.
(Go, from what little I know of it, is a baby step in this direction - it is
intended to make it easy to use multiple simultaneous loci of execution,
making use of the mutiple cores that are common now.)
I suspect we'll be shifting to radically different paradigms, 50 years from
now - massively parallel computing meshes (think Connection Machines on
steroids - or the human brain), and those will use fundamentally different
computing paradigms, and programming languages for them, which in turn will
need very different syntax.
Noel
> Lisp, _that's_ elegant.
The machine shines through Lisp even more brightly than it does
through C. Lisp attains incredible power from a tiny base: car, cdr,
cons, cond, T, F, null, lambda, def, exuding elegance that survives
even in a raging sea of parentheses.
For Lisp-friendly applications nowadays, I prefer Haskell, which is
much further away from the machine. Haskell code approaches--and
sometimes surpasses--the cleanliness of good mathematical notation.
For string processing, I remember Snobol 3 with great fondness.
But for everyday work with arrays and numbers, C is the workhorse.
Still, I wish that C would evaluate comma expressions in parallel
rather than in series, as in (a,b) = (b,a).
Doug
I enabled user accounting on my v7 instance and I noticed it "growing
without bound" and while this is noted as a possibility in the ac(1) man
page, I was pretty sure the original authors didn't mean 30k a second. I
scratched my head and thought for a while and then started experimenting
to see what the heck was going on. I removed /usr/adm/wtmp (which I had
created to enable accounting in the first place) and the little red disk
write arrow on my mac went away, but not the little green disk read
arrow... hmm. Something was keeping my v7 instance very busy reading
disk, that was for sure. I went through a few (dozens) more tests and
experiments, reread a bunch of man pages, Ritchie's v7 install note, and
thought some more and here's what I came up with...
If you modify your system to add dci lines and you enable some ttys in
/etc/ttys and you enable user accounting. Then, the next time you boot
into a kernel that doesn't have dci support, init or some other process
will try and fail to read the enabled ttys, log something in
/usr/adm/wtmp, if it exists, and then loop (very quickly), over and over
and over. If you aren't paying attention, this will hardly be noticeable
on modern hardware running simh, but I'm guessing this would have been
disastrous, back in the day.
The simple solution is to boot w/dci enabled when you have ttys enabled,
and only boot w/o dci enabled when you have disabled the ttys.
I'm guessing that this wasn't really ever an issue, back in the day, as
folks prolly didn't just yank their dci's and reboot a different kernel?
But, such are the joys of simulation.
Anyhow, if this doesn't sound like a very likely or reasonable analysis
of what was happening, I'd appreciate your letting me know, or if you've
experienced something like it before, it'd be great to know that I'm not
alone in this silliness.
Will