Reprinted from :

Always learning to drive , For the following article , I think it's simple and clear , Basically in line with our learning driven progress and process , Now forward to your blog , Hope to share with more friends .

understand Linux How to learn driver skills is very important , Study linux operating system when , You may have problems with driving , Here's how to learn linux Method of driver , Let's share it with you .

1. Learn to write simple makefile

2. Write an application , It can be used makefile Run

3. Learn to write linux Driver's makefile

4. Write a simple char drive ,makefile Compile and pass , Sure insmod,lsmod,rmmod. In the driver's init Function helloworld,insmod It should be able to pass dmesg See the output .

5. Write a complete drive a dynamic , add read,write,ioctl,polling And so on . stay ioctl Transfer structure from user space to kernel space .

6. Write one block Driver plus read,write,ioctl,poll And so on .

7. Simple learning memory management , This is the hardest , Understand all kinds of memoryalloc Function implementation details of . This is a linux Basic skills of development .

8. The application of learning lock mechanism , This is not the most difficult, but the most fallible , It involves a lot of synchronization and concurrency .

9. Look at the actual application in the kernel linux Driver code . You'll find the most basic you already know , The big frame is the same , No more than is read,write,ioctl And so on , But it contains a lot of small implementation details that I didn't know before . At this time, we have to consider many other issues, not just the realization of basic functions .

I recommend 2.6.20 in integrated A driver of kvm, Remember it was driver/lguest Next , It's fun , Namely linux Virtual machine driver under , The code is not long. , But it's powerful . Those who have the ability can write their own operating system and load it into the virtual machine as required , Then the client can have its own 4G Virtual address space .

10. After watching linux Driver code welcome to Linuxkernel In learning .

The easiest way , follow ldd(linuxdevivedriver) Do it again .

Linux Driver learning 【 turn 】 More articles about

  1. Linux Device drivers learn how to allocate memory

    Kernel provides a unified memory management interface for device drivers , So the module doesn't need to deal with segmentation and pagination . I've been in the first scull The module uses kmalloc and kfree To allocate and free memory space . kmalloc Inside the function ...

  2. Linux Device driver learning ----1. Device driver Introduction

    Device driver Introduction Please refer to Linux Device driver learning ---- Catalog 1. brief introduction Linux The advantage of the system is , The implementation details inside the system are open to all .Linux The kernel is made up of a lot of complex code , Device drivers can ...

  3. Linux Device driver learning ----2. Comparison between kernel module and application program

    Comparison between kernel module and application program Please refer to Linux Device driver learning ---- Catalog 1. Comparison between kernel module and application program Differences between kernel modules and Applications : Most small and medium-sized applications perform a single task from start to finish , And the model ...

  4. Linux Device driver learning ----3. Module compilation and loading

    Module compilation and loading Please refer to Linux Device driver learning ---- Catalog 1. Set up the test system The first 1 Step , First of all kernel.org Get a mainline kernel on the mirror website , And install it in your own system , Because of the writing of the learning driver ...

  5. Linux Device driver learning ---- Catalog

    Catalog Device driver Introduction 1. Device driver Introduction Building and running modules 2. Comparison of kernel modules and Applications 3. Module compilation and loading 4. The kernel symbol table of the module  5. Module initialization and shutdown  6. Module parameters  7. Writing drivers in user space ...

  6. Linux Learning notes for the first time

    One .Linux What is it Linux It's an operating system , As you know more or less Windows(xp,7,8) and Max OS , As for what the operating system is , There's no need to explain too much , If you've taken the introductory course before , There should be ...

  7. Chapter two 、 Linux How to learn

    Chapter two . Linux  How to learn Last update date :2009/08/06 1. Linux Current application roles 1.1  The use of the corporate environment 1.2  The use of personal environment Linux Current application roles In the first chapter Linux What is it when ...

  8. Linux Classic books and ways of kernel learning

    from:http://www.zhihu.com/question/19606660  You know Linux Classic books and ways of kernel learning ? modify modify Write supplementary notes report   Add comments Share • Invite to answer   ...

  9. About Linux The misunderstanding of kernel learning and the introduction of related books

    http://www.hzlitai.com.cn/article/ARM9-article/system/1605.html written Linux New to the kernel - About Linux The misunderstanding of kernel learning Let's start with something serious : Actually ...

Random recommendation

  1. js Judge the browser type and browser version

    Judge browser type :   if navigator.userAgent.indexOf(”MSIE”)>0) {} // Determine whether IE browser if(isFirefox=navigator.userAg ...

  2. supersr-- Controller life cycle :

    The call order is 1 init function (init;initWithFrame;initWithCoder; etc. )-- initialization 2 awakeFromNib-- stay loadView The previous work is here 3 viewDid ...

  3. jdbc call mysql Stored procedure implementation code with input and output

    Reprinted from  http://www.jb51.net/article/34747.htm 1. Create stored procedure   Build a MySQL Stored procedure add_pro Copy the code as follows : delimiter // dr ...

  4. mongodb establish LBS Location index

    <dependency> <groupId>org.mongodb</groupId> <artifactId>mongo-java-driver< ...

  5. sqoop Import and export of

    1. Incremental imports that know the values of a column (mysql------> file ) bin/sqoop import \--connect jdbc:mysql://bigdatcdh01:3306/test \--u ...

  6. Get rid of input stay type=&quot;number&quot; The up and down arrows on the right side of the arrow

    After adding code : input::-webkit-outer-spin-button, input::-webkit-inner-spin-button{ -webkit-appearance: none ...

  7. linux Hybrid connection between dynamic library and static library

      1, When an application needs to connect to an external library ,linux The default connection to the library is to use a dynamic library , Select the static library when the dynamic library cannot be found . Use mode: : gcc test.cpp -L. -ltestlib If the current directory has ...

  8. C# Basic notes ( Eleventh days )

    1. Review string (1) The immutability of strings (2) String method :1)Split() Division Split up the unwanted content of the string Returns an array of string types You can add StringSplitOption.RemoveEmp ...

  9. less- The comma of the sign , Space , Parent selector

    Less Symbol comma example: .test() { box-shadow+: inset 0 0 10px #555; } .study { .test(); box-shadow+: 0 0 ...

  10. Android Crash location

    This article introduces how to do it in Android Cell phone happens Crash When an Log The method of analysis , It can help testers quickly locate Android mobile phone Crash What happened , At the same time, provide effective modification for R & D personnel Bug Of ...