COMP3037 - Laboratory 1

This laboratory should take you less than 3 hours to complete. Make sure you ask your tutor for help if you get stuck.

Installing Linux

Follow the N110 lab instructions on the COMP3037 web site for recovering the machine. You may choose to either install from scratch or to just "sync filesystems" with the master.

kernel source code

Have a look at the kernel source code in /usr/src/linux. Try to find the point in the code that writes out the contents of /proc/cpuinfo when you ask for it.

tags

Look at the man page for ctags (if you use vi) or etags (if you use emacs). Run a tags program on the kernel sources and then use your editor to find the definition of the function sys_unlink(). What does this function do?

Compiling/installing the kernel

Modify the kernel sources to add your name to the contents of /proc/cpuinfo. Then build the kernel using the command "make bzImage". You may wish to get on with some of the homework exercises while waiting for the compile to finish (it will take about 15 minutes).

After the build is complete try to find the resulting bzImage file. Then copy that file to /boot/vmlinuz.test and run the command "lilo". Then reboot, choosing the "test" kernel at the lilo prompt. Did your modification work?

dont_delete

Modify the kernel source code so that it is impossible to delete a file called "dont_delete". Compile your kernel (that should be fast this time as most of it hasn't changed) and see if your change worked.

scp

Use scp or rsync/ssh to transfer the files you modified in the kernel sources to your Solaris student account. Why should you not use ftp?

homework

Do the homework exercises from the first 3 lectures. You can use netscape to view them on the web site. 1