Comments (4)
数组放在main
函数里面的话是开在栈上的,全局声明的话是在.bss
或者.data
段里面,唯一的区别只有这个。可以看看是不是爆栈(应该不会,整个数组只有800字节,距离一个4K页还有很远)了,或者sp寄存器维护出问题了?
另外,在最新版的tutorial上,将用例的数组修改为main函数内声明,也是能正常跑的。
from rcore-tutorial-v3.
感谢回复!感觉可能不是sp的问题,毕竟ch3跑的好好的。。。anyway我再debug一下!
BTW,还有几个问题顺便问一下
- 这里
page_table
貌似不需要可变,translate
方法只需要引用就行了rCore-Tutorial-v3/os/src/mm/memory_set.rs
Line 344 in e2c2949
- 这里改成
VirtPageNum((self.0 + PAGE_SIZE - 1) / PAGE_SIZE)
是否就不需要if
了
rCore-Tutorial-v3/os/src/mm/address.rs
Lines 105 to 111 in e2c2949
from rcore-tutorial-v3.
1.copy_data
确实只需要&PageTable
就行了,后面改
2.当self.0
为usize::MAX
的时候,self.0+PAGE_SIZE
就溢出了,所以至少这样写还有问题
from rcore-tutorial-v3.
感谢!
from rcore-tutorial-v3.
Related Issues (20)
- Nix flakes 支持
- VirtAddr/PhysAddr::ceil may leads to panic
- 协程的一些想法
- 想运行 iPerf 测试一下网络性能,想请教一下
- chp1 分支上的 rustsbi 版本不能支持 shutdown HOT 1
- 可以提供pdf版的教程吗
- ch3增加关于MAX_APP_NUM相关的编译期检查
- ch9以及main分支不再支持GUI HOT 1
- `MemorySet::copy_data`中的`page_table`参数无需可变引用
- 修改Makefile,在执行QEMU之前检查QEMU版本
- 某些章节的`MEMORY_END`不一致
- 从ch3开始,panic日志无法打印
- Some flaws in rust-toolchain.toml and Dockerfile
- Remove undefined behavior in usertests of ch8
- forktest2 possibly hangs start from ch8
- logging模块无法显示日志内容 HOT 1
- ch8 主线程彻底退出之前正在使用的内核栈就被回收 HOT 3
- Issues when bumping to at least nightly-2024-02-28 HOT 1
- 为什么在 frame allocator 里可以使用 Vec 呢 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcore-tutorial-v3.