Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to learn some real programming in C and the concepts of Linux. So i thought i will try by looking at the Linux kernel 0.01 version source.

In my understanding, I could find the scratch level implementation of many things, but the comments are very few. For example :

void rs_init(void)
{
    set_intr_gate(0x24,rs1_interrupt);
    set_intr_gate(0x23,rs2_interrupt);
    init(tty_table[1].read_q.data);
    init(tty_table[2].read_q.data);
    outb(inb_p(0x21)&0xE7,0x21);
}

There seems to be no comments about the registers or the function.
I know the implementation will provide some idea, but I would like to know, if I should keep some reference so that the values and the names give me a better meaning and understanding.

Please offer some pointers.

share|improve this question
7  
I don't think, that Linux 0.01 will be a particularly great source for C programming concepts :-) Try Minix instead. Minix is used to teach operating system design, therefore it is a much better source for learning stuff like this. –  Let_Me_Be Jun 20 '11 at 14:36
    
You probably will constantly run into the same issue with that old code. You'd probably have to cross-reference lots of documentation in order to exactly follow that code. Hence, the previous comment - look at something else. –  Mr. Shickadance Jun 20 '11 at 14:51
    
@Let_Me_Be: I think it might be appropriate to write that suggestion up as an answer. –  Caleb Jun 21 '11 at 8:22
    
@Caleb It doesn't answer the question. –  Let_Me_Be Jun 21 '11 at 10:24
    
@Let_Me_Be: I realize it isn't an exact match, but the OP "thought he would try" something, then got stuck and asked for pointers. Your suggestion offers a way forward that will accomplish his objectives and resolve the core issue. Unless you have some documentation for linux-0.01 sitting around, I would say a pointing him to a different kernel that is simple and documented and good to learn C from is the best answer to the OP's question. –  Caleb Jun 21 '11 at 10:28

3 Answers 3

While Minix has been suggested as one OS to study, another is Unix Sixth Edition via the Lions' Commentary.

Sixth Edition Unix is quite small by today's standards and the Lions' commentary on it is considered to be one of the best set of notes for learning the Unix operating system. For the longest time, it was only available as a multi-generation photocopy, but thankfully it has been reprinted and should be available from your favourite online book seller.

share|improve this answer

As per request, rewritten from a comment:

I don't think, that Linux 0.01 will be a particularly great source for C programming concepts :-)

Try Minix instead. Minix is used to teach operating system design, therefore it is a much better source for learning stuff like this.

http://www.minix3.org

http://wiki.minix3.org/en/DevelopersGuide

share|improve this answer

The best way to learn a programming language is to have a problem to solve, rather than trying to read how other people solved problems that you don't have.

Find an open source Linux project that excites you, and start by looking at some open bugs and seeing if you can fix them. Sure, it's a challenge, but if you have a specific problem, then you can learn the language and apply what you've learned to fixing the problem. It's much easier than trying to learn from previous code.

Sometimes bugs need a good understanding of the stuff already, so maybe find an open source project which has some features on a wish list, and work towards integrating one of those.

Open source teams are always looking for bug reports with attached fixes or improvements. It'll help you learn, and it'll give something back to the open source community.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.