]> git.tuebingen.mpg.de Git - aple.git/blobdiff - Unix_Concepts.m4
Unix_Concepts: Only mark up I/O operations as code and not comma
[aple.git] / Unix_Concepts.m4
index ae0c4ecf603fbc41fcb1a5e8ceed77f4e79947ec..fb3a122fcda0136dbebdd16b93646c681ee1be43 100644 (file)
@@ -145,18 +145,34 @@ interface based on the X window system facilitated cheap workstations
 which ran a complete open source software stack. </p>
 
 <p> The success of Linux, or <em>GNU/Linux</em> 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.
-
-<p> 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. </p>
+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. </p>
+
+<p> 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. </p>
+
+<p> 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. </p>
 
 SUBSECTION(«Linux Distributions»)
 
@@ -202,10 +218,6 @@ EXERCISES()
        <li> Run <code>uname -a</code> on various Unix machines to see the
        OS type and the kernel version. </li>
 
-       <li> Nice read on the
-       <a href="http://www.catb.org/~esr/writings/taoup/html/ch02s01.html">Origins and
-       History of Unix</a>, 1969-1995. </li>
-
        <li> Explore the <a
        href="https://upload.wikimedia.org/wikipedia/commons/7/77/Unix_history-simple.svg">Unix
        time line</a>. </li>
@@ -214,14 +226,6 @@ EXERCISES()
        href="http://www.gnu.org/cgi-bin/license-quiz.cgi">Free Software
        licensing quiz</a>. </li>
 
-       <li> Read the <a
-       href="https://www.newyorker.com/business/currency/the-gnu-manifesto-turns-thirty">
-       notes on the 30th anniversary</a> of the GNU Manifesto. </li>
-
-       <li> Read the <a
-       href="http://www.catb.org/~esr/writings/unix-koans/end-user.html">
-       Koan of Master Foo and the End User</a>. </li>
-
        <li> On a Debian or Ubuntu system, run <code>aptitude search
        python</code> to list all python-related Ubuntu packages. Run
        <code>aptitude show python-biopython</code> to see the description
@@ -553,8 +557,8 @@ EXERCISES()
 HOMEWORK(«
 
 Think about printers, sound cards, or displays as a file. Specifically,
-describe what <code>open, read</code>, and <code>write</code> should
-mean for these devices.
+describe what <code>open</code>, <code>read</code>, and <code>write</code>
+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 <code>open, read, write</code> 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 <code>open</code>, <code>read</code>,
+<code>write</code> 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. </p>
 
 <table>
        <tr>
-               <td> </td>
-               <td> <em>Directories</em> </td>
-               <td> <em>Non-directories</em> </td>
+               <th> &nbsp;&nbsp; </th>
+               <th> Directories </th>
+               <th> Non-directories </th>
        </tr> <tr>
-               <td> <code>&nbsp;r&nbsp;</code> </td>
+               <th> <code>r</code> </th>
 
                <td> The permission to list the directory contents. More precisely,
                this bit grants the permission to call <code>opendir(3)</code>
@@ -813,7 +818,7 @@ as described below. </p>
                fail for other reasons, though.
 
        </tr> <tr>
-               <td> <code>&nbsp;w&nbsp;</code> </td>
+               <th> <code>w</code> </th>
 
                <td> 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. </p>
                permissions. </td>
 
        </tr> <tr>
-               <td> <code>&nbsp;x&nbsp;</code> </td>
+               <th> <code>x</code> </th>
 
                <td> The permission to <em>search</em> the directory. Searching
                a directory means to access its entries, either by retrieving
@@ -858,9 +863,9 @@ three digits. </p>
 
 <table>
        <tr>
-               <td> octal value </td>
-               <td> symbolic representation </td>
-               <td> meaning </td>
+               <th> Octal Value </th>
+               <th> Symbolic Representation </th>
+               <th> Meaning </th>
        </tr> <tr>
                <td> 0 </td>
                <td> <code>---</code> </td>
@@ -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 <a
-href="#soft_and_hard_links">subsequent section</a>. 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»)
 
 <p> The <code>pipe(2)</code> 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 <em>read end</em> of the pipe, the other is
 the <em>write end</em>. Data written to the write end is buffered by
 the kernel and can be obtained by reading from the read end. </p>
@@ -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. </p>
 
+<p> This approach depends on file descriptor inheritance across
+<code>fork(2)</code>, so it does not work in the situation
+where neither process is an ancestor of the other. Files of
+type <em>fifo</em> (named pipes) overcome this restriction. To
+establish a connection between two <em>unrelated</em> processes,
+both processes call <code>open(2)</code> to obtain a file
+descriptor which is associated with the fifo. One process passes
+the <code>O_WRONLY</code> flag to open the file for writing while
+the other passes <code>O_RDONLY</code> to open it for reading. The
+two processes may then communicate in the same way as with the
+<code>pipe(2)/fork(2)</code> approach. </p>
+
 <p> The POSIX <code>dup(2)</code> and <code>dup2(2)</code> 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 <code>wc(1)</code>. Since <code>ls(1)</code> writes to stdout
 and <code>wc(1)</code> reads from stdin, <code>wc(1)</code> processes
 the output of <code>ls(1)</code>. </p>
 
-<p> Note that this trick does not work to establish a connection
-between two <em>existing</em> processes because it depends on file
-descriptor inheritance across <code>fork(2)</code>. In the general
-case one has to fall back to sockets or fifos to create the data
-channel. </p>
-
 SUBSECTION(«Stdio»)
 
 <p> The POSIX standard requires a compliant Unix system to provide
@@ -2518,6 +2524,21 @@ SUBSECTION(«symlink_madness»)
 
 SECTION(«Further Reading»)
 <ul>
+       <li> <a
+       href="http://www.catb.org/~esr/writings/taoup/html/ch02s01.html">Origins
+       and History of Unix, 1969-1995</a> by Eric Steven Raymond. </li>
+
+       <li> <a
+       href="https://www.newyorker.com/business/currency/the-gnu-manifesto-turns-thirty">
+       The GNU Manifesto Turns Thirty</a>, by Maria Bustillos. </li>
+
+       <li> <a href="https://lwn.net/Articles/924577/">The SCO lawsuit,
+       20 years later</a> </li>
+
+       <li> <a
+       href="http://www.catb.org/~esr/writings/unix-koans/end-user.html">
+       The Koan of Master Foo and the End User</a>. </li>
+
        <li> <a href="https://lwn.net/Articles/411845/">Ghosts of Unix Past:
        a historical search for design patterns</a>, by Neil Brown. </li>