[boot] added FAT16 bootable MS-DOS support

* also fixed broken FAT32 bootable MS-DOS
* also added extended error report in file.c
This commit is contained in:
Pete Batard 2011-12-02 00:11:53 +00:00
parent b6c6e37927
commit cbc54d764d
3 changed files with 50 additions and 99 deletions

2
file.c
View file

@ -45,6 +45,7 @@ int write_sectors(HANDLE hDrive, size_t SectorSize,
if((!WriteFile(hDrive, pBuf, (DWORD)BufSize, &Size, NULL)) || (Size != BufSize))
{
uprintf("write_sectors: Write error - %s\n", WindowsErrorString());
uprintf(" StartSector:%0X, nSectors:%0X, SectorSize:%0X\n", StartSector, nSectors, SectorSize);
return 0;
}
@ -74,6 +75,7 @@ int read_sectors(HANDLE hDrive, size_t SectorSize,
if((!ReadFile(hDrive, pBuf, (DWORD)BufSize, &Size, NULL)) || (Size != BufSize))
{
uprintf("read_sectors: Read error - %s\n", WindowsErrorString());
uprintf(" StartSector:%0X, nSectors:%0X, SectorSize:%0X\n", StartSector, nSectors, SectorSize);
return 0;
}