Thread: How do they compile code for an OS ?

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

    How do they compile code for an OS ?

    Hi,

    HOw do you write an OS using C? OR actually how do u write os for practically ANY language? I am not asking for the details. But i was just wondering what compilers people use to compile code for an os. I thought compilers were platform-dependent, and if you're writing an OS you're creating a new platform...

    thnx

  2. #2
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    Well, don't tell anyone, but from one os-dev'r to another:

    First, print out yor code. Doesn't matter if it's 500 pages long, print it all. Then seperate each module into its own stack, and you can optionally surround it with a securing device (rubber band). Then pick up the magical shaft of OS-Dev, and dance around the fire singing ceremonial os-dev chants to the os-dev gods. If they smile upon you, great flames should shoot up from your files, and the ashes shall form your kernel. Recompiling is a .........., though...


    Or you could go to osdev.org, but that's for sissy newbies. Now excuse me while I compile the keyboard interface ::dons ceremonial mask::

    Oh, and go to Flashdaddee's OS-dev forums is you run into any problems. We'll help you out there.

  3. #3
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    Originally posted by -KEN-
    Well, don't tell anyone, but from one os-dev'r to another:

    First, print out yor code. Doesn't matter if it's 500 pages long, print it all. Then seperate each module into its own stack, and you can optionally surround it with a securing device (rubber band). Then pick up the magical shaft of OS-Dev, and dance around the fire singing ceremonial os-dev chants to the os-dev gods. If they smile upon you, great flames should shoot up from your files, and the ashes shall form your kernel. Recompiling is a .........., though...


    Or you could go to osdev.org, but that's for sissy newbies. Now excuse me while I compile the keyboard interface ::dons ceremonial mask::

    Oh, and go to Flashdaddee's OS-dev forums is you run into any problems. We'll help you out there.

    LMAO if this is not true.........it's funny, if not it's kinda scary.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  4. #4
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    >i was just wondering what compilers people use to compile code
    >for an os

    A good one I've used is the enviroment of Keil. Used that for writing an MicrOS for M68000 and for 8051 programming.

    For PC's I think GCC will be a good one. Though note that an OS can't be completely written in C. You'll need some assembly too. I think that NASM is a good one.

  5. #5
    Unregistered
    Guest
    Linus Torvalds used the gcc to compile his OS (Linux).
    Of course assembly is nescessary, but the gcc also compiles assembly-code. That means that you donīt need any "NASM".

    klausi

  6. #6
    Registered User
    Join Date
    Oct 2001
    Posts
    197

    Thumbs up Itīs me!

    I forgot to log in.
    When I close my eyes nobody can see me...

  7. #7
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    Re: Itīs me!

    Originally posted by klausi
    I forgot to log in.

    LMAO I thought that was just funny, specially the thumbs up thing...........hey did you know that back in Roman Time the thumbs up actually meant to kill the opponent after the match was over? Yup, now you know.......well something like that, I read that online and saw it on the History Channel.....but then again you probably dont' care.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  8. #8
    Registered User
    Join Date
    Oct 2001
    Posts
    197

    Thumbs up

    Thatīs what I think about you!



    ...was only a joke;
    nice to know...

    klausi
    When I close my eyes nobody can see me...

  9. #9
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    >>Linus Torvalds used the gcc to compile his OS (Linux).

    I thought GCC originated on Linux? Or did he write GCC to compile his os?


    And hey! The OS-dev gods want more mention from you pleebs! Now bow!



  10. #10
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    >Recompiling is a *****, though...<

    LMFAO...

  11. #11
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    Well, don't tell anyone, but from one os-dev'r to another:

    First, print out yor code. Doesn't matter if it's 500 pages long, print it all. Then seperate each module into its own stack, and you can optionally surround it with a securing device (rubber band). Then pick up the magical shaft of OS-Dev, and dance around the fire singing ceremonial os-dev chants to the os-dev gods. If they smile upon you, great flames should shoot up from your files, and the ashes shall form your kernel. Recompiling is a *****, though...


    Or you could go to osdev.org, but that's for sissy newbies. Now excuse me while I compile the keyboard interface ::dons ceremonial mask::
    So the stories about Microsoft are true!
    My Website

    "Circular logic is good because it is."

  12. #12
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    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.

  13. #13
    Registered User blight2c's Avatar
    Join Date
    Mar 2002
    Posts
    266
    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.
    lol . . . the reason for your unreasonable treatment of my reason so infuriates my reason that i have reason to doubt your reason

    i think cervantes wrote that one

  14. #14
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    >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.<

    Uh, no?

  15. #15
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    [nitpick]
    >the thumbs up actually meant to kill the opponent after the match was over
    Actually, there were two ways and I believe the Romans used the second. The first was thumbs up and down where down mean kill and up meant mercy. The second was a simple palm up and palm down where down meant kill and up meant mercy. I could very well be wrong about the method, but I do know that down means to kill the opponent.
    [/nitpick]

    -Prelude
    My best code is written with the delete key.

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