• 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.

Link to comment
Share on other sites

  • 0
the only one i think i can anser is hte one that deals with dos

IIRC, windows 2000, xp, 2003 and of course longhorn dont use dos as an underlying system

585120924[/snapback]

Ok, but why when i setup WINDOWS XP in DOS !! ( when i goto in DOS and run smartdrv.exe then goto i386 and then winnt.exe ) that means that windows depends on DOS

also try to remove the 3 DOS files msdos.sys , io.sys, command.com , u will face a lot of troubles ........ all of that prove that Windows depends on DOS

Link to comment
Share on other sites

  • 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]

thats great but what the first step to make an operating system, BTW i mean DESIGNED SYSTEM as a system with colours and some graphic for begginers and you can do all WINDOWS operations through DOS , is that true ?

Link to comment
Share on other sites

  • 0
also try to remove the 3 DOS files msdos.sys , io.sys, command.com , u will face a lot of troubles ........ all of that prove that Windows depends on DOS

585120942[/snapback]

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:

Link to comment
Share on other sites

  • 0
Windows xp runs an emulated dos.

585120959[/snapback]

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

Link to comment
Share on other sites

  • 0
you can do all WINDOWS operations through DOS , is that true ?

585120955[/snapback]

Yes. Almost anything that can be done in windows can be done in DOS (not minimiza, max or switch windows).

Link to comment
Share on other sites

  • 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]

yes u right but we must say that dos files was the KEY files to make you start windows ( without them no windows )

Link to comment
Share on other sites

  • 0
yes u right but we must say that dos files was the KEY files to make you start windows ( without them no windows )

585120978[/snapback]

I'll say yes....I think all OS has a dependancy on a command line-based system.

Even Linux...and fancy as you can get the GUI with X, it's still sitting on a comand line.

BTW: the best solution to find out if Window is dependant on DOS should be e-mail Microsfot and ask them about it. It'll take aobut 1 week for them to reply tho...

Link to comment
Share on other sites

  • 0
Ok, but why when i setup WINDOWS XP in DOS !! ( when i goto in DOS and run smartdrv.exe then goto i386 and then winnt.exe ) that means that windows depends on DOS

also try to remove the 3 DOS files msdos.sys , io.sys, command.com , u will face a lot of troubles ........ all of that prove that Windows depends on DOS

585120942[/snapback]

Windows versions based on the NT kernel (ie: NT 3.x - Windows XP/2003 Server) do not require these files.

In essence, the PC's boot goes like this:

The BIOS runs the POST (power-on self test) "hey, do we have memory in here? how much? any glaring problems with it? drives? cpu speed? everything in basic working order? alright, let's start to boot! Now, where's that MBR?"

The MBR (master boot record) is loaded off the hard drive, which specifies the actual location of the logical boot drive (what are we gonna be booting from?) after which the actual bootstrap code is executed which loads the necessary boot files for whatever OS you are running. Depending on the OS, different MBR code is written, which calls different bootstrap files.

In the case of old school DOS, it went something like this: IO.SYS came first, basically to handle, well, input/output tasks - low level stuff (most likely written in pure assembly). Next came MSDOS.SYS, basically the DOS "kernel" - this is what we relied on to run apps and whatnot - applications would "hook into" the kernel for basic tasks - ie: how was the file system going to be organized? what got loaded into memory where? I could be a little off here, mind you - it's been a while. Some parts of MSDOS.SYS may be low level (ie: written in assembly), but I'd reckon a good chunk of it was probably written in C or an equivalent high level language. Next, to actually interface with the OS, we had COMMAND.COM - this was our command interpreter (ie: what we saw on the screen which let us interface with DOS, type commands and such, execute programs, etc.).

By the way, to further add to the confusion, in Windows 9x, Microsoft did away with MSDOS.SYS (its function being encapsulated into IO.SYS).

Perhaps this helped? The hell if I know what I'm talking about - it has been a while for me :)

Link to comment
Share on other sites

  • 0
Windows versions based on the NT kernel (ie: NT 3.x - Windows XP/2003 Server) do not require these files.

In essence, the PC's boot goes like this:

The BIOS runs the POST (power-on self test) "hey, do we have memory in here? how much? any glaring problems with it? drives? cpu speed? everything in basic working order? alright, let's start to boot! Now, where's that MBR?"

The MBR (master boot record) is loaded off the hard drive, which specifies the actual location of the logical boot drive (what are we gonna be booting from?) after which the actual bootstrap code is executed which loads the necessary boot files for whatever OS you are running. Depending on the OS, different MBR code is written, which calls different bootstrap files.

In the case of old school DOS, it went something like this: IO.SYS came first, basically to handle, well, input/output tasks - low level stuff (most likely written in pure assembly). Next came MSDOS.SYS, basically the DOS "kernel" - this is what we relied on to run apps and whatnot - applications would "hook into" the kernel for basic tasks - ie: how was the file system going to be organized? what got loaded into memory where? I could be a little off here, mind you - it's been a while. Some parts of MSDOS.SYS may be low level (ie: written in assembly), but I'd reckon a good chunk of it was probably written in C or an equivalent high level language. Next, to actually interface with the OS, we had COMMAND.COM - this was our command interpreter (ie: what we saw on the screen which let us interface with DOS, type commands and such, execute programs, etc.).

By the way, to further add to the confusion, in Windows 9x, Microsoft did away with MSDOS.SYS (its function being encapsulated into IO.SYS).

Perhaps this helped? The hell if I know what I'm talking about - it has been a while for me :)

585120987[/snapback]

no really that helps , i wonder how this 3 intelligent dos files recognize all of that which are you talking about on different pcs with different bios and different devices ....... ohhhh amazing ........ i think IO.sys has the responsibility for this task.

Link to comment
Share on other sites

  • 0

I will ask microsoft about that but i hope they give me their secrets , i think they will answer this mainly :)

now, i think you all agreed that dos written in pure assembly so that mean assembly was programmed by machine language

------------------------

i g2g i will check this thread l8er to find out ur thoughts about this subject

Link to comment
Share on other sites

  • 0
Ok, but why when i setup WINDOWS XP in DOS !! ( when i goto in DOS and run smartdrv.exe then goto i386 and then winnt.exe ) that means that windows depends on DOS

also try to remove the 3 DOS files msdos.sys , io.sys, command.com , u will face a lot of troubles ........ all of that prove that Windows depends on DOS

585120942[/snapback]

XP Setup doesn't have to be performed from DOS. You can boot from either the XP CD or the appropriate floppy disks and start the setup routine.

Those three files you listed are essentially DOS itself. Notice that XP (or any version of NT for that matter) do not install or require any of these three files, nor will it use them if they exist. XP will, however, execute autoexec.bat IF it exists, but it is not required to perform startup configurations.

Link to comment
Share on other sites

  • 0
I'll say yes....I think all OS has a dependancy on a command line-based system.

Even Linux...and fancy as you can get the GUI with X, it's still sitting on a comand line.

BTW: the best solution to find out if Window is dependant on DOS should be e-mail Microsfot and ask them about it. It'll take aobut 1 week for them to reply tho...

585120985[/snapback]

Every OS depends on a lower, command-line based system? Not necessarilly. What "system" do Macintosh OSes (besides OSX) run on? What does NT run on? Itself. I can tell you that's a fact (at least for NT) because for one, there's no command line interpreter (cmd.exe, command.com, etc) even running on NT until the user launches it (via the graphical shell) or the registry is configured to boot with it.

Edit: But by the time the registry is launching apps, NT is well past the "boot" stage...

Link to comment
Share on other sites

  • 0
no really that helps , i wonder how this 3 intelligent dos files recognize all of that which are you talking about on different pcs with different bios and different devices ....... ohhhh amazing ........ i think IO.sys has the responsibility for this task.

585121002[/snapback]

Well, that's kind of the idea. In the old primitive days, on a variety of platforms, it was not uncommon for an application diskette to also load a self-contained OS. The idea of having a centralized OS to take care of certain tasks really frees up the programmer. Remember running Wordperfect for DOS? The interface was built by the programmer from the ground up - everything from how the program looked and felt, to how you opened files, saved files, etc. All of the "graphics" and interface elements were designed by the programmer from the ground up. DOS provided the programmer a base on which to design an application - ie: it provided 1) support for a file system 2) support for accessing memory and I/O devices 3) support for modifing that file system, but it was up to the programmer to implement those things. When a programmer designs a basic windows app (let's not get into dot net and all that fun stuff just yet), they have more options. Windows already provides them a common interface that they can just modify based on specific settings for their apps. Literally, the application says "Hey, Windows, draw a window for me here!" and Windows obeys. That frees up a considerable amount of time for the programmer: time he can spend on doing other important things. At best, under DOS, an application could say "hey, DOS, I'm about to write data to the file system!" and DOS will obey - but the interface to writing that data (ie: the dialog box or whatnot) is all up to the programmer to design. Windows already does that for you via its API (application programming interface, I believe). Of course, you can make custom dialogs, et al, if you wish. But that's another story altogether.

Yes, in every operating system, you need a method to actually access the PHYSICAL hardware. Note that it's probably not a good idea for an application to be sending writes directly to the HD controller. It's probably more sane that there be an intermediary layer to handle that. Basically, the programmer shouldn't have to know the inner workings of computer hardware in order to write their apps. So that's what it basically comes down to: an operating system, in essence, allows programmers to develop applications without necessarily knowing all the fine points of how data is physically sent through the bus, to the hd controller, and how the controller then passes the data off to the drive itself, where it is then written to tiny rust particles. All the programmer needs to know is that there is a function called SaveFile() which takes care of all this stuff for them and they can call that function whenever they need to save something. Once again, I could be wrong. I drank a lot tonight, and it's been a while :)

Link to comment
Share on other sites

  • 0

The linux kernel is written almost entirerly in C. DOS was written in assembly, although I believe parts of it have been rewritten in C over the years. The NT kernel, cornerstone of modern Windows, is written in C and C++.

Like morficus said, any Windows system based on the NT kernel uses legacy dos methods of booting itself. This isn't the same as Windows 9x and ME, which run on top of dos but include a GUI. Notice how we no longer worry about conventional memory, expanded memory, etc. The memory manger for the NT kernel is completely different from DOS.

Depending on what you're looking for, writing an operating system can be relatively simple (minimal, no drivers, no userland tools, uniprocessor) or massively complex (clustering, support for multiple architectures, drivers). Assuming you want to build an OS for the x86, you'll certainly need to use assembly to write certain parts of it (like the bootloader).

Uhm, if you want scientific information you're looking in the wrong place. You can google the topic, which will probably give you plenty of information on how to program your own mini operating system, but, if you're serious, most universities with computer science/computer engineering classes will have operating system design courses and an extensive library to research from. Don't forget most computer science people will want you to be specific when you talk about an operating system, such as linux. Linux is the kernel. Most userland tools (command line, system libraries, gui, etc) that make it useful are written by the fine people at gnu.org. Thus the you'll often see Linux as a whole refered to as "GNU/Linux".

That said, here's your answers in brief:

Assembly/C/C++, You can't, yes, no.

Link to comment
Share on other sites

  • 0
Every OS depends on a lower, command-line based system? Not necessarilly. What "system" do Macintosh OSes (besides OSX) run on? What does NT run on? Itself. I can tell you that's a fact (at least for NT) because for one, there's no command line interpreter (cmd.exe, command.com, etc) even running on NT until the user launches it (via the graphical shell) or the registry is configured to boot with it.

585121040[/snapback]

Yeah, command-line system is a very bad way to describe it and isn't nearly accurate. Hell, even Linux doesn't really have a command based system that it starts up on. The command line you get is something initiated by the run-time level. Command lines are what the user puts input into the system through. What's really meant is a text mode based system, although even that doesn't really do it justice.

Link to comment
Share on other sites

  • 0
no really that helps , i wonder how this 3 intelligent dos files recognize all of that which are you talking about on different pcs with different bios and different devices ....... ohhhh amazing ........ i think IO.sys has the responsibility for this task.

585121002[/snapback]

Well, they don't really deal with the devices directly, those 3 files. What happens is the bootloader has the operating system self-load itself into memory and from there it does what it can. To deal with the devices, device drivers have to be loaded. What's built into those files are generic drivers that will work with any x86 compliant system, and only the minimal things it needs to run at that.

Link to comment
Share on other sites

  • 0

i've programmed my own little OS which only does a few commands and runs off a floppy disk.. Wasn't really all that hard to program..

I done all my programming in asm.. Started off by programming my bootstrap loader, then programmed my own kernel, then i programmed my own shell.. the shell is just a simple command line Interface. such as unix.

Link to comment
Share on other sites

  • 0
i've programmed my own little OS which only does a few commands and runs off a floppy disk.. Wasn't really all that hard to program..

I done all my programming in asm.. Started off by programming my bootstrap loader, then programmed my own kernel, then i programmed my own shell.. the shell is just a simple command line Interface. such as unix.

585121096[/snapback]

that looks great , can you send me a link to your executed files of your OS ( if you don't mind )

Link to comment
Share on other sites

  • 0
XP Setup doesn't have to be performed from DOS. You can boot from either the XP CD or the appropriate floppy disks and start the setup routine.

Those three files you listed are essentially DOS itself. Notice that XP (or any version of NT for that matter) do not install or require any of these three files, nor will it use them if they exist. XP will, however, execute autoexec.bat IF it exists, but it is not required to perform startup configurations.

585121028[/snapback]

i think i have found an EQUIVALENT to this 3 files which windows in a bad need to them cause i always face some troubles with them when i got a virus and correct me if i am wrong , what about HIMEM.SYS, Hiberfil.sys, NTldr and finally you need to tell me what about ((((((((((((( CONFIG.DOS, BOOTSECT.DOS ))))))))) now i guess some body will say to me THAT IS THE EMULATED DOS , in my opinion it is exactly dos files but in other name :)

Link to comment
Share on other sites

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

    • No registered users viewing this page.