?? process.c.txt
字號:
any problems,send mails to sindybear@163.com
相關文件
/fs/exec.c
這個文件主要是關于
(1)
//這是執(zhí)行一個命令的系統(tǒng)調(diào)用
asmlinkage int sys_execve(struct pt_regs regs)
filename = getname((char *) regs.ebx);
error = PTR_ERR(filename);
if (IS_ERR(filename))
goto out;
//函數(shù)do_execve定義在fs/exec.c中
//執(zhí)行這個命令
error = do_execve(filename, (char **) regs.ecx, (char **) regs.edx, ®s);
(2)
void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
……
tss->esp0 = next->esp0; //更新tss中的0層堆棧指針。
…… //其它關于權限的操作
(3)
int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
/*
* 這個函數(shù)其實等同于系統(tǒng)調(diào)用clone()
*/
__asm__ __volatile__(
"movl %%esp,%%esi\n\t"
"int $0x80\n\t" //調(diào)用sys_clone系統(tǒng)調(diào)用
"cmpl %%esp,%%esi\n\t" //檢查進程號
"je 1f\n\t" //如果是父進程,就跳出結(jié)束。
"movl %4,%%eax\n\t" //設置參數(shù)
"pushl %%eax\n\t"
"call *%5\n\t" //調(diào)用線程函數(shù)
"movl %3,%0\n\t" //推出
"int $0x80\n"
"1:\t"
:"=&a" (retval), "=&S" (d0)
:"0" (__NR_clone), "i" (__NR_exit),
"r" (arg), "r" (fn),
"b" (flags | CLONE_VM)
: "memory");
return retval;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -