Skip to content

Project 7

This is fine

In this project, you are tasked with implementing a simple kernel module that will allow you to add a new system call in the kernel.

Learning Objectives

  • 2.2 Explore the system call interface
  • 2.3 Show an understanding of the difference between user and kernel space

Grading Rubric

Make sure and review the class grading rubric so you know how your project will be graded.

Overview

This Project will be assigned in class. We will be using AWS and their EC2 instances to build and test our kernel module. You will need to have a basic understanding of how to use AWS and how to build and install a kernel module.

AWS released a new hypervisor in called Nitro that allows us to run our own kernel modules and debug issues pre-boot, this was something that was not possible just a few years ago so we will be on the cutting edge of technology! This is a fantastic opportunity to learn how to leverage the cloud to do some low-level debugging!

Building the Kernel

Here are the steps to build and install the kernel to make sure everything is working correctly. These instructions are for Fedora 38+.

  1. Install all the required dependencies and build tools as described in the minimal build instructions in the kernel README. These tools will be in different packages depending on your distribution. For Fedora, you can run the following command:

    bash
    sudo dnf install -y gcc make flex bison elfutils-libelf-devel openssl-devel bc llvm clang lld openssl openssl-devel dwarves
  2. Make a new directory to build clone the kernel source

    bash
    mkdir -p ~/kernel && cd ~/kernel
  3. Clone Linus's tree from git.kernel.org

    bash
    git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  4. Generate a default configuration file from your local kernel configuration so you can build the kernel and required modules.

    bash
    make localmodconfig

Rust for Linux (RFL)

Released under the MIT License.