Skip to content

Add support for raw devices#6960

Merged
OBattler merged 2 commits into
86Box:masterfrom
tjemg:master
Mar 23, 2026
Merged

Add support for raw devices#6960
OBattler merged 2 commits into
86Box:masterfrom
tjemg:master

Conversation

@tjemg

@tjemg tjemg commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR allows to use a physical device as an HDD disk.
I have tested with an external CompactFlash card (2GB) and running under MacOS and under FreeBSD.
This is the first time I contribute something to the project which touches C/C++ code - therefore, I am surely missing lots of things here...
Note - I touched the CMakeLists.txt file to compile the software under MacOS with brew - maybe these changes can be removed?

What could be done better?
Currently I have tested this by selecting the "new..." under the HDD dialog - the CHS should be automatically chosen and shown, not only when clicking "ok".
When the device is detected to be a raw/block device, probably some settings should be greyed out in the disk dialog.
I have added a setting to the configuration to signal that the device is raw/block device.
Maybe this could also be made visible in the GUI?

Note: due to what I wrote above, this patch is most likely incomplete - while the bare functionality seems to work (and it kind of does what I want :-) ), it probably needs some further adjustments before it goes to the main branch; my intention of doing the PR is to show a bit of code to achieve an initial draft of the feature I would like to kindly ask to be implemented.

Thank you for the awesome project :-)

Checklist

References

@OBattler

Copy link
Copy Markdown
Member

It appears to be fine, except that windows.h should be included before winioctl.h in qt_platform.cpp, otherwise compilation is broken.

@tjemg

tjemg commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

It appears to be fine, except that windows.h should be included before winioctl.h in qt_platform.cpp, otherwise compilation is broken.

Thank you for pointing this out. I made a small change to reflect the comment.

@OBattler OBattler merged commit 6f38a32 into 86Box:master Mar 23, 2026
45 checks passed
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.

2 participants