Hi,
I am trying to develop a SDIO device driver using Evc++.
The target device is an imate PPC. I am not using platform builder, as
i am not to use a development board, but just write a driver for the
PPC device which has an OS already.

My device has an SDBusdriver.dll
So i am thinking that i should develop a host controller driver and a
client driver.


Initially i am doing an SD card Client Driver and will try to modify it

from there.( Dont know if this is a good way to proceed)


I am currently modifying the registry in the
HKLM/Drivers/...../SDMemory_Class to replace the existing sdmemory.dll
client driver with my own SD card driver called MySD.dll.


I encountered the following problem in my driver code.


in the xxx_init, i have called the SDGetDeviceHandle(param1,param2)
API.
I get the HKLM/...../SDMemory_Class path in the param2 variable and got

a value for the handle returned by the API.
I used the Remote tools from EVC++ and in remote registry editor i
checked the active list of drivers. It showed one subkey as 'Hnd' and
onemore subkey as 'ClientInfo'. The handle value got from the API is
the same as the value in ClientInfo and not the one in Hnd.I expected
the value to be the one in 'Hnd' and not the one in 'ClientInfo'.
Is this a problem? if so how to correct it?


Next, i called the SDRegisterClient(...) API with the handle returned
by the SDGetDeviceHandle API as one of the parameters to
SDRegisterClient.
But this is causing an error, and the error code is 0xC0000006. I
understand that this status implies an INVALID HANDLE.


However, since the SDGetDeviceHandle API returned me the correct
registry path, i think the handle must also be correct. I cant
understand why the handle is invalid.


I hope someone can help me out on this one.


Thanks,
Nag

Re: invalid handle returned from SD API by Nagesh

Nagesh
Mon Jun 19 01:54:58 CDT 2006

Please, do help me out. I am in a fix. Am unable to proceed any further
due to this problem.


Thanks,
Nag


Re: invalid handle returned from SD API by Henrik

Henrik
Mon Jun 19 03:43:09 CDT 2006

First things first:
If the device you're trying to use as development platform implements a
trusted environment (which most PPC do), untrusted drivers will fail to
load. You need to sign the .dll, which may or may not be easilly
achieved, and it is certainly time consuming during the development
process.

Generally speaking, developing a driver using only a PPC retail device
as dev platform is usually pretty tough. I suggest you get a PB and a
dev-board that is as close to the PPC you want to target as possible.
When you think the driver works good enough on your dev-board, you
migrate the working driver to the PPC environment.

Another thing to consider when targeting PPC devices is that they
allready utilize almost all available memory, and it might actually be
difficult to squeeze in yet another .dll into slot0/slot1.

Anyway, Imate recently have started distributing special unlocked
"developer device" versions of some of their products. You might want
to get one of those.

Henrik Viklund
http://www.addlogic.se


Nagesh wrote:
> Please, do help me out. I am in a fix. Am unable to proceed any further
> due to this problem.
>
>
> Thanks,
> Nag