read, write) /vmunix) 
Le système est l'ensemble des librairies, des appels-système et du
noyau.
 
TIT .MULTICS SYSTEM : AN EXAMINATION OF ITS STRUCTURE ZAUT .ORGANICK, ELLIOTT I. DAT .1972 EDI .MIT PRESS,CAMBRIDGE, MA
Autres systèmes:
 
Technologie
uucp 1980; Internet 1985) 
 
/vmunix le noyau du système /etc/init le programme qui s'exécute au boot:  /bin/sh sur le
fichier /etc/rc (en multi-utilisateur) et ainsi
initialise les partitions du système de fichiers, le réseau, 
nettoie les fichiers temporaires de /tmp, lance les
démons, la comptabilité et les spoolers.  
/etc/ttys un programme d'écoute correspondant. En général, ce
programme est /etc/getty qui initialise la ligne, fixe un 
process group; ses actions décrites dans /etc/gettytab sont
paramétrées par le type de terminal. Pour les lignes marquées
interactives, on envoie la banière de login, et on lit le nom de
l'utilisateur (knaff). /bin/login knaff. Si ce
dernier réussit (bon mot de passe qui figure dans 
/etc/passwd), un shell (interpréteur de commandes) démarre.
Il y a plusieurs shell possibles. La correspondance entre
l'utilisateur et le shell est indiquée dans 
/etc/passwd. 
 
/bin, /usr/bin, /usr/local/bin, /usr/ucb
binaires des commandes /lib, /usr/lib, /usr/local/lib librairies /tmp fichiers temporaires /usr/users/cie6/knaff home directory (la
correspondance se trouve dans /etc/passwd) /etc fichiers annexes système /dev les périphériques /man les manuels 
/bin/sh)man sh, man csh, man tcsh, man
bash, man perl learn sur poly $0, $1,
$2, etc `xxx` 'a*b', "a*$1" 
TIT     .The UNIX programming environment
SLA     .Brian W. Kernighan, Rob Pike. - Englewood Cliffs, NJ
        .: Prentice-Hall, 1984. - X-357 p. ; 24 cm. - (Prentice-
        .Hall software series).
who | wc -l hist | spline | psplot | lpr (cd directory1; tar cf - fichier1) | (cd directory2; tar xf -) (date; who) > foto1 (date; who) >> foto1  mail -s URGENT levy <lettre_de_protestation ls a*.cecho * emacs notre éditeur de texte favori (Richard Stallman, FSF) 
 
TIT .BCPL : THE LANGUAGE AND ITS COMPILER AUT .Richards, Martin. / Whitby-Strevens, Colin. DAT .1979 EDI .CAMBRIDGE UNIVERSITY PRESS,CAMBRIDGE, MA
TIT     .The C programming language
SLA     .Brian W. Kernighan, Dennis M. Ritchie. - Englewood Cliffs,
        .NJ : Prentice Hall, 1978. - X-228 p. ; 24 cm. - (Prentice
        .Hall software series).
const N = 100;
var a: array [1..N] of integer;
procedure Insertion;
    var i, j, v: integer;
    begin
    for i := 2 to N do 
        begin
        v := a[i]; j := i;
        while a[j-1] > v do
            begin a[j] := a[j-1]; j:= j-1 end;
        a[j] := v;
        end;
    end;
#define N     100
int a[100];
void Insertion()
{
    int i, j, v;
    for (i = 1; i < N; ++i) {
        v = a[i]; j = i;
        while (a[j-1] > v) {
            a[j] = a[j-1]; j = j-1;
        }
        a[j] = v;
    }
}
void Insertion()
{
    register int i, j, v;
    for (i = 1; i < N; ++i) {
        v = a[i];
        for (j = i; (j > 0) && (a[j-1] > v); --j)
            a[j] = a[j-1];
        a[j] = v;
    }
}
&x&p (pointeurs)
        *&x == x
void Insertion()
{
    int v, *p, *q;
    for (p = &a[1]; p < &a[N]; ++p)
        v = *p;
        for (q = p; (p > &a[0]) && (*(q-1) > v); --q)
            *q = *(q-1);
        *q = v;
    }
}
void Insertion()
{
    register int v, *p, *q;
    for (p = a + 1; p < a + N; ++p)
        v = *p;
        for (q = p; (p > a) && (*(q-1) > v); --q)
            *q = *(q-1);
        *q = v;
    }
}
#include <stdio.h>
#define N     100
int a[N];
void Insertion (int a[], int n)
{
...
}
int main()
{
    int x, n;
    printf ("Entrez les nombres a trier (-1 pour terminer)\n");
    n = 0;
    for (;;) {
        scanf ("%d\n", &x);
        if ((x == -1) || (n >= N))
            break;
        a[n++] = x;
    }
    Insertion (a, n);
    for (i = 0; i < n; ++i)
        printf ("a[%2d] = %d\n", i, a[i]);
}   
void Exchange (int *p, int *q)
{
    int r;
    r = *p; *p = *q; *q = r;
}
int main ()
{
    int x, y;
    Exchange (&x, &y);
}
&a[i] == a + ipour tout tableau
a et entier i.
Donc, si on a un tableau int a[1000], une procédure f de
signature f(int *p) peut s'écrire f(&a[0]) ou f(a).
On peut aussi déclarer la signature sous la forme f(int p[])
avec un tableau ouvert.char nom[] = "levy"; nom[0] == 'l' nom[1] == 'e' nom[2] == 'v' nom[3] == 'y' nom[4] == 0 == '\0'
 
x = 1 est une
expression retournant la valeur de son membre droit 1, on écrit: 
if (x == 3)
    x = 1;
else
    x = 0;
}
{ et }. 
struct point {
    int x;
    int y;
};
struct point p, q;
... p.x = q.x - 2; ...
struct complex {
    float re;
    float im;
} z1, z2;
struct complex z3;
... z.re = 3.14; ...
 
 
struct tnode {
    char *word;
    int count;
    struct tnode *left;
    struct tnode *right;
}
struct t {
    ...
    struct s *p;
};
struct s {
    ...
    struct t *q;
}
struct tnode *p; ...(*p).left... ...p->left...
int *f();  est une fonction retournant un pointeur vers des intint (*pf)(); est un pointeur vers une fonction
 
union complexe { 
   struct cartesien {
       float: re;
       float: im;
   };
   struct polaire {
       float: rho;
       float: theta;
   };
} x, y;
...x.cartesien.re...
...y.polaire.rho...
typedef unsigned long u_long; u_long x, y;
float x = 3.14; int i; i = (int) x; short x; char *p; p = (char *) &x;
 
sizeof, malloc
#include <stdlib.h> 
/* talloc: make a node */
struct tnode *talloc (void)
{
    return (struct tnode *) malloc (sizeof(struct tnode));
}
 
emacs et le sauver dans prog1.c 
#include <stdio.h>
int main() /* count digits, white space, others */
{
    int c, i , nwhite, nother, ndigit[10];
    nwhite = nother = 0;
    for (i = 0; i < 10; ++i)
        ndigit[i] = 0;
    while ((c = getchar()) != EOF) {
        switch (c) {
        case '0': case '1': case '2': case '3': case '4':
        case '5': case '6': case '7': case '8': case '9':
            ++ ndigit [c - '0'];
            break;
        case ' ':
        case '\n':
        case '\t':
            nwhite++;
            break;
        default:
            nother++;
            break;
        }
    }
    printf("digits =");
    for (i = 0; i < 10; i++)
        printf(", white space = %d, other = %d\n",
            nwhite, nother);
}
 
% cc prog1.c % a.out
adb, dbx ou {\tt
gdb}.  Ce dernier est fortement conseillé sous emacs, si on a
des bonnes macros pour interfacer la souris. .emacs de son homedir, la ligne(load "/usr/users/labos/profs/levy/emacs/x-mouse-s.elc")
prog1.c avec l'option -g% cc -g prog1.cSous
emacs, taper la commande  sur le fichier
binaire a.out. Dans le binaire, le nom du fichier source et des
indications sur les variables et numéros de lignes ont été
rajoutées par l'option -g de cc. 
LIRE LE MANUEL GDBOn peut par exemple aller dans le source en pointant avec la souris (bouton de gauche), et mettre un point d'arrêt avec la commande CTL-X-SPACE met un point d'arrêt sur cette ligne. En allant dans le buffer gdb, on peut taper
(gdb) run, pour démarrer (gdb) p nwhite pour imprimer nwhite (gdb) cont ...
 
/usr/local/src/src.pmax/ultrix-3.1-pmax/lib/libc/gen, le
programme de conversion de chaines ASCII en entier.
% more atoi.c
/* @(#)atoi.c   4.3 (Berkeley) 81/02/28 */
int atoi(p)
register char *p;
{
        register int n;
        register int f;
        n = 0;
        f = 0;
        for(;;p++) {
                switch(*p) {
                case ' ':
                case '\t':
                        continue;
                case '-':
                        f++;
                case '+':
                        p++;
                }
                break;
        }
        while(*p >= '0' && *p <= '9')
                n = n*10 + *p++ - '0';
        return(f? -n: n);
}
Regarder lib/libc/mips/gen/atof.c!!
lib/libc/mips/gen/strncmp.c
% more strncmp.c
/* $Header: strncmp.c,v 1.1 87/02/16 11:17:00 dce Exp $ */
/*
 * Compare strings (at most n bytes):  s1>s2: >0  s1==s2: 0  s1<s2: <0
 */
strncmp(s1, s2, n)
register char *s1, *s2;
register n;
{
        while (--n >= 0 && *s1 == *s2++)
                if (*s1++ == '\0')
                        return(0);
        return(n<0 ? 0 : *s1 - *--s2);
}
Regarder lib/libc/mips/gen/atof.c!!
lib/libc/mips/gen/strcpy.c
% more strncpy.c
/* $Header: strncpy.c,v 1.1 87/02/16 11:17:02 dce Exp $ */
/*
 * Copy s2 to s1, truncating or null-padding to always copy n bytes
 * return s1
 */
char *
strncpy(s1, s2, n)
register char *s1, *s2;
{
        register i;
        register char *os1;
        os1 = s1;
        for (i = 0; i < n; i++)
                if ((*s1++ = *s2++) == '\0') {
                        while (++i < n)
                                *s1++ = '\0';
                        return(os1);
                }
        return(os1);
}
echo aa bb cc   (lire donc argv et argc et imprimer) cat aa bb   (lire argv et argc et lire les fichier correspondants)cat          (sans arguments) aa bb EOF   cat1 (lire l'entrée standard et imprimer les fichiers correspondants)aa bb cc EOF   cat1 aa bb   (que fait-il?)... sort
    (trier les lignes de stdin par ordre lexicographique) 
getchar(), getc(), putchar,
putc,printf) et on utilise pour le moment
que les file pointers (pas de fd SVP). On expliquera la
logique des redirections que dans la lecon sur le système de fichier
(TD2).
/*
 * Inode structure as it appears on
 * a disk block.
 */
struct dinode
{
        unsigned short  di_mode;/* mode and type of file */
        short   di_nlink;       /* number of links to file */
        short   di_uid;         /* owner's user id */
        short   di_gid;         /* owner's group id */
        off_t   di_size;        /* number of bytes in file */
        char    di_addr[40];    /* disk block addresses */
        time_t  di_atime;       /* time last accessed */
        time_t  di_mtime;       /* time last modified */
        time_t  di_ctime;       /* time created */
};
#define INOPB   8       /* 8 inodes per block */
/*
 * the 40 address bytes:
 *      39 used; 13 addresses
 *      of 3 bytes each.
 */