Introduction: Make an Operating System in C#
So, creating an operating system in Assembly is not easy!
This instructable will show you how to make your own C# operating system. If you are new to C#, consider doing some research first.
Step 1: Gather Resources
First, you need to have Microsoft Visual Studio 2010 or higher installed. Then install Cosmos User Kit Milestone 4.
Link for Cosmos User Kit: https://cosmos.codeplex.com/downloads/get/90082
Cosmos Project Page: https://cosmos.codeplex.com
If you have any problems with installing Cosmos, then comment it.
Let's move on to Step 2.
Step 2: Create the Project
Now that Cosmos is installed, let's create the project.
Select Cosmos Boot in the C# Template list. If you didn't find Cosmos Boot in the C# Template list, read the troubleshooting guide below:
Troubleshooting:
If it didn't show up, try the following:
- Try re-installing Cosmos as an Administrator.
- Try installing Visual Studio 2010.
- Select a different .NET Framework SDK.
Step 3: Coding [the Fun Part]
Now we can start coding!
NOTE: Do not delete any Cosmos-generated code except for Console.WriteLine("You just booted C# code");
An example of C# code:
Console.WriteLine("Cosmos Tutorial");
Console.ForegroundColor = ConsoleColor.Green;
string input;
shell:
input = Console.ReadLine();
if(input == "hw")
{
Console.WriteLine("Hello World!");
}
goto shell;
//End Code
So that was a shell example. Shells are easy to make (my opinion).
Let's move on to Step 4.
Step 4: Building the Operating System
Now that we have written the code, click the green play button in Visual Studio on the Tool Strip.
It should launch the Cosmos Builder.
You can experiment with it and do whatever you want. It will save it in an ISO file so you can burn it to a CD. The path of the image file is displayed on the builder.
If you don't want to burn it, you can emulate it using emulation software such as VirtualBox, Bochs, VMWare and many others.
Have fun with your Operating System!
Step 5: Tutorial Completed
You have completed this tutorial!
To support us, either like or share it! For more Instructables by Ralphsoft, visit our site.
Have fun,
Ralphsoft
19 Comments
12 months ago
hi when i try to open the cosmos builder it spits out an error saying unable to start program
2 years ago
how do i download it i dont see any .exe files in the GIT respiratory
Reply 2 years ago
here was it in assets :
https://github.com/CosmosOS/Cosmos/releases/download/Userkit_20200708/CosmosUserKit-20200708-vs2019.exe
Question 3 years ago
I get a error saying that migration cannot be complete:
3 years ago
Can you please make a tutorial on coding an OS in C++?
4 years ago
How can I install Cosmos?
5 years ago
I have a problem! When I'm trying to create a project, I don't see "Cosmos Boot", but I see "Cosmos C# Library" (with descriptoion "A project for creating Cosmos Kernel"). When I'm trying to create project by "Cosmos C# Library", my Visual Studio says: "GUID identificator must contain 32 numbers and 4 lines". It is on my screenshot, but it's in Polish there. By line I mind "-", but I don't know how to describe it (Maybe "minus"?), so i called it line. I was trying with a lot of names of project (contains deufalt name-"CSharpKrenel1" and "12345678-1234-4321-9320-656565656565" wich had 32 numbers and 4 lines and it was in form suggered by Visual Studio), but still nothing! Pleeeeees, help.
Reply 5 years ago
Which version of VS are you using? At the time I wrote this, I used VS 2010 to develop my operating system.
Before I can give you a clear answer, may I please know the following:
- which version of VS you are using
- if you are using the Cosmos User Kit MS4
Thanks
6 years ago
I get this everytime I try to debug
Reply 6 years ago
I have VM Virtualbox
Reply 6 years ago
You need VMWare, not VM VirtualBox.
7 years ago
is it possible to make it run on mobiles
Reply 7 years ago
It isn't possible without emulation. Try Bochs on Android or try it on iOS (Jailbroken)
7 years ago
Hi,
I'm using Visual Studio 2015 and when I try to install cosmos it says I need VS 2013. Is there a version or a patch I can find somewhere to run this with VS 2015?
Thank you,
Michael.
Reply 7 years ago
I don't think so. Anyway, the link I provided is Milestone 4. Milestone 4 is a stable build for Visual Studio. The newer ones have more to offer, but this one is very stable.
8 years ago on Introduction
Hi i would like to know if using Mono on mac it is possible to do this in OS X without virtual machine?
Reply 8 years ago on Introduction
I don't think so :(.
Anyway, you can check the cosmos project page for further information.
8 years ago on Introduction
fantastic, thanks so much for sharing!
Reply 8 years ago on Introduction
no problem :)