home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
sysutl
/
tryst.arc
/
TRYST1.DOS
next >
Wrap
Text File
|
1988-03-31
|
17KB
|
257 lines
TRYST DOS
This is the start of a series of articles about IBM PC-DOS and
hardware. In these articles, I will try to cover things that novice or
advanced users may find useful, (or simply that interest
me). If there is something that you would like to know about or have a
question on, leave a note to Amy Goebel on this RBBS and I will either
answer it in the mail system or include it in one of these articles if it
seems to be of general interest.
To start this off, I will cover some information about hard disks. In
the past there have been a lot of questions about formatting/partitioning
hard disks.
Some terms used in this article:
Hexidecimal, or Hex, expressed as a number = nnH. This is a numbering
system based on base 16. It is expressed with the numbers 0-9 and A, B, C,
D, E, and F. Hex is used frequently because 8 digit binary numbers break
down into 2 digit hex numbers very easily. The 4 binary digits = 1 hex
digit. The binary number 1111 1111 is equal to FF in hex.
Routine. When a routine is referred to in this article, it simply means a
set of instructions that the computer understands. Hopefully this set of
instructions does something useful, such as reading a file off of a disk
drive.
Bits and Bytes. There are 8 bits, or binary digits in a byte. One byte is
equal to one character, such as the letter "A".
K or Kb. Kilobytes, it is 1024 bytes. Computer memory is often referred to
as having so much K (or so many Kb), as in 640Kb of RAM. RAM is user work
area which is volatile - the contents vanish when the electricity is turned
off.
Address. Everything in the computer has an address. The 8088 CPU can talk
to 1 megabyte worth of addresses. For the user, the addresses available as
work space for programs and data occupy the addresses 0 through 640Kb,
which is where the user's RAM, or Randam Access Memory chips are located.
Above 640Kb are the addresses where the rest of the hardware lies, such as
the video screens, the ROMs, etc. Later articles will cover more in terms
of memory layout.
ROM. Read Only Memory. This is a chip in the computer which already has
computer instructions (routines) stored in it. These instructions do not
vanish when the computer is turned off, they are non-volatile. The routines
stored in a ROM can not be changed, hence Read Only, not Read/Write.
BOOTING UP WITH HARD DISKS
(WHAT CAN GO WRONG)
When the computer is turned on, a ROM called the BIOS, Basic Input
Output System, is used to "check" out your system and make sure you can
access things like your floppy drives, hard disk, your video
boards/monitors, and any memory you have. The ROM BIOS also looks on the
adapter cards you have in your computer, and searches for other ROMs. One
of the ROMs that it may find is the ROM on a hard disk controller card that
contains the routines for accessing that hard disk. On the AT, this
controller card has been combined with the floppy disk controller card, so
there is not a seperate card for the hard disk. The AT's adapter still
contains a ROM to access the hard disk and the floppy drives installed in
the AT. If the BIOS finds adapter cards with ROMs, it lets those ROMs
execute (run), to place into working memory any instructions necessary to
make the hardware work. The routines saved in the ROMs then become part
of the copy of the BIOS which remains in working memory to "run" the computer
during a session.
When IBM's ROM BIOS finds a ROM on a hard disk adapter card, it lets
that ROM take "control" of the system so that it may perform any set up
necessary to use the hard disk. The ROM BIOS searches absolute addresses
C8000H through E0000H in 2K increments, in search of a valid ROM.
It can tell a valid ROM by the first few bytes in the ROM. A
valid ROM will have 55H, AAH, a length indicator and then the assembly
language instruction to CALL FAR (to bring in a "FAR" routine). A checksum
is done on the ROM to verify its integrity, then the BIOS performs the
CALL FAR to bring in the executible code. The adapter's ROM then performs
its initialization tasks and hopefully returns control of the computer
back to the ROM BIOS so it can continue with the booting process. When the
ROM BIOS performs the CALL FAR, the hard disk ROM starts searching the hard
disk (starting at location 400 - byte 400?) for a two byte pattern
indicating the active partition. If it does not find this byte pattern,
you will get a BOOT FAILURE message. This means that the BIOS could not
find the active partition.
In addition to just indicating the active partition, the partition
table contains a code to indicate what operating system is in the
partition. DOS 2.x uses a 01 to indicate that the hard disk is formatted
for that version of DOS. And remember, when you format a "hard disk", you
are actually performing the format WITHIN a partition. This is done so you
can have other operating systems, such as XENIX, on the same hard disk as
DOS. DOS 3.x uses a value of 04. This means that if you formatted your
hard disk for DOS 3.x and then boot off of a DOS 2.x floppy, you will not
have access to the hard disk. DOS 2.x will look at the partition table and
find a value of 04 and report that the hard disk is "NON-DOS", (actually it
will tell you that Drive C: is an invalid drive). On the other hand, if
you boot off of DOS 3.x, it will recognize the "smaller" DOX 2.x number of
01 as a good DOS and allow you to access the hard disk drive. Therefore,
DOS 3.x can recognize DOS 2.x, but DOS 2.x can not recognize DOS 3.x. This
is what is meant by upwardly compatible, you can go up from DOS 2.x to DOS
3.x, i.e. DOS 3.x can read what is created under DOS 2.x, but you can not
go DOWN from DOS 3.x to DOS 2.x because DOS 2.x will not read DOS 3.x hard
disks.
There is a very good reason for this. Space on your hard disk is
"sectioned" off into pieces 512 bytes long. DOS keeps track of these
pieces with a table of section addresses called the File Allocation Table.
DOS 3.x supports larger disks (20 MB) by using a File Allocation Table
(FAT) with entries 16-bits (2 bytes) long. DOS 2.x support smaller drives
because its FAT had entries only 12 bits long. The larger bit FAT entry
meant that you could contain a larger number, therefore you could address
more space (20 MB instead of 10 MB). So, DOS 2.x can only read a FAT that
has entries 12 bits long and it simply cannot even begin to cope with the
larger FAT produced during the DOS 3.x format procedure. To prevent DOS
2.x from trying to do what it can not, the active partition value
indicating the DOS version was changed with DOS 3.x to prevent DOS 2.x from
messing around with a FAT which it could not handle. (This does not mean,
however, that you can not use DOS 2.x with a 20 MB hard disk. DOS 2.x uses
larger clusters than DOS 3.x and there are various methods used by hard
disk vendors to allow DOS 2.x to be used with larger drives.)
This change in FAT entry size is not the only change DOS 3.1 makes to
your hard disk. The space sections kept track of in the FAT are not listed
as Section 1, Section 2, etc. The FAT puts several sections together into
a cluster, and then keeps track of the space in terms of the clusters. It
does this because on a hard disk, there would be too many 512 byte sectors
for DOS to track. By putting several sectors together in a cluster, DOS
has fewer items to track. So, starting with DOS 3.x, the FAT has increased
the entry size, and decreased the cluster size. One cluster is the minimum
amount of space one file can occupy. One file will get at least one
cluster of space, even if that file only contains one byte in it.
Under DOS 2.x, the minimum cluster size was 4096 bytes long. That is 8
sectors, with each sector being 512 bytes long. Therefore, the smallest
file would be 4096 bytes, even if it just had the word "Hello" in it.
Starting with DOS 3.x, the cluster is 2048 bytes, which is 4 sectors of
of 512 bytes each. If you have a lot of small files, DOS 3.x is more
efficient since there is less "wasted" space at the end of each file.
(A floppy uses space even more efficiently, a cluster on a
floppy is only 2 sectors long, or 1024 bytes.) But smaller clusters
means more to keep track of, hence the larger FAT entries (for example,
if a FAT entry was 3 characters long, the largest number would be 999, but
a FAT entry 4 characters long could hold 9999 - a much larger number).
What this means to you in terms of booting: If you boot up on a
floppy, and you get the message that your hard disk is an invalid drive, it
could be that you are using the wrong version of DOS. The solution to this
would be to either boot up on the hard drive by removing the floppy, or try
to find a floppy with a newer DOS version. If this does not work, it could
be that someone installed a security system which changed the DOS operating
system byte value and unless you know the password or have whatever "key"
that system requires, you will not have access to the hard disk because
"plain" DOS does not recognize the partition byte.
Some security packages change the byte which determines what operating
system is in the active partition, and during boot-up, DOS does not "find"
an active, recognizable DOS partition without the intervention of the
security package. This prevents unauthorized users from gaining access to
a hard disk set up this way. If DOS does not find an active DOS partition,
it will inform the user that the hard disk is a "Non-DOS disk" and not
allow access to it. Often these packages are a combination of hardware and
software. The hardware installed in the machine has a special ROM on it
which is read by the IBM ROM BIOS and allowed to take control of the system
at boot up. If the user does not know a password, or have the key, they
will not be allowed to finish the boot up process, or the boot up may
proceed, but they do not have access to the hard disk (they will get the
message, "Invalid Drive Designation").
If you start getting errors on booting about problems with the boot
record, FAT or DIR, and you reformat and get the message that cylinder 0 is
bad and you can not use the drive, you can rerun FDISK and move the active
partition to "work around" the bad area. To do this, run FDISK and delete
the current partition and repartition the hard disk. REMEMBER: When you
create a new partition, you loose access to all the information on that
hard disk, so MAKE A BACKUP FIRST. When running Fdisk to fix a hard disk
with cylinder 0 being bad, move the active partition to start at Cylinder 1
(or 2), format, and place your files in this partition, skipping the bad
cylinder 0. This is done by saying that you do not want to use the whole
for DOS, and when it prompts you for the cylinders to use for DOS, start at
cylinder 1 instead of 0. When you boot up, it will take longer for the
BIOS to find the two byte pattern it is looking for to locate the active
partition, but this will work to skip bad areas. When you do this, you
essentially have two partitions, one with the bad areas, which is inactive,
and the active partition, which you are using.
When the two byte pattern is found, it loads the partition and other
disk information into RAM, where it stays - this is how DOS will access the
hard disk. This is also why, if you mess around with Debug or some memory
resident programs, the hard disk will suddenly become inaccessible. The
the disk system information is kept in RAM and this may be overwritten by
other programs inadvertently. If this happens, reboot.
An error message "1781" means that the drive setup information was
incorrect. For example, for a 40MB Qubie hard disk on an AT, it should be
setup as 1 drive, type 11, and Drive D is not installed (because there is
only one physical drive even though later you can split it up into two
logical drives using Qubie's software). You will get a "1781" error if you
say you do have a physical Drive D, when you really don't, if you said you
have 2 drives instead of 1, or if you specified the incorrect disk type
(should be 11 for AT 40 MB Qubie). If the search pattern (2 byte) is done
wrong (for example, in the Qubie BTformat setup), you will also get the
"1781" error. Although the example here is for a Qubie drive, this type of
error occurs on other hard disk drives as well, from similar problems. On
an AT, the information entered during setup, either by the vendor, or by a
user, should be printed out and kept with the machine. The setup
information is retained with a battery backup and eventually that battery
will have to be replaced. When it is, you will have to re-enter the setup
information, and if you do not know the type of hard disk drive you have,
you may have problems accessing that drive. To get the type of drive,
simply boot on the Diagnostic disk which came with the AT, and go through
the SETUP routine (choice 4 on the main menu). Under options, you will see
"Fixed Disk Drive C - Type 2", for example. You can print this out using
the <Shift><PrtSc> keys, or simply write it down in your "Guide to
Operations" manual. Then, when you have to replace the battery, you will
know what kind of hard disk type to enter for your fixed drive.
In addition to providing the routines to access the hard disk, the ROM
on the hard disk controller card is often used by drive retailers to do a
low-level format on their hard disk, rather than sending the user a floppy
with the low-level format on it. (IBM sells a package called "Hardware
Maintenance and Service" which contains an Advanced Diagnostic Diskette.
This diskette contains the routines to perform a low-level format on the
IBM line of personal computers). The low-level format is generally run the
manufacturer and probably should not be run by the customer unless they are
have hard disk problems such as "Data error reading drive C" or "Data write
or Data read error on Drive C". The low-level format actually establishes
sector addresses and tests the disk to find bad areas. If it finds bad
areas (and most hard disks have them and they are nothing to worry about
unless they are not found), these areas will be marked in the FAT so that
they are not used. The regular format that most users are familiar with
simply wipes the directory and FAT clean - it does not check the hard disk
for bad areas.
Depending on the hard disk controller (and the address of the ROM
routine), Debug can be used to access the low-level format routine on the
adapter's ROM. On an XT type machine, for example, the user would enter
the following: "Debug" and then, "G=C800:5". That command would run the
low-level format and hopefully find any bad areas that have developed
during the use of the hard disk, and write them out in the FAT so they are
no longer dangerous. Some utilities, such as Norton's, will check the hard
disk for bad areas and mark them in the FAT, so it may not be necessary to
perform a low-level format on your drive. During this type of a format,
you lose all the information on your drive, so be sure to back up any files
before doing it. That is one advantage to something like Norton's
utilities, or MACE utilities, they do not reformat the hard disk, so you do
not lose the information on it. Unless that information is in a bad area
already, then you may be able to recover parts of the file, but probably
not all of it. Running DOS' CHKDSK utility DOS NOT DO THIS!!!!!! If you
run CHKDSK and it tells you that your disk is okay, that does not mean that
it does not have any unnoted bad areas on it. CHKDSK merely compares the
directory entries for files against the FAT entries to be sure that no two
files say they are using the same space, and that there are enough clusters
allocated for the size of the file as indicated by the file size in the
directory entry. CHKDSK does not read and write to the hard disk to be
sure that there are no bad areas!!!! I will cover exactly what CHKDSK
does, and how the FAT and Directory work together to keep track of your
files, in a later "TRYST DOS" article.