Jump to content




Recent Status Updates

  • Photo
      30 Sep
    rhossis

    laptop hard disk seated beneath motherboard but with no access panel. 7 hours to replace :(

    Show comments (3)
  • Photo
      19 Sep
    Chall

    I love it when you go to write a help thread, then while writing, you reach an enlightenment, and figure it out yourself.

    Show comments (3)
View All Updates

Developed by TechBiz Xccelerator
Photo
- - - - -

Create an operating system in C#!

hello world

  • Please log in to reply
1 reply to this topic

#1 Termana

Termana

    CC Devotee

  • Just Joined
  • PipPipPipPipPipPip
  • 971 posts

Posted 06 November 2008 - 05:15 AM

Have you ever wanted to make your very own operating system? Well you've come to the right place - sit down and relax and I'll take you though how to make one that with run in QEMU. I should mention - it is fully managed code, including the kernel - the C++ fanboys will be REAL "happy" that you can do this :P
For this tutorial, I will assume you have at least moderate knowledge of C# and the Visual Studio IDE. (I am using the Visual Studio 2008 C# Express Edition)
I have attached some photos to help explain what I'm doing.
1. First goto Gocosmos.org and download the Cosmos User Kit (this is what I'm using for the tutorial not the DevKit)

2. Once you have the setup file.... set it up :P It all sets up just like a normal application install, until Visual Studio has its way. A dialog will come up (pic1.jpg) click Next on it.

3. Visual Studio will give you a warning about a unsigned content file that could contain harmful code - it doesn't so just click Yes. (pic2.jpg)

4. It will say "Installation complete successfully", click Close.

5. Open up Visual Studio, you will notice you now have a new template installed called CosmosBoot, click it and press ok.

6. In the Program.cs file there will be a line below Cosmos.Kernel.Boot.Default(); - replace it with Console.WriteLine("Hello World"); (pic3.jpg)

7. Goto the debug menu, and press Start without debugging.

8. A little console window will show up, and then a white dialog. On the white dialog just leave everything as it is and press "Build".

9. A lot of text will now show up, the Cosmos kernel and your part of the OS (hello world outputed if you done step 6) is being converted to assembly language and then it will be compiled by NASM (which is installed with Cosmos).

10. QEMU will start booting up, QEMU is a PC Emulator. Once done it should display, "Init Keyboard" and then "Hello World". (pic4.jpg).

And thats all there is to it, to build more onto it, just edit the area where you put the Console.WriteLine("Hello World"); part.

Enjoy building your own operating system in C#!

Attached Thumbnails

  • pic3.JPG
  • pic4.JPG
  • pic2.JPG
  • pic1.JPG

  • 0

Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!


#2 Dedman

Dedman

    CC Newcomer

  • Member
  • PipPip
  • 11 posts
  • Programming Language:Java, C++
  • Learning:Java, C++, C#, PHP, JavaScript, Others

Posted 27 December 2012 - 12:43 PM

I have found this to be currently outdated. Lines 5 and 6 either no longer apply in the current Cosmos version, or I am totally lost.img1.png Could you do an update to the newest version of Cosmos and VS C# 2010? I cannot seem to locate the Program.cs file

Edited by Dedman, 27 December 2012 - 12:59 PM.

  • 0





Also tagged with one or more of these keywords: hello world

Powered by binpress