The ultimate DOS boot disk

A little over a year ago, someone issued me a challenge: Make a boot disk containing the Microsoft network client and CD-ROM drivers. The problem is that the network client, plus the DOS boot files, plus a CD-ROM driver and MSCDEX almost always takes up more than 1.44 megs.
So I zipped up as much of the junk as I could and made a boot disk that extracted the Zip file to a ramdisk and connected to the network. I had tons of space left over. So I added some niceties like doskey and a mouse driver. I still had space left over. So then I started hunting down every network driver I could find so that one disk could service the mismash of NICs we’ve bought over the years.

It worked, but adding new drivers was beyond the ability of a lot of my coworkers. And I wanted to add a Windows-style network logon and TCP/IP configuration. I started coding it and some of it worked, but eventually I ran out of time so I abandoned it.

Meanwhile, someone else was doing the same thing, and his results were a lot better.

From the guy who brought you Bart’s Way to Create Bootable CD-ROMs, there’s Bart’s Modular Boot Disk.

To get a disk like mine, all you do is make a bootable floppy on a Windows 9x box, then download Bart’s network packages, including whatever NICs you want to support. Then pop back over to the modboot page and grab all the CD-ROM stuff. I made a disk that supports all of the CD-ROM drives Bart had drivers for, plus a half-dozen or so NICs from 3Com, Intel, and SMC, along with mouse support and doskey. I still had over 100K to spare.

If you find yourself just a little bit short of space, you can use the freeware fdformat to format a disk with just 16 root-directory entries and a large cluster size. Use the commmand fdformat a: /d:16 /c:2. The space that would normally go to the bigger root directory and FAT ends up going to storage capacity instead. But don’t try to run fdformat in Windows–find a Win98 box and boot it in DOS mode.

To make life easier on yourself, you might make the disk, then image a blank and keep the image around for when you want to format a maximum-capacity 1.44-meg disk.

Rare DOS disk utilities

Mailbag:

RAM disk; Your book; Mobos; Monitors; Net folders

I’ve been doing a bunch of work in DOS the past few days, and I’ve found some useful disk tools. A lot of people use the shareware WinImage or GRDUW to create images of floppy disks. That’s with good reason, seeing as floppies are so unreliable–this way, you’ve got a backup on a hard drive or CD-ROM drive, and it’s so much more convenient when you need a particular disk to just grab a blank, make a fresh copy from an image, and go do your thing. But I found some DOS utilities, some recent and others oldies but goodies, that give you the functionality of these shareware utilities but with the advantage of being free, smaller, faster, and in most cases running on a wider variety of operating systems–all good things. So they don’t have a nice clicky mousey interface… I don’t like using a mouse anyway. Maybe you’re like me, or maybe you like powerful utilities and don’t mind giving up the mouse to be able to use them.

So here goes.

Creating disk images. My favorite is  Diskwarez DF — of course I like this utility, seeing as it bears my initials. DF is a short and sweet utility for creating and writing disk images compatible with Rawrite and the Unix dd utility. Runs under DOS and under Windows 9x and NT in a command window. There are dozens of DOS disk imaging utilities out there, but this one has the advantage of being compatible with a very common cross-platform standard. Check out the Diskwarez site, as it’s got tons of info on disk programming, as well as some other utilities like free disk editors. Despite the name, it’s not a pirate site–Diskwarez software is distributed under a free license somewhat similar to the GPL.

If you prefer self-extracting images, you can use the similarly named DOSDF to create them.

Bigger, faster, better floppies. The other feature of GRDUW is to format high-capacity floppy disks and floppies that give faster access than disks formatted with Windows Explorer or the DOS format utility. Enter FDFORMAT . You can do that and plenty of other cool things with this utility. You can gain more usable space on a 1.44-meg floppy without resorting to weird disk formats just by reserving fewer root directory entries. For example, FDFORMAT A: /D:16 gives you the maximum available space on a 1.44-meg floppy by reserving just 16 root directory entries (if you’re storing large files you don’t need more than 16 anyway, probably).

For extra speed, use Sector Sliding: FDFORMAT A: /X:2 /Y:3 speeds up the disk by 50-100 percent by arranging the tracks in a more optimal order. Supposedly you can gain even more speed by playing around with the gap length, but the author says disks are less reliable when you do this. If you’re more interested in speed than in reliability, add the /G:32 switch to the command listed above.

And by default, the boot sector on disks formatted by FDFORMAT automatically try to boot to the hard drive rather than giving you the dreaded “Non-system disk or disk error” message. Why couldn’t Microsoft think of that?

And of course you can also format high-capacity disks. Use the /F168 option to format a 1.68-MB floppy, and the /F172 option to format a 1.72-meg floppy. These switches can be combined with the others as well. Keep in mind that extra-capacity disks aren’t bootable.

FDFORMAT’s downside is it won’t run from inside Windows NT or Windows 9x. The best thing to do with it is to format a disk with it on a PC booted into DOS (DOS mode from Windows 9x’s boot menu is sufficient), then take that disk and use the aforementioned DF or DOSDF utilities to make an image of that disk, then when you need to format a new high-speed disk or a new disk that won’t give you errors when you leave it in the drive, use the image.

Formatting bad disks. And finally, for those dreaded Track 0 Bad errors that render a disk unusable, there’s FR , which uses workarounds to try to make the disk usable again. Typically I get rid of floppies with bad sectors pretty quickly, but if it’s an emergency, this program might bail you out. I used to get around Track 0 errors by formatting the disk in my Amiga–for some reason the disk always worked after that–but seeing as I usually don’t have my Amiga set up, this is an alternative.

And wouldn’t you know it, as soon as I wrote that I found a better way. SmartFormat also does Track 0 workarounds, uses the date and time to create unique disk serial numbers (instead of Microsoft’s license-plate method), provides a fast format that’s up to 60% faster than Microsoft’s method, and can optionally format 1.72-meg disks. SmartFormat runs within Windows, usually.

Mailbag:

RAM disk; Your book; Mobos; Monitors; Net folders

Optimizing BIOSes and optimizing DOS

Optimizing the BIOS. Dustin Cook sent in a link to Adrian’s Rojak Pot, at www.adriansrojakpot.com , which includes a BIOS tweaking guide. It’s an absolute must-read. I have a few minor quibbles with a couple of the things he says, particularly about shadowing and caching your ROMs with Windows 9x. He says you shouldn’t do it. He’s right. He says you shouldn’t do it because Microsoft says not to do it with Windows NT, and Windows 9x “shares the same Win32 architecture.” It does and it doesn’t, but that’s flawed logic. Shadowing ROMs isn’t always a bad thing; on some systems that eats up some usable memory and on others it doesn’t, depending on the chipset and BIOS it uses. But it’s pointless because Windows doesn’t use the BIOS for anything, unless you’re in safe mode. Caching ROMs makes very little sense; there’s only so much caching bandwidth to go around so you should spend it on caching memory that’s actually being used for something productive. So who cares about architecture, you shouldn’t cache and shadow your ROMs because Windows will ignore it one way or the other, so those facilities are better spent elsewhere. The same thing is true of Linux.

Still, in spite of this minor flaw I found in a couple of different spots, this is an invaluable guide. Perfect BIOS settings won’t make a Pentium-90 run like a Pentium III, but poor BIOS settings certainly can make a Pentium III run more like a 386DX-40. Chances are your BIOS settings aren’t that bad, but they can probably use some improvement. So if you want the best possible performance from your modern PC, visit Adrian’s. If you want to optimize your 386 or 486 or low-end Pentium, visit the site I mentioned yesterday.

Actually, it wouldn’t be a half-bad idea to take the downloadable versions of both guides, print them, and stick them in a binder for future reference. You’ll never know when you might want to take them with you.

Optimizing DOS again. An awful lot of system speed is psychological. I’d say maybe 75% of it is pure psychology. It doesn’t matter so much whether the system really is fast, just as long as it feels fast. I mentioned yesterday keyboard and screen accelerators. Keyboard accelerators are great for people like me who spend a lot of time in long text files, because you can scroll through them so much faster. A keyboard accelerator makes a big difference in how an old DOS system feels, and it can improve the responsiveness of some DOS games. (Now I got your attention I’m sure.)

Screen accelerators are a bit more of a stretch. Screen accelerators intercept the BIOS calls that write to the screen and replace them with faster, more efficient code. I’d estimate the speedup is anywhere from 10 to 50 percent, depending on how inefficient the PC’s BIOS is and whether it’s shadowing the BIOS into RAM. They don’t speed up graphics at all, just text mode, and then, only those programs that are using the BIOS–some programs already have their own high-speed text routines they use instead. Software compatibility is potentially an issue, but PC power users have been using these things since at least 1985, if not longer, so most of the compatibility issues have long since been fixed.

They only take a couple of kilobytes of memory, and they provide enough of a boost for programs that use the BIOS that they’re more than worth it. With keyboard and screen accelerators loaded in autoexec.bat, that old DEC 386SX/20 feels an awful lot faster. If I had a copy of a DOS version of Microsoft Word, I could use it for writing and it wouldn’t cramp my style much.

Optimizing DOS and the BIOS, plus new iMacs

Optimizing DOS (Or: A New Use for Ancient Equipment). I was thinking yesterday, I wished I had a computer that could just hold disk images and do data recovery. Then I remembered I had a DECpc 320P laptop laying under my desk. I cranked it up. MS-DOS 5, 20 MHz 386sx, 80-meg drive, 6 MB RAM, grayscale VGA display. So I installed Norton Utilities 8, the main thing I wanted to run (I had a retail box sitting on my shelf), then of course I set out to optimize it. Optimizing DOS is really easy: it’s just a question of disk optimization and memory management. I cleaned up the root directory, pulled the extraneous files in the C:\DOS directory (the .cpi files, all the .sys files, all the .bas files). Then I ran Speed Disk, setting it to sort directory entries by size in descending order, put directories first, and do full optimization. It took about 30 minutes. If I’d been really bored I could have mapped out what executables are most important to me and put those first. Since DOS doesn’t track file access dates it can’t automatically put your frequently accessed files first like Speed Disk for Windows does.

Of course when I installed Norton Utilities 8 I installed NDOS, its command.com replacement. Built-in command history, improved resident utilities, and thanks to its memory management, it actually uses far less conventional memory (but more memory total) than command.com. That’s OK; with 6 MB of RAM I can afford to give up a fair bit of extended memory for better functionality.

Once I was happy with all that, I also attacked the startup files. I started off with a basic config.sys:

device=c:\dos\himem.sys
device=c:\dos\emm386.exe noems
dos=high,umb
files=30

Then I went into autoexec.bat, consolidated the PATH statements into one (it read: PATH C:\WINDOWS;C:\DOS;C:\DOS\u;C:\MOUSE) and added the prefix LH to all lines that ran TSRs or device drivers (such as MOUSE.EXE). Upon further reflection, I should have moved the Mouse directory into C:\DOS to save a root directory entry.

I added the NCACHE2 disk cache to autoexec.bat– NCACHE2 /ext=4096 /optimize=s /usehigh=on /a a c /usehma=on /multi=on. That turns on multitasking, enables caching of both C: and A:, tells it to use 4 MB of memory, use high memory, and use extended memory. My goal was to use as much memory as prudently as possible, since I’d be using this just for DOS (and mosly for running Norton Utilities).

I also set up a 512K RAMdisk using RAMDRIVE.SYS (devicehigh=c:\dos\ramdrive.sys 512 128 4). Then I added these lines to autoexec.bat:

md d:\temp
set tmp=d:\temp
set temp=d:\temp

Now when an app wants to write temp files, it does it to a RAMdisk. The other parameters tell it to use 128K sectors to save space, and put 4 entries in the root directory, also to save space. With DOS 5, that was the minimum. I don’t need any more than one, since I’m making a subdirectory. I could just point the temp directory to the root of D:, but I’d rather have dynamic allocation of the number of directory entries. This setting is more versatile–if I need two big files in the temp directory, I’m not wasting space on directory entries. If on the other hand I need tons of tiny files, I’m guaranteed not to run out of entries.

It’s not a barn burner by any stretch, but it’s reasonably quick considering its specs. Now when someone trashes a floppy disk, I can just throw it in the 320P, run Disk Doctor and Disktool on it (and in a pinch, Norton Disk Editor), copy the data to the HD, then throw the recovered data onto a new, freshly formatted floppy. I’ll only use it a couple of times a year, but when I need such a beast, I need it badly. And if I have the need to run some other old obscure DOS program that won’t run on newer machines, the 320P can come to my rescue again too. It runs the software well, it boots in seconds–what more can I ask?

I could have done a couple more things, such as a  screen accelerator and a keyboard accelerator . Maybe today if I have time.

I was tempted to put Small Linux ( http://www.superant.com/smalllinux/ ) on it, but frankly, DOS 5 and Norton Utilities 8 is more useful to me. I’m not sure what I’d do with a non-networkable Linux box with only 6 MB RAM and a monochrome display.

A useful (but unfortunately dated) link. I stumbled across this yesterday: The BIOS Survival Guide , a nicely-done guide to BIOS settings. Unfortunately it stopped being maintained in 1997, so it’s most useful for tweaking very old PCs. Still, it’s better than nothing, and most modern PCs still have most of these settings. And reading this does give you a prayer of understanding the settings in a modern PC.

If you want to optimize your BIOS, this is about as good a starting point as you’re going to find online for free. For more recent systems, you’ll be better served by The BIOS Companion, written by Phil Croucher (one of the co-authors of this piece.) You can get a sample from that book at http://www.electrocution.com/biosc.htm .

New iMac flavors. Steve Jobs unveiled the new iMacs this week. The new flavors: Blue Dalmation and Flower Power. Yes, they’re as hideous as they sound. Maybe worse. Check the usual news outlets. They’d go great in a computer room with a leopard-skin chair, shag carpet, and lava lamps. And don’t forget the 8-track cranking out Jefferson Airplane and Grateful Dead tunes.

I think the outside-the-box look of Mir, the PC Gatermann and I built as a Linux gateway (see yesterday), is far more tasteful–and that’s not exactly the best idea we ever had.

Ultra-useful Windows and DOS utilities (plus Linux stuff)

4/3/00
There are loads of links in this mail. Explore them; you won’t be disappointed.

Hello. I maintain the Interesting DOS programs website and I was pleasantly surprised when I got an email telling me my site was mentioned in your book as a download reference site for XMSDSK.

While I only provided a link to the XMSDSK file on Simtel, it was still great to see my site which I never thought will ever get mentioned in any book, especially a Windows one 🙂

I got your book and I like it (a lot). However, there were some tools I thought should have gotten mentioned (most are mentioned on my site)

———————————————————————–

On Page 65, you mentioned FIPS as a tool to resize partitions. While I haven’t tried FIPS, there is another freeware utility which I’ve used several times :

Partition Resizer v1.33 It resizes/moves your FAT16/FAT32 partitions safely without losing the data on it. It doesn’t eliminate the need for FDISK. You use Partition Resizer to resize and rearrange the FAT16/FAT32 partitions to create free space on your drive and then run FDISK to create the partition.

———————————————————————–

The Infozip link at http://www.cdrom.com/pub/infozip is orphaned and is no longer updated. An updated link is at ftp://ftp.info-zip.org/pub/infozip/Info-ZIP.html

———————————————————————–

On Page 209, you mentioned that internal Zip drives lack DOS drivers, this is not true as I have an internal ZIP drive and I access them from DOS. Perhaps you were trying the older drivers that came with the first Iomega parallel port drive?

———————————————————————–

FastVid v1.10 Improves video performance on Pentium Pro and Pentium II PCI/AGP systems. I haven’t tested this myself but you may want to check it out.

———————————————————————–

LFN Tools v1.48 These are DOS commands (as stand alone EXE’s) that can handle long filenames in plain DOS. Supports FAT32

For example there is LCOPY which works like XCOPY under a DOS window (copying the long filenames) but in plain DOS. This is useful for diaster recovery situations when you can’t get into Windows and you need to get files off your Windows drive. Other commands include

LMD – create a long directory name LRD – remove a directory with a long directory name (e.g lrd “Program Files”) LDIR – like the DIR command showing long filenames.

The Tools are released under the GPL so source code is available and it is free.

————————————————————————

AVPLite Build 134 Free (yet powerful) command-line antivirus detection and removal program.

The engine is only is only 49K (the antivirus updates are about 1.7MB) but it can scan inside ZIP, TGZ, CAB, mail folders in Netscape and Outlook, DOC files). If there is a virus on a machine, you can have a bootable disk with XMSDSK to create a ramdisk, then have the AVPlite and the antivirus update on separate floppy disks unzipped to the ramdrive and then run AVPlite from the ramdrive.

————————————————————————-

Some Linux links :

SET’s editor v0.4.41

GREAT text editor with the fimiliar Borland IDE interface with syntax highlighting. This is literally the FIRST app to install after you boot Linux. Editing text files with Joe, Vi and Emacs were ummmmmm….. kinda difficult ;-). Released under GPL.

(SET edit is also available for DOS with a built-in MP3 player 😉 )

The one page linux manual A PDF containing a summary of useful Linux commands You mentioned on your Silicon Underground that you wished there was a command reference for Linux. This one is close

————————————————————————- Since you mentioned Win3.x program manager, thought I’ll mention this

Calmira II v3.02 Freeware Win95 shell/interface for Windows 3.x, including explorer, etc.

Mask for Windows – PRWin98 Gives Win3.x apps the look and feel of Win9x apps

————————————————————————-

Looking forward to your upcoming Linux book (I agree with your sentiments on Silicon Underground – documentation is the main holdback for Linux)

Dev Teelucksingh
devtee@trinidad.net
Interesting DOS programs at http://www.opus.co.tt/dave
Trinidad and Tobago Computer Society at http://www.ttcsweb.org

— This email sent with Arachne, the ultimate Internet client —
— http://home.arachne.cz/ —

Wow. Thanks for all the links. That’ll keep my readers busy for ages and ages to come. I did immediately go download SET edit. Very, very nice.

I’m very glad you like my book and look forward to the Linux book. It’s coming along, faster than the Windows book did, but not as quickly as I’d like. I’m not even willing to hazard a guess when it will be finished at this point.

A year from now, there will probably be twice as many Linux books available as there are now. Maybe more. The quality will vary widely. But we need them. The stuff coming out of the Linux Documentation Project is getting better (or maybe I’m just getting smarter) but the stuff available even six months ago very frequently had gaps that a newcomer wouldn’t be able to climb over: missing steps, poor or inaccurate description of output–all kinds of little things that suggest the author didn’t take the time to step through the process one last time. A plethora of available Linux books will help in more ways than one.

Back to DOS and Windows… Although many people deny it, DOS is still an integral part of Windows, and some things just can’t be accomplished without diving into DOS. Even under NT, I always keep a command line open. I can tell you the last day I didn’t use a command line. It was in June of last year. I know because I was in New Mexico, far away from work and from any of my computers.

So Iomega finally got around to releasing Zip drivers that work with the internal IDE and ATAPI models? About time. We bought a big batch of them at work about two years ago, and I needed to access them from DOS, and nothing. The drivers wouldn’t work. We contacted Iomega, and their line was, “These drives require Windows 95 or newer.” A year later, when I was writing that chapter, drivers still hadn’t appeared. But better late than never.

Thanks again.