Suche senden
Hochladen
Introduction to Linux Drivers
•
28 gefällt mir
•
65,405 views
Anil Kumar Pugalia
Folgen
Technologie
Melden
Teilen
Melden
Teilen
1 von 29
Empfohlen
Network Drivers
Network Drivers
Anil Kumar Pugalia
I2C Drivers
I2C Drivers
SysPlay eLearning Academy for You
Bootloaders
Bootloaders
Anil Kumar Pugalia
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
Spi drivers
Spi drivers
pradeep_tewani
Interrupts
Interrupts
Anil Kumar Pugalia
SPI Drivers
SPI Drivers
SysPlay eLearning Academy for You
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
linuxlab_conf
Empfohlen
Network Drivers
Network Drivers
Anil Kumar Pugalia
I2C Drivers
I2C Drivers
SysPlay eLearning Academy for You
Bootloaders
Bootloaders
Anil Kumar Pugalia
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
Spi drivers
Spi drivers
pradeep_tewani
Interrupts
Interrupts
Anil Kumar Pugalia
SPI Drivers
SPI Drivers
SysPlay eLearning Academy for You
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
linuxlab_conf
Platform Drivers
Platform Drivers
SysPlay eLearning Academy for You
USB Drivers
USB Drivers
Anil Kumar Pugalia
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
RuggedBoardGroup
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
Emertxe Information Technologies Pvt Ltd
Understanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panic
Joseph Lu
Introduction Linux Device Drivers
Introduction Linux Device Drivers
NEEVEE Technologies
Linux device drivers
Linux device drivers
Emertxe Information Technologies Pvt Ltd
Linux dma engine
Linux dma engine
pradeep_tewani
linux device driver
linux device driver
Rahul Batra
U Boot or Universal Bootloader
U Boot or Universal Bootloader
Satpal Parmar
DMA Survival Guide
DMA Survival Guide
Kernel TLV
Character Drivers
Character Drivers
Anil Kumar Pugalia
Porting Android
Porting Android
Opersys inc.
Linux Kernel Overview
Linux Kernel Overview
Anil Kumar Pugalia
Block Drivers
Block Drivers
Anil Kumar Pugalia
Linux SD/MMC device driver
Linux SD/MMC device driver
艾鍗科技
U-Boot Porting on New Hardware
U-Boot Porting on New Hardware
RuggedBoardGroup
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
RajKumar Rampelli
Board Bringup
Board Bringup
Anil Kumar Pugalia
File System Modules
File System Modules
Anil Kumar Pugalia
References
References
Anil Kumar Pugalia
Weitere ähnliche Inhalte
Was ist angesagt?
Platform Drivers
Platform Drivers
SysPlay eLearning Academy for You
USB Drivers
USB Drivers
Anil Kumar Pugalia
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
RuggedBoardGroup
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
Emertxe Information Technologies Pvt Ltd
Understanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panic
Joseph Lu
Introduction Linux Device Drivers
Introduction Linux Device Drivers
NEEVEE Technologies
Linux device drivers
Linux device drivers
Emertxe Information Technologies Pvt Ltd
Linux dma engine
Linux dma engine
pradeep_tewani
linux device driver
linux device driver
Rahul Batra
U Boot or Universal Bootloader
U Boot or Universal Bootloader
Satpal Parmar
DMA Survival Guide
DMA Survival Guide
Kernel TLV
Character Drivers
Character Drivers
Anil Kumar Pugalia
Porting Android
Porting Android
Opersys inc.
Linux Kernel Overview
Linux Kernel Overview
Anil Kumar Pugalia
Block Drivers
Block Drivers
Anil Kumar Pugalia
Linux SD/MMC device driver
Linux SD/MMC device driver
艾鍗科技
U-Boot Porting on New Hardware
U-Boot Porting on New Hardware
RuggedBoardGroup
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
RajKumar Rampelli
Board Bringup
Board Bringup
Anil Kumar Pugalia
Was ist angesagt?
(20)
Platform Drivers
Platform Drivers
USB Drivers
USB Drivers
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
Understanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panic
Introduction Linux Device Drivers
Introduction Linux Device Drivers
Linux device drivers
Linux device drivers
Linux dma engine
Linux dma engine
linux device driver
linux device driver
U Boot or Universal Bootloader
U Boot or Universal Bootloader
DMA Survival Guide
DMA Survival Guide
Character Drivers
Character Drivers
Porting Android
Porting Android
Linux Kernel Overview
Linux Kernel Overview
Block Drivers
Block Drivers
Linux SD/MMC device driver
Linux SD/MMC device driver
U-Boot Porting on New Hardware
U-Boot Porting on New Hardware
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
Board Bringup
Board Bringup
Andere mochten auch
File System Modules
File System Modules
Anil Kumar Pugalia
References
References
Anil Kumar Pugalia
PCI Drivers
PCI Drivers
Anil Kumar Pugalia
Serial Drivers
Serial Drivers
SysPlay eLearning Academy for You
Embedded C
Embedded C
Anil Kumar Pugalia
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
gcc and friends
gcc and friends
Anil Kumar Pugalia
Audio Drivers
Audio Drivers
Anil Kumar Pugalia
Video Drivers
Video Drivers
Anil Kumar Pugalia
Kernel Programming
Kernel Programming
Anil Kumar Pugalia
Low-level Accesses
Low-level Accesses
Anil Kumar Pugalia
Linux Porting
Linux Porting
Anil Kumar Pugalia
BeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
SysPlay eLearning Academy for You
File Systems
File Systems
Anil Kumar Pugalia
Andere mochten auch
(14)
File System Modules
File System Modules
References
References
PCI Drivers
PCI Drivers
Serial Drivers
Serial Drivers
Embedded C
Embedded C
Kernel Debugging & Profiling
Kernel Debugging & Profiling
gcc and friends
gcc and friends
Audio Drivers
Audio Drivers
Video Drivers
Video Drivers
Kernel Programming
Kernel Programming
Low-level Accesses
Low-level Accesses
Linux Porting
Linux Porting
BeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
File Systems
File Systems
Ähnlich wie Introduction to Linux Drivers
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
SysPlay eLearning Academy for You
Processes
Processes
Anil Kumar Pugalia
Quick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIO
Chris Simmonds
BeagleBone Black Booting Process
BeagleBone Black Booting Process
SysPlay eLearning Academy for You
Introduction to Linux
Introduction to Linux
Anil Kumar Pugalia
Introduction to Linux
Introduction to Linux
Anil Kumar Pugalia
Symm.63
Symm.63
weiguang sun
Cooking security sans@night
Cooking security sans@night
jtimberman
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
Anil Kumar Pugalia
Reducing the boot time of Linux devices
Reducing the boot time of Linux devices
Chris Simmonds
IBM Lotusphere 2012 Show301: Leveraging the Sametime Proxy to support Mobile ...
IBM Lotusphere 2012 Show301: Leveraging the Sametime Proxy to support Mobile ...
William Holmes
Chapter17 Using SMPE.ppt
Chapter17 Using SMPE.ppt
Flavio787771
Embedded Applications
Embedded Applications
Anil Kumar Pugalia
Damn Simics
Damn Simics
reinhardx
SR-IOV Introduce
SR-IOV Introduce
Lingfei Kong
Introduction to Embedded Systems
Introduction to Embedded Systems
Anil Kumar Pugalia
TWS 8.6 new features (from the 2013 European Tour)
TWS 8.6 new features (from the 2013 European Tour)
Nico Chillemi
리눅스 드라이버 #2
리눅스 드라이버 #2
Sangho Park
Release notes 3_d_v61
Release notes 3_d_v61
sundar sivam
Linux scheduler
Linux scheduler
Liran Ben Haim
Ähnlich wie Introduction to Linux Drivers
(20)
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
Processes
Processes
Quick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIO
BeagleBone Black Booting Process
BeagleBone Black Booting Process
Introduction to Linux
Introduction to Linux
Introduction to Linux
Introduction to Linux
Symm.63
Symm.63
Cooking security sans@night
Cooking security sans@night
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
Reducing the boot time of Linux devices
Reducing the boot time of Linux devices
IBM Lotusphere 2012 Show301: Leveraging the Sametime Proxy to support Mobile ...
IBM Lotusphere 2012 Show301: Leveraging the Sametime Proxy to support Mobile ...
Chapter17 Using SMPE.ppt
Chapter17 Using SMPE.ppt
Embedded Applications
Embedded Applications
Damn Simics
Damn Simics
SR-IOV Introduce
SR-IOV Introduce
Introduction to Embedded Systems
Introduction to Embedded Systems
TWS 8.6 new features (from the 2013 European Tour)
TWS 8.6 new features (from the 2013 European Tour)
리눅스 드라이버 #2
리눅스 드라이버 #2
Release notes 3_d_v61
Release notes 3_d_v61
Linux scheduler
Linux scheduler
Mehr von Anil Kumar Pugalia
File System Modules
File System Modules
Anil Kumar Pugalia
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
System Calls
System Calls
Anil Kumar Pugalia
Embedded Software Design
Embedded Software Design
Anil Kumar Pugalia
Playing with R L C Circuits
Playing with R L C Circuits
Anil Kumar Pugalia
Shell Scripting
Shell Scripting
Anil Kumar Pugalia
Functional Programming with LISP
Functional Programming with LISP
Anil Kumar Pugalia
Power of vi
Power of vi
Anil Kumar Pugalia
"make" system
"make" system
Anil Kumar Pugalia
Hardware Design for Software Hackers
Hardware Design for Software Hackers
Anil Kumar Pugalia
RPM Building
RPM Building
Anil Kumar Pugalia
Linux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
Anil Kumar Pugalia
Linux Network Management
Linux Network Management
Anil Kumar Pugalia
System Calls
System Calls
Anil Kumar Pugalia
Timers
Timers
Anil Kumar Pugalia
Threads
Threads
Anil Kumar Pugalia
Synchronization
Synchronization
Anil Kumar Pugalia
Processes
Processes
Anil Kumar Pugalia
Signals
Signals
Anil Kumar Pugalia
Linux Memory Management
Linux Memory Management
Anil Kumar Pugalia
Mehr von Anil Kumar Pugalia
(20)
File System Modules
File System Modules
Kernel Debugging & Profiling
Kernel Debugging & Profiling
System Calls
System Calls
Embedded Software Design
Embedded Software Design
Playing with R L C Circuits
Playing with R L C Circuits
Shell Scripting
Shell Scripting
Functional Programming with LISP
Functional Programming with LISP
Power of vi
Power of vi
"make" system
"make" system
Hardware Design for Software Hackers
Hardware Design for Software Hackers
RPM Building
RPM Building
Linux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
Linux Network Management
Linux Network Management
System Calls
System Calls
Timers
Timers
Threads
Threads
Synchronization
Synchronization
Processes
Processes
Signals
Signals
Linux Memory Management
Linux Memory Management
Kürzlich hochgeladen
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Patryk Bandurski
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
AndikSusilo4
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Pooja Nehwal
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
2toLead Limited
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Delhi Call girls
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Scott Keck-Warren
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Alan Dix
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Pixlogix Infotech
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
Softradix Technologies
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
BookNet Canada
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
naman860154
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Mark Billinghurst
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
Key Features Of Token Development (1).pptx
Key Features Of Token Development (1).pptx
LBM Solutions
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Safe Software
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
ThousandEyes
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Memoori
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
Neo4j
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Delhi Call girls
Kürzlich hochgeladen
(20)
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Key Features Of Token Development (1).pptx
Key Features Of Token Development (1).pptx
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Introduction to Linux Drivers
1.
© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Introduction to Linux Drivers
2.
2© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? After this session, you would know W's of Linux Drivers Ecosystem of Linux Drivers Types of Linux Drivers Vertical & Horizontal Driver Layering Various Terminologies in vogue Linux Driver related Commands & Configs Using a Linux Driver Our First Linux Driver
3.
3© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. W's of Linux Drivers What is a Driver? What is a Linux Driver? Is Linux Device Driver = Linux Driver? Why we need a Driver? What are the roles of Linux Driver?
4.
4© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Functions of an OS Process / Time / Processor Management Memory Management Device I/O Management Storage Management Network Management
5.
5© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Linux as an OS So, Linux also has the same structure Visually, can be shown as
6.
6© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Linux Driver Ecosystem bash gvim X Server gcc firefox ` Process Management ssh Memory Management File Systems Device Control Networking Architecture Dependent Code Character Drivers & Friends Memory Manager Filesystem Layer Block Layer & Drivers Network Subsystem Interface Drivers Concurrency MultiTasking Virtual Memory Files & Dirs: The VFS Ttys & Device Access Connectivity CPU Memory Disks & CDs Consoles, etc Network Interfaces Hardware Protocol Layers like PCI, USB, I2C, RS232, ...
7.
7© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Kernel Source Organization /usr/src/linux/ net drivers block fs mm init arch/<arch> char mtd/ide net pci ...usbserial include asm-<arch>linux kernel ipc lib scripts toolsscripts crypto firmware security sound ...
8.
8© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. W's of a Module? Hot plug-n-play Driver Dynamically Loadable & Unloadable Linux – the first OS to have such a feature Later many followed suit Enables fast development cycle File: <module>.ko (Kernel Object) <module>.o wrapped with kernel signature Std Modules Path /lib/modules/<kernel version>/kernel/... Module Configuration: /etc/modprobe.conf
9.
9© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Module Commands Typically needs root permission Resides in /sbin Operates over the kernel-module i/f Foundation of Driver Development Need to understand thoroughly
10.
10© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Listing Modules Command: lsmod Fields: Module, Size, Used By Kernel Window: /proc/modules Are these listed modules static or dynamic?
11.
11© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Loading Modules Command: insmod <module_file> Go to modules directory and into fs/vfat Try: insmod vfat.ko
12.
12© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Unloading Modules Command: rmmod <module_name> Try: rmmod fat
13.
13© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Auto Loading Modules Command: modprobe <module_name> Try: modprobe vfat
14.
14© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Kernel Windows Through virtual filesystems /proc /sys Command: cat <window_file> System Logs: /var/log/messages Command: tail /var/log/messages dmesg | tail
15.
15© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Other Useful Commands Disassemble: objdump -d <object_file> List symbols: nm <object_file>
16.
16© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Command Summary lsmod insmod modprobe rmmod dmesg objdump nm
17.
17© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. The First Linux Driver
18.
18© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. The Kernel's C Normal C but without access to Standard Headers (/usr/include) Standard Libraries (/usr/lib) Then, what? Kernel Headers @ <kernel src>/include Kernel Function Collection @ <kernel src>/kernel <kernel src>/ipc <kernel src>/lib gcc need to be tuned to compile “Kernel C” Kernel C is a beautiful example of implementing object oriented code using pure C
19.
19© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. The Module Constructor static int __init mfd_init(void) { ... return 0; } module_init(mfd_init);
20.
20© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. The Module Destructor static void __exit mfd_exit(void) { ... } module_exit(mfd_exit);
21.
21© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. printk – Kernel's printf Header: <linux/kernel.h> Arguments: Same as printf Format Specifiers: All as in printf, except float & double related Additionally, a initial 3 character sequence for Log Level KERN_EMERG "<0>" /* system is unusable */ KERN_ALERT "<1>" /* action must be taken immediately */ KERN_CRIT "<2>" /* critical conditions */ KERN_ERR "<3>" /* error conditions */ KERN_WARNING "<4>" /* warning conditions */ KERN_NOTICE "<5>" /* normal but significant condition */ KERN_INFO "<6>" /* informational */ KERN_DEBUG "<7>" /* debug-level messages */
22.
22© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. The Module Constructor (revisited) static int __init mfd_init(void) { printk(KERN_INFO "mfd registered"); ... return 0; } module_init(mfd_init);
23.
23© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. The Module Destructor (revisited) static void __exit mfd_exit(void) { printk(KERN_INFO "mfd deregistered"); ... } module_exit(mfd_exit);
24.
24© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. The Other Basics & Ornaments Basic Headers #include <linux/module.h> #include <linux/version.h> #include <linux/kernel.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("Anil Kumar Pugalia"); MODULE_DESCRIPTION("First Device Driver");
25.
25© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Building the Module For building our driver, it needs The Kernel Headers for Prototypes The Kernel Functions for Functionality The Kernel Build System & the Makefile for Building Two options to Achieve 1. Building under Kernel Source Tree Put our driver appropriately under drivers folder Edit corresponding Kconfig(s) & Makefile to include our driver 2. Create our own Makefile to do the right invocation
26.
26© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Our Makefile ifeq (${KERNELRELEASE},) KERNEL_SOURCE := <kernel source directory path> PWD := $(shell pwd) default: $(MAKE) -C ${KERNEL_SOURCE} SUBDIRS=$(PWD) modules clean: $(MAKE) -C ${KERNEL_SOURCE} SUBDIRS=$(PWD) clean else obj-m += <module>.o endif
27.
27© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Try out your First Linux Driver
28.
28© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. What all have we learnt? W's of Linux Drivers Ecosystem of Linux Drivers Types of Linux Drivers Vertical & Horizontal Driver Layering Various Terminologies in vogue Linux Driver related Commands & Configs Using a Linux Driver Our First Linux Driver
29.
29© 2010-17 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?