diff --git a/report/2_research/research-report.tex b/report/2_research/research-report.tex index ef41b65..58477f8 100644 --- a/report/2_research/research-report.tex +++ b/report/2_research/research-report.tex @@ -31,7 +31,7 @@ \tableofcontents \section{项目简介} -Runikraft 是用Rust语言编写的能在RISC-V架构 + QEMU平台上运行unikernel。 +Runikraft 是用Rust语言编写的能在RISC-V架构 + QEMU平台上运行的unikernel。 它基于用C语言实现的Unikraft,在继承Unikraft的高效性和可定制性的同时, 进一步简化了构建系统镜像的流程,加入了RISC-V支持,并且 用Rust语言提供了更强的内核安全保证。 @@ -43,7 +43,7 @@ \subsection{操作系统的架构} 随着操作系统的 发展,分层系统出现了,这种系统被分割成若干层,最低层为硬件层,最高层为用户 -层,每一层都在较低层基础上实现,并为较高层提供一组能调用的程序集。分层系统 +层,每一层都在较低层的基础上实现,并为较高层提供一组能调用的程序集。分层系统 简化了构建和调试系统的难度,并且有助于局部优化系统。 然而合理地定义各层并不容易,有时低层组件可能需要 高层组件提供的服务;而且分层会导致用户层执行的操作需要多次转发才能映射到硬件 @@ -76,7 +76,7 @@ \subsection{虚拟化} 在1960s,大型机的运算速度已经远超过了人类的操作速度。为了 充分利用大型机的算力,一台大型机配置了多个终端,多个用户可以同时通过终端与大型机交互, 多个用户的程序轮转使用CPU时间。由于轮转速度很快,用户无法感受到自己的程序没有连续运行, -所以在每个用户看来,他都拥有一台计算机。这种运行在大型机上的分时系统是最初的虚拟化。 +所以在每个用户看来,他似乎拥有一台独立的计算机。这种运行在大型机上的分时系统是最初的虚拟化。 然而,随着个人计算机的发展,这种基于分时系统的虚拟化逐渐没落。虚拟化的再次兴起 得益于互联网技术的发展和云计算的兴起,在云计算中,用户通过网络操作远程的虚拟机, 这些远程虚拟机可以向外界提供网络服务。 @@ -104,7 +104,7 @@ \subsubsection{容器}\sectionauthor{蓝俊玮} 以Docker为代表的传统容器是为了便捷地打包程序及其依赖诞生的,而并不强调隔离性。 传统容器使用 Namespace/Cgroup 实现,这套容器技术实际上是从进程调度的角度入手, 对内核进行的功能扩展。优势上来说,操作界面很 Linux、很方便,开销也很低, -可以被用来无负担地套在已有应用外面来构建隔离的环境。并且它是纯软件方案, +可以被用来无负担地套在已有应用外面,来构建隔离的环境。并且它是纯软件方案, 不和其他层面的物理机、虚拟机相冲突。然而, 随着容器技术的不断发展,传统容器隔离性不足的缺陷逐渐暴露了出来。 Namespace/Cgroup 是内核的一个部分,其中运行的容器仍然使用主机的 Linux 内核, @@ -169,7 +169,7 @@ \subsection{Unikernels面临的问题} 移植目前常用的库。此外,unikernels镜像的构建不应该过于繁琐。 \subsection{知名的Unikernels}\label{subsec:famous-unikernel-projects} -下面简要介绍我们详细调研了的七个近两年仍然在维护unikernels。 +下面简要介绍我们详细调研了的七个近两年仍然在维护的unikernels。 \subsubsection{ClickOS}\sectionauthor{蓝俊玮} @@ -195,7 +195,7 @@ \subsubsection{ClickOS}\sectionauthor{蓝俊玮} \subsubsection{MirageOS}\sectionauthor{蓝俊玮} MirageOS 是一个用 OCaml 语言编写的, -用于在各种云计算和移动平台构建安全、高性能网络应用程序的库操作系统。 +用于在各种云计算和移动平台构建安全、高性能的网络应用程序的库操作系统。 它可以将大型服务器划分为很多更小的虚拟机,使得服务器具有更强的拓展性和安全性。 其代码可以在 Linux 、Mac OS 等系统中开发,然后编译成一个完全独立的、专门的内核, 可以在 Xen、KVM hypervisors 或轻量级 hypervisors 下运行。MirageOS @@ -216,8 +216,8 @@ \subsubsection{MirageOS}\sectionauthor{蓝俊玮} MirageOS的亮点是输入应用程序的所有源代码依赖项都被显式跟踪,包括实现内 核功能所需的所有库。MirageOS 包括一个构建系统,该系统内部使用 -一个 SAT 解算器(使用 OPAM 包管理器,使用 Mancoosi 项目的解算器) -从一个已发布的在线包集中搜索兼容的模块实现。由于 OCaml 的静态类型 +一个 SAT 解算器(使用 OPAM 包管理器,使用 Mancoosi 项目的解算器) +从一个已发布的在线包集中搜索兼容的模块实现。得益于 OCaml 的静态类型 检查,在编译时将捕获接口中的任何不匹配。 在 MirageOS 中,OCaml 编译器接收整个内核代码的源代码, @@ -231,8 +231,8 @@ \subsubsection{IncludeOS}\sectionauthor{蓝俊玮} 当 IncludeOS 映像引导时,它通过设置内存、运行全局构造函数、注册驱动程序和中断处理 程序来初始化操作系统。IncludeOS 不支持虚拟内存,应用程序和 - unikernel 库使用单个地址空间。因此,没有系统调用或用户空间的概念; 所有操作系统服务 - 都通过对库的简单函数调用来调用,并且都以特权模式运行。\cite{bib:10-includeos2} +unikernel 库使用单个地址空间。因此,没有系统调用或用户空间的概念; 所有操作系统服务 +都通过对库函数的简单调用使用,并且都以特权模式运行。\cite{bib:10-includeos2} \noindent IncludeOS 有如下优点:\cite{bib:9-includeos} \begin{itemize} @@ -240,12 +240,12 @@ \subsubsection{IncludeOS}\sectionauthor{蓝俊玮} 只要机器本身是可预测的,延迟也将是完全可预测的。因此,在裸机硬件上, IncludeOS可被视为低延迟,可预测的操作系统。 \item 对网络的支持很好,与 Linux 相比表现出色。 -\item IncludeOS 系统作为一个整体进行编译和优化。在编译器和连接器阶段, +\item IncludeOS 系统作为一个整体进行编译和优化。在编译和连接阶段, 优化器可以更多地了解整个系统正在做什么,并且有可能进一步优化。 \item IncludeOS 中的所有 IRQ 处理程序简单地(原子地)更新计数器, 并在有时间时将进一步的处理推迟到主事件循环。这消除了对上下文切换的需要, 同时也消除了与并发相关的问题,如竞争条件。 -通过使所有 I/O 都是异步的,CPU 保持忙碌,这样就不会发生阻塞。 +IncludeOS的所有 I/O 都是异步的,CPU 保持忙碌,不会发生阻塞。 \end{itemize} \noindent IncludeOS 有如下缺点:\cite{bib:9-includeos} @@ -258,19 +258,20 @@ \subsubsection{IncludeOS}\sectionauthor{蓝俊玮} \subsubsection{RustyHermit}\sectionauthor{陈建绿} -RustyHermit(\href{https://github.com/hermitcore/rusty-hermit}{Github}) 是 +\href{https://github.com/hermitcore/rusty-hermit}{RustyHermit}\ 是 一个基于 Rust 的、轻量级的 Unikernel,也是一个用来评估操作系统新的设计的研究项目。 它用 Rust 语言完全改写了 RWTH Aachen University - 开发的研究项目 \href{http://hermitcore.org/}{HermitCore}\footnote{HermitCore 最初是用 C 语言编写的,是一种针对高性能和云计算的可伸缩和可预测的运行时的 Unikernel。}。\cite{bib:14-rusty-hermit} +开发的研究项目 \href{http://hermitcore.org/}{HermitCore}\footnote{HermitCore 最初是用 C 语言编写的, +是一种针对高性能和云计算的可伸缩和可预测的运行时的 Unikernel。}。\cite{bib:14-rusty-hermit} 该项目完全使用 Rust 语言开发,Rust 的所有权模型保证了它的内存/线程安全, -并且让开发者能够在编译时就消除许多种 bug。因此,与通用编程语言相比,使用 Rust - 进行内核开发会留下更少的漏洞,得到更加安全的内核。 +并且让开发者能够在编译时就消除许多种 bugs。因此,与通用编程语言相比,使用 Rust +进行内核开发会留下更少的漏洞,得到更加安全的内核。 开发者扩展了 Rust 工具链以至于 RustyHermit 的 build 过程 与 Rust 通常的工作流程相似。使用 Rust runtime 而且不直接使用 OS 服务的 - Rust 应用程序能够直接在 RustyHermit 上运行而不需要修改。因此,原则上, - 每一个现有的 Rust 应用程序都可以建立在 RustyHermit 之上。\cite{bib:17-rusty-hermit2} +Rust 应用程序能够直接在 RustyHermit 上运行而不需要修改。因此,原则上, +每一个现有的 Rust 应用程序都可以建立在 RustyHermit 之上。\cite{bib:17-rusty-hermit2} RustyHermit 中优化实现了网络栈。它使用 \href{https://github.com/smoltcp-rs/smoltcp}{smoltcp} @@ -291,7 +292,7 @@ \subsubsection{RustyHermit}\sectionauthor{陈建绿} 包括安全内核代码与不安全内核代码之间的隔离、内核代码与用户代码之间的隔离。 在一组宏基准测试中,带有隔离功能的 unikernel 仅减慢了0.6\%。 -这篇论文中的内容可以作为我们实现 runikraft 的参考。 +%这篇论文中的内容可以作为我们实现 runikraft 的参考。 \subsubsection{Rumprun}\sectionauthor{陈建绿} @@ -305,7 +306,7 @@ \subsubsection{Rumprun}\sectionauthor{陈建绿} Rumprun unikernel 支持用 C、 C++ 、 Erlang、 Go、 Java、 Javascript (node.js)、 Python、 Ruby 和 Rust 等语言编写的应用程序。 -在 \href{https://github.com/rumpkernel/rumprun-packages}{rumprun-packages repository} +在\ \href{https://github.com/rumpkernel/rumprun-packages}{rumprun-packages repository}\ 中可以找到用于 Rumprun 的现成软件包,比如 \texttt{LevelDB}, \texttt{Memcached}, \texttt{nanomsg}, \texttt{Nginx} 和 \texttt{Redis}。 @@ -373,15 +374,15 @@ \subsubsection{Rumprun}\sectionauthor{陈建绿} \subsubsection{Nanos}\sectionauthor{陈建绿} -\href{https://github.com/nanovms/nanos}{Nanos(Github)}一个比较新的正在开发中的 Unikernel。 +\href{https://github.com/nanovms/nanos}{Nanos}\ 一个比较新的正在开发中的 Unikernel。 \begin{itemize} -\item Nanos 是一个新的内核,旨在虚拟化环境中运行一个且仅有一个应用程序。 +\item Nanos 是一个新的内核,旨在在虚拟化环境中运行一个且仅有一个应用程序。 与 Windows 或 Linux 等通用操作系统相比,它有几个限制——即它是一个单进程系统, 不支持运行多个程序,也不具备通过 ssh 进行用户或远程管理的概念。 \item Nanos 的目标是成为一个比 Linux 安全得多的系统。 它做到这一点的几个依赖:没有用户的概念,每个虚拟机只运行一个进程,限制每个虚拟机中包含的代码数量。 -\item Nanos 并不打算在裸金属上运行,所以开发者努力使其内核\textit{尽可能简单}。 +\item Nanos 并不打算在裸金属上运行,所以开发者努力使其内核尽可能简单。 \end{itemize} %这也许会对我们的项目有所帮助。 @@ -389,7 +390,7 @@ \subsubsection{Nanos}\sectionauthor{陈建绿} \subsubsection{Unikraft}\sectionauthor{张子辰} Unikraft是一个比较新的unikernel。它在设计时就充分考虑 了现有的unikernels的优缺点。它在保持unikernel的极简化、 -高效的同时,兼容了完整的POSIX兼容层,使开发者可以轻松地将现有的为Linux +高效的同时,引入了完整的POSIX兼容层,使开发者可以轻松地将现有的为Linux 编写的代码移植到unikernel上。Unikraft由若干低耦合的模块组成,内存分配器、 调度器、网络栈、引导代码都是独立的微型库。Unikraft的API即为微型库本身, 这意味着可以在生成时轻松地添加或移除APIs。\cite{bib:unikraft} @@ -443,7 +444,7 @@ \subsubsection{Unikraft}\sectionauthor{张子辰} 类似地,数据库这样的硬盘密集型程序可以使用标准的\texttt{vfscore}微型库(③), 或者用\texttt{ukblock} API提高吞吐量(⑧)。 -调度器也是可以插拔的(④),而且每个CPU核可以运行不同的调度器。 +调度器也是可插拔的(④),而且每个CPU核可以运行不同的调度器。 与其他unikernels相比,Unikraft的系统镜像更小、运行所需内存更小、吞吐量更大: @@ -514,7 +515,7 @@ \subsubsection{比较}\sectionauthor{张子辰} &ClickOS&\resizebox{\linewidth}{\height}{MirageOS}&\resizebox{\linewidth}{\height}{IncludeOS}&\resizebox{\linewidth}{\height}{RustyHermit}&Nanos&Rumprun&Unikraft\\\hline \endhead 实现语言&C++&OCaml&C++&Rust&C&C&C\\\hline -支持架构&x86-32、x86-64&x86-64、ARM-64&x86-32、x86-64、ARM-64&x86-64、ARM-64&x86-64、ARM-64、RISCV-64gc&x86-32、x86-64、ARM-64&x86-64、ARM-32、ARM-64\\\hline +支持架构&x86-32、x86-64&x86-64、ARM-64&x86-32、x86-64、ARM-64&x86-64、ARM-64&x86-64、ARM-64、RISCV-64&x86-32、x86-64、ARM-64&x86-64、ARM-32、ARM-64\\\hline 支持平台&Xen&KVM、Xen&KVM、Virtual Box、VMWare、x86物理机&QEMU、Uhyve&众多,包括但不限于Xen、KVM、VMWare、Virtual Box等&Xen、嵌入式设备&KVM、Xen、Solo5、Linux用户态\\\hline 支持语言&C、C++&OCaml&C、C++&Rust、C、C++、Go、Fortran&众多,包括但不限于C、Go、PHP、Node、Ruby、Lua、Perl等,理论上支持任何ELF文件&众多,包括但不限于C、C++、Erlang、Go、Java、Javascript (node.js)、Python、Ruby 、Rust等&众多,包括但不限于C、C++、Go、Python、Ruby、Web Assembly、Lua等\\\hline 构建系统&Click configuration language&Opam&Conan、CMake&cargo、CMake&系统与用户程序分别构建,系统使用Makefile构建&buildrump&Kraft、Kconfig\\\hline @@ -676,7 +677,7 @@ \subsection{模块化设计}\sectionauthor{张子辰} 的问题。系统缺乏明确的功能组件,所以系统必须作为一个整体维护。 在Runikraft中,只有极少数平台层的代码被放到了系统的核心组件中,而调度器、 -分配器等组件一律是micro-libraies。这些micro-libraires遵循一套明确 +分配器等组件一律是micro-libraries。这些micro-libraries遵循一套明确 定义的APIs,同一个系统模块可以有多种实现,用户可以轻松为自己的需求选择合适的系统组件的实现。 %Rust语言中的trait非常适合这种接口与实现分离的设计。 从Unikraft给出 diff --git a/report/3_feasibility/feasibility-report.bib b/report/3_feasibility/feasibility-report.bib index 2b7f91f..1d0aad8 100644 --- a/report/3_feasibility/feasibility-report.bib +++ b/report/3_feasibility/feasibility-report.bib @@ -9,30 +9,49 @@ @online{0 organization, date, month, year, addendum, pubstate, urldate @online{1, title = {QEMU}, - url = {https://wiki.qemu.org/Main_Page} + url = {https://wiki.qemu.org/index.php?title=Main_Page&oldid=9546}, + year={2020}, + month={Jul.}, + date={9} } % Optional fields: subtitle, titleaddon, language, version, note, organization, date, month, year, addendum, pubstate, urldate @online{2, title = {RISC-V开源指令集架构简介与应用前景分析}, - url = {http://www.scensmart.com/news/the-introduction-of-risc-v-and-application-prospect-analysis/} + url = {http://www.scensmart.com/news/the-introduction-of-risc-v-and-application-prospect-analysis/}, + year={2019}, + month={Nov.}, + date={2} } % Optional fields: subtitle, titleaddon, language, version, note, organization, date, month, year, addendum, pubstate, urldate @online{3, title = {故事:Rust在企业领域的应用}, - url= {https://zhuanlan.zhihu.com/p/61410107} + url= {https://zhuanlan.zhihu.com/p/61410107}, + author={张汉东}, + year={2019}, + month={Apr.}, + date={4} } -@online{5, - title = {Release V1.0.0}, - url = {https://github.com/riscv-non-isa/riscv-sbi-doc/releases/tag/v1.0.0} +@manual{5, + author = "{RISC-V Platform Specification Task Group}", + title = {RISC-V Supervisor Binary Interface Specification}, + date = {22}, + year={2022}, + month={Mar.}, + edition = {1.0.0}, + url = {https://github.com/riscv-non-isa/riscv-sbi-doc/releases/tag/v1.0.0}, } + % Optional fields: subtitle, titleaddon, language, version, note, organization, date, month, year, addendum, pubstate, urldate @online{6, - title = {Release OpenSBI Version 1.0}, - url = {https://github.com/riscv-software-src/opensbi/releases/tag/v1.0} + title = {OpenSBI Version 1.0}, + url = {https://github.com/riscv-software-src/opensbi/releases/tag/v1.0}, + year = {2021}, + month = {Dec.}, + date = {24}, } @book{7, author = {Steve Klabink}, @@ -41,140 +60,70 @@ @book{7 publisher = {The Rust Community}, } @online{8, - ALTauthor = {author}, - ALTeditor = {editor}, - title = {Rust Magazine 2021}, - date = {date}, + author = {肖猛}, + editor = {高宪凤}, + title = {图解 Rust 所有权与生命周期}, + year={2021}, url = {https://rustmagazine.github.io/rust_magazine_2021/chapter_1/rust_ownership.html}, - OPTsubtitle = {subtitle}, - OPTtitleaddon = {titleaddon}, - OPTlanguage = {language}, - OPTversion = {version}, - OPTnote = {note}, - OPTorganization = {organization}, - OPTdate = {date}, - OPTmonth = {month}, - OPTyear = {year}, - OPTaddendum = {addendum}, - OPTpubstate = {pubstate}, - OPTurldate = {urldate}, } @online{9, - ALTauthor = {author}, - ALTeditor = {editor}, + author = {hardsinging}, title = {Rust线程安全编程分析}, - date = {date}, + date = {12}, + month={Mar.}, + year={2022}, url = {https://zhuanlan.zhihu.com/p/138394529}, - OPTsubtitle = {subtitle}, - OPTtitleaddon = {titleaddon}, - OPTlanguage = {language}, - OPTversion = {version}, - OPTnote = {note}, - OPTorganization = {organization}, - OPTdate = {date}, - OPTmonth = {month}, - OPTyear = {year}, - OPTaddendum = {addendum}, - OPTpubstate = {pubstate}, - OPTurldate = {urldate}, } @online{a, - ALTauthor = {author}, - ALTeditor = {editor}, + author = {尹天宇}, title = {RISC-V特权等级与Linux内核的启动}, - date = {date}, + year = {2020}, + month = {Aug.}, + date = {23}, url = {https://zhuanlan.zhihu.com/p/164394603}, - OPTsubtitle = {subtitle}, - OPTtitleaddon = {titleaddon}, - OPTlanguage = {language}, - OPTversion = {version}, - OPTnote = {note}, - OPTorganization = {organization}, - OPTdate = {date}, - OPTmonth = {month}, - OPTyear = {year}, - OPTaddendum = {addendum}, - OPTpubstate = {pubstate}, - OPTurldate = {urldate}, } @online{b, - ALTauthor = {author}, - ALTeditor = {editor}, + author = "{辣椒油li}", title = {RISC-V基本介绍}, - date = {date}, + year = {2022}, + month = {Jan.}, + date = {22}, url = {https://blog.csdn.net/lijianyi0219/article/details/122634356}, - OPTsubtitle = {subtitle}, - OPTtitleaddon = {titleaddon}, - OPTlanguage = {language}, - OPTversion = {version}, - OPTnote = {note}, - OPTorganization = {organization}, - OPTdate = {date}, - OPTmonth = {month}, - OPTyear = {year}, - OPTaddendum = {addendum}, - OPTpubstate = {pubstate}, - OPTurldate = {urldate}, } @online{c, - ALTauthor = {author}, - ALTeditor = {editor}, + author = {orangeQWJ}, title = {RISC-V 特权指令结构}, - date = {date}, + year = {2022}, + month = {Feb.}, + date = {19}, url = {https://www.cnblogs.com/orangeQWJ/p/15912780.html}, - OPTsubtitle = {subtitle}, - OPTtitleaddon = {titleaddon}, - OPTlanguage = {language}, - OPTversion = {version}, - OPTnote = {note}, - OPTorganization = {organization}, - OPTdate = {date}, - OPTmonth = {month}, - OPTyear = {year}, - OPTaddendum = {addendum}, - OPTpubstate = {pubstate}, - OPTurldate = {urldate}, } @online{d, - ALTauthor = {author}, - ALTeditor = {editor}, + author = "{shawn}", title = {闲聊RISC-V虚拟化(1)-CPU虚拟化}, - date = {date}, + year = {2021}, + month = {Sep.}, + date = {8}, url = {https://zhuanlan.zhihu.com/p/408197895}, - OPTsubtitle = {subtitle}, - OPTtitleaddon = {titleaddon}, - OPTlanguage = {language}, - OPTversion = {version}, - OPTnote = {note}, - OPTorganization = {organization}, - OPTdate = {date}, - OPTmonth = {month}, - OPTyear = {year}, - OPTaddendum = {addendum}, - OPTpubstate = {pubstate}, - OPTurldate = {urldate}, } @online{e, - ALTauthor = {author}, - ALTeditor = {editor}, - title = {x-rust-freertos/feasibility.md at master}, - date = {date}, + author = {樊金昊 and 左顺 and 宁雨亭 and 黄业琦 and 张俸铭 and 雷思琦}, + title = {可行性报告}, + year = {2019}, + month = {Apr.}, + date = {9}, url = {https://github.com/OSH-2019/x-rust-freertos/blob/master/docs/feasibility.md}, - OPTsubtitle = {subtitle}, - OPTtitleaddon = {titleaddon}, - OPTlanguage = {language}, - OPTversion = {version}, - OPTnote = {note}, - OPTorganization = {organization}, - OPTdate = {date}, - OPTmonth = {month}, - OPTyear = {year}, - OPTaddendum = {addendum}, - OPTpubstate = {pubstate}, - OPTurldate = {urldate}, } @online{qemu-virt, title={`virt' Generic Virtual Platform (virt)}, url = {https://www.qemu.org/docs/master/system/riscv/virt.html}, + year={2022} +} +@online{qemu7, + title={QEMU 7.0 Released with KVM Support for RISC-V, ARM and OpenRISC Improvements}, + author={Marius Nestor}, + url={https://9to5linux.com/qemu-7-0-released-with-kvm-support-for-risc-v-arm-and-openrisc-improvements}, + year={2022}, + date={19}, + month={Apr.} } - diff --git a/report/3_feasibility/feasibility-report.tex b/report/3_feasibility/feasibility-report.tex index 8e34931..2a25bd0 100644 --- a/report/3_feasibility/feasibility-report.tex +++ b/report/3_feasibility/feasibility-report.tex @@ -20,7 +20,7 @@ pdftitle={2022春 操作系统原理与设计(H) x-runikraft小组 可行性报告}, pdfauthor={吴骏东; 张子辰; 蓝俊玮; 郭耸霄; 陈建绿} } -\renewcommand{\today}{2022年4月21日} +\renewcommand{\today}{2022年4月23日} \begin{document} \title{\bfseries Runikraft小组\quad 可行性报告} @@ -29,7 +29,7 @@ \maketitle \tableofcontents -\section{项目介绍} +\section{项目介绍}\sectionauthor{郭耸霄} 我们选择的课题是使用Rust语言改写Unikraft Unikernel。与RustyHermit和rCore等用Rust实现的操作系统不同, 我们将完全使用Rust的稳定特性编写代码。 @@ -48,9 +48,9 @@ \section{项目介绍} 因此,我们计划使用Rust语言改写架构和性能方面占优的unikernel——Unikraft。 在这份报告中,我们将首先介绍项目的理论依据——Rust语言适用于系统编程的特性 及对Unikraft源码的分析和改写思路;随后,我们将介绍使用QEMU进行硬件仿真和 -测试的方法;最后,我们将给出项目的总体设计和创新点。 +测试的方法;最后,我们将给出项目的创新点和总体设计。 \section{理论依据} -\subsection{Rust语言} +\subsection{Rust语言}\sectionauthor{陈建绿}\vspace*{-4ex} \subsubsection{保证内存安全的方式} 在高级语言中,某个内存位置要在程序中能被访问,必然就会与一个或多个变量建立关联关系。 这会引出内存的不正确访问引发的内存安全问题。这些问题在C/C++中都是需要开发者非常小心地 @@ -61,7 +61,7 @@ \subsubsection{保证内存安全的方式} \begin{tabular}{|c|c|} \hline \textbf{问题} & \textbf{Rust 的解决方案}\\\hline -使用未初始化内存&编译器禁止变量读取未赋值变量\\\hline +使用未初始化内存&编译器禁止读取未赋值变量\\\hline 对空指针解引用&使用\texttt{Option}枚举替代空指针\\\hline 悬垂指针&生命周期标识与编译器检查\\\hline 缓冲区溢出&编译器检查,拒绝超越缓冲区边界的数据访问\\\hline @@ -104,7 +104,7 @@ \subsubsection{Unsafe Rust} 调用一个不安全的函数或方法(例如C语言函数)。 访问和修改静态变量,后者是Rust中的"全局变量"。 使用Unsafe Rust会在一定程度上减少Rust编译器的安全检查,但牺牲的稍许安全性却可以换来 -灵活性的巨大提高。在与硬件抽象(定义于\texttt{portmacros.h}中)进行交互时,我们可能 +灵活性的巨大提高。在与硬件抽象进行交互时,我们可能 需要使用这个特性。 \subsection{Rust与C交互} @@ -175,7 +175,7 @@ \subsection{Rust的条件编译}\label{subsec:cond-compile} \end{lstlisting} \cite{e} -\subsection{RISC-V ISA} +\subsection{RISC-V ISA}\sectionauthor{吴骏东}\vspace*{-4ex} \subsubsection{特权特权模型} 在编写unikernel时,我们需要使用特权指令处理外设中断、控制机器状态, 因此需要了解RISC-V的特权模型。 @@ -187,7 +187,7 @@ \subsubsection{特权特权模型} 在M模式下运行的 hart 对内存、I/O 和一些对于启动和配置系统来说必要的底层 功能有着完全的使用权。因此它是唯一所有标准 RISC-V 处理器都必须实现的权限模式。\cite{a} \item[超级监管者级别(H)] 为了支持虚拟机监视器。但目前该级别并没有被正式加入到文档中。 -\item[监管者级别(S)] 为了支持现代类 Unix 操作系统,如 Linux,FreeBSD 和 Windows 。 +\item[监管者级别(S)] 为了支持现代操作系统,如 Linux,FreeBSD 和 Windows 。 \item[用户级别(U)] 用于运行应用程序,适用于安全嵌入式系统。 \end{description} @@ -218,7 +218,7 @@ \subsubsection{特权特权模型} \newcommand{\instbit}[1]{\mbox{\scriptsize #1}} \newcommand{\instbitrange}[2]{~\instbit{#1} \hfill \instbit{#2}~} %\centering - + \begin{longtable}{p{0in}p{0.4in}p{0.05in}p{0.05in}p{0.05in}p{0.05in}p{0.4in}p{0.6in}p{0.4in}p{0.6in}p{0.7in}l} \caption{RISC-V 特权指令}\\ & @@ -247,7 +247,7 @@ \subsubsection{特权特权模型} \instbitrange{6}{0} \\ \cline{2-11} \endhead - + & \multicolumn{4}{|c|}{funct7} & \multicolumn{2}{c|}{rs2} & @@ -256,8 +256,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{opcode} & R-type \\ \cline{2-11} - - + + & \multicolumn{6}{|c|}{imm[11:0]} & \multicolumn{1}{c|}{rs1} & @@ -265,15 +265,15 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{opcode} & I-type \\ \cline{2-11} - - + + & \multicolumn{10}{c}{} & \\ & \multicolumn{10}{c}{\bf Trap-Return Instructions} & \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0001000} & \multicolumn{2}{c|}{00010} & @@ -282,8 +282,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & SRET \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0011000} & \multicolumn{2}{c|}{00010} & @@ -292,15 +292,15 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & MRET \\ \cline{2-11} - - + + & \multicolumn{10}{c}{} & \\ & \multicolumn{10}{c}{\bf Interrupt-Management Instructions} & \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0001000} & \multicolumn{2}{c|}{00101} & @@ -309,15 +309,15 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & WFI \\ \cline{2-11} - - + + & \multicolumn{10}{c}{} & \\ & \multicolumn{10}{c}{\bf Supervisor Memory-Management Instructions} & \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0001001} & \multicolumn{2}{c|}{rs2} & @@ -326,15 +326,15 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & SFENCE.VMA \\ \cline{2-11} - - + + & \multicolumn{10}{c}{} & \\ & \multicolumn{10}{c}{\bf Hypervisor Memory-Management Instructions} & \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0010001} & \multicolumn{2}{c|}{rs2} & @@ -343,8 +343,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & HFENCE.VVMA \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110001} & \multicolumn{2}{c|}{rs2} & @@ -353,15 +353,15 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & HFENCE.GVMA \\ \cline{2-11} - - + + & \multicolumn{10}{c}{} & \\ & \multicolumn{10}{c}{\bf Hypervisor Virtual-Machine Load and Store Instructions} & \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110000} & \multicolumn{2}{c|}{00000} & @@ -370,8 +370,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{1110011} & HLV.B \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110000} & \multicolumn{2}{c|}{00001} & @@ -380,8 +380,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{1110011} & HLV.BU \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110010} & \multicolumn{2}{c|}{00000} & @@ -390,8 +390,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{1110011} & HLV.H \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110010} & \multicolumn{2}{c|}{00001} & @@ -400,8 +400,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{1110011} & HLV.HU \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110100} & \multicolumn{2}{c|}{00000} & @@ -410,8 +410,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{1110011} & HLV.W \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110010} & \multicolumn{2}{c|}{00011} & @@ -420,8 +420,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{1110011} & HLVX.HU \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110100} & \multicolumn{2}{c|}{00011} & @@ -430,8 +430,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{1110011} & HLVX.WU \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110001} & \multicolumn{2}{c|}{rs2} & @@ -440,8 +440,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & HSV.B \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110011} & \multicolumn{2}{c|}{rs2} & @@ -450,8 +450,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & HSV.H \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110101} & \multicolumn{2}{c|}{rs2} & @@ -460,15 +460,15 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & HSV.W \\ \cline{2-11} - - + + & \multicolumn{10}{c}{} & \\ & \multicolumn{10}{c}{\bf Hypervisor Virtual-Machine Load and Store Instructions, RV64 only} & \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110100} & \multicolumn{2}{c|}{00001} & @@ -477,8 +477,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{1110011} & HLV.WU \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110110} & \multicolumn{2}{c|}{00000} & @@ -487,8 +487,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{rd} & \multicolumn{1}{c|}{1110011} & HLV.D \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110111} & \multicolumn{2}{c|}{rs2} & @@ -497,15 +497,15 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & HSV.D \\ \cline{2-11} - - + + & \multicolumn{10}{c}{} & \\ & \multicolumn{10}{c}{\bf \emph{Svinval} Memory-Management Extension} & \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0001011} & \multicolumn{2}{c|}{rs2} & @@ -514,8 +514,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & SINVAL.VMA \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0001100} & \multicolumn{2}{c|}{00000} & @@ -524,8 +524,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & SFENCE.W.INVAL \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0001100} & \multicolumn{2}{c|}{00001} & @@ -534,8 +534,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & SFENCE.INVAL.IR \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0010011} & \multicolumn{2}{c|}{rs2} & @@ -544,8 +544,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & HINVAL.VVMA \\ \cline{2-11} - - + + & \multicolumn{4}{|c|}{0110011} & \multicolumn{2}{c|}{rs2} & @@ -554,8 +554,8 @@ \subsubsection{特权特权模型} \multicolumn{1}{c|}{00000} & \multicolumn{1}{c|}{1110011} & HINVAL.GVMA \\ \cline{2-11} - - + + \end{longtable} } @@ -621,7 +621,7 @@ \subsubsection{监管者二进制接口} } \end{lstlisting}​ -例如可以用如下程序实现一个打印一个字符到系统控制台上的putchar函数: +例如可以用如下程序实现一个打印一个字符到系统控制台上的\texttt{putchar}函数: \begin{lstlisting}[language=C] void sbi_console_putchar(int ch) { @@ -661,35 +661,32 @@ \subsubsection{KVM对RISC-V架构的支持} 嵌套虚拟化,而 Aarch64 要等到 v8.3 版本之后才支持这个功能。RISC-V 的时钟和核间中断可通过 SBI 软件辅助完成,而 Aarch64 需要特殊设计的计时器外设来支持虚拟化功能。\cite{d} -\subsubsection{使用QEMU进行仿真测试} +\subsection{QEMU}\sectionauthor{吴骏东} -QEMU is a generic and open source machine emulator and virtualizer. +QEMU是一款通用、开源的机器模拟器和虚拟化器。 -When used as a machine emulator, QEMU can run OSes and programs made for -one machine (e.g. an ARM board) on a different machine (e.g. your own PC). -By using dynamic translation, it achieves very good performance. +当用作机器模拟器时,QEMU可以把一个机器(如ARM board)的系统或程序运行在不同的机器上(如你的PC)。 +借助动态翻译,它达到了非常好的性能。 -When used as a virtualizer, QEMU achieves near native performance by executing -the guest code directly on the host CPU. QEMU supports virtualization when executing -under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, -QEMU can virtualize x86, server and embedded PowerPC, 64-bit POWER, S390, 32-bit -and 64-bit ARM, and MIPS guests.\cite{1} +当用作虚拟化器时,QEMU通过直接在宿主机CPU上运行客户机代码,达到了接近原生的性能。QEMU支持两种模式 +的虚拟化:在Xen hypervisor下执行,或者使用Linux内核模块KVM。当使用KVM时,QEMU可以虚拟化x86、 +服务器和嵌入PowerPC、64位 POWER、S390、32位和64位ARM、RISC-V\cite{qemu7}以及MIPS客户机。\cite{1} \noindent QEMU具有如下优点: \begin{description} -\item[Full-system emulation] Run operating systems for any machine, on any supported architecture. -\item[User-mode emulation] Run programs for another Linux/BSD target, on any supported architecture. -\item[Virtualization] Run KVM and Xen virtual machines with near native performance.\cite{1} +\item[完整系统的模拟] Run operating systems for any machine, on any supported architecture. +\item[用户态的模拟] Run programs for another Linux/BSD target, on any supported architecture. +\item[虚拟化] Run KVM and Xen virtual machines with near native performance.\cite{1} \end{description} -\subsection{Unikraft架构分析} +\subsection{Unikraft架构分析}\sectionauthor{张子辰}\vspace*{-4ex} \subsubsection{代码风格}\label{ssubsec:code-style} Unikraft的代码组织方式充分体现了模块化设计,核心代码被放在了\texttt{arch/}、\texttt{include/}和 -\texttt{plat/}三个目录下,而系统的几乎所有功能都由为了\texttt{lib/}目录下的micro-libraries提供。 +\texttt{plat/}三个目录下,而系统的几乎所有功能都由位于\texttt{lib/}目录下的micro-libraries提供。 一个micro-library被放在一个目录下: \begin{itemize} -\item \texttt{include/}:micro-libray的API; +\item \texttt{include/}:micro-library的API; \item \texttt{Config.uk}:menu-config配置; \item \texttt{exportsyms.uk}:导出的符号; \item \texttt{Makefile.uk}:自动构建系统的配置; @@ -697,7 +694,7 @@ \subsubsection{代码风格}\label{ssubsec:code-style} \item \texttt{extra.ld}:(可选)链接器配置。 \end{itemize} -比如,\texttt{rksched}的目录结构: +比如,\texttt{uksched}的目录结构: {\linespread{1} \begin{verbatim} uksched @@ -721,7 +718,7 @@ \subsubsection{代码风格}\label{ssubsec:code-style} 以\texttt{uk\_\hspace{0cm}\textit{}\hspace{0cm}\_} 开头,结构体名后\textit{通常}附加\texttt{\_t}, 比如\texttt{uk\_malloc}、\texttt{uk\_alloc\_malloc\_func\_t}。 -Unikraft使用面向对象设计,每个micro-libray中通常有与库同名的结构体,如\texttt{uk\_sched}, +Unikraft使用面向对象设计,每个micro-library中通常有与库同名的结构体,如\texttt{uk\_sched}, 库中的函数的第一个参数通常是执行这个结构体的指针,如 \texttt{\textbf{struct} uk\_sched *uk\_sched\_create(\textbf{struct} uk\_alloc *a, \textbf{size\_t} prv\_size)}。 @@ -742,11 +739,11 @@ \subsubsection{编译运行流程} \caption{配置Unikraft} \label{fig:unikraft-menuconfig} \end{figure} -Hello world程序与Unikraft的各个被使用的micro-libraies先被分别编译成了\texttt{.o}文件, +Hello world程序与Unikraft的各个被使用的micro-libraries先被分别编译成了\texttt{.o}文件, 再链接成一个unikernel镜像。一共生成了\texttt{libkvmplat}、\texttt{libkvmpci}、\texttt{libkvmvirtio}、 \texttt{apphelloworld}、\texttt{libnolibc}、\texttt{libukalloc}、\texttt{libukallocbbuddy}、 \texttt{libukargparse}、\texttt{libukboot}、\texttt{libukbus}、\texttt{libukdebug}、 -\texttt{libuksglist}、\texttt{libuktime}、\texttt{libuktimeconv}、\texttt{libx86\_64arch}等中间文件。 +\texttt{libuksglist}、\texttt{libuktime}、\texttt{libuktimeconv}和\texttt{libx86\_64arch}等中间文件。 最后的输出是18.0KiB大的\texttt{app-\linebreak helloworld\_kvm-x86\_64.gz}。 详细的编译日志位于我们的仓库的\href{https://github.com/OSH-2022/x-runikraft/tree/d22ccf0c1b248667148fd8953b71b6e0258de6a3/reference/Unikraft%20helloworld}{reference/Unikraft helloworld/}目录。 @@ -869,14 +866,14 @@ \subsubsection{调度器} 它使用双链尾队列(tail queue)维护所有线程(\texttt{thread\_list})和 睡眠状态(就绪或等待)的线程(\texttt{sleeping\_threads})。 每一轮调度,\texttt{ukschedcoop}从睡眠线程队列 -中找出一个处在就绪态的线程,并唤醒(\texttt{uk\_thread\_wake})这个线程, +中找出一个处在就绪态的线程,并唤醒(\texttt{uk\_thread\_wake})这个线程。 如果没有任何能执行的线程,就挂起CPU(\texttt{ukplat\_lcpu\_halt\_to}), 直到某个线程能执行。\texttt{ukschedcoop}并不需要为每一个事件维护等待队列, 因为即使线程等待的事件发生了,由于当前线程的执行不能被抢占,等待的线程也不能被立即唤醒。 Unikraft的论文中提到了它拥有抢占式调度器\texttt{ukpreempt},但是我们并没有在它的源代码中找到相应的实现。 -\section{技术依据} +\section{技术依据}\sectionauthor{张子辰}\vspace*{-4ex} \subsection{rustc交叉编译} 先安装交叉编译riscv64gc的编译器组件, 然后在编译时附加\texttt{--target riscv64gc-\linebreak unknown-none-elf}选项即可实现x86-64--riscv64交叉编译。 @@ -892,7 +889,7 @@ \subsection{rustc交叉编译} \subsection{启动操作系统} 添加编译选项\texttt{-Clink-arg=-Tlinker.ld}以便链接器能读取自定义的链接脚本: \begin{multicols}{2} -\begin{lstlisting} +\begin{lstlisting}[numbers=left] OUTPUT_ARCH(riscv) ENTRY(__runikraft_start) BASE_ADDRESS = 0x80200000; @@ -986,7 +983,7 @@ \subsection{启动操作系统} \end{lstlisting} \texttt{\_\_runikraft\_entry\_point}和\texttt{\_\_runikraft\_start}都是Runikraft核心组件的 -\texttt{plat::\linebreak bootstrap}的一部分,目前的核心组件还已经实现了\texttt{plat::console}和 +\texttt{plat::\linebreak bootstrap}的一部分,目前的核心组件还实现了\texttt{plat::console}和 \texttt{plat::time}两个\texttt{plat}模块的子模块,以及\texttt{bitcount}模块(这个模块完全是 对Unikraft的\texttt{bitcount.c}的翻译)。目前已经实现了\texttt{rkalloc} API(对应Unikraft的 \texttt{ukalloc},这个API有一个演示用的“空实现”\texttt{rkalloc\_empty}。 @@ -1044,7 +1041,7 @@ \subsection{运行和调试} 但是Ubuntu 20.04的APT源中的QEMU并没有附带,所以仍然需要到 \ \href{https://github.com/riscv-software-src/opensbi/releases/tag/v1.0}{OpenSBI Version 1.0}\ 手动下载。我们需要的是\linebreak\texttt{opensbi-1.0-rv-bin/share/opensbi/lp64/generic/firmware/fw\_jump.bin}。 -为了方便后续使用,可以在\texttt{~/.bashrc}中加上\texttt{export RISCV\_BIOS=\textit{}}。 +为了方便后续使用,可以在\texttt{\tildechar/.bashrc}中加上\texttt{export RISCV\_BIOS=\textit{}}。 一切安装完毕后,可以用 \begin{lstlisting} @@ -1105,15 +1102,16 @@ \subsection{QEMU性能测试} 原始记录见我们的仓库的\href{https://github.com/OSH-2022/x-runikraft/tree/eca8a7575be96fb0a4dc311a8c60622c0e9b0aa5/reference/qemu-benchmark.log}{reference/qemu-benchmark.log}。 从测试结果可以看出,不同类型的程序的损失比并不相同,但是我目前并没有弄清楚 -什么样的程序更容易造成性能损失。由于QEMU无法有效利用处理器的分值预测和高速缓存, -我猜测流水线友好和缓存友好的程序会因此较大的性能损失。考虑到内核的大部分操作不涉及大范围的 +什么样的程序更容易造成性能损失。由于QEMU无法有效利用处理器的分支预测和高速缓存, +我猜测流水线友好和缓存友好的程序会引起较大的性能损失。考虑到内核的大部分操作不涉及大范围的 寻址,可以认为系统内核属于会引起较大性能损失的程序,所以我们把QEMU仿真带来的性能损失视为5。 \section{创新点} 与先前用Rust改写FreeRTOS的小组类似,我们的项目偏重工程,没有理论上的创新点。 由于我们了解的所有用Rust写的操作系统都或多或少的使用了unstable的特性,我们用stable特性 编写unikernel也不失为一种技术上的创新。 -\section{概要设计} + +\section{概要设计}\sectionauthor{张子辰}\vspace*{-4ex} \subsection{架构} Runikraft的架构与Unikraft几乎相同。 \begin{figure}[!hbt] @@ -1140,10 +1138,10 @@ \subsection{架构} 它们分别提供网络设备和块设备的支持。 %与Unikraft的实现类似,这两个APIs的构造函数的参数接受指向\texttt{trait RKplat}的指针。 \texttt{rktime}提供获取和修改系统时间的API,\texttt{rkswrand}提供密码学安全的随机数, -\texttt{rkboot}负责完成系统的初始化并将控制权转交给用户的代码。 +\texttt{rkboot}负责完成OS元件的初始化并将控制权转交给用户的代码。 \texttt{rksched}和\texttt{rklock}是两个与调度器有关的APIs,前者负责创建、调度、撤销线程,后者负责线程间 -的同步和互斥。Runikraft支持多种调取器,比如,图\ \ref{fig:runikraft-arch}\ 中的RR的时间片轮转调度器、 +的同步和互斥。Runikraft支持多种调取器,比如,图\ \ref{fig:runikraft-arch}\ 中的RR是时间片轮转调度器、 Mul-qu是多重队列调取器、EDF是截止日期有限调度器。我们计划先实现RR调度器。当然,为了系统镜像的轻量性, 用户可以不使用任何调取器,这时,\texttt{rksched}和\texttt{rklock}会被编译成空API,创建线程的行为 将和函数调用相同。这保证了大部分使用仅仅并行加速的程序仍然能正确运行。 @@ -1300,5 +1298,5 @@ \section*{许可协议} 本许可证的全文位于:\\ \centerline{\url{https://creativecommons.org/licenses/by/4.0/legalcode.zh-Hans}} \bibliographystyle{IEEEtran} -\bibliography{feasibility-report} +\bibliography{feasibility-report.bib} \end{document}