AW: [ros-kernel] IOMega Zip Drive

James Tabor jimtabor at adsl-64-217-116-74.dsl.hstntx.swbell.net
Tue Mar 23 15:29:16 CET 2004


Hi,
Hartmut Birr wrote:
> Hi,
> 
> I think there is something wrong in DiskClassCreateDeviceObject and
> DiskClassDeviceControl (for IOCTL_DISK_GET_DRIVE_GEOMETRY).
> DiskClassCreateDeviceObject does never check for valid partition table
> from a removable media. DiskClassDeviceControl (for
> IOCTL_DISK_GET_DRIVE_GEOMETRY) must reread the partition table and check
> if it is a valid table. Can you disable some lines in disk.c and try it
> again? Possible It does fix the problem if the zip is inserted at boot
> time.
> 
> - Hartmut
> 
>  
I guess it is time to add removable media support for non floppies. With your
patch and the below code for Get Partition Info it should work w/o a media
verify function. We can add that later, since it would require more work in
atapi.sys.

MSDN on RemovableMedia, "Indicates removable media other than a floppy disk".

Best place to catch it is in disk.c,

       case IOCTL_DISK_GET_PARTITION_INFO:
         DPRINT1("IOCTL_DISK_GET_PARTITION_INFO\n");

         if ((DeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) &&
         (DeviceExtension->DiskGeometry->MediaType == RemovableMedia))
         {
	/* Build Partition from Removable Media */

         	DPRINT1("RemoveMedia TEST XXX\n");

		/* What should go here? */

		/* Verify Media Change */

			/* If Changed Remove old Entry */

       	         	/* Allocate a partition list for a single entry. */
		
         }

         if (IrpStack->Parameters.DeviceIoControl.OutputBufferLength <
             sizeof(PARTITION_INFORMATION))
           {
             Status = STATUS_INFO_LENGTH_MISMATCH;
           }
         else if (DiskData->PartitionNumber == 0)
           {
         DPRINT1("IOCTL_DISK_GET_PARTITION_INFO bad\n");

             Status = STATUS_INVALID_DEVICE_REQUEST;
           }
         else
         {
             PPARTITION_INFORMATION PartitionInfo;
[snip]

Need this too /drivers/fs/vfat/fsctl.c, in VfatHasFileSystem, add RemovableMedia,

  if (DiskGeometry.MediaType == FixedMedia || RemovableMedia) <-----
    {
       // We have found a hard disk
       Size = sizeof(PARTITION_INFORMATION);
       Status = VfatBlockDeviceIoControl(DeviceToMount,
                                         IOCTL_DISK_GET_PARTITION_INFO,
                                         NULL,
                                         0,
                                         &PartitionInfo,
                                         &Size,
                                         FALSE);

Just the first steps, Ideas?
James


More information about the Ros-kernel mailing list