How Do You Write Operating Systems?

By daniel161 ยท 15 replies
Feb 22, 2007
Post New Reply
  1. Ok, how did Bill Gates and all the others create Operating Systems? Lets say I have a blank floppy and HD. How would you start? It just cant seem possible!

    --Daniel L
  2. cfitzarl

    cfitzarl TechSpot Chancellor Posts: 1,975   +9

    It takes yeers of programming, coding, and securing. I'm not sure the details, I am sure of that.
  3. dmill89

    dmill89 TS Guru Posts: 475

    It depends on the complexity of the operateing system. A good programer could write a simple command line OS with no included utilities and no security in a matter of hours. A modern OS with lots of included utilities, a complex GUI, and high levals of security Like Vista or OSX can take years to develop and a team thousands of employees.
  4. cfitzarl

    cfitzarl TechSpot Chancellor Posts: 1,975   +9

    Although sometimes I think that if we put a room full of monkeys in front of dos, we could come up with an operating system better that what a lot of people have *cough*Windows*cough* :haha:...I'm just kidding...
  5. daniel161

    daniel161 TS Rookie Topic Starter Posts: 80

    My question refers to their not being an OS. If their is no program to write your os, how do you do it?

    --Daniel L
  6. cfitzarl

    cfitzarl TechSpot Chancellor Posts: 1,975   +9

    Good brain hurts now :haha:...
  7. howard_hopkinso

    howard_hopkinso TS Rookie Posts: 24,177   +19

    You might find some of the links HERE of interest.

    Regards Howard :)
  8. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    Bill Gates stole his OS from other people..

    As for how to get a computer going..

    First thing you do is write a trivial assembler for that machine (on another machine). This way you can write pure machine code programs for your target. Hopefully, whoever built the machine/CPU, provides some instruction set reference :)

    Using the assembler, you write a compiler for your target (on another, working machine). Once you have a target compiler, you can write any software you like (on another machine). At first, you would transport your programs to your target using raw disk images. As your codebease increases, you can use files or networking later on.

    That's how it is done in modern times.

    Back in the day, the target machine would have a some sort of an input system, either for pure machine code or some crude programming language like BASIC. You would use these machine inputs or the built-in PL to input your own programs (or an OS even) by hand.
  9. cfitzarl

    cfitzarl TechSpot Chancellor Posts: 1,975   +9

    I heard someone say that before. If he did actually steal it, and there was proof, wouldn't he have been sued for doing it :confused: ? Without proof, no one can make a correct assumption...well...most of the time. I knew Bill Gates was a money-hungry, corporate, greedy, arrogant person :haha:...just kidding *uncrosses fingers* ;).
  10. halo71

    halo71 TS Rookie Posts: 1,090

    Its the chicken before the egg question. I think he is asking what or how was a program written to even start to write an OS. How did someone know how to write a program to write an OS. What started it all.....I think thats what he is askinga anyways.
  11. daniel161

    daniel161 TS Rookie Topic Starter Posts: 80

    Yep ^^^ Thats my question!

    --Daniel L
  12. Boogityboo04

    Boogityboo04 TS Rookie Posts: 302

    I think to start off with no other machines in existence to create a assembler you would essentially use a board of switches to input binary or machine code or whatever.

    As far as I can remember thats how my dad did it when he built a computer completely from scratch in college. It had about the functionality of todays pocket calculators, but back then it was quite a job.
  13. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    Something that is legally correct, does not have to be right by common sense. And vice versa of course.
  14. beef_jerky4104

    beef_jerky4104 Banned Posts: 822

    Actually he didn't steal it. At the time most of the code and stuff was open source, which means it is free to everyone to use (Unix, the OS of the internet). Then he went "Hey I bet I jack this and make money!". So technically speaking he didn't steal, however it wasn't fair since he gets credit while it was some one elses work which he exploited.
  15. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    Erm.. QDOS was not open source.. Why would Microsoft pay money for it if it was?
    Please read up on history.
  16. DataMatrix47

    DataMatrix47 TS Rookie

    It's actualy pritty darn complex. The very first thing you could do is get a blank 1.44 Floppy disc, a ASCII hex table and Windowses DEBUG

    1. insert floppy in to the FDD

    2. start the commnand prompt

    3. run debug (just type 'debug') (example: c:\>debug)
    you'll see:

    4. now typein 'l 0 0 0 1' (no quotas)
    then type 'a 3e'
    the 3E address is the beggining of the FD boot system.
    now you should see:

    5. start writing assembly (some people call it incorrectly ASSEMBLER) code
    my exsample code:
    MOV     AX,0E44
    INT     10
    MOV     AX,0E61
    INT     10
    MOV     AX,0E74
    INT     10
    MOV     AX,0E61
    INT     10
    MOV     AX,0E4D
    INT     10
    MOV     AX,0E61
    INT     10
    MOV     AX,0E74
    INT     10
    MOV     AX,0E72
    INT     10
    MOV     AX,0E69
    INT     10
    MOV     AX,0E78
    INT     10
    MOV     AX,0E34
    INT     10
    MOV     AX,0E37
    INT     10
    MOV     AX,0E0D
    INT     10
    MOV     AX,0E0A
    INT     10
    JMP 003E
    >>>you can skip the next few lines
    can you see the diference between
    MOV AX,0E34
    MOV AX,0E37
    yes, it's 34 and 37. these are Heximal values. 34h='4' (character); 37h='7'; 44h='D'; 61h='a' etc.
    this writes a new line:
    MOV     AX,0E0D
    INT     10
    MOV     AX,0E0A
    INT     10
    int 10 is a BIOS video interrupt.
    JMP 003E JuMPs to the offset address 3E, from were the program begins.
    >>>back on track.>>>
    after you press enter at the last row press it again. here you are gagin at the '-' state.

    6. write 'w 0 0 0 1'. that will save your code to the floppy disk.
    6.2. write 'q' to stop the program DEBUG

    7.reboot your computer and boot from the floppy. on some systems like mine you press F8 at the mem check screen to open boot device menu. On other systems you got to press DEL to enter BIOS and change your boot device settings

    8. after the floppy boots you shold see a message.
    my example displays 'DataMatrix47' numerous times, every time on new line.

    Press ctrl+alt+del to restart the computer.

    SUMMARY: To make your own OS, furs you got to learn assembler, then, when you develop your bootloader, start writing the KERNEL (the core of every os) C is a recommended language, but you wount be able to use predefine functions, like PRINTF, SCANF, etc.
    This was just an example, not even remotly close to an operating system. THE OS HAS TO TAKE CARE of 1000 of 1000 of things.

    PS: if someone is interested, i can give a code file and a BAT script to write the code to a disk to see the result, without wasting 0.5-1 hours.
    1 person likes this.

Similar Topics

Add your comment to this article

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...