- source ../CoWare.csh -pa
- scide
星期四, 12月 11, 2008
星期三, 12月 10, 2008
星期二, 12月 09, 2008
SystemCall addition
Kernel Space:
REF:
- 在 kernel/sys.c 新增函式,並EXPORT
- include/asm-xxx/unistd.h 新增中斷號碼。
NR_syscalls 記得+1. - arch/i386/kernel/entry.S ( < 2.6.12 ) or syscall_table.S(>2.6.12)
+.long sys_xxx
- include/asm/unistd_32.h 新增與Kernel相同的號碼的define.
- include/bits/syscall.h
#define SYS_xxx __NR_xxx
static inline _syscall2(long, NEW, int, arg1, int, arg2);
/*linux中一共定義了7種不同的_syscall*,在 unistd.h 裡面
可以看到,若定義 system call 有要傳參數的話必需使用別
的 _syscall
*/_syscall1(int,addtotal,int, num)
- test
#include
_syscall2(long, hello, int, arg1, int, arg2);
int main(){
printf(" %d \n", hello(1, 2) );
return 0;
}
- 新版kernel已改為 syscall ,不再使用舊的那七種方式
- #include
#include
#include
//static inline _syscall2(long, NEW, int, arg1, int, arg2);
int main(){
time_t tt;
// time(&tt );
syscall( 13, &tt );
printf("tt=%d\n", tt );
}
- #include
REF:
- http://www.csie.ncu.edu.tw/~hsufh/COURSES/FALL2007/syscall.html
標籤:
【Programming】
星期五, 12月 05, 2008
MIPS Instruction set format
R-Type Instructions (Opcode 000000)
opcode (6) | rs (5) | rt (5) | rd (5) | sa (5) | function (6) |
I-Type Instructions (All opcodes except 000000, 00001x, and 0100xx)
opcode (6) | rs (5) | rt (5) | immediate (16) |
J-Type Instructions (Opcode 00001x)
opcode (6) | target (26) |
Coprocessor Instructions (Opcode 0100xx)
opcode (6) | format (5) | ft (5) | fs (5) | fd (5) | function (6) |
Reference:
- Page URL: http://www.d.umn.edu/~gshute/spimsal/talref.html
- http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPSir.html
- http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPS_slides/
標籤:
【學校、課業、論文】
訂閱:
文章 (Atom)