没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Linux Kernel 2.4 Internals
Table of Contents
Linux Kernel 2.4 Internals.................................................................................................................................1
Tigran Aivazian tigran@veritas.com.......................................................................................................1
1. Booting.................................................................................................................................................1
2. Process and Interrupt Management......................................................................................................1
3. Virtual Filesystem (VFS).....................................................................................................................2
4. Linux Page Cache................................................................................................................................2
5. IPC mechanisms..................................................................................................................................2
1. Booting.................................................................................................................................................2
1.1 Building the Linux Kernel Image......................................................................................................2
1.2 Booting: Overview.............................................................................................................................3
1.3 Booting: BIOS POST.........................................................................................................................4
1.4 Booting: bootsector and setup............................................................................................................4
1.5 Using LILO as a bootloader ..............................................................................................................7
1.6 High level initialisation .....................................................................................................................7
1.7 SMP Bootup on x86...........................................................................................................................9
1.8 Freeing initialisation data and code...................................................................................................9
1.9 Processing kernel command line.....................................................................................................10
2. Process and Interrupt Management....................................................................................................12
2.1 Task Structure and Process Table....................................................................................................12
2.2 Creation and termination of tasks and kernel threads......................................................................15
2.3 Linux Scheduler...............................................................................................................................17
2.4 Linux linked list implementation.....................................................................................................19
2.5 Wait Queues.....................................................................................................................................21
2.6 Kernel Timers..................................................................................................................................24
2.7 Bottom Halves.................................................................................................................................24
2.8 Task Queues.....................................................................................................................................25
2.9 Tasklets............................................................................................................................................26
2.10 Softirqs...........................................................................................................................................26
2.11 How System Calls Are Implemented on i386 Architecture?.........................................................26
2.12 Atomic Operations.........................................................................................................................27
2.13 Spinlocks, Read−write Spinlocks and Big−Reader Spinlocks......................................................28
2.14 Semaphores and read/write Semaphores.......................................................................................30
2.15 Kernel Support for Loading Modules............................................................................................31
3. Virtual Filesystem (VFS)...................................................................................................................34
3.1 Inode Caches and Interaction with Dcache......................................................................................34
3.2 Filesystem Registration/Unregistration...........................................................................................37
3.3 File Descriptor Management............................................................................................................39
3.4 File Structure Management..............................................................................................................40
3.5 Superblock and Mountpoint Management.......................................................................................43
3.6 Example Virtual Filesystem: pipefs.................................................................................................46
3.7 Example Disk Filesystem: BFS.......................................................................................................48
3.8 Execution Domains and Binary Formats.........................................................................................50
4. Linux Page Cache..............................................................................................................................51
5. IPC mechanisms................................................................................................................................54
5.1 Semaphores.....................................................................................................................................54
Semaphore System Call Interfaces..........................................................................................54
sys_semget()............................................................................................................................54
sys_semctl().............................................................................................................................54
Linux Kernel 2.4 Internals
i
Table of Contents
sys_semop().............................................................................................................................54
Non−blocking Semaphore Operations.....................................................................................55
Failing Semaphore Operations.................................................................................................55
Blocking Semaphore Operations.............................................................................................55
Semaphore Specific Support Structures..................................................................................56
struct sem_array.......................................................................................................................56
struct sem.................................................................................................................................56
struct seminfo...........................................................................................................................56
struct semid64_ds....................................................................................................................57
struct sem_queue......................................................................................................................57
struct sembuf............................................................................................................................57
struct sem_undo.......................................................................................................................58
Semaphore Support Functions.................................................................................................58
newary()...................................................................................................................................58
freeary()...................................................................................................................................58
semctl_down().........................................................................................................................59
IPC_RMID...............................................................................................................................59
IPC_SET..................................................................................................................................59
semctl_nolock().......................................................................................................................59
IPC_INFO and SEM_INFO.....................................................................................................59
SEM_STAT.............................................................................................................................59
semctl_main()..........................................................................................................................59
GETALL..................................................................................................................................59
SETALL...................................................................................................................................59
IPC_STAT...............................................................................................................................60
GETVAL.................................................................................................................................60
GETPID...................................................................................................................................60
GETNCNT...............................................................................................................................60
GETZCNT...............................................................................................................................60
SETVAL..................................................................................................................................60
count_semncnt().......................................................................................................................61
count_semzcnt().......................................................................................................................61
update_queue().........................................................................................................................61
try_atomic_semop().................................................................................................................61
sem_revalidate().......................................................................................................................62
freeundos()...............................................................................................................................62
alloc_undo().............................................................................................................................62
sem_exit()................................................................................................................................62
5.2 Message queues..............................................................................................................................62
Message System Call Interfaces..............................................................................................63
sys_msgget()............................................................................................................................63
sys_msgctl().............................................................................................................................63
IPC_INFO ( or MSG_INFO)...................................................................................................63
IPC_STAT ( or MSG_STAT)..................................................................................................63
IPC_SET..................................................................................................................................63
IPC_RMID...............................................................................................................................63
sys_msgsnd()...........................................................................................................................64
sys_msgrcv()............................................................................................................................64
Linux Kernel 2.4 Internals
ii
Table of Contents
Message Specific Structures....................................................................................................65
struct msg_queue.....................................................................................................................65
struct msg_msg........................................................................................................................66
struct msg_msgseg...................................................................................................................66
struct msg_sender....................................................................................................................66
struct msg_receiver..................................................................................................................66
struct msqid64_ds....................................................................................................................67
struct msqid_ds........................................................................................................................67
msg_setbuf...............................................................................................................................67
Message Support Functions.....................................................................................................68
newque()..................................................................................................................................68
freeque()...................................................................................................................................68
ss_wakeup().............................................................................................................................68
ss_add()....................................................................................................................................68
ss_del().....................................................................................................................................69
expunge_all()...........................................................................................................................69
load_msg()...............................................................................................................................69
store_msg()..............................................................................................................................69
free_msg()................................................................................................................................69
convert_mode()........................................................................................................................69
testmsg()...................................................................................................................................69
pipelined_send().......................................................................................................................70
copy_msqid_to_user().............................................................................................................70
copy_msqid_from_user().........................................................................................................70
5.3 Shared Memory...............................................................................................................................70
Shared Memory System Call Interfaces..................................................................................70
sys_shmget()............................................................................................................................70
sys_shmctl().............................................................................................................................71
IPC_INFO................................................................................................................................71
SHM_INFO.............................................................................................................................71
SHM_STAT, IPC_STAT.........................................................................................................71
SHM_LOCK, SHM_UNLOCK...............................................................................................71
IPC_RMID...............................................................................................................................72
IPC_SET..................................................................................................................................72
sys_shmat()..............................................................................................................................72
sys_shmdt()..............................................................................................................................73
Shared Memory Support Structures.........................................................................................73
struct shminfo64......................................................................................................................73
struct shm_info........................................................................................................................73
struct shmid_kernel..................................................................................................................73
struct shmid64_ds....................................................................................................................74
struct shmem_inode_info.........................................................................................................74
Shared Memory Support Functions.........................................................................................74
newseg()...................................................................................................................................74
shm_get_stat()..........................................................................................................................75
shmem_lock()..........................................................................................................................75
shm_destroy()..........................................................................................................................75
shm_inc().................................................................................................................................75
Linux Kernel 2.4 Internals
iii
Table of Contents
shm_close()..............................................................................................................................75
shmem_file_setup().................................................................................................................76
5.4 Linux IPC Primitives......................................................................................................................76
Generic Linux IPC Primitives used with Semaphores, Messages,and Shared Memory.........76
ipc_alloc()................................................................................................................................76
ipc_addid()...............................................................................................................................76
ipc_rmid()................................................................................................................................76
ipc_buildid().............................................................................................................................76
ipc_checkid()...........................................................................................................................77
grow_ary()...............................................................................................................................77
ipc_findkey()............................................................................................................................77
ipcperms()................................................................................................................................77
ipc_lock().................................................................................................................................77
ipc_unlock().............................................................................................................................77
ipc_lockall().............................................................................................................................77
ipc_unlockall().........................................................................................................................77
ipc_get()...................................................................................................................................78
ipc_parse_version()..................................................................................................................78
Generic IPC Structures used with Semaphores,Messages, and Shared Memory....................78
struct kern_ipc_perm...............................................................................................................78
struct ipc_ids............................................................................................................................78
struct ipc_id..............................................................................................................................79
Linux Kernel 2.4 Internals
iv
剩余83页未读,继续阅读
资源评论
scholar165
- 粉丝: 3
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功