Skip to content

Commit

Permalink
Merge pull request CosmosOS#124 from ARMmaster17/master
Browse files Browse the repository at this point in the history
Documentation update
  • Loading branch information
mterwoord committed May 30, 2015
2 parents 6f8002b + 05b752d commit dfc3a33
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 68 deletions.
8 changes: 4 additions & 4 deletions Docs/Articles/MS5/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ console window, you will see the following:
![](CosmosMS5/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, or on real
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.
Expand Down Expand Up @@ -126,18 +126,18 @@ and it will appear in the Visual Studio output window.

### What's the catch?

There really is no catch. Everything I've shown here is functioning as seen.
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 interfaces (necessary for
foreach), file systems (partial support exists), threads, networking, and
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?

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.
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

Expand Down
20 changes: 8 additions & 12 deletions Docs/Compiler/il2cpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,20 @@

### IL2CPU

This is one of the most important piece of code of Cosmos. It is an AOT
This is one of the most important pieces of code in Cosmos. It's an AOT
(Ahead-Of-Time) compiler.

When you compile your C# program, it is compiled into the IL (intermediate
When you compile your C# (or any .NET language) program, it is compiled into the IL (intermediate
language). The IL is then interpreted and executed by a Virtual Machine when
you open your exe
you open your exe.

Cosmos is written in C# and Visual Studio compiles it into IL as always. But a
PC does not came with an interpreter for the IL code. And writing a virtual
PC does not come with an interpreter for the IL code. And writing a virtual
machine for running an operating system is not always ideal.

IL2CPU takes the IL code and translates it to processor opcodes. Actually it
only supports the x86 architecture. So it translates from IL to x86 opcodes,
but it can be ported to any architecture.
This is where IL2CPU comes in. IL2CPU takes the IL code and translates it to processor opcodes. Currently, only x86 opcodes are available at the moment. However, more architectures are planned for the future (ARM, PowerPC, x86-64).

As you might think, the develop of IL2CPU is a fundamental step for the grow
of Cosmos. IL2CPU is responsible for the final output of code and should
optimize it as much as possible.

**TODO: explain this better.** Before finally creating the binary, IL2CPU does some more magic with files created in "C#/ASM". They are executed and from their execution an assembly file is get and integrated into the output.
At this point, IL2CPU performs some more magic before finally converting the entire file into a bootable binary file, which can be loaded by a bootloader on any system (Cosmos uses Syslinux).

As you might think, IL2CPU is a fundamental part of the development
of Cosmos. IL2CPU is responsible for the final output, which is why most optimizations added are for IL2CPU.
17 changes: 8 additions & 9 deletions Docs/Express/Compile.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
For creating your own Cosmos in Express 2010 you need the following:
For creating your own Cosmos in Express 2013 you need the following:

* Visual Studio Express for C# or VB.NET
* installed Cosmos Kit(User Kit or compiled from checkout (Dev Kit))
* Visual Studio 2010 Shell (Isolated Shell)
* Visual Studio Express for C# or VB.NET
* installed Cosmos Kit(User Kit or compiled from checkout (Dev Kit))
* Visual Studio 2013 Shell (Isolated Shell)

In Visual Studio Express you create a library project, that contain your OS
code, and a project for compiling your OS.

1. Start Visual Studio Express 2010 and create a project named "Cosmos C# Library". This is the part of your OS for adding Code. Compile this project now for creating the DLL for later use. After that save it.
2. (UNTESTED) Start your Microsoft Visual Studio 2010 Shell and create a Project "Cosmos Project (Empty)". It contains a custom Project that use MSBuild with many tasks to create your OS. Save the project.
3. Copy now the created library with name of your project in the folder of the build project under bin/Debug/ Thats needed else would the added reference in next step not found.
4. Add now the reference to the build project and try to build. When you get a warning that the added assembly is not found, you get "No Kernel Found!".

1. Start Visual Studio Express 2013 and create a project named "Cosmos C# Library". This is the part of your OS for adding Code. Compile this project now for creating the DLL for later use. After that save it.
2. (UNTESTED) Start your Microsoft Visual Studio 2013 Shell and create a Project "Cosmos Project (Empty)". It contains a custom Project that use MSBuild with many tasks to create your OS. Save the project.
3. Copy now the created library with name of your project in the folder of the build project under bin/Debug/ Thats needed else would the added reference in next step not found.
4. Add now the reference to the build project and try to build. When you get a warning that the added assembly is not found, you get "No Kernel Found!".
20 changes: 9 additions & 11 deletions Docs/Installation/DevKit.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@

### Prerequisites

* (Free) source code of Devkit from [Cosmos on CodePlex](https://github.com/CosmosOS/Cosmos)
* (Optional) [Visual Studio 2013 Community](http://go.microsoft.com/fwlink/?LinkId=517284)
If you do not wish to use the integrated source control, you can use the SVN
bridge instead.

* If using Visual Studio 2010 Express, you can use the [SVN bridge](http://cosmos.codeplex.com/SourceControl/list/changesets) i.e. direct download current changeset in a zip file, or one of the many TFS standalone clients available at CodePlex.
* (Free) [InnoSetup QuickStart Kit](http://www.jrsoftware.org/isdl.php#qsp)
* This is required to build the setup kit which is used to build and install the Visual Studio integration libaries for Cosmos.
* (Free) source code of Devkit from [Cosmos on GitHub](https://github.com/CosmosOS/Cosmos)
* You must clone the repository using Git. For a detailed walkthrough, [see here](https://help.github.com/articles/fork-a-repo/).
* When following the tutorial, replace *OctoCat* with *CosmosOS* and *Spoon-Knife* with *Cosmos*.
* (Free) [Visual Studio 2013 Community](http://go.microsoft.com/fwlink/?LinkId=517284)
* (Free) [InnoSetup QuickStart Kit](http://www.jrsoftware.org/isdl.php#qsp)
* This is required to build the setup kit which is used to build and install the Visual Studio integration libaries for Cosmos.
* During install it will ask you about optional components to install. Be sure you check "Install Inno Setup Preprocessor".
* (Free) [ Visual Studio 2010 SDK](http://www.microsoft.com/downloads/en/details.aspx?FamilyID=47305cf4-2bea-43c0-91cd-1b853602dcc5)
* Visual Studio SDK: [download here](https://www.microsoft.com/en-us/download/details.aspx?id=40758).

### Installation

* Look in the downloaded sources and **run install.bat** with admin privileges (Vista and upper will ask you for it), needed for install in system directories
* On end it will start retail versions of Visual Studio and you can begin with OS development.
* Look in the downloaded sources and run **install.bat** with admin privileges (UAC will ask for permission), needed for install in system directories.
* After installation is complete, Visual Studio will automatically open and you may begin programming with your new, modified copy of Cosmos.

## Parameters to the install.bat
The `install.bat` accepts following parameters
Expand Down
16 changes: 8 additions & 8 deletions Docs/Installation/Running.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ can simply fall back to ISO which should work with any environment.
### ISO

The ISO option creates an ISO image of the Cosmos output. This ISO file can be
mounted and booted by most virtualization technologies. In addition a physical
mounted and booted by most virtualization technologies. In addition, a physical
optical disk can be burned and used to boot physical hardware.

### VMWare Workstation
### VMWare Workstation/Player

WMWare Workstation and VMWare Player are the preferred testing environments
for Cosmos. This is because they are stable, reliable, and easily controlled
by the Cosmos Visual Studio integration package. This second point provides
for a seemless development and debugging process.
by the Cosmos Visual Studio integration package. This allows for easy debugging and code execution control.

VMWare Workstation is not free, however VMWare Player is. VMWare Player for
the typical Cosmos developer provides more than enough functionality.
Expand All @@ -29,19 +28,20 @@ VMWare Player can be downloaded [ here](http://vmware.com/download/player/).

### QEMU

 _place_holder;
Not officially supported at this time, but can be done. Just use the ISO option above with debugging turned off.

Bochs

 _place_holder;
Support is underway.

PXE

 _place_holder;
For PXE, no special software is required. Only an ethernet connection to your router. However, if you have a computer that does not support network booting, or if you must perform the action over WiFi, you may need to look at a PXE chainloader such as [gPXE](#).

Virtual PC

 _place_holder;
Not officially supported at this time, but can be done. Just use the ISO option above with debugging turned off.

Hyper-V

Not supported at this time.
14 changes: 7 additions & 7 deletions Docs/Kernel/MemoryManager.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# The Memory Manager

The manager will init it self if there is no blocks, the manager is model after a double LinkedList and not a List.
The manager will init itself if there are no blocks. The manager is modeled after a double LinkedList and is not a List.

# Memory Layout
The layout has not preset list or table but rather every item has meta data linking the next and previous item this allows for a robust system.
The layout does not have a preset list or table but rather every item has meta data linking the next and previous item. This allows for a robust system.

The data layout looks as follow :
The data layout is as follows:

````
Block|Block|Block etc.
Expand Down Expand Up @@ -33,10 +33,10 @@ the final layout looks like this:
Note:
this means the smallest size an Block can occupy is 17 bytes, 16 bytes for the header and 1 for the smallest data type a byte.
# How this system is used.
# Usage
### Allocation
Adding an Block is easy, you simply find the first free block using compare exchange and split it.
Allocating a block happens by finding the first free block and split it (if necessary).
## Deallocation (free)
Freeing a block is easy set its flag(in meta data) to Free
## Deallocation
Freeing a block is easy set its flag (in the metadata) to free.
19 changes: 9 additions & 10 deletions Docs/Kernel/Plugs.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
Plugs are used to fill "holes" in .NET libraries and replace them with different
code. Holes exist for example when a method in .NET library uses a Windows API
call. That API call will not be available on Cosmos. One method would be to
emulate the Windows API as WINE does, but the API is a low level C style API
relying on memory structures. Emulating it would be highly inefficient. Instead,
call. That API call will not be available on Cosmos. Emulating the win32 API would be highly inefficient. Instead,
Cosmos replaces specific methods and property implementations that rely on
Windows API calls. Plugs can also be used to provide an alternate implementation
win32 API calls. Plugs can also be used to provide an alternate implementation
for a method, even if it does not rely on the Windows API.

Plugs can be implemented in the following manners:

* Code Plug - Standard C# (or any .NET language) is used to provide the alternate implementation.
* Assembly Languge - In a few low level cases assembly language is used. This is reserved for a few few cases and only allowed in the Cosmos.Core ring.
* Assembly Languge - In a few low level cases assembly language is used. This is reserved for a few cases and only allowed in the Cosmos.Core ring.
* X# - Not supported as of yet. Used in place of Assembly language.

When a Cosmos project is compiled, IL2CPU creates a list of plugs. When it
encounters a method or property for which a plug exists, instead of using the IL
contained in the existing implementation, it substitutes the plug version
contained in the existing implementation, it substitutes it with the plug version
instead.

###
Plug Targets

* Source Plugs - Used to target a class library without modifiable or available source. For example the Console class in the .NET Framework. The Console class uses the Windows API, so plugs can be used to redefine the methods in the Console class to use code which interacts with Cosmos instead. For these types of plug targets, the attributes are specified on the plug implemenation since the source cannot be modified of the target. If we coud modify the source, we wouldn't need plugs. :)Sou
* Source Plugs - Used to target a class library without modifiable or available source. For example the Console class in the .NET Framework. The Console class uses the Windows API, so plugs can be used to redefine the methods in the Console class to use code which interacts with Cosmos instead. For these types of plug targets, the attributes are specified on the plug implemenation since the source cannot be modified of the target. If we coud modify the source, we wouldn't need plugs. :)
* Assembly Plug - Empty methods which create a sort of "abstract" class are used to define an interface to an assembly language plug. This type of plug is rare and only for the core ring. For these types of plugs, the attributes are specified on the target, rather than the implementation.

Non source targets should never need to use assembly language, but if they do
Non-source targets should never need to use assembly language, but if they do
the plugs must be cascaded since assembly language plugs can only be applied to
classes with modifiable source.

###
Implementing a Plug

Plugs can be applied at the class, or to an individual method or property. Plug
Plugs can be applied to a class, or to an individual method or property. Plug
implementations are defined by applying attributes to the class which provides
the plug implementation.

Expand Down Expand Up @@ -61,4 +60,4 @@ Plugs are used to fill "holes" in .NET libraries and replace them with different
**Plug Target**

Please specify the PlugTarget using the fully qualified name, like:
global::System.Console. To avoid later name colisions.
global::System.Console. To avoid later name colisions.
9 changes: 2 additions & 7 deletions Docs/Kernel/Startup.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@


There is some basic hand coded assembly which is the first entry point of
Cosmos. From there the first C# entry point is Cosmos.System.Kernel.Start().

Cosmos.System.Kernel is an abstract class that each project creates one
descendant of to create the operating system.
On startup, there is some hand-coded assembly that runs before the Cosmos layer kicks in. From there, the C# entry point Cosmos.System.Kernel.Start() is called.

Cosmos.System.Kernel is an abstract class that forms the Cosmos framework upon which your OS is built upon.

0 comments on commit dfc3a33

Please sign in to comment.