Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mosa.Utility.Launcher: bug fixes and behavioral changes #1217

Merged
merged 5 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Demos/Console/Run-BareMetal.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 -vmware-svga -include Include Mosa.BareMetal.CoolWorld.x86.dll
3 changes: 3 additions & 0 deletions Demos/Console/Run-BareMetal.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 -vmware-svga -include Include Mosa.BareMetal.CoolWorld.x86.dll
3 changes: 3 additions & 0 deletions Demos/Console/Run-BareMetal.HelloWorld.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 Mosa.BareMetal.HelloWorld.x86.dll
3 changes: 3 additions & 0 deletions Demos/Console/Run-BareMetal.HelloWorld.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 Mosa.BareMetal.HelloWorld.x86.dll
3 changes: 3 additions & 0 deletions Demos/Console/Run-BareMetal.Starter.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 Mosa.BareMetal.Starter.x86.dll
4 changes: 4 additions & 0 deletions Demos/Console/Run-BareMetal.Starter.x86.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.Starter.x86.dll

3 changes: 3 additions & 0 deletions Demos/Console/Run-BareMetal.TestWorld.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 Mosa.BareMetal.TestWorld.x86.dll
4 changes: 4 additions & 0 deletions Demos/Console/Run-BareMetal.TestWorld.x86.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.TestWorld.x86.dll

4 changes: 4 additions & 0 deletions Demos/Console/Run-VMware-BareMetal.CoolWorld.x86.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd %~dp0
cd ..\bin
Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash -include Include -vmware -vmdk Mosa.BareMetal.CoolWorld.x86.dll

3 changes: 3 additions & 0 deletions Demos/Console/Run-VMware-BareMetal.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 -vmware -vmdk -include Include Mosa.BareMetal.CoolWorld.x86.dll
3 changes: 3 additions & 0 deletions Demos/Console/Run-VirtualBox-BareMetal.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 -include Include -virtualbox -vdi Mosa.BareMetal.CoolWorld.x86.dll
3 changes: 3 additions & 0 deletions Demos/Console/Run-VirtualBox-BareMetal.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 -virtualbox -vdi -include Include Mosa.BareMetal.CoolWorld.x86.dll
2 changes: 1 addition & 1 deletion Demos/Run-BareMetal.CoolWorld.x86.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash -vmware-svga -include Include Mosa.BareMetal.CoolWorld.x86.dll
AnErrupTion marked this conversation as resolved.
Show resolved Hide resolved
./Mosa.Tool.Launcher -autostart -oMax -output-asm -output-debug -output-hash -vmware-svga -include Include Mosa.BareMetal.CoolWorld.x86.dll
2 changes: 1 addition & 1 deletion Demos/Run-BareMetal.HelloWorld.x86.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.HelloWorld.x86.dll
./Mosa.Tool.Launcher -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.HelloWorld.x86.dll
2 changes: 1 addition & 1 deletion Demos/Run-BareMetal.Starter.x86.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.Starter.x86.dll
./Mosa.Tool.Launcher -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.Starter.x86.dll

2 changes: 1 addition & 1 deletion Demos/Run-BareMetal.TestWorld.x86.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.TestWorld.x86.dll
./Mosa.Tool.Launcher -autostart -oMax -output-asm -output-debug -output-hash Mosa.BareMetal.TestWorld.x86.dll

2 changes: 1 addition & 1 deletion Demos/Run-VMware-BareMetal.CoolWorld.x86.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash -vmware -vmdk -include Include Mosa.BareMetal.CoolWorld.x86.dll
./Mosa.Tool.Launcher -autostart -oMax -output-asm -output-debug -output-hash -vmware -vmdk -include Include Mosa.BareMetal.CoolWorld.x86.dll
2 changes: 1 addition & 1 deletion Demos/Run-VirtualBox-BareMetal.CoolWorld.x86.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cd ../bin
./Mosa.Tool.Launcher.Console -autostart -oMax -output-asm -output-debug -output-hash -virtualbox -vdi -include Include Mosa.BareMetal.CoolWorld.x86.dll
./Mosa.Tool.Launcher -autostart -oMax -output-asm -output-debug -output-hash -virtualbox -vdi -include Include Mosa.BareMetal.CoolWorld.x86.dll
7 changes: 4 additions & 3 deletions Source/Docs/command-line-arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@ Below are the command line arguments available:
-timeout,Emulator.MaxRuntime,{value}
-debug,Launcher.Serial,true
-debug,OS.BootOptions,bootoptions=serialdebug

-acceleration,Emulator.Acceleration,true

Launcher - Emulator - Qemu & VMWare:
-vmware-svga,Emulator.SVGA,vmware
-virtio-vga,Emulator.SVGA,virtio
-vmware-svga,Emulator.Graphics,vmware
-virtio-vga,Emulator.Graphics,virtio

Launcher - Image:
-image,Image.ImageFile,{value}
Expand Down
5 changes: 4 additions & 1 deletion Source/Docs/settings-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,14 @@ Emulator Settings
Emulator,"Type of Emulator QEMU, VMware, Bochs"
Emulator.Memory,Amount of memory for the virtual machine in MB
Emulator.Display,"If true, show the video display"
Emulator.SVGA,"SVGA mode: std, cirrus, vbe, virtio or vmware"
Emulator.Graphics,"Graphics device: std, cirrus, vbe, virtio or vmware"
Emulator.MaxRuntime,Maximum runtime of the virtual machine in seconds (future)
Emulator.GDB,"If true, enables GDB within emulator"
Emulator.Serial,"Serial Emulation type None, Pipe, TCPServer, TCPClient"
Emulator.Serial.Host,Serial Host Name or IP address
Emulator.Serial.Port,Serial Port
Emulator.Serial.Pipe,Serial Pipename
Emulator.Acceleration,Enables CPU hardware acceleration on the emulator, if available

GDB Settings
------------
Expand Down Expand Up @@ -202,6 +203,8 @@ Application Location Settings
:widths: 50, 200

AppLocation.Bochs,Location of the BOCHS application
AppLocation.Bochs.BIOS,Location of the BOCHS BIOS
AppLocation.Bochs.VGABIOS,Location of the BOCHS VGA BIOS
AppLocation.QemuX86,Location of the QEMU application for x86 (i386)
AppLocation.QemuX64,Location of the QEMU application for x64
AppLocation.QemuARM32,Location of the QEMU application for ARM32
Expand Down
4 changes: 4 additions & 0 deletions Source/Mosa.Tool.Launcher/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@
<Label FontSize="14" Name="qemuImgPathLbl" Margin="165, -23, 0, 0">No path specified</Label>
<Label FontSize="14">Bochs:</Label>
<Label FontSize="14" Name="bochsPathLbl" Margin="165, -23, 0, 0">No path specified</Label>
<Label FontSize="14">Bochs BIOS:</Label>
<Label FontSize="14" Name="bochsBiosPathLbl" Margin="165, -23, 0, 0">No path specified</Label>
<Label FontSize="14">Bochs VGA BIOS:</Label>
<Label FontSize="14" Name="bochsVgaBiosPathLbl" Margin="165, -23, 0, 0">No path specified</Label>
<Label FontSize="14">VMWare:</Label>
<Label FontSize="14" Name="vmwarePathLbl" Margin="165, -23, 0, 0">No path specified</Label>
<Label FontSize="14">VirtualBox:</Label>
Expand Down
2 changes: 2 additions & 0 deletions Source/Mosa.Tool.Launcher/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ private void UpdateInterfaceAppLocations()
qemuEdk2ARMPathLbl.Content = MosaSettings.QemuEdk2ARM32;
qemuImgPathLbl.Content = MosaSettings.QemuImgApp;
bochsPathLbl.Content = MosaSettings.BochsApp;
bochsBiosPathLbl.Content = MosaSettings.BochsBIOS;
bochsVgaBiosPathLbl.Content = MosaSettings.BochsVGABIOS;
vmwarePathLbl.Content = string.IsNullOrEmpty(MosaSettings.VmwarePlayerApp) ? MosaSettings.VmwareWorkstationApp : MosaSettings.VmwarePlayerApp;
vboxPathLbl.Content = MosaSettings.VirtualBoxApp;
mkisofsPathLbl.Content = MosaSettings.MkisofsApp;
Expand Down
60 changes: 60 additions & 0 deletions Source/Mosa.Utility.Configuration/AppLocationsSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public static void GetAppLocations(MosaSettings mosaSettings)
mosaSettings.QemuEdk2ARM64 = FindQemuEDK2ARM64();
mosaSettings.QemuImgApp = FindQemuImg();
mosaSettings.BochsApp = FindBochs();
mosaSettings.BochsBIOS = FindBochsBIOS();
mosaSettings.BochsVGABIOS = FindBochsVGABIOS();
mosaSettings.VmwarePlayerApp = FindVmwarePlayer();
mosaSettings.VmwareWorkstationApp = FindVmwareWorkstation();
mosaSettings.VirtualBoxApp = FindVirtualBox();
Expand Down Expand Up @@ -227,6 +229,64 @@ private static string FindBochs()
: TryFind("bochs", LinuxDirectories);
}

private static string FindBochsBIOS()
{
return
IsWindows ? TryFind("BIOS-bochs-latest",
new string[] {
@"%ProgramFiles%\Bochs-2.6.9",
@"%ProgramFiles(x86)%\Bochs-2.6.9",
@"%ProgramFiles%\Bochs-2.6.8",
@"%ProgramFiles(x86)%\Bochs-2.6.8",
@"%ProgramFiles%\Bochs-2.6.5",
@"%ProgramFiles(x86)%\Bochs-2.6.5",
@"%ProgramFiles%\Bochs-2.6.2",
@"%ProgramFiles(x86)%\Bochs-2.6.2",
@"%ProgramFiles%\Bochs-2.7",
@"%ProgramFiles(x86)%\Bochs-2.7",

@"%CURRENT%\..\Tools\Bochs",
@"%CURRENT%\Tools\Bochs",

@"%APPDIR%\Tools\Bochs",
@"%APPDIR%\..\Tools\Bochs"
})
: TryFind("BIOS-bochs-latest",
new string[] {
"/usr/share/bochs",
"/opt/homebrew/share/bochs/"
});
}

private static string FindBochsVGABIOS()
{
return
IsWindows ? TryFind("VGABIOS-lgpl-latest",
new string[] {
@"%ProgramFiles%\Bochs-2.6.9",
@"%ProgramFiles(x86)%\Bochs-2.6.9",
@"%ProgramFiles%\Bochs-2.6.8",
@"%ProgramFiles(x86)%\Bochs-2.6.8",
@"%ProgramFiles%\Bochs-2.6.5",
@"%ProgramFiles(x86)%\Bochs-2.6.5",
@"%ProgramFiles%\Bochs-2.6.2",
@"%ProgramFiles(x86)%\Bochs-2.6.2",
@"%ProgramFiles%\Bochs-2.7",
@"%ProgramFiles(x86)%\Bochs-2.7",

@"%CURRENT%\..\Tools\Bochs",
@"%CURRENT%\Tools\Bochs",

@"%APPDIR%\Tools\Bochs",
@"%APPDIR%\..\Tools\Bochs"
})
: TryFind("VGABIOS-lgpl-latest",
new string[] {
"/usr/share/bochs",
"/opt/homebrew/share/bochs/"
});
}

private static string FindQemuImg()
{
return
Expand Down
6 changes: 4 additions & 2 deletions Source/Mosa.Utility.Configuration/CommandLineArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ private static List<Argument> GetMap()
new Argument { Name = "-video-width", Setting = Name.Multiboot_Video_Width},
new Argument { Name = "-video-height", Setting = Name.Multiboot_Video_Height},

new Argument { Name = "-vmware-svga", Setting = Name.Emulator_SVGA, Value = "vmware"},
new Argument { Name = "-virtio-vga", Setting = Name.Emulator_SVGA, Value = "virtio"},
new Argument { Name = "-vmware-svga", Setting = Name.Emulator_Graphics, Value = "vmware"},
new Argument { Name = "-virtio-vga", Setting = Name.Emulator_Graphics, Value = "virtio"},

new Argument { Name = "-acceleration", Setting = Name.Emulator_Acceleration, Value = "true"},

new Argument { Name = "-gdb-port", Setting = Name.GDB_Port},
new Argument { Name = "-gdb-host", Setting = Name.GDB_Host},
Expand Down
24 changes: 21 additions & 3 deletions Source/Mosa.Utility.Configuration/MOSASettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ public string BochsApp
set => Settings.SetValue(Name.AppLocation_Bochs, value);
}

public string BochsBIOS
{
get => Settings.GetValue(Name.AppLocation_Bochs_BIOS, null);
set => Settings.SetValue(Name.AppLocation_Bochs_BIOS, value);
}

public string BochsVGABIOS
{
get => Settings.GetValue(Name.AppLocation_Bochs_VGABIOS, null);
set => Settings.SetValue(Name.AppLocation_Bochs_VGABIOS, value);
}

public string CompileTimeFile
{
get => Settings.GetValue(Name.CompilerDebug_CompileTimeFile, null);
Expand Down Expand Up @@ -121,10 +133,10 @@ public string EmulatorSerial
set => Settings.SetValue(Name.Emulator_Serial, value);
}

public string EmulatorSVGA
public string EmulatorGraphics
{
get => Settings.GetValue(Name.Emulator_SVGA, "std");
set => Settings.SetValue(Name.Emulator_SVGA, value);
get => Settings.GetValue(Name.Emulator_Graphics, "std");
set => Settings.SetValue(Name.Emulator_Graphics, value);
}

public string EmulatorSerialHost
Expand All @@ -145,6 +157,12 @@ public ushort EmulatorSerialPort
set => Settings.SetValue(Name.Emulator_Serial_Port, value);
}

public bool EmulatorAcceleration
{
get => Settings.GetValue(Name.Emulator_Acceleration, false);
set => Settings.SetValue(Name.Emulator_Acceleration, value);
}

public string FileSystem
{
get => Settings.GetValue(Name.Image_FileSystem, null);
Expand Down
5 changes: 4 additions & 1 deletion Source/Mosa.Utility.Configuration/Name.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ namespace Mosa.Utility.Configuration;
public static class Name
{
public const string AppLocation_Bochs = "AppLocation.Bochs";
public const string AppLocation_Bochs_BIOS = "AppLocation.Bochs.BIOS";
AnErrupTion marked this conversation as resolved.
Show resolved Hide resolved
public const string AppLocation_Bochs_VGABIOS = "AppLocation.Bochs.VGABIOS";
public const string AppLocation_GDB = "AppLocation.GDB";
public const string AppLocation_Mkisofs = "AppLocation.Mkisofs";
public const string AppLocation_Ndisasm = "AppLocation.Ndisasm";
Expand Down Expand Up @@ -60,8 +62,9 @@ public static class Name
public const string Emulator_Serial_Host = "Emulator.Serial.Host";
public const string Emulator_Serial_Pipe = "Emulator.Serial.Pipe";
public const string Emulator_Serial_Port = "Emulator.Serial.Port";
public const string Emulator_Graphics = "Emulator.Graphics";
AnErrupTion marked this conversation as resolved.
Show resolved Hide resolved
public const string Emulator_Acceleration = "Emulator.Acceleration";
AnErrupTion marked this conversation as resolved.
Show resolved Hide resolved

public const string Emulator_SVGA = "Emulator.SVGA";
public const string Explorer_DebugDiagnostic = "Explorer.DebugDiagnostic";
public const string Explorer_Filter = "Explorer.Filter";
public const string Explorer_Start = "Explorer.Start";
Expand Down
Loading
Loading