操作系统课程设计 -nachos- lab-new1

本文详细介绍了在 Nachos 操作系统中进行线程测试的过程,包括如何使用 gdb 跟踪 context switch 函数 SWITCH() 和 ThreadRoot() 的执行。内容涵盖如何找到特定函数如 InterruptEnable(), SimpleThread(), ThreadFinish(), ThreadRoot() 的地址,以及如何确定主线程和派生线程的对象地址。同时解析了当主线程和派生线程执行 SWITCH() 函数时,CPU 返回的地址及对应程序位置。" 86426615,7681581,C#实现四则运算题目生成器,"['C#编程', '算法设计', '软件工程', '图形用户界面', '数学运算']
摘要由CSDN通过智能技术生成

nachos的奇奇怪怪的问题太多了,我预测到之后肯定会有好多学弟学妹来问,所以直接放上来存这算了哈哈哈哈~

The main.cc program of Nachos in ../threads/ calls function ThreadTest() as follows:

void

ThreadTest()

{

DEBUG(’t’, "Entering SimpleTest");

Thread *t = new Thread("forked thread");

t->Fork(SimpleThread, 1);

SimpleThread(0);

}

The SimpleThread() function used above is as follows:

void

SimpleThread(_int which)

{

int num;

for (num = 0; num < 5; num++) {

printf("*** thread %d looped %d times\n", (int) which, num);

currentThread->Yield();

}

}

Your tasks of this lab session is to

1. trace the execution of Nachos and observe the executions of

(a) context switch function SWITCH()

(b) function ThreadRoot()

using gdb and

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值