Creating an operating system from scratch

Discussion in 'Operating Systems' started by chibicitiberiu, May 23, 2009.

  1. chibicitiberiu

    chibicitiberiu New Member

    Messages:
    1,265
    Hello,

    For a long time I wanted to create an operating system, but I didn't knew too much programming, but now I learned a lot.
    I want to create an operating system from scratch. What do I need to know before starting?

    I understand that a project of this size will be enormous work, a lot of headaches, and so on. Is enough knowledge of programming in C++, or do I need to learn Assembly language? The platform will be a standard Intel x86 PC.
    And about Assembly language, what can it do, and how can I learn it?

    I don't really have experience with such big projects, and I didn't have the opportunity to talk to an expert about this.
     
  2. sshaggy

    sshaggy New Member

    Messages:
    722
    Found this on google. Might help..
     
  3. adarsh

    adarsh New Member

    Messages:
    907
  4. chibicitiberiu

    chibicitiberiu New Member

    Messages:
    1,265
  5. wardhanster

    wardhanster New Member

    Messages:
    214
  6. fmw

    fmw New Member

    Messages:
    474
    C will do anything an assembler will do. Given the fact that you ask these questions, I would suggest you aren't quite ready for prime time. Writing an operating system is about as complex as programming gets. Why not spend your time working on some useful applications.
     
  7. chibicitiberiu

    chibicitiberiu New Member

    Messages:
    1,265
    I know!! Don't be one of these guys who instead of answering the questions I pose, tries to discourage me. How will I gain experience if not trying? I want to try this, I want to learn.
    I won't quit this project, at least not yet. But I have many things to learn first. Today I just learned a bit of Assembly and how easy is to make a bootable floppy.

    Now I have a question. When the compiler compiles the code, does it turn into Assembly code (that .obj file) which is then linked and you get the executable? Or the linker does that? Or it never happens?

    Because I want to turn some C++ projects which are much easier for me to make into Assembly. I found out that it is possible with the DEBUG command which exists in both DOS and Windows cmd to display this Assembly code.
     
  8. sshaggy

    sshaggy New Member

    Messages:
    722
    Why not try to modify a linux distro according to ur own ideas. This will give some experience beforehand. Lots of resources are just a google away.
    Otherwise i found another great site, http://www.linuxfromscratch.org/
     
  9. fmw

    fmw New Member

    Messages:
    474
    C produces machine code, just like an assembler or any compiler for that matter. Assemblers are low level programming tools. As an example, if you want to set up a stack for the results of some computations, an assembler allows you to define exactly where in memory the stack will go. Most high level compilers would allocate the memory for you. Someone writing an accounting system in a high level language wouldn't care where the stacks are located or even that there are stacks at all. Someone writing an O/S would. C, unlike higher level compilers can provide the same kind of low level instruction work that an assembler can handle. It is certainly possible to write an O/S in C.

    I wasn't trying to discourage you. I was trying to advise you. Work on some applications until you become conversant with C programming. The O/S work can wait until you know what you're doing.
     
  10. chibicitiberiu

    chibicitiberiu New Member

    Messages:
    1,265
    Okay, thanks for help. But how do you explain that the DEBUG command in dos is able to display in assembly the data on a floppy for example in the boot sector to make it execute a program? Is it possible to put a C program in that boot sector to boot?
     
  11. movzx

    movzx New Member

    Messages:
    8
    You won't be able to write the initialization steps of a bootloader in C. You can either write a two stage loader or write the whole thing in assembly and call your kernel (in C) once you have the machine ready to transfer execution. Or, you can take the even easier route and use GRUB.

    Straight x86 assembly is very, very messy in my opinion. I suggest reading up on the Intel docs if you want to know the in's and out's of the architecture, because I can already tell you that there is just some stuff that will always have to be done in assembly when it comes down to the nitty-gritty machine-level operations of an OS kernel.

    http://www.intel.com/products/processor/manuals/
     

Share This Page