0% found this document useful (0 votes)
38 views3 pages

Assignment 2 + Project

project for kali linux,

Uploaded by

Nasir Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views3 pages

Assignment 2 + Project

project for kali linux,

Uploaded by

Nasir Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Project + Assignment 2: Implementing a Custom Linux Kernel on a Virtual Machine

Objective
The purpose of this assignment is to provide students with hands-on experience in configuring, modifying,
compiling, and installing a custom Linux kernel in a virtual machine environment. This exercise will help
students understand the intricacies of the Linux kernel and operating system internals.
Assignment Overview
You will:
1. Set up a development environment using a virtual machine.
2. Download and configure the Linux kernel source code.
3. Optionally, modify the kernel to add new functionality or change existing features.
4. Compile the kernel and install it on your virtual machine.
5. Test and debug the custom kernel to ensure it works correctly.
Steps and Guidance
1. Set Up Your Development Environment
Task: Install a virtual machine (VM) and set up a Linux development environment.
Guidance:
- Choose a VM tool such as VirtualBox, VMware.
- Install a Linux distribution (e.g., Ubuntu, kali Linux) within your VM.
- Install essential development packages:
Commands:
sudo apt-get update

sudo apt-get install build-essential git libncurses5-dev bison flex libssl-dev libelf-dev

2. Download the Linux Kernel Source Code


Task: Clone the Linux kernel source code from the official repository.
Guidance:
- Open a terminal and run the following commands:
git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

cd linux-stable

3. Configure the Kernel


Task: Configure the kernel using the current system configuration as a starting point.
Guidance:
- Copy the existing kernel configuration:
cp /boot/config-$(uname -r) .config

- Open the kernel configuration menu:


make menuconfig

- Navigate through the menu to enable or disable features as needed.


4. Modify the Kernel (Optional)
Task: Implement a new feature or modify an existing one in the kernel source code.
Guidance:
- Identify the part of the kernel you wish to modify (e.g., adding a new system call, modifying a scheduler).
- Make your changes in the appropriate source files. For example, to add a new system call, you might edit
files in the kernel directory.
5. Build the Kernel
Task: Compile the kernel and its modules.
Guidance:
- Compile the kernel with:
make -j$(nproc)

make modules_install

- Install the new kernel:


sudo make install

6. Configure the Bootloader


Task: Update the bootloader to recognize the new kernel.
Guidance:
- Update GRUB (assuming you are using GRUB):
sudo update-grub

7. Reboot and Test the New Kernel


Task: Reboot the VM and test the new kernel to ensure it is functioning correctly.
Guidance:
- Reboot the virtual machine and select the new kernel from the bootloader menu.
- Verify the new kernel is running:
uname –r
8. Debugging and Iteration
Task: Monitor the system for any issues, debug as necessary, and iterate on your changes.
Guidance:
- Use dmesg to check kernel messages:
dmesg | less

- If you encounter issues, revert to a previous snapshot of your VM (if you created one) and try to identify
and fix the problem.
Deliverables
1. Report: Document each step you took, including configurations, modifications, and any issues you
encountered and how you resolved them.
2. Source Code: Submit any modified kernel source files.
3. Demonstration: Provide a screenshots demonstrating the new kernel running on your virtual machine.
Evaluation Criteria
- Documentation: Clear and comprehensive documentation of the process and any issues encountered.
Additional Resources
- The Linux Kernel documentation (https://www.kernel.org/doc/html/latest/)
- Linux From Scratch (http://www.linuxfromscratch.org/)
- Kernel Newbies (https://kernelnewbies.org/)
Tips
- Regularly back up your virtual machine state.
- Make small, incremental changes and test each one thoroughly.
This assignment is designed to challenge you and provide a deep understanding of operating system
concepts through practical application. Good luck!

You might also like