Skip to content

Commit

Permalink
Demos: Merge HelloWorld into CoolWorld (#1239)
Browse files Browse the repository at this point in the history
* Demos: Merge HelloWorld into CoolWorld

Signed-off-by: AnErrupTion <[email protected]>

* Remove HelloWorld in Mosa.sln

Signed-off-by: AnErrupTion <[email protected]>

* Resolve conflicts

Signed-off-by: AnErrupTion <[email protected]>

* Rename VirtualBox & VMware Workstation demo scripts

Signed-off-by: AnErrupTion <[email protected]>

* Fix demo tests not working for console CoolWorld

Signed-off-by: AnErrupTion <[email protected]>

* Fix mistake

Signed-off-by: AnErrupTion <[email protected]>

* Forgot to update documentation

Signed-off-by: AnErrupTion <[email protected]>

* Fix bug in BootOptions + scripts

Signed-off-by: AnErrupTion <[email protected]>

---------

Signed-off-by: AnErrupTion <[email protected]>
  • Loading branch information
AnErrupTion authored Oct 14, 2024
1 parent 2130e8d commit bff4054
Show file tree
Hide file tree
Showing 79 changed files with 574 additions and 930 deletions.
104 changes: 52 additions & 52 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ jobs:
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.Starter.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal TestWorld
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.TestWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal HelloWorld
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.HelloWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal CoolWorld
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -vmware-svga -include bin\Include
- name: Demo Test - BareMetal Console CoolWorld
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters -bootoptions coolworldui=consolemode,bootoptions=serialdebug
- name: Demo Test - BareMetal Graphical CoolWorld
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters -vmware-svga -include bin\Include

linux-demo-testing:
strategy:
Expand Down Expand Up @@ -335,10 +335,10 @@ jobs:
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.Starter.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal TestWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal HelloWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal CoolWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -vmware-svga -include bin/Include
- name: Demo Test - BareMetal Console CoolWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters -bootoptions coolworldui=consolemode,bootoptions=serialdebug
- name: Demo Test - BareMetal Graphical CoolWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters -vmware-svga -include bin/Include

macos-demo-testing:
strategy:
Expand Down Expand Up @@ -369,10 +369,10 @@ jobs:
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.Starter.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal TestWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal HelloWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal CoolWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -vmware-svga -include bin/Include
- name: Demo Test - BareMetal Console CoolWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters -bootoptions coolworldui=consolemode,bootoptions=serialdebug
- name: Demo Test - BareMetal Graphical CoolWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters -vmware-svga -include bin/Include

linux-x64-compile-test:
name: Linux - X64 Compile Tests
Expand All @@ -393,26 +393,26 @@ jobs:
with:
name: linux-build-artifact
path: bin
- name: x64 Compile Test - BareMetal HelloWorld - o0
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x64.dll -x64 -o0 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal HelloWorld - o1
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x64.dll -x64 -o1 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal HelloWorld - o2
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x64.dll -x64 -o2 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal HelloWorld - o3
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x64.dll -x64 -o3 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal HelloWorld - o4
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x64.dll -x64 -o4 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal HelloWorld - o5
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x64.dll -x64 -o5 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal HelloWorld - o6
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x64.dll -x64 -o6 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal HelloWorld - o7
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x64.dll -x64 -o7 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal HelloWorld - o8
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x64.dll -x64 -o8 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal HelloWorld - o9
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x64.dll -x64 -o9 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal TestWorld - o0
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x64.dll -x64 -o0 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal TestWorld - o1
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x64.dll -x64 -o1 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal TestWorld - o2
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x64.dll -x64 -o2 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal TestWorld - o3
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x64.dll -x64 -o3 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal TestWorld - o4
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x64.dll -x64 -o4 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal TestWorld - o5
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x64.dll -x64 -o5 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal TestWorld - o6
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x64.dll -x64 -o6 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal TestWorld - o7
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x64.dll -x64 -o7 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal TestWorld - o8
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x64.dll -x64 -o8 -check -autolaunch-off -output-counters
- name: x64 Compile Test - BareMetal TestWorld - o9
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x64.dll -x64 -o9 -check -autolaunch-off -output-counters

linux-arm32-compile-test:
name: Linux - ARM32 Compile Tests
Expand All @@ -433,26 +433,26 @@ jobs:
with:
name: linux-build-artifact
path: bin
- name: ARM32 Compile Test - BareMetal HelloWorld - o0
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.ARM32.dll -arm32 -o0 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal HelloWorld - o1
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.ARM32.dll -arm32 -o1 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal HelloWorld - o2
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.ARM32.dll -arm32 -o2 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal HelloWorld - o3
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.ARM32.dll -arm32 -o3 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal HelloWorld - o4
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.ARM32.dll -arm32 -o4 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal HelloWorld - o5
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.ARM32.dll -arm32 -o5 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal HelloWorld - o6
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.ARM32.dll -arm32 -o6 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal HelloWorld - o7
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.ARM32.dll -arm32 -o7 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal HelloWorld - o8
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.ARM32.dll -arm32 -o8 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal HelloWorld - o9
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.ARM32.dll -arm32 -o9 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal TestWorld - o0
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.ARM32.dll -arm32 -o0 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal TestWorld - o1
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.ARM32.dll -arm32 -o1 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal TestWorld - o2
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.ARM32.dll -arm32 -o2 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal TestWorld - o3
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.ARM32.dll -arm32 -o3 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal TestWorld - o4
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.ARM32.dll -arm32 -o4 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal TestWorld - o5
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.ARM32.dll -arm32 -o5 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal TestWorld - o6
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.ARM32.dll -arm32 -o6 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal TestWorld - o7
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.ARM32.dll -arm32 -o7 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal TestWorld - o8
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.ARM32.dll -arm32 -o8 -check -autolaunch-off -output-counters
- name: ARM32 Compile Test - BareMetal TestWorld - o9
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.ARM32.dll -arm32 -o9 -check -autolaunch-off -output-counters

merge-artifacts:
name: Merge Artifacts
Expand Down
3 changes: 3 additions & 0 deletions Demos/Console/Run-BareMetal.Console.CoolWorld.x86.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd %~dp0
cd ..\bin
Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash -bootoptions coolworldui=consolemode Mosa.BareMetal.CoolWorld.x86.dll
3 changes: 3 additions & 0 deletions Demos/Console/Run-BareMetal.Console.CoolWorld.x86.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash -bootoptions coolworldui=consolemode Mosa.BareMetal.CoolWorld.x86.dll
3 changes: 0 additions & 3 deletions Demos/Console/Run-BareMetal.HelloWorld.x86.bat

This file was deleted.

3 changes: 0 additions & 3 deletions Demos/Console/Run-BareMetal.HelloWorld.x86.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cd %~dp0
cd ..\bin
Mosa.Tool.Launcher -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.HelloWorld.x86.dll
Mosa.Tool.Launcher -autostart -oMax -output-asm -output-debug -output-hash -bootoptions coolworldui=consolemode Mosa.BareMetal.CoolWorld.x86.dll
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.HelloWorld.x86.dll
./Mosa.Tool.Launcher -autostart -oMax -output-asm -output-debug -output-hash -bootoptions coolworldui=consolemode Mosa.BareMetal.CoolWorld.x86.dll
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions Source/Docs/demos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ MOSA includes three demos applications to demonstrate various capabilities of th
CoolWorld
=========

It uses the GPU and some other features offered by MOSA to make a nice graphical demo.
It's MOSA's flagship demo. It can boot into either console mode (containing a shell with a few basic commands) or
graphical mode (which makes use of the GPU and some other features offered by MOSA). You can boot into console mode by
inserting the `-bootoptions coolworldui=consolemode` command line option when starting the MOSA launcher.

.. image:: images/mosa-demo-coolworld.png
Console mode:

HelloWorld
==========
.. image:: images/mosa-demo-coolworld-console.png

It implements a basic shell with a few basic commands, like boot information, memory usage, and
device information.
Graphical mode:

.. image:: images/mosa-demo-helloworld.png
.. image:: images/mosa-demo-coolworld-graphical.png

TestWorld
=========
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Binary file removed Source/Docs/images/mosa-demo-helloworld.png
Binary file not shown.
Binary file modified Source/Docs/images/mosa-demo-starter.png
Loading
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-demo-testworld.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 0 additions & 15 deletions Source/Mosa.BareMetal.CoolWorld/Boot.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.BareMetal.HelloWorld.Apps;
using Mosa.BareMetal.CoolWorld.Console.Apps;

namespace Mosa.BareMetal.HelloWorld;
namespace Mosa.BareMetal.CoolWorld.Console;

public static class AppManager
{
Expand Down
50 changes: 50 additions & 0 deletions Source/Mosa.BareMetal.CoolWorld/Console/Apps/BootInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using System.Text;
using Mosa.Kernel.BareMetal;
using Mosa.Runtime;

namespace Mosa.BareMetal.CoolWorld.Console.Apps;

public class BootInfo : IApp
{
public string Name => "BootInfo";

public string Description => "Shows Multiboot v2 information.";

public void Execute()
{
System.Console.WriteLine("Command line : " + NullTermString(Multiboot.V2.CommandLine));
System.Console.WriteLine("Bootloader name : " + NullTermString(Multiboot.V2.BootloaderName));
System.Console.WriteLine("Memory lower : " + Multiboot.V2.MemoryLower / 1024 + " MiB");
System.Console.WriteLine("Memory upper : " + Multiboot.V2.MemoryUpper / 1024 + " MiB");
System.Console.WriteLine("Memory map entries : " + Multiboot.V2.MemoryMapEntries);
System.Console.WriteLine("Framebuffer available : " + !Multiboot.V2.FrameBuffer.IsNull);

if (!Multiboot.V2.FrameBuffer.IsNull)
{
System.Console.WriteLine("Framebuffer resolution : " + Multiboot.V2.FrameBufferWidth + "x" + Multiboot.V2.FrameBufferHeight);
}

System.Console.WriteLine("RSDPv1 version : " + !Multiboot.V2.RSDPv1.IsNull);
System.Console.WriteLine("RSDPv2 version : " + !Multiboot.V2.RSDPv2.IsNull);
}

private readonly StringBuilder Builder = new();

private string NullTermString(Pointer pointer)
{
Builder.Clear();

var i = 0;
byte b;

do
{
b = pointer.Load8(i++);
Builder.Append((char)b);
} while (b != 0);

return Builder.ToString();
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using System;

namespace Mosa.BareMetal.HelloWorld.Apps;
namespace Mosa.BareMetal.CoolWorld.Console.Apps;

public class Clear : IApp
{
Expand All @@ -12,6 +10,6 @@ public class Clear : IApp

public void Execute()
{
Console.Clear();
System.Console.Clear();
}
}
28 changes: 28 additions & 0 deletions Source/Mosa.BareMetal.CoolWorld/Console/Apps/Credits.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

namespace Mosa.BareMetal.CoolWorld.Console.Apps;

public class Credits : IApp
{
public string Name => "Credits";

public string Description => "Shows everyone who contributed to the project.";

public void Execute()
{
System.Console.WriteLine("*** MOSA Credits ****");
System.Console.WriteLine(" Phil Garcia");
System.Console.WriteLine(" Simon Wollwage");
System.Console.WriteLine(" Michael Frohlich");
System.Console.WriteLine(" Stefan Andres Charsley");
System.Console.WriteLine(" Chin Ki Yuen");
System.Console.WriteLine(" Patrick Reisert");
System.Console.WriteLine(" Phillip Webster");
System.Console.WriteLine(" Kevin Thompson");
System.Console.WriteLine(" Kai P.Reisert");
System.Console.WriteLine(" M.de Bruijn");
System.Console.WriteLine(" Royce Mitchell III");
System.Console.WriteLine(" Sebastian Loncar");
System.Console.WriteLine(" AnErrupTion");
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using System;

namespace Mosa.BareMetal.HelloWorld.Apps;
namespace Mosa.BareMetal.CoolWorld.Console.Apps;

public class Help : IApp
{
Expand All @@ -13,6 +11,6 @@ public class Help : IApp
public void Execute()
{
foreach (var app in AppManager.Applications)
Console.WriteLine(app.Name + " - " + app.Description);
System.Console.WriteLine(app.Name + " - " + app.Description);
}
}
21 changes: 21 additions & 0 deletions Source/Mosa.BareMetal.CoolWorld/Console/Apps/Mem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Kernel.BareMetal;

namespace Mosa.BareMetal.CoolWorld.Console.Apps;

public class Mem : IApp
{
public string Name => "Mem";

public string Description => "Shows memory information.";

public void Execute()
{
System.Console.WriteLine("**** Memory ****");
System.Console.WriteLine(" Total Pages : " + PageFrameAllocator.TotalPages);
System.Console.WriteLine(" Used Pages : " + PageFrameAllocator.UsedPages);
System.Console.WriteLine(" Page Size : " + Page.Size);
System.Console.WriteLine(" Free Memory : " + (PageFrameAllocator.TotalPages - PageFrameAllocator.UsedPages) * Page.Size / (1024 * 1024) + " MB");
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using System;
using Mosa.DeviceSystem.HardwareAbstraction;
using Mosa.DeviceSystem.Services;

namespace Mosa.BareMetal.HelloWorld.Apps;
namespace Mosa.BareMetal.CoolWorld.Console.Apps;

public class Reboot : IApp
{
Expand All @@ -14,12 +13,12 @@ public class Reboot : IApp

public void Execute()
{
Console.WriteLine("Rebooting...");
System.Console.WriteLine("Rebooting...");

var pc = Kernel.BareMetal.Kernel.ServiceManager.GetFirstService<PCService>();
var success = pc.Reset();

if (!success) Console.WriteLine("Error while trying to reboot.");
if (!success) System.Console.WriteLine("Error while trying to reboot.");

for (; ; ) HAL.Yield();
}
Expand Down
Loading

0 comments on commit bff4054

Please sign in to comment.