CS430 Homework 1: Linux Kernel Scavanger Hunt
Due Monday, January 27, by the end of the day
The Linux kernel source code is available from kernel.org, or on isoptera in /usr/src. It's also available online. For CS430, you will have to become somewhat familiar with this code, with the goal of understanding how to program inside an operating system.
For this week, do a scavanger hunt, where you must find the following:
- 5 places where a function pointer stored in a struct member. example: fs/btrfs/export.c lines 276-282. These must all be in different structure instances, but more than one may be from the same type of struct.
- 5 places where a function pointer stored in a struct is used to call a function. example: fs/exportfs/expfs.c line 391
- 5 places where a bitwise operator is used. example: arch/x86/pci/common.c line 626
- An amusing comment. "Amusing" here is highly subjective, and you will receive full credit even if I personally am not amused. example: drivers/power/supply/da9052-battery.c lines 345-347
The above examples refer to the source code on /usr/src/linux-source-5.10 on isoptera. This is probably the same as the generic Linux 5.10 source code. In some cases, Linux distributions use modified kernel source code, especially when specialized. Generally Linux distributions contain a mechanism to obtain the same source code used for the (binary) kernel. For Debian and Ubuntu, It's provided as a package called "linux-source", and this is how the source code on isoptera was obtained. Since generating the above examples, I've updated the kernel on isoptera to a 6-series kernel.
Extensive modification is more likely on distributions such as SteamOS or Android, which have a specific purpose other than general computing.
Turning in the assignment
Upload a file to the "course work uploads" explaining where you found the above items.