美文网首页
软件在“洞”里(五) —— 读《计算思维史话》(十二)

软件在“洞”里(五) —— 读《计算思维史话》(十二)

作者: 刘东利2020 | 来源:发表于2023-06-07 09:00 被阅读0次

    操作系统的作用:

    Device drivers and interrupts

    Job scheduling

    Hardware interrupts

    System calls

    File management

    Virtual memory

    什么是驱动?

    The key to making this possible with all the multitude of different devices we have today is to hide all the intri�cate details of a particular device behind a standard piece of software called a device driver, a program that operates a particular type of device attached to the computer.

    一般来说,驱动不被认为是操作系统的一部分,但是操作系统要处理中断,什么是中断?最开始是响应设备的信号 —— 驱动要访问内存:

    The interface of a device driver with the computer needs to be care�fully specified because many devices need to access specific memory locations.

    They also must generate and respond to control signals called interrupts, indica�tions that some event happening in the computer needs immediate attention.

    为了提升CPU的利用效率,有了调度 —— 和工厂一样:

    If one program has to wait for some input, another program could start run�ning. The operating system must have the capability of sending a waiting pro�gram to “sleep” and then waking it up again with an interrupt when its input has arrived and it is ready to proceed.

    后来才有了硬件中断:

    Because the oper�ating system is also a program and the CPU can only run one program at a time, how can the operating system hand the CPU over to one process and then get back control of the CPU so it can schedule another process? This is done by a different type of interrupt, one that switches not between a pro�cess and the operating system but between the actual computer hardware and the operating system. It is called a hardware interrupt. Such an interrupt happens when some event like a keyboard entry or mouse movement occurs.

    而为了保证一般用户的使用不会带来计算机的问题 —— 类似于过去的Operator:

    The operating system ensures the safety of the entire com�puter system through a set of special-purpose functions called system calls.

    其中的文件管理是一类特殊的系统调用:

    One special class of system calls has come to symbolize the entire operat�ing system.

    为了实现以上目的,需要有虚拟内存 —— 将其他存储硬件虚拟为内存。

    相关文章

      网友评论

          本文标题:软件在“洞”里(五) —— 读《计算思维史话》(十二)

          本文链接:https://www.haomeiwen.com/subject/hfngedtx.html