(原文章手抖 误删。。。重新发的)
大部分来自于洋大神哥的:http://yalongyang.com/2012/10/xv6-add-system-call/
题目一:为系统调用添加输出
在syscall.c中的,syscall函数改为
- void
- syscall(void){
- int num;
- num= proc->tf->eax;
- if(num > 0 && num < NELEM(syscalls) &&syscalls[num]) {
- proc->tf->eax = syscalls[num]();
- char* name;
- switch(num){
- case 1:
- name= "fork";
- break;
- case 2:
- name= "exit";
- break;
- case 3:
- name= "wait";
- break;
- case 4:
- name= "pipe";
- break;
- case 5: