News for hackers. Stuff that matters.
Re:How could the early Unix OS comprise so few lines of code? by eru on Monday September 11, 2023 @04:27AM (#37464441)
They also didn't care nearly as much about performance.

Or to be more precise, they had very different trade-offs to make. Back then, you could have a system call and context switch for every read and live with the overhead.

Today we have something like io_uring.

Re:How could the early Unix OS comprise so few lines of code? by msla on Monday September 11, 2023 @06:53AM (#37465391)
Back then, fitting in RAM was a big problem: The PDP-11 (the first kind of computer to run Unix, as opposed to UNICS) had a 16-bit address space, which gives you 64 K of RAM if you ignore the fact peripherals were memory-mapped and so took addresses away from actual memory. Later models had split I+D, or separate address spaces for Instructions and Data, but that's still only 128 K.

https://gunkies.org/wiki/PDP-11_Memory_Management

Re:How could the early Unix OS comprise so few lines of code? by shrubble on Monday September 11, 2023 @07:39AM (#37465771)
Later models could address 18 (256k) or 22 bits (4Mbytes) of memory.
Re:How could the early Unix OS comprise so few lines of code? by systems_glitch on Monday September 11, 2023 @10:43AM (#37468018)
Still restricted to I+D of 128K mapped in at any given time, plus your 8K of I/O space for bank 7.
Re:How could the early Unix OS comprise so few lines of code? by dezgeg on Monday September 11, 2023 @09:06AM (#37466665)
I'd guess that back then system call overhead was lower than with modern CPUs with deep pipelines, speculation and their vulnerability workarounds.
Re:How could the early Unix OS comprise so few lines of code? by pixl97 on Monday September 11, 2023 @01:47PM (#37470851)
I'm thinking most stuff was designed around single core performance. Lots of drivers had big'ole gigantic locks which really killed multi processor performance. These days with modern CPUs with a ton of cores the complexity has increased greatly.
Re:How could the early Unix OS comprise so few lines of code? by paulddraper on Monday September 11, 2023 @09:47PM (#37476121)
It wasn't lower. But people put up with it.

Because they had to; there just wasn't a viable alternative

Re:How could the early Unix OS comprise so few lines of code? by cmrdporcupine on Monday September 11, 2023 @10:13AM (#37467589)
For sure, and up until the mid-to-late 80s RAM speeds were higher than processor speeds. So approaches to architecture were totally different.

Most minicomputer class processors were sewn together from multiple chips and transistors; even their register sets for the CPU were often not dissimilar from main memory. Texas Instrument's minicomputer (and later microcomputer) architecture even just put registers in RAM. In the microcomputer world, the 6502 got around having a very small register set by just having a 256-byte "zero page" with slightly faster cycle access than regular memory.

There was no need for complicated cache hierarchies. Relative cost of a context switch or interrupt or transition from user space to kernel etc. was way lower than now.

And the users of the system were by and large trusted. Security was more of a suggestion.

Re:How could the early Unix OS comprise so few lines of code? by pmontra on Monday September 11, 2023 @02:22PM (#37471374)
We did care about performance because 1 MHz was slow even back then and data bus were slow too. However we had to care more about memory size because we couldn't fit much in a few kB or 1 or 2 MB for huge machines. Finally, compilation time for substantial programs were... substantial! You could play games as in that sword fighting xkcd.