Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!bionet!agate!rosarita!raymond From: raymond@rosarita.berkeley.edu (Raymond Chen) Newsgroups: comp.sys.ibm.pc Subject: Frequently Asked Questions: READ THIS BEFORE YOU POST Summary: Monthly Answers to Questions Keywords: Answers Message-ID: <1990Feb28.065659.14984@agate.berkeley.edu> Date: 28 Feb 90 06:56:59 GMT Expires: 1 Apr 90 01:00:00 GMT Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44) Reply-To: raymond@math.berkeley.edu (Raymond Chen) Followup-To: no followups, please Organization: U.C. Berkeley Lines: 556 [@(#)faq.csip 3.1 Last revised on 2/27/90] TABLE OF CONTENTS: (Severely hacked to fit on a 24x80 screen) CHAPTER 0: INTRODUCTION 3.2) Problems with product X. 0.1) What this file is. 3.3) Application file formats. 0.2) How to ask a question. 3.4) Can somebody confirm a rumor? CHAPTER 1: ARCHIVE SITES 3.5) Swapping the X and Y keys. 1.1) How to use anonymous ftp. CHAPTER 4: HARDWARE 1.2) How to decode the stuff in 4.1) Chip differences. comp.binaries.ibm.pc. 4.2) Using floppies with different 1.3) How to de-archive a file. density drives. 1.4) It says archive is corrupted. 4.3) Low-level reformat. 1.5) Public archives. 4.4) What interleave to use. 1.6) Email access to archives. 4.5) Meaning of ESDI, SCSI, RLL, MFM. 1.7) Can you go into more detail? 4.6) An RLL controller with an MFM drive. CHAPTER 2: PROGRAMMING 4.7) Leaving the PC on, mounting sideways. 2.1) Mouse, joystick, interrupts, CHAPTER 5: MISCELLANEOUS graphics cards. 5.1) Unerasing files, accidental reformat. 2.2) Direct memory access from C. 5.2) Curses, vi, emacs, TSRs. 2.3) How to reboot the computer. 5.3) GIF images. 2.4) Ex{te,pa}nded memory. 5.4) Controlling ECHO. CHAPTER 3: SOFTWARE & VENDORS 5.5) Environment variables. 3.1) Asking for recommendations. 5.6) Reinstalling DOS. CHAPTER 0: INTRODUCTION 0.1) What is this file? This is a list of questions that seem to pop up repeatedly in this newsgroup. The purpose of this article is to answer them once and for all so as to improve the signal-to-noise ratio. There are also bits and pieces of etiquette hidden in the answers, so even if you aren't particularly fascinated by the topic, skim through the answer. You might learn something. The mentioning of a particular company is not meant to be interpreted as an endorsement, merely a presentation of information which is requested often. If you feel I am showing favoritism, disagree with these answers, find any errors, or otherwise want to say something regarding them, send email to raymond@math.berkeley.edu. Special thanks go to Prof. Timo Salmi and Keith Petersen for providing much of the raw material from which Chapter 1 was built. Thanks also to all the people (too numerous to list) who contributed to this file. 0.2) I have a question that's not in this file. How should I ask it to increase the chances that I'll get a response? When asking a question, choose an appropriate subject. The volume of this newsgroup is so high that articles with subjects like "Help" or "A question" or "IMPORTANT READ THIS NOW" are likely to be ignored. Moreover, spend some time proofreading your article. Use your system's spellchecker to check words whose spellings you are unsure of. Pretend your article is going to be published around the world. After all, it is. CHAPTER 1: OBTAINING PROGRAMS FROM THE ARCHIVES 1.1) What is anonymous ftp? How do I use it? Ftp stands for File Transfer Protocol, a standard for transferring files among various computers. "Anonymous ftp" is a way of making files publicly available for transfer via ftp. Usually, this is done by logging in as userid "anonymous" and giving your electronic mail address as the password. Actually, you can type anything as the password, but it's only polite to give your email address. It's also only polite to minimize your connect time so that other people can ftp also, since each machine can service only a small number of ftp users at a time. Beyond this rather sketchy description, the details vary from machine to machine. On many UNIX machines, you can get information by typing "man ftp". In any case, check with your sysadmin for information peculiar to your site. Here is what a typical ftp session might look like. ftp 26.2.0.74 The IP address for the SIMTEL20 archives anonymous The special userid for anonymous ftp raymond@math.berkeley.edu My email address is the password cd pd1: Switch to the proper directory tenex Magic word, see below get inter190.arc Get the file INTER190.ARC quit Clean up and leave I could have gotten away with typing "ftp wsmr-simtel20.army.mil" instead of using the IP address. 1.2) How do I use the programs that are posted to comp.binaries.ibm.pc? Follow the instructions in order to cut and paste the files in the proper order. The resulting file must then be (1) "uudecode"d to a binary file, (2) transferred to your PC. The order in which the above steps are taken is not important, although the usual order is as shown above. If your host machine does not have the uudecode program (e.g., if it is not a UNIX machine), you will probably have to do the uudecoding on your PC. 1.3) I've uudecoded it, and the file is on my PC. Now what? Most files have to be unpacked before you can run them. The appropriate unpacking program to use can be determined by inspecting the file extension. Some of the more common ones appear in the table below. Exten- Program Full name of program package Archive sites that sion to use and directory on SIMTEL20 use this format ARC PKUNPAK PD1:PK361.EXE SIMTEL20 ZIP PKUNZIP PD1:PKZ102.EXE grape ZOO ZOO PD1:ZOO201.EXE comp.binaries.ibm.pc PAK PAK210 PD1:PAK210.EXE chyde.uwasa.fi ^^^ note: this is *different* from PKPAK. LHZ LHARC PD1:LH113c.EXE chyde.uwasa.fi The proper unpacking program should be available on the system from which you obtained the packed file. Consult the "read me" file for that particular archive site for information. When you obtain one of these packages, running the .EXE file will create the necessary programs and documentation. 1.4) The unpacking program said that the archive was corrupted. The two most common reasons for this are (1) failing to use the magic word "tenex" (when connected to SIMTEL20 and other TOPS20 systems) or "binary" (when connected to UNIX systems) when transferring the file from an ftp site to your host machine. The reasons for this are technical and boring. A synonym for "tenex" is "type L 8", in case your ftp doesn't know what "tenex" means. (2) failing to use an eight-bit binary transfer protocol when transferring the file from the host to your PC. Make sure to set the transfer type to "binary" on both your host machine and your PC. 1.5) What public archives exist, and what are their IP numbers? The most famous such is WSMR-SIMTEL20 [26.2.0.74], the White Sands Missile Range in New Mexico USA, whose MSDOS archives are administered by Keith Petersen (w8sdz@WSMR-SIMTEL20.Army.Mil). This is a very busy site, so try connecting at really obscure times of day. (SIMTEL20 is in the Mountain time zone, -7 hours relative to GMT.) In the PD1: directory, the file AAAREAD.ME has details on file directories and descriptions, and SIMIBM.ARC is an index of the MSDOS archives. Other popular archives include Site Intro File Direct questions to =================== ========== =================== wuarchive.wustl.edu README archives@wugate.wustl.edu 128.252.135.4 (Washington University, St. Louis, MO USA) A duplicate of the SIMTEL20 archives is kept in /mirrors/msdos. grape.ecs.clarkson.edu 00readme root@grape.ecs.clarkson.edu 128.153.13.196 (Clarkson University, New York, USA) chyde.uwasa.fi 00readme Timo Salmi (ts@chyde.uwasa.fi) 128.214.12.3 (University of Vaasa, Finland) A much larger list of ftp sites is posted to comp.archives sporadically. You can also send the message "send help" to comp-archives-server@twwells.com (or to comparc@twwells.com if your mailer doesn't like long userids) to obtain information on how to obtain information about archive sites. 1.6) I do not have ftp access. Can somebody email me the files? To obtain a file from SIMTEL20 via email, send mail to an email server (e.g., listserv@vm1.nodak.edu or listserv@vm.ecs.rpi.edu) with no subject and containing the single line /PDGET MAIL PD1:VGAIMG12.ARC UUENCODE for example. Do not include a signature because it confuses the server. No more than 100k or 3 files per day will be sent. For general instructions, send the message "GET PDGET HELP". If you don't even have email, most MSDOS SIMTEL20 files are available for downloading on the Detroit Download Central network at 313-885-3956. It is not a free system but the hourly cost is only 17 cents. It's also accessible on Telenet via PC Pursuit and on Tymnet via StarLink outdial. 1.7) Those answers didn't help. Can you go into more detail? And how do I get these "uudecode" and other programs? Brian O'Neill (oneill@bass.bu.edu) has written primers on obtaining files from comp.binaries.ibm.pc and via ftp, as well as a Starter's Kit. He has graciously made these files available via email. Send the following message to uuserve@bu-tyng.bu.edu: ascii send bin.man send ftp.man send starter.kit end This will transfer all three files via email. If you don't need a particular manual, omit that line. Don't forget the "ascii" as the first thing and the "end" as the last thing, and make sure they are at the beginning of the line. Give the server a couple of days to respond before you start complaining. CHAPTER 2: PROGRAMMING 2.1) How do I program the mouse/joystick? What does interrupt X do? How do I program my EGA/VGA/whatever graphics card? A comprehensive listing of functions available via interrupt calls may be FTP'd from CS.CMU.EDU [128.2.222.173] as file interrup.zip in directory /afs/cs/user/ralf/pub or from SIMTEL20 as PD1:INTER*.ARC (the most recent version as of 1 Feb 1990 is INTER190.ARC). This listing is updated four or five times per year. Books on programming the IBM PC include Advanced MS-DOS (Ray Duncan, Microsoft Press) The MS-DOS Encyclopedia (Microsoft Press) Programmer's Guide to the EGA and VGA Cards (Richard Ferraro, Addison-Wesley) Programmer's Guide to PC and PS/2 Video Systems (Richard Wilton, Microsoft Press) The Peter Norton Guide to Programming the IBM PC (Peter Norton, does anybody know the publisher?) 2.2) How do I do direct video access from C? Read/write an arbitrary byte? The hard-core (hard-code) method is to say #define screen ((char far*)0xB8000000) /* B800:0000 */ and treat "screen" as if it were an array. A more flexible approach is to say char far *screen = (char far*)0xB8000000; so your program can assign a value to "screen" depending on whether the program is being run with a color or monochrome card. (Use 0xB0000000 for monochrome cards.) To read and write arbitrary bytes, you can use essentially the same method, substituting whatever address you want in place of 0xB8000000. For those fainter of heart, you can use the peek() and poke() macros in . A similar trick can be used for accessing/setting the segment or offset portion of a far pointer. 2.3) How do I reboot my computer via software? Although some people will suggest using interrupt 19h, that method has its problems since it doesn't reset lots of things (e.g., the interrupt vectors). A more effective method is to store the magic number 0x1234 into 0x40:0x0072 and then perform a long jump to 0xffff:0x0000. The magic number suppresses the memory test. 2.4) What is the difference between extended/expanded memory, and how can I access it from my C/Pascal program? Expanded memory is a way of allowing a large quantity of memory all to share the same memory address. Think of it as a way of compressing a lot of memory into a small space. The only way to access it is via EMS function calls. (See the interrupt list.) Extended memory is memory that lives above the 1Meg boundary. You can access it via XMS function calls (see the interrupt list), or you can switch into protected mode by yourself and access it directly (risky, since you have to make sure you don't conflict with any other program that uses extended memory). Much safer is to use a DOS "extender" program that does this dirty work for you. Allegedly, Zortech C has compiler support for expanded memory, and the shareware CXL library (In PD1: on SIMTEL20) provide EMS handling for MSC and other compilers. (Anyone with firsthand experience with either package please contact me.) CHAPTER 3: SOFTWARE AND VENDORS 3.1) Has anyone had any experience with {company X, product Y}? If you solicit comments about a particular company or product, you must collect the replies and edit them into a good summary. (Concatenating all your responses does not qualify as a good summary.) Depending on the level of interest you receive, you may wish to post your summary. In any case, it is now your duty to keep the summary and offer it (via email) to anyone who asks the same question later. If someone else posts a request for comments and you are also interested, do *NOT* post an article saying "Me, too!" For one thing, people will probably ignore you. Instead, send email to the original poster requesting that he send you a copy of his summary. 3.2) I'm having trouble with product X. Can anyone help me? Contact the customer support department of the company who produced the product. Many companies will have a toll-free number for that purpose. Use it. After all, you paid for it. 3.3) What is the file format that application X uses? There are at least two books that cover this information: File Formats for Popular PC Software - ISBN 0 471-83671-0 $25 More File Formats for Popular PC Software - ISBN 0 471-85077-2 $25 both by Jeff Walden from Wiley Books. Between the two, they cover Lotus 1-2-3, MultiMate, Symphony, dBASE II & III, IBM Plans+, Supercalc 3, Multiplan, DIF, ABILITY, Volkswriter, Supercalc 4, Microsoft Rich Text Format, Framework, Reflex, WordPerfect, and Superproject. In a similar vein, the GIF and BGI file formats are available in PD1: and PD1: on SIMTEL20, and the formats for .OBJ and .EXE files can be found in the MS-DOS Encyclopedia. If you still can't find what you want, you can always contact the company that produced the application. 3.4) Rumor has it that company X is working on a new version of product Y. Does anybody have any information about it? If it hasn't been announced, then the people who could possibly answer your question are not allowed to tell you. 3.5) I don't like my keyboard's layout. How can I swap the X and Y keys? Look in SIMTEL20's PD1: directory. You'll find a whole slew of programs that let you swap keys around. CHAPTER 4: HARDWARE 4.1) What are the differences between chip X and chip Y? These are thumbnail sketches. In general, as the chip number goes up, the speed goes up, so such comments will be omitted. This list is far from comprehensive. 8086: The original. 16-bit bus, addresses 1Meg. 8088: An 8086 with only an 8-bit bus. 80186: An 8086 with a few more instructions. 80286: An 80186 with protected mode. Can access 16Meg of memory in protected mode. Segments still limited to 64K. In real mode, it looks like an 80186. 80386: An honest 32-bit CPU. An 80286 with better protected mode and a "Virtual 8086" mode. Can access 4Gig of memory. No 64K segment limitation. In real mode, it looks pretty much like an 80186. 80386DX: An alternate name for the 80386, to distinguish it from the... 80386SX: Identical to the 80386, except it has only a 16-bit bus. 80486: An 80386 with a built-in floating point unit. Officially called the i486. The 80x87 family are floating point units (FPUs) for the 80x86 family. 8087: FPU for 8086 8088 80186 80287: FPU for 80286. Early 80386s can use it, too. 80387: FPU for 80386. Faster than the 80287. Better trig. 80387SX: FPU for 80386SX. Otherwise the same as an 80387. The NEC Vxx series are CMOS replacements for parts of the 80x86 family. V30: 8086 replacement, has performance and instructions of 80186, plus a few more instructions, and an 8080 emulation mode. Expect speedups of roughly 15%--30%. V20: An 8-bit version of the V30. 5%--10% faster than the 8088. Also, note that many benchmarks exaggerate the relative performance of the chips since they tend to emphasize intructions which have been significantly sped up in the newer chips. 4.2) Can I move floppies around freely between 1.2M and 360K drives? How about formatting a 360K floppy as 1.2M? 720K as 1.44M? In general, once a disk has been written to by a 1.2M drive, only another 1.2M drive can read it reliably. As for formatting floppy disks at densities they weren't designed for: You might be able to get away with it. But it's not guaranteed to work. Proceed at your own risk. 4.3) How do I do a low-level reformat of my hard drive? Depends. Some diagnostics disks have this ability. Compaq Advanced Diags does, Dell Systems Support disk does. Many controllers can do it using DEBUG. Wester Digital controllers use G=C800:5, or sometimes G=CA00:5 or G=CC00:5. 4.4) What does interleave mean? What interleave should I use? If a disk has n:1 interleaving, that means that if you have just read a sector, then the next higher-numbered sector is n sectors away. For example, if a track has 11 sectors, then 2:1 interleaving would put the sectors on a track in the following order 1 7 2 8 3 9 4 10 5 11 6. The following numbers are rough guides; your actual mileage may vary. XTs may need 5:1 or higher; ATs typically 3:1; fast ATs and 386s 2:1. Double buffered controllers allow 1:1 for any processor. Smaller interleaves are faster, but if you pick an interleave smaller than your computer can handle, your disk will run pathetically slow. So if you're going to be wrong, err on the high side. There are programs on SIMTEL20 that claim to test your interleave factor. The commercial program SPINRITE claims to calculate the proper interleave factor and reformat your drive in place (= doesn't destroy the data). 4.5) What do ESDI, SCSI, RLL, MFM mean? ESDI = Enhanced Small Device Interface. SCSI = Small Computer Systems Interface. These are two interface standards which describe how the drive and the controller communicate. RLL = Run Length Limited. MFM = Modified Frequency Modulation. These are two recording methods which describe how the information is physically stored on the disk. 4.6) Can I use an RLL controller on my MFM drive? As is often the case, the answer is "maybe". The likelihood that it will work is good, but there are some older Seagate ST251s that just won't. Proceed at your own risk. 4.7) Should I leave my PC turned on all the time? What about mounting it sideways? There's a lot of stress placed on the system when it first comes up. Generally, you should leave your system running if you plan to return within the next few hours or so; if you don't expect to be using it for a day or so, whether or not you turn it off is a personal judgement call. Monitors aren't the same, though, since images can get "burned into" the phosphor. Use a screen blanker, or turn it off if you'll be away for more than five or ten minutes. As for mounting it sideways: The most common myth about this is that it will make the disk drive bearings wear unevenly. If you look at the manufacturer's information when you buy a disk drive, you will see that it is warrantied in any position *except*upside-down* (with the defect label down). However, the disk may hang slightly differently in the bearings after being placed on its side, so if you plan on mounting your system sideways, you should back up your hard disk while it's level, then mount your system sideways and do a low-level reformat of your hard disk and restore it from the backup you made. If you do this you shouldn't have problems. CHAPTER 5: MISCELLANEOUS 5.1) How do I undelete a file? Recover from an accidental reformat? The more famous utilities for undeleting files are Paul Mace's Utilities, Peter Norton's Utilities, and PC-Tools. They also provide some way of recovering from reformatting your hard disk, although you have to have run some special program beforehand. (That is, you have to know in advance that you might accidentally reformat your hard disk in the future.) 5.2) Where can I get curses? vi? emacs? How do I remove a TSR from memory? How do I write my own TSR? These programs and others are available from SIMTEL20: PD1:PCCURS14.ARC Unix-compatible version of Curses screen mgmt PD1:STEVIE.ARC Clone of Unix 'vi' text editor PD1:VI-19A.ARC Unix-like vi screen text editor for IBM PC PD1:TSRCOM29.ARC TSR memory management utils (MARK/RELEASE) PD1:RESLB201.ARC Function library for Turbo-C to make TSRs A more complete vi comes as part of the MKS Toolkit, available from Mortice Kern Systems. Send email to inquiry@mks.com. (This is a commercial product.) There are several different emacs implementations for the PC. You can get public versions like MicroEmacs and FreeMacs or commercial programs like Epsilon or Unipress Emacs. The similarity to GNU Emacs varies. In general, if you are looking for a program, look first in the file PD1:SIMIBM.ARC. This is a directory of all the files in SIMTEL20's MS-DOS archives. Keith Petersen spends a LOT of time keeping it up-to-date. Please make the effort worth his while. (And I'm pretty sure he won't mind an occasional thank-you letter.) Every month or so, Mr. Petersen also posts a list of SIMTEL20's new acquisitions to comp.binaries.ibm.pc.d. 5.3) What about GIF images? How do I view a GIF image? GIF images are kept on wuarchive.wustl.edu (/graphics/gif), grape.ecs.clarkson.edu (/g/gif), funic.funet.fi (/disk1/pub/misc/gif) and elsewhere. GIF viewers can be found at those sites, as well as in SIMTEL20's PD1: directory. 5.4) How do I turn the ECHO off from a batch file? In DOS 3.3 and higher, you can put the line "@echo off" at the start of your batch file. For other DOS versions, you'll have to apply a patch. The file PD1:ECHOOFF.PAT contains a list of the patches to apply depending on which version of DOS you are using. 5.5) How do I get/set an environment variable from a C/pascal program? Reading environment variables is easy. Look for a function called getenv(). Setting environment variables is trickier. If you only want the variable to be seen in spawned processes, use putenv(). Otherwise, you're going to have to dig into the depths of undocumented features. It's definitely not easy. Look at the program PD1:SETENVJW.ARC for an example. (There are other programs on SIMTEL20 that claim to do roughly the same thing as this.) 5.6) How do I install a new version of DOS on my hard drive? In principle, you should be able to boot off a floppy containing the new version and type "SYS C:". Then copy COMMAND.COM and all the other DOS programs (like CHKDSK.COM) to your hard disk. Unfortunately, this doesn't always work. Although you could poke around and try to install the new version manually, it's too complicated to go into. Most people recommend a procedure similar to the following: [0] Uninstall any copy-protected software that's on your hard drive. [1] Back up your hard drive (twice, to be extra sure), making sure to use a file-by-file backup and not an image backup. Verify your backup. [2] Optionally, perform a low-level reformat of the hard disk. [3] Boot off a floppy containing the new version and install DOS just like it was a brand new machine. [4] Restore all the files from your backup and verify the restoration. [5] If you have a nonstandard SHELL= line in your CONFIG.SYS, make sure it's set up properly for the new DOS version. (For example, different versions interpret the /E option differently.) -- raymond@math.berkeley.edu Let's keep those .sig files short, folks!