Skip to content

Commit

Permalink
Merge branch 'rcore-os:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
xuejianxinokok authored Dec 17, 2024
2 parents 9aa74de + d678ab9 commit e108b25
Show file tree
Hide file tree
Showing 46 changed files with 2,260 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: 2024 秋冬季开源操作系统训练营第一阶段总结-DFP-HN
date: 2024-11-10 14:01:09
tags:
- author: DFP-HN
- repo: https://github.com/LearningOS/rust-rustlings-2024-autumn-DFP-HN
---
# 第一阶段总结
第一阶段训练营通过写一些rust的基本语句,快速入门rust,掌握了rust的基本语法。第一阶段的题目设置非常合理,对于rust零基础的也能快速入门,只需要一步一步按照文档上的学习就能轻松完成题目。
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: 2024 秋冬季开源操作系统训练营第二阶段总结-DFP-HN
date: 2024-11-10 13:57:28
tags:
- author: DFP-HN
- repo: https://github.com/LearningOS/2024a-rcore-DFP-HN
---
# 第二阶段总结
第二阶段的题目略有难度,我在这个阶段有了很大的收获。第三章的练习是获取当前任务的信息,通过这个练习,大致清楚了进程在操作系统中的运行流程以及组成结构,系统调用的实现和中断的实现。第四章的练习考察对页表的理解,在完成的过程中加深了我对虚拟地址和物理地址的理解。第五章的练习是实现一个子进程的创建,fork+exec也能生成一个子进程,但这个子进程的资源和空间与父进程完全一致,然而练习的要求需要子进程有独立的数据,如果采用fork+exec将浪费很多时间去重新加载数据。第六章的练习是关于文件系统,创建硬链接和取消硬链接,这一章节对我来说有点挑战,因为之前学操作系统对于文件系统这一块就没太搞懂,认真看了几个晚上的代码后才搞懂文件系统的结构,收获非常大。第八章练习比前面的轻松一些,只要搞清楚了代码中各个结构之间的关系,就能轻松解决。
100 changes: 100 additions & 0 deletions source/_posts/2024A-OS-I-Summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
title: 2024A-OS-I-Summary
date: 2024-11-10 12:34:18
tags:
- author:Whth
- repo:https://github.com/LearningOS/rust-rustlings-2024-autumn-Whth
- RustBasics
---





# 引言

----

9月的时候在`Rust语言中文社区`的微信公众号了解到了这个训练营,
当时想想正好可以获取一些操作系统的设计与实践的经验和感受感受`Rust`编程的实际运用,所以就报名了.


# 第一阶段概述


---
## 个人情况

- 非科班
- 大四备战考研ing
- 有过一些`C++``Python`的编程基础
- 系统学习过linux的架构和原理
- 了解过`Rust`的编程范式和语言特性(不过没怎么实际用过,只是简单的配过环境搓过些小玩意儿)




## Rustling

说是100道题,不过实际上是80道题.
其中70道语言特性和语法相关的基础题目,而剩下的10道题都是算法相关的.

因为`Rustling`没啥平台依赖所有就直接在win本把仓库克隆下来然后`cargo install&&rustling watch`开干

语法基础题花了一个下午给整完,中途卡了两天然后又花了两天把剩下的这10道题也做了.不过有一说一最后几个算法题确实有那么点上强度的感觉了Xb

![img.png](2024A-OS-I-Summary/img.png)

![img_1.png](2024A-OS-I-Summary/img_1.png)



## 总结



唉唉,给我的感觉两类题目的难度曲线会稍微有点陡峭了,简单和困难的过渡不太平缓,中途如果没有`Jetbrain RustRover`的built-in linter(好用,推荐😋)可能还得多花些时间
![img_2.png](2024A-OS-I-Summary/img_2.png)

个人感觉最难的几个部分有生命周期,借用和作用域

1. **生命周期(Lifetimes)**:确保引用在其所指向的数据有效期内始终有效,防止悬空指针。虽说如此,但是实际上没有了`'a`和IDE的检查马上就歇菜了Xb.
2. **借用(Borrowing)**:允许临时使用数据而不转移所有权,提高代码的灵活性和安全性。这个借用和cpp的借用机制类似,不过在rust中 borrowing 的时候会自动释放,不用像cpp那样手动释放,挺好.
3. **作用域(Scopes)**:定义变量和引用的可见性和生命周期,确保资源在不再需要时被及时释放。最后我的理解感觉实际上也就是`{}`的范围.

不过难归难,实际上rust里面挺多编程范式确实体验蛮不错的,我挺喜欢模式匹配,建造者模式,鼓励链式调用(手动点赞).

最后在榜上捞了个Rank 39.

![img_3.png](2024A-OS-I-Summary/img_3.png)


# 推荐阅读



1. [Rust官方文档](https://doc.rust-lang.org/book/title-page.html) - Rust的官方文档是最权威的学习资源之一,提供了详尽的语言特性和标准库介绍,适合所有级别的学习者。

2. [Rust精选](https://rustcc.cn/) - 提供了一系列聚焦于学习Rust的网络资源,包括但不限于使用Rust处理信号的文章,这些资源对于希望深入了解特定主题的学习者非常有帮助。

3. [《Rust 程序设计》](https://kaisery.github.io/trpl-zh-cn/) - 一本全面介绍Rust编程的书籍,适合希望系统学习Rust的新手。

4. [《Rust 权威指南》](https://rust-book.cs.dbappsecurity.com/) - 这本书深入讲解了Rust的核心概念和高级特性,适合已经有一定Rust基础的学习者。

5. [《Rust 实战》](https://rust-lang-nursery.github.io/rust-cookbook/intro.html) - 通过实战项目帮助读者掌握Rust编程的实际应用,适合希望通过实践加深理解的学习者。

6. [《深入理解 rust 并发编程》](https://rust-lang-nursery.github.io/rust-cookbook/concurrency.html) - 针对Rust的并发编程特性进行了详细的讲解,适合对并发编程感兴趣的开发者。

7. [《Command-Line Rust》](https://rust-cli.github.io/book/) - 专注于使用Rust开发命令行应用程序,适合对此类应用感兴趣的学习者。

8. [《Rust Atomics and Locks》](https://docs.rs/crossbeam/latest/crossbeam/atomic/index.html) - 深入讲解了Rust中的原子操作和锁机制,适合希望深入了解并发控制的学习者。

9. [《System Programing with Rust》](https://azerupi.github.io/mdBook/rust-system-programming/) - 介绍了如何使用Rust进行系统级编程,适合希望探索这一领域的开发者。

10. [《Rust 编程之道》](https://rustwiki.org/zh-CN/rust-by-example/) - 通过具体的例子和最佳实践,帮助读者更好地掌握Rust编程。






Binary file added source/_posts/2024A-OS-I-Summary/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_posts/2024A-OS-I-Summary/img_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_posts/2024A-OS-I-Summary/img_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_posts/2024A-OS-I-Summary/img_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e108b25

Please sign in to comment.