Writing My Own Operating System
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: Writing My Own Operating System

  1. #1
    Join Date
    Jun 2007
    Location
    MA-USA
    Posts
    247

    Wink Writing My Own Operating System

    Hello Assembly Guru's!

    I am teaching myself assembly and needed a good project to stay motivated while learning to use it.

    So what i have done here is pieced together my own bootstrapper and operating system from different ideas i have seen on the internet.

    This booter loads from a floppy disk (FAT12) and runs in 16 bit real mode.

    I have written some basic input/output handler routines also.

    I would like you to download my code and have a look see.

    Any ideas or comments about what i have so far would be greatly appreciated.

    Theres enough stuff in this attatchment to get it all working on your system.

    If you have any questions, just leave a reply and i will answer them.

    Ok, thanks and happy coding...
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2008
    Posts
    19

    Re: Writing My Own Operating System

    Aww man! that's so awesome! I took an assembly class a few semesters ago, at the university i attend, and ever since I've wanted to write an operating system. I'm not nearly as advanced as you are, so I doubt I'd get anywhere, but it looks really friggin cool :P

  3. #3
    Join Date
    Jun 2007
    Location
    MA-USA
    Posts
    247

    Re: Writing My Own Operating System

    I am just learning assembly myself.

    I cant afford a book or schooling so i researched ASM on the net.

    I tried to keep the code simple so it would be easy to understand.

    The next step is to put the the command handlers into a table.

    This will reduce the amount of code it takes to process an input command.

    This will contain an input command and a function pointer for that command.

    I write graphics code everyday in 'C' so it is my goal to eventually write an OS that will be based on my 3d game engine.

    I am a long way away from that...

    I think if this is done right i will have a very fast OS with tons of polygon pumping power.

    If anyone has any ideas that would help speed up my design i would be very happy to hear them.

    ok, thanks for your time and for your posts.

  4. #4
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Writing My Own Operating System

    Hey, not trying to discourage you, but here you wont find much of a testing crowd, but I think you should go online with this project (like sourceforge.net) and publish it over there and let other people get involved in testing, reviewing etc.
    Regards,
    Ramkrishna Pawar

  5. #5
    Join Date
    Aug 2007
    Posts
    52

    Re: Writing My Own Operating System

    Awesome !
    Last edited by lopez86100; February 10th, 2008 at 04:43 PM.

  6. #6
    Join Date
    Jun 2007
    Location
    MA-USA
    Posts
    247

    Re: Writing My Own Operating System

    Does anyone have a bootstrapper for a usb storage device?
    Or maybe some ideas or info on how i can write one?
    I would like to store my OS on that instead of the floppy i use now.
    As of now i am using an old 286 lappy to code ASM and i would like to do it on my 386 desktop but it has no floppy drive, and i wish not to store it on the hard drive.

  7. #7
    Join Date
    Jun 2008
    Posts
    4

    Re: Writing My Own Operating System

    I took a look at some of the code you have--pretty interesting stuff you got there. I took a class last semester specifically for operating systems. We got as far as being able to load and run processes (.exe files), as well as implementing file-systems (FAT32), dealing with interrupts, and terminal/keyboard/mouse input. Oh yeah, and page tables--that was fun. No sarcasm there at all I might be able to help you out, if you had any questions or anything like that--just out of curiosity, how far were you intending on going with this?

  8. #8
    Join Date
    Oct 2005
    Location
    Minnesota, U.S.A.
    Posts
    680

    Re: Writing My Own Operating System

    I have done it on microcontrollers. USB mass storage is essentially a SCSI interface sent over a USB bus. For examples, take a look at source for almost any USB handling micro. I know that SiLabs (www.silabs.com) has Mass Storage examples written mostly in C for their 34x micros.

    -Erik

  9. #9
    Join Date
    Jun 2007
    Location
    MA-USA
    Posts
    247

    Re: Writing My Own Operating System

    Quote Originally Posted by Liminal
    I might be able to help you out, if you had any questions or anything like that--just out of curiosity, how far were you intending on going with this?
    First i would like to place the menu commands into a table, this would make any changes or additions to the menu a lot easier to do later on.
    As for how far i will take this project, well what im aiming for is a game engine that runs on its own operating system.
    Right now im a Win32-OpenGL graphics code monkey, but as we all know that running windows for a game platform is very slow due to the overhead of the os.
    I would like to have my own os and drop the opengl library all-together.
    This project is purely for my buddies and i to link up and play my games online.
    If you can make any parts of my code better i would like to know how.
    I have no schooling in computer sciences and tought myself how to code, so what i know about asm is not nearly enough to do it all myself.

  10. #10
    Join Date
    Nov 2006
    Posts
    146

    Re: Writing My Own Operating System

    Nice! You can go to www.osdev.org, and joing a large community. You can also go to rohitab.com forums and they have a nice OS tutorial in the Source Code section.
    If this post helps you out, please rate it!

  11. #11
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266

    Re: Writing My Own Operating System

    Quote Originally Posted by bitshifter420
    Does anyone have a bootstrapper for a usb storage device?
    Or maybe some ideas or info on how i can write one?
    Do you have the answer for this?

    Quote Originally Posted by bitshifter420
    i wish not to store it on the hard drive.
    I assume there is a good reason for that but I am curious what that is. Why do you "wish not to store it on the hard drive"?

    The original IBM PC could boot from the keyboard but I do not know the details of how to do that. I just know that I studied the IBM BIOS many years ago and was surprised by the code to boot from the keyboard.

    Have you considered a virtual machine? I am not familiar with the details of virtual machines from Microsoft, but a virtual machine would probably help, at least for development.

    Did you know that someone wrote an OS for a micro-controler that also had a HTTP server?

    Have you considered making a development environment (an editor and an assembler) that executes in your OS?
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  12. #12
    Join Date
    Jun 2007
    Location
    MA-USA
    Posts
    247

    Re: Writing My Own Operating System

    Quote Originally Posted by Sam Hobbs
    I assume there is a good reason for that but I am curious what that is. Why do you "wish not to store it on the hard drive"?
    Mainly so it is removable/portable and easy to make changes to later on.
    You can hardly find a new pc that has a floppy drive, so usb mass storage device seems to be the next best thing to store it on.
    Ive seen a lot of os examples written in C but i want to use asm only.
    Im currently using nasmw for an assembler, it seems like the simplest one i could find and is easy to use.
    My old 286 lappy has a 6 inch greyscale monitor so you can imagine how much fun that is to play with.
    Getting this os onto a usb for my 386 desktop is kinda ontop of my list right now.
    Then ill start work on the a20 gate and 32 bit protected mode.

  13. #13
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266

    Re: Writing My Own Operating System

    Quote Originally Posted by bitshifter420
    You can hardly find a new pc that has a floppy drive, so usb mass storage device seems to be the next best thing to store it on.
    Or CD-ROM, but I don't know how to easily test that. Probably if you were to develop the capability of booting from hard drive then that can be used for a CD-ROM also. Are you familiar with the El-Torito format? A CD-ROM can also emulate a hard drive.

    Can Linux boot from a USB device? If so, then you should be able to find source code for that.

    Quote Originally Posted by bitshifter420
    Ive seen a lot of os examples written in C but i want to use asm only.
    I said nothing about C; if you understood me to have implied that, then you misunderstand.
    Quote Originally Posted by bitshifter420
    Then ill start work on the a20 gate and 32 bit protected mode.
    I said nothing about 16-bits or 32-bits.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  14. #14
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266

    Re: Writing My Own Operating System

    Quote Originally Posted by bitshifter420
    Does anyone have a bootstrapper for a usb storage device?
    Or maybe some ideas or info on how i can write one?
    I would like to store my OS on that instead of the floppy i use now.
    Try doing a search. I did and got the following, but you should do the search yourself also.
    Also, have you looked around in usb.org?

    http://www.usb.org/developers/devclass_docs/HID1_11.pdf
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  15. #15
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266

    Re: Writing My Own Operating System

    How are you doing?

    I downloaded the x3dOS.zip file but I did not understand how to create a bootable floppy. I understand that it is still being developed and you are not ready for it to be used by most people.

    If you have an improved version that you want others to try and you think it is easier to understand then I am interested in trying it.

    Even if you don't have anything for us to try, I am curious about whether you have made progress.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center