Program Assignment Three, CSCI 523, Advanced Operating Systems Write a new system call that announces itself with a kernel message. 1. Use Start > System > Yast > Security & Users > Edit and Create Users to create a new user account. 2. Copy a clean version of the source tree to your directory. Be able to demo your source modifications from that new account. 3. Decide on the name of the system call and a number based upon an unused slot in the entry.S syscall table. This service must be unique to the class. You may not develop a system service with a classmate. 4. Write a user-level test program that calls the new system service that you decided upon in step one. Your test program is located in a separate file from the system service trap. In other words, your test program is compiled separately from the new system service but they are linked together at load time. 5. Write the custom library routine (a stand alone source file containing the new system service) that you decided in step one. As noted in step 2, it is called from user programs and it traps into the kernel. You may use the assembly routines we discussed earlier such as: movl $x, %eax ;offset in syscall table to sys_new_service int $0x80 ;trap into kernel or you may want to try the "_syscallx" macros found in /usr/include/asm/unistd.h where "x" is the number of parameters to pass into the kernel. For example here is the definition of _syscall0 #define _syscall0(type, name) type name(void) { \ long __res; \ __asm__ volatile ("int $0x80" \ : "=a" (__res) \ : "0" (__NR_##name) ); \ __syscall_return(type, __res); \ } One more point. The above macro depends on the string "name" to be added to the string "__NR_" to match the pre-defined asm/unistd.h strings "#define __NR_name xxx" where xxx is the table offset into the syscall table defined in entry.S. (You do not have to modify the asm/unistd.h file, instead just include the #include and the #define __NR_name pre-processor directives in your custom library file.) 6. Using the file linux/kernel/sys.c, add a "asmlinkage ssize_t sys_your_service()" routine which prints "Hi Mom" on the console. So that your new routine may be seen by the linking loader when it needs the address for the sys_call table, be sure to use the "EXPORT_SYMBOL(sys_your_service)" macro with your new routine. 7. Modify /usr/src/Linux/i386/kernel/entry.S file so that a new entry at the end of your table has the address of your "sys_your_service()" routine. Remember, this table offset number must match the number you use step 3. 8. Recompile and boot the new kernel. To copy your new bzImage file over to /boot folder, you will have to be superuser. Just type "su" and give the password. The new "#" prompt means you are now the superuser. 9. Type D to return to being a regular user and compile the user test program. Then cross your fingers, and run it.