Linux Device Driver Introduction

785 views

Published on

The slides describes

Published in: Education, Technology
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
785
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
22
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Linux Device Driver Introduction

  1. 1. Foxcoon Confidential 1 Linux Driver David Chen
  2. 2. Foxcoon Confidential 2 Kernel Process Resource computing power Memory network connectivity Kernel 是一塊可讓 CPU 直接執行的 machine code 分配系統資源給各 process
  3. 3. Foxcoon Confidential 3 kernel functions architecture
  4. 4. Foxcoon Confidential 4 kernel functions Process Management Creating and destroying processes scheduler Memory Management The different parts of the kernel interact with the memory-management subsystem through a set of function calls File system Linux supports multiple filesystem types ex2,ex3,FAT… Device Control All device control operations are performed by device drivers Networking must be managed by the operating system
  5. 5. Foxcoon Confidential 5 Kernel Modules Modules Each piece of code that can be added to the kernel at runtime Each module is made up of object code insmod and rmmod
  6. 6. Foxcoon Confidential 6 Classes of devices and modules Character device can be accessed as a stream of bytes Usually implements at least the open, close, read, and write system calls Text console (/dev/console) and the serial ports (/dev/ttyS0) Block device block devices are accessed by filesystem nodes in the /dev directory disk Network interface
  7. 7. Foxcoon Confidential 7 Security Issues Any security check in the system is enforced by kernel code init_module checks if the invoking process is authorized to load a module into the kernel only the superuser can exploit the power of privileged code Driver writers must also be careful, of course, to avoid introducing security bugs Buffer overrun uninitialized memory Any input received from user processes should be treated with great suspicion
  8. 8. Foxcoon Confidential 8 Linux Version Numbering Every software package used in a Linux system has its own release number, and there are often interdependencies across them even-numbered kernel versions(2.6.x) stable odd-numbered kernel versions(2.7.x) Not stable
  9. 9. Foxcoon Confidential 9 License Terms General Public license version 2(GPLv2) GPL 允許任何人散 與銷售佈 GPL 規範的產品 , 前提是必須 要讓收受者能獲得原始程式 , 並繼承同樣的權利
  10. 10. Foxcoon Confidential 9 License Terms General Public license version 2(GPLv2) GPL 允許任何人散 與銷售佈 GPL 規範的產品 , 前提是必須 要讓收受者能獲得原始程式 , 並繼承同樣的權利

×