Thread: Done with C .. Now what? :(

  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    19

    Done with C .. Now what? :(

    Hello ,
    I am done with C programming , i know bit of c++ .. and currently attending classes for java ..
    But i wanna go into linux kernel programming ..
    I have tried twice by reading a book published by O'really (Understanding Linux Kernel )

    but i failed to keep up with it as i got busy with my exams..
    I need a jump start in that area as i feel stucked

    Can someone please recomend me what to do?

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    I have tried twice by reading a book published by O'really (Understanding Linux Kernel )
    ...
    but i failed to keep up with it as i got busy with my exams..
    ...
    Can someone please recomend me what to do?
    Try reading it again?

    I'm not sure what you're asking. You are "done" (?) with C, but want to pursue Linux kernel programming?

  3. #3
    Registered User
    Join Date
    May 2012
    Posts
    1,066
    Quote Originally Posted by mhrsolanki2020 View Post
    I am done with C programming , i know bit of c++ .. and currently attending classes for java ..
    But i wanna go into linux kernel programming ..
    I have tried twice by reading a book published by O'really (Understanding Linux Kernel )

    but i failed to keep up with it as i got busy with my exams..
    You need to decide what's more important for you if you don't have time for both: your exams or studying the kernel.

    If you really want to do linux kernel programming, I'm afraid you need to be proficient in C because Linus doesn't really like C++ nor Java :-).

    Bye. Andreas

  4. #4
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    The "Linux" kernel is hellbeast spewing updates several times a day from several different sources with several million lines of code in its veins.

    If you can't handle a static book, you literally have no chance, none, of ever following the development of the kernel well enough to contribute.

    Soma

  5. #5
    Registered User
    Join Date
    Dec 2012
    Posts
    19
    Quote Originally Posted by Matticus View Post
    Try reading it again?

    I'm not sure what you're asking. You are "done" (?) with C, but want to pursue Linux kernel programming?
    I am confortable in programming with C .. (except file input output ) I know a bit of data structures

    Quote Originally Posted by AndiPersti View Post
    You need to decide what's more important for you if you don't have time for both: your exams or studying the kernel.

    If you really want to do linux kernel programming, I'm afraid you need to be proficient in C because Linus doesn't really like C++ nor Java :-).

    Bye. Andreas
    Proficient would be what level of expertise in C ?? Cuz i know C Since a year and a half .. i have been compiling roms and creating shell scripts and makefiles for android open source projects .. also i am comfortable using linux and know comands of it ..

    This much knowledge would be enough to get started with kernel programming??

    Quote Originally Posted by phantomotap View Post
    O_o

    The "Linux" kernel is hellbeast spewing updates several times a day from several different sources with several million lines of code in its veins.

    If you can't handle a static book, you literally have no chance, none, of ever following the development of the kernel well enough to contribute.

    Soma
    Hmmm... True that.. but i started it twice and i got diverted by something else (i was learning 3d animation so i gave up when i read it first time.. and the second time i went into learning shell script and thats when my exams started .. so gave up second time )

    But i really look forward to learn it ..
    As it will help me a great deal in developing roms for android ..

  6. #6
    Lurker
    Join Date
    Dec 2004
    Posts
    296
    Don't but the poor guy down like that.

    How old are you? Or rather, what I want to know what level you have studied C on?

    I have done some limited kernel hacking during my "career" as a software developer. Nothing fancy, just some minor bug fixes and so on.

    My advice if you want to some day hack on the Linux kernel is to go slow. Make a road map of what you need to learn.

    Without knowing what your current level of understanding I suggest:

    Improve your grasp of computer architecture.
    Learn to read and write some kind of assembly language.
    Improve your C skills.
    Cut your teeth at something simpler, read smaller, than the Linux kernel, for example Minix 3.
    Read a lot of code and try to understand what it does, how it is structured and why it is structured as it is.
    Take something like Minix 3 and try to reimplement something, for example a simple scheduler that you plug in.

    And remember, if you really want to be a kernel hacker then you have to put in the time. Focus on school and then kernel hacking. After that you might have time left to eat and sleep...

    Everybody should have a dream. You have not failed until you give up, so just keep at it.

  7. #7
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    As it will help me a great deal in developing roms for android
    O_o

    Learning to hack the "Linux" kernel will not really help you develop "Android" ROMS.

    Sure, the kernel is part of a ROM, but most of getting crap to work between devices is the firmware/driver stuff.

    If you want to be an "Android" builder, I'd say you are better off finding ways to improve the support of device aliasing code which doesn't live in the hardware. The community would love you for that, but a new ROM is just another ROM.

    Soma

  8. #8
    Registered User
    Join Date
    Dec 2012
    Posts
    19
    @Jimmy .. i am 17 .. i am in college .. And For me to make a road map , i should have slightest knowledge of what is linux kernel made up of which i dont ...

    1) Assembly language?? Like full top noch or just the understanding of it would be enough??
    2) Will improve C skills.. (planning to study data structures in c , that would sharpen my skill of c i guess , am i right or wrong??
    3) Minix 3?? What is that??
    4) how do you plug in a scheduler??

    I can give time as i am not persuing kernel developing as career so i have a life time ahead of me to learn it .. i can go as slow as i want...

    Yup .. Eveyone should have a dream ,, cheers to that

  9. #9
    Registered User
    Join Date
    Dec 2012
    Posts
    19
    Quote Originally Posted by phantomotap View Post
    O_o

    Learning to hack the "Linux" kernel will not really help you develop "Android" ROMS.

    Sure, the kernel is part of a ROM, but most of getting crap to work between devices is the firmware/driver stuff.

    If you want to be an "Android" builder, I'd say you are better off finding ways to improve the support of device aliasing code which doesn't live in the hardware. The community would love you for that, but a new ROM is just another ROM.

    Soma
    I am not developing roms because i have to .. i am developing it because i want to learn new things.. so i dont mind to give less time to build rom and learn about linux more in depth .. I would get the working knowledge of implementing the kernel if i know how to make it from source and how is the source coded


    BTW : What do you mean by "HACK the Linux kernel" ?

  10. #10
    Registered User
    Join Date
    Apr 2013
    Posts
    1,658
    You could try writing a device driver (or modifying an existing device driver if you can get the source code), but this normally means you'll need access to a "debugging" kernel, that you build along with your device driver code. You usually need two computers for this, one will be the "target" which will contain the "debugging" kernel with your device driver, the other will be the "host" which runs the debugger interface.

  11. #11
    Lurker
    Join Date
    Dec 2004
    Posts
    296
    Quote Originally Posted by mhrsolanki2020 View Post
    @Jimmy .. i am 17 .. i am in college .. And For me to make a road map , i should have slightest knowledge of what is linux kernel made up of which i dont ...
    I started writing basic at a Commodore 64 when I was 7 years old. I wrote C and 68k assembly with an Commodore Amiga when I was 12 years old. You wrote stuff closer to the metal in those days, which I think lead to an intuitive grasp of how a computer works in some sense. Something students at university level lack today.

    Quote Originally Posted by mhrsolanki2020 View Post
    1) Assembly language?? Like full top noch or just the understanding of it would be enough??
    Well, knowing assembly language is probably not a must now, it was probably more so back in the bronze age when I started out...

    Knowing the assembly language for an architecture would probably not be a bad idea though.

    Quote Originally Posted by mhrsolanki2020 View Post
    2) Will improve C skills.. (planning to study data structures in c , that would sharpen my skill of c i guess , am i right or wrong??
    Sure, a firm grasp of data structures is always good.

    I still think you learn programming by doing though. It is probably simpler now than it was back in my Amiga days. Now you can find good code to read everywhere. Most people that learn do so by imitating. So my advice is to get some code that you know are written by a skilled programmer. Read that code and imitate it. See how it is structured. Try to rewrite parts of it and then compare it to the original. Play with it and try to extend it in some way.

    Quote Originally Posted by mhrsolanki2020 View Post
    3) Minix 3?? What is that??
    Minix is kind of the reason Linus Torvalds wrote Linux. It is a Unix clone, which was written as a teaching aid for a course in operating systems. The current version, Minix 3, is more of a research operating system, which is downloadable for free, just as Linux. The difference between them is that the Minix kernel source is several magnitudes smaller.

    Quote Originally Posted by mhrsolanki2020 View Post
    4) how do you plug in a scheduler??
    What I mean is find the source code for the process scheduler and reimplement it.

    Quote Originally Posted by mhrsolanki2020 View Post
    I can give time as i am not persuing kernel developing as career so i have a life time ahead of me to learn it .. i can go as slow as i want...

    Yup .. Eveyone should have a dream ,, cheers to that
    Good luck!

  12. #12
    Registered User
    Join Date
    Dec 2012
    Posts
    19
    Okk .. So will do it up with Minix 3 ... And read c codes and rewrite them so as to implement it in my own manner .. thankyou for the advice ...

  13. #13
    Lurker
    Join Date
    Dec 2004
    Posts
    296
    Quote Originally Posted by mhrsolanki2020 View Post
    Okk .. So will do it up with Minix 3 ... And read c codes and rewrite them so as to implement it in my own manner .. thankyou for the advice ...
    I'm glad that I could be of any help.

    I'd also like to recommend 2 books.

    Operating systems design and implementation by Tannenbaum is a really good companion to the Minix 3 source code.

    Also Lions' commentary of UNIX by John Lions is a classic. It is not for the faint of heart though as it is a rather heavy read as it is more or less a walk through of a version of the original UNIX. Some parts are written in PDP 11 assembly language.

    Good luck with everything!

Popular pages Recent additions subscribe to a feed