If you've ever worked in the software field, you've probably come across Linux or any other Unix-like operating systems. You might've wondered what it is? Well, in this first part of the UNIX Basics series, I'll be deep-diving into what is UNIX, and how it came to be.
An operating system is the software that manages the computer’s hardware and provides a safe environment for running programs. It acts as an interface between programs and the hardware resources that these programs access. It is loaded into memory when a computer is booted and remains active as long as the machine is up. It performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.
Well, in the past many operating systems existed, but they were hardware-specific. And they were also proprietary because the assembler code developed on one machine, just wouldn't run on another. But all of this changed when Ken Thompson, Dennis Ritchie, and other developers at AT&T Bell Labs, developed UNIX in 1971. UNIX is the most powerful and popular multi-user and multi-tasking operating system out there. UNIX is nothing like its predecessors. It's written in C, instead of assembly language. This makes UNIX run on practically any hardware platform. Apart from the basic operating system functions, UNIX also includes a rich set of tools like editors, compiler, interpreters, etc., that aids users, programmers, and system administrators, in developing, debugging, and maintaining programs. That's why UNIX doesn't appeal to normal users.
The boom of UNIX started in the late 1970s when AT&T started licensing the UNIX source code to academic and research institutions. By using the UNIX source-code, the University of California, Berkeley, created its own flavor of UNIX and called it the Berkely Software Distribution, or more commonly known as BSD. BSD filled the holes in the original UNIX. It included additional software and capabilities, like the now-famous text editor vi, and csh. UCB had also created a better file system, a more versatile mail feature, and a better method of linking files. Later, they also offered TCP/IP with their distribution.
In addition to BSD, many other companies like Sun Microsystems, HP, IBM, etc. made their own distributions based on UNIX. This made the original UNIX lose its identity as a separate product, and at the same time, incompatibilities were also steadily growing. So to unify the many UNIX flavors and to create a single conforming standard, AT&T created the System V Interface Definition or SVID. This prompted the X/Open (now The Open Group) to create the X/Open Portability Guide or the XPG, and the systems following this specification were branded UNIX95, UNIX98, or UNIX03 depending on the version of the specification.
Even though there was already a standard for UNIX operating systems, IEEE developed another system of standards called as Portable Operating System Interface for Computer Environments or POSIX. POSIX was based on UNIX, even though it referred to operating systems in general. This existence of dual-standards made the X/Open to work with IEEE to create a unified standard that included elements of XPG and POSIX. This came to know as Single UNIX Specification, Version 3, or SUSV3. The main tagline for this standard was "write once, adopt everywhere", which means that any software developed on a POSIX-compliant system can be ported to run in any other POSIX-compliant system, with minimal to no modifications. This became a major milestone for UNIX.
Since the mid-1980s, Richard Stallman was already looking to create an open-source alternative to the proprietary UNIX system. So he founded the GNU project (GNU is a recursive acronym for "GNU's not UNIX"). GNU was to be a complete, UNIX-compatible operating system made up of free software. And by the early-1990s, even though many programs and features were written, there wasn't a working kernel for the GNU, because the GNU Hurd kernel was supposed to be a microkernel, and it's development resulted in long delays (even as of today, there hasn't been a stable version of the GNU Hurd kernel). Without a kernel, the free and open-source operating system dream was far from realization. Then came the first version of Linux kernel, a UNIX clone that is developed from scratch by Linus Torvalds and team. It targeted POSIX compliance. The Linux kernel code was completely written from scratch, using GNU software like GCC, etc. This made Linux a perfect match for the GNU project and was chosen as the kernel for GNU. This made the completely free operating system dream come true, with Linux kernel, GNU software, and X-Window System. And the operating system was called GNU/Linux, though many people call it just Linux. The most popular GNU/Linux flavors include Ubuntu, Arch Linux, Fedora (formerly Red Hat), SuSE, Debian, and Mandriva. These distributions include a plethora of software, from C and C++ compilers to Java, interpreters like Perl, PHP, python, and tcl, browsers like Firefox, internet servers, and multimedia software. All the major computer vendors have committed to support GNU/Linux, and many of them have ported their software to this platform. Many operating systems today, including Android, Chrome OS, Steam OS, and a huge amount of embedded operating systems for devices, are based on GNU/Linux.
"Unix-like" operating systems include systems which are based on UNIX and comply with Single UNIX Specifications. These include Linux, Free/Open/NetBSD, macOS (from 10.5), Solaris, etc. Solaris and macOS are POSIX certified, because these systems have passed the compliance check and are allowed by the Open Group to carry the UNIX name. But Linux, flavors of BSD, and many more operating systems "are" POSIX-compliant, but are not certified by the Open Group just because the foundations behind these operating systems didn't want to pay for the compliance check. These systems are "functionally" UNIX, but "are not" UNIX.
This wraps up the first part of the "UNIX Basics" series. I wanted to keep this post as short as possible, but it became a very large one as I kept on writing. Sorry about that! I'm already writing the second part in the series, so be on the lookout for that.
As I've referred many books and articles to write this post, there ought to some mistakes, so please comment down below if you've found any mistakes or errors. Thank you!