In this video, we dive into modifying and compiling a Linux kernel driver, focusing on the pcnet32 driver. The tutorial covers key aspects such as ABI compatibility and module loading. This video is the first of many aimed at advancing practical knowledge in kernel development.
Commands:
Step 1: Install Necessary Tools
sudo apt update
sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev
Step 2: Install the Kernel Source Package
cd /usr/src/
sudo apt install linux-source-{version} # replace version
sudo tar -xjf linux-source-{version}.tar.bz2 # replace version
cd linux-source-{version} # replace version
sudo chown -R {user}:{user} /usr/src/linux-source-{version} # replace version
Step 3: Modify the pcnet driver
nvim drivers/net/ethernet/amd/pcnet32.c
Step 4: Configure the Kernel
cp /boot/config-$(uname -r) .config
make oldconfig
Step 5: Compile
make modules_prepare
cd drivers/net/ethernet/amd
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
Step 6: Unload and Reload new module
lsmod | grep pcnet32
sudo rmmod pcnet32
lsmod | grep pcnet32
sudo insmod ./pcnet32.ko
lsmod | grep pcnet32
sudo dmesg | less
En esta página del sitio puede ver el video en línea Linux Kernel Programming: Driver Modification Tutorial de Duración hora minuto segunda en buena calidad , que subió el usuario The EV Engineer 28 enero 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 7,970 veces y le gustó 265 a los espectadores. Disfruta viendo!