读understanding the linux kernel

本文探讨了Linux系统中进程的管理和PID分配原则,包括进程的初始化过程及内核线程的作用。此外,还深入解析了中断请求的处理流程,包括可编程中断控制器的工作原理及其在信号传递中的角色。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


*****************************************************************************************************************************
Chapter 3. Processes  只记录了一些记忆有点模糊的和不太懂的
*****************************************************************************************************************************

there is an upper limit on the PID values; when the kernel reaches such limit, it must start recycling the lower, unused

PIDs. By default, the maximum PID number is 32,767 (PID_MAX_DEFAULT - 1);
//进程号是有限度的,默认最大值为32767!
Linux associates a different PID with each process or lightweight process in the system.

On the other hand, Unix programmers expect threads in the same group to have a common PID. For instance, it should be

possible to a send a signal specifying a PID that affects all threads in the group.
//线程是共用一个PID的!且共享内存空间!
a wait queue represents a set of sleeping processes, which are woken up by the kernel when some condition becomes true.
//一个等待队列 代表着许多个睡眠的进程。
Process 1
The kernel thread created by process 0 executes the init( ) function, which in turn completes the initialization of the

kernel. Then init( ) invokes the execve( ) system call to load the executable program init. As a result, the init kernel

thread becomes a regular process having its own per-process kernel data structure . The init process stays alive until the

system is shut down, because it creates and monitors the activity of all processes that implement the outer layers of the

operating system.
//内核线程建立0号进程,它执行init()函数,在这个函数中,将顺序的执行代码,初始化内核。这个初始化进程建立和管理其他所有的进程
//直到关机,初始化进程也就结束了!

************************************************************************************************************************
Chapter 4. Interrupts and Exceptions
************************************************************************************************************************
All existing IRQ lines are connected to the input pins of a hardware circuit called the Programmable Interrupt Controller,

which performs the following actions:
1.Monitors the IRQ lines, checking for raised signals. If two or more IRQ lines are raised, selects the one having the lower

pin number.

2.If a raised signal occurs on an IRQ line:

a.Converts the raised signal received into a corresponding vector.

b.Stores the vector in an Interrupt Controller I/O port, thus allowing the CPU to read it via the data bus.

c.Sends a raised signal to the processor INTR pin that is, issues an interrupt.

3.Waits until the CPU acknowledges the interrupt signal by writing into one of the Programmable Interrupt Controllers (PIC)

I/O ports; when this occurs, clears the INTR line.

4 . Goes back to step 1.
//所有的中断线都和可编程中断控制器相连,可编程中断控制器负责检查中断,然后做一系列的通知工作!
///
///
/********************************************看不下去了!!!!*******************************************************/
///
///

 前言   第一章绪论   Linux与其他类Unix内核的比较   硬件的依赖性   Linux版本   操作系统基本概念   Unix文件系统概述   Unix内核概述   第二章内存寻址   内存地址   硬件中的分段   Linux中的分段   硬件中的分页   Linux中的分页   第三章进程   进程、轻量级进程和线程   进程描述符   进程切换   创建进程   撤消进程   第四章中断和异常   中断信号的作用   中断和异常   中断和异常处理程序的嵌套执行   初始化中断描述符表   异常处理   中断处理   软中断及tasklet   工作队列   从中断和异常返回   第五章内核同步   内核如何为不同的请求提供服务   同步原语   对内核数据结构的同步访问   避免竞争条件的实例   第六章定时测量   时钟和定时器电路   Linux计时体系结构   更新时间和日期   更新系统统计数   软定时器和延迟函数   与定时测量相关的系统调用   第七章进程调度   调度策略   调度算法   调度程序所使用的数据结构   调度程序所使用的函数   多处理器系统中运行队列的平衡   与调度相关的系统调用   第八章内存管理   页框管理   内存区管理   非连续内存区管理   第九章进程地址空间   进程的地址空间   内存描述符   线性区   缺页异常处理程序   创建和删除进程的地址空间   堆的管理   第十章系统调用   POSIXAPI和系统调用   系统调用处理程序及服务例程   进入和退出系统调用   参数传递   内核封装例程   第十一章信号   信号的作用   产生信号   传递信号   与信号处理相关的系统调用   第十二章虚拟文件系统   虚拟文件系统(VFS)的作用   VFS的数据结构   文件系统类型   文件系统处理   路径名查找   VFS系统调用的实现   文件加锁   第十三章I/O体系结构和设备驱动程序   I/O体系结构   设备驱动程序模型   设备文件   设备驱动程序   字符设备驱动程序   第十四章块设备驱动程序   块设备的处理   通用块层   I/O调度程序   块设备驱动程序   打开块设备文件   第十五章页高速缓存   页高速缓存   把块存放在页高速缓存中   把脏页写入磁盘   sync()、fsync()和fdatasync()系统调用   第十六章访问文件   写文件   内存映射   直接I/O传送   异步I/O   第十七章回收页框   页框回收算法   反向映射   PFRA实现   交换   第十八章Ext2和Ext3文件系统   Ext2的一般特征   Ext2磁盘数据结构   Ext2的内存数据结构   创建Ext2文件系统   Ext2的方法   管理Ext2磁盘空间   Ext3文件系统   第十九章进程通信   管道   FIFO   SystemVIPC   POSIX消息队列   第二十章程序的执行   可执行文件   可执行格式   执行域   exec函数   附录一系统启动   附录二模块   参考文献
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值