-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
title: 2023秋开源操作系统训练营第二阶段小结-r27153733 | ||
date: 2023-11-05 19:41:26 | ||
tags: | ||
- author:r27153733 | ||
- repo:2023a-rcore-r27153733 | ||
--- | ||
|
||
## 第一阶段 | ||
|
||
一阶段的`rustlings`是挺好的rust入门题目,也是没有什么阻碍的完成了100道题。 | ||
|
||
## 第二阶段 | ||
|
||
# `lab1` | ||
|
||
这一个lab没什么难度,实现`taskinfo`不需要太多`os`相关的知识。 | ||
|
||
# `lab2` | ||
|
||
这一个lab开始上强度了,需要弄懂很多`os`知识。 | ||
|
||
关于`sys_get_time`和`sys_task_info`,题目有提到`splitted by two pages`问题,但是直接整个转换成物理地址写入也能过测试, | ||
|
||
我理解的处理`splitted by two pages`的方法是,对每一个字段,获取他的物理地址,然后写入。 | ||
|
||
或者像`buffers`那样,直接逐字节拷贝进`Vec<&'static mut [u8]>`。 | ||
|
||
不知道上面的方法是否正确。 | ||
|
||
关于`mmap`和`munmap`,本来是想保存在`MemorySet.areas`下,但是考虑到回收的内存段可能是分配的内存段的子集,要实现`MapArea`的分裂,还有性能问题, | ||
|
||
就直接在`MemorySet`下挂一个`btree`管理了(感觉在`mmap`这种需求下抽象成`MapArea`反而是一种负担)。 | ||
|
||
# ` lab3` | ||
|
||
`lab3`感觉比`lab2`简单,`spwan`直接复用`TaskControlBlock::new`再进行一些操作,`stride`也是采用了简单的实现。 | ||
|
||
本来想实现,即使`stride`溢出,也能选择正确的程序(无符号相减,结果转有符号与0比),因为时间问题直接用`u64`解决咕咕咕了。 | ||
|
||
# 补充 | ||
|
||
感觉`test`还是少了。 |