Subj : Re: Writing an OS To : comp.os.linux From : Jason Stewart Date : Thu Nov 04 2004 03:00 pm In article <418a18a8$1_2@news.fastfreenet.com>, Darrell Blake wrote: > Hi, > > I'm thining of writing an OS for my final year project at University but > I havn't got a clue where to start. I was hoping someone on here could > give me some good places on the net to look at or advise me on some good > books to read on the subject? The Tannenbaum books are *the* books to read if you're looking into creating your own OS. You may want to pick up some practical reading such as "Understanding the Linux Kernel" also. Be prepared to learn to understand how the microprocessor on your target platform works. > I've been using Linux as my primary OS for nearly six years now and have > realised that OS programming (and low level programming in general) is > one area of programming that I really don't know much about. > > The problem with Universities these days is that they only teach high > level stuff and I imagine it would be pretty tough to write an OS in > Java or, heaven forbid, C#! Ideally, I would want to write one in C++ as > that's my main language of choice (plus, I've ever even looked at C) > what is your opinion on this? C is the ideal language to write a kernel in. There are too many hidden memory allocations in C++. It's nice to know how and when your memory is being allocated by looking for malloc() or kmalloc(). With C++ this is unclear due to automatic constructors/destructors. There could be advantages to using C++ as a better C without using all of the OOP stuff, but any OOP (constructors, dtors and exceptions) would most likely be undesirable in a kernel due to the unlear nature of memory allocation and exceptions in kernel debugging as opposed to just using return codes and kmalloc(). Creating parts of the API in C++ might not be a bad idea. MS did that with the GDI portion of windows and that (arguably) turned out OK. In any case, good luck in your huge undertaking. Keep us posted. Cheers, Jason .