

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Technical Guide & Operating Systems Lab Manual
University: Gujarat Technological University (GTU) Course: Operating Systems & Linux Internals Document Type: Research Project / Technical Guide
Loadable Kernel Modules are object files that can be dynamically loaded into and unloaded from the running Linux kernel without requiring a system reboot. They extend kernel functionality to support new hardware devices, filesystems, or system calls.
Character devices stream data as a sequence of bytes (e.g., serial ports, sensors, keyboard inputs). Creating a custom pseudo character driver involves:
Allocating and registering a major/minor device number range using alloc_chrdev_region(). Initializing the cdev structure and linking file operations (file_operations). Exporting device nodes to user space using class_create() and device_create().
File Operations Structure Example
static struct file_operations fops = { .owner = THIS_MODULE, .open = dev_open, .read = dev_read, .write = dev_write, .release = dev_release, };
Because user space and kernel space maintain separate virtual memory address spaces, direct pointer dereferencing between spaces is prohibited. Secure data transmission utilizes kernel APIs: copy_to_user() to send data from kernel buffers to user applications, and copy_from_user() to ingest user input parameters.