mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-21 16:37:48 +00:00
Compare commits
9 Commits
22d84f2b38
...
6c82abd1e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c82abd1e6 | ||
|
|
9b0a0a3fbb | ||
|
|
54010c3653 | ||
|
|
b8be0c5a5d | ||
|
|
88e473433b | ||
|
|
1a0254b977 | ||
|
|
05dadc1302 | ||
|
|
6041d119db | ||
|
|
258426b787 |
@@ -406,6 +406,8 @@ Instead of writing our own bootloader, which is a project on its own, we use the
|
||||
bootloader = "0.9"
|
||||
```
|
||||
|
||||
**Note:** This post is only compatible with `bootloader v0.9`. Newer versions use a different build system and will result in build errors when following this post.
|
||||
|
||||
Adding the bootloader as a dependency is not enough to actually create a bootable disk image. The problem is that we need to link our kernel with the bootloader after compilation, but cargo has no support for [post-build scripts].
|
||||
|
||||
[post-build scripts]: https://github.com/rust-lang/cargo/issues/545
|
||||
|
||||
@@ -368,6 +368,8 @@ pub extern "C" fn _start() -> ! {
|
||||
bootloader = "0.9"
|
||||
```
|
||||
|
||||
** 注意:** 当前环境仅兼容 `bootloader v0.9` 版本。较新的版本需考虑使用其他的构建工具,否则会导致构建出现未知错误。
|
||||
|
||||
只添加引导程序为依赖项,并不足以创建一个可引导的磁盘映像;我们还需要内核编译完成之后,将内核和引导程序组合在一起。然而,截至目前,原生的 cargo 并不支持在编译完成后添加其它步骤(详见[这个 issue](https://github.com/rust-lang/cargo/issues/545))。
|
||||
|
||||
为了解决这个问题,我们建议使用 `bootimage` 工具——它将会在内核编译完毕后,将它和引导程序组合在一起,最终创建一个能够引导的磁盘映像。我们可以使用下面的命令来安装这款工具:
|
||||
|
||||
2119
blog/content/edition-2/posts/12-async-await/index.zh-TW.md
Normal file
2119
blog/content/edition-2/posts/12-async-await/index.zh-TW.md
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user