How many lines of code were in the first Unix version (with the Thompson shell)?

Given that the modern Linux kernel has about 15 million lines of code, I do wonder of the amount with the first Unix product released at the time.

  • 8
    A lot of the 15M LOC in Linux aren't executed on all platforms. Ancient Unix was for exactly one platform. – tofro Jan 12 '18 at 18:55
  • 7
    About 90% of Linux source code is drivers. About 90% of the rest is architecture-specific support code. Only about 1% is the kernel proper. Those are the numbers I remember from back when the kernel was about 10 million lines. I'm pretty sure the percentages for those 5 million lines added will be similar, if not even higher towards drivers. Unix supported only one architecture and only two or three devices. Remember, it didn't even have networking, which accounts for a significant portion of Linux kernel code. – Jörg W Mittag Jan 12 '18 at 23:15

According to the Unix history repository, V1 had 4,501 lines of assembly code for its kernel, initialisation and shell. Of those, 3,976 account for the kernel, and 374 for the shell.

For comparison, current dash has 14,455 lines of C, and the current Linux kernel has 372,988 lines of C for its core functions only (kernel, lib and mm in the kernel source code). But their capabilities are vastly greater than those of V1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.