Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kernel Exercise 5 Brandon Cline Stuart Fischer Rachel Langhans Brian Minter Adam Stasio.

Similar presentations


Presentation on theme: "Kernel Exercise 5 Brandon Cline Stuart Fischer Rachel Langhans Brian Minter Adam Stasio."— Presentation transcript:

1 Kernel Exercise 5 Brandon Cline Stuart Fischer Rachel Langhans Brian Minter Adam Stasio

2 Problem Statement Add a new function of return type “int” to the Linux kernel called “pedagogictime(int flag, struct timeval *thetime)” This function should return the current system time using a reference parameter If the “flag” parameter is TRUE, the function should print the system time using stdout. Function should return TRUE if successful, FALSE otherwise. Create a user-space program to test the new system call

3 Why Modify the Kernel? Changing the kernel allows a user to customize the OS for his or her individual needs. Kernel functions execute in kernel mode and have direct access to kernel variables and hardware I/O but can be initiated in user space. An effectively modified kernel/OS can enhance the productivity of a company or organization.

4 Modified Files /usr/src/linux-2.2.14/arch/i386/kernel/entry.S /usr/src/linux-2.2.14/include/asm/unistd.h /usr/src/linux-2.2.14/kernel/Makefile

5 entry.S At the end of the list of.long SYMBOL_NAME(…) statements, we added the entry for our system call.long SYMBOL_NAME(sys_pedagogictime)

6 unistd.h At the end of the list of #define __NR_…### We added: #define __NR_pedagogictime191

7 Makefile O_TARGET := kernel.o O_OBJS = …pedagogictime.o

8 Created Files /usr/src/linux-2.2.14/include/linux/pedagogictime.h –The header file for the system call’s operational code /usr/src/linux-2.2.14/kernel/pedagogictime.c –The system call’s operational code /mytest.c –The program used to test the new system call

9 Process for Rebuilding the Kernel make clean make oldconfig make dep OR make depend make make install reboot

10 Difficulties Encountered Creation of the stub using the syscall2() reference Instructions in the exercise book were geared towards mandrake Figuring out how to reference external variables Correct de-referencing of passed structs Make sometimes unable to locate files that we did not modify and were correctly placed. This was fixed by altering the associated #include statements. Some group members unfamiliar with C

11 Summary… What we learned How to modify the Linux kernel. Alterations to the kernel can improve productivity Versions of Linux are often different from one another requiring different methods of modification. Making changes to the Linux kernel is a fairly simple process, though it does take a while to learn to do effectively.


Download ppt "Kernel Exercise 5 Brandon Cline Stuart Fischer Rachel Langhans Brian Minter Adam Stasio."

Similar presentations


Ads by Google