本帖最后由 GSG9 于 4.8.2009 02:20 编辑
内核的基本结构,也就是我的旅程表
userspace process
|
+-------> files/directories
|
| +-------> file -> VFS -> filesystem -> file_operations table -> function
|
| +-------> directory(file) -> VFS -> filesystem -> file_operations -> function
|
+-------> character/block devices
| |
| +-------> file -> VFS -> device table -> char/block functions -> driver
| |
| +-------> file -> VFS --------------> filesystem --------------> devfs driver
|
+-------> pipes/sockets
| |
| +-------> system call -> socket -> layer-4 -> layer-3 -> NIC driver
| |
| +-------> descriptor -> buffer -> descriptor
|
+-------> system calls
| |
| +------> interrupt -> system call handler -> sys_syscall() -> do_syscall()
|
+-------> virtual memory
| |
| +-------> malloc() -> mmap() -> VMA -> KMA -> page manager -> hw mem
| |
| +-------> malloc() -> mmap() -> VMA -> KMA -> kswapd -> swap mag't -> blk dev
|
+-------> process management
|
+-------> system call(fork) -> system call handler -> sys_fork()/sys_clone()
|
+-------> system call(kill) -> system call handler -> sys_kill()
|
+-------> IPC -> system call(ipc) -> system call handler -> sys_ipc() |