Skip to content
Commits on Jan 25, 2016
  1. [filedisk] Introduce filedisk mini-driver SCSI routines

    Shao Miller committed
    Unfortunately, there has been a huge gap in development, which
    has introduced a challenge in remembering the short-term to-dos.
    Fortunately, commit-logs help (a bit).
    
    A new SCSI file for filedisk mini-driver operations is introduced.
    It is not yet used, as the filedisk logic is not yet a mini-driver.
    
    Signed-off-by: Shao Miller <winvblock@synthetel.com>
Commits on Dec 20, 2012
  1. [headers] Use WvlUnusedParameter

    Shao Miller committed
    It's more descriptive than directly casting to 'void'.
  2. [filedisk] Introduce supporting mini-driver routines

    Shao Miller committed
    But they aren't used, yet.  The WvFilediskDriveDevice routine
    should always refuse to drive a PDO with an FDO, because the
    filedisk mini-driver will do PDO work.
  3. [filedisk] Introduce mini-driver entry-point

    Shao Miller committed
    But not used, just yet.
  4. [filedisk] Mini-driver PnP code

    Shao Miller committed
    In shifting the filedisk code to become a mini-driver, we introduce
    filedisk/pnp.c for PnP IRP handling.
Commits on Dec 19, 2012
  1. [memdisk] Add a couple of assertions

    Shao Miller committed
    Consistent with the GRUB4DOS counterpart.
  2. [memdisk] Fix bus relations bug

    Shao Miller committed
    Forgot to handle the case where all PDO nodes have been
    produced.
  3. [grub4dos] Initial GRUB4DOS mini-driver

    Shao Miller committed
    The GRUB4DOS mini-driver registers itself as a mini-driver.
    When the safe hook initial probe routine is invoked, this
    G4D mini-driver has an opportunity to drive a safe hook
    PDO with a G4D bus FDO.
    
    A G4D bus FDO can have 9 children: 8 disk PDOs for the 8
    slots available in a G4D drive mapping table, 1 safe hook
    PDO for the previous hook in the INT 0x13 chain.
    
    Removal isn't currently working, as neither RAM disks nor
    file-/sector-backed disks are mini-driver devices, yet.
Commits on Dec 14, 2012
  1. [memdisk] Initial MEMDISK mini-driver

    Shao Miller committed
    The MEMDISK mini-driver registers itself as a mini-driver,
    then registers a main bus initial probe routine.  When that
    routine is invoked, it scans low memory for mBFTs.  If it finds
    mBFTs, a safe hook PDO is created for each of them.  There is a
    hack in place to prevent the later INT 0x13 safe hook walking
    from producing duplicates of mBFT safe hooks.
    
    A MEMDISK FDO will drive a safe hook PDO with the MEMDISK
    signature and provide, at most, 2 children: The MEMDISK disk
    and the previous safe hook in the chain.
    
    A hack is also in place because RAM disks aren't mini-driver
    devices, yet.  This also means that removal is temporarily
    broken.
Commits on Dec 13, 2012
  1. [safehook,mainbus] Switch safe hook over to a mini-driver

    Shao Miller committed
    Fix a bug in src/winvblock/mainbus/dummyirp.c where such a PDO
    should really respond directly to an IRP_MJ_PNP:IRP_MN_START_DEVICE.
    
    Assign a PDO to the safe hook FDO bus in
    WvSafeHookPnpQueryDeviceRelations.  That way, it's linked for the
    the later PnP probe for its capabilities, and also linked for its
    later removal.
    
    Fix a bug in WvSafeHookPnpRemoveDevice where a safe hook FDO would
    try to pass WvlDeleteDevice a null pointer.
    
    Add a DummyPdo member to S_WV_SAFE_HOOK_DUMMY_WRAPPER so we can
    calculate the offset of the dummy IDs relative to the wrapper's
    beginning.
    
    Remove a hack for the old, non-mini-driver safe hook PDOs.
    
    Actually create the safe hook PDO in WvlCreateSafeHookDevice,
    instead of it calling the old, non-mini-driver code.
  2. [safehook] Probe for an ancestor hook when queried

    Shao Miller committed
    When queried for BusRelations, a safe hook FDO should probe the
    previous hook in the chain and create a PDO, if appropriate.
  3. [safehook] Note the previous INT 0x13 handler

    Shao Miller committed
    Cache a record of a safe hook's ancestor in the chain.
  4. [safehook] Claim the safe hook for the FDO

    Shao Miller committed
    (And "unclaim" it when the FDO is removed.)
  5. [driver] Add missing extern specifiers

    Shao Miller committed
  6. [driver] Add WvlMapUnmapLowMemory

    Shao Miller committed
    For mapping/unmapping the first 1 MiB of memory.
  7. [safehook] Implement WvSafeHookDriveDevice

    Shao Miller committed
    This will test for a safe hook PDO and drive it with an FDO.
  8. [safehook] Unlink and delete any child PDO

    Shao Miller committed
    When the FDO is established, it will produce and link the child
    PDO (if there is one), so this is the corresponding tear-down.
    
    Note: WvSafeHookDriveDevice isn't actually implemented yet.
  9. [mainbus] Use WvlAssignDeviceToBus

    Shao Miller committed
    Thus hiding some of the "is linked" implementation details.
  10. [driver] New WvlAssignDeviceToBus function

    Shao Miller committed
    This function doesn't deal with how a bus device responds to a
    BusRelations query (that's up to each mini-driver), but it
    does increment or decrement a reference count on the bus
    device, so each assignment call must be matched by a
    corresponding unassignment call at some point during the child
    device's lifetime.
Commits on Dec 11, 2012
  1. [driver] Use WvDriverLinkDevice and WvDriverUnlinkDevice

    Shao Miller committed
    These two new functions are now used by WvlAttachDeviceToDeviceStack
    and WvlDetachDevice to set and unset the "linked" flag for a device.
  2. [safehook] Use WvlMergeDeviceRelations

    Shao Miller committed
  3. [mainbus] Use WvlMergeDeviceRelations

    Shao Miller committed
    Also, upon failure, release any higher device's report.
  4. [driver] WvlMergeDeviceRelations utility function

    Shao Miller committed
    Because it's fairly common to accumulate device relations during
    processing of an IRP_MJ_PNP:IRP_MN_QUERY_DEVICE_RELATIONS, this
    utility function should help with taking a higher device's list
    and merging in the current device's list.
  5. [safehook] Introduce safe hook bus FDO

    Shao Miller committed
    There is little purpose to a safe hook bus other than to possibly
    expose another safe hook PDO.
Commits on Dec 10, 2012
  1. [safehook] WvlGetSafeHook should return a SEG16:OFF16

    Shao Miller committed
    Other than the IDs, the SEG16:OFF16 is really the only other
    piece of what makes a safe hook PDO unique.  The IDs could be
    taken care of by the dummy logic.
  2. [safehook] Alignment for WvSafeHookDefaultDummyIds

    Shao Miller committed
    A future call to WvDummyAdd should have an aligned ExtraDataOffset
    argument, so calculate it ahead of time.
  3. [mainbus] Add WvDummyPnpQueryCapabilities

    Shao Miller committed
    Supports IRP_MJ_PNP:IRP_MN_QUERY_CAPABILITIES.
  4. [mainbus] Add WvDummyPnpQueryBusInfo

    Shao Miller committed
    Supports IRP_MJ_PNP:IRP_MN_QUERY_BUS_INFORMATION.  There's a to-do
    note, since it's possible that dummy PDOs could query a parent bus
    device for this information; undecided.
  5. [safehook] Introduce WvSafeHookDummyIds

    Shao Miller committed
    Generate a safe hook instance's dummy IDs, suitable for use
    with WvDummyAdd.  It isn't currently used, but it's planned.
  6. [mainbus] Dummy support for DeviceTextDescription

    Shao Miller committed
    Dummy PDOs now support the IRP_MJ_PNP:IRP_MN_QUERY_DEVICE_TEXT,
    DeviceTextDescription type.  This is the description that shows
    up in the "Found New Hardware Wizard", if an .INF file doesn't
    override it.
Commits on Dec 9, 2012
  1. [mainbus] WvDummyAdd now takes a mini-driver parameter

    Shao Miller committed
    The function now takes an optional mini-driver parameter.  If
    it is null, the main bus will own the dummy device.  If non-null,
    the specified mini-driver will own the dummy device.
  2. [driver,mainbus] Fix device tear-down

    Shao Miller committed
    Remove the NotAvailable member of the WV_S_DEV_EXT structure.
    Replace part of its use with a new CvWvlDeviceFlagAvailable flag.
    
    Introduce a new CvWvlDeviceFlagLinked flag.  This flag is set
      - For PDOs: When they are added to a parent bus
      - For FDOs: When they are attached to a device stack
    
    Introduce a new CvWvlDeviceFlagThread flag.  This flag controls
    whether or not IRPs and work items can be added to the device's
    IRP queue.
    
    The dummy PDO logic now handles a surprise-removal by incrementing
    the resource usage for the device and decrementing it during the
    subsequent IRP_MN_REMOVE_DEVICE.  This prevents the device's
    thread from stopping and deleting the device before the removal
    has been completed.  (See below regarding the resource usage.)
    
    Device tear-down now works like this: The device's thread always
    has ultimate responsibility for deleting a device.  The thread
    will accept IRPs and work items until such a time as:
      - The device is not linked (see explanation above)
      - The device is no longer available due to WvlDeleteDevice
      - The device, as a tracked resource, is only being used by
        the thread
    
    If any of these conditions are false, the thread continues to
    service IRPs and work items.  It is up to the IRP dispatcher
    to allow PnP IRPs to be processed and to disallow other IRPs.
    (A mini-driver might have special PnP handling or other IOCTLs
    that it wishes to service, even when a device is on its way
    to deletion.)
    
    WvMainBusAddDevice and WvlAttachDeviceToDeviceStack both link
    a device.  WvMainBusRemoveDevice and WvlDetachDevice both unlink
    a device.
  3. [mainbus] Make dummy devices mini-driver devices

    Shao Miller committed
    AoE and HTTPDisk adjusted to add their dummy devices using
    WvlAddDeviceToMainBus.
    
    Removed unused WvDummyRemove function.
    
    Removed OldDevice member of S_WVL_DUMMY_PDO.
    
    Fixed a bug in WvMainBusPnpRemoveDevice where it was trying to
    walk a list that was being modified in between steps.  Heh.
    
    dummyirp.c now uses WvlPassIrpUp instead of IoCompleteRequest.
    Tried to remove traces of the old style involving "bus nodes"
    and WV_S_DEV_T.  Use WvlCreateDevice instead of IoCreateDevice
    and use WvlDeleteDevice instead of IoDeleteDevice.
    
    Fixed an arithmetic bug in WvMainBusRemoveDevice.
    
    TODO: Dummy device removal doesn't quite work.
  4. [libbus,mainbus] Lessen the PDO-adding hacks

    Shao Miller committed
    Old-style "bus nodes," when added to the main bus using the
    old-style methods, will now _also_ be added to the main bus
    using the new methods.  Unfortunately, this means that removing
    the devices isn't working so well, just now.
Something went wrong with that request. Please try again.