Linux下使用c语言实现的内存管理模拟器 假设有台计算机物理内存大小为4MB,每个内存页大小为4k。采用分页机制,使用二级页表,第一级为页目录,共有1024项,每个页目录项指向一个页表,每个页表项指向一个实际的物理页面,每个页表共有1024个页表项。假设页目录和页表不占用内存空间。 系统中还有一个交换设备,采用分块管理机制,每块大小为4K,共1024个。有一系列内存访问指令,系统根据内存访问指令的内存虚地址访问内存。如果页目录项为空,则分配一个页表,并将相关值存入页目录项,如果页表项为空,则请求分配一个内存页,如果没有空闲内存,则使用页面置换算法换出一个内存页到交换设备上。如果页表项表明内存页在交换设备上,则先请求一个物理内存页,然后从交换设备上读入内存内容,释放交换设备上的磁盘块。-use Linux c language memory management simulator assumptions computers to the physical memory size 4 MB, each memory page size to 4k. Pagination mechanism, the use of two-page questionnaire, the first level of Contents page, a total of 1,024. each page directory entry point to a page table, each page table at an actual item of the physical pages, each page table pages of a total of 1,024 items table. Assuming page catalog and page table off memory space. There is also a system to exchange equipment, a sub-block management mechanism, each 4K block size, a total of 1,024. A series of memory access instructions, the system memory access instructions under the virtual memory address access memory. If the page directory entry is empty, one-page questionnaire distribution, and related value depo 下载
|
本书并不是特意一本Linux 的内部手册相反它是对操作系统的介绍同时以Linux作为示例书中每一章遵循从共性到特性的原则它们将首先给出核心子系统的概叙然后进行尽可能的详细描叙 我不会用routine_X()调用routine_Y()来增加bar 数据结构中foo 域的值这种方式来描叙核心算法 你自己可以通过阅读代码发现它每当需要理解一段代码时我总是将其数据结构画出来这样我发现了许多相关的核心数据结构以及它们之间的关系 每一章都是非常独立的就象Linux 核心子系统一样当然有时它们还是有联系的比如说如果你没有理解虚拟内存工作原理就无法描叙进程 硬件基本概念一章对现代PC 做了简要介绍操作系统必须与硬件系统紧密结合在一起协同工作操作系统需要一些只能够由硬件提供的服务为了全面理解Linux 你必须了解有关硬件的基础知识 软件基本概念一章介绍了软件基本原理与C 程序语言讨论了建立Linux 这样的操作系统的工具并且给出了操作系统的目标与功能的概叙 内存管理这章描叙了Linux 如何处理物理内存以及虚拟存储技术 进程管理描叙了进程的概念以及Linux 核心是如何创建管理与删除系统中的进程 进程间及进程与核心间通讯以协调它们的活动Linux 支持大量进程间通讯IPC -the book is not specifically a Linux internal manual Rather, it was the introduction of the operating system Linux simultaneously in each chapter of the book as an example to follow from the common characteristics of the principles is that they will be the first core subsystems of Syria will then proceed to the detailed depicts as possible, I will not use routine_X () call routine _Y () to increase the bar data structure foo domain of values in this manner, depicts the core algorithm you can read the code when it was found necessary to understand some code, I will always data structure drawn so I found many of the core data structure and the relationship between them each chapter very independent, just like the Linux kernel subsystem of course sometimes they like or linked, for instance if 下载
|