Translating The Linux Programming Interface – Part 1: History and standards

Tram Ho

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

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

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.

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.

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.

Share the news now

Source : Viblo