[ros-kernel] Removable Media Support is Broken.

James Tabor jimtabor at adsl-64-217-116-74.dsl.hstntx.swbell.net
Tue Jul 13 18:13:06 CEST 2004


Hi,
Hartmut Birr wrote:
> 
>>-----Original Message-----
>>From: ros-kernel-bounces at reactos.com 
>>[mailto:ros-kernel-bounces at reactos.com] On Behalf Of James Tabor
>>Sent: Tuesday, July 13, 2004 4:08 AM
>>To: ReactOS Kernel List
>>Subject: Re: [ros-kernel] Removable Media Support is Broken.
>>
>>
>>
>>The re-read for the partition table is getting hosed up. It 
>>seems class2 can not
>>tell if it is real zero or relative zero after the device 
>>object is built.
>>We found our bug,
>>James
>>
> 
>  
> I think you haven't found the bug. Reading of the partition table must go to
> \Device\Harddisk?\Partition0. You have changed back the device object for
> the call to IoReadPartitionTable. It goes now to

I can not get DiskDeviceExtension->PhysicalDevice to work. "ERROR: invalid drive"
Every where else uses DeviceObject when calling IoReadPartitionTable.

> \Device\Harddisk?\Partition1. 
Yes this is wrong it should be Partition0 not 1. Maybe in DiskClassCreateDeviceObject
we are doing or not doing something right if the device is removable.

> At the first read, the offset is not
> initialized and the correct sector is read. After the first read, the offset
> is always initialized with the offset of the first sector of the partition.

Look! You have to destroy the DeviceObject each time to build a Removable Media
partition. It is read more than once because of Vfatfs.sys calls it more than
once. Partitions, most of the time start at 0:0:0, so everything must be zeroed
out to start a new partition build. Class2.sys assumes and builds a offset when
it r/w to the device. So the second read kills everything and looks at the Boot
sector and not the Partition table. We can not assume it is a super floppy second
time around. BTW the only time BuildPartition is called, only when the media
was changed out. Maybe we are not cleaning out all the pointers before rebuilding
the partition table. It would be almost rebuilding a new DeviceObject.

> I've add some debug code to xHalIoReadPartitionTable, which prints the
> device name.
> 
> - Hartmut
>  

I'll work on finding out why Partition1 is selected and not 0.
Thanks big time! I hope I'm helping here!
James



More information about the Ros-kernel mailing list