Re: Cache



the driver itself doesn't do any caching. the i/o manager or the FS might
though.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"George" <georgeyu@xxxxxxxxxxxxxxxx> wrote in message
news:%237etR%23UqFHA.364@xxxxxxxxxxxxxxxxxxxxxxx
> Hi Doron,
>
> Thanks for the quick response. I have another question that may or may not
> have anything to do with the cache. For the USB mass storage device (i.e.
> USB flash drive), it seems to me that the Windows driver will do (write??)
> something in device's FAT area including MBR. This may cause problem when
> your application is doing the low level stuff, i.e. formatting the device
> or
> writing to the flash sector by sector. When your application exits, the
> Windows mass storage device driver might still write things to the device.
> This could cause your intended operation to fail. Is there a way to
> prevent
> Windows device driver from interfering when your application is perform
> low
> level IOs with the device?
> Another question (maybe the same as above) is under Windows 2000 system
> whether it's safe to remove the USB mass storage device after completing
> the
> low level operations without doing a safe removal?
>
> Thanks very much for the help.
>
> Best regards,
> George
>
> "Doron Holan [MS]" <doronh@xxxxxxxxxxxxxxxxxxxx> ¦b¶l¥ó
> news:%23ZjYVGUqFHA.3520@xxxxxxxxxxxxxxxxxxxx ¤¤¼¶¼g...
>> when you open the file handle, you can specify no caching. from
>>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/createfile.asp
>>
>> FILE_FLAG_NO_BUFFERING
>>
>> The system opens a file with no system caching. This flag does not
>> affect hard disk caching. When combined with FILE_FLAG_OVERLAPPED, the
> flag
>> gives maximum asynchronous performance, because the I/O does not rely on
> the
>> synchronous operations of the memory manager. However, some I/O
>> operations
>> take more time, because data is not being held in the cache. Also, the
> file
>> metadata may still be cached. To flush the metadata to disk, use the
>> FlushFileBuffers function.
>> An application must meet certain requirements when working with
> files
>> that are opened with FILE_FLAG_NO_BUFFERING:
>>
>>
>> a.. File access must begin at byte offsets within a file that are
>> integer multiples of the volume sector size.
>> b.. File access must be for numbers of bytes that are integer
>> multiples of the volume sector size. For example, if the sector size is
> 512
>> bytes, an application can request reads and writes of 512, 1024, or 2048
>> bytes, but not of 335, 981, or 7171 bytes.
>> c.. Buffer addresses for read and write operations should be
> sector
>> aligned, which means aligned on addresses in memory that are integer
>> multiples of the volume sector size. Depending on the disk, this
> requirement
>> may not be enforced.
>> One way to align buffers on integer multiples of the volume sector
>> size is to use VirtualAlloc to allocate the buffers. It allocates memory
>> that is aligned on addresses that are integer multiples of the operating
>> system's memory page size. Because both memory page and volume sector
> sizes
>> are powers of 2, this memory is also aligned on addresses that are
>> integer
>> multiples of a volume sector size.
>>
>> An application can determine a volume sector size by calling the
>> GetDiskFreeSpace function
>>
>>
>>
>> --
>> Please do not send e-mail directly to this alias. this alias is for
>> newsgroup purposes only.
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>>
>>
>> "George" <georgeyu@xxxxxxxxxxxxxxxx> wrote in message
>> news:uTRyEDSqFHA.3520@xxxxxxxxxxxxxxxxxxxxxxx
>> > Hi,
>> >
>> > I am not sure if this is an appropriate group for this question, so
> please
>> > feel free to direct me elsewhere. I'd like to knwo how to adjust the
>> > system
>> > cache to zero under Windows 2000. The purpose is to ensure Windows is
>> > synchronized with a USB mass storage device during a lengthy write
>> > operation, whatever retrieved from the Windows' file system is directly
>> > written to the USB mass storage device without been stored in the cache
>> > first.
>> > Thanks for the help.
>> >
>> > George
>> >
>> >
>>
>>
>
>


.



Relevant Pages

  • Re: Cache
    ... For the USB mass storage device (i.e. ... writing to the flash sector by sector. ... Windows mass storage device driver might still write things to the device. ...
    (microsoft.public.development.device.drivers)
  • Re: SP2 Installation Problem
    ... >something, with modern IDE drives, Windows will never see a bad sector ... If there are problems with a sector, ... >place on the drive, all transparent to Windows. ... If either flag is set, an automatic check of the file system ...
    (microsoft.public.windowsxp.general)
  • Re: Incompetent? was Re: Using Linux to Recover bad NTFS drive.
    ... the ability to nondestructively clone a partition or even an entire ... Back in Windows or BartPE you run SectorSpy to dump the raw ... sector data into text file on a new drive for forensic ... > every linux sysadmin should know about. ...
    (comp.os.linux.misc)
  • Re: Incompetent? was Re: Using Linux to Recover bad NTFS drive.
    ... the ability to nondestructively clone a partition or even an entire ... Back in Windows or BartPE you run SectorSpy to dump the raw ... sector data into text file on a new drive for forensic ... > every linux sysadmin should know about. ...
    (comp.os.linux.hardware)
  • Re: [GIT PATCH] USB autosuspend fixes for 2.6.23-rc6
    ... - REMOVE THE DAMN QUIRK ... that some USB device is broken with more than 64 sectors would seem to ... So why not make the 64 sector limit be the default? ... Windows gives them). ...
    (Linux-Kernel)