Akshat Gupta

Finally invoved in Open Source :)

Getting hands dirty with Linux module

I have always been intimated by people who work on Linux kernel. This May I had the opportunity to make my own module. So here is my take on this.

The first thing that is required is the latest kernel on a VM. Yes VM is the most important thing …. you do not want your machine to crash or lose data or get your RAM fried ;). After having the kernel ready (make sure you compile the kernel so that you have the sources and all the kernel development flags are set) go through a good tutorial which helps you with the Hello World module …. you have developed your own module.

Easy right … but the pain is yet to come. Lot of help with sample codes can be found by googling .. but not all can be used directly. Before using the code snippet one needs to make sure about the kernel version thanks to the changing api’s for each release of the kernel. So what do you do from here. Copy the code snippet, compile and hope for the best. If it does not compile, you know you are facing changed API .. the best thing to do in that case is to check the header files and fix the function calls. The comments in the header file are excellent and they guide a noob well on what all needs to be touched and what need not be.

Here are some nice Links which I found:

Hello word

Some code snippets
TIP: Do not be scared to try out things … worst (and most) case is a reboot 😉

TIP: Install logrotate as the log file will be becoming long very soon

TIP: The kernel stack space is only 4KB do not allocate space that is more than this

I will be adding more tips as and when I remember them till then …..Happy hacking


May 21, 2009 Posted by | Uncategorized | Leave a comment

I am Back

After I got through GSOC, I was really committed to open source and had decided that I would keep contributing to the community. But come August and things changed. After I started my graudate studies time could no longer be found for open source development. Writing this blog entry after 4 months is a proof of how busy a grad like can be. I was fortunate to have good mentors like Anant and Elizabeth who took phpCairo from where I had left it. I would like to thank and apologize for the same.

On the bright side, I did make some projects that I am going to open source. On of them is a peer to peer file system with no centralized server. Tough this project was made for grading purposes but the spec can be easily changed to what ever is required. It taught me a lot and hope it comes useful to someone else 😛 .

Anyway I am looking forward to mid December to take a big break and if things go as planned I would love to get in touch with phpCairo again.

December 1, 2008 Posted by | Uncategorized | Leave a comment

Long Time No See

Ya …..
Its been a long time since I have posted anything … This might be due to the fact that I have learnt nothing new (which is not possible) or I had no time(Please kick the mentor for that).
After a month of awesome coding finally phpCairo 1.0.1 is complete and is all set to be a part of PECL. The basic functionalities are up and running now only the intricate ones are left to sort out which will be corrected as they are brought forward (The beauty of Open Source).
Along the way there were lot of renaming of files and functions due the the PECL nomenclature which really bugged me but I guess it is required to maintain the uniformity in various extensions.

I could not write the module tests as there are around 300 modules so I have included various examples and there output so that people who want to use phpCairo can learn the syntax fast.

I am looking forward to start my work on php-gtk and use my own extension to integrate with it :).

Thanks a lot Anant and Elizabeth.

June 30, 2008 Posted by | Uncategorized | Leave a comment

pyCairo sucks

Why is pyCairo not documented … making my life miserable 😦 … have to go back to C++ for there documentation.

May 2, 2008 Posted by | Uncategorized | Leave a comment

Command Meme

$ history | awk ‘ {a[$2]++ } END {for (i in a) { print a[i] ” ” i}}’ | sort -rn | head
105 ./a.out
76 gcc
56 cd
55 ls
53 sudo
34 vi
15 pecl-gen
15 gvim
13 man
8 startx

May 1, 2008 Posted by | Uncategorized | Leave a comment

Drivel Installed

Just installed Drivel …. for wordpress please use movable type and add xmlrpc.php to your webserver address

May 1, 2008 Posted by | Uncategorized | Leave a comment