目录序言................................................................................ 1本书的主要目标........................................................ 1现有书籍不足之处.................................................... 1阅读早期内核的其它好处 ........................................ 2阅读完整源代码的重要性和必要性 ........................ 2如何选择要阅读的内核代码版本 ............................ 3阅读本书需具备的基础知识 .................................... 3使用早期版本是否过时? ........................................ 4EXT2 文件系统与 MINIX 文件系统......................... 4第 1 章 概述.................................................................. 51.1 LINUX 的诞生和发展........................................... 51.2 内容综述 ........................................................... 101.3 本章小结 ........................................................... 14第 2 章 LINUX 内核体系结构 .................................. 152.1 LINUX 内核模式................................................. 152.2 LINUX 内核系统体系结构 ................................. 162.3 中断机制 ........................................................... 182.4 系统定时 ........................................................... 192.5 LINUX 进程控制................................................. 202.6 LINUX 内核对内存的使用方法 ......................... 262.7 LINUX 系统中堆栈的使用方法 ......................... 292.8 LINUX 内核源代码的目录结构 ......................... 322.9 内核系统与用户程序的关系............................ 382.10 LINUX/MAKEFILE 文件...................................... 392.11 本章小结.......................................................... 47第 3 章 引导启动程序(BOOT)............................. 493.1 概述 ................................................................... 493.2 总体功能 ........................................................... 493.3 BOOTSECT.S 程序 ................................................ 503.4 SETUP.S 程序 ....................................................... 583.5 HEAD.S 程序........................................................ 713.6 本章小结 ........................................................... 80第 4 章 初始化程序(INIT)......................................... 814.1 概述 ................................................................... 814.2 MAIN.C 程序........................................................ 814.3 环境初始化工作 ............................................... 914.4 本章小结 ........................................................... 92第 5 章 内核代码(KERNEL)..................................... 955.1 概述 ................................................................... 955.2 总体功能描述 ................................................... 955.3 MAKEFILE 文件................................................... 985.4 ASM.S 程序........................................................ 1005.5 TRAPS.C 程序..................................................... 1065.6 SYSTEM_CALL.S 程序........................................ 1135.7 MKTIME.C 程序 ................................................. 1235.8 SCHED.C 程序.................................................... 1255.9 SIGNAL.C 程序................................................... 1385.10 EXIT.C 程序 ..................................................... 1475.11 FORK.C 程序.................................................... 1535.12 SYS.C 程序....................................................... 1605.13 VSPRINTF.C 程序.............................................. 1665.14 PRINTK.C 程序................................................. 1745.15 PANIC.C 程序 ................................................... 1755.16 本章小结........................................................ 176第 6 章 块设备驱动程序(BLOCK DRIVER)......... 1776.1 概述 ................................................................. 1776.2 总体功能.......................................................... 1776.3 MAKEFILE 文件................................................. 1806.4 BLK.H 文件........................................................ 1826.5 HD.C 程序.......................................................... 1866.6 LL_RW_BLK.C 程序 ........................................... 2026.7 RAMDISK.C 程序................................................ 2076.8 FLOPPY.C 程序................................................... 212第 7 章 字符设备驱动程序(CHAR DRIVER) ....... 2397.1 概述 ................................................................. 2397.2 总体功能描述.................................................. 2397.3 MAKEFILE 文件................................................. 2477.4 KEYBOARD.S 程序............................................. 2497.5 CONSOLE.C 程序................................................ 2677.6 SERIAL.C 程序 ................................................... 2907.7 RS_IO.S 程序 ..................................................... 2937.8 TTY_IO.C 程序................................................... 2977.9 TTY_IOCTL.C 程序............................................. 308第 8 章 数学协处理器(MATH)................................ 3178.1 概述 ................................................................. 3178.2 MAKEFILE 文件................................................. 3178.3 MATH-EMULATION.C 程序.................................. 319第 9 章 文件系统(FS)............................................... 3219.1 概述 ................................................................. 3219.2 总体功能描述.................................................. 3219.3 MAKEFILE 文件................................................. 327目录- II -9.4 BUFFER.C 程序 .................................................. 3309.5 BITMAP.C 程序................................................... 3459.6 INODE.C 程序 .................................................... 3499.7 SUPER.C 程序 .................................................... 3609.8 NAMEI.C 程序.................................................... 3699.9 FILE_TABLE.C 程序............................................ 3909.10 BLOCK_DEV.C 程序 ......................................... 3909.11 FILE_DEV.C 程序.............................................. 3949.12 PIPE.C 程序...................................................... 3979.13 CHAR_DEV.C 程序 ........................................... 4009.14 READ_WRITE.C 程序........................................ 4039.15 TRUNCATE.C 程序............................................ 4079.16 OPEN.C 程序.................................................... 4099.17 EXEC.C 程序.................................................... 4159.18 STAT.C 程序..................................................... 4309.19 FCNTL.C 程序 .................................................. 4319.20 IOCTL.C 程序................................................... 434第 10 章 内存管理(MM).......................................... 43710.1 概述 ............................................................... 43710.2 总体功能描述 ............................................... 43710.3 MAKEFILE 文件............................................... 44210.4 MEMORY.C 程序............................................... 44310.5 PAGE.S 程序..................................................... 457第 11 章 头文件(INCLUDE) ................................... 45911.1 概述 ............................................................... 45911.2 INCLUDE/目录下的文件 ................................. 45911.3 A.OUT.H 文件................................................... 46011.4 CONST.H 文件.................................................. 47011.5 CTYPE.H 文件.................................................. 47111.6 ERRNO.H 文件 ................................................. 47211.7 FCNTL.H 文件 .................................................. 47411.8 SIGNAL.H 文件................................................. 47611.9 STDARG.H 文件................................................ 47811.10 STDDEF.H 文件 .............................................. 47911.11 STRING.H 文件 ............................................... 48011.12 TERMIOS.H 文件 ............................................ 49011.13 TIME.H 文件................................................... 49711.14 UNISTD.H 文件............................................... 49811.15 UTIME.H 文件 ................................................ 50411.16 INCLUDE/ASM/目录下的文件 ....................... 50511.17 IO.H 文件....................................................... 50511.18 MEMORY.H 文件............................................. 50611.19 SEGMENT.H 文件 ........................................... 50711.20 SYSTEM.H 文件.............................................. 50911.21 INCLUDE/LINUX/目录下的文件 .................... 51211.22 CONFIG.H 文件............................................... 51211.23 FDREG.H 头文件 ............................................ 51411.24 FS.H 文件....................................................... 51711.25 HDREG.H 文件................................................ 52311.26 HEAD.H 文件 ................................................. 52511.27 KERNEL.H 文件.............................................. 52611.28 MM.H 文件..................................................... 52711.29 SCHED.H 文件................................................ 52711.30 SYS.H 文件..................................................... 53511.31 TTY.H 文件..................................................... 53711.32 INCLUDE/SYS/目录中的文件......................... 54011.33 STAT.H 文件 ................................................... 54011.34 TIMES.H 文件................................................. 54111.35 TYPES.H 文件................................................. 54211.36 UTSNAME.H 文件........................................... 54311.37 WAIT.H 文件................................................... 544第 12 章 库文件(LIB)............................................... 54712.1 概述 ............................................................... 54712.2 MAKEFILE 文件............................................... 54812.3 _EXIT.C 程序 ................................................... 55012.4 CLOSE.C 程序 .................................................. 55012.5 CTYPE.C 程序 .................................................. 55112.6 DUP.C 程序 ...................................................... 55212.7 ERRNO.C 程序.................................................. 55312.8 EXECVE.C 程序................................................ 55312.9 MALLOC.C 程序............................................... 55412.10 OPEN.C 程序.................................................. 56212.11 SETSID.C 程序................................................ 56312.12 STRING.C 程序 ............................................... 56412.13 WAIT.C 程序................................................... 56412.14 WRITE.C 程序 ................................................ 565第 13 章 建造工具(TOOLS) .................................... 56713.1 概述 ............................................................... 56713.2 BUILD.C 程序................................................... 567第 14 章 实验环境设置与使用方法 ........................ 57414.1 概述 ............................................................... 57414.2 BOCHS 仿真系统 ............................................ 57414.3 创建磁盘映象文件........................................ 57814.4 访问磁盘映象文件中的信息........................ 58114.5 制作根文件系统............................................ 58414.6 在 LINUX 0.11 系统上编译 0.11 内核........... 59014.7 在 REDHAT 9 系统下编译 LINUX 0.11 内核.. 59114.8 利用 BOCHS 调试内核 ................................... 594参考文献 .................................................................... 595附录 ............................................................................ 596附录 1 内核主要常数............................................ 596附录 2 内核数据结构............................................ 599附录 3 80X86 保护运行模式 ................................. 607附录 4 ASCII 码表 ................................................. 617索引 ............................................................................ 618
评论