Skip to content

Commit

Permalink
Update il2cpu.md
Browse files Browse the repository at this point in the history
Grammar fixes, fixed explanations.
  • Loading branch information
ARMmaster17 committed May 24, 2015
1 parent 5714c89 commit 25ea72c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Docs/Compiler/il2cpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@

### 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 of Cosmos. It is 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
This is where IL2CPU comes in. 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.

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.

0 comments on commit 25ea72c

Please sign in to comment.