X-Git-Url: http://git.tuebingen.mpg.de/?p=aple.git;a=blobdiff_plain;f=Unix_Concepts.m4;h=3841c01348f9f75c1844197299a3a920d69ed015;hp=ae0c4ecf603fbc41fcb1a5e8ceed77f4e79947ec;hb=HEAD;hpb=e9a3585174e0fda1ac580d0e720f7ecc48bb9e9f diff --git a/Unix_Concepts.m4 b/Unix_Concepts.m4 index ae0c4ec..fb3a122 100644 --- a/Unix_Concepts.m4 +++ b/Unix_Concepts.m4 @@ -145,18 +145,34 @@ interface based on the X window system facilitated cheap workstations which ran a complete open source software stack.

The success of Linux, or GNU/Linux as some prefer to -call it for reasons that should now be clear, has only increased -over time, to the point where commercial Unix systems are mostly -irrelevant. Today Linux runs on a wide variety of machines ranging -from supercomputers to workstations, smart phones and IOT (internet -of things) devices with very limited resources. - -

The same companies which almost killed Unix by commercializing it -in order to maximize their profit make money with Linux today. However, -they had to adjust their business model in order to comply with the -GPL. Rather than selling proprietary software, they bundle open source -software and sell support to paying customers. Some companies also -sell hardware with Linux pre-installed.

+call it for reasons that should now be clear, steadily increased over +time. In 2003 the SCO group, a company which sold a proprietary Unix +system, was unhappy about this progress and sued IBM, which offered +various Linux products. SCO claimed to be the owner of Unix, and that +Linux contained "millions of lines" of code copied from Unix. SCO's +lawyers argued that the success of Linux originated from this theft +of intellectual property and asked for $5 billion as compensation +for the resulting losses. The company also tried to collect taxes +from other Linux users. Microsoft funded SCO in these efforts.

+ +

In the end SCO lost the lawsuit since it was evident that all that +copied code never existed. In fact, the court ruled that SCO did not +even own the Unix copyrights to begin with. Another fun fact is that +the large number of bugs in the early Linux code actually helped to +prove that Linux was original work. The long term effects of this +lawsuit, an improved position of Linux and its ecosystem, last until +the presence. Commercial Unix systems have become irrelevant as Linux +runs on a wide variety of machines ranging from supercomputers to +workstations, smart phones and IOT (internet of things) devices with +very limited resources.

+ +

While SCO went bankrupt eventually, some of the companies which +almost killed Unix by maximizing their own profit still exist, and +make money with Linux today. However, they had to adjust their +business model in order to comply with the GPL. Rather than selling +proprietary software, they bundle open source software and sell +support to paying customers. Some companies also sell hardware with +Linux pre-installed.

SUBSECTION(«Linux Distributions») @@ -202,10 +218,6 @@ EXERCISES()
  • Run uname -a on various Unix machines to see the OS type and the kernel version.
  • -
  • Nice read on the - Origins and - History of Unix, 1969-1995.
  • -
  • Explore the Unix time line.
  • @@ -214,14 +226,6 @@ EXERCISES() href="http://www.gnu.org/cgi-bin/license-quiz.cgi">Free Software licensing quiz. -
  • Read the - notes on the 30th anniversary of the GNU Manifesto.
  • - -
  • Read the - Koan of Master Foo and the End User.
  • -
  • On a Debian or Ubuntu system, run aptitude search python to list all python-related Ubuntu packages. Run aptitude show python-biopython to see the description @@ -553,8 +557,8 @@ EXERCISES() HOMEWORK(« Think about printers, sound cards, or displays as a file. Specifically, -describe what open, read, and write should -mean for these devices. +describe what open, read, and write +should mean for these devices. », « @@ -566,9 +570,10 @@ printers could return the number of paper trays, the amount of toner left etc. Writing to the file descriptor would cause output on the device. This would mean to print the text that is written, play the audio samples, or show the given text on the display. The point to -take away is that the open, read, write interface is a -generic concept that works for different kinds of devices, not only -for storing data in a file on a hard disk. +take away is that the open, read, +write interface is a generic concept that works for +different kinds of devices, not only for storing data in a file on a +hard disk. ») @@ -796,11 +801,11 @@ as described below.

    - - - + + + - + - + - +
    Directories Non-directories    Directories Non-directories
     r  r The permission to list the directory contents. More precisely, this bit grants the permission to call opendir(3) @@ -813,7 +818,7 @@ as described below.

    fail for other reasons, though.
     w  w The permission to add or remove directory entries. That is, to create new files or to remove existing files. Note that write @@ -827,7 +832,7 @@ as described below.

    permissions.
     x  x The permission to search the directory. Searching a directory means to access its entries, either by retrieving @@ -858,9 +863,9 @@ three digits.

    - - - + + + @@ -1131,11 +1136,7 @@ file. Paths can be mapped to files, but not the other way around. In particular, there is no such thing like "the list of paths which have changed since yesterday". -The concept of hard- and soft links complicates -the situation further. This topic is discussed in a subsequent section. See the exercises -therein for more information. - +The concept of hard- and soft links complicates the situation further. ») HOMEWORK(« @@ -1790,8 +1791,7 @@ SUBSECTION(«Pipes and Redirections»)

    The pipe(2) system call takes no arguments and creates two file descriptors for the calling process which are tied -together as a unidirectional first in, first out data channel that -works just like a fifo, but without any files being involved. One +together as a unidirectional first in, first out data channel. One file descriptor is the read end of the pipe, the other is the write end. Data written to the write end is buffered by the kernel and can be obtained by reading from the read end.

    @@ -1803,6 +1803,18 @@ a copy of both pipe file descriptors. Hence the parent process can communicate with the child by writing a message to the write end of the pipe for the child to read.

    +

    This approach depends on file descriptor inheritance across +fork(2), so it does not work in the situation +where neither process is an ancestor of the other. Files of +type fifo (named pipes) overcome this restriction. To +establish a connection between two unrelated processes, +both processes call open(2) to obtain a file +descriptor which is associated with the fifo. One process passes +the O_WRONLY flag to open the file for writing while +the other passes O_RDONLY to open it for reading. The +two processes may then communicate in the same way as with the +pipe(2)/fork(2) approach.

    +

    The POSIX dup(2) and dup2(2) system calls allow a process to manipulate the entries of its file descriptor array. In particular the standard file descriptors 0, 1, and 2 can be @@ -1827,12 +1839,6 @@ with wc(1). Since ls(1) writes to stdout and wc(1) reads from stdin, wc(1) processes the output of ls(1).

    -

    Note that this trick does not work to establish a connection -between two existing processes because it depends on file -descriptor inheritance across fork(2). In the general -case one has to fall back to sockets or fifos to create the data -channel.

    - SUBSECTION(«Stdio»)

    The POSIX standard requires a compliant Unix system to provide @@ -2518,6 +2524,21 @@ SUBSECTION(«symlink_madness») SECTION(«Further Reading»)

    octal value symbolic representation meaning Octal Value Symbolic Representation Meaning
    0 ---