Reading Compact Flash image

Does anybody know of a tool to read/write a QNX image from/to a Compact
Flash card connected to a Windows PC via a USB reader/writer? Windows
alone does not understand the QNX4 format of the disk.

We would like to use such a tool to install our production image to
compact flash (once we have an image that boots correctly).

Thanks for any replies
William Morris

I think if you use MFC’s CreateFile() and ReadFile()/WriteFile() you can do
a sector level read and write to a device.

Say your compact flash is mounted to drive X: the your code would be
something like this:

HANDLE hDevice;
char compactFlashDeviceName[] = “\\.\X:”;

hDevice = CreateFile( compactFlashDeviceName,
GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, NULL);


Then use ReadFile(hDevice,…) to read the entire flash disk into an image
and use WriteFile(hDevice, …) to write the image.

There are some code samples with reading floppy disks floating around the
internet, and I believe you should be able to use the same principles.


Jens


“William Morris” <william@bangel.demon.co.uk> wrote in message
news:3E9BBEB7.FCADF8FB@bangel.demon.co.uk

Does anybody know of a tool to read/write a QNX image from/to a Compact
Flash card connected to a Windows PC via a USB reader/writer? Windows
alone does not understand the QNX4 format of the disk.

We would like to use such a tool to install our production image to
compact flash (once we have an image that boots correctly).

Thanks for any replies
William Morris

Jens

Thanks. Being lazy by nature, I was really hoping for a
tool that would do it for me. I shall use dd on QNX
and forget about Windows (I like to do that anyway).

Strangely, a dd’d copy of the flash disk does not work, but
that is another story.

Thanks
William

In article <3E9D30B8.BFFF1422@bangel.demon.co.uk>, william@bangel.demon.co.uk says…

Jens

Thanks. Being lazy by nature, I was really hoping for a
tool that would do it for me. I shall use dd on QNX

There is dd ported to Windows too.

and forget about Windows (I like to do that anyway).

Strangely, a dd’d copy of the flash disk does not work, but
that is another story.

Thanks
William

It is easily done under QNX using a PCMCIA CF adapter, and they are cheap
(~20$).
Martin

“William Morris” <william@bangel.demon.co.uk> wrote in message
news:3E9BBEB7.FCADF8FB@bangel.demon.co.uk

Does anybody know of a tool to read/write a QNX image from/to a Compact
Flash card connected to a Windows PC via a USB reader/writer? Windows
alone does not understand the QNX4 format of the disk.

We would like to use such a tool to install our production image to
compact flash (once we have an image that boots correctly).

Thanks for any replies
William Morris