What's the easiest and/or simplest part of Linux Kernel?

Discussion in 'C Programming' started by 郭é–, Aug 25, 2013.

  1. 郭é–

    éƒ­é– Guest

    Here is about C language, so I think people here might know something about Linux Kernel.

    Recently I have a interest in Linux Kernel, but I don't think my C programming skill is able to handle it, I'm just going to read the code in Github.

    So any of you have ever involved in the dev of Linux Kernel? I've been kernelnewbies.org, it's a great website.
    郭é–, Aug 25, 2013
    1. Advertisements

  2. 郭é–

    gdotone Guest

    i would like to suggest you try reading Minix3.

    from what i have seen of it, the code looks clean.
    like, perhaps, what you would expect to see after acing your C class followed by that A you got in data structures. ;-)


    there is a video of the creator giving a talk on youtube.
    i think he did a great job. (he's presentation)

    there's a book too for Minix3.

    whatever you do good luck with it.
    gdotone, Aug 26, 2013
    1. Advertisements

  3. 郭é–

    éƒ­é– Guest

    在 2013å¹´8月26日星期一UTC+8上åˆ10æ—¶23分14秒,写é“:
    I did read minix3's code yesterday, I think the code there is neat and simple, not complicated like Linux Kernel.

    So the data structures of a program or kernel is important?
    郭é–, Aug 26, 2013
  4. "Show me your code and conceal your data structures, and I shall
    continue to be mystified. Show me your data structures, and I won't
    usually need your code; it'll be obvious."
    --Eric S. Raymond, The Cathedral and the Bazaar
    Stephen Sprunk, Aug 26, 2013
  5. A few points come to mind. First of all at the risk of triggering
    some huge and ultimately pointless flame war the Linux kernel
    probably isn't the best place to look in the first instance. I've
    only limited experience of it but it huge and gets turned upside
    down on a regular basis as entire subsystems come and go. I seem
    to remember coming accross a statistic a while back to the effect
    that different revisions of the 2.6 kernel differ by more lines of
    code than are actually in any of the modern BSD kernels. Also the
    nature of Linux development with at least 10x the number of developers
    working on it than any of the BSDs make it quite inconsistent

    There are any number of good books on kernel internals. If you
    look at Linux make sure to cross-reference it against the specific
    version under consideration and don't be surprised if things have
    changed. If this is purely for academic interest and historical
    versions could be considered (not a bad option since they tend to
    be a lot simpler) Lions' Commentary on Unix 8th Edition by John
    Lions and The Design and Implementation of the 4.{234}BSD Unix
    Operating System by Leffler/McKusick/Karels/Quartermann are both
    legendary. I did work through Leffler et al cover to cover a few
    years back and while it's a little dry in places and makes no sense
    at all with a source listing (easy enough to download) most of it
    is easy enough reading and you do feel you've spent your time
    productively at the end of it.
    Andrew Smallshaw, Aug 26, 2013
  6. ITYM, "without".
    Kenny McCormack, Aug 27, 2013
  7. 郭é–

    éƒ­é– Guest

    在 2013å¹´8月27日星期二UTC+8上åˆ4æ—¶54分47秒,Andrew Smallshaw写é“:
    Yes some months I read some parts of Linux Kernel on Github but had no mindon it. 2 days before, I read Minix3's code, I found it neat and simple, I don't mean it easy but simpler than Linux Kernel.

    I may be purely for academic interests on *nix kernel code. And as you mentioned, Lions' Commentary on Unix, which I knew from Hackers & Painters, written by Paul Graham. I may try it out later.
    郭é–, Aug 27, 2013
  8. 郭é–

    Tim Rentsch Guest

    This quote is actually from (or perhaps paraphrased from)
    /The Mythical Man-Month/, by Fred Brooks.

    (And /The Cathedral and the Bazaar/ gives an attribution
    to that effect.)
    Tim Rentsch, Aug 27, 2013
  9. 郭é–

    Jorgen Grahn Guest

    Paraphrased. My copy of TMMM is at home, but googling seems to
    indicate that Brooks wrote

    Show me your flow charts and conceal your tables and I shall
    continue to be mystified, show me your tables and I won't usually
    need your flow charts; they'll be obvious.

    which amounts to the same thing, except it's also an attack on flow
    charts; Brooks found them useless.

    There's also Rob Pike, in "Notes on C Programming":

    Data dominates. If you've chosen the right data structures and
    organized things well, the algorithms will almost always be
    self-evident. Data structures, not algorithms, are central to
    Jorgen Grahn, Aug 27, 2013
  10. 郭é–

    Jorgen Grahn Guest

    [BSD, Lions, Leffler/McKusick/Karels/Quartermann]

    Another thing is, if you just want to *accomplish* something, doing it
    yourself in the Unix kernel should be a last resort. Everything
    becomes so much harder there: building, debugging, licensing,
    portability ...

    Jorgen Grahn, Aug 27, 2013
  11. 郭é–

    éƒ­é– Guest

    在 2013å¹´8月27日星期二UTC+8下åˆ3æ—¶50分41秒,Jorgen Grahn写é“:
    I don't understand, you mean that coding in Linux/Unix is hard work?
    郭é–, Aug 27, 2013
  12. 郭é–

    Jorgen Grahn Guest

    Please fix your newsreader.
    No. I mean writing and maintaining Linux /kernel/ code is a lot harder
    than doing it in user space.

    (Of course some problems must obviously be solved by kernel
    programming, but sometimes you have a choice and then you need to be
    aware of the cost difference.)

    Jorgen Grahn, Aug 27, 2013
  13. 郭é–

    Les Cargill Guest

    There is a compromise; write a device driver. You don't even need a
    "device" to drive; just twiddle bits in a 'C' statically allocated
    patch of RAM.

    The kernel proper has developed into a fairly arcane subculture. If
    you want to write your own microkernel to sit on another
    type O/S there are examples of that, too.
    Les Cargill, Aug 28, 2013
  14. 郭é–

    James Kuyper Guest

    He's using Google Groups - I don't think that's an option. Are you sure
    it's his newsreader that's at fault? According to mine, using the "View
    Source" command, his message says:
    and the line that bothers you so much is rendered as:
    In the main screen, it displays those UTF-8 characters on my screen as
    Chinese characters corresponding the ? characters in your message. Those
    characters translate literally as
    James Kuyper, Aug 28, 2013
    Stephen Sprunk, Aug 28, 2013
  16. 郭é–

    Tim Rentsch Guest

    I didn't take this comment as an attack on flowcharts. It's
    true Brooks thought flowcharts were overrated, but I don't
    think the quoted statement was meant to speak to that issue;
    it could just as well have been "algorithms" or "pseudo-code"
    for the point he was making.

    One of my favorites is also from Mythical Man-Month:

    Representation is the essence of programming.
    Tim Rentsch, Aug 29, 2013
  17. I was aware of the original quote and deliberately chose Raymond's
    because the terminology is more modern; if I had quoted Brooks, I doubt
    that éƒ­é– would have understood the relevance of flowcharts and tables
    to his question.
    .... and I attributed /The Cathedral and the Bazaar/, which is sufficient
    to find the attribution to Brooks if anyone had cared.

    Stephen Sprunk, Aug 29, 2013
  18. 郭é–

    Tim Rentsch Guest

    Brooks and MMM still deserve the credit. If you think the
    quote needs paraphrasing for contemporary usage, paraphrase it
    yourself. Attributing Eric Raymond is misleading.
    The problem with that idea is no one will think to look, and
    people will come away with the wrong impression. I looked it
    up only because I recognized the quote as being from Mythical
    Tim Rentsch, Aug 29, 2013
  19. 郭é–

    Jorgen Grahn Guest

    [snip lots]
    You both miss the most obvious: inserting Chinese text in a message
    to an English newsgroup is a bug. And that was not even the reason
    for my complaint; the double line spacing bug was.

    Jorgen Grahn, Aug 29, 2013
  20. 郭é–

    Jorgen Grahn Guest

    Yes, I agree code vs. data structures is the core of that quote.

    (Or code versus external representation; I find that file formats and
    protocols should be designed even before the C data structures for
    work to flow smoothly.)

    Jorgen Grahn, Aug 29, 2013
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.