Hard disk manufacturer's serial number

Is there any way to read manufacturer’s serial number from a hard disk
on QNX4. I want to do this from a program written in C.

JQu

A little utility located at
ftp://ftp.qnx.com/usr/free/qnx4/os/utils/disk/idediag.gz seems to do this
however I’ve had bad experiences with this program. (i.e. causes all disk
access to delay indefinitely until reboot) (also no source code)

So to get around that I made a little program that talks to the IDE
controller, sends the ATA Identify Device command and stores the reply in a
shared memory buffer (/dev/shmem/raw_disk_info).

This program is built into the boot file after Fsys but before Fsys.eide
and another program can open the shared memory and read it whenever
necessary.

If there is a more straightforward way of doing this I’d love to see it.

“Damian Jakubowski” <djakubowski@mikrob.pl> wrote in message
news:dmfjqa$8uf$1@inn.qnx.com

Is there any way to read manufacturer’s serial number from a hard disk on
QNX4. I want to do this from a program written in C.

JQu

Jason Schalkwrote:
If there is a more straightforward way of doing this I’d love to see

it.

Hello Jason,
I believe I’ve found the straightforward way…
I’m running the code AFTER the system has finished booting, and so far
it hasn’t messed up anything :wink:
If you can enlighten me on how to parse the below buffer output from
the code, I can show you the way:

0x08047da0 40 ff 37 10 00 00 3f 00 00 00 32 30 5a 47 20 20
@.7…?..20ZG
0x08047db0 20 20 20 20 03 00 39 41 34 45 30 61 74 72 36 31
…9A4E0atr61
0x08047dc0 30 30 20 20 20 20 20 20 20 20 20 20 20 20 20 10 00
.
0x08047dd0 00 00 00 00 00 07 ff 10 3f 10 fb 10 d0 ab 00 07
…?..
0x08047de0 03 78 78 78 78 00 00 00 00 00 00 1f 00 00 00 00
xxxx…
0x08047df0 fe 1e 6b 09 63 69 01 63 7f 00 00 00 fe 0b fe 00
…k.ci.c…
0x08047e00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x08047e10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x08047e20 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x08047e30 00 00 00 00 00 00 01 00 ff ff 00 00 00 00 00 00

0x08047e40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x08047e50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x08047e60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 21 00
…!.
0x08047e70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x08047e80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x08047e90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 a5

Regards,
Jacob