home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
sysutl
/
tryst.arc
/
TRYST2.DOS
< prev
next >
Wrap
Text File
|
1988-03-31
|
13KB
|
229 lines
TRYST DOS #2
In the first TRYST DOS article, I covered a few things about how
systems boot up and what errors may occur. In this article, I will
cover a few more items about booting and what you might try if you get
errors.
Sometimes when you try to boot your system, you get an error
message produced by the boot record on your boot disk. ALL disks
(including all hard disks and all floppy disks) have boot records; a
boot record is created during the formatting process. The boot record
contains instructions describing the kind of disk you are using so
that it may access files on it, and it contains the following error
messages: "Non-System disk or disk error, Replace and strike any key
when ready" and "Disk Boot failure".
If the boot record can not find IBMBIO.COM and IBMDOS.COM on the
disk you are trying to boot on, you will get the "Non-System disk..."
error. IBMBIO.COM and IBMDOS.COM are parts of the DOS operating
system. They are hidden, system files, so you normally do not see
them if you perform a directory. Utilities such as Norton's will
allow you to look at them, and you can even change the attributes so
they are no longer hidden and can still boot on the disk. They are
only required to be present and in a particular location to enable the
user to boot up. If you have just forgotten to put the operating
system on your boot disk, you should do so using either FORMAT B:/S or
SYS B:. If your boot disk (which can be either a floppy or a hard
disk) already has files on it, there is no longer any room for the
operating system, so you must either copy the files to another floppy
and then reformat the boot disk using the /S parameter with the FORMAT
command (for example, FORMAT B:/S) or delete everything on the boot
disk (DEL *.*) and use SYS to put the operating system on the disk,
(SYS B:). If you use SYS, remember to copy COMMAND.COM onto the disk
as well.
You may also get the "Non-System disk..." message if the
IBMBIO.COM and/or IBMDOS.COM have become corrupted and are no longer
able to run. Thankfully, this does not happen often, but if you are
trying to boot and you are sure you have an operating system on the
boot disk, then it is possible that this has happened and you can just
perform another SYS command to put fresh copies of the operating
system back on your boot disk. (Also, remember to use your backup
copy of the original DOS diskette to perform the SYS or FORMAT
operations, just in case you accidentally tell it to format or perform
the SYS on the wrong drive!) Also, since IBMBIO.COM and IBMDOS.COM are
both hidden, system files, there is really no way of knowing if you
really do have the operating system on your disk, unless you look at
it with Norton's Utilities or some other disk utility that lets you
look at hidden files. The presence of COMMAND.COM usually indicates
that you do have the system on the disk, but not always. You can copy
COMMAND.COM to a disk that does not have IBMBIO.COM AND IBMDOS.COM on
it. COMMAND.COM alone does not make a bootable disk.
The error message "Disk Boot failure" may happen if the boot
record has problems reading the disk, but generally it indicates that
something may have happened to the boot record itself and it can not
call up IBMBIO.COM and IBMDOS.COM to finish the booting process. When
this occurs, most users find that they must reformat the boot disk,
which means reformatting their hard disk, if they are using one.
(This is where a backup is very nice to have, otherwise you may never
see that data on your hard disk again.) There is one other trick that
you can try though, if you have planned ahead. You can use DEBUG to
make a copy of your boot record and store that copy on a floppy.
Then, if worse comes to worse, you can attempt to replace a bad boot
record with this copy and see if that cures the "Disk Boot failure"
problem. The boot record is 512 bytes long, which means it occupies
exactly 1 sector on a disk. To make a copy of the boot record on a
hard disk, where the hard disk is the C: drive, you would do the
following, <Enter> means to hit the ENTER key, DON'T TYPE "< E N T E R
>":
DEBUG <Enter> Start up debug at the prompt
- "-" is Debug's prompt
L 100 2 0 1 <Enter> Enter L for "load"
100 for the address where the
"loaded" information
will be stored
2 is the C: drive (0 is A:, 1 is
B:)
0 is the first sector on the disk
1 is how many sectors you want
(Boot records are 1 sector
long, or 512 bytes)
D 100 <Enter> *Optional, just to see what has been loaded,
generally, it will at least show
the DOS version, such as IBM 2.1,
on the far right-hand portion of
the screen. The rest will just be
"garbage" to us, though it means
something to the computer.
N BOOT.REC <Enter> Enter N for "name" and the name of the
file you want to make out of the
boot record, when you save it.
R CX <Enter> Enter R for "register" and CX for the
register name. You must put the
length of the file in this
register. The length is 512 bytes,
which is 200 in Hex. Debug uses
Hex.
200 <Enter> Enter 200 at the ":" prompt.
W 100 <Enter> Enter W for "write" to write the data which
starts at 100 (where you loaded
it). This saves the boot record in
the file you named in the N
command.
Q <Enter> Enter Q to "quit" and exit from Debug.
The reason you placed the boot record data at the offset address
100 in Debug is to enable you to use the N command to name the file
you will create. This is necessary because N stores the name at 80
hex, so if you loaded the boot record starting at 0, then the part of
the boot record at 80 hex would be overlaid with this file name (which
would, naturally, destroy the data and make the boot record invalid).
The addresses in Debug are really offsets within a particular 64K
section of memory. This is why you see two numbers on the left-most
portion of the screen when you do a D to "dump" or look at what is in
memory at any point. Debug displays the addresses as nnnn:nnnn. The
first 4 digits are WHICH 64Kb segment you are talking about and the
last 4 digits after the colon are an OFFSET within that segment. So
100 hex is actually 256 decimal bytes into the segment (the 256th
byte).
Next to the addresses on the line are 16 bytes displayed in hex
and then on the far right is the ASCII (plain english) interpretation
of those data bytes. Since most of the boot record is data for the
computer's use, it is not in english and just looks like nonsense.
Only the version number and the error messages which may be displayed
to the user can actually be displayed in an understandable form.
If you wish, before you quit from Debug, you can display the boot
records error messages by using the command "D 270" to display what is
in memory starting at 270 hex. When the boot record is loaded, this
is approximately the address where the error messages are stored. The
entire boot record itself runs from 100h to 300h if you loaded it into
Debug at offset 100h. (300h - 100h = 200h which is the length of the
boot record, 512 decimal is 200 in hex). You can display the entire
boot record by entering "D 100 300").
To use BOOT.REC, you would again go into DEBUG, but this time,
you would load it with BOOT.REC, and then write the data from that
file directly into the first sector on the boot disk. For example:
DEBUG BOOT.REC <Enter> At the DOS prompt begin Debug with BOOT.REC
- this automatically loads BOOT.REC
starting at Hex 100
D 100 <Enter> *Optional, you can display it if you want
W 100 2 0 1 <Enter> Enter W to write the data starting at 100 hex
to drive 2 (C:, A: = 0, B: = 1, etc.)
0 means sector 1 on the disk specified
1 for a length of 1 sector (512 bytes)
Q <Enter>
If this doesn't solve the booting problem, you will probably just
have to reformat with the /S parameter to put the operating system and
a fresh boot record on your boot disk. But, before you do this, just
try doing a SYS and then copy the COMMAND.COM to the boot disk
(presumably the hard disk, it's silly to do this much work for a
floppy).
What is Actually in the Boot Rec?
Here is the first line of a boot record, shown as Debug would
display it.
255C:0100 EB 34 90 49 42 4D 20 20-33 2E 32 00 02 04 01 00 .4.IBM 3.2.....
The 255C:0100 is the address, we are looking at the data starting
at 100h. The next few double digits are the hex codes for the data,
49 is the hex for the letter "I", 42 is "B", etc. On the right is the
ASCII, or english, translation of what those hex codes mean. If there
is no real english translation for a code, it just displays a ".".
You'll notice that the computer's instructions appear mostly as dots.
You won't see the instructions in english unless you unassemble them.
As a test, you could enter "U 100" to see the first computer
instruction which is a jump to a particular location. The 90 hex is
simply a NOP, or no operation, code which the computer inserts with a
jump instruction in case the address takes two bytes instead of 1
byte. (A far address would require two bytes, this address is near).
The boot record begins with a two byte jump instruction which
gets the computer "around" the text and data and into the actual
instructions for it. On the boot record for my AT's hard disk, the
first two bytes are "EB 34" in hex. The EB is a jmp instruction and
the 34 is the offset address for the "real" instructions. When the
ROM BIOS finishes checking the hardware, it looks for a boot record on
either the hard disk or a floppy and then it lets the boot record find
IBMBIO.COM and IBMDOS.COM to finish the boot up process. So, after
the ROM BIOS finds the boot record on my disk, it starts executing it,
and the first thing that happens is that it jumps to 34 hex and
continues with the instructions it finds there. It must do this jump
because the stuff after the jump instruction are not computer
instructions at all, but actual data which the user can read.
Following the jump instruction is the version number for the type
of DOS you are using. On my boot record, it is IBM 3.2.
After the text "IBM 3.2", the data indicates how the disk is
formatted. The 11th and 12th bytes indicate the number of bytes per
sector (0200h is 512 bytes). The 13th is the number of sectors per
cluster (on a hard disk with 3.2, it is 04, on a floppy it may be 01
or 02). The 14th and 15th bytes are the number of reserved sectors at
the beginning of the disk (01 00). The 16th byte is the number of
copies of the File Allocation Table (FAT) there are (02). The 17th is
the number of root directory entries (64 or 112, or 0002 which is read
as 200 = 512 entries). The 19th and 20th contains the total number of
sectors on the disk (07F8 hex). The 21st is the format ID (F8 on my
hard disk running DOS 3.2). The 22nd and 23rd are the number of
sectors per FAT (29 00) The 24th and 25th contain the number of
sectors per track (00 11 which is 17 in decimal). The 26th and 27th
contain the number of heads. The 28th and 29th bytes contain the
number of special reserved sectors (11 00).
That is a total of 8 fields, which takes up 32 bytes. After all
the data described here, the boot record has instructions which the
ROM BIOS uses to find whether this is really a boot disk at all
(contains IBMBIO and IBMDOS) or whether one of the error messages
listed above should be sent to the user.
The next part of the boot up process is performed by IBMBIO.COM and
IBMDOS.COM. Since TRYST2.DOS is already too long, TRYST3.DOS will
cover what they do, what error messages you might receive if something
goes wrong with those files, and this will hopefully finish up the
booting process.
Amy J. Goebel
ges are stored. The
entire boot re