How to make a *REAL* O.S. or Virtual Machine in C#
All tutorials created in C# to be posted in here.
3 posts
Page 1 of 1
NOTICE: THIS TUTORIAL CAN BE USED ON ANY DEVICE SUCH AS A IPHONE OR ANY OTHER DEVICE HAVE FUN!
WOW! The C-Sharp area doesnt have much! Let me fill it up for you guys with great tutorials such as this one!
My strongest point is in C#!
First before you do anything download this template called Cosmos
LINK: http://cosmos.codeplex.com/releases/351 ... load/90082
now that link download the template that is only availble for C# 2008.
K now to the code after you installed it then go to C# and create new then select the template for Cosmos.
Now when Cosmos loads you will see a bunch of stuff and coding, if you are familiar with C# then you can mess around with some of the stuff, if you arent that much of a expert just leave stuff alone and follow my instructions, later in this tutorial i will show you how to make a advanced OS, i have already made a OS with only a fully functioning Command prompt with my own computer language!
Now to the code again----
Here are some simple codes that you might want to add to your OS or VOS
If you are planning on making a VOS skip all this if you want and just put Form1 and other shit but if you want to make something actually better follow the tutorial!
FIrst before you add any code take away this code on the bottom
-
Now to some real code
to shutdown the device that the OS is on!
Now moving onto more advanced stuff! If you want.
This code is intermediate not really advanced but carries on!
also puts a title!
Now for some advanced stuff! Lets make that boring command prompt better and funner!
LETS DRAW !
you will need to import the following!
using System;
using Cosmos.Compiler.Builder;
using Cosmos.Hardware;
using Cosmos.Sys;
using Cosmos.Kernel;
using System.Collections;
using System.Collections.Generic;
using Screen = Cosmos.Hardware.VGAScreen
that will enable you to draw animations and other stuff!
Make a new namespace called Draw
public static void FillRectangle(uint lx, uint ly, uint sx, uint sy, uint colour)
Screen.SetMode320x200x8();
{
for (uint xx = lx; xx < sx + lx; xx++)
{
for (uint yy = ly; yy < sy + ly; yy++)
{
if(xx <= 319 && xx >= 0)
screenbuffer[yy * 320 + xx] = colour; //If you are using a uint[] as a screen buffer, use this, otherwise use this:
//Screen.SetPixel320x200x8(xx, yy, colour);
}
}
}
That above is the code for coloring the command prompt,
well that is all for today!
I will keep on adding to this a little bit every few days, cause i dont like making OS's that much or explaining them, so you can try this out and do what ever!
WOW! The C-Sharp area doesnt have much! Let me fill it up for you guys with great tutorials such as this one!
My strongest point is in C#!
First before you do anything download this template called Cosmos
LINK: http://cosmos.codeplex.com/releases/351 ... load/90082
now that link download the template that is only availble for C# 2008.
K now to the code after you installed it then go to C# and create new then select the template for Cosmos.
Now when Cosmos loads you will see a bunch of stuff and coding, if you are familiar with C# then you can mess around with some of the stuff, if you arent that much of a expert just leave stuff alone and follow my instructions, later in this tutorial i will show you how to make a advanced OS, i have already made a OS with only a fully functioning Command prompt with my own computer language!
Now to the code again----
Here are some simple codes that you might want to add to your OS or VOS
If you are planning on making a VOS skip all this if you want and just put Form1 and other shit but if you want to make something actually better follow the tutorial!
FIrst before you add any code take away this code on the bottom
-
Code: Select all
that code is to just pause the OS if you need that later.while (true)
;
Now to some real code
to shutdown the device that the OS is on!
Code: Select all
to restart the device that the OS is on!
Cosmos.Sys.Deboot.ShutDown();
Code: Select all
How to make a The OS read a line given to show!
Cosmos.Sys.Deboot.Reboot();
Code: Select all
To Restart the Consoles Commands and clear the memmory of anything that happend put the following code!
Console.WriteLine("Welcome! You just booted C# code. Please edit Program.cs to fit your needs");
Console.Read();
Code: Select all
Here is a little code snippet thing for shutting down a computer!
Console.Clear();
Code: Select all
Now only that, just that code can shut down your device! simple yet powerfull!namespace CosmosBoot1
{
class Program
{
#region Cosmos Builder logic
// Most users wont touch this. This will call the Cosmos Build tool
[STAThread]
static void Main(string[] args)
{
BuildUI.Run();
}
#endregion
// Main entry point of the kernel
public static void Init()
{
var xBoot = new Cosmos.Sys.Boot();
xBoot.Execute();
Console.WriteLine("Welcome to EXTRA OS!");
Console.WriteLine("If you want to shutdown your computer press any key");
Console.Read();
Cosmos.Sys.Deboot.ShutDown();
}
}
}
Now moving onto more advanced stuff! If you want.
This code is intermediate not really advanced but carries on!
Code: Select all
that code only allow the computer to shutdown if s is pressed!using System;
using Cosmos.Compiler.Builder;
namespace CosmosBoot1
{
class Program
{
#region Cosmos Builder logic
// Most users wont touch this. This will call the Cosmos Build tool
[STAThread]
static void Main(string[] args)
{
BuildUI.Run();
}
#endregion
// Main entry point of the kernel
public static void Init()
{
var xBoot = new Cosmos.Sys.Boot();
xBoot.Execute();
Console.Title.Equals("hello OS");
Console.WriteLine("Welcome to EXTRA OS!");
Console.WriteLine("If you want to shutdown your computer press s");
Console.KeyAvailable.Equals("s");
Console.Read();
Cosmos.Sys.Deboot.ShutDown();
}
}
}
also puts a title!
Now for some advanced stuff! Lets make that boring command prompt better and funner!
LETS DRAW !
you will need to import the following!
using System;
using Cosmos.Compiler.Builder;
using Cosmos.Hardware;
using Cosmos.Sys;
using Cosmos.Kernel;
using System.Collections;
using System.Collections.Generic;
using Screen = Cosmos.Hardware.VGAScreen
that will enable you to draw animations and other stuff!
Make a new namespace called Draw
public static void FillRectangle(uint lx, uint ly, uint sx, uint sy, uint colour)
Screen.SetMode320x200x8();
{
for (uint xx = lx; xx < sx + lx; xx++)
{
for (uint yy = ly; yy < sy + ly; yy++)
{
if(xx <= 319 && xx >= 0)
screenbuffer[yy * 320 + xx] = colour; //If you are using a uint[] as a screen buffer, use this, otherwise use this:
//Screen.SetPixel320x200x8(xx, yy, colour);
}
}
}
That above is the code for coloring the command prompt,
well that is all for today!
I will keep on adding to this a little bit every few days, cause i dont like making OS's that much or explaining them, so you can try this out and do what ever!
------------------------------------------------------------------------------
Proprogrammer, not just a Programmer.
Proprogrammer, not just a Programmer.
Hello Proprogrammer,
Thanks for your great post here
, you must show us how to make the gui
Keep it up cooll;
Thanks for your great post here


Keep it up cooll;
Doesnt that app have ti me .app or something for iphone?
Bound and boom tech,
The Future Of Coding
The Future Of Coding
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023