Saturday, July 17, 2010

How to write a Kernel module

A very very simple and rudimentary tutorial to know "How to write a kernel module". This is _no_ substitute for reading a good driver book/tutorial. This is just to give a launchpad for a novice to start on kernel programming.

Step 1: vi hello.c


#include <linux/init.h>

#include <linux/module.h>

#include <linux/kernel.h>



static int hello_init(void)

{

        printk(KERN_ALERT "Hello World");

        return 0;

}



static void hello_exit(void)

{

        printk(KERN_ALERT "Goodbye World");

}



module_init(hello_init);

module_exit(hello_exit);



MODULE_LICENSE("GPLv2");

MODULE_AUTHOR("YOUR NAME");






Step 2: vi Makefile

obj-m := hello-kernel.o
hello-kernel-objs := hello.o

Step 3: make -C /lib/modules/`uname -r`/build M=`pwd`
You should see hello-kernel.ko in your current directory, by now.

Step 4: sudo /sbin/insmod hello-kernel.ko

Step 5: dmesg

You should see "Hello World" here.

Step 6: lsmod | grep hello-kernel

Step 7: modinfo hello-kernel.ko

Step 8: sudo /sbin/rmmod hello-kernel.ko

Step 9: dmesg

You should see "Goodbye World" here.

Thursday, June 10, 2010

SYSTEM and METHOD for TROLL CONTROL

Since anything (however stupid it might be) can be patented, I am gonna patent the following:

Title: SYSTEM and METHOD for TROLL CONTROL in open-source projects mailing lists, via Contribution-Points based eMail Limits

Certain mailing lists are more troll-prone than others. For instance, foundation-list, project-list etc. are more troll-prone and attract a lot of noisy crowd than other useful mailing lists like performance-improvement, research, product-XYZ-users-support-list, etc.

For these troll-prone lists, we should have a points based eMail restriction. A person with 10 points can post only 3 mails per week, one with 50 points can post only 10 mails per week, etc. At no stage, a mail conversation (unless technical) can be allowed to have more than 19 mails (Refer previous patent)

These points should be awarded based on people's contribution. Say, for every 2 bugs fixed, you get 1 point. For every 3 queries resolved in user-support mailing list, you get 1 point. For every new software you package for your distribution, you get 1 point etc. Since not many look after support forums, every issue resolved in forums will give you 2 points. (Note: not "every comment in a forum", it is "every issue resolved")

People who have made zero contributions to a project in vital activities like packaging, bug-fixing, documenting, testing, bug-triaging etc. should not be allowed to start a thread in these troll-prone mailing lists. There are no restrictions on questions on legal, technology aspects. But the restrictions apply for questions on abstract areas like Vision, Strategy, Corporate-affiliation etc. where one can talk without making meaning.

known-limitation: Sometimes, even a good contributor will behave child-like and will involve in pointless trolling. Sadly, There is no cure for it :(

I need to hire a patent-writer so that I can get the above crappy, non-sensical idea, written in abstract words with diagrams, flow-chart etc. so that the stupid, lame proposal becomes patent-worthy.

In proprietary software development, corporate people waste time in Meetings. In open-source, we waste time in mailing-list trolls. Atleast, in the latter, we can choose to not-participate and there is a handy option of "Mark all as read".

This really lame post is written in an insomniac night in about 10 minutes, Thanks to Independence.

Thursday, April 29, 2010

openSUSE Art (Mug)

On one of those bored evenings, I had: an empty DelMonte tin, some openSUSE DVDs, a super glue and some kitchen utensils. And, I ended up doing things as in the video below. Watch it.


openSUSE Art (Mug) from Sankar P on Vimeo.




If you are using a RSS reader, please open the blog in a new browser window to see the embedded video. Preferably see the video in HD and in full screen.

Now that you have watched the video (hopefully), If you could think of any _really_ ;-) artistic things that can be done with this tin, drop me a comment.

For the photographs, Thanks should be given for Devadas Kovilakath, Nikanth K, Bharath Acharya. Thanks to Jhonny Jacob for the tins.

Friday, April 23, 2010

The Last Answer

“Then, too, although what I know is infinite, it is also true that what there is to know is infinite, and how can I be sure that both infinities are equal? The infinity of potential knowledge may be infinitely greater than the infinity of my actual knowledge. Here is a simple example: If I knew every one of the even integers, I would know an infinite number of items, and yet I would still not know a single odd integer.”

Murray said, “But the odd integers can be derived. If you divide every even integer in the entire infinite series by two, you will get another infinite series which will contain within it the infinite series of odd integers.”

The Voice said, “You have the idea. I am pleased. It will be your task to find other such ways, far more difficult ones, from the known to the not-yet-known. You have your memories. You will remember all the data you have ever collected or learned, or that you have or will deduce from that data. If necessary, you will be allowed to learn what additional data you will consider relevant to the problems you set yourself.”

Current mood: Thoughtful

Remainings of the above text, can be found here

Monday, April 12, 2010

I Wish ...

... I have joined a Technology Startup, right after my college.

By startup I don't mean one of these mushroomy, money-minded Indian companies (working on social-networking), whose sole aim is to be eaten by a bigger crocodile. I mean a real technology startup focused on innovation and steered by experienced, energetic and technical people (like Ximian, Sonus, Qumranet etc.).

However, to join a company like Qumranet, I should've used my latenight hours in college, working on Linux Kernel, instead of Java web programming or pointless browsing. Anyways, I have no regrets about joining Novell. It is the most suitable company for me, in the list of all companies where my classmates joined. I just believe things would've been far more challenging, positive, energetic and with more learning opportunities to have worked in a startup.

Tuesday, April 06, 2010

openSUSE Conference


Atleast in India, more people are looking forward to openSUSE conference 2010 it seems (than 2009) We should start the preparations :-)

Saturday, March 13, 2010

Forking Evolution ?

Someone, who probably has no idea of what it takes to maintain a large codebase, suggested that Canonical/Ubuntu should fork Evolution. He also sensed a non-existing Microsoft conspiracy. These days we seem to hear more about conspiracies by evil corporations than about technology/user-needs ;-)

Interestingly, it has generated some replies from my engineering inspirations - NotZed and Fejj. Fejj's comments in the original post here. The reply blog post of NotZed, in his typical to-the-point-style here. (There is a section about India as well, which I found interesting to read)

For Enterprise Desktop users on Windows, Outlook is the single-most indispensable and attractive software, that slows/stops people from migrating to Linux. The reason why it has so many passionate users, is because MSFT invests a lot of people for this product development/QA. For Evolution to seamlessly replace Outlook, what it needs is not-a-fork but more-resources (people not resources like memory ;-)).

A saner and practically more useful suggestion, to Canonical, would have been, to sponsor for few programmers to work for Evolution; Just like how RedHat has increased their contribution to Evolution, in the last two years or so. Copyright assignment is a stop-energy. To make it is easier to contribute to Evolution, it is LGPL, for a while now.

There are people on Canonical who are far more business-aware than me, who will just laugh and ignore at this fork-suggestion. But this post and the replies rekindled some old memories and thus this post.

On an unrelated note, I believe IMAP4 has outlived its time. I wish to see something on the lines of reMAP to gain popularity and interest. A new, open protocol that is REST-driven, conversation-based, http-cacheable/shareable, internal-cloud-host-able etc.