Operating system, compiler?

tonofsteel

Active member
Joined
Jul 10, 2003
Messages
35
Could you use C++ .net to write a operating system.
How do you go about making an operating system? I know that to write something like Windows or even old old Dos is not a easy task.

How do you write some code and make it so that the computer will boot up with it. What libraries would you use? Could you start off with writing a simple hello world bit of code and get the computer to boot up, and run your program that simply controls only the monitor to write that text to it? Is that a hard task to acheive.

Do you have to use or write drivers to access hard drives, graphics cards and other devices?

If you download say the Nvidia graphics card driver how would you know what to call or use from them?

I am interested in this because slower X86 Processors are becomming very economical to use in a control type application, but windows is an excessive operating system to use for controlling a few motors, valves etc. And dos is no longered offered by microsoft is it?

As well how would you write a compiler. Do you write something that recognizes "print" and then directly interpret print into some machine language that will print something to the screen?
 
A program that will boot with the computer can only be made in assembler. If you want to know how to make one just search google for "bootloader". Then when you have that, you can start making the rest in C++ (not C++.NET), but assembler is still recommended for core parts like the kernel. A hello word program like that is not hard as long as you have basic understanding of assembler.
If you want to know hardware specifications then manufacturers should have some resources, like Intel for example has a lot of resources about working with the processor.
 
Making a compiler is an extremely complex task. There is lots of research on this, and most universities offer compiler construction courses. If you do a search for Recursive Descent or LR Parsers you should get some webpages that offer compiler construction advice. There are also "compiler compilers" available for download (ie. YACC, LEX [I think thats what its called]).
 
Here is a good book on compilers. Its a VERY non-trival (ie, very difficult) task.

Writing an OS, even the simplest one available is 10 times as hard.

Id stick with DOS - surely you can find a copy somewhere? To code in DOS, you might also need an older compiler for C++ or Pascal or whatever - pretty much anything but VB. But at least youd have access to the disc, monitor, etc.

-Ner
 
If you want to use an x86 processer for a control type application, you can get a version of windows called Windows Embedded made specifically for this purpose. Also Linux and the various Unix flavors come in very lightweight distributions for this purpose, and since Linux is open-source you can modify it to suit your needs (which would be infinitely easier than trying to write your own OS from scratch).
 
if you want to control motors, have you ever heard of BASICSTAMP?? or for those more c inclined JAVASTAMP (ooo did i just include the bad bad sun word??) search google for either one and it will direct you to the company that makes them, you can get the whole development kit for around 170 bucks (that is the basic, of course they have toys that go along with it) the stamps themselves are not too terribly bad, but can get expensive if you dont have a product to put them in.

great for controlling motors and such...

i guess old robotics engineers never really die, we just find other things to spend our money on.
 
Back
Top