Use docfx for docs.

Docs cleanup.
This commit is contained in:
José Pedro 2018-11-09 22:50:36 +00:00
parent da440ff194
commit 19b800b5fe
No known key found for this signature in database
GPG key ID: B8247B9301707B83
37 changed files with 190 additions and 189 deletions

2
.gitignore vendored
View file

@ -14,6 +14,8 @@
[Pp]ackages/
[Oo]bj/
Docs/log.txt
*.[Oo]bj
*.suo
*.ncb

9
Docs/.gitignore vendored Normal file
View file

@ -0,0 +1,9 @@
###############
# folder #
###############
/**/DROP/
/**/TEMP/
/**/packages/
/**/bin/
/**/obj/
_site

View file

@ -1,8 +0,0 @@

Why two projects
What happens when F5 is pressed
Project properties

11
Docs/Cosmos.Docs.csproj Normal file
View file

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFramework>netstandard1.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="docfx.console" Version="2.40.2" PrivateAssets="All" />
</ItemGroup>
</Project>

View file

@ -1,2 +0,0 @@


View file

@ -1,15 +0,0 @@
<?xml version="1.0"?>
<configuration>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5.2" />
</system.Web>
-->
<system.web>
<compilation debug="false" targetFramework="4.5.2"/>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
</configuration>

5
Docs/api/.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
###############
# temp file #
###############
*.yml
.manifest

2
Docs/api/index.md Normal file
View file

@ -0,0 +1,2 @@
# PLACEHOLDER
TODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*!

View file

@ -1,4 +1,8 @@
DS to VS:
# Debug Commands
## DS to VS
```cs
Noop = 0;
TracePoint = 1;
Message = 2;
@ -17,8 +21,11 @@ Frame = 11;
Stack = 12;
Pong = 13;
BreakPointAsm = 14;
```
VS to DS:
## VS to DS
```cs
Noop = 0;
TraceOff = 1; // Dont think currently used
@ -49,6 +56,7 @@ SetAsmBreak = 16;
Ping = 17;
// Make sure this is always the last entry. Used by DebugStub to verify commands.
Max = 18;
```
Debug channel:
## Debug channel
We support channels, which are prefixed with anything prefixed with 192 and up. 192 is used for a debug view.

View file

@ -1,6 +1,6 @@

# Getting Started
### Introducing Cosmos
## Introducing Cosmos
Cosmos (C# Open Source Managed Operating System) is an operating system
development kit which uses Visual Studio as its development environment.
@ -25,22 +25,22 @@ 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.
### Writing your first Operating System
## Writing your first Operating System
Create a new project as you would any C# project, but select Cosmos as the
project type.
![](CosmosMS5/SNAG-0000.png)
![](images/SNAG-0000.png)
A starter project will be created. It looks very much like a standard C#
console application.
![](CosmosMS5/SNAG-0001.png)
![](images/SNAG-0001.png)
Program.cs contains the boot and execution code. Instead of seeing a Windows
console window, you will see the following:
![](CosmosMS5/SNAG-0003.png)
![](images/SNAG-0003.png)
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
@ -48,7 +48,7 @@ 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.
### Integrated Debugging
## Integrated Debugging
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
@ -56,11 +56,11 @@ 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.
![](CosmosMS5/SNAG-0005.png)
![](images/SNAG-0005.png)
Now run the project again.
![](CosmosMS5/SNAG-0007.png)
![](images/SNAG-0007.png)
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
@ -69,7 +69,7 @@ would in a normal application!
In addition to breakpoints Cosmos also supports step into (F11) as well. Trace
over (F10) is not supported yet.
### Debugger Communication
## Debugger Communication
The debugger uses the serial port to communicate. Because of this, debugging
only works wtih virtualization environments that support serial ports such as
@ -78,14 +78,14 @@ 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.
### Extra Debugging
## Extra Debugging
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.
### Code Based Breakpoints
## Code Based Breakpoints
Debugger.Break();
@ -93,7 +93,7 @@ assembly is used by all Cosmos projects.
Break can be used to issue a code based break. Visual Studio will break on the
line after this statement.
![](CosmosMS5/SNAG-0006.png)
![](images/SNAG-0006.png)
Since Cosmos does not support conditional breakpoints in the IDE yet, code
base breaks are very useful for implementing such. For example:
@ -110,7 +110,7 @@ Alternatively you can call the .NET class libary break:
Both functions will produce the same result.
### Debug Output
## Debug Output
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
@ -122,9 +122,9 @@ watching variable values and for performing tracing without breakpoints.
When this line is executed, it will send a message over the debugging channel
and it will appear in the Visual Studio output window.
![](CosmosMS5/SNAG-0008.png)
![](images/SNAG-0008.png)
### What's the catch?
## What's the catch?
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
@ -133,13 +133,13 @@ foreach loops), file systems (partial support exists), threads, networking, and
graphics. We have prototypes and experimentation for each, but none have been
rolled into the mainline Cosmos development as of yet.
### What was that Syslinux thing I saw on boot?
## What was that Syslinux thing I saw on boot?
Cosmos does not run on Linux. A boot loader called Syslinux is used to boot
Cosmos. After booting, Syslinux is not used. Syslinux is a bootloader and is
not a Linux distro. Syslinux simplifies the booting process by doing tasks such as enabline the A20 gate, initializing hardware, and switching to real mode (all of which are required by modern operating systems).
### Obtaining Cosmos
## Obtaining Cosmos
* Cosmos Website - [http://www.GoCosmos.org](http://www.GoCosmos.org)
* Source Code - Both dev kit and user kit - [http://github.com/CosmosOS/Cosmos/](http://github.com/CosmosOS/Cosmos/)

View file

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View file

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View file

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View file

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

43
Docs/articles/toc.yml Normal file
View file

@ -0,0 +1,43 @@
- name: Getting Started
href: GettingStarted.md
- name: Compiler
href: Compiler/il2cpu.md
- name: Debugger
items:
- name: Debug Commands
href: Debugger/DebugCommands.md
- name: Express
href: Express/Compile.md
- name: Installation
items:
- name: Dev Kit
href: Installation/DevKit.md
- name: Running
href: Installation/Running.md
- name: Kernel
items:
- name: Heap
href: Kernel/Heap.md
- name: Levels
href: Kernel/Levels.md
- name: Memory
href: Kernel/Memory.md
- name: Plugs
href: Kernel/Plugs.md
- name: Startup
href: Kernel/Startup.md
- name: Reference
items:
- name: x86
href: Reference/x86.md
- name: Tests
items:
- name: Test Runner
href: Tests/TestRunner.md

72
Docs/docfx.json Normal file
View file

@ -0,0 +1,72 @@
{
"metadata": [
{
"src": [
//{
// "files": [
// "**.csproj"
// ],
// "src": ""
//}
],
"dest": "api",
"disableGitFeatures": false,
"disableDefaultFilter": false
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"**/*.md",
"**/toc.yml",
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"favicon.ico",
"images/**",
"articles/images/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"dest": "_site",
"globalMetadata": {
"_appFooter": "<span></span>",
"_appLogoPath": "images/logo.png",
"_enableNewTab": true
},
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default"
],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false
}
}

BIN
Docs/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
Docs/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -1,147 +1,9 @@

# Cosmos Documentation
### Introducing Cosmos
<br />
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.
Some docs are outdated, and we are currently working on updating them and adding new ones.
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. Since milestone 5,
Cosmos includes an integrated project type in Visual Studio, and an
integrated debugger. You can debug your operating system directly from Visual
Studio using breakpoints.
<br />
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.
### Writing your first Operating System
Create a new project as you would any C# project, but select Cosmos as the
project type.
![](http://i.imgur.com/mb5ZOEk.png)
A starter project will be created. It looks very much like a standard C#
console application.
![](http://i.imgur.com/zUJoj5Y.png)
Program.cs contains the boot and execution code. Instead of seeing a Windows
console window, you will see the following:
![](http://i.imgur.com/D3F9c4t.png)
This is your operating system running in VMWare Player! Cosmos can of course
also be booted in VMWare Workstation, Hyper-V, Virtual PC, 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.
### Integrated Debugging
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.
![](http://i.imgur.com/Hf4LZ3c.png)
Now run the project again.
![](http://i.imgur.com/YLPmEUf.png)
Note that the execution stopped at "Two"? 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!
In addition to breakpoints Cosmos also supports step into (F11) as well. Trace
over (F10) is not supported yet.
### Debugger Communication
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.
### Extra Debugging
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.
### Code Based Breakpoints
Global.Dbg.Break();
Break can be used to issue a code based break. Visual Studio will break on the
line after this statement.
![](http://i.imgur.com/Dupjm8y.png)
Since Cosmos does not support conditional breakpoints in the IDE yet, code
base breaks are very useful for implementing such. For example:
```csharp
if (x == 5) {
Global.Dbg.Break();
}
```
Alternatively you can call the .NET class libary break:
System.Diagnostics.Debugger.Break();
Both functions will produce the same result.
### Debug Output
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.
```csharp
Global.Dbg.Send("Hello from Cosmos!");
```
When this line is executed, it will send a message over the debugging channel
and it will appear in the Visual Studio output window.
![](http://i.imgur.com/DHqwjiF.png)
### What's the catch?
There really is no catch. Everything I'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 interfaces (necessary for
foreach), file systems (partial support exists), threads, networking, and
graphics. We have prototypes and experimentation for each, but none have been
rolled into the mainline Cosmos development as of yet.
### What was that Syslinux thing I saw on boot?
Cosmos does not run on Linux. A boot loader called Syslinux is used to boot
Cosmos. After booting, Syslinux is not used. Syslinux is a bootloader and is
not a Linux distro.
### Obtaining Cosmos
* [Source Code - Both dev kit and user kit](http://github.com/CosmosOS/Cosmos/)
* [Releases](https://github.com/CosmosOS/Cosmos/releases)
*Looking for the [Cosmos website](https://gocosmos.org)?*

7
Docs/toc.yml Normal file
View file

@ -0,0 +1,7 @@
- name: Articles
href: articles/
- name: Cosmos Website
href: https://gocosmos.org
#- name: API Documentation
# href: api/
# topicHref: api/index.md

5
global.json Normal file
View file

@ -0,0 +1,5 @@
{
"msbuild-sdks": {
"Microsoft.Build.NoTargets": "1.0.40"
}
}