Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HD manufacturer/serial#

50 views
Skip to first unread message

Marcel Wulffraat

unread,
Nov 15, 1997, 3:00:00 AM11/15/97
to

Am looking for a utility program (DOS/W95) which provides
HD-info, such as serial#, type of HD, production-date, available
cache, etc. and also (maybe) the name of the manufacturer.

Regards,
Marcel Wulffraat
wul...@xs4all.nl

Haroldo Sotomayor

unread,
Nov 17, 1997, 3:00:00 AM11/17/97
to Marcel Wulffraat

Look at this program:

idediag.c:

/********************************************************************
idediag
shows characteristics of IDE hard disks.
Public Domain by Paolo Bevilacqua, Rome.
You can add more disk type to the idetypes[]
table, and distribuite freely.
********************************************************************/


#include "1010_hdc.h"


unsigned secbuf[256];
int drive;

struct {
unsigned cylinders,
heads,
sectors;
char *name;
} idetypes[] = {
{ 667, 4, 33, "Fujitsu M2611T (42.9 MB)" },
{ 667, 8, 33, "Fujitsu M2612T (85.9 MB)" },
{ 667, 12, 33, "Fujitsu M2613T (128.9 MB)" },
{ 667, 16, 33, "Fujitsu M2614T (171.9 MB)" },
{ 782, 2, 27, "Western Digital WD93024-A (20.6 MB)" },
{ 782, 4, 27, "Western Digital WD93044-A (41.2 MB)" },
{ 845, 3, 35, "Toshiba MK232FC (45.4 MB"},
{ 845, 7, 35, "Toshiba MK234FC (106 MB"},
{ 965, 5, 17, "Quantum ProDrive 40AT (40 MB)"},
{ 965, 10, 17, "Quantum ProDrive 80AT (80 MB)"},
{1050, 2, 40, "Teac SD-340 (41 MB)"},
{ 776, 8, 33, "Conner CP-3104 (100 MB)"},
{ 745, 4, 28, "Priam 3804M 40.7 MB"},
{ 944, 14, 40, "Quantum LPS270A (270 MB)"},
{ 0, 0, 0, ""}
};

struct ideinfo {
unsigned genconf,
fixcyls,
remcyls,
heads,
bytetrack, /* bytes per track */
bytesector, /* bytes per sector */
sectors, /* sectors per track */
byteisg, /* bytes intesector gap */
byteplo, /* bytes in sync */
worduniq; /* words unique status */
char serial[20];
unsigned contype, /* controller type */
bufsiz, /* buffer size in 512 byte blocks */
byteecc; /* ECC bytes trasferred in read/write long */
char firmware[8], /* firmware revision */
model[40]; /* model ID */
unsigned secsint, /* number of sectors transferred per interrupt
*/
dblword, /* double word transfer flag */
writepro; /* write protect */
};

printinfo() {

struct ideinfo *id = (struct ideinfo *)secbuf;
int i, capacity;
char c, *type;

/* get disk type by characteristics */
for (i=0; idetypes[i].cylinders != 0; ++i)
if (idetypes[i].cylinders == id->fixcyls &&
idetypes[i].heads == id->heads &&
idetypes[i].sectors == id->sectors) {
type = idetypes[i].name;
break;
}

/* unknow disk */
if (idetypes[i].cylinders == 0) {
type = "Unknown ";

/* calculate capacity in MB */
capacity = (id->fixcyls * id->heads * id->sectors) / 2048;
itoa(capacity, type+8, 10);
strcat(type, "Mbytes");
}

/* swap bytes in ASCII fields except for WD disks */

if (i != 4 && i != 5) {

for(i=0; i < 10; ++i) {
c = id->serial[i*2];
id->serial[i*2] = id->serial[i*2+1];
id->serial[i*2+1] = c;
}

for(i=0; i < 4; ++i) {
c = id->firmware[i*2];
id->firmware[i*2] = id->firmware[i*2+1];
id->firmware[i*2+1] = c;
}

for(i=0; i < 20; ++i) {
c = id->model[i*2];
id->model[i*2] = id->model[(i*2)+1];
id->model[i*2+1] = c;
}
}

printf("Informations for drive %u, %s\n"
"Drive ID: %04X\n"
"%u fixed cylinders, %u removables\n"
"%u heads, %u sectors\n"
"Serial number: %.20s\n"
"Controller firmware: %.8s\n"
"Controller model: %.408s\n"
"%u bytes per track, %u per sector\n"
"%u bytes of intersector gap, %u of sync\n"
"Controller type %u, buffer %u Kbytes\n"
"%u bytes of ECC, %u sector(s) transferred per interrupt\n"
"Double word transfer %s allowed, %s write protected.\n",

drive, type,
id->genconf,
id->fixcyls, id->remcyls,
id->heads, id->sectors,
id->serial,
id->firmware,
id->model,
id->bytetrack, id->bytesector,
id->byteisg, id->byteplo,
id->contype, id->bufsiz / 2,
id->byteecc, id->secsint,
id->dblword ? "" : "not", id->writepro ? "" : "not");

}

main() {

drive = 0;

/* disable interrupt from drive */
outp(HDC_FIXED, HDC_FIXED_IRQ);

/* set up task file parameter */
outp(HDC_SDH, 0xA0 + (drive<<4));

/* issue read parameters */
outp(HDC_COMMAND, HDC_COMMAND_READPAR);

/* read up sector */
readsect();

/* print out info */
printinfo();

}

readsect() {

int i;

/* poll DRQ */
while(inp(HDC_STATUS) & HDC_STATUS_BUSY)
;

/* read up sector */
for (i=0; i<256; ++i)
secbuf[i] = inpw(HDC_DATA);

}
--

1010_hdc.h:

/* read/write */
#define HDC_DATA 0x1F0
#define HDC_ERROR 0x1F1
#define HDC_SECCOU 0x1F2
#define HDC_SECNUM 0x1F3
#define HDC_CYLLOW 0x1F4
#define HDC_CYLHIGH 0x1F5
#define HDC_SDH 0x1F6

/* read */
#define HDC_STATUS 0x1F7
#define HDC_ALTSTA 0x3F6

/* write */
#define HDC_COMMAND 0x1F7
#define HDC_FIXED 0x3F6

/* commands */
#define HDC_COMMAND_RESTORE 0x10
#define HDC_COMMAND_SEEK 0x70
#define HDC_COMMAND_READ 0x20
#define HDC_COMMAND_WRITE 0x30
#define HDC_COMMAND_FORMAT 0x50
#define HDC_COMMAND_READVER 0x90
#define HDC_COMMAND_DIAG 0x90
#define HDC_COMMAND_SETPAR 0x91
#define HDC_COMMAND_WRSTACK 0xE8
#define HDC_COMMAND_RDSTACK 0xE4
#define HDC_COMMAND_READPAR 0xEC
#define HDC_COMMAND_POWER 0xE0

#define HDC_FIXED_IRQ 0x02
#define HDC_FIXED_RESET 0x04

#define HDC_STATUS_ERROR 0x01
#define HDC_STATUS_INDEX 0x02
#define HDC_STATUS_ECC 0x04
#define HDC_STATUS_DRQ 0x08
#define HDC_STATUS_COMPLETE 0x10
#define HDC_STATUS_WRFAULT 0x20
#define HDC_STATUS_READY 0x40
#define HDC_STATUS_BUSY 0x80
--

Hope this help

Regards,
Haroldo


Marcel Wulffraat escribió:

Milton

unread,
Nov 17, 1997, 3:00:00 AM11/17/97
to

At precisely, Sat, 15 Nov 1997 10:07:29 GMT
ID: <346d5e1...@news.xs4all.nl>
Newsgroup: news:comp.sys.ibm.pc.hardware.storage

Marcel Wulffraat felt inclined to proclaim:

>
>Am looking for a utility program (DOS/W95) which provides
>HD-info, such as serial#, type of HD, production-date, available
>cache, etc. and also (maybe) the name of the manufacturer.

Try this DOS utility:
ftp://ftp.coast.net/SimTel/msdos/diskutil/ataid011.zip

--
垂垂垂垂垂垂垂垂垂姣遙遙遙遙遙遙遙遙遙
Milton B. Hewitt
CAUCE Member - http://www.cauce.org
Be part of the solution, join today.
垂垂垂垂垂垂垂垂垂遙遙遙遙遙遙遙遙遙遙

0 new messages