操作系统大内核和微内核_操作系统中的内核I / O子系统

操作系统大内核和微内核

内核输入/输出子系统 (Kernel Input / Output subsystem)

Input and output (I/O) devices permit us to communicate with the computer system. I/O is the transfer of data between RAM and various I/O peripherals. By using Input devices such as keyboards, mouse, card readers, scanners, voice recognition systems, and touch screens we can enter data into the computer. y using output devices such as monitors, printers, plotters, and speakers allow us to get information from the computer.

输入和输出(I / O)设备允许我们与计算机系统进行通信。 I / O是RAM和各种I / O外设之间的数据传输。 通过使用输入设备,例如键盘,鼠标,读卡器,扫描仪,语音识别系统和触摸屏,我们可以将数据输入计算机。 使用显示器,打印机,绘图仪和扬声器之类的输出设备可以使我们从计算机中获取信息。

These devices directly not connected with the CPU. But there is an interface that manages the data transfers between them. The system bus signals converted to and from a format that is acceptable to the given device by this interface. Communication between these external devices and processor is done via I/O registers.

这些设备直接未与CPU连接。 但是有一个接口可以管理它们之间的数据传输。 系统总线通过此接口将信号转换为给定设备可以接受的格式,或从该设备接受该格式。 这些外部设备和处理器之间的通信通过I / O寄存器完成。

The kernel provides many services related to I/O. Several services such as scheduling, caching, spooling, device reservation, and error handling – are provided by the kernel, and build on the hardware and device driver infrastructure.

内核提供了许多与I / O相关的服务。 内核提供了一些服务,例如调度,缓存,后台处理,设备保留和错误处理,这些服务建立在硬件和设备驱动程序基础结构上。

We will discuss kernel services such as I/O scheduling, Caching, Buffering, Spooling, Device Reservation, I/O Protection, and Error Handling.

我们将讨论内核服务,例如I / O调度,缓存,缓冲,假脱机,设备保留,I / O保护和错误处理。

1)排程 (1) Scheduling)

It means to determine a good order in which to execute input/output requests called disk scheduling.

这意味着确定执行输入/输出请求的良好顺序,称为磁盘调度。

Scheduling I/O requests can greatly improve overall efficiency. Priorities can also play a vital role in request scheduling and can reduce the average waiting time for I/O to complete.

安排I / O请求可以大大提高整体效率。 优先级还可以在请求调度中发挥至关重要的作用,并且可以减少I / O完成的平均等待时间。

By this device access, permissions will be fair to all jobs. When an application issues a blocking I/O system call, the request is placed on the job queue for that device. The order of the queue rearranges by the Kernel I/O scheduler to improve the overall system efficiency.

通过此设备访问,权限将对所有作业均公平。 当应用程序发出阻塞的I / O系统调用时,该请求将放置在该设备的作业队列上。 队列的顺序由内核I / O调度程序重新排列,以提高整体系统效率。

2)缓存 (2) Caching)

It involves keeping a copy of data in a faster access location than where the data is normally stored.

它涉及将数据副本保存在比通常存储数据的位置更快的访问位置。

For example, when you request a file by looking at a Web page are stored on your hard disk in a cache subdirectory under the directory for your browser. When you get back to a page you have recently visited, the browser can get those files from the cache rather than the original server, saving you time and saving the network the burden of additional traffic.

例如,当您通过查看网页来请求文件时,网页存储在您的硬盘上浏览器目录下的缓存子目录中。 当您返回到您最近访问过的页面时,浏览器可以从缓存而不是原始服务器中获取这些文件,从而节省了时间并减轻了网络额外流量的负担。

There is a difference between cache and buffer is cache is a duplicate copy of some other data stored elsewhere whereas buffer stores copy of an existing data item.

高速缓存与缓冲区之间的区别在于,高速缓存是存储在其他位置的某些其他数据的副本,而缓冲区则存储现有数据项的副本。

3)缓冲 (3) Buffering)

Buffer is a memory area maintains by Kernel I/O Subsystem that stores data while they are transferred between two devices or between a device with an application.

缓冲区是由内核I / O子系统维护的存储区,用于在两个设备之间或带有应用程序的设备之间传输数据时存储数据。

Buffering is done for three reasons.

进行缓冲有三个原因。

  1. One reason is to adapt to devices that have different data transfer sizes.

    原因之一是要适应具有不同数据传输大小的设备。

  2. A second use of buffering is to support copy semantics for an application I/O. An application wants to write data on disk which is stored in its buffer, it is called “copy semantic ”. it calls the write() system call, providing a pointer to the buffer and the integer specify the number of bytes to write.

    缓冲的第二个用途是支持应用程序I / O的复制语义。 一个应用程序想要在磁盘上写入存储在其缓冲区中的数据,这被称为“复制语义”。 它调用write()系统调用,提供指向缓冲区的指针,整数指定要写入的字节数。

  3. A third one is to cope with the speed mismatch between the producer and consumer of the data stream.

    第三个是应付数据流的生产者和消费者之间的速度不匹配。

4)假脱机 (4) Spooling)

A spool is a type of buffer that holds output for a device. It is the process in which jobs from the cards are read directly onto the disk and the location of that card in the disk is recorded in a table by the operating system. When that job is required for execution, it is read from the disk.

假脱机是一种缓冲区,用于保存设备的输出。 在此过程中,卡中的作业被直接读取到磁盘上,操作系统将该卡在磁盘中的位置记录在表中。 当需要执行该作业时,将从磁盘读取该作业。

For example, several applications may wish to print their output concurrently, so spooling solves this problem by maintaining a queue for the output. A printer does not accept interleaved data. The output of all application is spooled in a separate disk file. When an application finishes printing then the spooling system queues the corresponding spool file for output to the printer.

例如,几个应用程序可能希望同时打印其输出,因此假脱机通过为输出保留队列来解决此问题。 打印机不接受交错数据。 所有应用程序的输出都后台处理在单独的磁盘文件中。 当应用程序完成打印时,假脱机系统会将相应的假脱机文件排队,以输出到打印机。

5)设备预约 (5) Device Reservation)

It provides exclusive device access. Allocation of devices when required by the processes and that device when it is no longer needed. It prevents deadlock. Many operating systems provide features that enable processes to coordinate and give exclusive access to them.

它提供独占的设备访问权限。 在流程需要时分配设备,在不再需要时分配设备。 它可以防止死锁。 许多操作系统提供的功能使进程能够进行协调并为其提供独占访问权。

6)I / O保护 (6) I/O Protection)

I/O must be performed via system calls. User processes may accidentally or purposefully attempt to disrupt normal operation via illegal I/O instructions. To prevent a user from do all I/O instructions defined to be privileged.

I / O必须通过系统调用执行。 用户进程可能会通过非法的I / O指令意外或有意地破坏正常操作。 为了防止用户执行所有定义为特权的I / O指令。

7)错误处理 (7) Error Handling)

An operating system that uses protected memory that can guard against many kinds of hardware and application errors. Devices and I/O transfers may fail in some manner, either for transient reasons, as when a network becomes overloaded or for permanent reasons, as when a disk controller becomes defective.

一个使用受保护的内存的操作系统,可以防止多种硬件和应用程序错误。 设备和I / O传输可能会以某种方式失败,可能是由于暂时原因(例如网络过载时),也可能是由于永久性原因(例如磁盘控制器出现故障)。

翻译自: https://www.includehelp.com/operating-systems/kernel-io-subsystem.aspx

操作系统大内核和微内核

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/546167.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

StackOverflow 上面最流行的 7 个 Java 问题!

StackOverflow发展到目前,已经成为了全球开发者的金矿。它能够帮助我们找到在各个领域遇到的问题的最有用的解决方案,同时我们也会从中学习到很多新的东西。这篇文章是在我们审阅了StackOverflow上最流行的Java问题以及答案后从中挑出来的。即使你是一个…

UbuntuKylin安装SUN JDK1.7

1.下载jdk1.7.0_67并且解压,放知道/usr/local/lib/jvm目录下tar zxvf jdk1.7.0_67.tar.gzsudo mv jdk1.7.0_67 /usr/local/lib/jvm2.编辑~/.bashrc文件,添加如下内容。JAVA_HOME后的内容为你自定义的JDK存放目录export JAVA_HOME/usr/local/lib/jvm/jdk1…

程序设计竞赛资源索引

如果想提高编程能力,最重要的就是多练多学,现在网络上提供了大量的习题库,可以很方便的练习编程。 ACM/ICPC题库(支持c,c,java,pascal): 台州学院acm :有不少习题使用中文描述,分类清晰,适合初学者。题目…

c++ stl stack_C ++ STL中的stack :: push()函数

c stl stackPrototype: 原型&#xff1a; stackst; //declarationst.push(T item);Parameter: 参数&#xff1a; T item; //T is the data typeReturn type: void 返回类型&#xff1a; void Header file to be included: 包含的头文件&#xff1a; #include <iostream&…

if快还是switch快?解密switch背后的秘密

这是我的第 57 篇原创文章条件判断语句是程序的重要组成部分&#xff0c;也是系统业务逻辑的控制手段。重要程度和使用频率更是首屈一指&#xff0c;那我们要如何选择 if 还是 switch 呢&#xff1f;他们的性能差别有多大&#xff1f;switch 性能背后的秘密是什么&#xff1f;接…

MySQL replace into (insert into 的增强版)

在使用SQL语句进行数据表插入insert操作时&#xff0c;如果表中定义了主键&#xff0c;插入具有相同主键的记录会报错&#xff1a; Error Code: 1062. Duplicate entry XXXXX for key PRIMARY(主键冲突) 这样我们只好检查主键是不是存在&#xff0c;若存在则更新&#xff0c;若…

最大连续子序列和问题

问题描述&#xff1a;给定一个序列a[1],a[2]...a[n]&#xff0c;求解其连续子序列中元素和的最大值 例如&#xff1a; 6 -1 5 4 -7 这个序列最大连续子序列和为14 具体问题见&#xff1a; [urlhttp://acm.hdu.edu.cn/showproblem.php?pid1003]HDOJ 1003[/url] [urlhttp://acm.…

js 数组添加n次相同元素_数组中两次出现相同元素之间的最大距离

js 数组添加n次相同元素Prerequisite: Hashing data structure 先决条件&#xff1a; 哈希数据结构 Problem statement: 问题陈述&#xff1a; Find maximum distance between two occurrences of same element in the array. 查找两次出现的相同元素在数组中的最大距离。 E…

一道题决定去留:为什么synchronized无法禁止指令重排,却能保证有序性?

前几天有一位读者找我问一个问题&#xff0c;说是这道题可能影响了他接下来3年的技术成长。据说这位读者前面的很多问题会的都还可以&#xff0c;属于那种可过可不过的类型的&#xff0c;面试官出了最后一道题&#xff0c;就是回答的满意就可以给Offer&#xff0c;回答的不好就…

haskell程序设计语言

根据[urlhttp://www.haskell.org/haskellwiki/Haskell]haskell[/url]的[urlhttp://www.haskell.org/haskellwiki/Introduction]官方定义[/url]&#xff0c;haskell是polymorphically(多态&#xff09; statically typed静态类型&#xff09;, lazy&#xff08;懒计算&#xff0…

【Android开发】之Fragment与Acitvity通信

上一篇我们讲到与Fragment有关的常用函数&#xff0c;既然Fragment被称为是“小Activity”&#xff0c;现在我们来讲一下Fragment如何与Acitivity通信。如果上一篇还有不懂得&#xff0c;可以再看一下。传送门。 Fragment与Activity通信的方式如下&#xff1a; 一、通过初始化函…

next和hasnext_使用Java中的next()和hasNext()方法遍历List元素

next和hasnextGiven a List of integers and we have to traverse, print all its element using next() and hasNext() methods. 给定一个整数列表&#xff0c;我们必须遍历&#xff0c;使用next()和hasNext()方法打印其所有元素。 什么是hasNex()和next()方法&#xff1f; (…

「递归」的正确打开方式,看不懂你打我~

这是磊哥的第 189 期分享作者 | 田小齐来源 | 码农田小齐&#xff08;ID&#xff1a;NYCSDE&#xff09; 分享 | Java中文社群&#xff08;ID&#xff1a;javacn666&#xff09;前言 递归&#xff0c;是一个非常重要的概念&#xff0c;也是面试中非常喜欢考的。因为它不但能考察…

Log4cpp 使用手册

参考资料&#xff1a; log4cpp 配置 与 使用http://www.cnblogs.com/welkinwalker/archive/2011/06/23/2088197.html 便利的开发工具-log4cpp快速使用指南 http://www.ibm.com/developerworks/cn/linux/l-log4cpp/ Log4cpp配置文件格式说明 http://sogo6.iteye.com/blog/115431…

适合初学编程的一些项目

学习了一门语言以及数据结构之后&#xff0c;通常需要做一些项目来巩固所学的知识&#xff0c;我感觉最好是用写一些简单的小工具或者小游戏&#xff0c;能够提高自己的编程能力&#xff0c;也能进一步提高自己学习的兴趣。最好的是将自己想做的事情用程序的实现&#xff0c;比…

python 5的倍数_查找所有低于1000的数字的和,这是Python中3或5的倍数

python 5的倍数Sometimes, we need to find the sum of all integers or numbers that are completely divisible by 3 and 5 up to thousands, since thousands are a too large number that’s why it becomes difficult for us. So, here we will do it in Python programmi…

switch 的性能提升了 3 倍,我只用了这一招!

这是我的第 190 期分享作者 | 王磊来源 | Java中文社群&#xff08;ID&#xff1a;javacn666&#xff09; 分享 | Java中文社群&#xff08;ID&#xff1a;javacn666&#xff09;上一篇《if快还是switch快&#xff1f;解密switch背后的秘密》我们测试了 if 和 switch 的性能&am…

HashMap get不出对象时出错 解决

为什么80%的码农都做不了架构师&#xff1f;>>> 如题&#xff1a; Map map new HashMap(); map.put("1", "A"); map.put("2", "A"); map.put("3", "A"); map.put("4", "A")…

安装codeblocks和wxwidgets及opencv

codeblocks 是一款开放源代码的跨平台的c/c++集成开发环境,它是用wxwidgets 开发的,并且支持插件,功能很强大。可以用来在windows开发各种程序。下面记录一下我安装该软件的过程: 首先到http://www.codeblocks.org/downloads 下载该软件,选择含mingw的文件(codeblocks-10…

Java LinkedList boolean addAll(int index,Collection c)方法,带有示例

LinkedList boolean addAll(int index&#xff0c;Collection c)方法 (LinkedList boolean addAll(int index, Collection c) method) This method is available in package java.util.Collection and here, Collection is an interface. 该方法在java.util.Collection包中可用…