Thread: How do they compile code for an OS ?

  1. #16
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    Originally posted by Imperito
    An OS can only be compiled by a compiler written on that OS. Conversely, a compiler can only be written on an OS compiled by that compiler.
    It does'nt make sense, if it's like what u said, how is the os compiled in the first place?

  2. #17
    Registered User
    Join Date
    Jan 2002
    Posts
    363
    >>It does'nt make sense, if it's like what u said, how is the os compiled in the first place?

    simple:
    First, print out yor code. Doesn't matter if it's 500 pages . . . . .

  3. #18
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Its the chicken and the egg all over again.

    Which came first, the OS or the PC?
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #19
    Registered User
    Join Date
    Jan 2002
    Posts
    363
    Egg.
    Its basic evolution.
    Birds decended from reptiles.
    Reptiles laied eggs.
    Therefore egg before chicken.

  5. #20
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    How about monotremes(?)?
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  6. #21
    Registered User
    Join Date
    Jan 2002
    Posts
    363
    Well working with the assumption that all tetrapods came from Devonian lobe-finned fish and the lack of any contradicting theories or evidence (except creationism), I think egg wins again.

  7. #22
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    What about the easter egg and the Easter bunny?
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  8. #23
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    How do u compile once you printed out?

    Seriously, pls help, i really want to know the theory.

    thnx

  9. #24
    Registered User
    Join Date
    Jan 2002
    Posts
    363
    Well the egg is a symbol of rebirth at easter so has its origins way back with jesus. The easter bunny is some marketing gimic that i doubt goes back much further than the 50's. Egg wins again.

    And i do remember someone on this board saying that microsoft have thier own special compiler for windows. (that information is atleast second or third hand by now so don't flame me when you come up with conclusive evidance proving otherwise)

  10. #25
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    I am talking about as in general. Say if i wrote an OS using C and assembly. Now, what do i do to compile it and actually use it? I believe thats a straight question when it's asked in general terms.

  11. #26
    Registered User
    Join Date
    Jan 2002
    Posts
    363
    http://www.osdev.org/developers/guide01/index.html

    There's a guide to mixing C and Assembly to compile an operating system. They suggest using gcc.
    It mainly just includes compiling them both into object code and linking them as a final step.
    In theory, just about any c++ compiler could be used, provided you specify for it not to play with your code.

  12. #27
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    Hi thnx,

    SO basically i'll write the code in any os and then compiling it using maybe gcc. What will be the output? Will it have any special file extensions? DO i thne copy the whole thing on disk or burn on cd so it'll load up when i reboot the comp or somethin?

    thnx

  13. #28
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    > The first was thumbs up and down where down mean kill and up meant mercy.

    I don't know about your second method, but I believe the reason thumbs down meant to kill was that thrusting the thumb in a downward motion was an imitation of thrusting the sword into the prone foe. Or so I've heard.

  14. #29
    Registered User
    Join Date
    Mar 2002
    Posts
    30

    First OS/compiler

    Originally posted by Nutshell


    It does'nt make sense, if it's like what u said, how is the os compiled in the first place?
    Well, I think they were handcoding. You know, hex things and DEBUG (not MS's, an handcoded DEBUG) which they used for the first HexEditor, which produced the first Interpreter which saved on tape the first 10 commands... But hey, this is ancient history (don't remember if greek of roman). Compiling is a very modern thing, you know, must be mid 80's, or closer.

    BTW, they should us computer history! Which one computed the length of a circle?

    There was a first programmer which came with the ideea (was not even the programmer-he invented the job), and did a lot of work, like God, did it from nothing!

    I might be wrong about hex. First computer was an 8 bit data bus?

    OS vs compiler. Tonight, on...
    Now I C.

  15. #30
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    >What will be the output?<

    A file. The format is what you decide on, though the most common are flat binary, COFF and ELF.

    >Will it have any special file extensions?<

    The file can be of any extension, as in all reality file extensions don't mean anything.

    >DO i thne copy the whole thing on disk or burn on cd so it'll load up when i reboot the comp or somethin?<

    Depends how your bootloader is set up. If it can read from a FAT disk, you could just copy it over. This all really depends on your bootloader though.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code won't compile
    By monkles in forum C Programming
    Replies: 3
    Last Post: 05-28-2009, 01:45 PM
  2. Compile Errors in my Code. Can anyone help?
    By DGLaurynP in forum C Programming
    Replies: 1
    Last Post: 10-06-2008, 09:36 AM
  3. Cross (compiler | OS) && reuseable code
    By audinue in forum C Programming
    Replies: 6
    Last Post: 07-22-2008, 12:46 PM
  4. How Can I compile 3 source code in 1 program ?
    By lord_cedrich in forum C Programming
    Replies: 8
    Last Post: 12-10-2006, 05:10 AM
  5. ....this code doesn't compile, very odd error
    By Leeman_s in forum Windows Programming
    Replies: 2
    Last Post: 11-03-2002, 02:31 PM