Files to change in CentOS Linux The following list is a starting point for adding a simple kernel service.
Possible files to change in CentOS /usr/src/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.s390x/arch/s390/mm/fault.c /usr/src/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.s390x/arch/s390/kernel/syscalls.S /usr/src/kernels/2.6.18-92.el5-s390x/include/asm-s390/unistd.h /usr/src/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.s390x/include/asm-s390/unistd.h /usr/include/asm/unistd.h --------- The following file is for PCs only ---------- /usr/src/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.s390x/arch/i386/kernel/syscall_table.S
Contents, by number on previous slide “mm/fault.c”: Your code for the service call “syscalls.S”: Builds the syscall table “../kernels../unistd.h”: Defines the name & number of the call “../redhat/BUILD/../unistd.h”: Same as above “/usr/include/asm/unistd.h”: Contains the include values for the kernel itself to determine what facilities are available at compile time ---------------------------------------------- “syscall_table.S”: Defines the name as a “long”
Names I used (for my own solution) …/fault.c: sys_DJ_fault_tracker 311 …/BUILD…/unistd.h “ /usr/include/asm/unistd.h “ (allows TESTING pgm to use a name instead of 311) …/kernels…/asm-s390/unistd.h __NR_DJ_fault_tracker 311 (note that this one is different, but it doesn’t hurt because it isn’t referenced by fault.c) …/syscalls.S (sys_DJ_fault_tracker, sys_DJ_fault_tracker, sys_DJ_fault_tracker) yes, all 3 parameters are the same!!! The whole point of using a NAME like __NR_DJ_fault_tracker, instead of the number is that, users do not have to use raw numbers. Raw numbers lead to errors. Names are better (for humans anyway). Of course, you should use your own names for the files!!!!