SlideShare a Scribd company logo
1 of 10
Download to read offline
Linux Device Driver
Agenda

   History & Why Linux kernel?
   Device Driver.
       Purpose & Design
       Kernel mode & User mode
       Development
       Application & API
History and Why Linux kernel?

   First developed by Linus Torvals.
   Linux base on UNIX standard.
   Workgroup for implement driver
    & patch with kernel.org.
   ”Just for fun” - Linux Torvals
    History.
Pupose & Design

   Connection between Hardware and Software.
                 Design communicate on logical
                   layer ( Port : ttyS,lp,hd) and
                   physical layer(Handle stardard
                   of communication protocol).
                 Linux kernel (.ko file type) &

                   Microsoft (.sys file type )
                   kernel( Monolithic,Micro,Hybird
                   )
Linux boot sequence on x86
                                                     x86 Real Mode

   BIOS
   Bootloader ( GRUB/LILO )
   Real Mode Kernel
                                                      X86 Protected
            Arch/x86/boot/pm.c                            Mode

   Protected Mode kernel
   The init Process
   User Processes and Daemons


          Booting up,Essential Linux Device Drivers-Venkateswaran.
User & Kernel mode.


    Kernel Mode
       It can execute any CPU instruction and reference
        any memory address. Kernel mode is generally
        reserved for the lowest-level”.
       Most, ”trusted functions of the operating system”.

    User Mode
       In User mode, the executing code has no ability to
        directly access hardware or reference memory.
       Code running in user mode must delegate to
        system APIs to access hardware or memory.
                      Understanding user & kernel mode,Coding Horror-Jeff Atwood
Development

   Linux System Call.
   Device Drivers Development Supporting device
    drivers.
   Kernel Programming Environment.
Linux System Call

   Executing in kernel mode.
       Kernel mode recognize and particular action
        is require from the device.
       Call to device routine which pass user
        process to device routine.
       Device routine may be shared
        simulataneously by user application
Device Drivers Development
      Supporting device drivers.
   A set of routines that communicate with a hardware
    device and provide a uniform interface to the operating
    system kernel.
   A self-contained component that can be added to, or
    removed from, the operating system dynamically.
   Management of data flow and c ontrol between user
    programs and a peripheral device.
   A user-defined section of the kernel that allows a
    program or a peripheral device to appear as a `` /dev
    '' device to the rest of the system's software.

                       Write a Linux Hardware Device Driver.FreeSoftware Mag.
Device Driver Programming
                                                         % make
#include <linux/init.h>
#include <linux/module.h>                                make[1]: Entering directory `/usr/src/linux-2.6.10'

MODULE_LICENSE("Dual BSD/GPL");                          CC [M] /home/ldd3/src/misc-modules/hello.o

                                                         Building modules, stage 2.
static int hello_init(void)                              MODPOST
{                                                        CC
printk(KERN_ALERT "Hello, worldn");
                                                         /home/ldd3/src/misc-modules/hello.mod.o
return 0;
                                                         LD [M] /home/ldd3/src/misc-modules/hello.ko
}
                                                         make[1]: Leaving directory `/usr/src/linux-2.6.10'

static void hello_exit(void)                             % su

{                                                        root# insmod ./hello.ko
printk(KERN_ALERT "Goodbye, cruel worldn");             Hello, world
}                                                        root# rmmod hello

                                                         Goodbye cruel world
module_init(hello_init);
                                                         root#
module_exit(hello_exit);



                                       Linux kernel in a nutshell,3rd-Greg Kroah-Hartman

More Related Content

What's hot

Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systemsVandana Salve
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module ProgrammingSaurabh Bangad
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)shimosawa
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Thomas Petazzoni
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsHisaki Ohara
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
The basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemThe basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemHungWei Chiu
 
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Ahmed El-Arabawy
 
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...Anne Nicolas
 
linux device driver
linux device driverlinux device driver
linux device driverRahul Batra
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot processTeja Bheemanapally
 

What's hot (20)

Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systems
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module Programming
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
The basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemThe basic concept of Linux FIleSystem
The basic concept of Linux FIleSystem
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
 
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
linux device driver
linux device driverlinux device driver
linux device driver
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
BusyBox for Embedded Linux
BusyBox for Embedded LinuxBusyBox for Embedded Linux
BusyBox for Embedded Linux
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Platform Drivers
Platform DriversPlatform Drivers
Platform Drivers
 

Viewers also liked

Embedded systems training India - Linux system programming and kernel intern...
Embedded systems training India  - Linux system programming and kernel intern...Embedded systems training India  - Linux system programming and kernel intern...
Embedded systems training India - Linux system programming and kernel intern...RR Embedded
 
Linux Device Driver Training-TutorialsDaddy
Linux Device Driver Training-TutorialsDaddyLinux Device Driver Training-TutorialsDaddy
Linux Device Driver Training-TutorialsDaddyStryker King
 
Linux Device Driver Introduction
Linux Device Driver IntroductionLinux Device Driver Introduction
Linux Device Driver IntroductionDavidChen0513
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingStephan Cadene
 
Linux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emptionLinux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emptionHemanth Venkatesh
 
Introduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwareIntroduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwaredefinecareer
 

Viewers also liked (10)

Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Embedded systems training India - Linux system programming and kernel intern...
Embedded systems training India  - Linux system programming and kernel intern...Embedded systems training India  - Linux system programming and kernel intern...
Embedded systems training India - Linux system programming and kernel intern...
 
Linux Device Driver Training-TutorialsDaddy
Linux Device Driver Training-TutorialsDaddyLinux Device Driver Training-TutorialsDaddy
Linux Device Driver Training-TutorialsDaddy
 
Linux Device Driver Training
Linux Device Driver TrainingLinux Device Driver Training
Linux Device Driver Training
 
Linux Device Driver Introduction
Linux Device Driver IntroductionLinux Device Driver Introduction
Linux Device Driver Introduction
 
Peek into linux_device_driver_kit
Peek into linux_device_driver_kitPeek into linux_device_driver_kit
Peek into linux_device_driver_kit
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development Training
 
Linux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emptionLinux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emption
 
Introduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwareIntroduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmware
 
LINUX Device Drivers
LINUX Device DriversLINUX Device Drivers
LINUX Device Drivers
 

Similar to Linux device driver

Similar to Linux device driver (20)

Linux Device Driver’s
Linux Device Driver’sLinux Device Driver’s
Linux Device Driver’s
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux basics
Linux basics Linux basics
Linux basics
 
Device drivers tsp
Device drivers tspDevice drivers tsp
Device drivers tsp
 
Linux basics
Linux basics Linux basics
Linux basics
 
Studienarb linux kernel-dev
Studienarb linux kernel-devStudienarb linux kernel-dev
Studienarb linux kernel-dev
 
Ch1 linux basics
Ch1 linux basicsCh1 linux basics
Ch1 linux basics
 
Linux Kernel Development
Linux Kernel DevelopmentLinux Kernel Development
Linux Kernel Development
 
Walking around linux kernel
Walking around linux kernelWalking around linux kernel
Walking around linux kernel
 
Linuxdd[1]
Linuxdd[1]Linuxdd[1]
Linuxdd[1]
 
Introduction to Operating Systems.pptx
Introduction to Operating Systems.pptxIntroduction to Operating Systems.pptx
Introduction to Operating Systems.pptx
 
Evolution of Linux Containerization
Evolution of Linux Containerization Evolution of Linux Containerization
Evolution of Linux Containerization
 
Evoluation of Linux Container Virtualization
Evoluation of Linux Container VirtualizationEvoluation of Linux Container Virtualization
Evoluation of Linux Container Virtualization
 
Linux
LinuxLinux
Linux
 
Building
BuildingBuilding
Building
 
Linux kernel driver tutorial vorlesung
Linux kernel driver tutorial vorlesungLinux kernel driver tutorial vorlesung
Linux kernel driver tutorial vorlesung
 
Linux
LinuxLinux
Linux
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Lecture1 Introduction
Lecture1  IntroductionLecture1  Introduction
Lecture1 Introduction
 
brief intro to Linux device drivers
brief intro to Linux device driversbrief intro to Linux device drivers
brief intro to Linux device drivers
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Linux device driver

  • 2. Agenda  History & Why Linux kernel?  Device Driver.  Purpose & Design  Kernel mode & User mode  Development  Application & API
  • 3. History and Why Linux kernel?  First developed by Linus Torvals.  Linux base on UNIX standard.  Workgroup for implement driver & patch with kernel.org.  ”Just for fun” - Linux Torvals History.
  • 4. Pupose & Design  Connection between Hardware and Software.  Design communicate on logical layer ( Port : ttyS,lp,hd) and physical layer(Handle stardard of communication protocol).  Linux kernel (.ko file type) & Microsoft (.sys file type ) kernel( Monolithic,Micro,Hybird )
  • 5. Linux boot sequence on x86 x86 Real Mode BIOS Bootloader ( GRUB/LILO ) Real Mode Kernel X86 Protected Arch/x86/boot/pm.c Mode Protected Mode kernel The init Process User Processes and Daemons Booting up,Essential Linux Device Drivers-Venkateswaran.
  • 6. User & Kernel mode.  Kernel Mode  It can execute any CPU instruction and reference any memory address. Kernel mode is generally reserved for the lowest-level”.  Most, ”trusted functions of the operating system”.  User Mode  In User mode, the executing code has no ability to directly access hardware or reference memory.  Code running in user mode must delegate to system APIs to access hardware or memory. Understanding user & kernel mode,Coding Horror-Jeff Atwood
  • 7. Development  Linux System Call.  Device Drivers Development Supporting device drivers.  Kernel Programming Environment.
  • 8. Linux System Call  Executing in kernel mode.  Kernel mode recognize and particular action is require from the device.  Call to device routine which pass user process to device routine.  Device routine may be shared simulataneously by user application
  • 9. Device Drivers Development Supporting device drivers.  A set of routines that communicate with a hardware device and provide a uniform interface to the operating system kernel.  A self-contained component that can be added to, or removed from, the operating system dynamically.  Management of data flow and c ontrol between user programs and a peripheral device.  A user-defined section of the kernel that allows a program or a peripheral device to appear as a `` /dev '' device to the rest of the system's software. Write a Linux Hardware Device Driver.FreeSoftware Mag.
  • 10. Device Driver Programming % make #include <linux/init.h> #include <linux/module.h> make[1]: Entering directory `/usr/src/linux-2.6.10' MODULE_LICENSE("Dual BSD/GPL"); CC [M] /home/ldd3/src/misc-modules/hello.o Building modules, stage 2. static int hello_init(void) MODPOST { CC printk(KERN_ALERT "Hello, worldn"); /home/ldd3/src/misc-modules/hello.mod.o return 0; LD [M] /home/ldd3/src/misc-modules/hello.ko } make[1]: Leaving directory `/usr/src/linux-2.6.10' static void hello_exit(void) % su { root# insmod ./hello.ko printk(KERN_ALERT "Goodbye, cruel worldn"); Hello, world } root# rmmod hello Goodbye cruel world module_init(hello_init); root# module_exit(hello_exit); Linux kernel in a nutshell,3rd-Greg Kroah-Hartman