• 0

How to build an operaing system ?


Question

Recommended Posts

  • 0
I can tell you that Windows is written in C and C++, with small amounts of assembly in places. Linux, mostly C++ from what I understand. DOS, who knows (or cares) ;)

How to test an OS? Get it to boot successfully and not crash.

To write a boot sector to start your OS, you will probably need to know some assembly.

Windows 9x (95, 98) run on top of DOS. Windows ME does not, but it is very unstable. Windows NT (NT4, 2000, XP, and on) do not run on DOS or anything else. The bootloader (NTLDR) directly loads the NT kernel. I don't know what you mean by "designed system".

To give you an idea of what you're talking about, Windows NT was started in the early 90s by a small team of people which quickly grew to a team of over 400 people, and now the NT team consists of several thousand people. Windows Server 2003 (the most recent version of Windows NT) has roughly 50 million lines of code, and takes several hours to compile on a server farm. Granted, any hobbyist OS isn't going to be nearly the size of today's Windows, but even linux has been around for about 10 years now, and was based on Unix, which has been around virtually forever in computer years.

585120935[/snapback]

WineME does run on a DOS bootstrap. It is not like NT.

  • 0
I 75% sure that windows (NT and up) only use DOS to load, not to run (unlike 9x).

Once windows is loaded, it dones't depend on DOS any more.

Once more.. I'm not 100% sure of this, it's just my way of seeing it.  :rolleyes:

585120961[/snapback]

I'm 100% sure there is NO DOS needed to run XP. io.sys, config.sys, autoexec.bat... not needed by XP.

  • 0
Well, there's going to be at least some part of a system that will be in assembly.

585138228[/snapback]

Yeah, I just remembered, some parts of a complex OS has to be written in assembly but in general, simple OS can be written in high level languages.

  • 0

The kids trying to learn and make an OS to be as he chooses, let him. Ive seen alot of "You cant, Give up, You wont, This and that". There IS no I CANT, HE CANT, THEY CANT. If this were all true, then we wouldnt be here at this very moment. Computers dont grow out of trees, and OS'es dont grow in a flower. A person just like that sat down and thought about it and analyzed. Sure, the chances are fairly slim, and it will take years, but you never know. Maybe in the near future we'll see a full blown OS come out that many of us will like and switch over to. Im not one to hate XP, or Microsoft for that matter, but something new wouldnt be bad.

Overall, and in the end, good luck mate. Be patient and take your time, if it doesnt end up being successful, atleast you have the experience and knowledge that you probably dont have at the moment. I myself would like to have more knowledge in this, and the links given have been great. I shall also sit down over my spare tiems and read all of this. It might come in handy some day. :yes:

  • 0

good point kayman, @elagizy if you want to make an os styled on that program, you do know the .net languages require the clr to run dont you? there is mono for linux but then again the support for windows.forms requires to be on windows or running wine in linux. If youd really like to have that as the main interface in an os id highly suggest, as others have you simply make a shell replacement, like bb4win etc ;)

@ davemania24 --- http://www.menuetos.org/ on the first page of this thread, an os written completely in assembly, very cool little thing

  • 0

thanks all for your point of view about the program and about the hell which i'm going to face it in doing my OS ...

and i have download the source code of the kernel and application of www.menuetos.org OS ( special thanks for the posting, its pretty cool ), if you see the screen shots it seems that the programmer made a graphical interface for the OS ( as i want to ) also i can see he made also something in his OS which can play the famous game Prince Of Persia (Dos Version)

and thats the features :

- Pre-emptive multitasking, multithreading, ring-3 protection

- Responsive GUI with resolutions up to 1280x1024, 16 million colours

- IDE: Editor/Macro Assembler for building kernel and applications

- TCP/IP stack with Loopback, PPP & Ethernet drivers

- Network applications include ftp/http/mp3/smtp servers,

- irc, http, nntp and tftp clients

- Free-form, skinnable application windows

- Hard real-time data fetch

- Fits uncompressed on a single floppy!

i think now that will be a good source which help me the essentials ....

and i am going to ask u few question as a beginning to go through hell :

- i want to know the period which takes in doing that OS ? ( you may give a range )

- what is the best tool which i use to write assembly and C ? ( if there is , Giving links to download the tools will be great )

- Is Virtual PC is the best tool to test my OS faster ?

- and finally what is the 1st step ( File ) which i will program it first ? ( discss only the main idea (task)file and i will going to conclude it through the files of menue OS )

  • 0

- Writing your own OS from scratch takes a while... there's a class at my university where that's done in a semester.

- You can pick whatever you want as your editor... I like vim. You can use gcc and co. to build the source into a kernel.

- Virtual PC is probably the best option if you have it. Otherwise, you're stuck with something like bochs.

- I don't know what you're asking...?

  • 0
i think now that will be a good source which help me the essentials ....

and i am going to ask u few question as a beginning to go through hell :

- i want to know the period which takes in doing that OS ? ( you may give a range )

- what is the best tool which i use to write assembly and C ? ( if there is , Giving links to download the tools will be great )

- Is Virtual PC is the best tool to test my OS faster ?

- and finally what is the 1st step ( File ) which i will program it first ? ( discss only the main idea (task)file and i will going to conclude it through the files of menue OS )

585139243[/snapback]

1) Depends on how many features you have, how many people you have working on it, etc... If you start from scratch maybe 5-6 years? If you use the example OS and built from it.. maybe sooner? Its hard to guess since I am finding it hard to judge your level of computer knowledge.

2) I use a plain notepad or text editor program for assembly and Visual Studio.Net for C. There is the KDevelop clone of Visual Studio for free (it is open source).

3) Yes, VirtualPC or VMWare is the best way to test your OS unless you have a second computer which you can use. I would prefer to use a real machine, but you may not have that. Although, with the virtual machine you have a lot more debug options available.

4) You first need to write a boot sector and master boot record to start your OS. Then you need to develop a kernel to provide basic features such as mulit-tasking, device support, etc. The last thing you will do is create your user interface and functionality.

  • 0
Uhhh, I've never seen an OS hand coded in assembly unless it was in a embedded system

585138223[/snapback]

Umm, what do you think the low level stuff is? C++? JAVA?!? Of course all OS'es have parts in assembly. :rofl:

  • 0
BTW , is there any harm to my computer devices while programming OS ( when making drivers for the devices ...... etc ) ?

May I make a suggestion? Find a super-cheap computer, maybe even one somebody's throwing away, and thrash it. Use the free compilers that come with Linux ( I already gave the link last time.), write any program you wish, and run it on that cheap PC. Call it your "crash test dummy". When you have reduced it to a heap of smoking ruin, replace whatever hardware you trashed. Get acquainted with your screwdriver...make it your best friend. When you have fixed the computer, trash it again, and so on.

What will this do? You will learn right away what to do and not do with device drivers (I hope you can find a lot of cheap monitors!), and you will become familiar with more different kinds of hardware. To make your operating system any good to other people, you'll need it to be able to run on somebody else's computer besides your own, right? So get your hands on as much old hardware as you can! Later, you can buy the better hardware to test it on, and announce that you've "ported" your OS to the newest hardware. In the meantime, all the 286's out there still WORK...

Others here have suggested Visual Studio applications, and yes, they have their merits. But you're asking where can I find compilers/development environments free...Linux Red Hat comes with (I'm guessing) eight compilers, and/or development envoironments? There's gcc, yabcc, g++ just for C, there's emacs for the ultimate text-based code environment, where there's no bossy GUI getting in your face and fouling up the Chi of your programming space, there's at least half a dozen interpreters and compilers for other languages ranging from Ada to assembler. I never scanned a line of Perl code, and just reading the tutorial that came with my distro for free, I now could at least grope my way through Perl if I had to.

You see, you're proposing to write an entire OPERATING SYSTEM! So, you'll need to be really, really knowledgable about EVERYTHING a computer does. Even about the applications and processes that you don't use. Other people may use or want them, and so your operating system will need them.

I don't mean to be so pushy about Linux (I'm turning into a Linux missionary, I sometimes feel) but Linus Torvalds started out just like you, and he's the best example I can recommend. Also, in the Linux world, there are so many different flavors and variations of Linux, and some of them are very small (try getting ahold of "Damn Small Linux" or "Linux friom Scratch" ), and you might be better off starting with your system by "thinking small". Start with the basics: what do you want a computer to do? Then build from there.

And, if nothing else, thank you for starting this thread. I have found it most stimulating, and it has produced a much livelier discussion than the usual questions. And count me in with the people cheering you on! You can do it, if you set your mind to it! But you will have much to learn. And why not do it, anyway? Why not? You only have a lifetime, and many people live and die in this world without even writing any programs at all...

  • 0
ok so tell me what is the files which make windows depends on emulated DOS ,

as i think smartdrv.exe makes the computer thinks that its working on winxp ( but you exactly working on DOS ) , u use that file to fast the windows xp setup process through DOS . i will call that file as EMULATED WINDOWS FILE

585120974[/snapback]

Smartdrv.exe is a disk-caching program for DOS, it speeds up disk I/O. Winxp setup in DOS mode will use it if its available, and complain if its not there telling you that its going to take a long time to copy files without it. Thats all.

Edited by Richardo
  • 0

Yes you can damage your computer, that's why choose the Virtual PC, if you have it, the worst it can happen it's that the VPC crashes, the hardest part will be the drivers communication, and the bootloader, then after this, all extra-features will be easier to deploy.. :cool:

  • 0
Yes you can damage your computer, that's why choose the Virtual PC, if you have it, the worst it can happen it's that the VPC crashes, the hardest part will be the drivers communication, and the bootloader, then after this, all extra-features will be easier to deploy.. :cool:

585533858[/snapback]

I would probably be better, from a compatibility stan-point, to just find an el-cheapo computer and test it on that. That way you have actual hardware running you OS, not emulation hardware.

  • 0
I don't mean to be so pushy about Linux (I'm turning into a Linux missionary, I sometimes feel) but Linus Torvalds started out just like you, and he's the best example I can recommend. Also, in the Linux world, there are so many different flavors and variations of Linux, and some of them are very small (try getting ahold of  "Damn Small Linux" or "Linux friom Scratch" ), and you might be better off starting with your system by "thinking small". Start with the basics: what do you want a computer to do? Then build from there.

585162399[/snapback]

Except... Linus did NOT write an OS... Linus wrote a kernel. The OS now known as Linux was built over a period of several years by dozens of people under GNU.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.