-
Notifications
You must be signed in to change notification settings - Fork 30
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
Improved device support (and other improvements and bugfixes) #31
Merged
Conversation
This file contains 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
…ng a device without mounting it (ie. without reading rootblock/volume information), lclevy#17
…ting a native device structure.
… opening an already existing file, lclevy#23
…make sure it is written.
…building native devices.
…y on 'make check'.
…ie. setting the directories with test files).
…ust for testing).
…CygWin (on Windows).
…sed before the include).
…ne in floppy.sh).
… scripts may run in parallel).
…ities available).
…vice (with Windows ioctls).
…racted path/filenames.
…o separated modules.
…evice moved to separated functions.
…g a device block).
…minating before null).
…ns for status check - returned value is already a RETCODE (RC_OK or RC_ERROR).
It seems you now know better than me this code I wrote 20 years ago. Thanks for improving it! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is mainly to address #17 - there was no way to operate on a device that could not be mounted. I have split these things (opening a device and mounting it) so that operation like formatting a clean image/device can be performed.
This separation required couple more changes, ie. geometry setting that was done in the mounting code is now done in the device code (where it should be, as this is a property of a device). In particular, it can be read directly from devices both on Windows and Linux. It is added to Windows native device and also implemented for Linux (for which I have implemented a prototype of native device support (NOT TESTED!!!).
I repeat: THE NATIVE DEVICE CODE IS NOT TESTED(!) and since it is dealing with SYSTEM DEVICES anyone testing this should be aware what is doing and that a mistake (or a bug...) can cost precious data. So please test it safely, never from root/admin and only on selected devices with properly set permissions, best on a separated system like a VM.
If the native device code is not needed (most cases, I bet...), I advice to build the library without it (with
generic
).Also, I did some small changes to built the library in several environments (on Debian, cross-compiled for windows, and build on Windows with Visual Studio and CygWIn).
Concerning the issue with formatting the disks - I have created 2 command line tools: for creating and formatting floppy disk images. So this can be easily tested by users.
For other details please check the commits.
(I'll leave the PR for some time - if there's no comments I will merge it.)