Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing an operating system....

Status
Not open for further replies.

whistlerboy

Programmer
Mar 7, 2001
1
CA
Hey, I'm thinkin of writin mi own os. Just would like to know why the main choice of the language is usually C. I would like to write it in C++. Im thinkin of usin the DJGPP compilers, and EMACS IDE. Also, a NASM assembler. What exactly is it? And why do I need it?
I am new to this, any suggestions, or guidence, or critisism would be appreaciated.
 
Have you been to Be.com website? Their OS is written in C++, and it's really really fast. Makes me wonder why NT is so slow....

Chip H.
 
Assembler is basically machine code. It's what every language (c, c++, vb, etc is built upon) It's also what your compiler generates.(sort of)

Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
 
chiph, if you have not noticed, there are a couple reasons why BeOS is really fast, but personaly I hate it

1) it has extremely limited hardware support
2) extremely limited video card support

it's just very limited, therefore it will naturally run faster, NT runs slower because it's checking out the hardware and such, win2k is improved because it doesnt dianose the hardware everytime it boots, just new ones or the first install.

in my opionion, BeOS is like a lower end MacOS platform made for the PC.

ASM is the base of any OS (as mentioned by mbaranski)
Higher level programming languages makes it easier to write for a particular task, writing in pure ASM is not only faster (execution speed) but also smaller if written correctly, most other higher level programming languages, have much more overhead, that can slow the execution speed.

the only disadvantage of ASM is it's ease of use.

Most of the modern OSes, are created using numerous language, let along all the componets used could be multiple.

Linux is an OS I know of that is written mostly in C/C++ and ASM somewhat. Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, HTML/Dhtml, Visual InterDev 6(ASP/WebProgramming/Vbscript)

 
my two cents...

even a small o/s is going to be tens of K-lines of code so...

write it in c++ to learn the concepts associated with o/s design. then when/if you actually use the o/s re-write those high-use routines in well crafted assembler (or c). you're going to have to do a lot of re-writing (re-factoring) to get it work well so might as well be comfortable at the learning stage.

but learning about coding o/s is learning about the machine at a low-level so somewhere you're going to have to get that assembler experience under your belt. if for no other reason, than to understand what the low-level issues are for the target machine.
 
chiph, if you have not noticed, there are a couple reasons why BeOS is really fast, but personaly I hate it

1) it has extremely limited hardware support
2) extremely limited video card support

it's just very limited, therefore it will naturally run faster, NT runs slower because it's checking out the hardware and such, win2k is improved because it doesnt dianose the hardware everytime it boots, just new ones or the first install.


I'm not a BeOS bigot (rather, I like OS/2!), but I was impressed with it. So far as boot speed, I find it to be somewhat irrelevant as long as the OS is stable enough to stay up for a week or two at a time. What impressed me about BeOS was the ability to turn on/off CPUs in a SMP box at will to do testing of your multi-threaded app.

I was also impressed with how much of an starter application you can get by just inheiriting from the BApplication object. And to extend it further wasn't too difficult, either. I've compared it favorably with IBM's OpenClass GUI library.

You are correct in it's limited support for hardware, especially video cards. (Check out Linux, it's still limited compared to NT). But since I've always felt that drivers are more important than hardware, I tend to buy cards that have quality support for a wide-range of operating systems. Thus far, that's mostly been Matrox, and ATI (somewhat). I usually have to spend a little more (instead of buying a cheap Taiwanese card), but it's worth it.

Chip H.
 
hrm, gee this sounds very familiar to an earlier post, hehe Karl
kb244@kb244.com
[Post your questions in tek-tips for all to see , do not email me with questions]
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, HTML/Dhtml, Visual InterDev 6(ASP/WebProgramming/Vbscript)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top