6

Does the Linux kernel use original Unix code or do they share the idea? Since both are written in C, is that true?

3
  • When you say "unix original code" do you only mean the original Bell Labs version?
    – jordanm
    Dec 5, 2013 at 3:29
  • no i mean cod of any unix version that linux might use Dec 5, 2013 at 3:31
  • thank u all for answering my question. i don't know which is correct so i wont judge. Dec 5, 2013 at 3:49

4 Answers 4

10

In cases like this it helps to define Unix more precisely. In this response I will be talking about AT&Ts unix specifically.

Linux is a Unix Clone and shares no actual code. This is what allowed Linux to be licensed under the GPL and hence free software. If it had inherited code, it would have been owned by the creator of the code it used and could not have been freely modified and used under the GPL as it is today.

If is very likely that it would have enjoyed much more limited success had it not been so widely accessible. There are several competing free software unixes such as FreeBSD which came later and do infact share code though with a very different licensing scheme. There is far too much to the licensing history to properly cover it here unfortunately.

7
  • 1
    The creator of the code (eg IBM) can re-license their proprietary work however they want. Your statement about it not being freely modified if it inherited code from proprietary UNIX (eg System V) is false, that inherited code would just have to be contributed under GPLv2 (for the kernel itself).
    – jordanm
    Dec 5, 2013 at 3:17
  • 2
    Also, freebsd may have came slightly later, but BSD was well before Linux.
    – jordanm
    Dec 5, 2013 at 3:19
  • what about basic programs like ls, grep, find - were they written from scratch by GNU\Linux community, or something what taken from early UNIX free distributions (open-sources)?
    – ALZ
    Dec 5, 2013 at 5:29
  • 4
  • 1
    @ALS also, there was a GNU community long before a GNU/Linux community. GNU had completed everything except their kernel, Hurd (which has been in development for a decade or two now), when the Linux kernel came along. and the rest, as they say, is history.
    – strugee
    Dec 6, 2013 at 2:39
6

Linux kernel is largely considered based on the original Unix kernel. Linus Torvalds wrote most of the Linux kernel code from scratch. See this page for more information: https://www.kernel.org/linux.html

PS: It is not at all a stupid question to ask in my opinion.

5

Linux doesn't use any of the original code. The original Unix code from AT&T was sometimes available free of charge to certain groups but was never free to redistribute.

Most commercial Unix systems obtained a license from AT&T and made and sold their own modifications to the AT&T code base.

In the 1980s, a group at Berkeley University made their own distribution of additional Unix software, which was freely redistributable and modifiable. Gradually they rewrote components of Unix until in the early 1990s they had their own Unix variant, unencumbered by AT&T proprietary code. This was known as the Berkeley Software Distribution (BSD), of which there are now several variants (FreeBSD, OpenBSD and NetBSD being the main 3; Mac OS X is partly based on FreeBSD).

In roughly the same time frame, the GNU project developed their own freely redistributable and modifiable replacements for some Unix utilities. When Linux started, the GNU project lacked a kernel; quickly the combination of a Linux kernel, GNU utilities and other utilities spread. This combination is known as Linux distributions, or Linux for short. Linux doesn't contain any of the original Unix code; like BSD, it is an independent reimplementation of the same design.

Other independent reimplementations of Unix include the now-dead OSF/1 as well as the MINIX variant used in teaching and on embedded devices.

1
  • BSD did contain (not much, but enough to get sued: en.wikipedia.org/wiki/…. ) some AT&T Unix code. The timing of that legal trouble opened the door for Linux to become popular.
    – RonJohn
    Feb 6, 2018 at 11:56
4

The Linux kernel did not start with any other UNIX code as a base. However, during the SCO vs IBM lawsuit, it was shown that Linux contained some code from a UNIX OS based on BSD known as Dynix. There are likely other cases where companies contributed code that they originally wrote for proprietary UNIX.

Not the answer you're looking for? Browse other questions tagged .