1.1 Introduction
All operating systems serve programs: Execute new programs, open files, read files, allocate storage, and get the current time
1.2 UNIX Architecture
The interface of the kernel is called a system call
Public Function Library building up the system call Interface , the application can use both common library functions and system invoke interfaces, and the shell is a special application that provides an interface for other applications
1.3 Shell
The shell is a command-line interpreter, and the shell's user input is usually from the terminal, sometimes from a file (as a shell script)
1.4 Files and directories
The stat and FSTAT functions return information structures that contain all file attributes
Get directory information: Opendir, Readir, Closedir
1.5 Inputs and outputs
File description is usually a small non-negative integer: standard input, standard output, standard error
Redirect:./a.out <infile >outfile
1.6 Procedures and processes
Program is an executable program that stores the directory files on the disk
Process Control main right three main functions: fork, exec, waitpid
All threads in a process share a space, file descriptors, stacks, and process-related properties
1.7 Error Handling
1.8 User Logo
Users with a user ID of 0 are super users
Getuid (), Getgid ();
1.9 Signal
Signal (signal) is used to notify the process of what happened
1.10 Time Value
1.11 system calls and library functions
System calls are interfaces provided by the kernel, and library functions can understand further encapsulation
Exercises:
1.4: The calendar is stored in the number of 32 digits (2^31-1=214 768 347)/(3600*24*365) =68 so 1970+68=2038
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
1th Basic knowledge of Unix