-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在K210运行时卡死,但是在QEMU运行没事 #16
Comments
由于磁盘缓冲层需要进程获取睡眠锁,因此文件系统的初始化是在initcode第一次将要离开内核时进行的,在kernel/proc.c中的代码如下。 // A fork child's very first scheduling by scheduler()
// will swtch to forkret.
void
forkret(void)
{
static int first = 1;
// Still holding p->lock from scheduler.
release(&myproc()->lock);
if (first) {
// File system initialization must be run in the context of a
// regular process (e.g., because it calls sleep), and thus cannot
// be run from main().
first = 0;
fat32_init();
myproc()->cwd = ename("/");
}
usertrapret();
} 在 |
感谢 |
那为什么在QEMU下面能正常运行,而K210不能呢?这两个平台好像都用到了这段代码 |
在K210上,内存的初始情况是未知的,而QEMU则可能事先将内存清零了,所以锁的未初始化状态可能不同。 |
受教了感谢! |
我修改了initcode,把init程序硬编码到了内核里面,为什么在初始化时获取当前目录的ename函数时
![2021-05-06_10-21-08](https://user-images.githubusercontent.com/29215152/117232969-d3460780-ae54-11eb-8fec-6073add81dd6.png)
![2021-05-05_11-01-00](https://user-images.githubusercontent.com/29215152/117232903-af82c180-ae54-11eb-815d-1ea44cbf45d3.png)
![2021-05-05_12-18-32](https://user-images.githubusercontent.com/29215152/117239054-a3046600-ae60-11eb-8baa-c4a7d170aae3.png)
紧接着会卡死在申请加锁这里呢?
并且在QEMU下面没问题,只在K210下有问题
就是这样的
The text was updated successfully, but these errors were encountered: