Commit 53b9fe4
authored
Improvements to DosDriveManager (#2161)
* Move CurrentDosDirectory property from VirtualDrive to DosDriveBase and make it optional.
* Added drive letter/index conversion methods to DosDriveManager.
* Replaced internal DosDriveManager.DriveLetters dictionary with new drive letter/index methods.
* Complete rewrite of DosDriveManager internal storage to use a single generic array for all drives instead of a dictionary for each drive type.
Changed dictionary interface of DosDriveManager to use DosDriveBase instead of VirtualDrive.
Added a number of generic methods for mounting, unmounting, and retrieving drives of different types.
Added capability to retrieve drives by drive index as well as by drive letter.
* Added DosDriveManager.TryGetDriveLetterIndex helper method. Changed internal HasDriveAtIndex to use int instead of ushort.
* Fixed problematic use of ElementAtOrDefault when used with DosDriveManager. Applied a few optimizations relating to use of DosDriveManager.
* Renamed some drive letter/index helper methods and parameters.
* Change drive letter in test to unassigned letter Q: because drive letter Z: is assigned by default as a memory drive (it's just not a virtual drive).
* Remove problematic assertions in DosDriveManager (CopyTo methods).
* Fixed DOS FCB manager test ParseFilename_InvalidDrive_ContinuesParsing.
* Fixed drive count in DosDriveManager. Also removed unnecessary DosDriveManager.NumberOfPotentiallyValidDriveLetters property. The drive manager now knows exactly how many drives are mounted.
* Added more documentation to DosDriveManager.
* Removed generic exception handler from DosDriveManager.Clear methods.
* Fixed DOS IOCTL function for IsDeviceRemovable.
AX = media type (0000h removable, 0001h fixed)
* [DOS] Fixed DosDriveManager CopyTo() methods.
DriveLetterCollection and DriveCollection both had a bug which prevented them from enumerating all drive slots. This had resulted in array elements not set when using CopyTo.
* [DOS] Added some DosDriveManager unit tests.
* chore: Removed `#region` directives from DosDriveManager.
Per project maintainer's request.1 parent 067d0d0 commit 53b9fe4
14 files changed
Lines changed: 1142 additions & 141 deletions
File tree
- src/Spice86.Core/Emulator
- InterruptHandlers/Dos
- Mcp
- OperatingSystem
- Structures
- tests/Spice86.Tests/Dos
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 2 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
| 665 | + | |
671 | 666 | | |
672 | 667 | | |
673 | 668 | | |
| |||
1781 | 1776 | | |
1782 | 1777 | | |
1783 | 1778 | | |
1784 | | - | |
1785 | | - | |
| 1779 | + | |
1786 | 1780 | | |
1787 | 1781 | | |
1788 | 1782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
| 1157 | + | |
| 1158 | + | |
1157 | 1159 | | |
1158 | 1160 | | |
1159 | 1161 | | |
| |||
1164 | 1166 | | |
1165 | 1167 | | |
1166 | 1168 | | |
1167 | | - | |
| 1169 | + | |
1168 | 1170 | | |
1169 | 1171 | | |
1170 | 1172 | | |
| |||
1238 | 1240 | | |
1239 | 1241 | | |
1240 | 1242 | | |
1241 | | - | |
| 1243 | + | |
1242 | 1244 | | |
1243 | 1245 | | |
1244 | 1246 | | |
| |||
1524 | 1526 | | |
1525 | 1527 | | |
1526 | 1528 | | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
1533 | 1533 | | |
1534 | 1534 | | |
1535 | 1535 | | |
| |||
0 commit comments