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

Conversation

AnErrupTion
Copy link
Member

@AnErrupTion AnErrupTion commented Apr 12, 2024

Hi! This PR focuses on bug fixes and general behavioral changes around Mosa.Utility.Launcher, alongside a few minor features. Here's what been changed:

  • On Linux, the GUI launcher is used in the script files in the Demos folder instead of the console launcher
  • Added a Demos/Console directory which contains scripts that use the console launcher instead of the GUI one
  • In Mosa.Utility.Configuration:
    • Added new app locations for Bochs' BIOS and VGA BIOS. This is because, on Linux, the launch code would try to get the files under /bin, which is simply incorrect
    • The setting Emulator.SVGA has been renamed to Emulator.Graphics
    • Added a new setting Emulator.Acceleration, which currently enables hardware acceleration (WHPX on Windows, HVF on macOS, and KVM on Linux) for QEMU
  • In Mosa.Utility.Launcher:
    • Removed the BaseLauncher.Quote() method. Instead, string interpolation is used at all times and when instead a StringBuilder is present, strings are appended directly to it instead of concatenation to decrease any potential memory allocations
    • Removed the BaseLauncher.NullOrEmpty() method because it was only used once, and it was trivial to implement anyway
    • The BaseLauncher.GetResource(string) method now throws if a manifest resource isn't found
    • In the Builder.Build() method, the Stopwatch.Start() method is called instead of Stopwatch.StartNew() because else it wouldn't start the instantiated Stopwatch, but instead it'd create a new one and discard it immediately
    • The Builder.Build() method no longer checks if MosaSettings.TemporaryFolder and MosaSettings.ImageFolder exist before creating them, because Directory.CreateDirectory() already does that. Furthermore, it'll create any subdirectories, removing the need for creating MosaSettings.TemporaryFolder
    • In the SimpleTCP class, incrementations and decrementations of the volatile lines field have been replaced with Interlocked.Increment() and Interlocked.Decrement() respectively
    • The Starter.IsSucccessful property has been renamed to Starter.IsSuccessful
    • In the Starter class, the lockObject field has been introduced to avoid locking using this

@AnErrupTion AnErrupTion self-assigned this Apr 12, 2024
Demos/Run-BareMetal.CoolWorld.x86.bat Outdated Show resolved Hide resolved
@AnErrupTion AnErrupTion requested a review from tgiphil April 13, 2024 18:43
Demos/Run-BareMetal.CoolWorld.x86.sh Show resolved Hide resolved
Signed-off-by: AnErrupTion <[email protected]>
@AnErrupTion AnErrupTion requested a review from tgiphil April 17, 2024 22:00
Copy link
Member

@charsleysa charsleysa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@charsleysa charsleysa dismissed tgiphil’s stale review April 20, 2024 04:57

Comments fixed

@charsleysa
Copy link
Member

@AnErrupTion please update branch with latest master

@AnErrupTion AnErrupTion merged commit 00fdf6a into mosa:master Apr 20, 2024
67 checks passed
@AnErrupTion AnErrupTion deleted the launcher-improvements branch April 20, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants