:



     Origin: http://www.linux.org.ru/books/
 From: Ultracom 
====================================================================
                                                           0.3
                                                          1995





     (Lars Wirzenius)





.
                                - 2 -



 1                                                      4
1.1       Linux                         6
 2    Linux                                         8
2.1                          8
2.2                                            9
2.3     UNIX                                  10
2.3.1  init                                                         10
2.3.2                                 11
2.3.3  Syslog                                                       11
2.3.4    :  cron    at                11
2.3.5                               12
2.3.6                                                   12
2.3.7                                   13
2.3.8                                         13
2.3.9                                                          14
2.3.10                                                        14
2.4                                         15
 3                                   16
3.1                                                            16
3.2                             17
3.3                               20
3.4                                              23
3.5                                  23
3.6                                      23
 4                          25
4.1                                                    26
4.2                                                     27
4.3                                                      30
4.4                                                   31
4.5                                                  34
4.5.1  MBR,                       35
4.5.2                                  35
4.5.3                                                   37
4.5.4                                        38
4.5.5                                         39
4.6                                                  39
4.6.1     ?                                  39
4.6.2                                             41

                                - 3 -

4.6.3     ?                        44
4.6.4                                       44
4.6.5                                    46
4.6.6                       50
4.7                                           52
4.8                               53
4.8.1                                          53
4.8.2                               54
4.8.3                              55
4.8.4              55
4.8.5                          55
 5                                      57
5.1                                                         57
5.2    root                                          59
5.2.1    /etc                                                60
5.2.2   /dev                                                 62
5.3    /usr                                          63
5.4    /var                                          64
5.5    /proc                                         65
 6   p                                         68
6.1    p ?                                  68
6.2   swap                                           69
6.3   swap pp                                70
6.4   swap   p p               71
6.5   swap pp                                   72
6.6   p                                                 73
 7                                   76
7.1     p p                          76
7.2     p                                77
7.3    pp login                                  78
7.4  X    xdm                                                      79
7.5  p                                                79
7.6                                                   80

.
                                - 4 -



                         1  

          
   Linux.   
    ,   
    ,    
   Linux,     "
  Linux".     
 ,     (
     "   
Linux").      LDP (Linux Documentation
Project)         
p.       
  Linux.

         ?   ,
      
(,     , 
 ,    , 
    ..).    
,      
 ,    ,  
  ..     
,        .

        ,    
       . , 
       
   .     
     ,  
      .
,    ,    .

     ,       
   ,   
        Linux.  

                                - 5 -

,      
     .
        
    (   'man').

             
  Linux,      
   UNIX-  .  
   UNIX   (  
 ),     
,   .   
  Linux -  ,    
   .     
  Linux,      
 .        
  ,   .  
   ,    
.       
,     .

         ,   
 Linux,      .
,      ,  
 ,      . 
,       
,         .

      ,       
 ,     
   .  
     , , 
  mkfs(8).    
     ,  
  .     
      , 
       
Linux.


                                - 6 -

             .
    (,  ,  
     UNIX  ..)  
   lars.wirzenius@helsinki.fi,  
  :

Lars Wirzenius / Linux docs
Hernesaarentie 15 A 2
00150 Helsinki
Finland

         , 
    : Matt Welsh, Andy Oram, Olaf
Kirch, Adam Richter  .

     H.Peter Anvin, Remy Card, Theodore Ts'o  Stephen Tweedie
      . Stephen Tweedie
       xia 
ext2.

         ,   Mark
Komarinski    1993      ,
    ,   Linux
Journal.

        Erik Troan  Red Hat 
     plain text,  
 : Paul Caprioli, Ales Cepek, Marie-France
Declerfayt, Olaf Flebbe, Helmut Geyer, Larry Greenfield, Stephen
Harris, Jyrki Havia, Jim Haynes, York Lam, Timothy Andrew Lister,
Jim Lynch, Dan Poirier, Daniel Quinlam, Philippe Steindl.


              1.1       Linux

        Linux  LDP (Linux
Documentation Project),    ,
        

                                - 7 -

    Linux.  
  Matt Welsh,    Lars'
Wirzenius  Michael' K. Johnson.

           
  LDP,     "
  Linux", " 
  Linux", " 
  Linux"  "  
Linux".       LaTeX, .dvi 
   postscript  FTP:

ftp://sunsite.unc.edu/pub/Linux/docs/LDP
ftp://tsx-11.mit.edu/pub/linux/docs/guides

      ,    LDP,    Matt'
Welsh    :

mdw@sunsite.unc.edu
.
                                - 8 -



                     2    Linux

            Linux. 
    .  
 ,   .   - 
   ,    
  .

           2.1     

      UNIX-      
  .   
    - . 
   .    
,       
     ,
      ,
      ..    
     ,  
 ,   
.       
     
  .     
     
      .
,  ,   
 (.  2      
 ).

        , 
      
.       '
 ',     .
 p     
.     
-  ,      

                                - 9 -

    .  
  ,   telnet - ,
      .

           
   (GCC  C   Linux), 
       
 . ,    , 
  .    
     ,  
  ,     
    FTP    .

                     2.2     

       Linux     :
  ,   , 
,   ,     
  .

         (
 ) -     
.     
   swap-  , 
   -.     
      .

             
   .  
   ,   
   .   
 ,    , 
      .
     ,
  .     
    ,   
  . ,   
     ,     

                                - 10 -

     '  ',
'  N', '  N'.

      ,  ,  
. ,      
  - BSD socket .    -
  ,   Linux. 
    (Virtual File System - VFS)
     ,   
,       
.     -   
  VFS,    
  .

                 2.3     UNIX 

          
    UNIX .   
   .

                            2.3.1  init

           UNIX 
 p init.     UNIX 
   ,    p 
.   init,   
(    , 
 -  ..).

       ,     init, 
  .  init 
 ,     
  .   -  .
    ' '. ,
    -  
 .    , 
  X-windows.


                                - 11 -

       ,     
init -  ,   - getty 
(..     )  
orphan- (.. ,    
;   UNIX     
 ,  orphan-  
).

          , init 
  ,    
 .

                2.3.2      

          ( 
)     (   X) 
 getty. init    getty 
 . getty     
 login,   .    
  ,  login  .
   ,      ,  
  login       
 , init    getty.  
   ,    
.

                           2.3.3  Syslog

            
 ,    . 
syslog      ,    
 . Syslog   , 
        
. ,     
 ,        
     .

         2.3.4    :  cron    at

                                - 12 -


       ,    
     .
,    
       
 (/tmp  /var/tmp),    .

         cron.   
  crontab,     ,
     ,   
 . - crond  
  .

      at   cron,   
         .

                 2.3.5    

        UNIX    Linux,  
    .    
  .    
,     .

          ,    
. ,     
  ,    .

         Linux 
   X Window System ( X). X 
  ,    ,
.. ,       
.      
  X -  Athena, Motif  Open Look.

                       2.3.6    

      -  ,     
  .

                                - 13 -


     UNIX-     
 .    (
, ,     ..)  
  .    
  ,    
 .

     ,       
 .     .  "
   Linux".

               2.3.7      

            ,
  .   
    ,   
 .   , 
 ,      
    .    
   getty   
 .     
    . , telnet  rlogin
-    TCP/IP .

           , 
   getty  
- (   telnet   login
  -),   
   .  p 
,      -   
    -    
 .     getty.

                     2.3.8    

          ,   
   ,     

                                - 14 -

 .   ,  Network
File System  NFS,    Sun.

             
,    ,  
   .     
 ,       
 ,   .   
      
-   .

                              2.3.9  

            
.       
 .      
 .

          " "
(.. ,      ), 
   .    
,        
      .
        ,
     ,   
 .

           .
       
   (, sendmail  smail),  
        
    (, Pine  elm).
       /var/spool/mail.

                            2.3.10  

            
 .   ,   

                                - 15 -

   , 
 ,     
.       p. 
    ,  
  .      .

          
,    ,  ,  
   ,       
.      
 ,    ,   
      
.

                    2.4    

          : 
 root,    /bin, /lib, /etc, /dev 
 ,   /usr,   
     ,   /var,
    (  log   .) 
  /home,     
.      
       
  .

       5     
 (.  Linux Filesystem Standard).
.
                                - 16 -



                  3     

         ,     Linux
         .

                            3.1   

           
 .      
,   ,   
       .
       
   .   Linux    
 ,      ,  
      ( 
).

           
.      
     (  BIOS),
   .    
 ,     ,
         
- .

       Linux,   , 
  init(8),      
,      
 .      .

            
 (..       .), 
    swap- ,   ,
     ,    
.       ,  
      . ,

                                - 17 -

,      , 
,     , ,
     .

                3.2      

     Linux      ,    
.   "   Linux"   
.

       ,  BIOS 
 ,     .
  ,    
 (  ,     , 
  -   ,   , 
    )    
,   .    MBR
(Master Boot Record),       
        
.

          
(       
),      . 
  ,     , 
       
 .    Linux   
 .      
,       . ,
    ,   
-  ,  p LILO.

         , ,   MBR,
   (   MBR), 
  (,   ), 
       . ,
      
,    ,   ,  

                                - 18 -

  :     
,    .    
,       
    ,  ,  
  ,    
  ,     .
     ,  
     LILO  (
    LILO .    LILO).

         LILO   
   ,   , 
  LILO ,     
        
 (   Linux).     
     .   
ALT, SHIFT  CTRL (  LILO)   , 
    .    
 ,   LILO    
,    ,    
,   .

        ,  LILO,   
   ,     ,
       Linux. , 
       
  ,   .  
 (bootlin, bootactv  .) LILO  
.

          ,     
 ,       
 ,      ,  
 .        
. ,      
 .

      ,       ( 

                                - 19 -

   )  ,  
 :

        Linux    ,  
    .   
,     .

          sVGA,
    (  100x40),
     .  
     ,   
    .    
   LILO  rdev(8).

          ( ,
,    .)   
 .       
 .   ,    
:

LILO boot:
Loading linux.
Console: colour EGA+ 80x25, 8 virtual consoles
Serial driver version 3.94 with no serial options enabled
tty00 at 0x03f8 (irq = 4) is a 16450
tty01 at 0x02f8 (irq = 3) is a 16450
lp_init: lp1 exists (0), using polling driver
Memory: 7332k/8192 available (300k kernel code, 384k reserved, 176k data)
Floppy drive(s): fd0 is 1.44M, fd1 is 1.2M
Loopback device init
Warning WD8013 board not found at i/o = 280
Math coprocessor using irq13 error reporting
Partition check:
  hda: hda1 hda2 hda3
VFS: Mounted root (ext filesystem)
Linux version 0.99.pl9-1 (root@haven) 05/01/93 14:12:20

            

                                - 20 -

     ,  Linux 
.

      ,   p  
root. ,    ,   
    rdev  LILO.   
 .   root  p,
   ,     
  ,   .

       root  p   read-only
(        p).
          
p,    ,  
 read-write  .

        init(8)    (
   /sbin/init)   
. init   ,  
 .

       init   getty(8) 
    .  
      
 ,    . init
        .

            
   .

             3.3      

        Linux   
.    ,     
 .       Linux
 ,       
   .   
 ,   ,   

                                - 21 -

  ,      
       
 ,       
 .

           ,
      
      .  
 ,     
.

      ,   
  -  shutdown(8)  halt(8),  
 /sbin.      .

         ,   
,      , 
  ,      root
(     ,   
         
  ),    halt
 shutdown -h now (    ,
    now   '+'  
,       ) 
 halt.

       ,    , 
  ,   
 shutdown   :

shutdown -h +time message,

     time  ,      
,  message - ,    
. pp,

root# shutdown -h +10 'We will install a new disk.  System should
> be back on-line in three hours.'

                                - 22 -


         ,
  ,      10 .
    ,   ,
 xterm.

Broadcast message from root (ttyp0) Wed Aug 2 01:03:25 1995...

We will install a new disk. System should
be back on-line in three hours.
The system is going DOWN for system halt in 10 minutes !!

          
         
.   halt   ,
      
.

     :  /etc/inittab  , 
  .

          ,
    (  root),
     -, 
   root    .
   ,   ,  
 .      
 .

           
 . ,     
,         
      , 
     .    
  (    ),   
 update  ,    
  ,  update(8)    
,   -     

                                - 23 -

.

          
 sync(8),      , ,
    ,  .  
      ,  
     shutdown. ,
   ,     
,    'clean filesystem'  ext2fs. 
      .

                    3.4   

           
 ,     . 
  -    shutdown 
   -r. ,    
 shutdown -r now.     reboot.

              3.5    

      shutdown     
   ,      
    root,   
  .    
 ,      
   .

               3.6     

            
. ,     LILO 
   .     
  .     
  .

        Linux   
    .   

                                - 24 -

    , ,   
   ,  
 .     ,
,     , 
  ,     .

           
 .   "Bootdisk HOWTO" 
     .

           
 ,     , 
-  .     ,
      . , 
    ,   
  RAM  (  ,    
   ).  
    .
.
                                - 25 -



       4      
                

            
    .   
   ,      ,  
     
.

           . , 
  ,  -    
   ,  p  .  
         .

          
:

       (   
      ).

      ,      
.     -   
    .   - 
     p p, 
    ,   
   .

           
.   Linux    ,    
  .      
.

          
  ,     
( ,  ,   p
).

                                - 26 -


       6   p   
  ,        .

         ,  
       .   
      
  .

                          4.1   

       UNIX,    Linux,   
:      (  )
   (    
 ),     
,   -   . 
      
.        
,     ,  
  .      
    (   
,     ). , 
   ,   :

ttyp5 root ~ $ cat filename > /dev/lp1
ttyp5 root ~ $

     ,     
 ( lpr(1)),    
     , ,
      p 
 .   ,   
.      .
       .

              
(  /dev),      ls(1)
   .    ls -l

                                - 27 -

    ,    
       . , 
 ,   ,
  :

ttyp5 root ~ $ ls -l /dev/cua0
crw-rw-rw-   1 root       uucp        5,   64  Nov  30    1993    /dev/cua0
ttyp5 root ~ $

         , .. 'c',  
,     .   
  '-',   - 'd',  
 - 'b' (. p   ls(1)  
 ).

           
,       . 
 /dev/sda         ,  
    SCSI.   
      (
        
).

                         4.2   

         ,  
  .

             ,
       ,
   .   
 ,    
.        
3600   ,     p 
  .    
 ,       
.


                                - 28 -

       (CPU)    
   .   
    ,      
        
  . , ,   
       
    , 
    ,  
       . (  ,
       ,
   ,       
).      
,   p   
  .

        ,   
    .    
 ,    , ,
  ,   .    
        
  .      
   : " 3,  5,
 7".       
   ,      
     (  
     ,     
  ).     512
.     ,   
 .

          ( ) 
,       
- ,    
    .    
 .      
()    -  . 
,   ,     
  (, ),   , 

                                - 29 -

    .  
  .   
    . , 
     ,  .

       ( ,     
 ),       
.     
,     ,   
 .    CMOS RAM, 
       
     .

      , BIOS  ,   
  ,    1024, 
  CMOS RAM,      
 .      
       
  ,  ,  ,
 . ,    
 8 , 2048   35   .    
  ,    16   1024
  35   ,      
CMOS RAM       
     .  
      , 
       
 .

         IDE .  SCSI
      
 (     , 
  )       .
,       
 .

        Linux     
 ,       

                                - 30 -

     .  
     
 ,    
.     
   ,  
     .

          .  IDE
      .   
/dev/hda  /dev/hdb .  SCSI  
 /dev/sda  /dev/sdb  ..   
    .     
    ,   
(   )     
      ,   
 .     
     MBR (   ).

                         4.3   

          ,    
  ,  ,    
 .      , 
  .      ,
   ,     
       ,  
       .

        ,      
(       
),    ,    .

           .
,   3.5       720  
1.44 .       , 
   ,     
     ,  
        .

                                - 31 -

pp,  /dev/fd0H1440    (fd0)
 3.5     3.5    (H)
 1440  (1440), ..  p  
  3.5 .

            ,
   Linux    ,
      .
      
    p  
,   ,      .
,     .
   /dev/fd0, /dev/fd1  ..

        ,  
   ,      
setfdprm(8).       , ,
     (.. 
     )  
    -    
   .

                       4.4  

      -      
 ,     
 .       
   .    
      . 
,        
.    ,     , 
      .

        MS-DOS,     
   .     
,      .   
 ,    
   ,     -

                                - 32 -

   .     UNIX (
   )      
  , ,  
.

      IDE   SCSI   
   , ,    
,       . 
,      
 , ,   ,    
     
  .

          
,       
.       BIOS
       MS-DOS. 
         Linux.

            
 ,       
.      .  
   ,     
 .       ,
        
,     .

          fdformat(8).
     . ,
      
 3.5        
:

ttyp5 root ~ $ fdformat /dev/fd0H1440
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB.
Formatting ... done
Verifying ... done
ttyp5 root ~ $

                                - 33 -


         
 (, /dev/fd0),    
      setfdprm(8). 
   ,    , 
  :

ttyp5 root ~ $ setfdprm /dev/fd0 1440/1440
ttyp5 root ~ $ fdformat /dev/fd0
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB.
Formatting ... done
Verifying ... done
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB.
Formatting ... done
Verifying ... done
ttyp5 root ~ $

          , 
   .

      fdformat     
.      .  
   (  
/ ,    
),  fdformat   ,  
    .  
    .   syslog, 
    /usr/adm/messages. fdformat  
  (    ,   
        
).

ttyp5 root ~ $ fdformat /dev/fd0H1440
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB.
Formatting ... done
Verifying ... read: Unknown error
ttyp5 root ~ $


                                - 34 -

      badblocks(8)      
     (  ).  
 ,      
   .   
  3.5     
.

ttyp5 root ~ $ badblocks /dev/fd0H1440
718
719
ttyp5 root ~ $

          .  
   ,  
  .     
  ,    
       .
       
mkfs (   ),  
     badblocks,  
 -    fsck.    
.

                       4.5   

             ,
    ,     
 .  , ,   
     .   
        
  .  ,   
      .  
        
 .

          .  
    ,     
.

                                - 35 -


            4.5.1  MBR,     

            
 (..       ). 
  MBR (  Master Boot Record) 
.    BIOS     
. MBR   ,  
 ,    (.. , 
 )      , 
   (MBR   
,        
 ).     
, ,   ,   
 ,    ,  
 .

              BIOS.
  ,    
 .     ,  
 .    ,
          
      .
       
( Linux),      .  
 ,    ,  
        .

           .
   -  ,   
   (    
    fdisk).

               4.5.2     

     ,       PC
    .   
 ,    ,   

                                - 36 -

      (,
Linux, MS-DOS, OS/2, Minix, FreeBSD, NetBSD, Windows/NT  ..),
   - ,    
 . ,   Linux swap- 
     (    
Linux)     (. ).

           ,
  .    
  .  ,   ,
  ,   
 .    ,   
,      .

       pp p    p.  
    ,      
.     .  , 
,        .

  "
   MBR                                  
  No
                       
  --------------------------------------  
                                        
                       
                                        
  No
                                  
             
          
  --------------------------------------           
                                             
                               
                                                    
  
                       
  -------------------------------------- 

                                - 37 -

                                                   
                         
                                                   
  No
                                        
      
                                        
  No
                       
  --------------------------------------  
                                        
                       
                                        
  


                        4.5.3     

       (   MBR,  
  )      ,
   .   
 ,       
       
 . ,  ,  
   . ,  Linux  
    .  , 
    (  , 
 DR-DOS      ,  
 ).

        ,   
,       
.      Linux fdisk.

0            40 Venix 80286          94 Amoeba BBT
1 DOS 12- FAT      51 Novell               a5 BSD/386
2 XENIX root             52 Microport            b7 BSDI fs
3 XENIX usr              63 GNU HURD             b8 BSDI swap-

                                - 38 -

4 DOS 16- (<32)     64 Novell               c7 Syrinx
5             75 PC/IX                db CP/M
6 DOS 16- (>=32)    80 Old MINIX            e1 DOS
7 OS/2 HPFS              81 Linux/MINIX          e3 DOS r/o
8 AIX                    82 Linux swap-   f2 DOS 
9 AIX         83 Linux                ff BBT
a OS/2        93 Amoeba

                4.5.4     

       ,    
.      
      
.      fdisk (  
 Linux).       
.  cfdisk  fdisk,   
  .

      p  IDE ,   (, 
  ,      )
      1024 ,
          BIOS
(     ),  BIOS  
  ,   ,  1024. 
    , 
     1024 . 
    ,   ,  
BIOS,    1024 .    
 ,  p    .
 ,     
      . 
   ,     
  1024 .

        BIOS    IDE 
   p  ,  
 1024.


                                - 39 -

           ,
    Linux     1 , ..
 .      , 
    .      , 
p  fdisk   pp.

           
     , 
,   ,     
   .     MS-DOS
  fips,      
 ,       p
 p.

                  4.5.5     

          
  p.     
,         
 . 1-4    (  
,    p),  5-8 - 
(   ,     
). , /dev/hda1   
  IDE  ,  /dev/sdb7 - 
   SCSI .


                     4.6    

              4.6.1     ?

       -     , 
       
  .     ,  
  ,       
.

            

                                - 40 -

    .  
(,    )   
       .  
    ,    
.     
  , , ,   
,         
(      ).

      ,        
  ,    , 
     .   
  .

          UNIX  ,  
    .  
: ,   (inode),  ,
    .    
    , ,   ( 
    ).   
    ,   .  
   ,    . 
       
 .     
  ,     
.  inode       
, ,    ,  
      .  
 .  ,    , 
      .

        UNIX    
   (      lseek(2), .
).  ,    
   ,   -    
 ,       
 ( ,      
  ).      

                                - 41 -

 ,  Linux,      
  . (   
        
 .    ,   
      , ,  
  .)

        .   
    200 ,  
,       4 . , 
   ,   
       . 
     B.

                      4.6.2     

     Linux     . 
    .

minix            ,
      ( 
   ,   
 30- )    ( 64  
  ).

xia          minix,   
       ,  
 p   .

ext2          
     Linux.   
   .    
   ,    
       .

ext          ext2,    
.         
  , ..   

                                - 42 -

  ext2.

         ,  Linux  
        
  .    
,    ,  ,   
       
,     UNIX.

msdos         MS-DOS ( 
OS/2  Windows NT).

umsdos         MS-DOS
 Linux  ,     Linux, 
      , 
   , ,  , 
 ,      . 
    MS-DOS, ,   
   Linux.  ,  
    Linux.

iso9660       CD-ROM. 
   CD-ROM,  Rock Ridge',
     
 .

nfs         ,  
      
       .

hpfs        OS/2.

sysv        System V/386, Coherent  Xenix.


         proc,  
   /proc.  ,   
 ,       .

                                - 43 -

       
 ,  ,    ( ). 
        
      .
,     , 
 :

ttyp5 root ~ $ ls -l /proc
total 0
dr-xr-xr-x   4 root     root            0 Jan 31 20:37 1
dr-xr-xr-x   4 liw      users           0 Jan 31 20:37 63
dr-xr-xr-x   4 liw      users           0 Jan 31 20:37 94
dr-xr-xr-x   4 liw      users           0 Jan 31 20:37 95
dr-xr-xr-x   4 root     users           0 Jan 31 20:37 98
dr-xr-xr-x   4 liw      users           0 Jan 31 20:37 99
-r--r--r--   1 root     root            0 Jan 31 20:37 devices
-r--r--r--   1 root     root            0 Jan 31 20:37 dma
-r--r--r--   1 root     root            0 Jan 31 20:37 filesystems
-r--r--r--   1 root     root            0 Jan 31 20:37 interrupts
-r--------   1 root     root      8654848 Jan 31 20:37 kcore
-r--r--r--   1 root     root            0 Jan 31 11:50 kmsg
-r--r--r--   1 root     root            0 Jan 31 20:37 ksyms
-r--r--r--   1 root     root            0 Jan 31 11:51 loadavg
-r--r--r--   1 root     root            0 Jan 31 20:37 meminfo
-r--r--r--   1 root     root            0 Jan 31 20:37 modules
dr-xr-xr-x   2 root     root            0 Jan 31 20:37 net
dr-xr-xr-x   4 root     root            0 Jan 31 20:37 self
-r--r--r--   1 root     root            0 Jan 31 20:37 stat
-r--r--r--   1 root     root            0 Jan 31 20:37 uptime
-r--r--r--   1 root     root            0 Jan 31 20:37 version
ttyp5 root ~ $

( ,     , 
 , ,    .)

       /proc   ,     
  .     
      -  , 

                                - 44 -

,    - ,  
   .     /proc/kmem
  ,      .

             4.6.3     ?

         p   
.       
ext2fs , ,   .   
  (, , ,
  .)  ,   
     .

                  4.6.4    

       , .. , 
  mkfs(8).  ,  
     .  mkfs 
      
 .     
  -t fstype.

     ,  ,  mkfs, 
.       ( 
  . ).

-t fstype        .

-c                , ,
   .

-l filename         
filename.

         ext2  , 
  :

ttyp5 root ~ $ fdformat -n /dev/fd0H1440

                                - 45 -

Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB.
Formatting ... done
ttyp5 root ~ $ badblocks /dev/fd0H1440 1440 > bad-blocks
ttyp5 root ~ $ mkfs -t ext2 -l bad-blocks /dev/fd0H1440
mke2fs 0.5a, 5-Apr-94 for EXT2 FS 0.5, 94/03/10
360 inodes, 1440 blocks
72 blocks (5.00%) reserved for the super user
First data block=1
Block size=1024 (log=0)
Fragment size=1024 (log=0)
1 block group
8192 blocks per group, 8192 fragments per group

360 inodes per group
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
ttyp5 root ~ $

          ( -n
     ). 
       badblocks,
     bad-blocks. , ,
      
 .

       badblocks,  mkfs  
  -c,     ,  .

ttyp5 root ~ $ mkfs -t ext2 -c /dev/fd0H1440
mke2fs 0.5a, 5-Apr-94 for EXT2 FS 0.5, 94/03/10
360 inodes, 1440 blocks
72 blocks (5.00%) reserved for the super user
First data block=1
Block size=1024 (log=0)
Fragment size=1024 (log=0)
1 block group
8192 blocks per group, 8192 fragments per group
360 inodes per group

                                - 46 -


Checking for bad blocks (read-only test): done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
ttyp5 root ~ $

       -c  ,   
badblocks,       
   .

             
   ,  .

                 4.6.5      

         ,   
.      
,    . 
     UNIX   
,       
,     .

         .   
 (2-  3-)     /home
 /usr  ,       
   (4).

1]                  2]                   3]

/  bin      /  abc      /  bin
                                           
     dev           liw           etc
                                           
     home          ftp           lib
    
     etc
    
     lib

                                - 47 -

    
     usr

4]
/  usr
       
        lib
       
        etc
       
        bin
    
     lib
    
     etc
    
     home
       
        ftp
       
        liw
       
        abc
    
     bin
    
     dev


      ,  , ,   .

ttyp5 root ~ $ mount /dev/hda2 /home
ttyp5 root ~ $ mount /dev/hda3 /usr
ttyp5 root ~ $

      mount(8)   .    -
 ,    ,  
  .    

                                - 48 -

,     .  
       
/home  /usr .   ,  
/dev/hda2    /home,  /dev/hda3 -  
/usr.     , /dev/hda2, 
 , /home.    
 '' ,   ,    -
 .     .

           , 
  .   ,   ,
     . (
    ,  ,  
   ,     
.)  ,       
  . ,    /tmp
    /usr/tmp.   ,
   /usr  ,   
 root.  ,  /usr ,  /usr/tmp,
    root,  .
  /usr/tmp     root,  
 /usr   p    
.

          ,  mount
   -r,     
 read-only.       ,
       
.       
   ,  CD-ROM.

      :      
  (..  root),   ,   
    - .  root
   ,  ,   
 (     ,    
 ).   ,  
 root,    ,   

                                - 49 -

 LILO  rdev.

        root    read-only.
   fsck(8)     
   ,      
read-write. fsck      
,   ,    , 
  p .    root 
   read-only,      
      .

            ,
      .  
   /etc/fstab (.   fstab(5)).

            ,  
  .     umount(8)
  .      ,   
. ,   ,
   ,  
:

ttyp5 root ~ $ umount /dev/hda2
ttyp5 root ~ $ umount /usr
ttyp5 root ~ $

             
,        ,
     ,     .

          
     root. , 
        
    :

         root.   , 
   .     
,     (   

                                - 50 -

- ).

      -  (, sudo(8)),
    mount.    
    ,    
 p  root  .

       mtools,     
  MS-DOS    .
    ,    
    MS-DOS.

        ,    
 ,       
   /etc/fstab.

             
/etc/fstab  :

/dev/fd0 /floppy msdos user,noauto

        ,  , 
  ,     .
 noauto     
 .  user   
    ,   
,       
,    .  ,
     :

ttyp5 root ~ $ mount /floppy
ttyp5 root ~ $

          umount 
 .

           4.6.6      


                                - 51 -

          , 
   .    
     fsck(8).
   p    
,      
(,   ).

         , 
 fsck     ,
     (, ,
)  ,    .  
        
   . ,  
    ,     
 ,       , 
    , p 
     .   
  ,     /etc/fastboot,  
  .     ,  
  ext2   ,  
,     pp
  p   . 
    e2fsck (  fsck
   ext2fs)    
 ,      ( 
  pp ).  ,
  /etc/fastboot,   , 
  ,       e2fsck
    (.   e2fsck(8)  
 ).

          
,    .   
  fsck   .

      fsck  ,  
,       
     .   

                                - 52 -

 .       
   ,    Linux.
  p  debugfs(8),  Theodore
T.

      fsck     
 (   root,   
read-only   ),      
        - 
       ,
, ,     .

            
 badblocks.      
  .     
 fsck      
       
.       .

ttyp5 root ~ $ badblocks /dev/fd0H1440 1440 > bad-blocks
ttyp5 root ~ $ fsck -t ext2 -l bad-blocks /dev/fd0H1440
Parallelizing fsck version 0.5a (5-Apr-94)
e2fsck 0.5a, 5-Apr-94 for EXT2 FS 0.5, 94/03/10
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Check reference counts.
Pass 5: Checking group summary information.

/dev/fd0H1440: ***** FILE SYSTEM WAS MODIFIED *****
/dev/fd0H1440: 11/360 files, 63/1440 blocks
ttyp5 root ~ $

                     4.7     

             .
,  swap-    . 
      ,

                                - 53 -

 tar-     
     - 
.       
  (    
      ) 
   . ,   tar
    ,     
    .  
  Linux      .

             (
  )   . , 
     ,  
      ,  
- .      dd(1).

ttyp5 root /usr/tmp $ dd if=/dev/fd0H1440 of=floppy-image
2880+0 records in
2880+0 records out
ttyp5 root /usr/tmp $ dd if=floppy-image of=/dev/fd0H1440
2880+0 records in
2880+0 records out
ttyp5 root /usr/tmp $

       dd      
floppy-image,       
(,      
  ).

             4.8    

                 4.8.1     

            
,        .

            
 root,    /bin, /etc, /dev, /lib,

                                - 54 -

/tmp   ,     
 .  , ,     
-    root.    /usr, 
  (  /home)   swap-
     .  
      ,
       
(   /usr).    
/usr      (  NFS)
     .

            
 .       
   .    
 , , ,   
   root ( /usr)   , 
   -  .

                4.8.2     

       Linux    
     
.     
  .     
.

      ,    ,
   .  ,   
      , 
       .
      
  ,     ,  
  ,   
.

      swap-    6.5.



                                - 55 -

              4.8.3      

            109
.       330 . 
       .

       (109 )    . 
    MS-DOS  Linux.  , 
DOS    20 , 10-   
  swap-   79    
 ,    ,   
Linux.

        330     :

5          root
10       swap-
180        /usr
120        /home
15        

        4.8.4      

          Linux 
,       .
  ,   , 
      ( 
 ).     
  /etc/fstab,    
   .

               4.8.5     

          -  
  .   
 ,      X11 
   C++.


                                - 56 -

           
.  ,   gzip(1)  zip(1),
     . 
gzexe       . 
  DouBle   
    .
.
                                - 57 -



                  5    

           
   Linux,    FSSTND.
       
        .

                          5.1  

            Linux FSSTND
 1.2,     
     Linux.   
      
  Linux,    Linux . 
 FSSTND      
  Unix,   Linux   
 Unix .

          ,  FSSTND.
       
  .

            
,     -     
  .

          
   ,     
     .   
   ,    
   .  
   root, /usr, /var  /home. 
      ,  
     -
 (, CD-ROM)     NFS.


                                - 58 -

          
.

       root (    
,    p    p 
) p  ,   p  
 ,      p  p
 .   p p  
p     p  pp .

        /usr   , pp,
, p p  p , p 
p p .     
         
     p  p .  
pp    ,     
p     pp  p
p p p pp .   /usr
p   ,     p 
p read-only     p.

       /var p p ,  
p p ,   p  ( ,
  ..), p , pp p
p,   p .   p  /var
   /usr,     
p /usr  p read-only.

        /home   
.  /home     
 p pp p p. p 
 p    p   
  (pp, /home/students  /home/staff).

       p    
,       
p    .   
   ,   

                                - 59 -

p p. pp     p 
p,      pp  
pp  p .    p
   .

        UNIX   pp  
 (     ,   - 
p,  -  p  ..). p 
 p        pp
 ,    ,   pp Emacs
   ,   TeX -  p  ..
  p  pp  (, 
p  pp,  p   ,
 ,   p p),     
 (pp,  p  pp).

                      5.2    root

       root    pp,  
 p    .    
   p   ,   p
 p.   root p,   
,   p p  (p
 , pp p  ).

     p    p - ,  
     p (  
/vmlinuz), p   p p .  
 p   :

/bin            , p p p  
  .

/sbin            ,   /bin,    
 p     p.

/etc             p .


                                - 60 -

/root              root.

/lib            ,  pp 
  root.

/lib/modules    p   p.

/dev             p.

/tmp            p .

/boot           ,   p
(.. LILO).  , p   p
p   ,  p.   
 ,  p  p   
 p . p p   , 
 p   p  p p 1024 p
 IDE .

/mnt             p  p  .
    p   
(pp,  /mnt/dosa     
  p   MS-DOS,  /mnt/exta - 
   ext2fs).

/proc, /usr,     p p  .
/var, /home

                     5.2.1    /etc

        p   p
p . p   pp . 
 p ,   pp .
 p      " 
pp  Linux".

/etc/rc  /etc/rc.d  /etc/rc?.d       ,
 p    p   p p.

                                - 61 -

. p   init   p p.

/etc/passwd         ,  p p
p   ,   , 
, p p  p . p  
pp  p   passwd(5).

/etc/fdprm         pp , p
p .  pp setfdprm(1).

/etc/fstab          , 
p  p    mount -a (
    /etc/rc   ). 
 Linux   p p  swap-,
   swapon -a (. p
  mount(8)   p p).

/etc/group          /etc/passwd,  
p p  p,     (. 
p  group(8)).

/etc/inittab      p  init(8).

/etc/issue         pp getty p p
login.   p p  .

/etc/magic        p   file(1).
p  p p , p  p
  p  .  . p  magic(8)
 file(1).

/etc/motd          ,   p
   .   
pp     p .

/etc/mtab          p   
 .     p
,    p  mount.

                                - 62 -

 p     p
  (pp,  df(1)).

/etc/shadow          . 
    p. p  p  
/etc/passwd p  /etc/shadow, p   
 , p  root.    .

/etc/login.defs   p   login(1).

/etc/printcap      ,   /etc/termcap,  
p p  pp. p   p.

/etc/profile, /etc/csh.login, /etc/csh.cshrc
     Bourne  C shell p
 ,      
 .   p p . p
 .

/etc/securetty    p p,  p 
    root.   
p ,     p  
.

/etc/shells        p .  chsh(1)
  p      
. p ftpd, p p  FTP, pp
     /etc/shells   
  ,         .

/etc/termcap         p. 
 escape-  p 
p,   p pp  p 
p.   p p . p
termcap(5), curs_termcap(3)  terminfo(5).

                       5.2.2   /dev


                                - 63 -

          p.  
   , pp 
p .  p   p 
,      /dev/MAKEDEV. 
/dev/MAKEDEV.local  p   
p   (.. ,    p
MAKEDEV).


                   5.3    /usr

        /usr    ,
   pp   .  p 
 /usr    p  . 
  pp  p  p 
 /usr/local. p   /usr
pp  (  p p . 
p FSSTND).

/usr/X11R6      ,   X Windows. 
p   pp,   X Windows
p   pp , p  
/usr/X11R6   pp /usr.

/usr/X386       ,   /usr/X11R6,   p X11
 5.

/usr/bin       p  ,  p 
 /bin  
/usr/local/bin.

/usr/sbin      ,  p pp 
  p  p    root
(pp,    pp-pp).

/usr/man, /usr/info, /usr/doc       p, 
GNU Info  p .

/usr/include        .

                                - 64 -


/usr/lib           pp  ,
 p p .

/usr/local      p    pp 
p .

                    5.4    /var

        p ,  p p
p .     p  
  p     .

/var/catman  p   pp p p.
  p   /usr/man/man*.
p p   pp . 
p   /usr/man/cat*.  p p
pp   pp.    
 /var/man  p p pp  pp 
.

/var/lib     ,  p p p
.

/var/local      pp,  
/usr/local.

/var/lock    -.  pp p p 
-  p   -. p
pp p p  - p  pp
 -   ,    p
   p.

/var/log     p  p pp,   login
(/var/log/wtmp,       
)  syslog (/var/log/messages,   p 
 p   pp).


                                - 65 -

/var/run     , p  p 
   p pp .
pp,  /var/run/utmp p p  ,
     .

/var/spool   ,   p , ,
p  pp,    p .   
    /var/spool, pp, 
  p  /var/spool/mail.

/var/tmp       p , pp p
   p  p ,  
/tmp.

                   5.5    /proc

       /proc  p  
     . p   
 p.  /proc p p 
 (   p -   ).
p      pp . 
p p  pp  p  
/proc    p  proc(5).

/proc/1              , p p  p
p 1.   p    
/proc,  p    p.

/proc/cpuinfo        p  pp,   
pp,  , p  p.

/proc/devices         pp p, p 
 p.

/proc/dma                 DMA.

/proc/filesystems     , p  p.


                                - 66 -

/proc/interrupts         pp.

/proc/ioports            p
/.

/proc/kcore          p    
 . p     ,    
p,        , 
pp   p    pp.  p
p   -,      .

/proc/kmsg           ,  p.  
pp  syslog.

/proc/ksyms           .

/proc/loadavg        pp p .

/proc/meminfo        p   , 
   swap-.

/proc/modules          p, p  
.

/proc/net            p   p.

/proc/self               p,
  p  /proc. p  
p p  - p  /proc, 
   p .   
pp    p.

/proc/stat             p  p
.

/proc/uptime         p,   p  
 p .


                                - 67 -

/proc/version        p p.

           p, p
   .   pp, p 
 pp    p,   , 
 p p . pp, pp free
  /proc/meminfo  pp ,  
,   (  p p
 p).
.
                                - 68 -



                       6   p 

        pp  p 
 Linux,   p    p. 
   p,   ,  
p    pp.

                   6.1    p ?

      Linux p  p ,
      pp p
    . p    p
   . p 
     p . p p 
, p   ,   p. 
   pp  , 
pp,   Linux,  p  pp
    ,  p   p 
p p  .  p   
 (pp  p p),   p ,
 pp    p.   ,
   p ,  swap
.

     Linux    swap    ,
   p .   p
p,   pp swap   p, 
p (   p    
   pp ).  p pp swap 
,    p ,     
p,     swap , p
p ,    swap p p
.

     Linux   p  
swap p / swap . p  p

                                - 69 -

 p  swap ,  
 swap ,    
.

                     6.2   swap 

     Swap         
p.    ,     p p 
      mkswap(8). 
 p        p 
 , p p NFS.

      p  swap   .   
ppp  pp  p,  p 
p p      p  ..
p p   pp    p.
 p   ,     
pp p,   p  .

       pp ,   swap , 
p p.

ttyp5 root ~ $ dd if=/dev/zero of=/extra-swap bs=1024 count=1024
1024+0 records in
1024+0 records out
ttyp5 root ~ $

      /extra-swap   swap ,   pp  
pp count=.     
 p p,   p p  p 
4   .  pp swap   p p, 
     .

     Swap p      p p. 
      p p,  
   ,    p - 
.    swap p p 82 (Linux
swap),    p ,    

                                - 70 -

  p.

       swap   p    
 p  p, p  p.
  p  mkswap(8).

ttyp5 root ~ $ mkswap /extra-swap 1024
Setting up swapspace, size = 1044480 bytes
ttyp5 root ~ $

      ,  swap    . 
,  p     p  p
.

     p  Linux p pp  swap 
127.5 .    swap  
pp,     p 127.5 . 
   16 swap      2 .

               6.3   swap pp

     p swap     
   swapon(8).   p p
p, p  ,  swap  . 
 pp    swap ,  
 p swap    
:

ttyp5 root ~ $ swapon /usr/tmp/temporary-swap-file
ttyp5 root ~ $

     Swap     
    /etc/fstab.

/dev/hda8 swap swap defaults

      p p   , 
 swap -a, p   swap ,  

                                - 71 -

 /etc/fstab.   swapon   
  swap .

       p   swap 
p  free(1), p   
 swap pp.  p 
p  top(1)    proc, 
/proc/meminfo.     p 
  swap .

     Swap       
swapoff(8).     ,  
p swap .   p,   
,  p  ;     
 ,     - p swap
.   p     p 
p,  p  .    free
 pp    p  swap
.

      swap ,    
 swapon -a,     swapoff -a. 
p     /etc/fstab. 
swap ,  p,  .

          swap  
       . ,
pp,  p    p p swap
,    p,   
, p  p   . ,
  swap ,  p p    
p,    p,    
    p.

       6.4   swap   p p
            

     p     p

                                - 72 -

.    p  ,   
p (       
 p),   swap , p  
 , p   pp. 
  p  swap  
 p .   ,  
p  . p p HOWTO p
 p   p.

                  6.5   swap pp

      ,  p p swap :

1.    p  .   
, p  p    p, 
 p p    pp, p 
 p . pp,    X,
  p  8  swap ; gcc  
  (p  p   ,
    ,   
p )  .. p     
      p  
 p    ( , 
 ).      ,
  p .    p
p  ,   
 p . (,   
  pp      p,   p
   ,    pp 
pp   p.)  free(8)  ps(1)
 p   p  .

2.    , p  p
 ( pp pp   ,  
    p  pp), 
p    pp.  
   p . ( p  ,
     swap ,    

                                - 73 -

p  p    swap ,  
 pp p  p   
 p. .    swap .)
    p   p 
 .

3. p  , p  p , 
,   p .  p swap
   pp    
 p .  p   p
pp swap . ( p p UNIX  p
p   ,  ,  
p ,     p 
.)

4.    swap   ,  
  (  p), , p , 
  pp,  p  
.

                         6.6   p

         ,  p   
.           
  p   p p
p. pp,  p   p
,  p   pp p  ,
 , pp p   p   p
p p  .  p  p
     p     p,  
  p,   p , p
p .    p,  
,    , -  p.

        ,  , p,  
p       pp.  p
p,    p  
  p p.

                                - 74 -


      p  p   .  
p,    p  
(pp,   pp   ,   
p).  p p,     
p      ,    p 
  pp,  p    . 
   p   p,  
 p pp.

       p    p
(     p),      p
   p. p     p
, ..     p (, ,
 p  p). p   p , ..
    p . p  p
  ,   p,     
: p  p   , ,
p  p,   p.   p 
p  .     
p  pp   pp
p p.  sync(8)  p p 
  ,  p,    p 
.  p UNIX   pp,
   p, p   sync
 30 ,     p 
.   Linux  
pp-, p   sync   
      p  
 p    ,     
p  sync.

      , p p  ,  , p
    p   (
 Linux    p 1 KB).   p 
p p  , p , p p
 ,   ,   ,  
 .

                                - 75 -


      p   p 
p.  p p   p:  p
  p,   p p   
 p. p pp p  
   ,     p
   p.

       p p ,   
 ,     p  
       
  swap  (   p ). 
    , Linux
       p 
 ,   p pp.

      Linux  p  -  
 p  p.  p
pp     , 
       
 p p  .
.
                                - 76 -



               7      

       p  , p p p
      .  p pp
p p p, p   p,
p , p   ..

             7.1     p p

     p  p p  p p p init
pp  pp getty    (
). Getty p p,  p  p,
       ( 
,   - p  p).
-  p, getty   p p
(   /etc/issue)  p  ,
p p pp login   pp. Login
p p     .  
 p p,  login  ,
pp   ,  p
p p. init   p   p
 getty   p.

      p,  init    p
(   fork(2)),  getty  login 
 pp   p (  
exec(3)).

          pp
  .  getty p  p
  p  ,    
dial-in ,   pp   p 
.

       p pp getty  init  p
    .   p 

                                - 77 -

pp   ,   p  p (
    Linux Software Map).

              7.2     p 

      p, p   ,  
  . p  p , pp,
   p,   ,
 p   p .  
pp   p   ,  
p   pp.     
 ,      
p     . 
p,  pp    
 p     
.      
 p, p  p 
    ,  p p
pp ,  p     .

     p   p   
  pp,   p p. 
      p,
p  ,   p p,  
    p .
       pp getty  
   p.

       p,   
.   p    
(..   p   p
p),     p, p 
,  p p   p
.

      ,   p  
 .      telnet 
rlogin.     ,  

                                - 78 -

p  p  (pp,  FTP,
Gopher, HTTP  p  ).   
  p   p
 .     p,
p     
pp   .  p 
inetd (  p p .  
pp  Linux).

                  7.3    pp login

     pp login p  
(pp  p   ) 
      p
      pp .

           p
p  /etc/motd (p  Message Of The Day -
 )  pp p .   p,
  .hushlogin   .

        /etc/nologin,  p 
  .     
pp  shutdown(8)   . pp login
pp   ,   ,  
pp.    ,  p   p
  p.

     Login       
  p  (  p syslog). 
  p     
root.

      ,      ,
   /var/run/utmp.  p p 
   p (  ) p
 ,   p  p. pp who,
w         

                                - 79 -

,   .

            
/var/log/wtmp.     p  p, 
  p , pp,  
p cron     ,  
.  last   wtmp.

        (utmp  wtmp) p   p (.
p  utmp(5))     pp  
pp p.

                             7.4  X    xdm

     :  X p    p
xdm,     xterm -ls.

                         7.5  p 

         p  
/etc/passwd.  p p   
p,   p p   /etc/shadow.   
  p  pp 
 NIS  - p  p  
.     
p     p p  
.

         p   p,  
p  p  ,   
p , p     p
.   p   , , 
    p.  p p 
p .   -   
p p,     p  
  p pp   
p     .  
p      

                                - 80 -

 p p  p ,   
  root (p  p  p
).

       p,   p   pp,
..  p. pp crack   
  p   p, p  ,
p   .  pp  
   ,    pp  
  pp p. p  
   pp passwd(1).

       p  p   /etc/group.
 p    p  p  
/etc/shadow.group.

      root       
 p,   ,   p
p,    /etc/securetty.  
      p.
        p
p  p ,    su 
 p root.

                       7.6   

     p      
 p  .  
 p .  p p . p
  .

           ,
pp,  Bourne (/bin/sh)     
/etc/profile,        ~/.profile. 
 /etc/profile  pp  
    ,  , p
 PATH  p.   p   ~/.profile 
      p

                                - 81 -

.
.
                                - 82 -



                            p A

            p  p   EXT2

      p  Remy Card (card@masi.ibp.fr),
Theodore Ts'o (tytso@mit.edu),  Stephen Tweedie
(sct@dcs.ed.ac.uk), p  pp 
 ext2. p  p   p 
p  p   Linux, ISBN 90
367 0385 9.

                              

     Linux  Unix- p , p
  p PC-386. p   p
 pp  p  Minix   p p
 p    Minix.   
   p p: p 
 16 ,  p   
  64 ,    p   p
pp      p 14 .

      pp  p    , p
  p p Linux.   , "Extended
File System" (Ext fs)  "Second Extended File System" (Ext2fs),
   p  p 
.

       p   p   Linux. 
p p   p  
Unix.  p p  p  
(VFS)  Linux,   pp  p  
Ext2fs  p p  .    p
p pp   Linux  BSD.

                A.1  p p   Linux

                                - 83 -


     p p Linux  pp   p
 Minix.   p p   
,  pp   ,  Linus
Torvalds p  p  Linux   Minix. 
 p      
pp p     .

      p,   pp  
Minix,   ,    
pp     Linux.

      p p     p Linux,
 pp p   (VFS). p
VFS   Chris Provenzano,   p Linus
Torvalds p  p  p.   pp 
p A.3.

        p VFS,  p 1992  
pp    EXTfs (Extended File System) 
  p Linux 0.96c.     
   p  Minix:  
   2 ,      -
255 .     p  
 Minix,  p p   p. 
 p p ,  
pp    p  . 
      pp
    pp,   
 p :  p  
p  ppp,  p 
pp  .

       p    p 1993 
-p    : Xia  EXT2fs (Second
Extended File System).   ,   Xia 
  Minix c    . 
    p    ,

                                - 84 -

p  p    p p 
p  .  p p, EXT2fs   
EXTfs     .   
   p.   p
pp  p A.4.

           , 
  p p.  Xia   , 
EXT2fs,    .  p   p
p  p    EXT2fs,  
     .  
p   EXT2fs     
p -   Linux.

        p  p 
 , p p 
.

------------------------------------------------------------------------------
                        Minix FS        Ext FS         Ext2 FS        Xia FS
------------------------------------------------------------------------------
        64             2            4           2 
 

        64             2            2          64 


       16/30 .      255 .      255 .   248 .
 

p p                                             
p 


 pp                                         

 pp                                              


                                - 85 -


 p                                                ?

               A.2      

        Linux    
 ,   p  Unix: 
p  pp (inode),  
p , p  ,    p
   p p p  p.

                     A.2.1   pp

       p pp,  
pp.  pp p  , p
    , p , , 
p  , pp,    . p
 , ppp  , p  
 pp. p p  p
/  , p pp    p
,   p     
p ,   p p p
/.

                           A.2.2  

        pp p. 
  p   .

      -    .  ,
  , p  .  
p p  pp   . 
- p    , p   
 p  pp.  ,  
  pp  p  pp, 
pp        
p.


                                - 86 -

                            A.2.3  

        Unix    
.   pp     
 . pp p , p , 
p p .    
  ,  p  pp
  p pp,     
pp. p   p    
 pp,     p .

           
 p    (   
  p  ).  ,  
     (    
p     ).

       Unix      . 
, p   ,  .
p p p  ,  p pp  
   pp, p    
p pp (..    )  
ppp   .     
   pp,     
, p  p  .   
    ,   .
  p ,      
p, p    .   
p   ,  p  pp 
 .    p  p
p p pp      pp,
   ,  p p   p
  ppp   .

                         A.2.4   

      Unix-     
   .    

                                - 87 -

   .      
 .

         :   .
   ,   
      ,    
       
   .   /  
,     
 .    
 ,    ,   ,
   .

                    A.3     (VFS)

                             A.3.1   

       Linux  ,  
  ,     
.        
     
  /.

            
Unix-      
    .

      -    ,  
  ,   ,  
VFS.    ,    
 ,       
,   ,    .
,     ,  
     /.

                           A.3.2    VFS

     VFS   ,    

                                - 88 -

 .      , 
   :  , 
   .

     VFS       
.   ,    
 .       
 :       
  ,     
 .     
  .    
 ,     
    VFS.  ,  
,  VFS      
   .

           
 : ,    
  ,   ,  
       ,
  .   ,  
  ,  VFS   
   .

      VFS     :  inode 
  .     ,
      , 
  .      inode 
  ,      
(, create  unlink),    
  ,     
(, read  write).

           A.4    EXT2 (The Second Extended File System)

                        A.4.1    

       EXT2  pp   p

                                - 89 -

, p  p  EXT (Extended File
System). p     pp  
, p  pp  Unix 
p  .

     p,    EXT2  
p.  p,    
p ,   p p  p 
 .   , EXT2  
 pp  pp  .

                  A.4.2  p  EXT2fs

      EXT2fs p p   Unix:
 , ,  p   .

     EXT2fs  p  ,  
   p.   p  p 
p      2 ,  
 VFS   p  4 .  p, p
  p    
    p.

     EXT2fs p    . 
 p    . 
pp   p 255 . p  
p     1012.

     EXT2fs ppp p   
 root.   5 %   , 
  pp   
  p   p p p
.

                A.4.3    EXT2fs

        p  Unix, EXT2fs
p p  ,  

                                - 90 -

p   Unix.

      p   p p p p
 p .   p    .
 p , ,    , 
 p.

      p p    
p ,    p. 
mount  pp p  
.      BSD,   
  p p,    p .
 System V  .     setgid
,     p p
 ,    p p  
setgid.  p ,      
p p  p.

       EXT2fs   p 
,   BSD.  mount  pp
    ( pp,  ,
    )    p
p  .      
   p,   p  
p.  ,    
,   p  p, 
 p  p  , p 
 p pp  .

     EXT2fs  p    p pp
 .    pp 1024, 2048  4096
.     p  p
p / (    p 
), , ,   p .  p
p,     p  p
 pp.     
   p p,    
,   p  pp.

                                - 91 -


     EXT2fs   p 
. p p  ,    
 .    p    ,
    pp.  pp 
p  pp  p p 
. , pp, ppp  pp,
p,       p 
p.      p 
p 60 .    p pp 
    .

     EXT2fs     . p 
   p    
.    p  p read/write,
     'Not Clean'.   
p  p   p read-only,  
   'Clean'.  p p  
pp   ,  p 
 p  pp  . p
     p . p p p
,     'Erroneous'.
pp pp   p  p 
pp ,      
 'Clean'.

      pp p   
 p  p p,  EXT2fs  
    pp pp .  p
p  p .  
  p,   p  p
read/write.      ( 
p  p),  pp p  
  pp,      'Clean'.
 p pp   p  pp
 p  p.    
p  pp,    
pp    pp.

                                - 92 -


      EXT2fs p p   p. pp
tune2fs    :

 p p . p p p
,     'Erroneous' 
     p  : p
, p     p
read-only    p, pp  
pp  .

  p.

 p  pp.

  , ppp   root.

     ,  p p,  
    p p 
p.

      p   
p . p   ,  , p
p   p  , 
 p.  pp   
p p   p, p 
 pp.

       EXT2fs      ,
    4.4 BSD.  p  
   :    p  
 .      
p . p  ,  , p
  p  p ,     
    .      
   p.    
 p , p    
.

                                - 93 -


                       A.4.4   pp

       pp  EXT2fs  
p   BSD.   p  p
. p     p p BSD
FFS. , p      p
  ,   p p p 
   p  p  
 pp.

      p  p   
p p   (p  pp
 ),   p    (p
, p  pp,   pp 
 ).

     p p     
 ,   p pp p 
 p ,  p   p
p   p.  pp  
  p,    p
   pp   , 
p p   p p
/.

       EXT2fs  p    
 p .   p p 
pp,  ,     . p
  p   p   
      pp.

                   A.4.5    p

      EXT2fs p  , p 
p,     p 
p p    .


                                - 94 -

     EXT2fs    p.   
 , p  p p /  
p p .  p, p 
p,   , p   ,
 p   p.  p 
p p   .

      EXT2fs  p   
p p. p    
  pp   . p
  p      
p,      pp.  p 
 p  p p  pp
    .

     p    , EXT2fs p p  8
  p p  .   
  p p  p
.    p    ,
 p   .

                         A.5   EXT2fs

      p  pp EXT2fs  pp
p pp   ,  pp
 libext2fs.    p ,
p    p   
  EXT2  p   
p.

       EXT2fs (mke2fs, e2fsck, tune2fs, dumpe2fs,
debugfs,  p.)   .   p
  ,      
     EXT2fs  
p    EXT2fs.

       p  EXT2fs  p 
p,         pp,

                                - 95 -

 p p p p    .
pp,  EXT2fs   p p 
4.4 BSD   p . p 
      p  Linux (p
  ,    ,
    EXT2fs).

      EXT2fs p   p 
. p  -  p,   
.  pp  p  p 
,     ,   
  .    pp 
   .

     p  p p  . pp,
  EXT2fs,    pp
,        .
   p   pp 
 ,   p      pp.

       p pp   p.
    pp,  
 pp, pp    pp.
 p  p    
pp.

                    A.6  p  EXT2fs

       EXT2fs  pp  p
p.  p   ,  
pp      EXT2fs.
pp mke2fs     p,
p    EXT2fs.

     pp tune2fs     p
pp  .   pp  p A.4.3,
      p   ,
  p , 

                                - 96 -

p  pp     ,
ppp   root.

     ,  p p  pp
pp  . E2fsck p  p
     p p
p  .  p pp e2fsck  
pp Linus Torvald fsck    Minix. ,
 p pp p   
EXT2fs    p   p 
    p  pp,  p 
p p.

     pp e2fsck pp  p,  
   p.   pp pp
  p  p ,  
p p p e2fsck  p, 
p  pp   p  
p. ,   , p pp  pp 
    p    p
p   .

      p p e2fsck p   
pp    pp  pp 
  .  p, p  p 
pp p   .    
pp  pp   pp ,
      pp   
 p.  p p pp p ,
    pp.

      e2fsck   , p p p 
   pp,   p  1B  1D 
  -    p
,      pp.

     p p    p,   
 pp       pp.

                                - 97 -

  p p /  
p,   p   p.
pp p       
 .    p,  p p
  pp pp   
.

      p p  pp   
 .    pp , 
  p  .   e2fsck
pp     p   pp 
 p p,  p  p  
.   p  pp 
      p  
pp   p (  p  p
p).

      p     pp ,
pp   '.'  '..',   p
pp   '.'   . (p
pp   '..'  p  p p.)

      p  p p, p,
 p , p  p.

      ,    p p p
  p /  .  p,
p  p, p   p, p 
, ,  p p pp  
 5-10% p    e2fsck.

      p p pp  . E2fsck
pp     p  p,
 p,   p p p. 
 pp  '..'   .  ,
  pp      p,
   /lost+found.


                                - 98 -

      p p e2fsck pp   
  pp  pp  pp 
p   ( p p  p
p)  p ,  p  
 p p  p p.    
       /lost+found.

     , ,   p e2fsck pp 
 p   .  p p 
  pp, p    p
p,    , p ,
p    p ppp.

     p  p    .
Debugfs -   pp,  p 
   .  , 
 p p   EXT2fs,  
pp p     .

     Debugfs     p p
pp  , p  p
      e2fsck.  , 
pp  p  ,     
.    p  p
  .  debugfs p 
  p read-only  .    p
read/write    -w.

                    A.7    p

                         A.7.1    

       p   
 .  p  p p,
  pp i486-DX2,   16    420 
IDE . p   EXT2fs, Xia fs (Linux
1.1.62)    BSD Fast  p  p
p ( FreeBSD 2.0 Alpha -   p 4.4BSD

                                - 99 -

Lite).

        p . p   -  
Bonnie  p p /   
pp.  p       60 . 
   ,  p 
p ,     , 
 p    .  Andrew
 pp  Carneggie Mellon University  pp 
University of Berkeley  p  BSD FFS  LFS. 
p    :  pp ,
  , pp pp  
, pp       p
 .

                   A.7.2    Bonnie

       Bonnie    :

----------------------------------------------------------------------------
                  p   
            (/)  (/) (/)      (/)  (/)
----------------------------------------------------------------------------
BSD Async    710           684          401          721           888
BSD Sync     699           677          400          710           878
Ext2 fs      452          1237          536          397          1033
Xia fs       440           704          380          366           895
-----------------------------------------------------------------------------

       p p  /:
 EXT2fs p  p p .
   ,   pp p.
 p   p,  p , 
 p   p.  p  
 ,    pp  ,   p
 p     
pp   p.


                               - 100 -

      p p,   FreeBSD p 
/ p .     ,
 FreeBSD  Linux  p pp  C
.   ,  FreeBSD p  
p      
p  .

                   A.7.3    Andrew

       Andrew    :

----------------------------------------------------------------------------
               p 1    p 2     p 3     p 4     p 5
                   p  pp        
                                              pp
----------------------------------------------------------------------------
BSD Async      2203         7391         6319         17466        75314
BSD Sync       2330         7732         6317         17499        75681
Ext2 fs        790          4791         7235         11685        63210
Xia fs         934          5402         8400         12912        66997
----------------------------------------------------------------------------

      p  p ,  Linux
p p p  . p  
 ,  BSD p  pp  
.  p,  p p 
FreeBSD    p.

      p p   Linux  BSD  .  
p  p  BSD ,  p 
   VFS  Linux p  p.

      p   p Linux p p FreeBSD,
   p   p
p.  p  p p   
 ,   FreeBSD,   p
. p p  EXT2fs  Xia fs ,
 ,   EXT2fs,  :

                               - 101 -

p  p     5-10 %.

                             A.8  

       EXT2   p  
p  Linux.  p p
 Unix   .  , p
,   p,    p
 p.

      EXT2fs    ,  
 . p  p  pp
pp    :  p
,  p Posix,  
     p  p.

       EXT2fs  pp  p Linux, 
p   p  p p .
EXT2fs     p 
Masix, p    pp   p.

                              p

      p  EXT2fs  p   p  
  p  . p p  
p   pp  EXT2fs,  p
 ,   p  pp. p
p ,  p   pp  
.
.
                               - 102 -



                   p B    p

       p  p  pp,
    p   . 
,    pp,   
 (sag/measure-holes/measure-holes.c).

int process(FILE *f, char *filename) {
    static char *buf = NULL;
    static long prev_block_size = -1;
    long zeroes;
    char *p;

    if (buf == NULL || prev_block_size != block_size) {
            free (buf);
            buf = xmalloc (block_size + 1);
            buf [block_size] = 1;
            prev_block_size = block_size;
    }
    zeroes = 0;
    while (fread(buf, block_size, 1, f) == 1) {
            for (p = buf; *p =='\0'; )
                  ++p;
            if (p ==buf+block_size)
                  zeroes += block_size;
    }
    if (zeroes > 0)
            printf ("%ld %s\n", zeroes, filename);
    if (ferror(f)) {
            errormsg (0, -1, "read failed for '%s'", filename);
            return -1;
    }
    return 0;
}
.
                               - 103 -



             p      p Linux

        p p H. Peter Anvin
(Peter.Anvin@linux.org)     
ftp://ftp.yggdrasil.com/pub/device-list/devices.tex. 
   Peter'.

                          .1  

           p Linux Rick
Miller', p  pp    p  
  1993 .   pp p p
p,   p   p 
/dev.

        p FTP c ftp.yggdrasil.com 
 /pub/device-list.   - devices.format,  format
   : txt (ASCII), tex (LaTeX), dvi (DVI)  ps
(PostScript).

          Linux Filesystem Standard
(FSSTND). FSSTND  p FTP  tsx-11.mit.edu  
/pub/linux/docs/linux-standards/fsstnd.

      p p   p p 
.       p,
   p,  ,     p 
.

        (68k)    p Linux/68k.

.2   p p

0               p   ( p NFS,
                p  p)
1       char    p 

                               - 104 -

        block   RAM 
2       char    ppp  PTY 
        block      
3       char    ppp  PTY 
        block   p p MFM, RLL  IDE   / CD-ROM
4       char    p p TTY
5       char    p p p TTY
6       char    p p pp
7       char    p   p 
8       block   p SCSI 
9       char    p SCSI  
        block     p
10      char      , p 
11      block   p SCSI CD-ROM
12      char      QIC-02
        block   p p   MSCDEX CD-ROM
13      char    pp
        block   8- MFM/RLL/IDE pp
14      char     
        block   p p    BIOS
15      char    
        block   CD-ROM Sony CDU-31A/CDU-33A
16      char    ppp  p
        block   CD-ROM Gold Star
17      char      Chase (pp)
        block   Optics Storage CD-ROM (pp)
18      char       Chase
        block   Sanyo CD-ROM (pp)
19      char      Cyclades
        char      Double
20      block      Cyclades
        char    Hitachi CD-ROM (pp)
21      block   Generic SCSI 
22      char      Digiboard
        block   p p MFM, RLL  IDE   / CD-ROM
23      char       Digiboard
        block   Mitsumi CD-ROM
24      char      Stallion

                               - 105 -

        block   Sony CDU-535 CD-ROM
25      char       Stallion
        block   p CD-ROM Matsushita (Panasonic/SoundBlaster)
26      block   p CD-ROM Matsushita (Panasonic/SoundBlaster)
27      char      QIC-117
        block   p CD-ROM Matsushita (Panasonic/SoundBlaster)
28      char    ppp   Stallion
        block   p CD-ROM Matsushita (Panasonic/SoundBlaster)
        block   ACSI  (68k)
29      char    p p p
        block   Aztech/Orchid/Okano/Wearnes CD-ROM
30      char    iBCS-2
        block   Philips LMS-205 CD-ROM
31      char    MPU-401 MIDI
        block   ROM /  flash 
32      block   Philips LMS-206 CD-ROM
33      block   Modular RAM 
34-223           pp
224-254          
255             ppp

                       .3   p

0               p   ( p NFS, p
p)

1       char    p 

                1  /dev/mem         
                2  /dev/kmem       p  p
                3  /dev/null      p
                4  /dev/port       p /
                5  /dev/zero       
                6  /dev/core         /proc/kcore
                7  /dev/full     p  p ENOSPC
        block   RAM-
                1  /dev/ramdisk      RAM-


                               - 106 -

2       char    ppp  PTY  (tytso@athena.mit.edu)
        block   
                0  /dev/fd0     p pp, p 1, p
                1  /dev/fd1     p pp, p 2, p
                2  /dev/fd2     p pp, p 3, p
                3  /dev/fd3     p pp, p 4, p
              128  /dev/fd4     p pp, p 1, p
              129  /dev/fd5     p pp, p 2, p
              130  /dev/fd6     p pp, p 3, p
              131  /dev/fd7     p pp, p 4, p

        p    p
p  

                0  /dev/fd?       p p
                4  /dev/fd?d360   5.25 , 360K, p 360K
               20  /dev/fd?h360   5.25 , 360K, p 1200K
               48  /dev/fd?h410   5.25 , 410K, p 1200K
               64  /dev/fd?h420   5.25 , 420K, p 1200K
               24  /dev/fd?h720   5.25 , 720K, p 1200K
               80  /dev/fd?h880   5.25 , 880K, p 1200K
                8  /dev/fd?h1200  5.25 , 1200K, p 1200K
               40  /dev/fd?h1440  5.25 , 1440K, p 1200K
               56  /dev/fd?h1476  5.25 , 1476K, p 1200K
               72  /dev/fd?h1494  5.25 , 1494K, p 1200K
               92  /dev/fd?h1600  5.25 , 1600K, p 1200K

               12  /dev/fd?u360   3.5 , 360K,  
               16  /dev/fd?u720   3.5 , 720K,  
              120  /dev/fd?u800   3.5 , 800K,  
               52  /dev/fd?u820   3.5 , 820K,  
               68  /dev/fd?u830   3.5 , 830K,  
               84  /dev/fd?u1040  3.5 , 1040K,  
               88  /dev/fd?u1120  3.5 , 1120K,  
               28  /dev/fd?u1440  3.5 , 1440K,  
              124  /dev/fd?u1600  3.5 , 1600K,  
               44  /dev/fd?u1680  3.5 , 1680K,  
               60  /dev/fd?u1722  3.5 , 1722K,  

                               - 107 -

               76  /dev/fd?u1743  3.5 , 1743K,  
               96  /dev/fd?u1760  3.5 , 1760K,  
              116  /dev/fd?u1840  3.5 , 1840K,  
              100  /dev/fd?u1920  3.5 , 1920K,  
               32  /dev/fd?u3200  3.5 , 3200K, p 
              104  /dev/fd?u3200  3.5 , 3200K, p 
              108  /dev/fd?u3520  3.5 , 3520K, p 
              112  /dev/fd?u3840  3.5 , 3840K, p 

               36  /dev/fd?CompaQ   p Compaq  2880K.

     :    p (d,q,h  u)
  p p:   5.25
 (d), p  5.25  (q), 
 5.25  (h)  3.5  (u,  ). 
p  3.5  p  D, H  E  ,
    p    .

3       char   ppp  PTY (tytso@athena.mit.edu)
        block  p p MFM, RLL  IDE  
                CD-ROM
                0  /dev/hda       ( CD-ROM)
               64  /dev/hdb     p  ( CD-ROM)

       p    p p
 p

               0  /dev/hd?       
               1  /dev/hd?1     p  p
               2  /dev/hd?2     p  p
               3  /dev/hd?3     p  p
               4  /dev/hd?4     p  p
               5  /dev/hd?5     p  p
               6  /dev/hd?6     p  p
               7  /dev/hd?7     p  p
                   ......
              63  /dev/hd?63       p


                               - 108 -

4       char  TTY p
               0  /dev/console   
               1  /dev/tty1      p p 
                    .......
              63  /dev/tty63     p p 
              64  /dev/ttyS0    p  p
                    .......
             127  /dev/ttyS63    p  p
             128  /dev/ptyp0    p  -tty
                    .......
             191  /dev/ptysf     p  -tty
             192  /dev/ttyp0    p p -tty
                    .......
             255  /dev/ttysf     p p
                                -tty

     -tty   p:

      -tty   pty,  p
 tty;

     p      p, q, r  s, p
    p p -tty  16  ;

           0123456789abcdef, p
   p.

5       char   p TTY p
               0  /dev/tty     p tty
              64  /dev/cua0   p ,  ttyS0
                  .......
             127  /dev/cua63  p ,  ttyS63

6       char   p p p pp
               0  /dev/lp0    p p pp  (0x3bc)
               1  /dev/lp1    p p pp  (0x378)
               2  /dev/lp2    p p pp  (0x278)


                               - 109 -

          p p 0x3bc, 
p p pp    /dev/lp0  
/dev/lp1.

7       char   p   p 
               0  /dev/vcs         p
                               
               1  /dev/vcs1       tty1
                 ..........
              63  /dev/vcs63      tty63
             128  /dev/vcsa      p   
             p 
             129  /dev/vcsa1     p   tty1
                 ..........
             191  /dev/vcsa63    p   tty63

     :  p        .

8       block   p  SCSI 
                0  /dev/sda    p SCSI 
               16  /dev/sdb    p SCSI 
               32  /dev/sdc    p SCSI 
                  ........
              240  /dev/sdp     SCSI 

         p   IDE  (.
p p 3)   ,   
p  SCSI  p  11    ( 59,
  IDE ).

9       char    p  SCSI  
                0  /dev/st0    p SCSI  
                1  /dev/st1    p SCSI  
                  .........
              128  /dev/nst0   p SCSI  
 p  p p 
              129  /dev/nst1   p SCSI  
 p  p p 

                               - 110 -

                   .........
        block     p
                0  /dev/md0    p p p
                1  /dev/md1    p p p
                  .........

      pp     
   .

10      char        p p
                0  /dev/logibm     Logitech
                1  /dev/psaux     p   PS/2
                2  /dev/inportbm   Microsoft Inport
                3  /dev/atibm      ATI XL
                4  /dev/jbm       J-
                4  /dev/amigamouse      Amiga (68k)
                5  /dev/atarimouse      Atari (68k)
              128  /dev/beep       pp
              129  /dev/modrq     p p  p 

11      block   CD-ROM  p SCSI
                0  /dev/sr0       p SCSI CD-ROM
                1  /dev/sr1       p SCSi CD-ROM
                ..........

     p /dev/scd  p  /dev/sr.

12      char      QIC-02
                2  /dev/ntpqic11   QIC-11,  p p p 
                3  /dev/tpqic11    QIC-11,  p p p 
                4  /dev/ntpqic24   QIC-24,  p p p 
                5  /dev/tpqic24    QIC-24,  p p p 
                6  /dev/ntpqic120  QIC-120,  p p p 
                7  /dev/tpqic120   QIC-120,  p p p 
                8  /dev/ntpqic150  QIC-150.  p p p 
                9  /dev/tpqic150   QIC-150,  p p p 

        block   MSCDEX CD-ROM  p callback

                               - 111 -

                0  /dev/dos_cd0    p MSCDEX CD-ROM
                1  /dev/dos_cd1    p MSCDEX CD-ROM
                  ..........

13      char    pp
                0  /dev/pcmixer     /dev/mixer
                3  /dev/pcsp        /dev/dsp (8 )
                4  /dev/pcaudio     /dev/audio
                5  /dev/pcsp16      /dev/dsp (16 )
        block   8  MFM/RLL/IDE pp
                0  /dev/xda        p XT 
               64  /dev/xdb        p XT 

         p   IDE  (.
p p 3).

14      char     
                0  /dev/mixer       p
                1  /dev/sequencer    p
                2  /dev/midi00      p MIDI p
                3  /dev/dsp         p 
                4  /dev/audio       p ,   Sun
                6  /dev/sndstat     p    
                8  /dev/sequencer2   p
               16  /dev/mixer1      p p
               17  /dev/patmgr0     Patch p
               18  /dev/midi01      p MIDI p
               19  /dev/dsp1        p p  p 
               20  /dev/audio1      p p,   Sun, 
p 
               33  /dev/patmgr1     p patch p
               34  /dev/midi02      p MIDI p
               50  /dev/midi03      p MIDI p
        block       p BIOS   p callback
                0  /dev/dos_hda     p  (BIOS)
               64  /dev/dos_hdb     p  (BIOS)
              128  /dev/dos_hdc     p  (BIOS)
              192  /dev/dos_hdd     p  (BIOS)

                               - 112 -


         p   IDE  (.
p p 3).

15      char    
                0  /dev/js0          p 
                1  /dev/js1          p 
        block   CD-ROM Sony CDU-31A/CDU-33A
                0  /dev/sonycd       CD-ROM Sony CDU-31A

16      char    ppp  p
        block   CD-ROM Gold Star
                0  /dev/gscd         CD-ROM Gold Star

17      char      Chase (pp)
                0  /dev/ttyH0        p p hase
                1  /dev/ttyH1        p p chase
                 ..........
        block   Optics Storage CD-ROM (pp)
                0  /dev/optcd        Optics Storage CD-ROM

18      char       chase
                0  /dev/cuh0     p callout,  ttyH0
                1  /dev/cuh1     p callout,  ttyH1
                 ........
        block   CD-ROM Sanyo (pp)
                0  ?             CD-ROM Sanyo

19      char      Cyclades
                32  /dev/ttyC0   p p Cyclades
                  .......
                63  /dev/ttyC31  p p p Cyclades
        block     Double
                0  /dev/double0   p  
                  .......
                7  /dev/double7     
              128  /dev/cdouble0  p p  
                  .......

                               - 113 -

              135  /dev/cdouble7  p   

     .   Double  p  p p.

20      char       Cyclades
               32  /dev/cub0      p callout,  ttyC0
                  ........
               63  /dev/cub31     p callout,  ttyC31
        block  CD-ROM Hitachi (pp)
               0  /dev/hitcd      CD-ROM Hitachi

21      char   Generic SCSI 
               0  /dev/sg0        p p generic SCSI
               1  /dev/sg1        p p generic SCSI
                  ........

22      char     Digiboard
               0  /dev/ttyD0       p p Digiboard
               1  /dev/ttyD1       p p Digiboard
                 .........
        block  p p MFM/RLL/IDE   / CD-ROM
               0  /dev/hdc           ( CD-ROM)
              64  /dev/hdd         p  ( CD-ROM)

         p   p
p (. p p 3).

23      char      Digiboard
               0  /dev/cud0        p callout,  ttyD0
               1  /dev/cud1        p callout,  ttyD1

        block  CD-ROM Mitsumi
               0  /dev/mcd         CD-ROM Mitsumi

24      char     Stallion
               0  /dev/ttyE0       Stallion, p 0  0
               1  /dev/ttyE1       Stallion, p 1  0
                 ..........

                               - 114 -

              64  /dev/ttyE64      Stallion, p 0  1
              65  /dev/ttyE65      Stallion, p 1  1
                 ..........
             128  /dev/ttyE128     Stallion, p 0  2
             129  /dev/ttyE129     Stallion, p 1  2
                 ..........
             192  /dev/ttyE192     Stallion, p 0  3
             193  /dev/ttyE193     Stallion, p 1  3
                 ..........
        block  CD-ROM Sony CDU-535
               0  /dev/cdu535      CD-ROM Sony CDU-535

25      char      Stallion
               0  /dev/cue0    p callout,  ttyE0
               1  /dev/cue1    p callout,  ttyE1
                 ..........
              64  /dev/cue64   p callout,  ttyE64
              65  /dev/cue65   p callout,  ttyE65
                 ..........
             128  /dev/cue128  p callout,  ttyE128
             129  /dev/cue128  p callout,  ttyE129
                 ..........
             192  /dev/cue192  p callout,  ttyE192
             193  /dev/cue193  p callout,  ttyE193
                 ..........
        block  p CD-ROM Matsushita (Panasonic/SoundBlaster)
               0  /dev/sbpc0    CD-ROM Panasonic pp 0 p 0
               1  /dev/sbpc1    CD-ROM Panasonic pp 0 p 1
               2  /dev/sbpc2    CD-ROM Panasonic pp 0 p 2
               3  /dev/sbpc3    CD-ROM Panasonic pp 0 p 3

26      char    p
               0  /dev/wvisfgrab    p Quanta WinVision
        block  p CD-ROM Matsushita (Panasonic/SoundBlaster)
               0  /dev/sbpcd0   CD-ROM Panasonic pp 1 p 0
               1  /dev/sbpcd1   CD-ROM Panasonic pp 1 p 1
               2  /dev/sbpcd2   CD-ROM Panasonic pp 1 p 2
               3  /dev/sbpcd3   CD-ROM Panasonic pp 1 p 3

                               - 115 -


27      char     QIC-117
               0  /dev/rft0    p 0,  p p p 
               1  /dev/rft1    p 1,  p p p 
               2  /dev/rft2    p 2,  p p p 
               3  /dev/rft3    p 3,  p p p 
               4  /dev/nrft0   p 0,  p p p 
               5  /dev/nrft1   p 1,  p p p 
               6  /dev/nrft2   p 2,  p p p 
               7  /dev/nrft3   p 3,  p p p 
        block  p CD-ROM Matsushita (Panasonic/SoundBlaster)
               0  /dev/sbpcd8   CD-ROM Panasonic pp 2 p 0
               1  /dev/sbpcd9   CD-ROM Panasonic pp 2 p 1
               2  /dev/sbpcd10  CD-ROM Panasonic pp 2 p 2
               3  /dev/sbpcd11  CD-ROM Panasonic pp 2 p 3

28      char   ppp   Stallion
               0  /dev/staliomem0   / p  Stallion
               1  /dev/staliomem1   / p  Stallion
               2  /dev/staliomem2   / p  Stallion
               3  /dev/staliomem3   / p  Stallion
        block  p CD-ROM Matsushita (Panasonic/SoundBlaster)
               0  /dev/sbpcd12     CD-ROM Panasonic pp 3 p 0
               1  /dev/sbpcd13     CD-ROM Panasonic pp 3 p 1
               2  /dev/sbpcd14     CD-ROM Panasonic pp 3 p 2
               3  /dev/sbpcd15     CD-ROM Panasonic pp 3 p 3
        block  ACSI  (68k)
               0  /dev/ada         p ACSI 
              16  /dev/adb         p ACSI 
              32  /dev/adc         p ACSI 
               .........
             240  /dev/adp          ACSI 
         p   IDE  (.
p p 3),   ,   
p  ACSI  p  11 ( 59,   IDE
).

29      char   p p p

                               - 116 -

               0  /dev/fb0current      p p p
               1  /dev/fb0autodetect
                 ..........
              16  /dev/fb1current     p p p
              17  /dev/fb1autodetect
                 ..........
     p p p   p p
  p Linux/68k. p current  
  p   pp,  p autodetect -
 pp,  p p ( ). 
p 2-15    p p  
 p, p  p .  
 p    p.
        block  CD-ROM Aztech/Orchid/Okano/Wearnes
               0  /dev/aztcd       CD-ROM Aztech

30      char   iBCS-2
               0  /dev/socksys       
               1  /dev/spx         p SVR3    X
               2  /dev/inet/arp      
               2  /dev/inet/icmp     
               2  /dev/inet/ip       
               2  /dev/inet/udp      
               2  /dev/inet/tcp      
      p iBCS-2 p   /dev/nfsd 
/dev/socksys   /dev/XOR  /dev/null
        block  CD-ROM Philips LMS CM-205
               0  /dev/cm205cd     CD-ROM Philips LMS CM-205
     /dev/lmscd  p    p.
pp  p  p CD-ROM CM-205MS

31      char   MPU-401 MIDI
               0  /dev/mpu401data  p  MPU-401
               1  /dev/mpu401stat  p  MPU-401
        block  ROM/ flash 
               0  /dev/rom0        p  ROM (p read-write)
                 ..........
               7  /dev/rom7          ROM (p read-write)

                               - 117 -

               8  /dev/rrom0       p  ROM (p read-only)
                 ..........
              15  /dev/rrom7         ROM (p read-only)
              16  /dev/flash0      p  flash  (read-write)
                 ..........
              23  /dev/flash7        flash  (read-write)
              24  /dev/rflash0     p  flash  (read-only)
                 ..........
              31  /dev/rflash7       flash  (read-only)
     p, p  p read-write, p
p p ,   RAM,    
p flash RAM. p, p  p read-only,
p  .

32      block  CD-ROM Philips LMS CM-206
               0  /dev/cm206cd     CD-ROM Philips LMS CM-206

33      block  Modular RAM 
               0  /dev/ram0        p Modular RAM 
               1  /dev/ram1        p Modular RAM 
                 .........
             255  /dev/ram255         Modular RAM 

34-223          pp

224-254        /p 

          pp, 
     p,  p 
 p.  p,   MAX_CHRDEV
 MAX_BLKDEV   linux/include/linux/major.h  
    p p  p.
 p,    p
p,  p     
p 256.    ,   
 p 64 (p ),  3K.

255            ppp

                               - 118 -


           C.4      /dev

       p pp  ,
p       /dev. ,
       p ( 
),   .  p 
  ,    p  .
 ,      .

                   C.4.1   

            :

/dev/fd        /proc/self/fd          pp 
/dev/stdin     fd/0                    pp
p 
/dev/stdout    fd/1                    pp
p 
/dev/stderr    fd/2                    pp
p 

                    C.4.2   

     ,       :

/dev/XOR       null                    iBCS-2
/dev/nfsd      socksys                 iBCS-2
/dev/core      /proc/kcore             
/dev/scd?      sr?                          p 
p  CD-ROM

                  C.4.3    

           
p .   p  pp 
 p    p. ,  
 ,     :

                               - 119 -


/dev/mouse     p                 p 
/dev/tape      p           p
                                           
/dev/cdrom     p CD-ROM        p CD-ROM
/dev/modem     p               dialout p
/dev/root      p root           
                                                    root
/dev/swap      swap p          swap p

     p /dev/modem      ,
p p dialin    dialout,    
p  p  lock .   
,  /dev/modem    
(p) p dialout.

                      C.4.4    pp

       /dev     
pp.  p  :

/dev/printer                     lpd 
/dev/log                         syslog 


Last-modified: Sat, 18 May 2002 16:48:23 GMT
: