views:

1100

answers:

7

Or learning about C/C++, Linux development, or anything else? Or is it just something that might be fun or useful for some people to do?

+4  A: 

Go for it! It's a blast - and hard, but fun :)

Also, look at Minix for a very small, but functional, OS.

warren
upvote on both counts!
Javier
thanks - I'm sure there are other options, too, but these are the ones I know of :) .. my lug had a preso on this last month http://trilug.org/sep2008 - i believe the slides are available online, along with video and audio, too
warren
+3  A: 

I don't know, does changing the oil on your car help you learn mechanical engineering? :-)

Paul Tomblin
No, but it does help me learn about my car...
Thomas Owens
bad analogy. much better would be to assemble a car from parts ordered by mail, some of them from different manufacturers, but all 'supposed' to work according to some guy's plans
Javier
@Thomas, that's sort of my point - assembling a Linux system teaches you how to assemble a Linux system, not how to design an operating system.
Paul Tomblin
Ah, but while you're looking around the engine compartment to change the oil filter, you might appreciate ugly or elegant engineering along the way...
Toybuilder
@Toybuilder, I used to build my kernels, but all I learnt from that is how to run make config, not how the modules I'd just included or excluded were written. Similarly, changing your oil doesn't tell you much about the combustion cycle.
Paul Tomblin
+3  A: 

I would recommend reading the book Operating Systems: Design and Implementation from Tanenbaum and trying to implement Minix. It is the way most engineers are taught at school.

Null303
great book, i used it to read the whole Linux kernel (loong ago, vers 0.99pl9). you can learn a lot by contrasting the different design choices and seeing how each one was implemented.
Javier
+5  A: 

Actually I'd say no, it's not the best way for learning about operating systems, Linux development or C/C++.

Building a Linux From Scratch system might be very good at learning how to build Linux parts together to get a functional system, but I wouldn't suggest to try it if you're not familiar with basic usage of Linux.

As some people answered, the book Modern Operating Systems by A. Tanenbaum might be one of your best resources for learning about how *NIX OS works.

For C/C++ and Linux development, I'd start with The C programming language by K&R since the language used in building *NIX systems is C. Also, reading sources of Linux programs and modules never hurts in the learning process.

skinp
+11  A: 

Depends on what you consider to be an "operating system."

If you define it as an assemblage of core utilities, some optional packages, and a liberal sprinkling of system administration skills, then sure, building Linux from scratch will help you learn about all that. You'll learn to build the kernel, format the disks, install the core programs, and configure the user interface, among others.

But if you define an OS as an integrated assemblage of computer science concepts such as process scheduling, virtual memory, paging, processes management, threads, interprocess communication, device drivers, filesystem data structures, network stacks, and access control lists, then no. I wouldn't say that following some how-to scripts for building a Linux system will teach you much about these topics.

It all hinges on your point of view. Users and system administrators consider an operating system to be the user interface, utility programs, and the stuff that gets between you and your applications. Computer scientists define it as all the technologies that goes into the kernel which remain largely invisible to the user.

Which kind of learner are you?

Addendum: There are lots of web sites about Linux/Unix internals, such as TLDP, LinuxHQ, A Small Trail Through the Linux Kernel, Linux 2.4 Internals, and more.

Barry Brown
+2  A: 

Changing build options and rebuilding the kernel is a good experience, but it won't teach you all that much about the OS, especially if you are doing all of this on a PC.

If you are porting Linux, from scratch, to a new hardware, and have to make driver changes along the way, you will learn a lot though. It's a hair-pulling and fun experience! I've done this on two platforms... It's a good experience learning to build the kernel with a cross-compiler, and then building a root filesystem image into the kernel!

Toybuilder
+2  A: 

I put together a couple Linux From Scratch installs in the past, went to Gentoo and am now using Ubuntu. Linux from scratch is an excellent way to figure out how the various user land parts of Linux work and how a distro is put together.

Linux From Scratch will help give you a good amount of knowledge if you were thinking about starting your own BSD/Linux/OpenSolaris distribution. You get to learn a little bit regarding system administration, how gcc compilation is done, a tad about linking and shared libraries, etc.

Linux From Scratch will not give you a better understanding about C/C++ programming or general Operating System theory.

Redbeard 0x0A