Skip to content

This is a simple example of using procfs in the device drivers.

Notifications You must be signed in to change notification settings

4etell/simple-linux-device-driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cb2dbf1 · Jul 17, 2023

History

9 Commits
Jan 19, 2022
Jan 23, 2022
Jul 17, 2023
Jul 17, 2023

Repository files navigation

Linux Device Driver

Introduction

This is a simple example of using procfs in the device drivers. A user-level program receives input command-line arguments to identify the required path to the target structure(task_struct or pt_regs) from the system tables, transfers it to the kernel level, gets information from this structure and prints the structure. The kernel module code in the driver.c file. User application code in the usr.c file.

Building and Using driver

  1. Build the driver by using Makefile (sudo make)
  2. Load the driver using sudo insmod driver.ko
  3. Compile user application gcc -o usr usr.c
  4. Usage: ./usr struct_id PID Avaliable struct_id: 0 - pt_regs, 1 - task_struct.

About

This is a simple example of using procfs in the device drivers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published