Thread: Kernel Development

  1. #1
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732

    Kernel Development

    Hi, I was just wondering if anybody here had done any kernel development as their personal project before. I understand that it’s something which is really huge development. What I’m trying to see if anyone here has made an attempt to develop at least few modules of it and how far they thro.

    And also are there materials or books which I could refer to get more information on the kernel or OS development.

    Thanks a lot!

    -ssharish
    Life is like riding a bicycle. To keep your balance you must keep moving - Einstein

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    I've written a couple of very small but functional kernel* modules, if you want to look at the outcome, here's a thread:

    kernel memory char device

    I was going to write a driver for an unsupported usb webcam I found, but someone beat me to the punch (I'm glad for that, to be honest -- the "USB video class device specification" is 150+ pages). Anyway, linux kernel programming is very definitely it's own realm (all C & asm -- apparently Linus thinks C++ is tish). There are some "hello world" module tutorials around if you google, that provide some orientation. Beyond that, there are very few resources on the web -- I dished out for some books, there are a few in print. You can ask me for an opinion if you want.

    There is actually a kernel programming forum at LinuxQuestions.org (a sub forum under "software"). It only sees a few messages a day, but there are I think knowledgeable regulars.

    *I'm just presuming you mean linux or some other open source kernel of course...MS has unmarked helicopter squads to deal with hacking that kernel.
    Last edited by MK27; 05-17-2009 at 03:14 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    >*I'm just presuming you mean Linux or some other open source kernel of course...MS has unmarked helicopter squads to deal with hacking that kernel.
    Well, that’s right. Not a great fan of MS anyway. I really wanted to get involved with some personal project at home. I get really sick of work which I do at office.

    But thanks alot MK27!

    Anyone else, involved ???

    Thanks !

    -ssharish
    Life is like riding a bicycle. To keep your balance you must keep moving - Einstein

  4. #4
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312
    I did some "modules" for Linux and some "servers" for Plan9, but these were more like those I-have-to-do-it-at-least-once projects. From a theoretical point of view, I know some details about the basics (memory management, scheduling, interrupts, processes, threads, ...), but I consider it too much of a hassle to actually implement stuff like that myself.

    If you want to write a new OS, I suggest "Modern Operating Systems" by Andrew Tanenbaum. It's very well written, and can be understood by ambitioned beginners.

    If you want to participate in the Linux development, it's probably best to start writing arbitrary modules, reading source code and the LKML. Once you know some of the commonly used functions in the Linux kernel, you can start reading a book and learn about the basic design, which you wouldn't believe there is after reading /usr/src/linux/arch/.

    Greets,
    Philip
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    There is also this site which someone on a mailing list pointed out to me:

    Linux Kernel Newbies - Linux Kernel Newbies

    It is not quite just for programmers, but from the looks of things it is mostly so. Also, they do organized collaborative projects such as bug fixes (look under "kernel janitors" and "kernel mentors"), which you will be welcome to join.

    There is a kernel mentoring mailing list too, for tough questions, if you pm me I might be able to dig up the address...
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  6. #6
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    In a year I don't remember clearly, I independently invented the concept of "futexes" and implemented them correctly (on x86 at least). Of course, I was outclassed, and my implementation never saw the light of day, much less stood any real competition against the current implementation. It was, however, around the same time that the other line of development was happening. (Independent inspiration -- I didn't know other people were doing the same thing or I probably would have deferred immediately)

    That's the whole of my Linux kernel development experience.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    My claim to fame is that I wrote the first PowerNow! driver for Linux. Whilst I was technically working for AMD at the time, I did the work privately during a few weeks when I was staying in a hotel on a work-assignment in Austin. Whilst nearly all of the code has been changed now (and my name isn't in the credits ), the current PowerNow! driver is still based on the code I wrote!

    I have also done a fair bit of work inside various kernels as a professional:
    - Modifying a AMD Ethernet driver to use MMIO rather than DMA (because of architecture of the target system not supporting DMA).
    - Port RTOS from 29K to x86-32.
    - Port another RTOS from 68K to x86-32.
    - Working on Windows graphics drivers.
    - Working on Xen Virtualization for HVM/SVM.
    - Currently working inside a RTOS and Graphics drivers.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #8
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by ssharish2005 View Post
    Hi, I was just wondering if anybody here had done any kernel development as their personal project before. I understand that it’s something which is really huge development. What I’m trying to see if anyone here has made an attempt to develop at least few modules of it and how far they thro.

    And also are there materials or books which I could refer to get more information on the kernel or OS development.

    Thanks a lot!

    -ssharish
    osdev.org

  9. #9
    Disrupting the universe Mad_guy's Avatar
    Join Date
    Jun 2005
    Posts
    258
    If you're looking for Linux stuff, Linux Device Drivers, 3rd ed. is available online for free. I also recommend 'Essential Linux Device Drivers,' and 'Linux Kernel Development, 2nd edition.'

    For windows, I recommend 'Microsoft Windows Internals' (I read 4th edition; latest is 5th edition,) as well as 'Programming the Microsoft Windows Driver Model, 2nd edition.' The second book is excellent, but mostly concerns the XP-era kernel. Developing drivers on XP is simple and pretty neat; Vista has the driver signing mechanism, but if you use the Device Driver DDK you can at least test it on your system (I suppose anybody else who had to use it would need to build it themselves, though...) I'm not sure how much the API has changed since I don't use Windows anymore, so you might need to use MSDN or something.
    operating systems: mac os 10.6, debian 5.0, windows 7
    editor: back to emacs because it's more awesomer!!
    version control: git

    website: http://0xff.ath.cx/~as/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Kernel bug? (attn matsp)
    By brewbuck in forum Linux Programming
    Replies: 7
    Last Post: 04-13-2009, 10:31 AM
  2. SOS - Can a monolithic kernel be used in a micro-kernel style OS?
    By sean in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 11-20-2008, 09:30 AM
  3. Programming RIP2 with kernel routes table
    By jpablo in forum Linux Programming
    Replies: 1
    Last Post: 04-22-2006, 11:26 AM
  4. CreateThread ?!
    By Devil Panther in forum Windows Programming
    Replies: 13
    Last Post: 11-15-2005, 10:55 AM