IDE device driver query

Hello to all,

I am doing diagnostic of HDD on the linux 2.6. The challenge we are facing is the synchronization with the existing ide driver. The kernel module that we have written directly accesses the ide controller registers. The restriction is that we cannot make any changes in the currently running ide driver. But how to make sure that while my module is writing into a particular sector, the existing driver does not interfere? Is there a way to temporarily shutdown the running IDE interface and resume it once the diagnostics is done?

Thanks & Regards,

-Nutty

Reply to
Nutty
Loading thread data ...

In Linux it's absolutely forbidden that an I/O address used by a driver is accessed by another running driver. After an access each driver will leave an I/O device in a state, unknown to anybody else, that it assumes not to be modified when it accesses it the next time.

So you need to deactivate (unload) one driver before activating another.

As said already a hundred times, when accessing the DID hardware you either need to _use_ the driver provided by Linux _or_ not use it at all: unload it or (maybe better for someone thinking along the lines you do) not use Linux at all.

-Michael

Reply to
Michael Schnell

Compile it as a module in the kernel and unload this module (or don't load it at all). Beware: your system cannot be on an IDE disk in that case.

Reply to
Sebastian

Others have said it - don't do it. Unload the driver first.

If you absolutely must, you _may_ be able to catch an opportune moment when the IDE driver is idle and disable interrupts on all processors.

You then wait to make sure that any running DMA transfer is finished.

At this point, you should be able to access the registers, provided you can restore the state afterwards exactly. Don't even think of writing to an active filesystem.

Don't do it.

Kind regards,

Iwo

Reply to
Iwo Mergler

Iwo,

Has this anything to do with your previous posts?

If so, as previously pointed out IDEs do badblock management by themselves so doing it again in software is completely pointless. All that should be required is an IDE device status and the current driver will already be doing this.

---------------

I m a beginner in the Linux platform. Since last two years,i was working on Embedded C,C++ on the keil compiler, on the 89C51RD2. I have

also worked on the WinCE 5.0 Platform Builder with EVC++. According to my new project, i would like to write the diagnostic application for the PC type device (32 bit processor) i.e i have to test the functionality of each and every hardware like CPU,HDD,Serial Ports,RAID,etc.The client has given the procedure to carry out each test. As per the requirement the procedure to test HDD should be

# Check HDD

  1. Validates the hard-disk device by writing a pattern onto an unused sector and compares with the expected pattern.
  2. Checks all the sectors (HDD surface test) and report bad sectors.
  3. Retains the original sector contents.

Can anyone please help me to start the application.

Please guide me...

Iwo Mergler wrote:

Reply to
dmctek.googlepages.com

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.