Preamble
UNIX, Linux, Kernel, GNU, Linux Torvalds, …
The Linux Programming Interface – Part 1: History and standards
Linux is a member of the UNIX operating system family. UNIX has a long history. The first part of the chapter is about an overview of history. We will describe the main events of the UNIX system and the C programming language, then we will look at two things that govern the Linux system that still exist today: the GNU project and the development of the Linux kernel.
One of the remarkable features of the UNIX system is that it is not controlled by a single supplier or organization. Moreover, many groups, both commercial and non-commercial, contribute to its development. As a result, there are many features added to UNIX, but it also has the consequences that the UNIX implementations are so different, so writing the application to be able to run on all UNIX implementations becomes increasingly difficult. This leads to the need for UNIX standards, which we discussed in Part 1 of this chapter.
There are two commonly used definitions of UNIX. One is for operating systems that have achieved the Single UNIX Specification. At the present time, there is no free version of UNIX implementations (eg Linux and Free BSD achieve this branding)
The second is the operating system that has the same function and interface as the classic UNIX operating system (eg Bell Laboratories UNIX, System V and BSD). By definition Linux is also classified as UNIX. Although we will focus on the Single UNIX Specifications in this book, they will follow the second definition of UNIX. So we will often say “Linux, as well as other UNIX implementations …”
A brief history of UNIX and C
The first version of UNIX was developed in 1969 (the same year Linus Torvalds was born) by Ken Thompson at Bell Laboratories, a division of telephone corporation AT&T. It is written in assembly language for Digital PDP-7 mini-computer. The name UNIX is a pun on MULTICS (Multiplexed Information and Computer Service), the name of the earlier operating system project of AT&T in conjunction with MIT and General Electric. Thompson drew several ideas for the new operating system from MULTICS, including directory tree structure, standalone programs and interpreters (the shell), and file concepts as an unstructured. streams of bytes.
In 1970, UNIX was rewritten in assembly language for the Digital PDP-11 minicomputer.
Shortly after, Dennis Ritchie, a colleague of Thompson at Bell, designed and developed the C programming language. This was a big step forward. C inherited from some interpreters, B. B began to be implemented by Thompson and inherited from earlier programming languages called BCPL. In 1973, C was so developed that most of the UNIX kernel was rewritten in C. UNIX became the first operating system written in high-level language, the fact that there was still a need to switch back and forth between architectures. hardware architecture.
The origin of C explains why, its descendant C ++, is widely used as a system programming language today. Other languages: FORTRAN for math jobs by engineers and scientists. COBOL for commercial and data processing systems. C has been developed so far, and unlike FORTRAN or COBOL (developed by many committees), C is designed by individuals until one goal is achieved: developing a high-level language for the implementation of UNIX kernel and related software. Like UNIX itself, C was developed by programmers for their intended use. The result is a compact, effective, powerful, concise, modular, and coherent language in design.
The first 6 versions of UNIX
Between 1969 and 1979, UNIX released several editions, called “editions”. Essentially, snapshots developed by AT&T.
- First version 11/1971: at this time, UNIX runs on PDP-11 and has the FORTRAN compiler and lots of useful programs to this day, including ar, cat, chmod, chown, cp, dc, ed , find, ln, ls, mkdir, mv, rm, sh, su and who
- The second version, June 1972, UNIX can be installed on 10 AT&T machines
- The third version, February 1973, included the C compiler and the first implementation of pipes
- The 4th version, November 1973, most of UNIX are written in C
- Version 5, June 1974 UNIX was installed for more than 50 systems
- 6th edition, May 1975: widely used outside AT&T
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | Over the period of these releases, the use and reputation of UNIX began to spread, first within AT&T, and then beyond. An important contribution to this growing awareness was the publication of a paper on UNIX in the widely read journal Communications of the ACM ([Ritchie & Thompson, 1974]). At this time, AT&T held a government-sanctioned monopoly on the US telephone system. The terms of AT&T’s agreement with the US government prevented it from selling software, which meant that it could not sell UNIX as a product. Instead, beginning in 1974 with Fifth Edition, and especially with Sixth Edition, AT&T licensed UNIX for use in universities for a nominal distribution fee. The university distributions included documentation and the kernel source code (about 10,000 lines at the time). AT&T’s release of UNIX into universities greatly contributed to the popularity and use of the operating system, and by 1977, UNIX was running at some 500 sites, including 125 universities in the United States and several other countries. UNIX offered universities an interactive multiuser operating system that was cheap yet powerful, at a time when commercial operating systems were very expensive. It also gave university computer science departments the source code of a real operating system, which they could modify and offer to their students to learn from and experiment with. Some of these students, armed with UNIX knowledge, became UNIX evangelists. Others went on to found or join the multitude of startup companies selling inexpensive computer workstations running the easily ported UNIX operating system. |
History of BSD and System V
In January 1979, version 7 of UNIX, was upgraded and provided with the file system. This release includes lots of new tools including awk, sed, tar, uucp. Bourne shell and a FORTRAN 77 compiler. The 7th release is significant because UNIX has been redirected into 2 variants: BSD and System V.
Thompson spent 1975/1976 to visit professors at the University of California at Berkeley, which was his former university. There, he worked with many students and added a lot of features to UNIX. (Among these students, Bill Joy later became the co-founder of Sun Microsystems). Over time many tools and features were developed at Berkeley, including the C shell, micro editor, an upgrade of the file system (the Berkeley Fast File System), sendmail, a Pascal compiler, and memory manager. Virtual on the new architecture Digital VAX
Under the name Berkeley Software Distribution (BSD), this version of UNIX, including source code, is widely distributed. The fully distributed version was 3BSD in December 1979. (Earlier is Berkeley-BSD and 2BSD).
In 1983, the Computer Systems Research Group at the University of California in Berkeley released 4.2BSD. This release makes sense because it includes complete installations of TCP / IP, including socket programming, and lots of networking tools. The previous version 4.1BSD is widely distributed to universities around the world. They are also the founders of SunOS (released in 1983), the UNIX version sold by Sun.
Some other BSDs such as 4.3BSD in 1986, and sold 4.4BSD in 1993
1 2 3 4 5 6 7 | The very first ports of the UNIX system to hardware other than the PDP-11 occurred during 1977 and 1978, when Dennis Ritchie and Steve Johnson ported it to the Interdata 8/32 and Richard Miller at the University of Wollongong in Australia simultaneously ported it to the Interdata 7/32. The Berkeley Digital VAX port was based on an earlier (1978) port by John Reiser and Tom London. Known as 32V, this port was essentially the same as Seventh Edition for the PDP-11, except for the larger address space and wider data types. |
Meanwhile, the US antitrust law enforces the division of AT&T (starting from mid-1970 until 1982). As a result, System III was released in 1981. System III, developed by AT&T’s UNIX Support Group (USG), has several hundred employees developing and upgrading UNIX and applications. The first version of System V was in 1983, and a series of later versions were developed, in 1989 System V Release 4 (SVR4), this time System V incorporated many features from BSD including utilities. network utility.
Therefore, a lot of BSD distributions after but in the 80s. UNIX has a lot of implementations that run on many hardware. These implementations include SunOS and later Solaris, Digitals Ultrix and OSF / 1 (later renamed HP Tru64 YNIX), IBM AIX, Hewlett-Parkard’s (HP’s) HP-UX, NeXT’s NeXTStep, A / UX for Apple Macintosh , and Microsoft and SCO’s XENIX for Intel 32-bit architectures. Each vendor produces one or several proprietary chip architectures, they sell proprietary operating systems.
A brief history of Linux
The term Linux is often referred to as a UNIX-like operating system with the Linux kernel being part of it. However, this is incorrect since many of the important components are included in commercial Linux distributions. The true origin of Linux comes from a project.
The GNU Project
In 1984, Richard Stallman, a special talented programmer, who worked at MIT, created a free version of UNIX. Stallman has resisted limits on the legitimacy of proprietary operating systems of computer vendors. These limits mean buying a computer without seeing the source code of the software they are buying and they certainly cannot copy the change and redistribute it. He also encourages developers to compete with others and integrate them into their work.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | Stallman militated against the legal restrictions placed on proprietary operating systems by computer vendors. These restrictions meant that purchasers of computer software in general could not see the source code of the software they were buying, and they certainly could not copy, change, or redistribute it. He pointed out that such a framework encouraged programmers to compete with each other and hoard their work, rather than to cooperate and share it. In response, Stallman started the GNU project (a recursively defined acronym for “GNU’s not UNIX”) to develop an entire, freely available, UNIX-like system, consisting of a kernel and all associated software packages, and encouraged others to join him. In 1985, Stallman founded the Free Software Foundation (FSF), a nonprofit organization to support the GNU project as well as the development of free software in general. When the GNU project was started, BSD was not free in the sense that Stallman meant. Use of BSD still required a license from AT&T, and users could not freely modify and redistribute the AT&T code that formed part of BSD. One of the important results of the GNU project was the development of the GNU General Public License (GPL), the legal embodiment of Stallman’s notion of free 6 Chapter 1 software. Much of the software in a Linux distribution, including the kernel, is licensed under the GPL or one of a number of similar licenses. Software licensed under the GPL must be made available in source code form, and must be freely redistributable under the terms of the GPL. Modifications to GPL-licensed software are freely permitted, but any distribution of such modified software must also be under the terms of the GPL. If the modified software is distributed in executable form, the author must also allow any recipients the option of obtaining the modified source for no more than the cost of distribution. The first version of the GPL was released in 1989. The current version of the license, version 3, was released in 2007. Version 2 of the license, released in 1991, remains in wide use, and is the license used for the Linux kernel. (Discussions of various free software licenses can be found in [St. Laurent, 2004] and [Rosen, 2005].) The GNU project did not initially produce a working UNIX kernel, but did produce a wide range of other programs. Since these programs were designed to run on a UNIX-like operating system, they could be, and were, used on existing UNIX implementations and, in some cases, even ported to other operating systems. Among the more well-known programs produced by the GNU project are the Emacs text editor, GCC (originally the GNU C compiler, but now renamed the GNU compiler collection, comprising compilers for C, C++, and other languages), the bash shell, and glibc (the GNU C library). By the early 1990s, the GNU project had produced a system that was virtually complete, except for one important component: a working UNIX kernel. The GNU project had started work on an ambitious kernel design, known as the GNU/HURD, based on the Mach microkernel. However, the HURD was far from being in a form that could be released. (At the time of writing, work continues on the HURD, which currently runs only on the x86-32 architecture.) Because a significant part of the program code that constitutes what is commonly known as the Linux system actually derives from the GNU project, Stallman prefers to use the term GNU/Linux to refer to the entire system. The question of naming (Linux versus GNU/Linux) is the source of some debate in the free software community. Since this book is primarily concerned with the API of the Linux kernel, we’ll generally use the term Linux. The stage was set. All that was required was a working kernel to go with the otherwise complete UNIX system already produced by the GNU project. |
Linux Kernel
In 1991, Linus Torvalds, a Finnish student at the University of Helsinki, wrote an operating system for his Intel 80386 computer. In one course, he had to use Minix, a small UNIX-like operating system developed in the mid-80s of the last century by Andrew Tanenbaum, a University professor in Holland. Tanenbaum created Minix. The Minix kernel can be built and run on a 386 system. However, it is used as a teaching tool, it is designed depending on the hardware architecture, and it does not use to the best of its ability. 386 processor.
Torvalds started the project to create a fully featured UNIX kernel running on 386. A few months later, Torvalds developed a kernel that allowed him to compile and run a lot of GNU programs. After 5-10-1991, Torvalds asked for the help of other programmers.
1 2 3 4 5 6 7 8 9 10 11 12 13 | Do you pine for the nice days of Minix-1.1, when men were men and wrote their own device drivers? Are you without a nice project and just dying to cut your teeth on a OS you can try to modify for your needs? Are you finding it frustrating when everything works on Minix? No more all-nighters to get a nifty program working? Then this post might be just for you. As I mentioned a month ago, I’m working on a free version of a Minix-look-alike for AT-386 computers. It has finally reached the stage where it’s even usable (though may not be depending on what you want), and I am willing to put out the sources for wider distribution. It is just version 0.02 . . . but I’ve successfully run bash, gcc, gnu-make, gnu-sed, compress, etc. under it. |
Following the tradition of UNIX ending in X, this kernel is called Linux. Linux was initially under a lot of limited licenses, but Torvalds soon made it available under the GNU GPL license.
Many other developers join Torvalds in the development process of Linux, adding many features such as upgrading the file system, networking support, printing devices, and multi-processor support. In April 1994, developers released version 1.0. Linux 1.2 in March 1995. version 2.0 in June 1996, Linux 2.2 in January 1999, Linux 2.4 in 1/2991. 2.5 November 2001, 2.6 in December 2003
An aside: the BSDs
Linux kernel version numbers
Ports to other hardware architectures
Linux distributions
The standards
summary
The UNIX system was first developed in 1969 on a Digital PDP-7 minicomputer by Ken Thompson at Bell Laboratories (AT&T). The operating system takes many ideas and is pun on the name of MULTICS system. In 1973, UNIX was written for PDP-11 and rewritten in C, a language designed and installed at Bell Laboratories by Dennis Ritchie. To legitimize the sale of UNIX, AT&T has distributed systems to nominal universities. These distributions include source code, and became very popular in the university, since it provided a cheaper operating system where source code was learned and edited by computer scientists and academics. born.
The University of California at Berkeley acts as a UNIX system developer. here Ken Thompson and some of the students who graduated here expand this system. In 1979, the university produced their UNIX distributions, BSD, which are widely used and underpinned by many commercial UNIX releases.
Along with BSD is the System V.
Two different things have led to the development of the Linux (GNU /) system. One of them is the GNU Project, founded by Richard Stallman. The late 80s. The GNU Project is almost complete, available for free distribution. In 1991 inspired by the Minix kernel written by Andrew Tanenbaum, Linux Torvalds built the UNIX kernel for the Intel x86-32 architecture. Torvalds invited other developers to join him to develop this kernel. Many other programmers have done so, over time, Linux has expanded and ran on a lot of hardware architectures
Portability problems / porting / portability issues I understand is to run on multiple hardware, cross-platform, etc. in UNIX and C implementations that have been around since the 80s. The C language had standards in 1989 (C89), and was revised in 1999 (C99). First read standardized operating system interface POSIX.1, approved by IEEE in 1988, and as ISO standard in 1990. During the 1990s, the other standards outlined included many standards of Single UNIX. Specification. In 2001, the POSIX 1003.1-2001 and SUSv3 were approved. This standard has been incorporated and expanded from many previous versions of POSIX and Single UNIX Specifications before. In 2008, revised and finalized the POSIX 1003.1-2008 and SUSv4.
Unlike the UNIX implementations, Linux splits into many distributions. Consequently, there is no “official” Linux distribution. Every Linux distribution creates snapshots from the current kernel, with lots of patches applied. LSB develops and advertises a set of Linux systems aimed at ensuring that applications are compatible between Linux distributions, so that applications are compiled and run reliably on other Linux systems. together.
End
I wonder if you have installed Linux as your previous exercise. If not, do it now.
The exercise is that you take a look at the first 5 videos: https://www.youtube.com/playlist?list=PL7B2bn3G_wfBuJ_WtHADcXC44piWLRzr8 .
No need to outperform your compatriots, outrun you in the past
In the next article, I will translate Part 2: Basic concepts.