Re: Writing an OS

From: Jason Stewart (kahuna_74_at_yahoo.com)
Date: 11/04/04


Date: Thu, 04 Nov 2004 15:00:36 GMT

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



Relevant Pages

  • Re: Where to begin kernel programming?
    ... the kernel is structured and Walter Oney's Programming WDM Drivers 2nd ... I have 4 years of C experience and I have read Programming ... Charles Petzold and other books that didnt take me far away from ...
    (microsoft.public.win32.programmer.kernel)
  • Re: [PATCH 0 of 4] Generic AIO by scheduling stacks
    ... thought we couldn't do native kernel threads for "normal" threading ... disciplines in question: i hacked on scheduling, 1:1 threading, on Tux, ... the programmer from the risks and complexities of thread programming, ... Having a 1:1 relationship between user-space and kernel-space context is ...
    (Linux-Kernel)
  • Re: Win32 API and Kernel
    ... The Win32 API is the published programming interface for support user space ... For instance the Win32 API: ... Now inside the kernel, there is a set of Kernel Support Routines ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Memory Allocation Table question ??
    ... Today Ray Pittigher in his posting "Subject:Is this a Kernel Problem? ... I have been looking for such a table for my memory allocations (just ... lines, before "Mem-info etc..."). ... where the kernel space starts and ends and here is the user space. ...
    (Fedora)
  • Re: forth and virtual memory
    ... Using a file-backed memory area and relying on the kernel and ... part which handles the MMU tries to do smart ... in which not only the RAM is used as a cache over the ... programming did not wait for him to get the point. ...
    (comp.lang.forth)