Page 1 of 2
Unix V4 source recovered after 50 years
Posted: Fri Dec 26, 2025 4:25 am
by Yuri
Looks like some people have managed to save a real that held the source code for UNIX version 4 and read the data off of it.
The full article can be found on Tom's Hardware:
https://www.tomshardware.com/software/l ... itten-in-c
A pretty impressive and influential bit of computing history.

Re: Unix V4 source recovered after 50 years
Posted: Fri Dec 26, 2025 7:56 am
by BigDumbDinosaur
Looks like some people have managed to save a real (sic) that held the source code for UNIX version 4 and read the data off of it.
The full article can be found on Tom's Hardware:
https://www.tomshardware.com/software/l ... itten-in-c
A pretty impressive and influential bit of computing history. 
Yes it is.
However, this statement in the article is not quite correct:
...Unix v4, the first version of the operating system with both its kernel and core utilities written in that shiny newfangled language known as C.
Yes, all the core utilities were written in K&R C and almost all of the kernel was as well. However, the V4 kernel that was run on the PDP-11 had some assembly language because the machine code produced from the compiled C version simply wasn’t tight enough for a few critical functions (interrupt handlers, if my memory correctly serves me—I read about this stuff some 45 years ago).
Kernighan and Ritchie also mentioned this in their “The C Programming Language” book of 1978, on page 2 (yes, I have an original copy, purchased used at the University of Illinois bookstore in 1982), saying that about 800 lines of assembly language were part of the kernel source. This need for assembly language in critical places persisted for a while when the first UNIX ports to PC hardware were done. C compilers simply weren’t as efficient back then as they are now.
As for downloading and building the source, and then running it on something, that might be interesting, but not an eye-opener—UNIX’s modus operandi has remain remarkably consistent over the years (what I learned from my early encounters with UNIX in 1980 mostly applies to Linux). The Linux user of today should not have any trouble using a 50+ year-old UNIX, but would likely be disappointed that all the bells and whistles we take for granted today aren’t there. No BASH, no PERL, no PHP, no Python...none of that modern stuff.
It would be like a life-long Porsche owner suddenly finding himself behind the wheel of a 1950 Buick Roadmaster.
Re: Unix V4 source recovered after 50 years
Posted: Fri Dec 26, 2025 10:12 am
by BigEd
Thanks Yuri, this is big news! And it's straightforward to bring this distribution up in simh. See here
http://squoze.net/UNIX/v4/README
We've a bit of a conversation going on over here:
https://retrocomputingforum.com/t/unix- ... 5400?u=eds
Re: Unix V4 source recovered after 50 years
Posted: Fri Dec 26, 2025 8:27 pm
by BigDumbDinosaur
Interesting in reading that the procedure to get V4 UNIX running is just like what was done at my employer in 1980 when they set up a PDP-11/70 with UNIX.
The PDP had two RK05 disk units and one tape drive (can’t recall the model), and at the time, seemed to be the cutting edge of computing. None of us at the time, as far as I knew, had any idea how far-reaching UNIX’s influence would be. What I did quickly recognize was how much more interesting the UNIX environment was than CICS running on the company’s S370 mainframe. CICS was as dull as a cheap kitchen knife—UNIX was cool! 
Re: Unix V4 source recovered after 50 years
Posted: Sat Dec 27, 2025 4:44 am
by jgharston
It's not so much that their C compiler wasn't efficient enough, but in crucial places you need to transition from the CPU itself doing something to getting into some C code. The PDP11 interupt handler can't jump into a C routine, it simply sets the program counter to a specified value and starts executing machine code. There needs to be machine code at that location to set the machine state into a state where it can hand on into a C routine.
And then there's things like reading user space when executing in the kernel - that has to be done in machine code as it's machine level functionality.
I downloaded the disk image and SIMH ini files, and it booted first time. I was even more impressed that my code that runs happily in UnixV5 also ran first time:
link.
From testing, the only thing I've found a problem with is exec() calling /bin/sh to "shell out" to run a command. There's some difference from v5+ that I haven't worked out yet. With v5 and later you do exec("/bin/sh",("sh","-c","command line to run",0)) but on v4 that gives me: -c: cannot open.

Re: Unix V4 source recovered after 50 years
Posted: Sat Dec 27, 2025 6:19 am
by BigDumbDinosaur
It's not so much that their C compiler wasn't efficient enough, but in crucial places you need to transition from the CPU itself doing something to getting into some C code...
As I said, I last read about it 45 years ago.
A huge amount of water has gone over my cranial dam in that time. I’m amazed I remember what I do remember about this stuff. 
Re: Unix V4 source recovered after 50 years
Posted: Sat Dec 27, 2025 8:06 am
by BigEd
Great screenshot JGH - very retro!
Re: Unix V4 source recovered after 50 years
Posted: Sat Dec 27, 2025 5:57 pm
by electricdawn
That... is ancient (the youngster would say about seeing a Windows XP screenshot).
I remember my first contact with a computer was a PDP-somethingsomething (PDP-8?) in somewhat 1977/8 during my first year at the "Technische Gymnasium" in the city of Mainz/Germany. This ONE meeting kindled my lifelong interest in computers. I somehow still remember that. When my parents moved to Kaiserslautern, they sent me to the "Technische Gymnasium" (it's like a vocational high school centred around - at that time - modern technology) there, and I had access to the mini-computer (probably a PDP as well) at the university of Kaiserslautern. We had as one of the first high schools in Germany the course "Informatik" ... pretty much the theory of the basics of programming a computer. We programmed the PDP at our university - which was situated on the other side of town - with punch cards!
I bought a copy of Niklaus Wirth's "Algorithms and Data Structures" back then and it's still sitting in a shelf above my desk today!
Re: Unix V4 source recovered after 50 years
Posted: Sat Dec 27, 2025 6:47 pm
by Yuri
I remember my first contact with a computer was a PDP-somethingsomething (PDP-8?) in somewhat 1977/8 during my first year at the "Technische Gymnasium" in the city of Mainz/Germany.
My first contact with a computer was an Apple II+; I never got a chance to work with any minicomputers or mainframes. I have worked at IBM in my carrier, and the team I was on had an AS400, but despite my begging and pleading to let me learn how to use it they said no....
I still get awe struck seeing those photos of the Cray-1, and the various big iron from the day. Even if they can't hold a candle next to today's computers, they were still pretty neat computers.
I have in fact gotten it to run; simh is running very slowly (I presume to actually emulate the speed of the PDP-11 itself). Trying to see if there's an easier way to get files edited on the Windows side back into the PDP-11 so I don't have to fight with ed.
Re: Unix V4 source recovered after 50 years
Posted: Sat Dec 27, 2025 7:11 pm
by electricdawn
NOTHING beats the awesome images of a Cray main-frame. To me, this is still the pinnacle of "Big Iron".
Re: Unix V4 source recovered after 50 years
Posted: Sat Dec 27, 2025 8:57 pm
by barnacle
Can't argue with that; the Cray was the coolest looking machine in town. The Sinclair MK14 (my first computer) wasn't a patch on it.
Neil
Re: Unix V4 source recovered after 50 years
Posted: Sat Dec 27, 2025 11:25 pm
by BigDumbDinosaur
NOTHING beats the awesome images of a Cray main-frame. To me, this is still the pinnacle of "Big Iron".
Yep, and to think that early versions of Cray machines were wire-wrapped and ran at the then-astonishing speed of 80 MHz. It took some serious engineering to pull off that kind of performance.
Re: Unix V4 source recovered after 50 years
Posted: Wed Dec 31, 2025 6:53 am
by v4guy
Hey, FYI if anybody wants to have a play around with this system (and admire its primitive nature) I created a website where you can get a live terminal of it in your browser:
https://unixv4.dev
Check it out (and let me know if you have any feedback)
Re: Unix V4 source recovered after 50 years
Posted: Wed Dec 31, 2025 8:04 am
by BigEd
Marvellous - thanks for that! And thanks for automating the boot-time inputs, getting us to the # prompt.
Re: Unix V4 source recovered after 50 years
Posted: Wed Dec 31, 2025 9:42 am
by Yuri
Hey, FYI if anybody wants to have a play around with this system (and admire its primitive nature) I created a website where you can get a live terminal of it in your browser:
https://unixv4.dev
Check it out (and let me know if you have any feedback)
That's pretty cool. Might want to add a note to the MOTD that CTRL+C will not stop a program either..... >_>