Skip to content

Commit

Permalink
Fixed SCCP and Debug Engine Improvements (#1128)
Browse files Browse the repository at this point in the history
* - WIP

* - WIP

* - WIP

* - WIP
  • Loading branch information
tgiphil committed Aug 23, 2023
1 parent 96d73c1 commit edba799
Show file tree
Hide file tree
Showing 23 changed files with 292 additions and 148 deletions.
5 changes: 2 additions & 3 deletions Source/Docs/command-line-arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Command Line Arguments

The command line arguments serve as shortcuts to the common set of :doc:`settings-options` used by the MOSA tools.

.. tip:: Specific settings may also be specified on the command line using the ``-setting`` argument (or using the shorthand version ``-s`` ). For example to set the ``Compiler.OutputFile`` setting with ``Mosa.Demo.HelloWorld.x86.bin``, pass the following two arguments ``-setting Compiler.OutputFile=Mosa.Demo.HelloWorld.x86.bin`` on the command line.
.. tip:: Specific settings may also be specified on the command line using the ``-setting`` argument (or using the shorthand version ``-s`` ). For example to set the ``Compiler.OutputFile`` setting with ``Mosa.HelloWorld.x86.bin``, pass the following two arguments ``-setting Compiler.OutputFile=Mosa.HelloWorld.x86.bin`` on the command line.

Below are the command line arguments available:

Expand Down Expand Up @@ -145,7 +145,6 @@ Below are the command line arguments available:
-video,Multiboot.Video,true
-video-width,Multiboot.Video.Width,{value}
-video-height,Multiboot.Video.Height,{value}
-video-depth,Multiboot.Video.Depth,{value}

Launcher - GDB:
-launch-debugger,Launcher.GDB,true
Expand All @@ -167,7 +166,7 @@ Below are the command line arguments available:
-watch,Debugger.WatchFile,{value}

Unit Testings:
-unittest-maxerrors,UnitTest.MaxErrors,{value}
-maxerrors,UnitTest.MaxErrors,{value}

Optimization Levels:
-o0,Optimizations.Basic,false
Expand Down
4 changes: 2 additions & 2 deletions Source/Docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ How is the Cosmos project different than MOSA?

Cosmos is designed to be an operating system toolkit plugin for Visual Studio. The Cosmos toolkit, once installed, integrates with Visual Studio in two significant ways. First, the toolkit introduces a new Cosmos project type that can launch and control the build process. Second, the toolkit integrates with Visual Studio’s debugger and provides break points and watches. The toolkit requires Microsoft’s implementation of the .NET framework to compile a Cosmos operating system.

In comparison, MOSA has no dependencies on any Microsoft’s applications including Visual Studio, the .NET framework or Windows operating system. MOSA can run on all the platforms where .NET runs!
In comparison, MOSA has no dependencies on any of those applications like Visual Studio or Windows. MOSA can run on all the platforms where .NET runs!

Another important difference is Cosmos compiles to Assembly and uses YASM, to finally compile to binary code. MOSA compiles directly to binary code and has its own linker implementation.

Are Cosmos and MOSA working together?
-------------------------------------

No, Cosmos and MOSA are seperate and independent projects.
Recently, there have been talks to integrate the MOSA compiler into Cosmos, thus potentially being able to implement more features in the MOSA compiler while also providing more stability and performance for Cosmos. While nothing has come out of this yet, you can express your opinion on this in our Discord in #cosmos-integration and in the Cosmos Discord in #mosa-cosmos-crossdev.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Source/Docs/images/mosa-launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 20 additions & 20 deletions Source/Docs/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,39 @@ MOSA is licensed under the `New BSD License <http://en.wikipedia.org/wiki/New_BS

.. code-block:: text
Copyright (c) 2008, MOSA-Project
Copyright (c) 2023, MOSA-Project
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided
Redistribution and use in source and binary forms,
with or without modification, are permitted provided
that the following conditions are met:
* Redistributions of source code must retain the
above copyright notice, this list of conditions
above copyright notice, this list of conditions
and the following disclaimer.
* Redistributions in binary form must reproduce the
above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or
* Redistributions in binary form must reproduce the
above copyright notice, this list of conditions and
the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name of Managed Operating System Alliance (MOSA)
nor the names of its contributors may be used to endorse
or promote products derived from this software without
* Neither the name of Managed Operating System Alliance (MOSA)
nor the names of its contributors may be used to endorse
or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
We will accept contributions submitted under the New BSD License or the compatible `MIT/X11 License <http://en.wikipedia.org/wiki/MIT_License>`__. Note: GNU licenses are not compatible with the BSD license.
We will accept contributions submitted under the New BSD License or the compatible `MIT/X11 License <http://en.wikipedia.org/wiki/MIT_License>`__. Note: GNU licenses are not compatible with the BSD license.
48 changes: 23 additions & 25 deletions Source/Docs/settings-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Here are the setting options for the compiler tools:
Compiler Settings
-----------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -18,14 +18,13 @@ Compiler Settings
Compiler.Multithreading,"If true, enables multithreading during compiling process"
Compiler.Multithreading.MaxThreads,Maximum number of threads used by the compiler
Compiler.Binary,"If true, emits object file, otherwise no object file is created"
Compiler.EmitInline,"If true, emits all inlined methods into the object file"
Compiler.OutputFile,Filename of the object file
Compiler.SourceFiles,Filename(s) of the source files

Compiler Optimizations Settings
-------------------------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -50,7 +49,7 @@ Compiler Optimizations Settings
Linker Settings
---------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -66,7 +65,7 @@ Linker Settings
Common Settings
---------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -77,25 +76,25 @@ Common Settings
Compiler Debug Settings
-----------------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

CompilerDebug.Statistics,"If true, enables statistics gathering"
CompilerDebug.DebugFile,Filename to emit a MOSA specific debug information
CompilerDebug.MapFile,Filename to emit a map of all symbols
CompilerDebug.MapFile,Filename to emit a map of all symbols
CompilerDebug.CompileTimeFile,Filename to emit compile times for each method
CompilerDebug.AsmFile,Filename to emit ASM disassembly
CompilerDebug.NasmFile,Filename to emit disassembly using the NASM tool
CompilerDebug.InlinedFile,Filename to emit a list of all methods that were inlined
CompilerDebug.PreLinkHashFile,Filename to emit a list of all methods with their hash value prior to linking
CompilerDebug.PreLinkHashFile,Filename to emit a list of all methods with their hash value prior to linking
CompilerDebug.PostLinkHashFile,Filename to emit a list of all methods with their hash value after linking
CompilerDebug.FullCheckMode,"If true, causes the compiler to run internal validate checks (used to test the compiler)"

Compiler X86 Settings
---------------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -104,7 +103,7 @@ Compiler X86 Settings
Explorer Settings
-----------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -115,7 +114,7 @@ Explorer Settings
Launcher Settings
-----------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -131,7 +130,7 @@ Launcher Settings
Image Settings
--------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -144,7 +143,7 @@ Image Settings
Emulator Settings
-----------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -162,7 +161,7 @@ Emulator Settings
GDB Settings
------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -172,21 +171,20 @@ GDB Settings
Multiboot Settings
------------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Multiboot.Version,"Multiboot version none, v1, v2"
Multiboot.Video,"If true, enable VGA BIOS Extension (VBE)"
Multiboot.Version,"Multiboot version none, v2"
Multiboot.Video,"If true, enable the framebuffer provided by Multiboot"
Multiboot.Video.Width,Video Width
Multiboot.Video.Height,Video Height
Multiboot.Video.Depth,Video Depth
Multiboot.InitialStackAddress,Initial Stack Address

Debugger Settings
-----------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -196,7 +194,7 @@ Debugger Settings
Application Location Settings
-----------------------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -212,11 +210,11 @@ Application Location Settings
AppLocation.Ndisasm,Location of the Ndisasm application
AppLocation.Mkisofs,Location of the Mkisofs application
AppLocation.GDB,Location of the GDB application

OS Settings
-----------------------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand All @@ -226,17 +224,17 @@ OS Settings
Import Settings
---------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Import,Filename of another settings file to import


Unit Test Settings
---------------

.. csv-table::
.. csv-table::
:header: "Settings", "Description"
:widths: 50, 200

Expand Down
6 changes: 3 additions & 3 deletions Source/Docs/unit-tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
Unit Tests
##########

The MOSA project has an extensive set of unit tests to help validate that the MOSA compiler is emitting correct binary code.
The MOSA project has an extensive set of unit tests to help validate that the MOSA compiler is emitting correct binary code.

On Windows, execute the script ``Tests\RunAllUnitTestsWithPause.bat`` to run the unit tests.

On Linux, execute the following to run the unit tests:

.. code-block:: bash
dotnet bin/Mosa.Utility.UnitTests.dll -oMax -s Emulator.Display=false
dotnet bin/Mosa.Utility.UnitTests.dll -oMax -check
The unit tests take a few minutes to execute on a modern PC. The results will be automatically displayed on the screen. The last line shows the total number of tests and failed tests, and the total time. Similar to the following:

.. code-block:: text
Total Elapsed: 95.3 secs
Unit Test Results:
Expand Down
18 changes: 17 additions & 1 deletion Source/Mosa.BareMetal.HelloWorld.x86/Boot.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Kernel.BareMetal;
using Mosa.UnitTests.Primitive;

namespace Mosa.BareMetal.HelloWorld.x86;

Expand All @@ -11,7 +12,22 @@ public static void Main()
Debug.WriteLine("Boot::Main()");
Debug.WriteLine("MOSA x86 Kernel");

Program.EntryPoint();
var result = CheckedTests.AddU8U8(18446744073709551615, 1);

if (result == 95272687)
{
Debug.WriteLine("CheckedTests::AddU8U8() -> Pass");
}
else
{
Debug.WriteLine("CheckedTests::AddU8U8() -> Fail");
}

Debug.WriteLine("##PASS##");

while (true)
{
}
}

public static void Include()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
<ItemGroup>
<ProjectReference Include="..\Mosa.BareMetal.HelloWorld\Mosa.BareMetal.HelloWorld.csproj" />
<ProjectReference Include="..\Mosa.Kernel.BareMetal.x86\Mosa.Kernel.BareMetal.x86.csproj" />
<ProjectReference Include="..\Mosa.UnitTests\Mosa.UnitTests.csproj" />
</ItemGroup>
</Project>

0 comments on commit edba799

Please sign in to comment.