Skip to content

Commit

Permalink
- WIP (#1082)
Browse files Browse the repository at this point in the history
* - WIP

* - WIP

* - WIP

* - WIP

* - WIP

* - WIP

* - WIP

* - BareMetal
  • Loading branch information
tgiphil committed Jul 12, 2023
1 parent 60d0535 commit d1d059a
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
run: dotnet restore Source/Mosa.sln
- name: Build
run: dotnet build Source/Mosa.sln /p:Version=${{ env.BUILD_VERSION }}
- name: Cleanup
run: cmd.exe /C "rmdir /s /q bin\reko bin\cs bin\de bin\es bin\fr bin\it bin\ja bin\ko bin\pl bin\pt-BR bin\ru bin\tr bin\zh-Hans bin\zh-Hant"
- name: Store Build Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion Source/Docs/command-line-arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Below are the command line arguments available:
-memory,Emulator.Memory
-gdb,Emulator.GDB,true
-term,Emulator.MaxRuntime,{value}
-debug,Launcher.Serial.Connection,true
-debug,Launcher.Serial,true

Launcher - Emulator - Qemu & VMWare:
-vmware-svga,Emulator.SVGA,vmware
Expand Down
3 changes: 1 addition & 2 deletions Source/Docs/settings-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ Launcher Settings
Launcher.Exit,"If true, exit immediately after launch"
Launcher.PlugKorlib,"If true, automatically include the plugs for CoreLib"
Launcher.GDB,"If true, launch the GNU GDB application after VM launch"
Launcher.Serial.Connection,"If true, outout the serial to console"
Launcher.Serial.File,Filename to emit serial output (future)
Launcher.Serial,"If true, outputs the serial data"
Launcher.Debugger,"If true, launch the MOSA debugger application after VM launch"
Launcher.Test,"If true, monitors VM serial for success or failure messages"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.analyzers" Version="1.1.0" />
<PackageReference Include="xunit.assert" Version="2.4.2" />
<PackageReference Include="xunit.core" Version="2.4.2" />
<PackageReference Include="xunit.extensibility.core" Version="2.4.2" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.2" />
<PackageReference Include="xunit.runner.console" Version="2.4.2">
<PackageReference Include="xunit.analyzers" Version="1.2.0" />
<PackageReference Include="xunit.assert" Version="2.5.0" />
<PackageReference Include="xunit.core" Version="2.5.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.5.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.5.0" />
<PackageReference Include="xunit.runner.console" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
10 changes: 10 additions & 0 deletions Source/Mosa.Demo.TestWorld.x86/Boot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,14 @@ public static bool Test5()
{
return Mosa.UnitTests.Basic.ArrayLayoutTests.I8a();
}

public static string str = null!;

#nullable enable

public static void TestNullable()
{
str = "Hello!";
Screen.WriteLine(str);
}
}
4 changes: 2 additions & 2 deletions Source/Mosa.Kernel.BareMetal.x86/PlatformPlug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public static void EntryPoint()
public static PlatformArchitecture GetPlatformArchitecture() => PlatformArchitecture.X86;

[Plug("Mosa.Kernel.BareMetal.Platform::ConsoleWrite")]
public static void ConsoleWrite(byte c) => VGAConsole.Write(c);
public static void ConsoleWrite(byte c) => x86.VGAConsole.Write(c);

[Plug("Mosa.Kernel.BareMetal.Platform::DebugWrite")]
public static void DebugWrite(byte c) => SerialDebug.Write(c);
public static void DebugWrite(byte c) => x86.SerialDebug.Write(c);

public static class PageTablePlug
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Mosa.Tool.Debugger/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private void SetDefaultSettings()
private void SetRequiredSettings()
{
MosaSettings.EmulatorGDB = true;
MosaSettings.LauncherSerialConnection = true;
MosaSettings.LauncherSerial = true;
MosaSettings.LauncherExit = false;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Mosa.Utility.Configuration/CommandLineArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private static List<Argument> GetMap()
new Argument { Name = "-launch-gdb", Setting = "Launcher.GDB", Value="true"},
new Argument { Name = "-launch-debugger", Setting = "Launcher.Debugger", Value="true"},

new Argument { Name = "-output-serial-console", Setting = "Launcher.Serial.Connection"},
new Argument { Name = "-output-serial-connection", Setting = "Launcher.Serial.Connection"},
new Argument { Name = "-output-serial-file", Setting = "Launcher.Serial.File"},
new Argument { Name = "-debug", Setting = "Launcher.Serial.Connection", Value="true"},

Expand Down
12 changes: 3 additions & 9 deletions Source/Mosa.Utility.Configuration/MOSASettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,10 @@ public bool LauncherTest
set => Settings.SetValue(Name.Launcher_Test, value);
}

public bool LauncherSerialConnection
public bool LauncherSerial
{
get => Settings.GetValue(Name.Launcher_Serial_Connection, false);
set => Settings.SetValue(Name.Launcher_Serial_Connection, value);
}

public bool LauncherSerialFile
{
get => Settings.GetValue(Name.Launcher_Serial_File, false);
set => Settings.SetValue(Name.Launcher_Serial_File, value);
get => Settings.GetValue(Name.Launcher_Serial, false);
set => Settings.SetValue(Name.Launcher_Serial, value);
}

public int EmulatorMaxRuntime
Expand Down
3 changes: 1 addition & 2 deletions Source/Mosa.Utility.Configuration/Name.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ public static class Name
public const string Launcher_GDB = "Launcher.GDB";
public const string Launcher_Launch = "Launcher.Launch";
public const string Launcher_PlugKorlib = "Launcher.PlugKorlib";
public const string Launcher_Serial_Connection = "Launcher.Serial.Connection";
public const string Launcher_Serial_File = "Launcher.Serial.File";
public const string Launcher_Serial = "Launcher.Serial";
public const string Launcher_Start = "Launcher.Start";
public const string Launcher_Test = "Launcher.Test";
public const string Linker_Dwarf = "Linker.Dwarf";
Expand Down
4 changes: 2 additions & 2 deletions Source/Mosa.Utility.Launcher/Starter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public bool Launch(bool waitForExit = false)
return IsSucccessful;
}

if (MosaSettings.LauncherSerialConnection)
if (MosaSettings.LauncherSerial)
{
IsSucccessful = StartDebug(Process);
return IsSucccessful;
Expand Down Expand Up @@ -283,7 +283,7 @@ private Process LaunchQemu()

var serial = MosaSettings.EmulatorSerial;

if (MosaSettings.LauncherSerialConnection || MosaSettings.LauncherTest)
if (MosaSettings.LauncherSerial || MosaSettings.LauncherTest)
{
serial = "tcpserver";
}
Expand Down

0 comments on commit d1d059a

Please sign in to comment.