Skip to main content

Posts

Hello everyone. I am always thankful for all of you who follow my blog and my Youtube channel. This post is to announce that from here forward, all my tutorial and source code can be found at: www.soliduscode.com
Okay so I have posted a number of Linux kernel programming videos over at my YouTube channe , however I find that I need a place to post a sample code and the make file to build a module. So here it is. The Makefile obj-m := solidusmodule.o KERNEL_DIR = /lib/modules/3.2.0-25-generic/build PWD := $(shell pwd) all: $(MAKE) -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules clean: rm -rf *.o *.ko *.mod.* *.symvers *.order *~ #include #include #include // file_operations structure- which of course allows use to open/close,read/write to device #include //this is a char driver; makes cdev available #include //used to access semaphores; sychronizatoin behaviors #include //copy_to_user;copy_from_user //(1) Create a structure for our fake device struct fake_device { char data[100]; struct semaphore sem; } virtual_device; //(2) To later register our device we need a cdev object and some other variables struct cdev *mcdev; //m stands 'my' int major_number;

AVR Programming

Hello internet, i just recently posted a video  on how to interface an AVR microcontroller with and LCD Screen (HD44780). Please watch the video and do comment.

Introduction to Linux Kernel Device Drivers

If you toy with electronics, perhaps with microcontrollers (MCU), you might at some point in time decide to interface your microcontroller to your computer.  However, you will come to learn that it would not work for a variety of reasons: one being that you need correct voltage between the computer and the microcontroller, and the second, most critical, you need a way for the computer to recognize and speak to your device. Well, this is where device drivers are useful.  Device drivers are the software need for your computer applications to talk to your device.  The power of a device driver and the possibilities that lie with it can not fully be summarized by myself. So, so whatever reason you many want to write a device driver, in this post, along with others, I will demonstrate how to write a device driver. Major and Minor Numbers When we write a device driver, that device driver will become part of the kernel and it will have an identification number called a major numb