• 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

    • Still using Microsoft Money 2005 in 2026 here!
    • I have a couple to mention, and they still run great on Windows 11 Adobe Lightroom Version 2 Alcohol 120% CLZ Book, Comic, Game, Movie, & Music Collector (PC - No longer sold / Grandfathered in - now mobile apps/online only) DVDDecrypter ISO Buster Pro version 1.9.1 (Still supports HD-DVD too) Nero Burning Rom 8 (Only the burning software, no backup, media converter, etc)   OpenAL (Runtime) - GuildWars 1 Reforged still uses it for 3d headphone audio PowerDVD 12 Ultra SPTD (SCSI Pass through Direct Driver) UltraISO Windows Media Encoder 9 WinImage You can tell I still sport an optical drive    
    • Linux 7.1 arrives with an NTFS overhaul and major hardware performance boosts by Paul Hill The founder of the Linux kernel has just announced the availability of Linux 7.1. This is a stable version of the kernel that will now be tested by various Linux distributions before it is shipped to users through update managers. Some users, like those on Debian, for example, might not get it for a long time, if at all, while Fedora users can expect it in the near future. With Linux 7.1 out on time, the merge window for Linux 7.2 is now open, giving contributors the opportunity to send in major new features that have been waiting for the last two months. Torvalds warned that he is currently travelling and will be in another timezone, so timing for the merge window may be irregular due to timezone differences and limited internet access. Torvalds said that he has already fetched early pull requests to allow him to do some offline work, but the travel could still cause disruption. Right now, he is not planning to extend the release, but did consider it. He said he might later regret not extending, though. In terms of this last week of development for Linux 7.1, Torvalds said there were no major or alarming changes. This week consisted mostly of smaller driver updates to GPU, networking, and sound, networking fixes, trace tooling fixes, and misc minor fixes. The shortlog this week lists fixes for driver bugs, memory leaks, I/O and USB fixes, networking and RDMA fixes, DRM/graphics fixes, and tooling and verification improvements. Specific fixes include USB series heap-overflow and buffer overflow fixes, and multiple use-after-free, memory-leak, and refcount corrections across subsystems such as i2c, zram, gpio, and net. There are fixes for graphics drivers, including amdgpu, i915, and virtio, as well as hypervisor and virtualization tweaks affecting mshv, vmbus, and hyperv. According to Phoronix, anyone running Linux 7.1 should look out for the new NTFS driver, Intel FRED for improved performance on Panther Lake and future CPUs, faster graphics with Intel Arc Battlemage, and improvements for older AMD Radeon GPUs. If you are running Linux on your computer and everything is fine, then you don’t need to worry about updating to Linux 7.1 as a priority; just wait for it to be pushed to you. If you have tried Linux on hardware but it didn’t work properly, trying again with a distro that uses Linux 7.1 could cause Linux to work on your machine, thanks to the new hardware support.
    • you can also do this with this tool: PowerSettingsExplorer made by mbk1969 at 3dguru forum.. I found it by accident researching on modern standby and annoying quirks of it in 2022
    • AB Download Manager 1.9.1 by Razvan Serea AB Download Manager is an open-source, feature-rich download manager designed to accelerate downloads, organize files efficiently, and provide seamless control over downloads. With support for multiple connections, resume capability, and an intuitive interface, it enhances the downloading experience for users seeking speed and reliability. The software integrates with various browsers, enabling quick link grabbing and batch downloading. It supports HTTP, HTTPS, and FTP protocols, ensuring broad compatibility with different file sources. Users can schedule downloads, set speed limits, and categorize files automatically for better organization. AB Download Manager is lightweight yet powerful, making it a great alternative to proprietary download managers. Its open-source nature allows developers to contribute, customize, and improve the software as needed. Whether you're downloading large files, managing multiple downloads at once, or seeking an ad-free experience, this tool offers a practical and efficient solution. Key features of AB Download Manager: Multi-Connection Support – Accelerates downloads by splitting files into multiple segments. Resume Capability – Allows paused or interrupted downloads to be resumed without starting over. Batch Downloading – Supports downloading multiple files at once for improved efficiency. Browser Integration – Captures download links directly from browsers for seamless operation. HTTP, HTTPS, and FTP Support – Ensures compatibility with a wide range of file sources. Download Scheduling – Enables users to automate downloads at specific times. Speed Limiting – Lets users control bandwidth usage for optimized performance. File Categorization – Automatically organizes downloaded files into designated folders. User-Friendly Interface – Simple and intuitive design for easy navigation. Cross-Platform Compatibility – Works on multiple operating systems. Ad-Free Experience – No intrusive ads or tracking for a clean user experience. AB Download Manager 1.9.1 changelog: Added An option to customize notification sounds (#1259) Fixed Ongoing notification was laggy on Samsung One UI devices (#1269) Improved Updated Translations Minor UI/UX improvements Download: AB Download Manager 1.9.1 | Portable | ~80.0 MB (Open Source) Download: ARM64 | Portable ARM64 | Android Links: AB Download Manager Website | Github Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • 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
      507
    2. 2
      +Edouard
      196
    3. 3
      PsYcHoKiLLa
      139
    4. 4
      ATLien_0
      90
    5. 5
      Steven P.
      81
  • Tell a friend

    Love Neowin? Tell a friend!