STATIC.x

Kunal Dawn


1 Comment

Device Drivers, Part 5: Character Device Files — Creation & Operations

In my previous article, I had mentioned that even with the registration for the <major, minor>device range, the device files were not created under /dev — instead, Shweta had to create them manually, using mknod. However, on further study, Shweta figured out a way to automatically create the device files, using the udev daemon. She also learnt the second step to connect the device file with the device driver — linking the device file operations to the device driver functions. Here is what she learnt. Continue reading

Advertisements


1 Comment

Device Drivers, Part 4: Linux Character Drivers

Shweta, at her PC in her hostel room, was all set to explore the characters of Linux character drivers, before it was taught in class. She recalled the following lines from professor Gopi’s class: “… today’s first driver would be the template for any driver you write in Linux. Writing any specialised/advanced driver is just a matter of what gets filled into its constructor and destructor…” Continue reading


Leave a comment

Device Drivers, Part 3: Kernel C Extras in a Linux Driver

Enthused by how Pugs impressed their professor in the last class, Shweta wanted to do so too. And there was soon an opportunity: finding out where the output of printk had gone. So, as soon as she entered the lab, she grabbed the best system, logged in, and began work. Knowing her professor well, she realised that he would have dropped a hint about the possible solution in the previous class itself. Going over what had been taught, she remembered the error output demonstration from insmod vfat.ko — running dmesg | tail. She immediately tried that, and found the printk output there. Continue reading


Leave a comment

Device Drivers, Part 2: Writing Your First Linux Driver in the Classroom

Shweta and Pugs reached their classroom late, to find their professor already in the middle of a lecture. Shweta sheepishly asked for his permission to enter. An annoyed Professor Gopi responded, “Come on! You guys are late again; what is your excuse, today?” Continue reading


Leave a comment

Device Drivers, Part 1: Linux Device Drivers for Your Girl Friend

“After a week of hard work, we finally got our driver working,” were Pugs’ first words when he met his girlfriend, Shweta.

“Why? What was your driver up to? Was he sick? And what hard work did you do?” asked Shweta. Confused, Pugs responded, “What are you talking about?”

Now it was Shweta’s turn to look puzzled, as she replied, “Why ask me? You tell me — which of your drivers are you talking about?” Continue reading