rcore-os / rCore-Tutorial-Book-v3

A book about how to write OS kernels in Rust easily.
https://rcore-os.github.io/rCore-Tutorial-Book-v3/
GNU General Public License v3.0
1.13k stars 211 forks source link

rCore-Tutorial-Book-v3/chapter1/3first-instruction-in-kernel1 #140

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

内核第一条指令(原理篇) - rCore-Tutorial-Book-v3 3.6.0-alpha.1 文档

https://rcore-os.github.io/rCore-Tutorial-Book-v3/chapter1/3first-instruction-in-kernel1.html

AtomicVar commented 2 years ago

这一课很精彩,Qemu 的介绍、计算机加电启动流程以及链接器的链接过程,都是很好的原理性介绍。:heart:

Jiangmmh commented 1 year ago

太精彩了。

cm-lll commented 1 year ago

linyihai commented 1 year ago

内容深入浅出,让人获益匪浅,多谢作者的劳动

wtsclwq commented 1 year ago

深入浅出,对于我这种各个地方都了解一点但是没有将知识串联起来的人非常有帮助。

chiniun commented 1 year ago

赞 谢谢

word119 commented 1 year ago

第一次读懂,已年过34岁

learning310 commented 1 year ago

勘误:”在前八章我们主要用到 CPU 和物理内存“

wyfcyx commented 1 year ago

@learning310 好像没问题?

learning310 commented 1 year ago

@learning310 好像没问题?

理解错误,抱歉。

chestNutLsj commented 10 months ago

可以在端序的旁注里添加一张示意图: {1969-x-17350526740980}(1).png

Ayana-chan commented 9 months ago

"注意这里我们载入的文件带有 .bin 后缀,它并不是上一节中我们移除标准库依赖后构建得到的内核可执行文件,而是还要进行加工处理得到内核镜像。”这句话有语病,刚开始读好几次没看懂;而且这里第一次提到内核镜像,应当加以强调。也许可以改成以下句式,虽然不太简洁但也算是能理解:“注意这里我们载入的文件(内核镜像)带有 .bin 后缀,它并不是上一节中我们移除标准库依赖后构建得到的内核可执行文件。我们还要进行一些加工处理才能得到正确的内核镜像。”

wyfcyx commented 8 months ago

"注意这里我们载入的文件带有 .bin 后缀,它并不是上一节中我们移除标准库依赖后构建得到的内核可执行文件,而是还要进行加工处理得到内核镜像。”这句话有语病,刚开始读好几次没看懂;而且这里第一次提到内核镜像,应当加以强调。也许可以改成以下句式,虽然不太简洁但也算是能理解:“注意这里我们载入的文件(内核镜像)带有 .bin 后缀,它并不是上一节中我们移除标准库依赖后构建得到的内核可执行文件。我们还要进行一些加工处理才能得到正确的内核镜像。”

重写了一下,感谢反馈。

watsmal commented 8 months ago

这里建议还是把“在此期间链接器主要完成两件事情:第二件事情是将符号替换为具体地址。”修改一下,“链接器在链接外部目标文件的时候,会将符号转化为地址”,但是你又说“当一个模块被转化为目标文件之后,它的内部符号就已经在目标文件中被转化为具体的地址了”,所以有矛盾。

bj-edward commented 8 months ago

"不同的段会被编译器放置在内存不同的位置上" 这里应该是被链接器放置在内存不同的位置上吧

HideOnBush-FV commented 5 months ago

没有必要纠结别人用哪几个字表述吧=。= 能理解就行了呗,我觉得已经写很好了

Lee-side commented 4 months ago

写的太好了, 都串联起来了👍

FangTaC commented 3 months ago

qemu-system-riscv64 \ -machine virt \ -nographic \ -bios ../bootloader/rustsbi-qemu.bin \ -device loader,file=target/riscv64gc-unknown-none-elf/release/os.bin,addr=0x80200000 qemu-system-riscv64: Unable to load the RISC-V firmware "../bootloader/rustsbi-qemu.bin" 这个报错是什么原因呢

swing0ne commented 2 months ago

qemu-system-riscv64 -machine virt -nographic -bios ../bootloader/rustsbi-qemu.bin -device loader,file=target/riscv64gc-unknown-none-elf/release/os.bin,addr=0x80200000 qemu-system-riscv64: Unable to load the RISC-V firmware "../bootloader/rustsbi-qemu.bin" 这个报错是什么原因呢

应该是缺少bootloader这个文件夹

FangTaC commented 2 months ago

已经解决,十分感谢!

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2024年4月20日(星期六) 下午2:52 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [rcore-os/rCore-Tutorial-Book-v3] rCore-Tutorial-Book-v3/chapter1/3first-instruction-in-kernel1 (Issue #140)

“这里我们使用预编译好的 rustsbi-qemu.bin ,它需要被放在与 os 同级的 bootloader 目录下”,如果是这样的话,“ -bios ../bootloader/rustsbi-qemu.bin”是不是要改成“ -bios ./bootloader/rustsbi-qemu.bin”

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>