Browsed by
Tag: drivers

Linux Device Drivers | Concept character driver

Linux Device Drivers | Concept character driver

I have created this very simple character driver just to see how the process works from beginning to end when creating a device driver in Linux. Before we start, this driver is going to be compiled against the Linux 2.6 kernel and will probably not work in earlier versions. Also, make sure you have set up your development environment and that you have the Linux 2.6 kernel header files installed. If you need to review any of this, look back at the Pre-coding Preparation page.

The device driver that is described on this page is a very simple character driver which simply logs a message whenever a process tries to open/close the device file. I did this so that I could get familiar with the development process and understand how everything works together to create the driver. Eventually I am going to implement the open/read/write/close functions so that the driver will actually do something useful.

Read More Read More

Linux Device Drivers | Pre-coding preparations

Linux Device Drivers | Pre-coding preparations

A good place to start playing around with the Linux kernel and building device drivers, is inside a virtual machine (VM). I am running Windows on my desktop, but I use a VM to run different distributions of Linux. These VM’s are a good place to do development on because if you totally destroy the operating system, no harm is done to your host operating system (which is Windows in my case).

To create a VM, you first need a program that will run your VM’s. In my case, I will be using a program called VMware Player by VMware. This is a free program for Windows that allows you to run any kind of operating system inside a VM. The free version only allows you to run one VM at a time, while the paid versions allow you to run multiple VM’s at once. There are also many other programs available that will run VM’s, a popular open source one is VirtualBox by Oracle. VirtualBox is great because it will work on Windows/Mac/Linux and it will allow you to run multiple VM’s at once. It doesn’t really matter which one you choose, just make sure you pick one and download/install it.

Read More Read More