Thread: Create an operating system

  1. #16
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    I know it's very complex, and I know it's flexibility makes it more complex. I was mearly suggesting an alternative route to creating his OS

    You could at least take some chunks... Look at the source for ReactOS, Minix, Linux and a few others -- I'm sure it'd help.

  2. #17
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Since this is your first attempt at an OS, getting past the boot loader and to something which prints "hello world" and then halts would be a pretty reasonable achievement.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #18
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Bootloaders arent that difficult to write, you just need to know which BIOS calls to make. You could even put the 'hello world' message in the bootloader. 512 bytes is huge when writing assembly. Like I said, get yoru boot loader runnign in real mode first, then you can have it load the code that switches you to protected mode later. 16 bit code is so much easier to write, not to mention the BIOS calls are pretty much static at this point.

  4. #19
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    If you can get the boot loader to work AND load your kernel AND then get a C program to run on your OS you will have gotten farther than a bunch of old Flashdaddeeans.

    I got as far as the bootstrap but did not get to loading my kernel. BTW if on the rare chance you do get FAT32 working on your OS if MS finds out about it they will ask for royalties. Not likely they will find out but it's a fair warning.

    The main goal for the OS bootup process is to bootstrap (starts at 0000:7C00) and load the kernel into memory and possibly perform a jump to more startup code.

    Once you get the assembler code done you will want to move to C/C++ ASAP. The faster you get C code running on your own OS the faster your development time will be.

    The one thing that absolutely MUST be coded in pure assembler is the 512 byte bootstrap code. This cannot be done in C. Since this is your first attempt at an OS I recommend a real mode operating system. Startup is easier and you can do interrupts easily. With protected mode you must at least setup the GDT and the IVT and perhaps the LDT. The easiest way in protected mode is to setup a simple 2 descriptor system. Each descriptor would cover 50% of the total system RAM. You would then allocate memory out of this RAM and so forth. One portion is for user code and one portion is for OS code. The Intel tech refs explain this system in great detail.
    Last edited by VirtualAce; 10-17-2007 at 12:01 AM.

  5. #20
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Quote Originally Posted by Bubba View Post
    BTW if on the rare chance you do get FAT32 working on your OS if MS finds out about it they will ask for royalties.
    how would linux deal with that then?

  6. #21
    Registered User
    Join Date
    Jun 2007
    Posts
    25
    Thanks everyone.

    I guess it's off to learn assembly then.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. using an operating system command in c
    By clearrtc in forum C Programming
    Replies: 2
    Last Post: 05-21-2006, 04:26 PM
  2. Floppy Operating System
    By eam in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 10-09-2004, 07:40 AM
  3. Operating system
    By sopranosomega in forum C Programming
    Replies: 6
    Last Post: 10-07-2002, 06:12 AM
  4. idea: operating system
    By roberth9000 in forum Contests Board
    Replies: 6
    Last Post: 09-16-2002, 06:08 AM
  5. What operating system are YOU useing?
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 36
    Last Post: 09-14-2002, 10:02 AM