Академический Документы
Профессиональный Документы
Культура Документы
UNIX-compatible tools. Its file system adheres to traditional UNIX semantics, and it fully implements the standard UNIX networking model. Main design goals are speed, efficiency, flexibility and standardization. Linux is designed to be compliant with the relevant POSIX documents; some Linux distributions have achieved official POSIX certification. The Linux programming interface adheres to the SVR4 UNIX semantics, rather than to BSD behavior.
1.1
1.2
is
uses KDE, GNOME ), but the programmers prefer to type the commands. Shell: the user process which executes programs (command interpreter)
User types command Shell reads command (read from input) and translates it to the
operating system.
shell scripts A shell script is a file containing a sequence of commands addressed to the operating system that facilitates the repeated execution of the included commands without their having to be laboriously retyped each time they are executed. If there is a distinct ordered list of operating system commands that the user needs to execute repeatedly, for example, immediately after every login or immediately before every logout, then most operating systems have a facility for recording the list of commands in a file, which can then either be executed automatically upon login or logout, or can be invoked by the user through the issuance of a single command that results in the execution of the entire contents of the batch file, which can contain as few as one operating system command or as many as thousands.
1.6
clear echo Menuset stop=1 while ($stop>0) cat << ENDOFMENU 1: stampa data 2: stampa la directory corrente 3: esci ENDOFMENU echo -n Scegli il comando set reply=$< switch ($reply) case 1 : date breaksw case 2 : pwd breaksw case 3 : set stop=0 breaksw default: echo scelta sbagliata riprova breaksw endsw end exit 0 1.7
action from the O.S. The programs perform the system calls by mean of trap. trap instruction: changes from user mode to kernel mode controls the correctness of the call parameters execution done on behalf of the operating system returns to user mode Since it is impossible to write a trap in C, it is provided a standard library with a procedure for each system call. These procedures are written in assembler and are called from C. For example a C program for performing the system call read, it calls the procedure read ,of the standard library. So, the standard library defines a standard set of functions through which applications interact with the kernel, and which implement much of the operating-system functionality that does not need the full privileges of kernel code. POSIX establishes which are the procedures of the library that the system has to provide, their parameters and tasks. 1.9
The Kernel
The kernel is responsible for maintaining the important abstractions of the
operating system. It provides the main functions of the abstract machine (system calls and Interrupt and traps). Approximate structure of generic UNIX kernel
1.10
The Kernel
The Linux kernel uses a monolithic model. It does
not take the new client-server model (i.e., microkernel). The main reason for this choice is the improvement of the performances.
The kernel code is executed in kernel mode with full
access to all the physical resources of the computer. All kernel code and data are contained in a unique address space.
File System
Linux files are organized by a hierarchy of labels,
commonly known as a directory structure. The files referenced by these labels may be of three kinds:
Regular files, which contains a sequence of bytes that
generally corresponds to code (programs) or data. Directory files, which are stored on disk in a special format and form the backbone of the file system Special file, which correspond to peripherals such as printers or disks.
hierarchical semantics.
directory
tree
obeying
UNIX
1.12
File System
directories. pathname:
Every
file
has
unambiguous
/home/user1/papers
1.13
Binaries which are absolutely essential to run Linux. /boot All the files required for booting Linux on a system. /dev All the devices have their corresponding files here. /etc All the configuration files for the various software are stored here. Don't play with this directory. /home All users will have their 'My Documents' under this directory. If your id is rossi, your 'My Documents' (called home-directory) is /home/rossi. /lib The libraries required by system-applications. (Just like DLLs in Windows.) /lost+found When a disk-check finds files which are damaged or which are not linked to any directory, they are recovered to this directory. Such damages are almost always due to incorrect shutdown.
1.14
systems are mounted. /opt The directory where optional software are installed. /proc proc houses a pseudo-file system. Its contents really do not exist anywhere on the disk, and are made available only when you cd to this directory and look at some file. /root The home-directory for the super-user: root. /sbin The system-administration binaries exist here. /tmp The directory where temporary files are created and stored. All users can save files here. /usr Everything related to users /var Files whose contents vary frequently are in this directory.
1.15
houses critical binaries of the users /usr/include The header-files required by programs for compilation. /usr/lib The libraries required by user-applications. /usr/local Files peculiar to this particular machine. /usr/sbin User-administration binaries. /usr/share Information that can be shared by most users. /usr/src The source-code for the Linux kernel. /usr/X11R6 Files needed by the X Window system.
directory.
/var/log
The log-files of the system. /var/spool Directories for mail, news, printing and other queued work.
1.16
Mounting
Separate file systems
After mounting
Before mounting
1.17
After mounting