1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How are operating systems and such made?

Discussion in 'Nerd Out Zone' started by joppiesaus, Feb 21, 2015.

  1. joppiesaus

    joppiesaus Infamous Space-Octopus

    • Member
    Let's go back to the beginning of computers.
    A chip with a few thousand transistors is made.
    An operating system was made

    You have modern languages, like C++
    The C++ compiler converts the code into Assembly code / CPU instructions.
    An CPU instruction is: If you say do 13 with value 345 to the computer, the CPU will do that and give you the result back.
    You can write programs using these instructions. I made one a while ago.
    This is a DOS program that takes a characters value, and another, and ads them togheter to make a brand new character and displays it.
    x86 Assembly:
    .model small
        char db 0       ; byte char = 0
    main proc           ; void main {
        mov ah, 1h      ; read char      (char saved in reg al)
        int 21h         ; Dos interrupt  (do upper instruction)
        mov char, al    ; char = al
        mov ah, 1h      ; read char again
        int 21h
                        ; al = increment, char = character
        add al, char    ; Add char to increment(reg al)
                        ; a + b = b + a
        mov dl, al      ; Copy char to dl
        mov ah, 2h      ; write char     (looks into dl for char)
        int 21h         ; display char   (do upper instruction)
    endp                ; }
    end main
    Which will lead into instructions, this is mov ah, 1h in binary(roughly):
    This is the whole program viewed by notepad, these are not 1's and 0's, notepad understands it as characters. But these are all instructions that the CPU executes in this program.
    MZ%       ÿÿ    ò                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ´Í!¢  ´Í!  ŠÐ´Í!
    ... Which you can make into 1's and 0's too.

    But you need something to set those bits. I mean in order to make program a computer, you need a computer.
    You can upload it to a chip, sure, but you need something digital in order to do that.
    I just can't understand it. How did they go from nothing to an OS which you can develop programs in again?
    There has to be a start.

    Here's the question: How did this start?

    Then again: That program doesn't even use the RAM. Imagine all the code needed to make an OS like Windows... it's all too much for my head!

    EDIT: Wow. The source code of the first MS-DOS was ~301 kibibytes. Yes, two years of work for 301 kibibytes of one year of work!
    I wish I could learn Assembly and make cool stuff on modern computers!
    Last edited: Feb 21, 2015
    joppiesaus, Feb 21, 2015
    Last edited by joppiesaus; at Feb 21, 2015
  2. Arctic

    Arctic Giant Robot Advocate

    • Tester
    I would imagine that someone had to write the first interpreter in binary. Bootstrapping, if you will.
    It's all downhill from there,
  3. joppiesaus

    joppiesaus Infamous Space-Octopus

    • Member
    But how did they program binary if there was no computer to program in?
  4. Arctic

    Arctic Giant Robot Advocate

    • Tester
    I don't bloody know. A mechanical device?
  5. tetryds

    tetryds cus tet, that's it

    • Member
  6. Danarkivus-2

    Danarkivus-2 Back Into Space

    • Member
    those thing how primitive those thing where.

Share This Page