Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ch9 2device-driver-1.rst #237

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/chapter9/2device-driver-1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
串口驱动程序
------------------------------------

我们要管理是串口(UART)物理设备。我们在第一章其实就接触了串口,但当时是通过RustSBI来帮OS完成对串口的访问,即OS只需发出两种SBI调用请求就可以输出和获取字符了。但这种便捷性是有代价的。比如OS在调用获取字符的SBI调用请求后,RustSBI如果没收到串口字符,会返回 ``-1`` ,这样OS只能采用类似轮询的方式来继续查询。到第七章为止的串口驱动不支持中断是导致在多进程情况下,系统效率低下的主要原因之一。大家也不要遗憾,我们的第一阶段的目标是 **Just do it** ,先把OS做出来。在本节,我们需要逐步改进优化对串口的操作了。
我们要管理的是串口(UART)物理设备。我们在第一章其实就接触了串口,但当时是通过RustSBI来帮OS完成对串口的访问,即OS只需发出两种SBI调用请求就可以输出和获取字符了。但这种便捷性是有代价的。比如OS在调用获取字符的SBI调用请求后,RustSBI如果没收到串口字符,会返回 ``-1`` ,这样OS只能采用类似轮询的方式来继续查询。到第七章为止的串口驱动不支持中断是导致在多进程情况下,系统效率低下的主要原因之一。大家也不要遗憾,我们的第一阶段的目标是 **Just do it** ,先把OS做出来。在本节,我们需要逐步改进优化对串口的操作了。

.. image:: uart-drive.png
:align: center
Expand Down
Loading