uCore-Tutorial-Guide-2023S
Documentation of uCore-Tutorial-Guide-2023S
Deployed version can be found here.
This project forked from learningos/ucore-tutorial-guide-2022a
License: GNU General Public License v3.0
Documentation of uCore-Tutorial-Guide-2023S
Deployed version can be found here.
https://learningos.github.io/uCore-Tutorial-Guide-2023S/chapter0/1setup-devel-env.html
ucore ch5练习中,在usershell运行ch5_mergetest,会产生如下错误:
ch5_mergetest代码如下:
可以看到ch5_mergetest并未得到待测试程序的名称,因而打印出的目标测试程序名称均为null。
通过测试发现数组TESTS和FAILES中的数据均为0,因此ch5_mergetest获得的程序名均为空指针,导致错误。
修改Makefile,将ch5_mergetest添加到ch5的测试程序集(ch5原始Makefile好像并未包括该程序),并在usershell中执行ch5_mergetest;
或者在任一用户程序中创建全局变量char * str = "waku";
,并在main函数中尝试打印。
链接器在链接ucore用户态程序时,会把TESTS和FAILS放到名为.data.rel.local的section中,初始化为0,且该段在链接器链接过程中中符号没有重定位。导致最终TESTS、FAILS等数组内容为空。(猜测可能是由于TESTS、FAILS等全局变量引用了常量字符串,被编译器优化为在 运行时 进行重定位,而ucore不提供运行时重定位功能,导致问题发生。
在用户程序的链接选项中添加-static
参数,可以避免这一问题。
通过测试发现:
推测可能是由于编译器的某种优化策略导致。
https://learningos.github.io/uCore-Tutorial-Guide-2023S/chapter2/0intro.html
https://learningos.github.io/uCore-Tutorial-Guide-2023S/chapter6/2fs-implementation.html
https://learningos.github.io/uCore-Tutorial-Guide-2023S/chapter2/1rv-privilege.html
https://learningos.github.io/uCore-Tutorial-Guide-2023S/chapter1/0intro.html
https://learningos.github.io/uCore-Tutorial-Guide-2023S/chapter6/0intro.html
https://learningos.github.io/uCore-Tutorial-Guide-2023S/chapter5/3shell-and-binloader.html
https://learningos.github.io/uCore-Tutorial-Guide-2023S/chapter3/4time-sharing-system.html
https://learningos.github.io/uCore-Tutorial-Guide-2023S/chapter6/1fs-interface.html
https://learningos.github.io/uCore-Tutorial-Guide-2023S/chapter1/2remove-std.html
https://learningos.github.io/uCore-Tutorial-Guide-2023S/chapter4/3sv39-implementation-1.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.