diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 2d5e929e7d..d1475f6595 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -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: @@ -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: @@ -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 @@ -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 @@ -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 diff --git a/Demos/Console/Run-BareMetal.Console.CoolWorld.x86.bat b/Demos/Console/Run-BareMetal.Console.CoolWorld.x86.bat new file mode 100755 index 0000000000..80878929f1 --- /dev/null +++ b/Demos/Console/Run-BareMetal.Console.CoolWorld.x86.bat @@ -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 diff --git a/Demos/Console/Run-BareMetal.Console.CoolWorld.x86.sh b/Demos/Console/Run-BareMetal.Console.CoolWorld.x86.sh new file mode 100755 index 0000000000..a6cf2e840c --- /dev/null +++ b/Demos/Console/Run-BareMetal.Console.CoolWorld.x86.sh @@ -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 diff --git a/Demos/Console/Run-BareMetal.CoolWorld.x86.bat b/Demos/Console/Run-BareMetal.Graphical.CoolWorld.x86.bat similarity index 100% rename from Demos/Console/Run-BareMetal.CoolWorld.x86.bat rename to Demos/Console/Run-BareMetal.Graphical.CoolWorld.x86.bat diff --git a/Demos/Console/Run-BareMetal.CoolWorld.x86.sh b/Demos/Console/Run-BareMetal.Graphical.CoolWorld.x86.sh similarity index 100% rename from Demos/Console/Run-BareMetal.CoolWorld.x86.sh rename to Demos/Console/Run-BareMetal.Graphical.CoolWorld.x86.sh diff --git a/Demos/Console/Run-BareMetal.HelloWorld.x86.bat b/Demos/Console/Run-BareMetal.HelloWorld.x86.bat deleted file mode 100644 index 9696bef80a..0000000000 --- a/Demos/Console/Run-BareMetal.HelloWorld.x86.bat +++ /dev/null @@ -1,3 +0,0 @@ -cd %~dp0 -cd ..\bin -Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.HelloWorld.x86.dll diff --git a/Demos/Console/Run-BareMetal.HelloWorld.x86.sh b/Demos/Console/Run-BareMetal.HelloWorld.x86.sh deleted file mode 100755 index a9174c2cff..0000000000 --- a/Demos/Console/Run-BareMetal.HelloWorld.x86.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -cd ../bin -./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.HelloWorld.x86.dll diff --git a/Demos/Console/Run-VMware-BareMetal.CoolWorld.x86.bat b/Demos/Console/Run-VMware-BareMetal.Graphical.CoolWorld.x86.bat similarity index 100% rename from Demos/Console/Run-VMware-BareMetal.CoolWorld.x86.bat rename to Demos/Console/Run-VMware-BareMetal.Graphical.CoolWorld.x86.bat diff --git a/Demos/Console/Run-VMware-BareMetal.CoolWorld.x86.sh b/Demos/Console/Run-VMware-BareMetal.Graphical.CoolWorld.x86.sh similarity index 100% rename from Demos/Console/Run-VMware-BareMetal.CoolWorld.x86.sh rename to Demos/Console/Run-VMware-BareMetal.Graphical.CoolWorld.x86.sh diff --git a/Demos/Console/Run-VirtualBox-BareMetal.CoolWorld.x86.bat b/Demos/Console/Run-VirtualBox-BareMetal.Graphical.CoolWorld.x86.bat similarity index 100% rename from Demos/Console/Run-VirtualBox-BareMetal.CoolWorld.x86.bat rename to Demos/Console/Run-VirtualBox-BareMetal.Graphical.CoolWorld.x86.bat diff --git a/Demos/Console/Run-VirtualBox-BareMetal.CoolWorld.x86.sh b/Demos/Console/Run-VirtualBox-BareMetal.Graphical.CoolWorld.x86.sh similarity index 100% rename from Demos/Console/Run-VirtualBox-BareMetal.CoolWorld.x86.sh rename to Demos/Console/Run-VirtualBox-BareMetal.Graphical.CoolWorld.x86.sh diff --git a/Demos/Run-BareMetal.HelloWorld.x86.bat b/Demos/Run-BareMetal.Console.CoolWorld.x86.bat old mode 100644 new mode 100755 similarity index 50% rename from Demos/Run-BareMetal.HelloWorld.x86.bat rename to Demos/Run-BareMetal.Console.CoolWorld.x86.bat index 9c67f3cefd..c42ee23065 --- a/Demos/Run-BareMetal.HelloWorld.x86.bat +++ b/Demos/Run-BareMetal.Console.CoolWorld.x86.bat @@ -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 diff --git a/Demos/Run-BareMetal.HelloWorld.x86.sh b/Demos/Run-BareMetal.Console.CoolWorld.x86.sh similarity index 50% rename from Demos/Run-BareMetal.HelloWorld.x86.sh rename to Demos/Run-BareMetal.Console.CoolWorld.x86.sh index 7512922111..78131f3752 100755 --- a/Demos/Run-BareMetal.HelloWorld.x86.sh +++ b/Demos/Run-BareMetal.Console.CoolWorld.x86.sh @@ -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 diff --git a/Demos/Run-BareMetal.CoolWorld.x86.bat b/Demos/Run-BareMetal.Graphical.CoolWorld.x86.bat similarity index 100% rename from Demos/Run-BareMetal.CoolWorld.x86.bat rename to Demos/Run-BareMetal.Graphical.CoolWorld.x86.bat diff --git a/Demos/Run-BareMetal.CoolWorld.x86.sh b/Demos/Run-BareMetal.Graphical.CoolWorld.x86.sh similarity index 100% rename from Demos/Run-BareMetal.CoolWorld.x86.sh rename to Demos/Run-BareMetal.Graphical.CoolWorld.x86.sh diff --git a/Demos/Run-VMware-BareMetal.CoolWorld.x86.bat b/Demos/Run-VMware-BareMetal.Graphical.CoolWorld.x86.bat similarity index 100% rename from Demos/Run-VMware-BareMetal.CoolWorld.x86.bat rename to Demos/Run-VMware-BareMetal.Graphical.CoolWorld.x86.bat diff --git a/Demos/Run-VMware-BareMetal.CoolWorld.x86.sh b/Demos/Run-VMware-BareMetal.Graphical.CoolWorld.x86.sh similarity index 100% rename from Demos/Run-VMware-BareMetal.CoolWorld.x86.sh rename to Demos/Run-VMware-BareMetal.Graphical.CoolWorld.x86.sh diff --git a/Demos/Run-VirtualBox-BareMetal.CoolWorld.x86.bat b/Demos/Run-VirtualBox-BareMetal.Graphical.CoolWorld.x86.bat similarity index 100% rename from Demos/Run-VirtualBox-BareMetal.CoolWorld.x86.bat rename to Demos/Run-VirtualBox-BareMetal.Graphical.CoolWorld.x86.bat diff --git a/Demos/Run-VirtualBox-BareMetal.CoolWorld.x86.sh b/Demos/Run-VirtualBox-BareMetal.Graphical.CoolWorld.x86.sh similarity index 100% rename from Demos/Run-VirtualBox-BareMetal.CoolWorld.x86.sh rename to Demos/Run-VirtualBox-BareMetal.Graphical.CoolWorld.x86.sh diff --git a/Source/Docs/demos.rst b/Source/Docs/demos.rst index ab56baac4b..53d7dd44e0 100644 --- a/Source/Docs/demos.rst +++ b/Source/Docs/demos.rst @@ -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 ========= diff --git a/Source/Docs/images/mosa-demo-coolworld-console.png b/Source/Docs/images/mosa-demo-coolworld-console.png new file mode 100644 index 0000000000..fefcb1eac1 Binary files /dev/null and b/Source/Docs/images/mosa-demo-coolworld-console.png differ diff --git a/Source/Docs/images/mosa-demo-coolworld-graphical.png b/Source/Docs/images/mosa-demo-coolworld-graphical.png new file mode 100644 index 0000000000..cba65a3c58 Binary files /dev/null and b/Source/Docs/images/mosa-demo-coolworld-graphical.png differ diff --git a/Source/Docs/images/mosa-demo-coolworld.png b/Source/Docs/images/mosa-demo-coolworld.png deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Source/Docs/images/mosa-demo-helloworld.png b/Source/Docs/images/mosa-demo-helloworld.png deleted file mode 100644 index eef192f2c6..0000000000 Binary files a/Source/Docs/images/mosa-demo-helloworld.png and /dev/null differ diff --git a/Source/Docs/images/mosa-demo-starter.png b/Source/Docs/images/mosa-demo-starter.png index e69de29bb2..0f038f9bf3 100644 Binary files a/Source/Docs/images/mosa-demo-starter.png and b/Source/Docs/images/mosa-demo-starter.png differ diff --git a/Source/Docs/images/mosa-demo-testworld.png b/Source/Docs/images/mosa-demo-testworld.png index e69de29bb2..4daeabda09 100644 Binary files a/Source/Docs/images/mosa-demo-testworld.png and b/Source/Docs/images/mosa-demo-testworld.png differ diff --git a/Source/Mosa.BareMetal.CoolWorld/Boot.cs b/Source/Mosa.BareMetal.CoolWorld/Boot.cs deleted file mode 100644 index a9be886f3b..0000000000 --- a/Source/Mosa.BareMetal.CoolWorld/Boot.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MOSA Project. Licensed under the New BSD License. - -using Mosa.Kernel.BareMetal; -using Mosa.Runtime.Plug; - -namespace Mosa.BareMetal.CoolWorld; - -internal class Boot -{ - [Plug("Mosa.Runtime.StartUp::BootOptions")] - public static void SetBootOptions() - { - BootSettings.EnableDebugOutput = true; - } -} diff --git a/Source/Mosa.BareMetal.HelloWorld/AppManager.cs b/Source/Mosa.BareMetal.CoolWorld/Console/AppManager.cs similarity index 86% rename from Source/Mosa.BareMetal.HelloWorld/AppManager.cs rename to Source/Mosa.BareMetal.CoolWorld/Console/AppManager.cs index 54baf279ca..2c8b1828f6 100644 --- a/Source/Mosa.BareMetal.HelloWorld/AppManager.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Console/AppManager.cs @@ -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 { diff --git a/Source/Mosa.BareMetal.CoolWorld/Console/Apps/BootInfo.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/BootInfo.cs new file mode 100644 index 0000000000..6f03ea0aa7 --- /dev/null +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/BootInfo.cs @@ -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(); + } +} diff --git a/Source/Mosa.BareMetal.HelloWorld/Apps/Clear.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Clear.cs similarity index 73% rename from Source/Mosa.BareMetal.HelloWorld/Apps/Clear.cs rename to Source/Mosa.BareMetal.CoolWorld/Console/Apps/Clear.cs index aa115fd734..4f9bc83fbb 100644 --- a/Source/Mosa.BareMetal.HelloWorld/Apps/Clear.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Clear.cs @@ -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 { @@ -12,6 +10,6 @@ public class Clear : IApp public void Execute() { - Console.Clear(); + System.Console.Clear(); } } diff --git a/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Credits.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Credits.cs new file mode 100644 index 0000000000..ce8176de00 --- /dev/null +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Credits.cs @@ -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"); + } +} diff --git a/Source/Mosa.BareMetal.HelloWorld/Apps/Help.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Help.cs similarity index 70% rename from Source/Mosa.BareMetal.HelloWorld/Apps/Help.cs rename to Source/Mosa.BareMetal.CoolWorld/Console/Apps/Help.cs index f8361dc1bb..394b81b849 100644 --- a/Source/Mosa.BareMetal.HelloWorld/Apps/Help.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Help.cs @@ -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 { @@ -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); } } diff --git a/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Mem.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Mem.cs new file mode 100644 index 0000000000..53f4e7148b --- /dev/null +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Mem.cs @@ -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"); + } +} diff --git a/Source/Mosa.BareMetal.HelloWorld/Apps/Reboot.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Reboot.cs similarity index 72% rename from Source/Mosa.BareMetal.HelloWorld/Apps/Reboot.cs rename to Source/Mosa.BareMetal.CoolWorld/Console/Apps/Reboot.cs index d8f0e811aa..d54898aac9 100644 --- a/Source/Mosa.BareMetal.HelloWorld/Apps/Reboot.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Reboot.cs @@ -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 { @@ -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(); 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(); } diff --git a/Source/Mosa.BareMetal.HelloWorld/Apps/Shell.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Shell.cs similarity index 50% rename from Source/Mosa.BareMetal.HelloWorld/Apps/Shell.cs rename to Source/Mosa.BareMetal.CoolWorld/Console/Apps/Shell.cs index d21101fe2b..0f93521601 100644 --- a/Source/Mosa.BareMetal.HelloWorld/Apps/Shell.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Shell.cs @@ -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 Shell : IApp { @@ -12,22 +10,22 @@ public class Shell : IApp public void Execute() { - Console.WriteLine(); - Console.WriteLine("MOSA Shell v2.4"); - Console.WriteLine("Enter \"quit\" to exit the shell."); + System.Console.WriteLine(); + System.Console.WriteLine("MOSA Shell v2.4"); + System.Console.WriteLine("Enter \"quit\" to exit the shell."); while (true) { - Console.Write("> "); + System.Console.Write("> "); - var cmd = Console.ReadLine(); + var cmd = System.Console.ReadLine(); if (cmd == "quit") break; if (!AppManager.Execute(cmd)) { - Console.WriteLine("Unknown command: " + cmd); + System.Console.WriteLine("Unknown command: " + cmd); } } } diff --git a/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowDisks.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowDisks.cs new file mode 100644 index 0000000000..3176f261b6 --- /dev/null +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowDisks.cs @@ -0,0 +1,43 @@ +// Copyright (c) MOSA Project. Licensed under the New BSD License. + +using System; +using Mosa.DeviceSystem.Disks; + +namespace Mosa.BareMetal.CoolWorld.Console.Apps; + +public class ShowDisks : IApp +{ + public string Name => "ShowDisks"; + + public string Description => "Shows information about disk controllers and disks."; + + public void Execute() + { + System.Console.Write("> Probing for disk controllers..."); + var diskControllers = ConsoleMode.DeviceService.GetDevices(); + System.Console.WriteLine("[Completed: " + diskControllers.Count + " found]"); + + foreach (var device in diskControllers) + { + System.Console.Write(" "); + ConsoleMode.Bullet(ConsoleColor.Yellow); + System.Console.Write(" "); + ConsoleMode.InBrackets(device.Name, ConsoleColor.White, ConsoleColor.Green); + System.Console.WriteLine(); + } + + System.Console.Write("> Probing for disks..."); + var disks = ConsoleMode.DeviceService.GetDevices(); + System.Console.WriteLine("[Completed: " + disks.Count + " found]"); + + foreach (var disk in disks) + { + System.Console.Write(" "); + ConsoleMode.Bullet(ConsoleColor.Yellow); + System.Console.Write(" "); + ConsoleMode.InBrackets(disk.Name, ConsoleColor.White, ConsoleColor.Green); + System.Console.Write(" " + (disk.DeviceDriver as IDiskDevice).TotalBlocks + " blocks"); + System.Console.WriteLine(); + } + } +} diff --git a/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowFS.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowFS.cs new file mode 100644 index 0000000000..791a92dad9 --- /dev/null +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowFS.cs @@ -0,0 +1,63 @@ +// Copyright (c) MOSA Project. Licensed under the New BSD License. + +using System; +using Mosa.DeviceSystem.Disks; +using Mosa.FileSystem.FAT; + +namespace Mosa.BareMetal.CoolWorld.Console.Apps; + +public class ShowFS : IApp +{ + public string Name => "ShowFS"; + + public string Description => "Shows information about partitions and file systems."; + + public void Execute() + { + System.Console.Write("> Finding partitions..."); + var partitions = ConsoleMode.DeviceService.GetDevices(); + System.Console.WriteLine("[Completed: " + partitions.Count + " found]"); + + foreach (var partition in partitions) + { + System.Console.Write(" "); + ConsoleMode.Bullet(ConsoleColor.Yellow); + System.Console.Write(" "); + ConsoleMode.InBrackets(partition.Name, ConsoleColor.White, ConsoleColor.Green); + System.Console.Write(" " + (partition.DeviceDriver as IPartitionDevice).BlockCount + " blocks"); + System.Console.WriteLine(); + } + + System.Console.Write("> Finding file systems..."); + + foreach (var partition in partitions) + { + var fat = new FatFileSystem(partition.DeviceDriver as IPartitionDevice); + if (!fat.IsValid) continue; + + System.Console.WriteLine("Found a FAT file system!"); + + var location = fat.FindEntry("TEST.TXT"); + if (!location.IsValid) continue; + + System.Console.Write("Found test file!"); + + var testStream = new FatFileStream(fat, location); + + System.Console.WriteLine(" - Length: " + (uint)testStream.Length + " bytes"); + System.Console.Write("Reading File: "); + + for (; ; ) + { + var i = testStream.ReadByte(); + + if (i < 0) + break; + + System.Console.Write((char)i); + } + + System.Console.WriteLine(); + } + } +} diff --git a/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowISA.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowISA.cs new file mode 100644 index 0000000000..bfbf78839a --- /dev/null +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowISA.cs @@ -0,0 +1,30 @@ +// Copyright (c) MOSA Project. Licensed under the New BSD License. + +using System; +using Mosa.DeviceSystem.Framework; + +namespace Mosa.BareMetal.CoolWorld.Console.Apps; + +public class ShowISA : IApp +{ + public string Name => "ShowISA"; + + public string Description => "Shows information about ISA devices."; + + public void Execute() + { + System.Console.Write("> Probing for ISA devices..."); + + var isaDevices = ConsoleMode.DeviceService.GetAllDevices(DeviceBusType.ISA); + System.Console.WriteLine("[Completed: " + isaDevices.Count + " found]"); + + foreach (var device in isaDevices) + { + System.Console.Write(" "); + ConsoleMode.Bullet(ConsoleColor.Yellow); + System.Console.Write(" "); + ConsoleMode.InBrackets(device.Name, ConsoleColor.White, ConsoleColor.Green); + System.Console.WriteLine(); + } + } +} diff --git a/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowPCI.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowPCI.cs new file mode 100644 index 0000000000..af94a22de0 --- /dev/null +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/ShowPCI.cs @@ -0,0 +1,34 @@ +// Copyright (c) MOSA Project. Licensed under the New BSD License. + +using System; +using Mosa.DeviceSystem.Framework; +using Mosa.DeviceSystem.PCI; + +namespace Mosa.BareMetal.CoolWorld.Console.Apps; + +public class ShowPCI : IApp +{ + public string Name => "ShowPCI"; + + public string Description => "Shows information about PCI devices."; + + public void Execute() + { + System.Console.Write("> Probing for PCI devices..."); + var devices = ConsoleMode.DeviceService.GetAllDevices(DeviceBusType.PCI); + System.Console.WriteLine("[Completed: " + devices.Count + " found]"); + + foreach (var device in devices) + { + System.Console.Write(" "); + ConsoleMode.Bullet(ConsoleColor.Yellow); + System.Console.Write(" "); + + var pciDevice = (PCIDeviceConfiguration)device.Configuration; + var name = device.DeviceDriverRegistryEntry == null ? "UnknownPCIDevice" : device.Name; + + ConsoleMode.InBrackets(pciDevice.Name + ": " + name + " " + pciDevice.VendorID.ToString("x") + ":" + pciDevice.DeviceID.ToString("x") + " " + pciDevice.SubSystemID.ToString("x") + ":" + pciDevice.SubSystemVendorID.ToString("x") + " (" + pciDevice.ClassCode.ToString("x") + ":" + pciDevice.SubClassCode.ToString("x") + ":" + pciDevice.ProgIF.ToString("x") + ":" + pciDevice.RevisionID.ToString("x") + ")", ConsoleColor.White, ConsoleColor.Green); + System.Console.WriteLine(); + } + } +} diff --git a/Source/Mosa.BareMetal.HelloWorld/Apps/Shutdown.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Shutdown.cs similarity index 81% rename from Source/Mosa.BareMetal.HelloWorld/Apps/Shutdown.cs rename to Source/Mosa.BareMetal.CoolWorld/Console/Apps/Shutdown.cs index 0d12503816..dd006bc4d5 100644 --- a/Source/Mosa.BareMetal.HelloWorld/Apps/Shutdown.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Shutdown.cs @@ -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 Shutdown : IApp { @@ -14,7 +13,7 @@ public class Shutdown : IApp public void Execute() { - Console.WriteLine("Shutting down..."); + System.Console.WriteLine("Shutting down..."); var pc = Kernel.BareMetal.Kernel.ServiceManager.GetFirstService(); pc.Shutdown(); diff --git a/Source/Mosa.BareMetal.HelloWorld/Apps/Time.cs b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Time.cs similarity index 83% rename from Source/Mosa.BareMetal.HelloWorld/Apps/Time.cs rename to Source/Mosa.BareMetal.CoolWorld/Console/Apps/Time.cs index 3329bb08f1..95e9e37fe5 100644 --- a/Source/Mosa.BareMetal.HelloWorld/Apps/Time.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Console/Apps/Time.cs @@ -1,9 +1,8 @@ // Copyright (c) MOSA Project. Licensed under the New BSD License. -using System; using Mosa.Kernel.BareMetal; -namespace Mosa.BareMetal.HelloWorld.Apps; +namespace Mosa.BareMetal.CoolWorld.Console.Apps; public class Time : IApp { @@ -15,8 +14,8 @@ public void Execute() { var time = Platform.GetTime(); - Console.WriteLine("DD/MM/YYYY HH:MM:SS"); - Console.WriteLine( + System.Console.WriteLine("DD/MM/YYYY HH:MM:SS"); + System.Console.WriteLine( (time.Day < 10 ? "0" + time.Day : time.Day) + "/" + (time.Month < 10 ? "0" + time.Month : time.Month) diff --git a/Source/Mosa.BareMetal.CoolWorld/Console/ConsoleMode.cs b/Source/Mosa.BareMetal.CoolWorld/Console/ConsoleMode.cs new file mode 100644 index 0000000000..5d0dc72cf5 --- /dev/null +++ b/Source/Mosa.BareMetal.CoolWorld/Console/ConsoleMode.cs @@ -0,0 +1,61 @@ +// Copyright (c) MOSA Project. Licensed under the New BSD License. + +using System; +using Mosa.DeviceSystem.HardwareAbstraction; +using Mosa.DeviceSystem.Services; +using Mosa.Kernel.BareMetal; +using Mosa.Runtime.Plug; + +namespace Mosa.BareMetal.CoolWorld.Console; + +public static class ConsoleMode +{ + public static DeviceService DeviceService { get; private set; } + + public static void Initialize() + { + Debug.WriteLine("ConsoleMode::Initialize()"); + + DeviceService = Kernel.BareMetal.Kernel.ServiceManager.GetFirstService(); + + System.Console.BackgroundColor = ConsoleColor.Black; + System.Console.ForegroundColor = ConsoleColor.White; + System.Console.Clear(); + + AppManager.Execute("ShowISA"); + AppManager.Execute("ShowPCI"); + AppManager.Execute("ShowDisks"); + AppManager.Execute("ShowFS"); + AppManager.Execute("Shell"); + + System.Console.WriteLine("User has decided to exit out of shell."); + System.Console.WriteLine("Shutting down..."); + + var pcService = Kernel.BareMetal.Kernel.ServiceManager.GetFirstService(); + var success = pcService.Shutdown(); + + if (!success) System.Console.WriteLine("Error while trying to shut down."); + + for (; ; ) HAL.Yield(); + } + + public static void InBrackets(string message, ConsoleColor outerColor, ConsoleColor innerColor) + { + var restore = System.Console.ForegroundColor; + System.Console.ForegroundColor = outerColor; + System.Console.Write("["); + System.Console.ForegroundColor = innerColor; + System.Console.Write(message); + System.Console.ForegroundColor = outerColor; + System.Console.Write("]"); + System.Console.ForegroundColor = restore; + } + + public static void Bullet(ConsoleColor color) + { + var restore = System.Console.ForegroundColor; + System.Console.ForegroundColor = color; + System.Console.Write("*"); + System.Console.ForegroundColor = restore; + } +} diff --git a/Source/Mosa.BareMetal.HelloWorld/IApp.cs b/Source/Mosa.BareMetal.CoolWorld/Console/IApp.cs similarity index 78% rename from Source/Mosa.BareMetal.HelloWorld/IApp.cs rename to Source/Mosa.BareMetal.CoolWorld/Console/IApp.cs index 31c6aa98ff..b90b2c8513 100644 --- a/Source/Mosa.BareMetal.HelloWorld/IApp.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Console/IApp.cs @@ -1,6 +1,6 @@ // Copyright (c) MOSA Project. Licensed under the New BSD License. -namespace Mosa.BareMetal.HelloWorld; +namespace Mosa.BareMetal.CoolWorld.Console; public interface IApp { diff --git a/Source/Mosa.BareMetal.CoolWorld/Apps/Paint.cs b/Source/Mosa.BareMetal.CoolWorld/Graphical/Apps/Paint.cs similarity index 87% rename from Source/Mosa.BareMetal.CoolWorld/Apps/Paint.cs rename to Source/Mosa.BareMetal.CoolWorld/Graphical/Apps/Paint.cs index f68956b177..7b4a6e1cd4 100644 --- a/Source/Mosa.BareMetal.CoolWorld/Apps/Paint.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Graphical/Apps/Paint.cs @@ -1,9 +1,9 @@ // Copyright (c) MOSA Project. Licensed under the New BSD License. using System.Drawing; -using Mosa.BareMetal.CoolWorld.Components; +using Mosa.BareMetal.CoolWorld.Graphical.Components; -namespace Mosa.BareMetal.CoolWorld.Apps; +namespace Mosa.BareMetal.CoolWorld.Graphical.Apps; public class Paint : Window { diff --git a/Source/Mosa.BareMetal.CoolWorld/Apps/Settings.cs b/Source/Mosa.BareMetal.CoolWorld/Graphical/Apps/Settings.cs similarity index 97% rename from Source/Mosa.BareMetal.CoolWorld/Apps/Settings.cs rename to Source/Mosa.BareMetal.CoolWorld/Graphical/Apps/Settings.cs index 00db8a1b38..d1044fa771 100644 --- a/Source/Mosa.BareMetal.CoolWorld/Apps/Settings.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Graphical/Apps/Settings.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using System.Drawing; -using Mosa.BareMetal.CoolWorld.Components; +using Mosa.BareMetal.CoolWorld.Graphical.Components; -namespace Mosa.BareMetal.CoolWorld.Apps; +namespace Mosa.BareMetal.CoolWorld.Graphical.Apps; public class MouseColorBtn : Button { diff --git a/Source/Mosa.BareMetal.CoolWorld/Components/Button.cs b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Button.cs similarity index 97% rename from Source/Mosa.BareMetal.CoolWorld/Components/Button.cs rename to Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Button.cs index dcaca88cec..64fb205025 100644 --- a/Source/Mosa.BareMetal.CoolWorld/Components/Button.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Button.cs @@ -5,7 +5,7 @@ using Mosa.DeviceSystem.Fonts; using Mosa.DeviceSystem.Mouse; -namespace Mosa.BareMetal.CoolWorld.Components; +namespace Mosa.BareMetal.CoolWorld.Graphical.Components; public class Button { diff --git a/Source/Mosa.BareMetal.CoolWorld/Components/Label.cs b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Label.cs similarity index 90% rename from Source/Mosa.BareMetal.CoolWorld/Components/Label.cs rename to Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Label.cs index 58c85e512c..02915ec4be 100644 --- a/Source/Mosa.BareMetal.CoolWorld/Components/Label.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Label.cs @@ -3,7 +3,7 @@ using System.Drawing; using Mosa.DeviceSystem.Fonts; -namespace Mosa.BareMetal.CoolWorld.Components; +namespace Mosa.BareMetal.CoolWorld.Graphical.Components; public class Label { diff --git a/Source/Mosa.BareMetal.CoolWorld/Components/PaintArea.cs b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/PaintArea.cs similarity index 95% rename from Source/Mosa.BareMetal.CoolWorld/Components/PaintArea.cs rename to Source/Mosa.BareMetal.CoolWorld/Graphical/Components/PaintArea.cs index db0e4ba846..7ae2322882 100644 --- a/Source/Mosa.BareMetal.CoolWorld/Components/PaintArea.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/PaintArea.cs @@ -5,7 +5,7 @@ using Mosa.DeviceSystem.HardwareAbstraction; using Mosa.DeviceSystem.Mouse; -namespace Mosa.BareMetal.CoolWorld.Components; +namespace Mosa.BareMetal.CoolWorld.Graphical.Components; public class PaintArea { diff --git a/Source/Mosa.BareMetal.CoolWorld/Components/Taskbar.cs b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Taskbar.cs similarity index 95% rename from Source/Mosa.BareMetal.CoolWorld/Components/Taskbar.cs rename to Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Taskbar.cs index 71468178c7..c9150404f2 100644 --- a/Source/Mosa.BareMetal.CoolWorld/Components/Taskbar.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Taskbar.cs @@ -5,7 +5,7 @@ using System.Drawing; using Mosa.DeviceSystem.Mouse; -namespace Mosa.BareMetal.CoolWorld.Components; +namespace Mosa.BareMetal.CoolWorld.Graphical.Components; public class TaskbarButton : Button { @@ -73,9 +73,9 @@ public void Update() } // Check if taskbar buttons holding a window (each) are clicked - for (var i = 0; i < Program.Taskbar.Buttons.Count; i++) + for (var i = 0; i < Desktop.Taskbar.Buttons.Count; i++) { - var button = Program.Taskbar.Buttons[i]; + var button = Desktop.Taskbar.Buttons[i]; if (button.AttachedWindow == null) continue; diff --git a/Source/Mosa.BareMetal.CoolWorld/Components/TaskbarWindowMenu.cs b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/TaskbarWindowMenu.cs similarity index 96% rename from Source/Mosa.BareMetal.CoolWorld/Components/TaskbarWindowMenu.cs rename to Source/Mosa.BareMetal.CoolWorld/Graphical/Components/TaskbarWindowMenu.cs index 9feecf8189..379753208c 100644 --- a/Source/Mosa.BareMetal.CoolWorld/Components/TaskbarWindowMenu.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/TaskbarWindowMenu.cs @@ -2,7 +2,7 @@ using System.Drawing; -namespace Mosa.BareMetal.CoolWorld.Components; +namespace Mosa.BareMetal.CoolWorld.Graphical.Components; public class TaskbarWindowMenu { diff --git a/Source/Mosa.BareMetal.CoolWorld/Components/Window.cs b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Window.cs similarity index 96% rename from Source/Mosa.BareMetal.CoolWorld/Components/Window.cs rename to Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Window.cs index c5167c23d4..ca18d0280b 100644 --- a/Source/Mosa.BareMetal.CoolWorld/Components/Window.cs +++ b/Source/Mosa.BareMetal.CoolWorld/Graphical/Components/Window.cs @@ -3,7 +3,7 @@ using System.Drawing; using Mosa.DeviceSystem.Mouse; -namespace Mosa.BareMetal.CoolWorld.Components; +namespace Mosa.BareMetal.CoolWorld.Graphical.Components; public class Window { @@ -23,7 +23,7 @@ public class Window public Window(string title, uint x, uint y, uint width, uint height, Color inactiveTitlebarColor, Color activeTitlebarColor, Color bodyColor) { Title = title; - Id = Program.Random.Next(1, int.MaxValue); + Id = Desktop.Random.Next(1, int.MaxValue); X = x; Y = y; diff --git a/Source/Mosa.BareMetal.CoolWorld/Graphical/Desktop.cs b/Source/Mosa.BareMetal.CoolWorld/Graphical/Desktop.cs new file mode 100644 index 0000000000..2aa1e4357b --- /dev/null +++ b/Source/Mosa.BareMetal.CoolWorld/Graphical/Desktop.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using Mosa.BareMetal.CoolWorld.Graphical.Apps; +using Mosa.BareMetal.CoolWorld.Graphical.Components; +using Mosa.DeviceDriver.ISA; +using Mosa.DeviceSystem.Fonts; +using Mosa.DeviceSystem.HardwareAbstraction; +using Mosa.DeviceSystem.Services; +using Mosa.Kernel.BareMetal; + +namespace Mosa.BareMetal.CoolWorld.Graphical; + +public static class Desktop +{ + public static DeviceService DeviceService { get; private set; } + + public static PCService PCService { get; private set; } + + public static Random Random { get; private set; } + + public static Taskbar Taskbar { get; private set; } + + public static void Start() + { + Debug.WriteLine("Desktop::Start()"); + + DeviceService = Kernel.BareMetal.Kernel.ServiceManager.GetFirstService(); + PCService = Kernel.BareMetal.Kernel.ServiceManager.GetFirstService(); + Random = new Random(); + + Display.DefaultFont = Utils.Load(File.ReadAllBytes("font.bin")); + + Utils.Fonts = new List + { + Display.DefaultFont, + Utils.Load(File.ReadAllBytes("font2.bin")) + }; + + if (!Display.Initialize()) HAL.Abort("An error occurred when initializing the graphics driver."); + + Utils.Mouse = DeviceService.GetFirstDevice().DeviceDriver as StandardMouse; + + if (Utils.Mouse == null) HAL.Abort("Mouse not found."); + + Utils.BackColor = Color.Indigo; + Utils.Mouse.SetScreenResolution(Display.Width, Display.Height); + + Mouse.Initialize(); + WindowManager.Initialize(); + + Taskbar = new Taskbar(); + Taskbar.Buttons.Add(new TaskbarButton(Taskbar, "Shutdown", Color.Blue, Color.White, Color.Navy, + () => { Environment.Exit(0); return null; })); + Taskbar.Buttons.Add(new TaskbarButton(Taskbar, "Reset", Color.Blue, Color.White, Color.Navy, + () => { PCService.Reset(); return null; })); + Taskbar.Buttons.Add(new TaskbarButton(Taskbar, "Paint", Color.Coral, Color.White, Color.Red, + () => { WindowManager.Open(new Paint(70, 90, 400, 200, Color.MediumPurple, Color.Purple, Color.White)); return null; })); + Taskbar.Buttons.Add(new TaskbarButton(Taskbar, "Settings", Color.Coral, Color.White, Color.Red, + () => { WindowManager.Open(new Settings(70, 90, 400, 200, Color.MediumPurple, Color.Purple, Color.White)); return null; })); + + for (; ; ) + { + // Get current time + var time = Platform.GetTime(); + + // Clear screen + Display.Clear(Utils.BackColor); + + // Draw MOSA logo + Display.DrawMosaLogo(10); + + // Initialize background labels + var labels = new List