Skip to content
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

咨询您一个关于问题 #1

Open
SeddonShen opened this issue Aug 13, 2021 · 3 comments
Open

咨询您一个关于问题 #1

SeddonShen opened this issue Aug 13, 2021 · 3 comments

Comments

@SeddonShen
Copy link

我们现在在跑linux的时候(自己编译的清华的NaiveMIPS的Kernel)在Load的时候出现了问题,在PMON的信息如下:
`PMON> g console=ttyS0,115200 rdinit=sbin/init
zero at v0 v1 a0 a1 a2 a3
00000000 00000000 00000000 00000000 00000003 a7dffd78 a7dffd88 870af7f0
t0 t1 t2 t3 t4 t5 t6 t7
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
s0 s1 s2 s3 s4 s5 s6 s7
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
t8 t9 k0 k1 gp sp s8 ra
00000000 00000000 00000000 00000000 00000000 a7dffd58 00000000 8707ad18

Exception Cause=coprocessor unusable, SR=0x10000002, PC=0x8707af40
CONTEXT=0x00000000, XCONTEXT=0x00000064
BADVADDR=0xbfc00000, ENTHI=0x00000064
ENTLO0=0x00000000, ENTLO1=0x00000064

zero at v0 v1 a0 a1 a2 a3
00000000 24000000 34000000 870c0000 870ca050 0000001f 00000000 8700fd90
t0 t1 t2 t3 t4 t5 t6 t7
8700fd90 10000000 00000000 00000001 8032bda1 00000000 00000000 00000010
s0 s1 s2 s3 s4 s5 s6 s7
00000000 00000020 870c7060 00000020 8700fc00 870ca050 870a77ec 870c0000
t8 t9 k0 k1 gp sp s8 ra
00000000 00000000 00000000 00000000 870bc0d0 8700fb38 00000000 87053d74

8707af40 4448f800 cfc1 t0,$31
PMON> `
由于我们是重新编译的Linux,而您好像直接用的是大赛资源包里面的Linux2.6,我们之前以为这个问题不是普遍性的问题,但是我们隔壁队伍在使用自己核去启动资源包自带的Linux的时候,在打印一些串口信息后,也会弹出这个CFC1指令的错误,我们感觉很奇怪,为什么最后又跑到PMON的指令上去了,所以想问问您有没有这种情况

@SeddonShen
Copy link
Author

拜读了您的Report之后感觉和您当时写的如下片段有相似之处,感觉可能是相似的问题,特来请教您
启动引导异常 在初次遇到问题时,我们直接使用了官方提供的 ucore 而非自己编译的内
核进行引导。在执行时触发了 PMON 的异常,直接跳转到 .v200_msg 段。经过反汇编发现
官方给出的 ucore 存在的一个直接跳转,与我们后续自行编译的跳转不符。我们猜测这是
由于面向 Rom 与面向 Ram 构建的不同,重新构建后程序正常进入启动流程。同时在启动后
续过程中,还存在系统会跳转到 PMON 的异常处理程序的异常行为。检查波形后我们发现
这是我们没有正确实现 CP0-Ebase 寄存器导致的。

@SeddonShen
Copy link
Author

在此先谢谢各位哥哥姐姐了!

@Makiras
Copy link
Member

Makiras commented Aug 14, 2021

这个时间可能比较长,我不太确定能准确回忆起所有的细节

由于面向 Rom 与面向 Ram 构建的不同 这个应该说的是内核启动后的自解压加载到内存这一过程
如果linux启动后,还没有初始化中断处理函数(将对应的异常处理拷贝到通过Ebase+bias计算的地址中),内存中的对应位置应该仍然是PMON的错误处理函数,如果这个时候出错会走PMON的错误处理。

BTW, CFC1 应该是一个浮点指令,在编译时开启 soft-float 一类的指令应该可以workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants