File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ unsafe {
205205
206206 完成上述代码任务,回答如下的问题:
207207
208- - `set_entry` 函数做了什么?为什么它是 unsafe 的?
208+ - `set_entry` 函数做了什么?为什么它的实现是 unsafe 的?
209209 - `jump_to_entry` 函数做了什么?要传递给内核的参数位于哪里?查询 `call` 指令的行为和 x86_64 架构的调用约定,借助调试器进行说明。
210210 - `entry_point!` 宏做了什么?内核为什么需要使用它声明自己的入口点?
211211 - 如何为内核提供直接访问物理内存的能力?你知道几种方式?代码中所采用的是哪一种?可以参考[这篇文章](https://os.phil-opp.com/paging-implementation)进行学习。
Original file line number Diff line number Diff line change @@ -31,9 +31,7 @@ fn efi_main() -> Status {
3131 // 2. Load ELF files
3232 let elf = { /* FIXME: Load kernel elf file */ } ;
3333
34- unsafe {
35- set_entry ( elf. header . pt2 . entry_point ( ) as usize ) ;
36- }
34+ set_entry ( elf. header . pt2 . entry_point ( ) as usize ) ;
3735
3836 // 3. Load MemoryMap
3937 let mmap = uefi:: boot:: memory_map ( MemoryType :: LOADER_DATA ) . expect ( "Failed to get memory map" ) ;
You can’t perform that action at this time.
0 commit comments