Driver Programming
. Sa

ha ,

. Sh

us e Inno a on en
Un e s
O De h

e
e
Hardware is complicated
1.
2.
3.
4.

Mu
p e
Mu
p e
O e app
No enou

endo s
e s ons
n
un
ona
h sma
p o amme s

HARDWARE
Drivers simplify them
1.
2.
3.
4.

So wa e oun e pa s o ha dwa e
Hand e mu
p e HW e s ons
Hand e mu
p e HW endo s
Do h s a...
Outline
1.
2.
3.
4.
5.

The L nux e ne
T pes o De
e D
e s( ene a )
ha / B o
De
e D e s
Ne wo In e a es
Demo
Linux and Linus
1. W
en b L nus To a ds (Un e s
o He s n )
2. He wan ed a s s em be e
han UNIX,
and MINIX
3. “The a
den a
...
The Linux Device Paradigm

HARDWARE
The Linux Device Paradigm

HARDWARE
ERNEL
The Linux Device Paradigm

HARDWARE
ERNEL
USER SPA E
The Linux Device Paradigm

HARDWARE
ERNEL
USER SPA E
SHELL
Drivers are

DRI ER

HARDWARE
ERNEL
The Linux Device Paradigm

DRI ER

HARDWARE
ERNEL
USER SPA E
The Linux Device Paradigm

HARDWARE
ERNEL
USER SPA E

D nam

Load n
The Linux Device Paradigm

DRI ER

HARDWARE
ERNEL
USER SPA E

D nam

Load n
Types of drivers
1.

ha

De

es

DRI ER

1

0

1

0

1
Types of drivers
1

2. B o

De

es

DRI ER

0

1

0

1

1

0

1

0

1

1

1

0

0

1

1

1

0

0

1

1

0

0

0

1

1

0

...
Types of drivers
3. Ne wo

In e

a es

DRI ER

T P/UDP

P

P
Driver is a module
E e

e ne

ex ens on

DRI ER

s a Modu e
Driver is a module
E e

e ne

ex ens on

DRI ER

MODULE

s a Modu e
A device is represented as a file
And o
ead w

ead/ w
e he

e

he ph s
e

a

de

e, we
Process

HARDWARE

DE I E

ONTROLLER

ERNEL

DRI ER

DE I E FILE

USER SPA E
Programming Process
De

e struct

s u u e o ho d da a pes o
ommun a e w h he de
es. Th s ma
o espond o a ua p ns.
Programming Process
F

e ope a ons

A de e o he use spa e s us a
F e ope a ons maps
e RUD o de

e.
e.
Programming Process
En

po n s

The e s no main() n modu es. Be ause
modu e s no an exe u ab e. So we need
de ne en
po n s...
Major Numbers
Ea h de
e d
den
e wh
and s un que

e
h
o

has a ma o numbe
s ass ned on un me
a
de es
Execution Stack is small
No memo
s a
memo
s ese

o a ed on un me. A
ed a exe u on
Makefile
make s a nux app
a on ha
d
e s (so wa es n ene a )

omp

es
Attaching the module to kernel
nsmod ha _de
e. o
m nod /de / ha _de
e 251 0
Exit point
Ex
o

po n s a so needs o de ned manua
ea up he used e ne spa e
User space program
Open de
e
n e a
ons

e and pe

o m use

spa e
Demo
Upcoming SlideShare
Loading in …5
×

Driver programming : The Linux Way

779 views

Published on

Hardware is a pain. This presentation give a birds eye view on the way to program drivers on a Linux Based Machine.

video : https://www.youtube.com/watch?v=rr-lKnxLfB4
report : http://www.slideshare.net/shivekkhurana/driver-programming-report

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
779
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
25
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Driver programming : The Linux Way

  1. 1. Driver Programming . Sa ha , . Sh us e Inno a on en Un e s O De h e e
  2. 2. Hardware is complicated 1. 2. 3. 4. Mu p e Mu p e O e app No enou endo s e s ons n un ona h sma p o amme s HARDWARE
  3. 3. Drivers simplify them 1. 2. 3. 4. So wa e oun e pa s o ha dwa e Hand e mu p e HW e s ons Hand e mu p e HW endo s Do h s a oss d e en OS(es) DRI ER
  4. 4. Outline 1. 2. 3. 4. 5. The L nux e ne T pes o De e D e s( ene a ) ha / B o De e D e s Ne wo In e a es Demo
  5. 5. Linux and Linus 1. W en b L nus To a ds (Un e s o He s n ) 2. He wan ed a s s em be e han UNIX, and MINIX 3. “The a den a e o u ona .”
  6. 6. The Linux Device Paradigm HARDWARE
  7. 7. The Linux Device Paradigm HARDWARE ERNEL
  8. 8. The Linux Device Paradigm HARDWARE ERNEL USER SPA E
  9. 9. The Linux Device Paradigm HARDWARE ERNEL USER SPA E SHELL
  10. 10. Drivers are DRI ER HARDWARE ERNEL
  11. 11. The Linux Device Paradigm DRI ER HARDWARE ERNEL USER SPA E
  12. 12. The Linux Device Paradigm HARDWARE ERNEL USER SPA E D nam Load n
  13. 13. The Linux Device Paradigm DRI ER HARDWARE ERNEL USER SPA E D nam Load n
  14. 14. Types of drivers 1. ha De es DRI ER 1 0 1 0 1
  15. 15. Types of drivers 1 2. B o De es DRI ER 0 1 0 1 1 0 1 0 1 1 1 0 0 1 1 1 0 0 1 1 0 0 0 1 1 0 0 0 1 1 0 1 1 0 1 0 1 1 0
  16. 16. Types of drivers 3. Ne wo In e a es DRI ER T P/UDP P P
  17. 17. Driver is a module E e e ne ex ens on DRI ER s a Modu e
  18. 18. Driver is a module E e e ne ex ens on DRI ER MODULE s a Modu e
  19. 19. A device is represented as a file And o ead w ead/ w e he e he ph s e a de e, we
  20. 20. Process HARDWARE DE I E ONTROLLER ERNEL DRI ER DE I E FILE USER SPA E
  21. 21. Programming Process De e struct s u u e o ho d da a pes o ommun a e w h he de es. Th s ma o espond o a ua p ns.
  22. 22. Programming Process F e ope a ons A de e o he use spa e s us a F e ope a ons maps e RUD o de e. e.
  23. 23. Programming Process En po n s The e s no main() n modu es. Be ause modu e s no an exe u ab e. So we need de ne en po n s manua o oad de e. o
  24. 24. Major Numbers Ea h de e d den e wh and s un que e h o has a ma o numbe s ass ned on un me a de es
  25. 25. Execution Stack is small No memo s a memo s ese o a ed on un me. A ed a exe u on
  26. 26. Makefile make s a nux app a on ha d e s (so wa es n ene a ) omp es
  27. 27. Attaching the module to kernel nsmod ha _de e. o m nod /de / ha _de e 251 0
  28. 28. Exit point Ex o po n s a so needs o de ned manua ea up he used e ne spa e
  29. 29. User space program Open de e n e a ons e and pe o m use spa e
  30. 30. Demo

×