diff -ruN v45h9\chglog.txt v45i1\chglog.txt --- v45h9\chglog.txt Wed Sep 23 19:35:10 2015 +++ v45i1\chglog.txt Thu Sep 24 13:06:12 2015 @@ -820,7 +820,8 @@ -- 2015.02.19 - v0.45g -!) added check for ATAPI if IDE identify fails +!) added check for ATAPI if IDE identify fails (some devices doesn't report +ATAPI signature in wrong internal states) -- 2015.02.22 - v0.45g1 @@ -909,7 +910,7 @@ 2015.09.22 - v0.45h6 +) added BOCHS detection -+) implemented quick device absence detection for BOCHS (0x00 status) +o) implemented quick device absence detection for BOCHS (0x00 status) !) unified IORES structure init via UniataInitIoRes() and UniataInitIoResEx() this affects problem with ReactOS boot under BOCHS (BUG 10176) e!) IORES->Proc check in IO routines replaced with ASSERT() @@ -929,13 +930,26 @@ 2015.09.23 - v0.45h8 +) sync with ReactOS repository -e) handle PRD and IO-buff double-buffering before sending CMD to device. +eo) handle PRD and IO-buff double-buffering before sending CMD to device. Copying is moved from AtapiDmaStar() to AtapiDmaDBPreSync() -+) #pragma pack(1) is used for BusMaster structures in 'bsmaster.h' +e) #pragma pack(1) is used for BusMaster structures in 'bsmaster.h' -- 2015.09.23 - v0.45h9 !) #pragma pack() is used in all uniata headers to avoid cross-environemnt -ambiguities +ambiguities (this was the root of the problem) +-- +2015.09.23 - v0.45h10 + +*) merged IORES-related logging from parallel branch (39k forked from 39j) +e!) fixed PCI bus scanning algorithm (it could stop after 1st pass even if +some devices are detected) + +-- +2015.09.24 - v0.45i + +o) implemented quick device absence detection for all types of VM (0x00 status) +o) stop detection process in IssueIdentify if after IDENTIFY command still reports 0x00 +status. diff -ruN v45h9\driver\Dist\2K\uata_2k.inf v45i1\driver\Dist\2K\uata_2k.inf --- v45h9\driver\Dist\2K\uata_2k.inf Wed Sep 23 19:35:40 2015 +++ v45i1\driver\Dist\2K\uata_2k.inf Fri Sep 25 12:52:16 2015 @@ -6,7 +6,7 @@ ClassGUID={4D36E97B-E325-11CE-BFC1-08002BE10318} Class=SCSIAdapter CatalogFile=uniata.cat -DriverVer=09/23/2015,0.45.8.9 +DriverVer=09/25/2015,0.45.9.1 ; ; Source file information diff -ruN v45h9\driver\Dist\2K\uata_2kh.inf v45i1\driver\Dist\2K\uata_2kh.inf --- v45h9\driver\Dist\2K\uata_2kh.inf Wed Sep 23 19:35:40 2015 +++ v45i1\driver\Dist\2K\uata_2kh.inf Fri Sep 25 12:52:16 2015 @@ -6,7 +6,7 @@ ClassGUID={4D36E97B-E325-11CE-BFC1-08002BE10318} Class=hdc CatalogFile=uniata.cat -DriverVer=09/23/2015,0.45.8.9 +DriverVer=09/25/2015,0.45.9.1 ; ; Source file information diff -ruN v45h9\driver\Dist\2K\uniata_w2k.reg v45i1\driver\Dist\2K\uniata_w2k.reg --- v45h9\driver\Dist\2K\uniata_w2k.reg Wed Sep 23 19:35:40 2015 +++ v45i1\driver\Dist\2K\uniata_w2k.reg Fri Sep 25 12:52:18 2015 @@ -6,7 +6,7 @@ "Start"=dword:00000000 "Tag"=dword:00000019 "Type"=dword:00000001 -"DisplayName"="Universal BusMaster SATA/ATA/ATAPI Driver v0.45.8.9" +"DisplayName"="Universal BusMaster SATA/ATA/ATAPI Driver v0.45.9.1" "ImagePath"=hex(2):53,79,73,74,65,6d,33,32,5c,44,52,49,56,45,52,53,5c,75,6e,69,\ 61,74,61,2e,73,79,73,00 diff -ruN v45h9\driver\Dist\NT4\uata_nt4.inf v45i1\driver\Dist\NT4\uata_nt4.inf --- v45h9\driver\Dist\NT4\uata_nt4.inf Wed Sep 23 19:35:38 2015 +++ v45i1\driver\Dist\NT4\uata_nt4.inf Fri Sep 25 12:52:16 2015 @@ -6,7 +6,7 @@ ClassGUID={4D36E97B-E325-11CE-BFC1-08002BE10318} Class=SCSIAdapter CatalogFile=uniata.cat -DriverVer=09/23/2015,0.45.8.9 +DriverVer=09/25/2015,0.45.9.1 ; ; Source file information Binary files v45h9\driver\Dist\tools\build_inf.exe and v45i1\driver\Dist\tools\build_inf.exe differ diff -ruN v45h9\driver\Dist\XP\uata_xp.inf v45i1\driver\Dist\XP\uata_xp.inf --- v45h9\driver\Dist\XP\uata_xp.inf Wed Sep 23 19:35:40 2015 +++ v45i1\driver\Dist\XP\uata_xp.inf Fri Sep 25 12:52:18 2015 @@ -6,7 +6,7 @@ ClassGUID={4D36E97B-E325-11CE-BFC1-08002BE10318} Class=SCSIAdapter CatalogFile=uniata.cat -DriverVer=09/23/2015,0.45.8.9 +DriverVer=09/25/2015,0.45.9.1 ; ; Source file information diff -ruN v45h9\driver\Dist\XP\uata_xph.inf v45i1\driver\Dist\XP\uata_xph.inf --- v45h9\driver\Dist\XP\uata_xph.inf Wed Sep 23 19:35:40 2015 +++ v45i1\driver\Dist\XP\uata_xph.inf Fri Sep 25 12:52:18 2015 @@ -6,7 +6,7 @@ ClassGUID={4D36E97B-E325-11CE-BFC1-08002BE10318} Class=hdc CatalogFile=uniata.cat -DriverVer=09/23/2015,0.45.8.9 +DriverVer=09/25/2015,0.45.9.1 ; ; Source file information diff -ruN v45h9\driver\id_ata.cpp v45i1\driver\id_ata.cpp --- v45h9\driver\id_ata.cpp Wed Sep 23 19:22:54 2015 +++ v45i1\driver\id_ata.cpp Fri Sep 25 12:50:46 2015 @@ -267,6 +267,7 @@ return; \ } \ if(res->Proc) { \ + KdPrint(("PROC io write request @ ch %x, res* %x\n", chan, _port)); \ ASSERT(FALSE); /* We should never get here */ \ } \ if(!res->MemIo) { \ @@ -303,6 +304,7 @@ return; \ } \ if(res->Proc) { \ + KdPrint(("PROC io write request @ ch %x, res* %x, offs %x\n", chan, _port, offs)); \ ASSERT(FALSE); /* We should never get here */ \ } \ if(!res->MemIo) { \ @@ -337,6 +339,7 @@ return (_type)(-1); \ } \ if(res->Proc) { \ + KdPrint(("PROC io read request @ ch %x, res* %x\n", chan, _port)); \ ASSERT(FALSE); /* We should never get here */ \ } \ if(!res->MemIo) { \ @@ -372,6 +375,7 @@ return (_type)(-1); \ } \ if(res->Proc) { \ + KdPrint(("PROC io read request @ ch %x, res* %x, offs %x\n", chan, _port, offs)); \ ASSERT(FALSE); /* We should never get here */ \ } \ if(!res->MemIo) { \ @@ -1564,6 +1568,10 @@ statusByte = AtaCommand(deviceExtension, DeviceNumber, lChannel, Command, (j < 4) ? DEV_BSIZE : 0 /* cyl */, 0, 0, 0, 0, ATA_WAIT_INTR); // Clear interrupt + if (!statusByte) { + KdPrint2((PRINT_PREFIX "IssueIdentify: 0-status, not present\n")); + return FALSE; + } else if (statusByte & IDE_STATUS_DRQ) { // Read status to acknowledge any interrupts generated. KdPrint2((PRINT_PREFIX "IssueIdentify: IDE_STATUS_DRQ (%#x)\n", statusByte)); @@ -1720,10 +1728,17 @@ deviceExtension->FullIdentifyData.VendorAcoustic, deviceExtension->FullIdentifyData.CurrentAcoustic )); - KdPrint2((PRINT_PREFIX "AdvPowerMode %d, cur %d\n", + KdPrint2((PRINT_PREFIX "AdvPowerMode %d\n", deviceExtension->FullIdentifyData.CfAdvPowerMode )); + KdPrint2((PRINT_PREFIX "PowerMngt %d/%d, APM %d/%d\n", + deviceExtension->FullIdentifyData.FeaturesEnabled.PowerMngt, + deviceExtension->FullIdentifyData.FeaturesSupport.PowerMngt, + deviceExtension->FullIdentifyData.FeaturesEnabled.APM, + deviceExtension->FullIdentifyData.FeaturesSupport.APM + )); + // Check out a few capabilities / limitations of the device. if (deviceExtension->FullIdentifyData.RemovableStatus & 1) { // Determine if this drive supports the MSN functions. @@ -1765,6 +1780,20 @@ KdPrint2((PRINT_PREFIX "R-rate %d\n", deviceExtension->FullIdentifyData.NominalMediaRotationRate )); + KdPrint2((PRINT_PREFIX "WC %d/%d, LA %d/%d, Protected %d/%d, WB %d/%d, RB %d/%d, Q %d/%d\n", + deviceExtension->FullIdentifyData.FeaturesEnabled.WriteCache, + deviceExtension->FullIdentifyData.FeaturesSupport.WriteCache, + deviceExtension->FullIdentifyData.FeaturesEnabled.LookAhead, + deviceExtension->FullIdentifyData.FeaturesSupport.LookAhead, + deviceExtension->FullIdentifyData.FeaturesEnabled.Protected, + deviceExtension->FullIdentifyData.FeaturesSupport.Protected, + deviceExtension->FullIdentifyData.FeaturesEnabled.WriteBuffer, + deviceExtension->FullIdentifyData.FeaturesSupport.WriteBuffer, + deviceExtension->FullIdentifyData.FeaturesEnabled.ReadBuffer, + deviceExtension->FullIdentifyData.FeaturesSupport.ReadBuffer, + deviceExtension->FullIdentifyData.FeaturesEnabled.Queued, + deviceExtension->FullIdentifyData.FeaturesSupport.Queued + )); // Read very-old-style drive geometry KdPrint2((PRINT_PREFIX "CHS %#x:%#x:%#x\n", @@ -3168,7 +3197,9 @@ LunExt->MaximumBlockXfer)); } - if(LunExt->IdentifyData.MajorRevision) { + if(LunExt->IdentifyData.MajorRevision + && 0 /* DEBUG !!!! REMOVE ME */ + ) { if(LunExt->opt_ReadCacheEnable) { KdPrint2((PRINT_PREFIX " Try Enable Read Cache\n")); @@ -3193,30 +3224,32 @@ 0, ATA_C_F_DIS_RCACHE, ATA_WAIT_BASE_READY); LunExt->DeviceFlags &= ~DFLAGS_RCACHE_ENABLED; } - if(LunExt->opt_WriteCacheEnable) { - KdPrint2((PRINT_PREFIX " Try Enable Write Cache\n")); - // If supported & allowed, setup write cacheing - statusByte = AtaCommand(deviceExtension, i, lChannel, - IDE_COMMAND_SET_FEATURES, 0, 0, 0, - 0, ATA_C_F_ENAB_WCACHE, ATA_WAIT_BASE_READY); - // Check for errors. - if (statusByte & IDE_STATUS_ERROR) { - KdPrint2((PRINT_PREFIX - "AtapiHwInitialize: Enable write cacheing on Device %d failed\n", - i)); - LunExt->DeviceFlags &= ~DFLAGS_WCACHE_ENABLED; + if(LunExt->IdentifyData.FeaturesSupport.WriteCache) { + if(LunExt->opt_WriteCacheEnable) { + KdPrint2((PRINT_PREFIX " Try Enable Write Cache\n")); + // If supported & allowed, setup write cacheing + statusByte = AtaCommand(deviceExtension, i, lChannel, + IDE_COMMAND_SET_FEATURES, 0, 0, 0, + 0, ATA_C_F_ENAB_WCACHE, ATA_WAIT_BASE_READY); + // Check for errors. + if (statusByte & IDE_STATUS_ERROR) { + KdPrint2((PRINT_PREFIX + "AtapiHwInitialize: Enable write cacheing on Device %d failed\n", + i)); + LunExt->DeviceFlags &= ~DFLAGS_WCACHE_ENABLED; + } else { + LunExt->DeviceFlags |= DFLAGS_WCACHE_ENABLED; + } } else { - LunExt->DeviceFlags |= DFLAGS_WCACHE_ENABLED; + KdPrint2((PRINT_PREFIX " Disable Write Cache\n")); + statusByte = AtaCommand(deviceExtension, i, lChannel, + IDE_COMMAND_SET_FEATURES, 0, 0, 0, + 0, ATA_C_F_DIS_WCACHE, ATA_WAIT_BASE_READY); + LunExt->DeviceFlags &= ~DFLAGS_WCACHE_ENABLED; } - } else { - KdPrint2((PRINT_PREFIX " Disable Write Cache\n")); - statusByte = AtaCommand(deviceExtension, i, lChannel, - IDE_COMMAND_SET_FEATURES, 0, 0, 0, - 0, ATA_C_F_DIS_WCACHE, ATA_WAIT_BASE_READY); - LunExt->DeviceFlags &= ~DFLAGS_WCACHE_ENABLED; } - if(LunExt->IdentifyData.FeaturesSupport.PowerMngt || + if(/*LunExt->IdentifyData.FeaturesSupport.PowerMngt ||*/ LunExt->IdentifyData.FeaturesSupport.APM) { if(LunExt->opt_AdvPowerMode) { diff -ruN v45h9\driver\id_dma.cpp v45i1\driver\id_dma.cpp --- v45h9\driver\id_dma.cpp Wed Sep 23 19:12:12 2015 +++ v45i1\driver\id_dma.cpp Thu Sep 24 15:24:08 2015 @@ -1708,12 +1708,6 @@ return; } } - /* try generic DMA, use hpt_timing() */ - if (wdmamode >= 0 && apiomode >= 4) { - if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_DMA)) { - return; - } - } AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode); promise_timing(deviceExtension, dev, ATA_PIO0 + apiomode); return; @@ -2356,6 +2350,9 @@ } break; default: + return; + } + if(!timing) { return; } SetPciConfig4(0x60 + (dev<<2), timing); diff -ruN v45h9\driver\id_probe.cpp v45i1\driver\id_probe.cpp --- v45h9\driver\id_probe.cpp Wed Sep 23 18:18:20 2015 +++ v45i1\driver\id_probe.cpp Thu Sep 24 12:13:42 2015 @@ -353,6 +353,7 @@ RtlZeroMemory(PciDevMap, maxPciBus*PCI_MAX_DEVICES); for(pass=0; pass<3; pass++) { + no_buses = FALSE; for(busNumber=0 ;busNumberBaseIoAddress1[c]); - KdPrint2((PRINT_PREFIX "IDX_IO1 %x->%x(%s)\n", - IDX_IO1, - chan->RegTranslation[IDX_IO1].Addr, - chan->RegTranslation[IDX_IO1].MemIo ? "mem" : "io")); - - KdPrint2((PRINT_PREFIX "IDX_IO2 %x->%x(%s)\n", - IDX_IO2, - chan->RegTranslation[IDX_IO2].Addr, - chan->RegTranslation[IDX_IO2].MemIo ? "mem" : "io")); - - KdPrint2((PRINT_PREFIX "IDX_BM_IO %x->%x(%s)\n", - IDX_BM_IO, - chan->RegTranslation[IDX_BM_IO].Addr, - chan->RegTranslation[IDX_BM_IO].MemIo ? "mem" : "io")); - - KdPrint2((PRINT_PREFIX "IDX_SATA_IO %x->%x(%s)\n", - IDX_SATA_IO, - chan->RegTranslation[IDX_SATA_IO].Addr, - chan->RegTranslation[IDX_SATA_IO].MemIo ? "mem" : "io")); + DbgDumpRegTranslation(chan, IDX_IO1); + DbgDumpRegTranslation(chan, IDX_IO2); + DbgDumpRegTranslation(chan, IDX_BM_IO); + DbgDumpRegTranslation(chan, IDX_SATA_IO); if(!(deviceExtension->HwFlags & UNIATA_AHCI)) { #ifdef _DEBUG @@ -2687,10 +2676,11 @@ KdPrint2((PRINT_PREFIX " AHCI HDD at home\n")); return ATA_AT_HOME_HDD; } - if(g_opt_VirtualMachine == VM_BOCHS) { + if(g_opt_VirtualMachine /*== VM_BOCHS || + g_opt_VirtualMachine == VM_VBOX*/) { GetStatus(chan, signatureLow); if(!signatureLow) { - KdPrint2((PRINT_PREFIX " 0-status BOCHS - not present\n")); + KdPrint2((PRINT_PREFIX " 0-status VM - not present\n")); UniataForgetDevice(LunExt); return ATA_AT_HOME_NOBODY; } @@ -2979,7 +2969,8 @@ RetVal = DFLAGS_DEVICE_PRESENT; LunExt->DeviceFlags |= DFLAGS_DEVICE_PRESENT; LunExt->DeviceFlags &= ~DFLAGS_ATAPI_DEVICE; - } else { + } else + if(!g_opt_VirtualMachine) { // This can be ATAPI on broken hardware GetBaseStatus(chan, statusByte); if(!at_home && UniataAnybodyHome(HwDeviceExtension, lChannel, deviceNumber)) { @@ -2989,6 +2980,9 @@ KdPrint2((PRINT_PREFIX "CheckDevice: try ATAPI %#x, status %#x\n", deviceNumber, statusByte)); goto try_atapi; + } else { + KdPrint2((PRINT_PREFIX "CheckDevice: VM Device %#x not present\n", + deviceNumber)); } GetBaseStatus(chan, statusByte); } diff -ruN v45h9\driver\tools.h v45i1\driver\tools.h --- v45h9\driver\tools.h Wed Sep 23 19:05:50 2015 +++ v45i1\driver\tools.h Wed Sep 23 21:16:26 2015 @@ -111,6 +111,14 @@ KdPrint(("\n")); \ } +#define DbgDumpRegTranslation(chan, idx) \ + KdPrint2((PRINT_PREFIX \ + " IO_%#x (%#x), %s:\n", \ + idx, \ + chan->RegTranslation[idx].Addr, \ + chan->RegTranslation[idx].Proc ? "Proc" : ( \ + chan->RegTranslation[idx].MemIo ? "Mem" : "IO"))); \ + #define BrutePoint() { ASSERT(0); } #define DbgAllocatePool(x,y) ExAllocatePool(x,y) @@ -120,6 +128,8 @@ #else #define KdDump(a,b) {} + +#define DbgDumpRegTranslation(chan, idx) {} #define DbgAllocatePool(x,y) ExAllocatePool(x,y) #define DbgFreePool(x) ExFreePool(x) diff -ruN v45h9\driver\uniata_ver.h v45i1\driver\uniata_ver.h --- v45h9\driver\uniata_ver.h Wed Sep 23 19:35:32 2015 +++ v45i1\driver\uniata_ver.h Fri Sep 25 12:52:08 2015 @@ -1,10 +1,10 @@ -#define UNIATA_VER_STR "45h9" -#define UNIATA_VER_DOT 0.45.8.9 +#define UNIATA_VER_STR "45i1" +#define UNIATA_VER_DOT 0.45.9.1 #define UNIATA_VER_MJ 0 #define UNIATA_VER_MN 45 -#define UNIATA_VER_SUB_MJ 8 -#define UNIATA_VER_SUB_MN 9 -#define UNIATA_VER_DOT_COMMA 0,45,8,9 -#define UNIATA_VER_DOT_STR "0.45.8.9" +#define UNIATA_VER_SUB_MJ 9 +#define UNIATA_VER_SUB_MN 1 +#define UNIATA_VER_DOT_COMMA 0,45,9,1 +#define UNIATA_VER_DOT_STR "0.45.9.1" #define UNIATA_VER_YEAR 2015 #define UNIATA_VER_YEAR_STR "2015"