There are too many expriments this semester.
As for OS, recompiling the Linux kernel is the very first job to do intending to add a new system function. I managed it under Ubuntu 16.04, 4.4.0.
And then I finished writing a simulation of file management which implemented
pwd and so on.
First you need a VMware machine. There are many tutorials on the Internet.
Then you need the source code of linux kernel and the tools to compile it.
After the above commands, you may see a folder, which name is
First, change dir to
/arch/x86/entry/syscalls. Then add a new line at the end of the
syscal_64.tbl. For me, i add
546 common newcall sys_newcall.
Then, change dir to
/include/linux, and add a newline like
asmlinkage long sys_newcall(int x);.
Last, modify the
kernel/Makefile to add
Change dir to
Write test.c like:
The following code still needs some tests.