home *** CD-ROM | disk | FTP | other *** search
- TRYST DOS #3
-
- In the second TRYST DOS article, I covered some initial
- information about the bootup process and ended with the boot record.
- This article will cover the part of the bootup process controlled by
- IBMBIO.COM, IBMDOS.COM and COMMAND.COM. That should end the bootup
- process and then in the fourth article we can go on to other things.
-
- As mentioned in TRYST2.DOS, the boot record is used by the
- computer's ROM BIOS to find the parts of the operating system which
- should be on your boot disk, whether that disk is a floppy or a hard
- disk. The boot record points to the first entry in the directory, and
- that entry should be IBMBIO.COM. Remember that both IBMBIO.COM and
- IBMDOS.COM are hidden, read-only, system files which means you do not
- see them when you do a directory. These hidden files must be present
- for you to boot up. Having COMMAND.COM alone on a disk does not make
- that disk bootable. If you see the error message "Non-System disk or
- or disk error. Replace and strike any key when ready". This error
- message is produced by the boot record when IBMBIO.COM is not the
- first file on the default disk drive.
-
- IBMBIO.COM is labeled the "interface module to the ROM BIOS" by
- IBM. (There is a fairly good explanation of the booting process in
- the "Disk Operating System Technical Reference", but I'll go over the
- major points here.) The IBMBIO.COM allows the programs running on a PC
- to access the device routines coded in the ROM BIOS. These
- "low-level" routines include the instructions for performing
- operations such as displaying information on the screen, reading the
- keyboard, sending data out to the printer, making the disk drives
- operate to access data, and so on. It is how the operating system
- controls the hardware. IBMBIO.COM contains any modifications or
- updates to the ROM BIOS that are needed to correct any bugs or add
- support for other types of hardware such as new disk drives. By using
- the IBMBIO.COM to "update" the ROM BIOS on the "fly" when the user
- turns on their computer, IBM does not need to replace the ROM BIOS
- chip itself, but makes any corrections through the cheaper and easier
- method of modifying the IBMBIO.COM file instead. (This is one reason
- why IBM DOS 3.2 came out, it needed to support the 3.5 inch floppies
- and the new screen on the IBM laptop PC.)
-
- IBMBIO.COM also keeps track of hardware operations on an internal
- stack which is a "scratch pad" area for the operating system to save
- information, such as addresses it will need. An example of the uses
- for this stack can be seen when running a program such as a word
- processor. If you have told the word processor to save your letter,
- it will write the data to your disk. During this time, if you start
- typing some more information, a hardware interrupt occurs for the
- keyboard. A hardware interrupt is just a way to let the system know
- that something is going on with the hardware. Since you don't want
- the process of writing the information to the disk to be interrupted,
- DOS allocates a slot in the stack for the keyboard's hardware
- interrupt and when it gets a chance, (probably after the data has been
- written to the disk), it can process that interrupt and pick up the
- characters you may have been typing.
-
- In DOS 3.2, only 9 slots, or frames are allocated for the stack,
- and as it turns out this is probably not sufficient to allow for all
- the hardware interrupts possible. Therefore, you can include a line
- in your configuration file, CONFIG.SYS, to increase the number of
- frames if you get the error message "Internal Stack Failure". The
- line you would need to add to the CONFIG.SYS file could be:
-
- STACKS=12,128
-
- This would give you 12 frames, or slots, for IBMBIO.COM. Each
- frame is 128 bytes long, and that parameter is necessary for the
- instruction to work, even though 128 bytes is the default size.
-
- One way to discover what kind of things the IBMBIO.COM does is to
- look at its error messages. These messages are issued by IBMBIO.COM
- when something that it is supposed to be doing fails. The messages
- include: "FATAL: Internal Stack Failure, System Halted"; "Insert
- diskette for drive A: and strike any key when ready", "Unrecognized
- command in CONFIG.SYS"; "Sector size too large in file"; "Bad or
- missing Command Interpreter"; "Invalid country code"; "Configuration
- too large for memory"; and "Too many Block Devices".
-
- Looking at these messages, you can make a guess that the
- IBMBIO.COM is the portion of the DOS operating system that reads your
- CONFIG.SYS file and puts any device drivers (i.e. DEVICE=ANSI.SYS)
- into play. You can tell this by the messages "Unrecognized command in
- CONFIG.SYS", and "Too many Block Devices", for examples.
-
- So, after the boot record is read into memory by the ROM BIOS, it
- checks the root directory to be sure that IBMBIO.COM AND IBMDOS.COM
- are present and in that order. IBMBIO.COM is then read into memory
- and the BIOS reads IBMDOS.COM into memory. IBMBIO.COM then looks at
- the system switches to determine the kind of monitor you are using, it
- checks on equipment status, such as the amount of memory (RAM)
- available, it initializes the attached devices (checks to see if you
- have a printer and if it is on), loads the device drivers from the
- CONFIG.SYS file, sets up the low-numbered interrupt vectors (they
- control things like printing when you hit <CTRL><PrtSc>), and
- reclocates IBMDOS.COM down in memory to where it is supposed to be.
- Then IBMBIO.COM releases control to IBMDOS.COM.
-
- IBMDOS.COM contains the routines such as opening a file, reading
- a file, writing a file and other kinds of file accessing. It performs
- these functions through calls to the IBMBIO.COM to perform disk
- operations and other kind of hardware operations. IBMDOS.COM is
- mostly used by applications programmers to perform file functions,
- such as opening a file in order to do something with the data in it.
- Programs such as Dbase, WordStar and so on, use IBMDOS.COM's functions
- (also called interrupts) to perform these same things. By using
- IBMDOS.COM, Dbase does not have to contain its own coding for finding
- a file on the user's disk and doing all the housekeeping chores
- necessary to open and use a file. When IBMBIO.COM releases control to
- IBMDOS.COM, IBMDOS.COM sets up its interrupt vectors (the file
- functions) and builds a Program Segment Prefix for COMMAND.COM at the
- lowest available memory segment. The Program Segment Prefix is one of
- those housekeeping chores which are necessary to open and use a file.
- It contains information such as how big a record is, what the file
- attribute is, what is the current block (to read the file), the file
- size, the current record and the drive where the file is located.
-
- There is only one error message in IBMDOS.COM and that is "Divide
- Overflow".
-
- Control then goes back to IBMBIO.COM. IBMBIO.COM uses the EXEC
- function call to load and start up COMMAND.COM or any other command
- processor which you may have specified in the CONFIG.SYS file.
- The command processor is the portion of DOS which most people consider
- to BE DOS. It gives them their prompt (i.e. C>), and it contains many
- of the internal commands, such as DIR, COPY and ERASE. It also
- contains the instructions for executing .BAT files and when the
- command processor begins running, one of the first things it does is
- to search for an AUTOEXEC.BAT file in the root directory. If it finds
- it, it will execute the batch file.
-
- The command processor, COMMAND.COM has three parts. IBM calls
- them the "resident portion", the "initialization portion" and the
- "transient portion". The resident portion stays in memory for the
- entire session on the computer (or until a reboot). It contains the
- instructions for performing critical error handling, handling
- <CTRL><Break>, and for program termination. It also has a routine to
- reload the transient portion of COMMAND.COM if necessary when an
- application program such as Lotus' 1-2-3 is exitted. All of DOS'
- standard error handling is done with this portion of the operating
- system. There are too many error message in COMMAND.COM to list all
- of them here, but a few are: "Incorrect DOS version"; "Batch file
- missing"; "Insert disk with batch file and press any key when ready";
- "Bad command or file name"; "Duplicate file name or File not found.";
- "Access denied."; "Insufficient disk space"; "File cannot be copied
- onto itself"; "Invalid parameter"; "Enter new time:"; "Invalid
- path, not directory, or directory not empty"; "Insufficient memory";
- "Error writing to device". These messages should give you a "flavor"
- of what COMMAND.COM does.
-
- The initialization portion of COMMAND.COM follows the resident
- portion and is given control during the bootup procedure. This
- section actually processes the AUTOEXEC.BAT file. It also decides
- where to load the user's programs when they are executed (i.e. where
- to put Dbase in memory when the user wants to run it). Since this
- code is only needed during startup, it is overlaid by the first
- program which COMMAND.COM loads, since it is no longer needed.
-
- The transient portion is loaded at the high end of memory and it
- is the command processor itself. It interprets whatever the user
- types in at the keyboard, hence messages such as "Bad command or file
- name" for when the user misspells a command. This portion contains
- all the internal commands (i.e. COPY, DIR, RENAME, ERASE), it
- contains the batch file processor (to run .BAT files) and it has a
- routine to load and execute external commands which are either .COM or
- .EXE files.
-
- If you wish to change the names of the internal commands, you can
- actually use DEBUG and rename COPY or one of the other commands to
- anything you wish. If you do this, it will cause fewer problems if
- you use the same number of letters as the old command. Some people
- customize their COMMAND.COM files like this to use names for commands
- which they are more comfortable with, or to prevent other users from
- doing certain operations. Here is how you could change the command
- DEL to ERA (which makes more sense than DEL as an abbreviation for
- ERASE):
-
- C>DEBUG COMMAND.COM <Enter> use debug to "edit" command.com
- - debug's prompt is a hyphen
- -S100 FFFE "DEL" <Enter> search for the word "DEL" from
- 2536:4f60 address 100 through FFFE
- - write down the address it gives
- you
- -d2536:4f60 <Enter> display what is at that address,
- xxxxxxxxx xxxxxxxxx you should see some numbers on
- - the left of the screen, but on
- the right should be some English
- words which are the names of the
- internal commands
- -e2536:4f60 <Enter> edit the word "DEL"
- 44.45 <Space> 45.52 <Space> 4c.41 <Enter>
- the edit command gives you the
- 44. and you enter the 45 and
- hit the <Space> bar to continue
- with the edit. The next letter
- is 45 and you enter 52, and so
- on, hitting the <Enter> key to
- end the edit. When you do
- this, you change the
- hexidecimal values for DEL and
- enter the hex values for ERA.
- -
- -w <Enter> save the file by writing it
- -q <Enter> quit debug
- C>
-
- If you decide to do this, be sure you are working with a copy of
- the COMMAND.COM file, and not the original, since if you mess it up
- you may be very sad you ever heard of doing this.
-
- This is an interesting point - if you look at your application
- programs, they have .COM and .EXE endings too, as well as those
- supplemental programs (or external commands) on the DOS disk. This
- actually means that any program you write and compile with a .COM or a
- .EXE ending could be considered to be an external command and any
- application programs which you purchase, such as 1-2-3 can also be
- considered to be an external command. Or you could consider all
- external commands which come on the DOS disk to be applications
- programs. The point is that those features of DOS which require a
- .COM or .EXE file to be present, are just useful programs which are
- marketed on the disk with DOS and are not actually part of DOS itself.
- These include FIND, SORT, DEBUG, LINK, PRINT and so on.
-
- This transient portion of COMMAND.COM produces the system prompt,
- (A>), and reads what the user types in from the keyboard and tries to
- do something with it. For any .COM or .EXE files, it builds a command
- line and issues an EXEC function call to load the program and transfer
- control to it.
-
- Since the transient portion of COMMAND.COM is so large
- (containing the internal commands and all those error messages), and
- it is not needed when the user is running an application such as
- 1-2-3, it can be overlaid by an application, if that application needs
- the room. When the application is through, the resident portion of
- COMMAND.COM brings the transient portion back into memory to show the
- prompt. This is why you will sometimes see the message "Insert disk
- with COMMAND.COM". It needs to get the transient portion off the disk
- since it was overlaid with the application program.
-
- That pretty much covers the bootup process. After COMMAND.COM is
- loaded, it runs the AUTOEXEC.BAT file and then the user gets their
- prompt to begin working. The next article will cover specifics on
- the CONFIG.SYS and AUTOEXEC.BAT files.
-
- Amy J. Goebel
- emory when the user wants to run it). Since this
- code is only needed during startup, it is overlaid by the