-
Notifications
You must be signed in to change notification settings - Fork 186
Fix sector size calculation for Disk images #248
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
base: develop
Are you sure you want to change the base?
Conversation
e1ed65c
to
622c271
Compare
574400f
to
462ffb6
Compare
?????????? |
Bumping this again, as I still need this. |
I implemented your changes in my fork now: I plan to publish new NuGet packages with this fix soon. Thanks a lot for your contribution! Could you take a look at this test case? It fails after this modification. I am not sure whether the test was actually wrong previously, or if anything is wrong now. |
Not really sure, but we were writing the boot sectors wrong in the first place, it’s likely that the test had similarly wrong parameters. |
Okay, sounds like it makes sense. I'll try to figure out how this could be tested in some other way. |
Okay, fixed the test case and built new nuget packages. Packages from my fork are prefixed with |
.net 8 targets as well for nuget? =) |
Yes! |
excellent. KAPE is getting ported to your library for v2 |
This comment was marked as outdated.
This comment was marked as outdated.
Thanks! But I guess we also need to fix |
Uggggh, I think see the issue. I had thought that I was calculating the sector count wrong because the test was reporting 512, but the test assumed the boot IMAGE was first because it used to write IMAGE, then CATALOG (this does not conform to the El Torito spec, it's supposed to be CATALOG then IMAGE). So the test read the boot catalog size, which is always 1 sector, 512 bytes. So, to sum up, I think you have the tests fixed correctly and you don’t have to change anything. I will investigate with real world examples to make sure. |
Having looked more into this, I think that there is some logic missing i Also, |
A fix for a bug mentioned in #247: implementing fixes for sector size detection for bootable images.
We either calculate the sector count based on the emulated floppy size, or we look at the boot sector of the image to see if it's a valid boot sector. If so, we retrieve the sector count from there.
When writing to the disk, if we are writing a boot image with emulation, we mark the sector count as 1 in the boot catalog.