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

Refactor Mosa.DeviceSystem (part 1) #1190

Merged
merged 5 commits into from
Feb 25, 2024
Merged

Conversation

AnErrupTion
Copy link
Member

@AnErrupTion AnErrupTion commented Feb 22, 2024

This series of PRs aims to refactor parts of the code base with the primary goal of making them easier to understand. Here are the most notable changes in part 1 of refactoring Mosa.DeviceSystem (and parts of Mosa.DeviceDriver):

  • Throughout all refactored files, pointless XML comments have been removed, and per-class comments have been added, giving more useful insight into what the class is, and does. This allow for better general understanding of the code.
  • Added useful properties in the EditorConfig file, and removed unused ones
  • The StandardKeyboard driver (and the IKeyboardDevice interface) are now able to be requested scan codes via blocking and non-blocking ways. (Previously, it was only non-blocking, which could cause some issues in e.g. console environments)
  • The _lock field in BaseDeviceDriver has been renamed to DriverLock
  • GraphicalTextDevice's (and thus, ITextDevice's) ClearScreen() method was renamed to Clear()
  • The following, unused classes and interfaces have been removed (NOTE: Many files appear as deleted in Git, when in fact they were simply moved. Please refer to this list which is exhaustive.):
    • IAudioDevice (unused, we have no audio subsystem yet)
    • IDMAChannel (unused + uninherited)
    • IDateTime (unused + uninherited)
    • IMultibootSpecification (unused + uninherited)
    • INetworkDevice (unused, we have no network subsystem yet)
    • IOPortResources (unused)
    • IPixelPaletteGraphicsDevice (unused)
    • ISerialDevice (unused + uninherited)
    • ITextScreen (it was only inherited by TextScreen, and there was no need for it even then)
    • ITimer (unused + uninherited)
    • MACAddress (same as INetworkDevice)
    • MemoryResources (unused)
    • IPCIDevice (it was only inherited by PCIDevice)
    • IPCIDeviceResource (same as IPCIDevice + it provided properties and methods that IPCIDevice already had)
    • SpinLock (unused)
  • Mosa.DeviceSystem has been partly restructured (not finished yet, which is mostly the sole reason why this PR has been split into multiple parts). They contain the following classes and interfaces thus far:
    • Graphics
      • FrameBuffer32
      • IGraphicsDevice
    • Keyboard
      • IKeyboard
      • Key
      • KeyEvent
      • KeyType
      • Keyboard
      • IKeyboardDevice
      • IScanCodeMap
    • TextDevice
      • GraphicalTextDevicec
      • ITextDevice
      • TextScreen
    • PCI
      • IPCIController
      • IPCIControllerLegacy
    • VirtIO (nothing has changed there)
    • Fonts
      • ASC16Font
      • ISimpleFont
      • SimpleBitFont
    • Services (nothing has changed there either, apart from the name which previously was Service)

@AnErrupTion AnErrupTion self-assigned this Feb 22, 2024
Source/.editorconfig Show resolved Hide resolved
Source/.editorconfig Show resolved Hide resolved
Source/Mosa.BareMetal.CoolWorld/Display.cs Outdated Show resolved Hide resolved
Source/Mosa.DeviceDriver/PCI/VMware/VMwareSVGA2.cs Outdated Show resolved Hide resolved
Source/Mosa.DeviceDriver/ScanCodeMap/HU.cs Outdated Show resolved Hide resolved
Source/Mosa.DeviceSystem/PCI/PCIDevice.cs Outdated Show resolved Hide resolved
Source/Mosa.DeviceSystem/PCI/PCIDevice.cs Outdated Show resolved Hide resolved
Source/Mosa.DeviceSystem/Services/DiskDeviceService.cs Outdated Show resolved Hide resolved
Source/Mosa.DeviceSystem/Services/PCService.cs Outdated Show resolved Hide resolved
Source/.editorconfig Show resolved Hide resolved
@tgiphil tgiphil self-requested a review February 23, 2024 03:53
Source/.editorconfig Show resolved Hide resolved
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 merged commit fd21b83 into mosa:master Feb 25, 2024
66 checks passed
@AnErrupTion AnErrupTion deleted the refactor-1 branch March 9, 2024 08:50
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