Chinaunix首页 | 论坛 | 博客
  • 博客访问: 412500
  • 博文数量: 65
  • 博客积分: 1491
  • 博客等级: 上尉
  • 技术积分: 702
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-30 15:57
文章分类
文章存档

2011年(6)

2010年(12)

2009年(47)

我的朋友

分类: LINUX

2009-08-21 16:21:04

Understanding the Linux Kernel : Chapter 1 Introduction

以下内容为本人的阅读笔记:

1.The 2.6 version of the Linux kernel aims to be compliant with the IEEE POSIX standard.

POSIX全称: Portable Operating System Interface for Unix.
POSIX是IEEE为Unix系统而设计的内核与应用程序的接口。很多Unix-like系统都兼容POSIX标准(如SVR4 和 4.4BSD)。 好处是:应用程序能够不依赖于系统内核而跨平台运行。

2.We often use the term "operating system" as a synonym for "kernel."

所谓的操作系统,就是指内核。

3.User Mode and Kernel Mode

(1)Some operating systems allow all user programs to directly play with the hardware components (a typical example is MS-DOS ). In contrast, a Unix-like operating system hides all low-level details concerning the physical organization of the computer from applications run by the user.
(2)User programs is forbidden to directly interact with low-level hardware components or to access arbitrary memory locations. In particular, the hardware introduces at least two different execution modes for the CPU: a nonprivileged mode for user programs and a privileged mode for the kernel. Unix calls these User Mode and Kernel Mode , respectively.
(3)Whenever a process makes a system call,the hardware changes the privilege mode from User Mode to Kernel Mode.
Unix-like系统下,应用程序只能跟操作系统打交道,无法直接操作硬件。
比如,无法直接存取RAM、读写DISK,而必须通过系统调用如:malloc, open/close...
进程通过系统调用进入Kernel Mode,也即通过操作系统操作硬件。

4.Hard and Soft Links
Hard Link:It is not possible to create hard links for directories.
Hard Link:Links can be created only among files included in the same filesystem.

Hard Link:创建一个副本,并与原文件两者内容保持同步(不能对目录做Hard Link)。
Soft Link:只相当于一个快捷方式。

5.Unix makes a clear distinction between the contents of a file and the information about a file.
All information needed by the filesystem to handle a file is included in a data structure called an inode. Each file has its own inode, which the filesystem uses to identify the file.

每个文件都有一个inode.

6.When a file is created by a process, its owner ID is the UID of the process. Its owner user group ID can be either the process group ID of the creator process or the user group ID of the parent directory, depending on the value of the sgid flag of the parent directory.

进程所创建文件的权限和UID/GID等信息都可以由进程控制。

7.As already mentioned, a CPU can run in either User Mode or Kernel Mode . Actually, some CPUs can have more than two execution states. For instance, the 80 x 86 microprocessors have four different execution states. But all standard Unix kernels use only Kernel Mode and User Mode.

80x86 CPU 有四个不同级别的状态,Unix内核只用到其中的Kernel Mode 和 User Mode.

8.The kernel itself is not a process but a process manager.The process/kernel model assumes that processes that require a kernel service use specific programming constructs called system calls .

内核不是一个进程,而是一个进程管理器.

9.Memory management is by far the most complex activity in a Unix kernel. More than a third of this book is dedicated just to describing how Linux handles memory management.

内存管理的重要性

阅读(1563) | 评论(0) | 转发(0) |
0

上一篇:QoS Quantum

下一篇:GPRS、CMNET、CMWAP

给主人留下些什么吧!~~