读书笔记:Modern Operation System by Tanechum 01

Chapter 1

这里写图片描述

Personal computers exist not because millions of people have a centuries-old pent-up desire to own a computer, but because it is now possible to manufacture them cheaply. We often forget how much technology affects our view of systems and it is worth reflecting on this point from time to time.

That’s very cool insight.

这里写图片描述

了解当下被视为“过时(obsolete)”的想法并不是无用的,尽管在生物学中,过时的东西就会灭绝,但技术可以让过时的概念又重获新生。

这里写图片描述
The principal metric prefixes.

Summary

OS的角色

  • resource manager : 管理系统的各个部分,关键点:Multiplexing
    • Time Multiplexing : 决定谁来使用,使用多久
    • Space Multiplexing : 分配资源,比如分配内存使得多个程序并存
  • extended machine : 为用户提供抽象层次, 使得底层硬件(actual machine)使用起来更方便。
    • Abstraction:隐藏底层的复杂细节。(Managing complexity)

OS的基本概念

  • 进程
    • a program in execution
    • associateed with address space & a set of resources
    • a container that holds all the info needed to run a program
    • process table : 进程信息储存的表
    • alarm signal : OS发给进程的信号,让进程暂时停止工作,处理这个信号。
      • signal : the software analog of hardware interrupt
      • Address Space : the set of addresses a process can use
  • 内存管理
  • I/O管理
  • 文件系统
  • 安全

OS的本质

一个OS的功能的是由它所能使用的System Call决定的。
调用sys call的方式通常是与所使用的机器紧密相关的,而且通常要用汇编语言;
Procedure library的作用:让高级语言(C)能够调用sys call。
system call类似于调用函数,只不过system call有进入内核的特权。
调用System Call的过程:
1. 将参数压入到栈中
2. 实际地调用library procedure (汇编语言写就)
3. li.pro 将S.C.的号码放在与OS约定好的位置。
4. 执行一个TRAP指令切换到内核模式,内核代码根据SC的编号调用handler执行S.C.
5. 控制返回到li.pro.,再返回给User program
6. 清空栈

OS的分类

  • monolithic (DOS)
  • layered system
  • microkernel
  • client-server
  • virtual machine
  • exokernel

OS紧密联系的:计算机组成


  • 处理器
    • 各类register: stack pointer, PC, PSW…
    • CPU结构:pipeline, superscalar CPU
    • 模式
    • 超高速切换线程的hyperthreading CPU
  • I/O
    • 组成:controller(chip, physically ctrl) & device
      • controller : 提供更简单的接口让OS使用,自带寄存器(I/O port space)
    • device driver : 用来和controller交互的软件。在内核模式运行。
    • 操作:
    • busy waiting : CPU需要不断检查device是否完成了任务
    • interrupt : driver命令device完成任务时由controller发出一个信号。 CPU接受中断请求就会转入内核模式,根据device的编号在interrupt vector中寻找对应的handler处理,完毕就返回到user program。
    • DMA : CPU给DMA chip发任务,DMA chip做完了就产生interrupt
  • Booting the computer
    • BIOS 一个包含底层I/O软件的程序。
    • 工作原理:

1.check RAM and basic devices
2.determine the boot device (floppy, CD-ROM or disk)
3.read the first sector into memory and exec.
4.read the second sector, which contains a loader
5.the loader reads in OS and start it.
6.OS check device drivers for each device
7.OS initialize table, start program or GUI

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章