-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from Beavercat7/master
2023开源操作系统训练营第三阶段项目一总结报告-Beavercat7
- Loading branch information
Showing
3 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--- | ||
|
||
title: < 2023开源操作系统训练营第三阶段项目一总结报告-蒋文卓> | ||
|
||
date: 2023-12-01 20:36:49 | ||
|
||
tags: | ||
|
||
categories: | ||
|
||
- oscamp 2023fall arceos unikernel | ||
|
||
tags: | ||
|
||
- author:Beavercat7 | ||
|
||
--- | ||
|
||
### 总结报告 | ||
|
||
|
||
|
||
## 第一周实验总结 | ||
|
||
|
||
|
||
# exercise 1&2: 改变println!宏以及引入haspmap | ||
|
||
这里我是直接查询chatgpt知道可以通过在println!加入特殊符号来改变颜色,于是改变了底层的println!实现了。 | ||
|
||
后者我则是有点找不着头脑,因为本身的rust基础就是训练营的第一周和第二周,而这种程度根本无法跟得上后续的项目级别的开发,二阶段也只是调用api,到了第三阶段才发现自己连cargo管理项目和lib.rs文件都不知道是什么作用,导致自己花了很多时间去找bug,后来通过在项目群里询问大佬才发现自己的问题,当然对于引入hashmap的操作,也是借鉴了石磊老师的注释大法,通过报错信息和一步步释放自己想要的代码来逐步达到目的,这让我节省了很多时间。 | ||
|
||
|
||
|
||
# exercise 3&4 引入early算法和解析dtb文件 | ||
|
||
前者我是直接通过将buddy算法和bitmap算法两个内存分配和页分配的算法结合起来拼凑起来实现的。 | ||
|
||
后者我是通过使用群里大佬分享的库,以及询问邝劲强大佬关于库的使用方法,他给予了我一些提示,于是成功实现了这个练习。 | ||
|
||
|
||
|
||
# exercise 5 将协作式调度算法fifo改造为抢占式调度算法 | ||
|
||
这里我是直接参考了round_robin.算法的实现进行修改,然后比较顺利的通过。 | ||
|
||
|
||
|
||
## 第二周实验总结 | ||
|
||
|
||
|
||
# exercise 1&2 | ||
|
||
|
||
|
||
这里我使用了非常规的方法,直接使用了脚本来获取文件大小等信息 | ||
|
||
后者通过脚本将两个文件合并到一起,后来才发现这种做法是不可取的,少了在loader的一环,这也导致我后续练习5的bug找了很久。 | ||
|
||
|
||
|
||
# exercise 3&4 | ||
|
||
|
||
|
||
这两个实验则相对于简单很多,第一个实验就是改一下汇编代码'nop'和'wfi' | ||
|
||
后者就是仿照puthello和putchar然后加一个axstd::process::exit函数的调用就行了。 | ||
|
||
|
||
|
||
# exercise 5&6 | ||
|
||
|
||
|
||
其实在我心目中,反而是第一个和第二个实验最难,我对文件那块不太熟悉,练习5和练习6的思路和策略我觉得想得很快,无非是因为要写内联汇编而已,这里我也是首先犯了没有保存a7寄存器的错误,后续发现不再是loadfault的错误而是IllegalInstruction的错误信息,一直找不到错误的重点在哪里,在此过程中,在助教和群友的帮助下,尝试了通过其他寄存器如s11来保存a7,通过全局静态变量来保存a7寄存器,通过在loader传入a0而非a7寄存器到helloapp的_start函数的第一个参数来保存abi表地址一共三个办法,得出一定不是 | ||
|
||
helloapp本身的问题,而是loader的文件,然后通过排查,发现是load_size的大小太小了,一直写得指导书的32,后面改大一点通过了 | ||
|
||
练习6意识到需要改正练习1和练习2没有在loader加入头结构和相关函数的问题,于是添加上去,实现了分别调用两个地址空间的应用。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: <blog-title> | ||
date: 2023-12-01 23:40:02 | ||
tags: | ||
--- |