[comp.sys.ibm.pc] formatting system disks: How DOS does it

gwr@linus.UUCP (Gordon W. Ross) (08/26/87)

This might be of interest to the general readership.  The methods
DOS uses to create a system disk are poorly explained in the manual.

In article <36e6247a.86c0@apollo.uucp> (Chris Landry) writes:
>I have a Leading Edge model M with an add-on external hard disk.
>It seems to be very ibm compatible and I've had no problems
>running any software or booting from the hard disk.
>
>Something funny happens when I try to format floppies.

[description of normal format deleted]

>If I enter...           format b: /s    # to create a system diskette
>the response is...      Vers 2.11
>                        Insert DOS disk in drive A:
>                        and press any key when ready
>If I do what it says
>I then get the message...
>                        Insert new disk in drive B:
>                        and press any key when ready
>
>It formats ok but its sort of a pain to dig out my DOS disk.
>
>Why is it asking for a DOS disk????
>
>The PATH is set to a directory which contains all
>the MS-DOS 2.11 system files supplied with the machine.
>
>Could this be my first compatibilty problem?
>Anybody got any theories?
>-- 
>    Chris Landry        Apollo Computer, Chelmsford MA
>    landry@apollo.uucp

No compatibility problem.  Here's the answer:

The two MS-DOS commands which can make a disk or diskette bootable
(SYS.COM and FORMAT.COM) both have to copy the two hidden files
(IBMBIOS.COM and IBMDOS.COM) from somewhere onto the disk or diskette
which is being made bootable.  Neither the PATH nor COMSPEC
environment variables can help find these hidden files.  Instead,
somewhere in the run image of DOS a drive specifier is stored which
points to the place this run image was booted from.  This same place
is used as a source for the hidden file copy and COMMAND.COM copy onto
the target "system" disk.  If you booted from drive A: then the copy
routine will prompt you to insert the diskette because it is looking
for the diskette it was booted from.  Only an identical copy will do
(very fussy).

This scheme has one nasty side effect as well, which one should be
aware of.  Say I want to make a system disk for a different version of
DOS.  This would happen, for example, when one wants to update the
version of DOS on a hard disk.  I have booted up on the hard disk as
usual,  I copy all the new DOS files into C:/DOS, and then I run
SYS.COM to install the new hidden files.  BUT -- where does it get the
hidden files from?  The last boot device which still holds the
previous DOS version of the hidden files.  Therefore, the only way to
update the DOS version of your hard disk (without reformatting) is to
boot the new version from a floppy and then do the above mentioned
copy A:*.* c:\DOS and SYS C: which will then get the new hidden files
from drive A: (where the system was booted from).

Simple, Eh?  Learned the hard way...
	(i.e.  "Bad or missing command interpreter"...)
-- 
	The MITRE Corporation	ARPA: gwr%linus@mitre-bedford
	Burlington Road		UUCP: decvax!linus!gwr
	Bedford, MA  01730	Phone: (617) 271-3205