Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-13091

inappropriate ASSERT()s drivers\usb\usbstor\misc.c:USBSTOR_IsFloppy()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 0.4.13
    • None
    • None

    Description

      real hardware Acer Aspire ZG5 (no floppy hardware)

      drivers\usb\usbstor\misc.c:USBSTOR_IsFloppy() contains

          ASSERT(FormatHeader->Reserved1 == 0x00);
          ASSERT(FormatHeader->Reserved2 == 0x00);
          ASSERT(FormatHeader->Reserved3 == 0x00);

      which when encountered on this hardware attempting boot from flash drive cause the boot process to fail.  These non-zero values may be the result of USB pipe communication stalling and having to be reset, something that is attempted in the drivers.

      However, because these ASSERT()s fail the boot process it can never succeed.

      I will suggest that non-zero values should be more explicitly checked for with an 'if()' and a return FALSE done if the condition is met which would report to the caller that the entity under consideration is not a floppy drive.  While there is a possibility the entity might actually be a floppy drive in some scenarios, in the scenario observed there is no floppy drive (and I think no controller in the system), and these checks as coded will incorrectly keep the boot process from ever succeeding (at least in a debug build with ASSERT()s active.)

      Don't know if in fact those areas should be zero for an actual floppy, but if, as in my scenario, the item is in fact not a floppy, then perhaps those locations may legitimately contain non-zero values.

      Here is the block of code I currently have in that area which allows my boot effort to continue well beyond this point:

      // jira 'code' not able to handle as formatted, sorry about appearance
      //    
      // sanity checks    
      //
      #if 1    
      //apparently not so sane, reserved items are non-zero on acer aspire one ZG5...    
      //(assuming the returned response passed to parameter Buffer was otherwise valid...)    
      //...non-zero(es)may be occurring when a pipe endpoint stalls and has to be cleared,     
      //perhaps while request outstanding for the capacity_format...
      //#ifndef NDEBUG    
      if( (FormatHeader->Reserved1 | FormatHeader->Reserved2 | FormatHeader->Reserved3))    
      {    
      DPRINT1(
      "->ReservedX non-zero not expected, but seems to occur with pipe reset\n"   "treat as NOT a floppy, even tho' perhaps it could have been...\n");       //why/how are these non-zero, apparently not allowed/expected!!!    __debugbreak ; 
      return FALSE;    
      }
      //#endif    
      ASSERT(FormatHeader->Reserved1 == 0x00);    
      ASSERT(FormatHeader->Reserved2 == 0x00);    
      ASSERT(FormatHeader->Reserved3 == 0x00);
      #endif

       

       

       

       

      Attachments

        Activity

          People

            bug zilla Bug Zilla
            curiousone curiousone
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: