-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[FREELDR] Perform disk geometry fixups for "enhanced" removable drives #8401
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
Draft
HBelusca
wants to merge
2
commits into
reactos:master
Choose a base branch
from
HBelusca:freeldr_extint13_removable_geometry_fixup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[FREELDR] Perform disk geometry fixups for "enhanced" removable drives #8401
HBelusca
wants to merge
2
commits into
reactos:master
from
HBelusca:freeldr_extint13_removable_geometry_fixup
+308
−6
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HBelusca
added a commit
to HBelusca/reactos
that referenced
this pull request
Sep 26, 2025
reactos#8401) For example, ATAPI devices like CD-ROMs, detected as such by the BIOS INT 13h extensions. The motivation is that some hardware would report unusable geometry (number of sectors) for such devices, for example: - VBOX returns CHS=(-1)/(-1)/(-1) and total sectors = 0xFFFFFFFF`FFFFFFFF; - Dell Latitude D531 BIOS claims that the drive is *NOT* removable (although is an ATAPI device), returns a hardcoded CHS=680/64/32, and total sectors = 348160 for 2048 bytes per sectors, corresponding to a fixed 680 MiB disk. All this, even though a CD-ROM is present and may contain much less data. In order to fix these problems, we always report a drive as being removable *IF* it is detected as an ATAPI device by the INT 13h,AH=48h "Get drive parameters" function. In that case also, we redetermine a suitable geometry. First we assume the drive may be a CD-ROM, and attempt to read the ISO-9660 volume size from its ISO Primary Volume Descriptor, if any. If none is found, we fall back to size detection by bisecting over valid and invalid sectors.
4c7864d
to
fd9e637
Compare
1 task
Cc @disean too for review. |
Switching PR to draft because of a change of design being done. |
HBelusca
added a commit
to HBelusca/reactos
that referenced
this pull request
Sep 29, 2025
reactos#8401) For example, ATAPI devices like CD-ROMs, detected as such by the BIOS INT 13h extensions. The motivation is that some hardware would report unusable geometry (number of sectors) for such devices, for example: - VBOX returns CHS=(-1)/(-1)/(-1) and total sectors = 0xFFFFFFFF`FFFFFFFF; - Dell Latitude D531 BIOS claims that the drive is *NOT* removable (although is an ATAPI device), returns a hardcoded CHS=680/64/32, and total sectors = 348160 for 2048 bytes per sectors, corresponding to a fixed 680 MiB disk. All this, even though a CD-ROM is present and may contain much less data. In order to fix these problems, we always report a drive as being removable *IF* it is detected as an ATAPI device by the INT 13h,AH=48h "Get drive parameters" function. In that case also, we redetermine a suitable geometry. First we assume the drive may be a CD-ROM, and attempt to read the ISO-9660 volume size from its ISO Primary Volume Descriptor, if any. If none is found, we fall back to size detection by bisecting over valid and invalid sectors.
000be17
to
d4f35e6
Compare
HBelusca
added a commit
to HBelusca/reactos
that referenced
this pull request
Oct 4, 2025
reactos#8401) For example, ATAPI devices like CD-ROMs, detected as such by the BIOS INT 13h extensions. The motivation is that some hardware would report unusable geometry (number of sectors) for such devices, for example: - VBOX returns CHS=(-1)/(-1)/(-1) and total sectors = 0xFFFFFFFF`FFFFFFFF; - Dell Latitude D531 BIOS claims that the drive is *NOT* removable (although is an ATAPI device), returns a hardcoded CHS=680/64/32, and total sectors = 348160 for 2048 bytes per sectors, corresponding to a fixed 680 MiB disk. All this, even though a CD-ROM is present and may contain much less data. In order to fix these problems, we always report a drive as being removable *IF* it is detected as an ATAPI device by the INT 13h,AH=48h "Get drive parameters" function. In that case also, we redetermine a suitable geometry, by bisecting over valid and invalid sectors.
d4f35e6
to
45f0b66
Compare
HBelusca
added a commit
to HBelusca/reactos
that referenced
this pull request
Oct 4, 2025
reactos#8401) For example, ATAPI devices like CD-ROMs, detected as such by the BIOS INT 13h extensions. The motivation is that some hardware would report unusable geometry (number of sectors) for such devices, for example: - VBOX returns CHS=(-1)/(-1)/(-1) and total sectors = 0xFFFFFFFF`FFFFFFFF; - Dell Latitude D531 BIOS claims that the drive is *NOT* removable (although is an ATAPI device), returns a hardcoded CHS=680/64/32, and total sectors = 348160 for 2048 bytes per sectors, corresponding to a fixed 680 MiB disk. All this, even though a CD-ROM is present and may contain much less data. In order to fix these problems, we always report a drive as being removable *IF* it is detected as an ATAPI device by the INT 13h,AH=48h "Get drive parameters" function. In that case also, we redetermine a suitable geometry, by bisecting over valid and invalid sectors.
45f0b66
to
7f90cb8
Compare
HBelusca
added a commit
to HBelusca/reactos
that referenced
this pull request
Oct 5, 2025
reactos#8401) For example, ATAPI devices like CD-ROMs, detected as such by the BIOS INT 13h extensions. The motivation is that some hardware would report unusable geometry (number of sectors) for such devices, for example: - VBOX returns CHS=(-1)/(-1)/(-1) and total sectors = 0xFFFFFFFF`FFFFFFFF; - Dell Latitude D531 BIOS claims that the drive is *NOT* removable (although is an ATAPI device), returns a hardcoded CHS=680/64/32, and total sectors = 348160 for 2048 bytes per sectors, corresponding to a fixed 680 MiB disk. All this, even though a CD-ROM is present and may contain much less data. In order to fix these problems, we always report a drive as being removable *IF* it is detected as an ATAPI device by the INT 13h,AH=48h "Get drive parameters" function. In that case also, we redetermine a suitable geometry, by bisecting over valid and invalid sectors.
7f90cb8
to
e41a65f
Compare
HBelusca
added a commit
to HBelusca/reactos
that referenced
this pull request
Oct 6, 2025
reactos#8401) For example, ATAPI devices like CD-ROMs, detected as such by the BIOS INT 13h extensions. The motivation is that some hardware would report unusable geometry (number of sectors) for such devices, for example: - VBOX returns CHS=(-1)/(-1)/(-1) and total sectors = 0xFFFFFFFF`FFFFFFFF; - Dell Latitude D531 BIOS claims that the drive is *NOT* removable (although is an ATAPI device), returns a hardcoded CHS=680/64/32, and total sectors = 348160 for 2048 bytes per sectors, corresponding to a fixed 680 MiB disk. All this, even though a CD-ROM is present and may contain much less data. In order to fix these problems, we always report a drive as being removable *IF* it is detected as an ATAPI device by the INT 13h,AH=48h "Get drive parameters" function. In that case also, we redetermine a suitable geometry, by bisecting over valid and invalid sectors.
e41a65f
to
260cfa7
Compare
HBelusca
added a commit
to HBelusca/reactos
that referenced
this pull request
Oct 7, 2025
reactos#8401) For example, ATAPI devices like CD-ROMs, detected as such by the BIOS INT 13h extensions. The motivation is that some hardware would report unusable geometry (number of sectors) for such devices, for example: - VBOX returns CHS=(-1)/(-1)/(-1) and total sectors = 0xFFFFFFFF`FFFFFFFF; - Dell Latitude D531 BIOS claims that the drive is *NOT* removable (although is an ATAPI device), returns a hardcoded CHS=680/64/32, and total sectors = 348160 for 2048 bytes per sectors, corresponding to a fixed 680 MiB disk. All this, even though a CD-ROM is present and may contain much less data. In order to fix these problems, we always report a drive as being removable *IF* it is detected as an ATAPI device by the INT 13h,AH=48h "Get drive parameters" function. In that case also, we redetermine a suitable geometry, by bisecting over valid and invalid sectors.
260cfa7
to
1e78cdc
Compare
HBelusca
added a commit
to HBelusca/reactos
that referenced
this pull request
Oct 9, 2025
reactos#8401) For example, ATAPI devices like CD-ROMs, detected as such by the BIOS INT 13h extensions. The motivation is that some hardware would report unusable geometry (number of sectors) for such devices, for example: - VBOX returns CHS=(-1)/(-1)/(-1) and total sectors = 0xFFFFFFFF`FFFFFFFF; - Dell Latitude D531 BIOS claims that the drive is *NOT* removable (although is an ATAPI device), returns a hardcoded CHS=680/64/32, and total sectors = 348160 for 2048 bytes per sectors, corresponding to a fixed 680 MiB disk. All this, even though a CD-ROM is present and may contain much less data. In order to fix these problems, we always report a drive as being removable *IF* it is detected as an ATAPI device by the INT 13h,AH=48h "Get drive parameters" function. In that case also, we redetermine a suitable geometry, by bisecting over valid and invalid sectors.
3032323
to
274ab3e
Compare
HBelusca
added a commit
to HBelusca/reactos
that referenced
this pull request
Oct 10, 2025
reactos#8401) CORE-9023 For example, ATAPI devices like CD-ROMs, detected as such by the BIOS INT 13h extensions. The motivation is that some hardware would report unusable geometry (number of sectors) for such devices, for example: - VBOX returns CHS=(-1)/(-1)/(-1) and total sectors = 0xFFFFFFFF`FFFFFFFF; - Dell Latitude D531 BIOS claims that the drive is *NOT* removable (although is an ATAPI device), returns a hardcoded CHS=680/64/32, and total sectors = 348160 for 2048 bytes per sectors, corresponding to a fixed 680 MiB disk. All this, even though a CD-ROM is present and may contain much less data. In order to fix these problems, we always report a drive as being removable *IF* it is detected as an ATAPI device by the INT 13h,AH=48h "Get drive parameters" function. In that case also, we redetermine a suitable geometry, by bisecting over valid and invalid sectors.
reactos#8401) CORE-9023 For example, ATAPI devices like CD-ROMs, detected as such by the BIOS INT 13h extensions. The motivation is that some hardware would report unusable geometry (number of sectors) for such devices, for example: - VBOX returns CHS=(-1)/(-1)/(-1) and total sectors = 0xFFFFFFFF`FFFFFFFF; - Dell Latitude D531 BIOS claims that the drive is *NOT* removable (although is an ATAPI device), returns a hardcoded CHS=680/64/32, and total sectors = 348160 for 2048 bytes per sectors, corresponding to a fixed 680 MiB disk. All this, even though a CD-ROM is present and may contain much less data. In order to fix these problems, we always report a drive as being removable *IF* it is detected as an ATAPI device by the INT 13h,AH=48h "Get drive parameters" function. In that case also, we redetermine a suitable geometry, by bisecting over valid and invalid sectors.
274ab3e
to
971e507
Compare
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose & Proposed changes
This PR is necessary for PR #8399 to work.
JIRA issue: CORE-14603
For example, ATAPI devices like CD-ROMs, detected as such by the BIOS INT 13h extensions.
The motivation is that some hardware would report unusable geometry (number of sectors) for such devices, for example:
VBOX returns CHS=(-1)/(-1)/(-1) and total sectors = 0xFFFFFFFF`FFFFFFFF;
Dell Latitude D531 BIOS claims that the drive is NOT removable (although is an ATAPI device), returns a hardcoded CHS=680/64/32, and total sectors = 348160 for 2048 bytes per sectors, corresponding to a fixed 680 MiB disk.
All this, even though a CD-ROM is present and may contain much less data.
In order to fix these problems, we always report a drive as being removable IF it is detected as an ATAPI device by the INT 13h,AH=48h "Get drive parameters" function.
In that case also, we redetermine a suitable geometry. First we assume the drive may be a CD-ROM, and attempt to read the ISO-9660 volume size from its ISO Primary Volume Descriptor, if any. If none is found, we fall back to size detection by bisecting over valid and invalid sectors.
Testing
Examples
Running on VirtualBox 5.0.20 r106931: freeldr_disk_geo_fixup_VBOX.txt
Running on the Dell Latitude D531: freeldr_disk_geo_fixup_DellLatitudeD531.txt