| Chapter 1. Introduction | ||||||||||
| 1.4Basic Operating System Concepts | ||||||||||
| Multiuser Systems | ||||||||||
| Users and Groups | ||||||||||
| Processes | ||||||||||
| Kernel Architecture | microkernel | |||||||||
| monolithic | ||||||||||
| modules | ||||||||||
| 1.5. An Overview of the Unix Filesystem | ||||||||||
| current working directory | ||||||||||
| absolute/relative directory | ||||||||||
| Hard and Soft Links | $ ln p1 p2 | create a new hard link that has the pathname p2 for a file identified by the pathname p1. | ||||||||
| Hard links limitations: | ||||||||||
| It is not possible to create hard links for directories | ||||||||||
| Links can be created only among files included in the same filesystem | ||||||||||
| $ ln -s p1 p2 | creates a new soft link with pathname p2 that refers to pathname p1 | |||||||||
| File Types | file -h filename | |||||||||
| Regular file | ||||||||||
| Directory | ||||||||||
| Symbolic link | ||||||||||
| Block-oriented device file | ||||||||||
| Character-oriented device file | ||||||||||
| Pipe and named pipe (also called FIFO) | ||||||||||
| Socket | ||||||||||
| File Descriptor and Inode | ||||||||||
| inode | ||||||||||
| File type (see the previous section) | ||||||||||
| Number of hard links associated with the file | ||||||||||
| File length in bytes | ||||||||||
| Device ID (i.e., an identifier of the device containing the file) | ||||||||||
| Inode number that identifies the file within the filesystem | ||||||||||
| UID of the file owner | ||||||||||
| User group ID of the file | ||||||||||
| Several timestamps that specify the inode status change time, the last access time, and the last modify time | ||||||||||
| Access rights and file mode | ||||||||||
| Access Rights and File Mode | ||||||||||
| suid | ||||||||||
| sgid | ||||||||||
| sticky | ||||||||||
| File-Handling System Calls | ||||||||||
| fd = open(path, flag, mode) | ||||||||||
| Accessing an opened file | ||||||||||
| sequentially or randomly | ||||||||||
| nread = read(fd, buf, count); | ||||||||||
| write( ) | ||||||||||
| newoffset = lseek(fd, offset, whence); | ||||||||||
| Closing a file | ||||||||||
| res = close(fd); | ||||||||||
| res = rename(oldpath, newpath); | ||||||||||
| res = unlink(pathname); | ||||||||||
| 1.6. An Overview of Unix Kernels | ||||||||||
| User Mode | ||||||||||
| Kernel Mode | ||||||||||
| kernel thread | ||||||||||
| system call | ||||||||||
| kernel routines can be activated in several ways: | ||||||||||
| system call | ||||||||||
| exception | ||||||||||
| interrupt | ||||||||||
| kernel thread | ||||||||||
| Reentrant Kernels | ||||||||||
| reentrant function | ||||||||||
| control path | ||||||||||
| private Process Address Space | ||||||||||
| synchronization | ||||||||||
| critical region | ||||||||||
| Each semaphore may be viewed as an object composed of: | ||||||||||
| An integer variable | ||||||||||
| A list of waiting processes | ||||||||||
| Two atomic methods: down( ) and up( ) | ||||||||||
| Spin locks | ||||||||||
| fork( ) | ||||||||||
| exec( ) | ||||||||||
| exit( ) | ||||||||||
| wait4( ) | ||||||||||
| MMU | ||||||||||
| Virtual memory | ||||||||||
| Kernel Memory Allocator(KMA) | ||||||||||
| It must be fast | ||||||||||
| It should minimize the amount of wasted memory | ||||||||||
| It should try to reduce the memory fragmentation problem | ||||||||||
| It should be able to cooperate with the other memory management subsystems to borrow and release page frames from them | ||||||||||
| · Resource map allocator | ||||||||||
| · Power-of-two free lists | ||||||||||
| · McKusick-Karels allocator | ||||||||||
| · Buddy system | ||||||||||
| · Mach's Zone allocator | ||||||||||
| · Dynix allocator | ||||||||||
| · Solaris 's Slab allocator | ||||||||||
| demand paging | ||||||||||
| Copy On Write | ||||||||||
Understanding the linux kernel-ch1-overview
最新推荐文章于 2026-08-18 22:02:00 发布
本文介绍了Unix系统的文件系统概述,包括硬链接与软链接的区别、文件类型、文件描述符及inode的概念;同时还涵盖了Unix内核概述,涉及用户模式与内核模式、进程调度、内存管理等方面的内容。

876

被折叠的 条评论
为什么被折叠?



