操作系统的坑(更新)

Operating Systems

Figure2.1

#include<stdio.h>
#include<stdlib.h>
#include<sys/time.h>
#include<assert.h>
#include"common.h"
int main(int argc,char*argv[]){
        if(argc!=2){
                fprintf(stderr, "usage:cpu<string>\n");
                exit(1);
        }
        char *str=argv[1];
        while(1){
                Spin(1);
                printf("%s\n",str);
        }
return 0;
}
需要从 [   ]code.threads-intro.tgz  下载,可以用上写过的py软件

 

Figure2.2只需要&,;去除

 

 

 

 

https://bbs.csdn.net/topics/280002263 虽然不算写时复制,很好的解决了想的问题:一样的地址映射不同物理地址。

 

 是包中的common_threads.h头文件.

posted @ 2020-04-30 21:56  世界を変える御宅族  阅读(313)  评论(0编辑  收藏  举报