This is only a preview of the August 1995 issue of Silicon Chip. You can view 31 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Vifa JV-60 2-Way Bass Reflex Loudspeaker System":
Items relevant to "A Gain-Controlled Microphone Preamp":
Articles in this series:
Items relevant to "Build The Mighty-Mite Powered Loudspeaker":
Items relevant to "Computer Bits":
|
COMPUTER BITS
BY GEOFF COHEN
An easy way to identify IDE
hard disc parameters
Losing the CMOS setup in your computer is a
real nuisance if you don’t have a copy of the hard
disc drive parameters. Diskinfo.exe is a nifty little
utility program that will automatically retrieve
the required disc parameters for you.
This article was written in response
to an earlier article entitled “CMOS
Memory Settings – What To Do If
The Battery Goes Flat” (SILICON CHIP,
May 1995). In that article, the author
described how to re-enter a PC’s CMOS
setup values if they were lost.
One of the things emphasised in
the original article was that all PC
owners should keep a record of their
hard disc drive parameters for just
such an eventuality. Unfortunately,
not all owners do that and the relevant
information is not always attached to
the drive unit.
I have been designing electronic
hardware, writing software and repairing PC problems for many years
now, so having PCs crash on me is
no novelty.
As a full-time computer professional, there are two problems that have
given me considerable hassles with
PCs over the past few years. These
problems are: (1) what to do if the
CMOS crashes with a good battery;
Fig.1: this screen grab shows the information returned by the program. As well
as the number of cylinders, heads and sectors per track, it also includes the
drive capacity, its model and serial numbers, the buffer size and the number of
bytes per sector.
72 Silicon Chip
and (2) finding out the hard disc type
if you do not have easy physical access
to the drive itself (eg, in laptop PCs),
or if the details are not attached to the
drive in the first place.
Why does the CMOS crash?
Let’s take a look at the CMOS memory problem first. In my experience, it
is not always a flat battery that causes
the CMOS to crash. In fact, some
motherboards are prone to losing their
CMOS setup when combined with
certain power supplies.
As a rule of thumb, if this happens
with a good battery more often than
once every two months, then it’s quite
possible that there is a fault on the
motherboard, in the power supply or,
very occasionally, on a bus card.
If this is occurring with your PC and
it is still under warranty, you should
return it to your supplier as soon as
possible. Some intermittent faults can
take a long time to track down, since
there are usually a lot of possible causes that have to be eliminated.
However, if the fault is reported
to the supplier before the warranty
period expires, they have to fix the
problem, even if the warranty period expires before the fault is finally
rectified.
I have also noticed that CMOS
memory problems are more likely to
occur in the “el cheapo” motherboard
upgrades, although this problem is not
as frequent as it once was. I usually
find out about it after my customer
has had their old “AT” or 386 PC upgraded to a 486 and then, after it fails,
can’t get it fixed under warranty, as
the “el cheapo” supplier is no longer
in business. Just another example of
Notes On The Operation Of DISKINFO.EXE
Diskinfo.exe is a C utility program written by Geoff Cohen and Alan Vidler.
It retrieves the IDE hard disc details from IBM (& compatible) AT, 386, 486
and Pentium PCs, independently of the state of the CMOS or BIOS. This is
useful when the CMOS is incorrect or has no hard disc details entered, as
happens with a new motherboard.
The Diskinfo.exe program uses the standard ATA (IDE) disc command
set, sending commands to and receiving status details and textual data from
the ATA disc drive. I found a lot of useful details in AT attachment interface
specifications ATA2-R3.DOC, which I downloaded from the Internet before
we started writing Diskinfo.exe. Alan Vidler looked at the Linux hard disk
I/O source code and did most of the initial design of the program.
While the complete list of commands is too long to go into, the basic
operation of Diskinfo.exe is:
(1). Check if the drive is an IDE type & exit if not;
(2). Send the Identify Drive command;
(3). Receive the details, format & display on screen;
(4). Repeat steps 1-3 for Drive 1
On a more detailed level, the program first checks if Drive 0 (ie, C:) is
an ATA (or IDE) drive, by sending the command HD_CURRENT (0x1f6) to
I/O port A0. It then waits 20ms, checks if the ready bit (0x40) is set, and
exits if it isn’t.
Next, it sends the identify drive (0x1f7) command to the I/O port, waits
20ms, then reads the information returned from the ATA disc drive and
displays it on the screen.
This complete procedure is then repeated for Drive 1 (ie, D:), the only
difference being that the commands are sent to I/O port B0 instead of A0.
In addition, the message “press any key for drive D Information” appears
on the screen.
It is also worth mentioning that this information can be sent to a file by
redirecting the output. This is done by typing (at the A:> prompt):
DISKINFO>FILENAME
TANSTAAFL1, I guess (1there ain’t no
such thing as a free lunch).
Another less frequent cause of
CMOS problems is the 240V mains
power. In particular, mains spikes may
propagate through the power supply
to the CMOS while the computer is
running. This can cause an error the
next time the computer is switched on
but usually the PC just hangs when the
spike arrives.
I always recommend fitting a mains
spike suppressor for every PC installation. As far as I am concerned, mains
spike suppressors are like chicken
soup – they may help and they cer
tainly won’t hurt. For network and
small commercial systems, a UPS
(uninterruptable power supply) is a
must – at least for the server.
If you write programs, another
source of CMOS errors is the odd
program crashing when you try to run
it and then going haywire. Of course,
this has never happened to me; well,
would you believe hardly ever?
When a program runs haywire, there
is a low but finite probability that it
will write odd characters all through
your PCs memory and this can very
easily put rubbish into the CMOS
memory. C and Assembler are really
good at this and I have even managed
to get normally well-behaved compilers to crash the CMOS, but I really had
to work at it.
What hard disc is it?
Now we get to the difficult part –
finding out what type of hard disc is
lurking under your PC’s cover when
the CMOS thinks you don’t have a hard
disc at all. In the past, I have nearly
gone mad trying to find what the hard
disc parameters were on a PC (ie, the
number of heads, cylinders and sectors
per track). This is even more difficult if
my client is in another city, as I cannot
personally open the case and have a
look inside.
Physically checking for hard disc
information has become easier of late,
with most manufacturers now printing
the specifications on a label attached
to the top of the disc drive. Of course,
this is no help if you own a disc drive
that doesn’t have a specifications label.
And even if the information is there,
you still have to open your PC to inspect it. This can take a fair amount
of time on some PCs, especially if the
hard disc is buried in the drive bay
beneath one of the floppy disc drives
and has to temporarily be removed so
that the label can be seen.
When servicing older PCs, I have
sometimes had to completely remove
the hard disc from the computer, just
to discover the brand and model, and
then try to find the details in assorted
lists supplied (sometimes grudgingly) by the hard disc manufacturers.
Sometimes, even this didn’t provide
an answer and I was forced to enter
the most common hard disc values
into the CMOS on a trial and error
basis, sometimes spending hours on
the more obscure models.
Diskinfo.exe
Fortunately, these trials are no
longer necessary, as there are now
some really nifty utilities around
which will retrieve the hard disc
parameters from a PC, even when
the CMOS is com
p letely cleared
(non-computerese for trashed). I normally use one written by myself and
Alan Vidler (of AV Software), which
we have placed in the public domain.
Called DISKINFO.EXE, it provides
details on IDE drives. These form the
overwhelming majority of the small
to medium-capacity hard disc drives
sold over the last few years. In operation, the program bypasses the system
BIOS and accesses the drive (or drives)
directly. The disc drive parameters are
then displayed on the screen.
Fig.1 shows the information returned by the program. As well as the
number of cylinders, heads and sectors
per track, it also includes the drive
capacity, its model and serial numbers,
the buffer size and the number of bytes
per sector.
Note, however, that the software
will not work with SCSI drives or with
some types of caching controllers and
other non-standard controllers (even
if they are controlling an IDE drive). If
August 1995 73
How To Make A Bootable Diskinfo.Exe Floppy
When you receive your copy of DISKINFO.EXE, you will need to copy it
to a bootable floppy, so it can be used if your CMOS becomes corrupted as
some later date. First, go to the DOS prompt, then put the disc containing
DISKINFO.EXE in floppy disc drive A and copy it to drive C by typing:
COPY A:DISKINFO.EXE C:\ (or COPY B:DISKINFO.EXE C:\ for drive B.
When this has finished, remove the DISKINFO.EXE floppy disc and install
the floppy disc that is to become your boot disc in drive A. Now, from the C:>
prompt, type: FORMAT A:/S (or FORMAT A:/S/U for MS DOS 6).
When this is complete, type: COPY C:\DISKINFO.EXE A:
After this is completed, you can test that the boot disc functions correctly
by rebooting the PC with this disc still in drive A. When the PC has booted
up, you need to press <Enter> twice to get past the time & date questions.
If you now type DISKINFO at the A:> prompt, the screen should display data
similar to that shown in Fig.1.
It would, of course, be a good idea to write this information down now,
rather than after the CMOS information is lost. I always write the hard disc
parameters (number of heads, cylinders and sectors per track) on a self-adhesive label and stick it to the back of the PC.
a non-supported controller is found,
a reject message is displayed and the
program exits. Alternatively, with
some caching controllers, the program
will display nonsense results and fail
to show the Model Number, Firmware
Revision number or Serial Number.
In either case, this doesn’t cause any
problems since the program cannot
write to the disc or alter any of its
parameters.
Assuming that your CMOS has
crashed, the procedure is to first restore all the CMOS settings (see the
May 1995 article), except for the hard
disc type. This should initially be left
at “None” (sometimes called “Type 0”
or “No Hard Disc”).
Now return to the Main Menu of
the CMOS Setup utility and carefully
check the menu items. Many late-mod-
el PCs have an option which will automatically fill in the hard disc numbers
for you. This menu item is usually
called “IDE HDD (Hard Disc Drive)
Auto Detect”, or someting similar.
If your PC has this option, then
select it and press the <Enter> key.
This will run a HDD auto detect utility
and will write the correct hard disc
details (number of heads, cylinders
and sectors per track) into the CMOS
memory. You then only need to return
to the Main Menu of the CMOS Setup
and save these corrected settings. The
PC will now reboot with the hard disc
running normally.
If your PC does not have this option,
you will need to boot the machine
from a floppy disc containing the
DISKINFO.EXE utility. When you
run the utility (ie, type DISKINFO at
the A:> prompt), it will
show a screen similar to
that shown in Fig.1. Note
the number of cylinders,
heads and sectors per
track, then remove the
floppy disc, reboot your
PC and again proceed to
the CMOS Setup screen.
This is usually accomplished by pressing the
<Del> key when prompted to do so, as described
in the earlier article. Now
go to the Standard CMOS
Setup, select Hard Disc C
Fig.2: most manufacturers now print the disc drive
(sometimes called Hard
parameters on an attached label.
74 Silicon Chip
Disc 0) and select Type 47 (may also
be called “User” or “User Defined”). As
indicated by the legends at the bottom
of the screen, you select the entries
using the arrow keys and modify the
entries using the Page Up and Page
down keys.
The hard disc parameters that you
obtained from DISKINFO.EXE (and
wrote down) are now entered. This
is done by selecting the relevant
heading and entering the appropriate
value directly via the keyboard. These
headings are:
Cyl = number of cylinders;
Head = number of heads; and
Sect = number of Sectors per track.
The other two hard disc entries are
not critical. I usually enter 65535 for
WPcomp (sometimes called Precomp)
and 1024 for Lzone (sometimes called
LandZone). The Setup screen should
now show the correct hard disc size
underneath the “Size” heading.
All you need to do now is to return
to the CMOS Setup’s Main Menu and
save these new settings. Your computer should now boot normally from the
hard disc drive, just as it used to before
the CMOS setup was lost.
As a final point, note that if you
have a SCSI hard disc, you must always choose “Type 0” for this type
of drive. I have received frantic calls
from customers with SCSI hard discs,
asking why their PC won’t boot up
after they have restored (or changed)
the CMOS Setup.
Despite what is in the hard disc
manual, they sometimes choose a
“Type 47”, often because of a helpful
friend who “knows all about computers” and thinks that a “Type 0” is incorrect. Of course, when they attempt
to boot up the PC, it either hangs or
gives a hard disc error message.
The remedy is simple – just reset
the hard disc to a Type 0.
Obtaining DISKINFO.EXE
The program DISKINFO.EXE is
available for $10 (incl. p&p) from Silicon Chip Publications (see software
advert), or directly from the Author at
PO Box 136, Kippax, ACT, 2615.
Alternatively, you can email me at
gcohen<at>pcug.org.au for a copy via the
Internet. I log on to the Internet daily,
or via Compuserve at 100026,307 (but
I only check here once a week). I am
also available at any of these addresses
for anyone who has problems that they
SC
can’t solve on their own.
|