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

  • 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

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

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

  • 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

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

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

  • 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 :)

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

  • 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

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

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

  • 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 :)

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

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

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

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

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

  • 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 :)

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

    • No registered users viewing this page.
  • Posts

    • Samsung Galaxy Z Fold 8, Flip 8, Z Fold Wide: Everything you need to know The ONLY thing I need to know is the price, which I know will be way higher than I (and most people) are willing to pay for a phone... so basically nothing here I need to know. PS: Nice job getting that Apple reference to a non-existent and unrevealed product as "competition" in there. Cheque is in the mail.
    • Well I really think the repasting helped if your higher clocks have returned, maybe the next thing to look at is if there is a problem with your case airflow? I guess this because your 3080 has returned to optimal state, but is still staying too warm, which might suggest it was thermal throttling before you repasted, of which the only logical conclusion could be outside factors.
    • Samsung Galaxy Z Fold 8, Flip 8, Z Fold Wide: Everything you need to know by Hamid Ganji Galaxy Z Fold 7 - Image via Samsung The next generation of Samsung foldables is set to be unveiled next month at the second Unpacked event of the year. Samsung’s 2026 foldables are not expected to offer significant upgrades over their predecessors, with the Korean firm instead focusing on design refinements and conventional upgrades such as faster processors and better cameras. However, Samsung is reportedly planning to unveil an all-new passport-style foldable this year to rival Apple’s first foldable iPhone, which is expected to debut this September. Here’s a roundup of everything we know about Samsung’s upcoming foldable devices ahead of their official debut. When can we expect Samsung’s new foldables? The Galaxy Z Fold 7 and Z Flip 7 series were unveiled in July, and Samsung is expected to maintain this timeframe in 2026. Based on previous reports from Korean sources, Samsung will hold its Unpacked event on July 22 in London, UK, to pull back the curtain on the Galaxy Z Fold 8 series. The devices are also expected to hit the shelves a few weeks after launch. However, Samsung has yet to announce an official date. A new naming scheme? One of the most interesting changes we might see this year is a new naming scheme for Samsung’s latest foldables. SamMobile reported that since Samsung is expected to unveil three foldables this year, it has adopted a new naming strategy to simplify product identification for customers. Accordingly, the standard Galaxy Z Fold 8 will reportedly be called the Galaxy Z Fold 8 Ultra and will serve as the direct successor to last year’s Galaxy Z Fold 7. The “Ultra” suffix suggests the phone could feature higher-end specifications, such as additional rear camera modules. Samsung’s new passport-style foldable is expected to carry the Galaxy Z Fold 8 name without any suffix. This model is reportedly equipped with two rear cameras. No major changes are expected for the Flip model. Galaxy Z Fold 8 Ultra and Z Flip 8 anticipated specs Rumors over the past few months suggest Samsung is preparing several upgrades for its upcoming foldables, although the devices may continue to rely on larger batteries and faster charging speeds rather than dramatic design changes. The primary focus this year is expected to be the Galaxy Z Fold 8 and its wide-screen design. Galaxy Z Fold 8 Ultra official CAD renders - Image via AndroidHeadlines Here are the anticipated specifications for the Galaxy Z Fold 8 Ultra based on previous leaks: 6.5-inch outer display and 8-inch inner display, 120Hz refresh rate, and 2,600 nits peak brightness Snapdragon 8 Elite Gen 5 processor, paired with 12GB or 16GB of RAM and 256GB, 512GB, or 1TB of storage 4.1mm thickness when unfolded and a weight of 210g 200MP main camera, 50MP ultrawide camera, 10MP or 12MP telephoto camera, 10MP cover camera, and 10MP selfie camera 5,000mAh battery with 45W wired charging Android 17 and One UI 9 As for the Galaxy Z Flip 8, the device is not expected to be a major departure from its predecessor, although it could become slightly slimmer. Expected specifications include: Snapdragon 8 Elite Gen 5 or Exynos 2600 processor 12GB of RAM with 256GB and 512GB storage options 6.9-inch Dynamic AMOLED 2X inner dispaly and 4.1-inch Super AMOLED outer dispaly 50MP main camera, 12MP ultrawide camera, and 10MP selfie camera 4,300mAh battery with 25W wired charging Android 17 and One UI 9 Samsung’s foldables are also expected to launch with Gemini Intelligence, Google’s AI suite for automating tasks in Android ecosystem. Moreover, given current memory and component costs, some Galaxy Z Fold 8 Ultra and Z Flip 8 variants could see a price hike. Galaxy Z Fold 8 adopts a wide-screen design The centerpiece of the upcoming Unpacked event could be the Galaxy Z Fold 8, previously rumored as the Galaxy Z Fold Wide. This model adopts a passport-style form factor and is expected to compete directly with Apple’s iPhone Fold. Galaxy Z Fold 8 official CAD renders - Image via AndroidHeadlines Here’s what to expect: 7.6-inch primary OLED display and 5.4-inch cover display, 120Hz refresh rate, 2,600 nits peak brightness, and 4:3 aspect ratio Snapdragon 8 Elite Gen 5 processor, 12GB or 16GB of RAM, and 256GB, 512GB, or 1TB storage options 4,800mAh battery with 45W wired charging 50MP main camera, 50MP ultrawide camera, and 10MP selfie camera Android 17 and One UI 9 The three new foldable phones are unlikely to be the only devices unveiled at Samsung’s Unpacked event. The company is also expected to introduce the Galaxy Watch Ultra 2 and the Galaxy Watch 9 series.
    • Thanks
  • Recent Achievements

    • Week One Done
      rolfus earned a badge
      Week One Done
    • One Month Later
      Leroy Jethro Gibbs earned a badge
      One Month Later
    • Conversation Starter
      flexorcist earned a badge
      Conversation Starter
    • One Month Later
      AndreaB earned a badge
      One Month Later
    • One Month Later
      agatameier earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      504
    2. 2
      +Edouard
      196
    3. 3
      PsYcHoKiLLa
      140
    4. 4
      ATLien_0
      88
    5. 5
      Steven P.
      81
  • Tell a friend

    Love Neowin? Tell a friend!