-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c8799b
commit 5aa2566
Showing
1 changed file
with
343 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,347 @@ | ||
|
||
<!DOCTYPE html> | ||
<html class="no-js" prefix="og: https://ogp.me/ns#" lang="en"> | ||
<head><link rel="preconnect" href="https://d1di2lzuh97fh2.cloudfront.net" crossorigin><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><meta charset="utf-8"><link rel="icon" href="https://d1di2lzuh97fh2.cloudfront.net/files/2d/2di/2div3h.svg?ph=621e385ee8" type="image/svg+xml" sizes="any"><link rel="icon" href="https://d1di2lzuh97fh2.cloudfront.net/files/07/07f/07fzq8.svg?ph=621e385ee8" type="image/svg+xml" sizes="16x16"><link rel="icon" href="https://d1di2lzuh97fh2.cloudfront.net/files/1j/1j3/1j3767.ico?ph=621e385ee8"><link rel="apple-touch-icon" href="https://d1di2lzuh97fh2.cloudfront.net/files/1j/1j3/1j3767.ico?ph=621e385ee8"><link rel="icon" href="https://d1di2lzuh97fh2.cloudfront.net/files/1j/1j3/1j3767.ico?ph=621e385ee8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>PatchOS</title> | ||
<meta property="og:url" content="https://georgefence.github.io/Patchware/main.html"><meta property="og:title" content="PatchOS"><meta property="og:type" content="article"><meta property="og:description" content="PatchOS is Console OS with Graphical User Interface."><meta property="og:site_name" content="PatchOS"><meta property="og:image" content="https://621e385ee8.cbaul-cdnwnd.com/967bcc44ef908c77ab38e6cc4ff0d624/200000002-0ac040ac08/700/Screenshot%202023-05-16%20200308.png?ph=621e385ee8"><meta name="robots" content="index,follow"><link rel="canonical" href="https://patchos5.webnode.page/"><script>window.checkAndChangeSvgColor=function(c){try{var a=document.getElementById(c);if(a){c=[["border","borderColor"],["outline","outlineColor"],["color","color"]];for(var h,b,d,f=[],e=0,m=c.length;e<m;e++)if(h=window.getComputedStyle(a)[c[e][1]].replace(/\s/g,"").match(/^rgb[a]?\(([0-9]{1,3}),([0-9]{1,3}),([0-9]{1,3})/i)){b="";for(var g=1;3>=g;g++)b+=("0"+parseInt(h[g],10).toString(16)).slice(-2);"0"===b.charAt(0)&&(d=parseInt(b.substr(0,2),16),d=Math.max(16,d),b=d.toString(16)+b.slice(-4));f.push(c[e][0]+"="+b)}if(f.length){var k=a.getAttribute("data-src"),l=k+(0>k.indexOf("?")?"?":"&")+f.join("&");a.src!=l&&(a.src=l,a.outerHTML=a.outerHTML)}}}catch(n){}};</script></head> | ||
<body class="l wt-home ac-s ac-i ac-n l-default l-d-none b-btn-r b-btn-s-l b-btn-dn b-btn-bw-2 img-d-n img-t-u img-h-n line-solid b-e-ds lbox-d c-s-n wnd-free-bar-fixed wnd-fe"><noscript> | ||
<iframe | ||
src="https://www.googletagmanager.com/ns.html?id=GTM-542MMSL" | ||
height="0" | ||
width="0" | ||
style="display:none;visibility:hidden" | ||
> | ||
</iframe> | ||
</noscript> | ||
|
||
|
||
|
||
|
||
<div class="b-l-br logo-br"></div> | ||
|
||
<div class="b-l-text logo-text-wrapper"> | ||
<div class="b-l-text-w logo-text"> | ||
<span class="b-l-text-c logo-text-cell"><font class="wnd-font-size-130"><strong>PatchOS</strong></font></span> | ||
</div> | ||
</div> | ||
|
||
|
||
</div> | ||
</div> | ||
<!--[if IE]><![endif]--> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<title>Getting Started </title> | ||
<meta name="viewport" content="width=device-width"> | ||
<meta name="title" content="Getting Started "> | ||
<meta name="generator" content="docfx 2.59.4.0"> | ||
|
||
<link rel="shortcut icon" href="../favicon.ico"> | ||
<link rel="stylesheet" href="../styles/docfx.vendor.css"> | ||
<link rel="stylesheet" href="../styles/docfx.css"> | ||
<link rel="stylesheet" href="../styles/main.css"> | ||
<meta property="docfx:navrel" content="../toc"> | ||
<meta property="docfx:tocrel" content="toc"> | ||
|
||
|
||
<meta property="docfx:newtab" content="true"> | ||
</head> <body data-spy="scroll" data-target="#affix" data-offset="120"> | ||
<div id="wrapper"> | ||
<header> | ||
|
||
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation"> | ||
<div class="container"> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> | ||
<span class="sr-only">Toggle navigation</span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
|
||
<a class="navbar-brand" href="../index.html"> | ||
<img id="logo" class="svg" src="../images/logo.png" alt=""> | ||
</a> | ||
</div> | ||
<div class="collapse navbar-collapse" id="navbar"> | ||
<form class="navbar-form navbar-right" role="search" id="search"> | ||
<div class="form-group"> | ||
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off"> | ||
</div> | ||
</form> | ||
|
||
<ul class="nav level1 navbar-nav"> | ||
<li> | ||
<a href="../index.html" title="Home">Home</a> | ||
</li> | ||
<li> | ||
<a href="../install.html" title="Install">Install</a> | ||
</li> | ||
<li> | ||
<a href="https://gocosmos.org" title="Cosmos Website">Cosmos Website</a> | ||
</li> | ||
<li> | ||
<a href="../articles/GettingStarted.html" title="Articles">Articles</a> | ||
</li> | ||
<li> | ||
<a href="../api/Cosmos.Build.Common.html" title="API Documentation">API Documentation</a> | ||
</li> | ||
</ul> </div> | ||
</div> | ||
</nav> | ||
|
||
<div class="subnav navbar navbar-default"> | ||
<div class="container hide-when-search" id="breadcrumb"> | ||
<ul class="breadcrumb"> | ||
<li></li> | ||
</ul> | ||
</div> | ||
</div> | ||
</header> | ||
<div role="main" class="container body-content hide-when-search"> | ||
<div class="sidenav hide-when-search"> | ||
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a> | ||
<div class="sidetoggle collapse" id="sidetoggle"> | ||
<div> | ||
<div class="sidefilter"> | ||
<form class="toc-filter"> | ||
<span class="glyphicon glyphicon-filter filter-icon"></span> | ||
<input type="text" id="toc_filter_input" placeholder="Enter here to filter..." onkeypress="if(event.keyCode==13) {return false;}"> | ||
</form> | ||
</div> | ||
<div class="sidetoc"> | ||
<div class="toc" id="toc"> | ||
|
||
<ul class="nav level1"> | ||
<li class="active"> | ||
<a href="GettingStarted.html" title="Getting Started" class="active">Getting Started</a> | ||
</li> | ||
<li class=""> | ||
<a href="Compiler/il2cpu.html" title="Compiler" class="">Compiler</a> | ||
</li> | ||
<li class=""> | ||
<a href="Changelog.html" title="Change Log" class="">Change Log</a> | ||
</li> | ||
<li class=""> | ||
<span class="expand-stub"></span> | ||
<a class="">Debugger</a> | ||
|
||
<ul class="nav level2"> | ||
<li class=""> | ||
<a href="Debugger/DebugCommands.html" title="Debug Commands" class="">Debug Commands</a> | ||
</li> | ||
</ul> </li> | ||
<li class=""> | ||
<span class="expand-stub"></span> | ||
<a class="">Installation</a> | ||
|
||
<ul class="nav level2"> | ||
<li class=""> | ||
<a href="Installation/DevKit.html" title="Dev Kit" class="">Dev Kit</a> | ||
</li> | ||
<li class=""> | ||
<a href="Installation/Running.html" title="Running" class="">Running</a> | ||
</li> | ||
</ul> </li> | ||
<li class=""> | ||
<span class="expand-stub"></span> | ||
<a class="">Kernel</a> | ||
|
||
<ul class="nav level2"> | ||
<li class=""> | ||
<a href="Kernel/Levels.html" title="Levels" class="">Levels</a> | ||
</li> | ||
<li class=""> | ||
<a href="Kernel/Plugs.html" title="Plugs" class="">Plugs</a> | ||
</li> | ||
<li class=""> | ||
<a href="Kernel/Startup.html" title="Startup" class="">Startup</a> | ||
</li> | ||
<li class=""> | ||
<a href="Kernel/OnBoot.html" title="OnBoot" class="">OnBoot</a> | ||
</li> | ||
<li class=""> | ||
<a href="Kernel/CGS.html" title="Graphics" class="">Graphics</a> | ||
</li> | ||
<li class=""> | ||
<a href="Kernel/VFS.html" title="Virtual File System" class="">Virtual File System</a> | ||
</li> | ||
<li class=""> | ||
<a href="Kernel/Network.html" title="Network" class="">Network</a> | ||
</li> | ||
<li class=""> | ||
<a href="Kernel/ManifestResouceStream.html" title="Resource Files" class="">Resource Files</a> | ||
</li> | ||
<li class=""> | ||
<a href="Kernel/MemoryManagement.html" title="Memory Management and Garbage Collection" class="">Memory Management and Garbage Collection</a> | ||
</li> | ||
<li class=""> | ||
<a href="Kernel/Audio.html" title="Audio" class="">Audio</a> | ||
</li> | ||
</ul> </li> | ||
<li class=""> | ||
<span class="expand-stub"></span> | ||
<a class="">Reference</a> | ||
|
||
<ul class="nav level2"> | ||
<li class=""> | ||
<a href="Reference/x86.html" title="x86" class="">x86</a> | ||
</li> | ||
</ul> </li> | ||
<li class=""> | ||
<span class="expand-stub"></span> | ||
<a class="">Tests</a> | ||
|
||
<ul class="nav level2"> | ||
<li class=""> | ||
<a href="Tests/TestRunner.html" title="Test Runner" class="">Test Runner</a> | ||
</li> | ||
</ul> </li> | ||
</ul> </div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="article row grid-right"> | ||
<div class="col-md-10"> | ||
<article class="content wrap" id="_content" data-uid=""> | ||
<h1 id="getting-started">Getting Started</h1> | ||
|
||
<h2 id="introducing-cosmos">Introducing Cosmos</h2> | ||
<p>Cosmos (C# Open Source Managed Operating System) is an operating system | ||
development kit which uses Visual Studio as its development environment. | ||
Despite C# in the name any .NET based language can be used including VB.NET, | ||
Fortran, Delphi Prism, IronPython, F# and more. Cosmos itself and the kernel | ||
routines are primarily written in C#, and thus the Cosmos name. Besides that, | ||
NOSMOS (.NET Open Source Managed Operating System) sounds stupid.</p> | ||
<p>Cosmos is not an operating system in the traditional sense, but instead it is | ||
an "Operating System Kit", or as I like to say "Operating System Legos". | ||
Cosmos lets you create operating systems just as Visual Studio and C# normally | ||
let you create applications. Most users can write and boot their own operating | ||
system in just a few minutes, all using Visual Studio. You can debug your operating system directly from Visual | ||
Studio using breakpoints.</p> | ||
<p>Cosmos is available in two distributions, the developer kit (dev kit), and the user kit. The dev kit is designed for users who want to work on Cosmos itself. | ||
The user kit is designed for those who are interested in building their own | ||
operating system and doing some Cosmos work. The dev kit might be thought of | ||
as the Cosmos SDK. Most users should start off with the user kit as it is not | ||
so overwhelming like the dev kit. This article focuses on the user kit.</p> | ||
<h2 id="writing-your-first-operating-system">Writing your first Operating System</h2> | ||
<p>Create a new project as you would any C# project, but select Cosmos as the project type.</p> | ||
<p><img src="images/SNAG-0000.png" alt=""></p> | ||
<p>A starter project will be created. It looks very much like a standard C# | ||
console application.</p> | ||
<p><img src="images/SNAG-0001.png" alt=""></p> | ||
<p>Kernel.cs contains the boot and execution code. Instead of seeing a Windows | ||
console window, you will see the following:</p> | ||
<p><img src="images/SNAG-0003.png" alt=""></p> | ||
<p>This is your operating system running in VMware Player! Cosmos can of course | ||
also be booted in VMware Workstation, Hyper-V, Virtual PC, Bochs, or on real | ||
hardware. But by default Cosmos uses VMware Player because it is both free, | ||
and reliable. Cosmos can even debug in Visual Studio, even when running on | ||
another machine.</p> | ||
<h2 id="integrated-debugging">Integrated Debugging</h2> | ||
<p>Debugging is a major issue with operating system development. The Cosmos team | ||
was not content enough to simply conquer building and deployment, we want to | ||
make developing operating system as easy as developing Windows applications. | ||
Debugging a Cosmos based operating system should feel very familiar to you. | ||
Lets modify our project a little bit to show the effect, and set a breakpoint. | ||
<strong>Note that the debugger only works in Visual Studio, and not Linux</strong></p> | ||
<p><img src="images/SNAG-0005.png" alt=""></p> | ||
<p>Now run the project again.</p> | ||
<p><img src="images/SNAG-0007.png" alt=""></p> | ||
<p>Note that the execution stopped at "One"? That is becuase in Visual Studio our | ||
project has stopped on a breakpoint. Simply press F5 to continue just as you | ||
would in a normal application!</p> | ||
<p>In addition to breakpoints Cosmos also supports step into (F11) as well. Trace | ||
over (F10) is not supported yet.</p> | ||
<h2 id="debugger-communication">Debugger Communication</h2> | ||
<p>The debugger uses the serial port to communicate. Because of this, debugging | ||
only works wtih virtualization environments that support serial ports such as | ||
VMware. QEMU supports serial ports as well, but its serial port implementation | ||
is seriously broken on Windows and makes debugging impossible using QEMU. To | ||
debug on real hardware, you must use a physical serial cable. In the future | ||
Cosmos will also support debugging over Ethernet.</p> | ||
<h2 id="extra-debugging">Extra Debugging</h2> | ||
<p>Cosmos supports some explicit methods that can be used to communicate with the | ||
debugger and use additional functionality. It is accessed using the Debugger | ||
class in the Cosmos.Debug namespace in the Cosmos.Kernel assembly. This | ||
assembly is used by all Cosmos projects.</p> | ||
<h2 id="code-based-breakpoints">Code Based Breakpoints</h2> | ||
<pre><code>mDebugger.Break(); | ||
</code></pre> | ||
<p>Break can be used to issue a code based break. Visual Studio will break on the | ||
line after this statement.</p> | ||
<p><img src="images/SNAG-0006.png" alt=""></p> | ||
<p>Since Cosmos does not support conditional breakpoints in the IDE yet, code | ||
base breaks are very useful for implementing such. For example:</p> | ||
<pre><code>if (x == 5) { | ||
mDebugger.Break(); | ||
} | ||
</code></pre> | ||
<p>Or you can use the .NET BCL debugger break:</p> | ||
<pre><code>System.Diagnostics.Debugger.Break(); | ||
</code></pre> | ||
<p>Both functions will produce the same result.</p> | ||
<h2 id="debug-output">Debug Output</h2> | ||
<p>Debug strings can be output to the debug window of the host. Because Cosmos | ||
does not support watches yet, this functionality can be very useful for | ||
watching variable values and for performing tracing without breakpoints.</p> | ||
<pre><code>mDebugger.Send("Hello from Cosmos!"); | ||
</code></pre> | ||
<p>When this line is executed, it will send a message over the debugging channel | ||
and it will appear in the Visual Studio output window.</p> | ||
<p><img src="images/SNAG-0008.png" alt=""></p> | ||
<h2 id="whats-the-catch">What's the catch?</h2> | ||
<p>There really is no catch. Everything we've shown here is functioning as seen. | ||
No mockups were used. However we still have a lot of work to go. Items of | ||
interest that are on our current task list include threads and networking. | ||
We have prototypes and experiments for each, but none have been rolled into | ||
the mainline Cosmos development as of yet.</p> | ||
<h2 id="obtaining-cosmos">Obtaining Cosmos</h2> | ||
<ul> | ||
<li>Cosmos Website - <a href="http://www.GoCosmos.org">http://www.GoCosmos.org</a></li> | ||
<li>Source Code - Both dev kit and user kit - <a href="http://github.com/CosmosOS/Cosmos/">http://github.com/CosmosOS/Cosmos/</a></li> | ||
</ul> | ||
</article> | ||
</div> | ||
|
||
<div class="hidden-sm col-md-2" role="complementary"> | ||
<div class="sideaffix"> | ||
<div class="contribution"> | ||
<ul class="nav"> | ||
<li> | ||
<a href="https://github.com/CosmosOS/Cosmos/blob/master/Docs/articles/GettingStarted.md/#L1" class="contribution-link">Improve this Doc</a> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="toggle-mode"> | ||
<div class="icon"> | ||
<i aria-hidden="true">☀</i> | ||
</div> | ||
<label class="switch"> | ||
<input type="checkbox" id="switch-style"> | ||
<span class="slider round"></span> | ||
</label> | ||
<div class="icon"> | ||
<i aria-hidden="true">☾</i> | ||
</div> | ||
</div> | ||
|
||
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix"> | ||
<h5>In This Article</h5> | ||
<div></div> | ||
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> --> | ||
</nav> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<footer> | ||
<div class="grad-bottom"></div> | ||
<div class="footer"> | ||
<div class="container"> | ||
<span class="pull-right"> | ||
<a href="#top">Back to top</a> | ||
</span> | ||
<div class="pull-left"> | ||
<span></span> | ||
|
||
</div> | ||
<div class="toggle-mode pull-right visible-sm visible-xs"> | ||
<div class="icon"> | ||
<i aria-hidden="true">☀</i> | ||
</div> | ||
<label class="switch"> | ||
<input type="checkbox" id="switch-style-m"> | ||
<span class="slider round"></span> | ||
</label> | ||
<div class="icon"> | ||
<i aria-hidden="true">☾</i> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<script type="text/javascript" src="../styles/toggle-theme.js"></script> | ||
</footer> </div> | ||
|
||
<script type="text/javascript" src="../styles/docfx.vendor.js"></script> | ||
<script type="text/javascript" src="../styles/docfx.js"></script> | ||
<script type="text/javascript" src="../styles/main.js"></script> | ||
</body> | ||
</html> |