1. Operating system: Provide services for programs they run.
Typical services: (1) excuting a new program.
(2) opening a file, reading a file.
(3) allocating a region of memory.
(4) getting the current time of day and so on.
2. Unix Architecture
(1). Operating system in a strict sense (The kernel):
1) controls the hardware resources of the computer.
2) provides an enviroment under which programs can run.
Figure 1.1
System calls: the interface to the kernel.
Shell: a specical application that provides an interface for running other applications.
(2). Operating system in a broad sense:
1) kernel;
2) all the other software.
3. Logging In
(1) Loggin name
1) password file: /etc/passwd.
2) entry in the password file: seven colon-separated fields:
login name; encrypted password; numeric user ID(205); numeric group ID(105); comment filed; home directory; shell program;
sar:x:205:105:Stephen Rago:/home/sar:/bin/ksh
encrypted password file to a different file. Chapter 6.
(2) Shell: a command-line interpreter that reads user input and excutes commands.
4. Files and Directories
(1) Unix File system: a hierarchical arrangement of directories and files.
1) Directory: a file that contains directory entries.
A directory entry: contains a filename along with a structure of information describing the attributes of the file.
Attributes of the file: a) type of file - regular file.
b) directory - the size of file.
c) the owner of the file.
d) permissions for the file.
e) when the file was last modified.
The attributes in greate detail in chapter 4.
Make a distinction between the logical view of a directory entry and the way it is actually stored on disk. Clear when discussing hard links in chapter 4.
(2) Filename
The names in a directory are called filenames. (slash / and null).
(3) Pathname
Absolute pathname;
Relative pathname;
(4) Working Directory
(1) used by the process: from which relative pathnames are interpreted.
(2) use chdir function to change working directory.
(5) Home Directory
(1) log in, password file.
5: Input and Output
(1) File Descriptors
1) small non-negative integers
2) used by the kernel to identify files.
3) a particular process.
(2) Standard Input, Standard Output, Standard Error.
1) when a new program is run , shells open three descriptors: standard input, standard output, standard error (connected to the terminal).
2) shells provide a way to redirect the descriptors to any file.
(3) Unbufferd I/O functions
1) open, read, write, lseek and close.
2) functions all work with file descriptors.
in chapter 3, we describe the unbuffered I/O functions in more detail.
(4) Standard I/O
1) provide an