Page 1 of 1

My OS idea

Posted: Fri Nov 09, 2007 1:40 pm
by Dkelly
I'm thinking about writing an OS... here's the basics of what I'd like:

* Boots from disk.
* Command line interpreter.
* In the early days I'd like it to function something like lilo or grub so that it can boot other operating systems, but yet if I don't want to boot another OS I can stay in my OS. This will give the project usefulness right from the start, in case I find myself short on time to work on it, and stop development, at least I'd have my own os selecter.
* Command line functionality similar to dos's debug.exe utility. Ability to assemble directly from the command line, and read/write results to disk.
* Read/write fat32 at minimum.
*Most or all written in asm.
* 64 bit.
* Only support intel / amd x86 64bit.
* Multiple CPUs
* If I can find a suitable bios source code, it would be nice to integrate this into that bios, and have it flashed into the bios eprom so that it boots from there, requiring no disk.
* It would be nice to have it run from the CPU's cache, so that if no ram memory is present it can still run.
* either build it all myself or use whatever public domain source I can find, but no GPLd source.

Any comments? Has this been done already? Feasable? Possible? Pipe dream? Anyone have any PD source to donate? Warnings about difficult parts?

Thanks for your input.

Dan K

Posted: Fri Nov 09, 2007 2:26 pm
by AJ
Hi,

I would say that most of what you want to do sounds feasible. The only bit that I would treat with major caution is the 'flashing it to the BIOS' bit. Not just because things could go wrong, but more from the point of view of who the intended audience is. I know that I wouldn't flash someone's OS to my BIOS - even if it was written by MS / Linux contributers and was therefore (relatively) trusted.
It would be nice to have it run from the CPU's cache, so that if no ram memory is present it can still run.
I guess that to start with, your OS will be pretty much running from the CPU's cache anyway - until you get to about 2-4mb on a current machine, so that doesn't seem a problem. I would personally let the CPU do its own thing with regards to that.

Personally, I would tackle the project something like:
1. Get a basic first stage boot loader working.
2. Get a 'working unit' version of the secondary boot loader working - get a working debug-mode printf-like function working.
3. Do all the bits where you switch up to long mode (if you go down the 64 bit route) and get a working printf function working for that too.
4. Now you have debug output and can print constructive error messages on the screen, get your long mode memory management online properly.
5. Add CLI, FAT and whatever else.

If you are sticking with an OS Loader, I really wouldn't bother much with SMP....

Just my opinion :wink:

Cheers,
Adam