[comp.sys.ibm.pc.misc] Frequently Asked Questions: READ THIS BEFORE YOU POST

t-rayc@microsoft.UUCP (Raymond CHEN) (07/03/90)

[
Now that comp.sys.ibm.pc has split, this file should also be split
into pieces.  Any volunteers?

Differences between this version and last month's version are
described in a companion article.  There have been some significant
changes. --rjc
]

[@(#)faq.csip   4.8  Last revised on 7/2/90]

TABLE OF CONTENTS

CHAPTER 0:  INTRODUCTION

0.1)  What is 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?
0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?
0.4)  Somebody just asked a really simple question.  What should I do?

CHAPTER 1:  OBTAINING PROGRAMS FROM THE ARCHIVES

1.1)  What is anonymous ftp?  How do I use it?
1.2)  How do I use the programs that are posted to comp.binaries.ibm.pc?
1.3)  I've uudecoded it, and the file is on my PC.  Now what?
1.4)  The unpacking program said that the archive was corrupted.
1.5)  What public archives exist, and what are their IP numbers?
1.6)  I do not have ftp access.  Can somebody email me the files?

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?
2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?
2.3)  How do I reboot my computer via software?
2.4)  What is the difference between extended/expanded memory, and
      how can I access it from my C/Pascal program?
2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?
3.2)  I'm having trouble with product X.  Can anyone help me?
3.3)  What is the file format that application X uses?
3.4)  Rumor has it that company X is working on a new version of product Y.
      Does anybody have any information about it?
3.5)  I don't like my keyboard's layout.  How can I swap the X and Y keys?

CHAPTER 4:  HARDWARE

4.1)  What are the differences between chip X and chip Y?
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?
4.3)  How do I do a low-level reformat of my hard drive?
4.4)  What does interleave mean?  What interleave should I use?
4.5)  What do ESDI, SCSI, RLL, MFM mean?
4.6)  Can I use an RLL controller on my MFM drive?
4.7)  Should I leave my PC turned on all the time?  What about
      mounting it sideways?

CHAPTER 5:  MISCELLANEOUS

5.1)  How do I undelete a file?  Recover from an accidental reformat?
5.2)  Where can I get curses? vi? emacs?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?
5.3)  What about GIF images?  How do I view a GIF image?
5.4)  How do I turn the ECHO off from a batch file?
5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?
5.6)  How do I install a new version of DOS on my hard drive?

APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

--------------------------------------------------------------------------
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.

    You should probably also check that your question hasn't been asked
    to death before.  Many of the files on my email server address
    commonly-asked questions whose answers are too long to list here.
    I also keep an index of previously-asked questions on my email server.
    Instructions on using the email server are posted separately.

0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?

    Oh, for crying out loud.  About twice a year some immature bozo
    posts a note like this and the flames don't die out for weeks.  If
    you consider yourself a mature human being, bite your lip and keep
    quiet.  Let the nincompoop think he's won.  If you absolutely
    positively can't keep quiet, flame the sucker by email.  But
    please, don't make the rest of us have to suffer through it.

    While I have your attention, here are a few more subjects that
    we're sick of seeing:

    FCC to impose surtax on modem usage:  This is simply not true.
        Consult the file "fcc" on my mail server for a letter from
        the FCC debunking this rumor.

    Make Money Fast:  They're all pyramid schemes, and they're illegal,
        especially the one from Dave Rhodes.

    Dying Boy's Last Wish:  He broke the record in 1988, so stop it already.
        Besides, the poor child's address keeps changing, ranging from London
        to Atlanta.

0.4)  Somebody just asked a really simple question.  What should I do?

    Send him the answer by email.  Don't post the answer, since
    (trust me) about a dozen people will do it anyway.  If you
    want, drop me a line so I can add the question to the FAQ archives.


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.  (Although rumor has it that nobody actually
    saves the passwords typed to the ftp program.)  It's only polite to
    minimize your connect time, 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:<msdos.gif>          Switch to the proper directory
        tenex                       Magic word, see below
        get gif_lib.zip             Get the Turbo C GIF library (include source)
        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.

    Here's a script to perform step 1 on UNIX machines:

        #! /bin/sh
        sed '/^END/,/^BEGIN/d' $* | uudecode

    If you saved the pieces as "part01" "part02" and so on, then you
    just type "combine part*" and everything gets decodeded automatically.

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:<MSDOS.ARC-LBR>PK361.EXE   SIMTEL20
        ZIP     PKUNZIP  PD1:<MSDOS.ZIP>PKZ102.EXE      grape
        ZOO     ZOO      PD1:<MSDOS.ZOO>ZOO201.EXE      comp.binaries.ibm.pc
        PAK     PAK210   PD1:<MSDOS.ARC-LBR>PAK210.EXE  chyde.uwasa.fi
                ^^^ note: this is *different* from PKPAK.
        LZH     LHARC    PD1:<MSDOS.ARC-LBR>LH113c.EXE  chyde.uwasa.fi
        Z       COMPRESS PD1:<MSDOS.SQ-USQ>COMPRS16.ARC unix archive sites

    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.

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.

        Here is a way to check if you are doing binary transfers correctly.
        Compile the following one-line C program: main(){puts("\250\n\250");}
        Run it by typing "a.out >binary.fil".  Transfer the file
        "binary.fil" to your IBM PC, and TYPE it to the screen from the
        DOS prompt.  If you are doing things correctly, you should see
        the following:
                ?
                 ?
        except that the question marks will be upside-down.


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.
    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:<MSDOS.FILEDOCS> 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, Potsdam, NY USA)

        chyde.uwasa.fi          00readme        Timo Salmi (ts@chyde.uwasa.fi)
        128.214.12.3 (University of Vaasa, Finland)

    My email server has the index files for SIMTEL20, grape, and chyde.

    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.  (You might
    also look at the file "ftp.list" on my mail server.)

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:<MSDOS.GRAPHICS>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".

    BITNET users can also use send LISTSERV commands to LISTSERV@NDSUVM1
    or LISTSERV@RPIECS to accomplish the same thing.

    European users can use EARN TRICKLE servers.  Send commands to
    TRICKLE@site, where "site" is one of the following: 
        AWIWUW11 (Austria)      DB0FUB11 (Germany)      EB0UB011 (Spain) 
        BANUFS11 (Belgium)      DTUZDV1  (Germany)      TAUNIVM  (Israel)
        DKTC11   (Denmark)      IMIPOLI  (Italy)        TREARN   (Turkey)
        
    BITNET users can send email to BITFTP@PUCC to perform ftp.
    To receive instructions, send email consisting of the single
    word HELP to BITFTP@PUCC.  Using this service to ftp to SIMTEL20
    is discouraged, however.

    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.  



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:<MSDOS.INFO>INTER290.ZIP (as of 1 MAy 1990).
    This listing is updated four or five times per year.

    A list of books on programming the IBM PC can be found in the file
    "books" on my mail server.

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.)  See also the file
    "flickerfree" on my mail server for tips on doing flicker-free
    video access.

    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 <dos.h>.  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.  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.

    A useful mnemonic is that exPanded memory uses Paging.

    Allegedly, Zortech C has compiler support for expanded memory, and the
    shareware CXL library (In PD1:<MSDOS.C> on SIMTEL20) provide EMS
    handling for MSC and other compilers.

    More details can be found in the file "memory" on my email server.
    Books which describe the use of expanded and extended memory are listed
    in the file "books" on my email server.

2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

    This is a painfully well-known bug in Turbo C.  Just #include <math.h>
    and stick the line "(void)exp(1.0);" at the start of your main() and
    that should convince the linker to include the floating point formats.
    A patch exists to remedy this bug.

    Patches for Turbo C can be obtained from SIMTEL20, or from LIB 5 of
    the Borland Forum on CompuServe.  There is also a Turbo-C mailing list
    on LISTSERV@UCF1VM.BITNET.


CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?

    Here's a checklist:

        [ ] Consult the files "products" and "old.questions" on my mail 
            server to see if somebody else has asked the same question and 
            to see who responded.  Send them email asking them for their 
            opinions.

        [ ] Write a letter to the Better Business Bureau.

        [ ] If you're still not satisfied, then post a request.  But it
            is now your duty to 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?  What are the GIF,
      TIFF, BGI, OBJ, EXE file formats?  How can I write my own BGI driver?
      Does anybody have a BGI driver for X?

    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.

    If you still can't find what you want, you can always contact the
    company that produced the application.  

    GIF, TIFF and BGI file formats are available on SIMTEL20, and the 
    formats for .OBJ and .EXE files can be found in the MS-DOS Encyclopedia.
    On SIMTEL20 is also the Borland BGI toolkit, which can also be obtained
    directly from Borland.  Send the message

        old /BGI/

    to my email server for information about obtaining BGI files.

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:<MSDOS.KEYBOARD> 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:      A slightly buggy version of the...
    80386DX:    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.
    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?

    After formatting a 360K disk in a 360K drive, that disk should be
    written to ONLY by another 360K drive, although both 360K and 1.2M
    drives can read it.

    Before formatting a 360K disk in a 1.2M drive, first BULK ERASE the
    diskette, then format it and write to it using ONLY a 1.2M drive.
    This floppy can be read reliably on a 360K drive.  This disk should
    be considered READ-ONLY in a 360K drive.

    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.  PS/2 hard drives can be formatted by booting
    the Reference disk and typing Ctrl-A to call up a hidden menu.

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?

    A record of these debates the last time they went around can be 
    obtained from my email server.  Request the file "24hrs".

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?  Is there a program that does X?

    These programs and others are available from SIMTEL20:

PD1:<MSDOS.SCREEN>PCCURS14.ARC    Unix-compatible version of Curses screen mgmt
PD1:<MSDOS.EDITOR>STEVIE.ARC      Clone of Unix 'vi' text editor
PD1:<MSDOS.EDITOR>VI-19A.ARC      Unix-like vi screen text editor for IBM PC
PD1:<MSDOS.SYSUTL>TSRCOM29.ARC    TSR memory management utils (MARK/RELEASE)
PD1:<MSDOS.TURBO-C>RESLB201.ARC   Function library for Turbo-C to make TSRs

    Books on TSR programming are listed in the file "books" on my email server.

    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:<MSDOS.FILEDOCS>SIMIBM.ARC.  This is a directory of all the files
    in SIMTEL20's MS-DOS archives.
    You can also send requests to my email server to search through the
    index for a word or phrase.


5.3)  What about GIF images?  How do I view a GIF image?

    GIF images are kept on wuarchive.wustl.edu (/graphics/gif),
    funic.funet.fi (/disk1/pub/misc/gif) and elsewhere.  GIF viewers can
    be found at those sites, as well as on SIMTEL20 (PD1:<MSDOS.GIF>).
    See the file "gif.sites" available from my mail server for a larger list.

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:<MSDOS.BATUTL>ECHOOFF.PAT contains
    a list of the patches to apply depending on which version of DOS
    you are using.

5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?

    There are a few ways of setting a long path.  One solution is to set
    things up so you don't need a long path in the first place.  For
    example, create a \bat directory with lots of batch files which save
    the current path, set the path to something else, run a program, then
    reset the path to what it originally was.  Or, use the SUBST program
    to make drive-letter aliases for long pathnames.  If you really want a
    big path, fetch the program BIGPATH.ARC or SETPTH13.ARC from SIMTEL20.

    The size of the environment is controlled by the "/E" option to
    COMMAND.COM.  Add the line "SHELL=COMMAND.COM /P /E:xxx" to your
    CONFIG.SYS, where xxx is the desired environment size (in either
    bytes or paragraphs, depending on your DOS version).

    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:<MSDOS.SYSUTL>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.)


APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

    I operate a mail server which not only dispenses files such as this
    one, but also looks up programs in the SIMTEL20 index, the grape
    index, and the chyde index.  (So you have no excuse for not looking
    in these indexes before posting a request.)  If you send email to
    raymond@math.berkeley.edu with no subject and containing
    the single line "help", you will receive instructions; sending the
    message "directory" gives you an index of all the files
    available on the server.

    One file in particular you might be interested in is "faq.more"
    which contains answers to MORE questions, but which weren't included
    here for reasons of space.  Send the message "send faq.more" to
    obtain it.  Its table of contents follows:

1)  I found a bug in program X!
2)  Why do I get disk full errors when I only have a bunch of tiny files
    in my root directory?
3)  I found that program X contains the string "Copyright Microsoft", so
    it must be a pirated copy of a commercial program, right?
4)  Can you summarize the history of the 80x86 family of processors?
5)  How about other chips that didn't make on the main faq list?
6)  Why do people say that the 80286 is "brain-dead"?
7)  How do I determine whether I am running on a monochrome or color
    machine?
8)  I have written a program that uses the mouse, and when I use
    CGA/EGA/VGA it is fine, but the mouse does not appear on
    a Hercules card. Why?
9)  Why does DOS use the \ instead of a / as a directory name separator?
    How can I tell DOS that I want to use slashes instead?
10) What is the SysReq key for?
11) How do I switch my screen into 43 line mode?  How can I detect the 
    number of lines from a program?
12) How do I echo a blank line from a batch file?
13) Why does my PC lose a day if I leave it unattended for more than 24 hours?
14) How can I toggle NumLock/CapsLock/ScrollLock from a batch file or program?
15) I just installed a high density (1.2M) floppy drive, and weird things
    are happening.  How do I fix it?
16) What is 4DOS?  Where can I get it?  How can I disable the annoying beeps
    that it makes when I run it?

t-rayc@microsoft.UUCP (Raymond CHEN) (08/03/90)

[WARNING:  The email server described herein is not currently working.
 The one at raymond@math.berkeley.edu is out of commission.
 the one at rjc@math.princeton.edu works, but not perfectly.
 If you want something and the server at rjc@math.princeton.edu is
 not cooperating, send me email and I'll service your request by hand.
]

TABLE OF CONTENTS

CHAPTER 0:  INTRODUCTION

0.1)  What is 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?
0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?
0.4)  Somebody just asked a really simple question.  What should I do?

CHAPTER 1:  OBTAINING PROGRAMS FROM THE ARCHIVES

1.1)  What is anonymous ftp?  How do I use it?
1.2)  How do I use the programs that are posted to comp.binaries.ibm.pc?
1.3)  I've uudecoded it, and the file is on my PC.  Now what?
1.4)  The unpacking program said that the archive was corrupted.
1.5)  What public archives exist, and what are their IP numbers?
1.6)  I do not have ftp access.  Can somebody email me the files?

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?
2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?
2.3)  How do I reboot my computer via software?
2.4)  What is the difference between extended/expanded memory, and
      how can I access it from my C/Pascal program?
2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?
3.2)  I'm having trouble with product X.  Can anyone help me?
3.3)  What is the file format that application X uses?
3.4)  Rumor has it that company X is working on a new version of product Y.
      Does anybody have any information about it?
3.5)  I don't like my keyboard's layout.  How can I swap the X and Y keys?

CHAPTER 4:  HARDWARE

4.1)  What are the differences between chip X and chip Y?
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?
4.3)  How do I do a low-level reformat of my hard drive?
4.4)  What does interleave mean?  What interleave should I use?
4.5)  What do ESDI, SCSI, RLL, MFM mean?
4.6)  Can I use an RLL controller on my MFM drive?
4.7)  Should I leave my PC turned on all the time?  What about
      mounting it sideways?

CHAPTER 5:  MISCELLANEOUS

5.1)  How do I undelete a file?  Recover from an accidental reformat?
5.2)  Where can I get curses? vi? emacs?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?
5.3)  What about GIF images?  How do I view a GIF image?
5.4)  How do I turn the ECHO off from a batch file?
5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?
5.6)  How do I install a new version of DOS on my hard drive?

APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

--------------------------------------------------------------------------
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.

    You should probably also check that your question hasn't been asked
    to death before.  Many of the files on my email server address
    commonly-asked questions whose answers are too long to list here.
    I also keep an index of previously-asked questions on my email server.
    Instructions on using the email server are posted separately.

0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?

    Oh, for crying out loud.  About twice a year some immature bozo
    posts a note like this and the flames don't die out for weeks.  If
    you consider yourself a mature human being, bite your lip and keep
    quiet.  Let the nincompoop think he's won.  If you absolutely
    positively can't keep quiet, flame the sucker by email.  But
    please, don't make the rest of us have to suffer through it.

    While I have your attention, here are a few more subjects that
    we're sick of seeing:

    FCC to impose surtax on modem usage:  This is simply not true.
        Consult the file "fcc" on my mail server for a letter from
        the FCC debunking this rumor.

    Make Money Fast:  They're all pyramid schemes, and they're illegal,
        especially the one from Dave Rhodes.

    Dying Boy's Last Wish:  He broke the record in 1988, so stop it already.
        Besides, the poor child's address keeps changing, ranging from London
        to Atlanta.

0.4)  Somebody just asked a really simple question.  What should I do?

    Send him the answer by email.  Don't post the answer, since
    (trust me) about a dozen people will do it anyway.  If you
    want, drop me a line so I can add the question to the FAQ archives.


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.  (Although rumor has it that nobody actually
    saves the passwords typed to the ftp program.)  It's only polite to
    minimize your connect time, 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:<msdos.gif>          Switch to the proper directory
        tenex                       Magic word, see below
        get gif_lib.zip             Get the Turbo C GIF library (include source)
        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.

    Here's a script to perform step 1 on UNIX machines:

        #! /bin/sh
        sed '/^END/,/^BEGIN/d' $* | uudecode

    If you saved the pieces as "part01" "part02" and so on, then you
    just type "combine part*" and everything gets decodeded automatically.

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:<MSDOS.ARC-LBR>PK361.EXE   SIMTEL20
        ZIP     PKUNZIP  PD1:<MSDOS.ZIP>PKZ102.EXE      grape
        ZOO     ZOO      PD1:<MSDOS.ZOO>ZOO201.EXE      comp.binaries.ibm.pc
        PAK     PAK210   PD1:<MSDOS.ARC-LBR>PAK210.EXE  chyde.uwasa.fi
                ^^^ note: this is *different* from PKPAK.
        LZH     LHARC    PD1:<MSDOS.ARC-LBR>LH113c.EXE  chyde.uwasa.fi
        Z       COMPRESS PD1:<MSDOS.SQ-USQ>COMPRS16.ARC unix archive sites

    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.

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.

        Here is a way to check if you are doing binary transfers correctly.
        Compile the following one-line C program: main(){puts("\250\n\250");}
        Run it by typing "a.out >binary.fil".  Transfer the file
        "binary.fil" to your IBM PC, and TYPE it to the screen from the
        DOS prompt.  If you are doing things correctly, you should see
        the following:
                ?
                 ?
        except that the question marks will be upside-down.


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.
    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:<MSDOS.FILEDOCS> 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, Potsdam, NY USA)

        chyde.uwasa.fi          00readme        Timo Salmi (ts@chyde.uwasa.fi)
        128.214.12.3 (University of Vaasa, Finland)

    My email server has the index files for SIMTEL20, grape, and chyde.

    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.  (You might
    also look at the file "ftp.list" on my mail server.)

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:<MSDOS.GRAPHICS>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".

    BITNET users can also use send LISTSERV commands to LISTSERV@NDSUVM1
    or LISTSERV@RPIECS to accomplish the same thing.

    European users can use EARN TRICKLE servers.  Send commands to
    TRICKLE@site, where "site" is one of the following: 
        AWIWUW11 (Austria)      DB0FUB11 (Germany)      EB0UB011 (Spain) 
        BANUFS11 (Belgium)      DTUZDV1  (Germany)      TAUNIVM  (Israel)
        DKTC11   (Denmark)      IMIPOLI  (Italy)        TREARN   (Turkey)
        
    BITNET users can send email to BITFTP@PUCC to perform ftp.
    To receive instructions, send email consisting of the single
    word HELP to BITFTP@PUCC.  Using this service to ftp to SIMTEL20
    is discouraged, however.

    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.  



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:<MSDOS.INFO>INTER290.ZIP (as of 1 MAy 1990).
    This listing is updated four or five times per year.

    A list of books on programming the IBM PC can be found in the file
    "books" on my mail server.

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.)  See also the file
    "flickerfree" on my mail server for tips on doing flicker-free
    video access.

    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 <dos.h>.  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.  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.

    A useful mnemonic is that exPanded memory uses Paging.

    Allegedly, Zortech C has compiler support for expanded memory, and the
    shareware CXL library (In PD1:<MSDOS.C> on SIMTEL20) provide EMS
    handling for MSC and other compilers.

    More details can be found in the file "memory" on my email server.
    Books which describe the use of expanded and extended memory are listed
    in the file "books" on my email server.

2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

    This is a painfully well-known bug in Turbo C.  Just #include <math.h>
    and stick the line "(void)exp(1.0);" at the start of your main() and
    that should convince the linker to include the floating point formats.
    A patch exists to remedy this bug.

    Patches for Turbo C can be obtained from SIMTEL20, or from LIB 5 of
    the Borland Forum on CompuServe.  There is also a Turbo-C mailing list
    on LISTSERV@UCF1VM.BITNET.


CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?

    Here's a checklist:

        [ ] Consult the files "products" and "old.questions" on my mail 
            server to see if somebody else has asked the same question and 
            to see who responded.  Send them email asking them for their 
            opinions.

        [ ] Write a letter to the Better Business Bureau.

        [ ] If you're still not satisfied, then post a request.  But it
            is now your duty to 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?  What are the GIF,
      TIFF, BGI, OBJ, EXE file formats?  How can I write my own BGI driver?
      Does anybody have a BGI driver for X?

    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.

    If you still can't find what you want, you can always contact the
    company that produced the application.  

    GIF, TIFF and BGI file formats are available on SIMTEL20, and the 
    formats for .OBJ and .EXE files can be found in the MS-DOS Encyclopedia.
    On SIMTEL20 is also the Borland BGI toolkit, which can also be obtained
    directly from Borland.  Send the message

        old /BGI/

    to my email server for information about obtaining BGI files.

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:<MSDOS.KEYBOARD> 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:      A slightly buggy version of the...
    80386DX:    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.
    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?

    After formatting a 360K disk in a 360K drive, that disk should be
    written to ONLY by another 360K drive, although both 360K and 1.2M
    drives can read it.

    Before formatting a 360K disk in a 1.2M drive, first BULK ERASE the
    diskette, then format it and write to it using ONLY a 1.2M drive.
    This floppy can be read reliably on a 360K drive.  This disk should
    be considered READ-ONLY in a 360K drive.

    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.  PS/2 hard drives can be formatted by booting
    the Reference disk and typing Ctrl-A to call up a hidden menu.

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?

    A record of these debates the last time they went around can be 
    obtained from my email server.  Request the file "24hrs".

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?  Is there a program that does X?

    These programs and others are available from SIMTEL20:

PD1:<MSDOS.SCREEN>PCCURS14.ARC    Unix-compatible version of Curses screen mgmt
PD1:<MSDOS.EDITOR>STEVIE.ARC      Clone of Unix 'vi' text editor
PD1:<MSDOS.EDITOR>VI-19A.ARC      Unix-like vi screen text editor for IBM PC
PD1:<MSDOS.SYSUTL>TSRCOM29.ARC    TSR memory management utils (MARK/RELEASE)
PD1:<MSDOS.TURBO-C>RESLB201.ARC   Function library for Turbo-C to make TSRs

    Books on TSR programming are listed in the file "books" on my email server.

    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:<MSDOS.FILEDOCS>SIMIBM.ARC.  This is a directory of all the files
    in SIMTEL20's MS-DOS archives.
    You can also send requests to my email server to search through the
    index for a word or phrase.


5.3)  What about GIF images?  How do I view a GIF image?

    GIF images are kept on wuarchive.wustl.edu (/graphics/gif),
    funic.funet.fi (/disk1/pub/misc/gif) and elsewhere.  GIF viewers can
    be found at those sites, as well as on SIMTEL20 (PD1:<MSDOS.GIF>).
    See the file "gif.sites" available from my mail server for a larger list.

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:<MSDOS.BATUTL>ECHOOFF.PAT contains
    a list of the patches to apply depending on which version of DOS
    you are using.

5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?

    There are a few ways of setting a long path.  One solution is to set
    things up so you don't need a long path in the first place.  For
    example, create a \bat directory with lots of batch files which save
    the current path, set the path to something else, run a program, then
    reset the path to what it originally was.  Or, use the SUBST program
    to make drive-letter aliases for long pathnames.  If you really want a
    big path, fetch the program BIGPATH.ARC or SETPTH13.ARC from SIMTEL20.

    The size of the environment is controlled by the "/E" option to
    COMMAND.COM.  Add the line "SHELL=COMMAND.COM /P /E:xxx" to your
    CONFIG.SYS, where xxx is the desired environment size (in either
    bytes or paragraphs, depending on your DOS version).

    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:<MSDOS.SYSUTL>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.)


APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

    I operate a mail server which not only dispenses files such as this
    one, but also looks up programs in the SIMTEL20 index, the grape
    index, and the chyde index.  (So you have no excuse for not looking
    in these indexes before posting a request.)  If you send email to
    raymond@math.berkeley.edu with no subject and containing
    the single line "help", you will receive instructions; sending the
    message "directory" gives you an index of all the files
    available on the server.

    One file in particular you might be interested in is "faq.more"
    which contains answers to MORE questions, but which weren't included
    here for reasons of space.  Send the message "send faq.more" to
    obtain it.  Its table of contents follows:

1)  I found a bug in program X!
2)  Why do I get disk full errors when I only have a bunch of tiny files
    in my root directory?
3)  I found that program X contains the string "Copyright Microsoft", so
    it must be a pirated copy of a commercial program, right?
4)  Can you summarize the history of the 80x86 family of processors?
5)  How about other chips that didn't make on the main faq list?
6)  Why do people say that the 80286 is "brain-dead"?
7)  How do I determine whether I am running on a monochrome or color
    machine?
8)  I have written a program that uses the mouse, and when I use
    CGA/EGA/VGA it is fine, but the mouse does not appear on
    a Hercules card. Why?
9)  Why does DOS use the \ instead of a / as a directory name separator?
    How can I tell DOS that I want to use slashes instead?
10) What is the SysReq key for?
11) How do I switch my screen into 43 line mode?  How can I detect the 
    number of lines from a program?
12) How do I echo a blank line from a batch file?
13) Why does my PC lose a day if I leave it unattended for more than 24 hours?
14) How can I toggle NumLock/CapsLock/ScrollLock from a batch file or program?
15) I just installed a high density (1.2M) floppy drive, and weird things
    are happening.  How do I fix it?
16) What is 4DOS?  Where can I get it?  How can I disable the annoying beeps
    that it makes when I run it?

raymond@math.berkeley.edu (Raymond Chen) (09/04/90)

[Important changes:
  The mail server has changed location.
  The archives are now available via anonymous ftp.

 Note:  Please report all problems with the server; it's a new version
	and there are probably some bugs that slipped through testing.]

[$Id: csip.faq 4.10 90/09/02 20:35:43 raymond Exp Locker: raymond $]

TABLE OF CONTENTS

CHAPTER 0:  INTRODUCTION

0.1)  What is 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?
0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?
0.4)  Somebody just asked a really simple question.  What should I do?

CHAPTER 1:  OBTAINING PROGRAMS FROM THE ARCHIVES

1.1)  What is anonymous ftp?  How do I use it?
1.2)  How do I use the programs that are posted to comp.binaries.ibm.pc?
1.3)  I've uudecoded it, and the file is on my PC.  Now what?
1.4)  The unpacking program said that the archive was corrupted.
1.5)  What public archives exist, and what are their IP numbers?
1.6)  I do not have ftp access.  Can somebody email me the files?

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?
2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?
2.3)  How do I reboot my computer via software?
2.4)  What is the difference between extended/expanded memory, and
      how can I access it from my C/Pascal program?
2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?
3.2)  I'm having trouble with product X.  Can anyone help me?
3.3)  What is the file format that application X uses?
3.4)  Rumor has it that company X is working on a new version of product Y.
      Does anybody have any information about it?
3.5)  I don't like my keyboard's layout.  How can I swap the X and Y keys?

CHAPTER 4:  HARDWARE

4.1)  What are the differences between chip X and chip Y?
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?
4.3)  How do I do a low-level reformat of my hard drive?
4.4)  What does interleave mean?  What interleave should I use?
4.5)  What do ESDI, SCSI, RLL, MFM mean?
4.6)  Can I use an RLL controller on my MFM drive?
4.7)  Should I leave my PC turned on all the time?  What about
      mounting it sideways?

CHAPTER 5:  MISCELLANEOUS

5.1)  How do I undelete a file?  Recover from an accidental reformat?
5.2)  Where can I get curses? vi? emacs?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?
5.3)  What about GIF images?  How do I view a GIF image?
5.4)  How do I turn the ECHO off from a batch file?
5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?
5.6)  How do I install a new version of DOS on my hard drive?

APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

--------------------------------------------------------------------------
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.

    You should probably also check that your question hasn't been asked
    to death before.  Many of the files in my archives address
    commonly-asked questions whose answers are too long to list here.
    I also keep an index of previously-asked questions in my archives.
    Instructions on accessing the archive can be found in Appendix A.

0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?

    Oh, for crying out loud.  About twice a year some immature bozo
    posts a note like this and the flames don't die out for weeks.  If
    you consider yourself a mature human being, bite your lip and keep
    quiet.  Let the nincompoop think he's won.  If you absolutely
    positively can't keep quiet, flame the sucker by email.  But
    please, don't make the rest of us have to suffer through it.

    While I have your attention, here are a few more subjects that
    we're sick of seeing:

    FCC to impose surtax on modem usage:  This is simply not true.
        Consult the file "fcc" in my archives for a letter from
        the FCC debunking this rumor.

    Make Money Fast:  They're all pyramid schemes, and they're illegal,
        especially the one from Dave Rhodes.

    Dying Boy's Last Wish:  He broke the record in 1988, so stop it already.
        Besides, the poor child's address keeps changing, ranging from London
        to Atlanta.

0.4)  Somebody just asked a really simple question.  What should I do?

    Send him the answer by email.  Don't post the answer, since
    (trust me) about a dozen people will do it anyway.  If you
    want, drop me a line so I can add the question to the FAQ archives.


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.  It's only polite to minimize your connect
    time, 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 system administrator 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:<msdos.gif>          Switch to the proper directory
        tenex                       Magic word, see below
        get gif_lib.zip             Get the Turbo C GIF library (include source)
        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.

    Here's a script to perform step 1 on UNIX machines:

        #! /bin/sh
        sed '/^END/,/^BEGIN/d' $* | uudecode

    If you saved the pieces as "part01" "part02" and so on, then you
    just type "combine part*" and everything gets decodeded automatically.

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:<MSDOS.ARC-LBR>PK361.EXE   SIMTEL20
        ZIP     PKUNZIP  PD1:<MSDOS.ZIP>PKZ102.EXE      grape
        ZOO     ZOO      PD1:<MSDOS.ZOO>ZOO201.EXE      comp.binaries.ibm.pc
        PAK     PAK210   PD1:<MSDOS.ARC-LBR>PAK210.EXE  chyde.uwasa.fi
                ^^^ note: this is *different* from PKPAK.
        LZH     LHARC    PD1:<MSDOS.ARC-LBR>LH113c.EXE  chyde.uwasa.fi
        Z       COMPRESS PD1:<MSDOS.SQ-USQ>COMPRS16.ARC unix archive sites

    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.

    Mike Jones (mrj00496@uxa.cso.uiuc.edu) maintains a comprehensive
    list of archive formats, available for anonymous ftp from
    ux1.cso.uiuc.edu (128.174.5.59) in the directory doc/pcnet.


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.

        Here is a way to check if you are doing binary transfers correctly.
        Compile the following one-line C program: main(){puts("\250\n\250");}
        Run it by typing "a.out >binary.fil".  Transfer the file
        "binary.fil" to your IBM PC, and TYPE it to the screen from the
        DOS prompt.  If you are doing things correctly, you should see
        the following:
                ?
                 ?
        except that the question marks will be upside-down.


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.
    This is a very busy site, so try connecting at really obscure
    times of day.  (SIMTEL20 is in the Mountain time zone, 7 hours
    behind GMT.)

    In the PD1:<MSDOS.FILEDOCS> 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, Potsdam, NY USA)

        chyde.uwasa.fi          00readme        Timo Salmi (ts@chyde.uwasa.fi)
        128.214.12.3 (University of Vaasa, Finland)

    My email server has the index files for SIMTEL20, grape, and chyde.

    A very large list of ftp sites is maintained by odin@pilot.njin.net.
    The most recently list can be ftp'd from pilot.njin.net (128.6.7.38).

    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:<MSDOS.GRAPHICS>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".

    BITNET users can also send LISTSERV commands to LISTSERV@NDSUVM1
    or LISTSERV@RPIECS to accomplish the same thing.

    European users can use EARN TRICKLE servers.  Send commands to
    TRICKLE@site, where "site" is one of the following: 
        AWIWUW11 (Austria)      DB0FUB11 (Germany)      EB0UB011 (Spain) 
        BANUFS11 (Belgium)      DTUZDV1  (Germany)      TAUNIVM  (Israel)
        DKTC11   (Denmark)      IMIPOLI  (Italy)        TREARN   (Turkey)
        
    BITNET users can send email to BITFTP@PUCC to perform ftp.
    To receive instructions, send email consisting of the single
    word HELP to BITFTP@PUCC.  Using this service to ftp to SIMTEL20
    is discouraged, however.

    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.  



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:<MSDOS.INFO>INTER290.ZIP (as of 1 MAy 1990).
    This listing is updated four or five times per year.

    A list of books on programming the IBM PC can be found in the file
    "books" in my archives.

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.)  The file "flickerfree"
    in my archives contains tips on doing flicker-free video access.

    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 <dos.h>.  A similar trick can
    be used for accessing/setting the segment or offset portion
    of a far pointer.

    Note that this method works only for compilers which store pointers
    in segment:offset format (e.g., MSC, TC).  Other compilers
    (e.g., Lattice) may do things differently.  Consult your compiler
    manual to be sure.

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.  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.

    A useful mnemonic is that exPanded memory uses Paging.

    Allegedly, Zortech C has compiler support for expanded memory, and the
    shareware CXL library (In PD1:<MSDOS.C> on SIMTEL20) provide EMS
    handling for MSC and other compilers.

    More details can be found in the file "memory" in my archives.

2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

    This is a painfully well-known bug in Turbo C.  Just #include <math.h>
    and stick the line "(void)exp(1.0);" at the start of your main() and
    that should convince the linker to include the floating point formats.
    A patch exists to remedy this bug.

    Patches for Turbo C can be obtained from SIMTEL20, or from LIB 5 of
    the Borland Forum on CompuServe.  There is also a Turbo-C mailing list
    on LISTSERV@UCF1VM.BITNET.
    (There's also a Zortech-C mailing list on uunet!ztc-list-request.)


CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?

    Here's a checklist:

        [ ] Consult the files "products" and "old.questions" in my archives
            to see if somebody else has asked the same question and
            to see who responded.  Send them email asking them for their 
            opinions.

        [ ] Write a letter to the Better Business Bureau.

        [ ] If you're still not satisfied, then post a request.  But it
            is now your duty to 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?  What are the GIF,
      TIFF, BGI, OBJ, EXE file formats?  How can I write my own BGI driver?
      Does anybody have a BGI driver for X?

    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.

    If you still can't find what you want, you can always contact the
    company that produced the application.  

    GIF, TIFF and BGI file formats are available on SIMTEL20, and the 
    formats for .OBJ and .EXE files can be found in the MS-DOS Encyclopedia.
    On SIMTEL20 is also the Borland BGI toolkit, which can also be obtained
    directly from Borland.  Many questions and answers about BGI files
    are logged in the file "old.questions" in my archives.

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:<MSDOS.KEYBOARD> 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:      A slightly buggy version of the...
    80386DX:    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.
    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?

    After formatting a 360K disk in a 360K drive, that disk should be
    written to ONLY by another 360K drive, although both 360K and 1.2M
    drives can read it.

    Before formatting a 360K disk in a 1.2M drive, first BULK ERASE the
    diskette, then format it and write to it using ONLY a 1.2M drive.
    This floppy can be read reliably on a 360K drive.  This disk should
    be considered READ-ONLY in a 360K drive.

    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.  PS/2 hard drives can be formatted by booting
    the Reference disk and typing Ctrl-A to call up a hidden menu.

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?

    A record of these debates the last time they went around is
    kept in my archives; consult the file "24hrs".

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?  Is there a program that does X?

    These programs and others are available from SIMTEL20:

PD1:<MSDOS.SCREEN>PCCURS14.ARC    Unix-compatible version of Curses screen mgmt
PD1:<MSDOS.EDITOR>STEVIE.ARC      Clone of Unix 'vi' text editor
PD1:<MSDOS.EDITOR>VI-19A.ARC      Unix-like vi screen text editor for IBM PC
PD1:<MSDOS.SYSUTL>TSRCOM29.ARC    TSR memory management utils (MARK/RELEASE)
PD1:<MSDOS.TURBO-C>RESLB201.ARC   Function library for Turbo-C to make TSRs

    Books on TSR programming are listed in the file "books" in my archives.

    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.  The file "editor" in my archives discusses this, as well
    as other popular questions about editors.

    In general, if you are looking for a program, look first in the file
    PD1:<MSDOS.FILEDOCS>SIMIBM.ARC.  This is a directory of all the files
    in SIMTEL20's MS-DOS archives.
    You can also send requests to my email server to search through the
    index for a word or phrase.


5.3)  What about GIF images?  How do I view a GIF image?

    Archives for GIF images come and go (mostly go).
    GIF images are kept on wuarchive.wustl.edu (/graphics/gif),
    funic.funet.fi (/disk1/pub/misc/gif) and elsewhere.  GIF viewers can
    be found at those sites, as well as on SIMTEL20 (PD1:<MSDOS.GIF>).
    See the file "gif.info" in my archives for more information.

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:<MSDOS.BATUTL>ECHOOFF.PAT contains
    a list of the patches to apply depending on which version of DOS
    you are using.

5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?

    There are a few ways of setting a long path.  One solution is to set
    things up so you don't need a long path in the first place.  For
    example, create a \bat directory with lots of batch files which save
    the current path, set the path to something else, run a program, then
    reset the path to what it originally was.  Or, use the SUBST program
    to make drive-letter aliases for long pathnames.  If you really want a
    big path, fetch the program BIGPATH.ARC or SETPTH13.ARC from SIMTEL20.

    The size of the environment is controlled by the "/E" option to
    COMMAND.COM.  Add the line "SHELL=COMMAND.COM /P /E:xxx" to your
    CONFIG.SYS, where xxx is the desired environment size (in either
    bytes or paragraphs, depending on your DOS version).

    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:<MSDOS.SYSUTL>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.)


APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

    The archives I keep mentioning in this document are available
    for anonymous ftp (see question 1.1) from math.princeton.edu
    in the directory pub/rjc/csip.  The files are compressed via
    the UNIX "compress" program (see question 1.3).  The file "directory"
    describes the contents of the directory.

    People who cannot ftp can request the files via email.  Send
    email to rjc@math.princeton.edu with no subject and containing
    the single line "help" to receive instructions.

    The email server also looks up programs in the SIMTEL20 index,
    the grape index, and the chyde index.  (So you have no excuse
    for not looking in these indexes before posting a request.)

    One file in particular you might be interested in is "faq.more"
    which contains answers to MORE questions, but which weren't included
    here for reasons of space.  Its table of contents follows:

1)  I found a bug in program X!
2)  Why do I get disk full errors when I only have a bunch of tiny files
    in my root directory?
3)  I found that program X contains the string "Copyright Microsoft", so
    it must be a pirated copy of a commercial program, right?
4)  Can you summarize the history of the 80x86 family of processors?
5)  How about other chips that didn't make on the main faq list?
6)  Why do people say that the 80286 is "brain-dead"?
7)  How do I determine whether I am running on a monochrome or color
    machine?
8)  I have written a program that uses the mouse, and when I use
    CGA/EGA/VGA it is fine, but the mouse does not appear on
    a Hercules card. Why?
9)  Why does DOS use the \ instead of a / as a directory name separator?
    How can I tell DOS that I want to use slashes instead?
10) What is the SysReq key for?
11) How do I switch my screen into 43 line mode?  How can I detect the 
    number of lines from a program?
12) How do I echo a blank line from a batch file?
13) Why does my PC lose a day if I leave it unattended for more than 24 hours?
14) How can I toggle NumLock/CapsLock/ScrollLock from a batch file or program?
15) I just installed a high density (1.2M) floppy drive, and weird things
    are happening.  How do I fix it?
16) What is 4DOS?  Where can I get it?  How can I disable the annoying beeps
    that it makes when I run it?

raymond@math.berkeley.edu (Raymond Chen) (10/03/90)

[Note:  I was sent some last-minute corrections.  In particular, Ralf
Brown's interrupt list is now at version 490.  Although I eagerly
solicit comments/corrections, it would be nice if you sent any comments
towards the beginning rather than the end of the month.]

[$Id: csip.faq 4.10 90/09/02 20:35:43 raymond Exp Locker: raymond $]

TABLE OF CONTENTS

CHAPTER 0:  INTRODUCTION

0.1)  What is 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?
0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?
0.4)  Somebody just asked a really simple question.  What should I do?

CHAPTER 1:  OBTAINING PROGRAMS FROM THE ARCHIVES

1.1)  What is anonymous ftp?  How do I use it?
1.2)  How do I use the programs that are posted to comp.binaries.ibm.pc?
1.3)  I've uudecoded it, and the file is on my PC.  Now what?
1.4)  The unpacking program said that the archive was corrupted.
1.5)  What public archives exist, and what are their IP numbers?
1.6)  I do not have ftp access.  Can somebody email me the files?

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?
2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?
2.3)  How do I reboot my computer via software?
2.4)  What is the difference between extended/expanded memory, and
      how can I access it from my C/Pascal program?
2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?
3.2)  I'm having trouble with product X.  Can anyone help me?
3.3)  What is the file format that application X uses?
3.4)  Rumor has it that company X is working on a new version of product Y.
      Does anybody have any information about it?
3.5)  I don't like my keyboard's layout.  How can I swap the X and Y keys?

CHAPTER 4:  HARDWARE

4.1)  What are the differences between chip X and chip Y?
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?
4.3)  How do I do a low-level reformat of my hard drive?
4.4)  What does interleave mean?  What interleave should I use?
4.5)  What do ESDI, SCSI, RLL, MFM mean?
4.6)  Can I use an RLL controller on my MFM drive?
4.7)  Should I leave my PC turned on all the time?  What about
      mounting it sideways?

CHAPTER 5:  MISCELLANEOUS

5.1)  How do I undelete a file?  Recover from an accidental reformat?
5.2)  Where can I get curses? vi? emacs?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?
5.3)  What about GIF images?  How do I view a GIF image?
5.4)  How do I turn the ECHO off from a batch file?
5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?
5.6)  How do I install a new version of DOS on my hard drive?

APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

--------------------------------------------------------------------------
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.

    You should probably also check that your question hasn't been asked
    to death before.  Many of the files in my archives address
    commonly-asked questions whose answers are too long to list here.
    I also keep an index of previously-asked questions in my archives.
    Instructions on accessing the archive can be found in Appendix A.

0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?

    Oh, for crying out loud.  About twice a year some immature bozo
    posts a note like this and the flames don't die out for weeks.  If
    you consider yourself a mature human being, bite your lip and keep
    quiet.  Let the nincompoop think he's won.  If you absolutely
    positively can't keep quiet, flame the sucker by email.  But
    please, don't make the rest of us have to suffer through it.

    While I have your attention, here are a few more subjects that
    we're sick of seeing:

    FCC to impose surtax on modem usage:  This is simply not true.
        Consult the file "fcc" in my archives for a letter from
        the FCC debunking this rumor.

    Make Money Fast:  They're all pyramid schemes, and they're illegal,
        especially the one from Dave Rhodes.

    Dying Boy's Last Wish:  He broke the record in 1988, so stop it already.
        Besides, the poor child's address keeps changing, ranging from London
        to Atlanta.

0.4)  Somebody just asked a really simple question.  What should I do?

    Send him the answer by email.  Don't post the answer, since
    (trust me) about a dozen people will do it anyway.  If you
    want, drop me a line so I can add the question to the FAQ archives.


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.  It's only polite to minimize your connect
    time, 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 system administrator 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:<msdos.gif>          Switch to the proper directory
        tenex                       Magic word, see below
        get gif_lib.zip             Get the Turbo C GIF library (include source)
        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.

    Here's a script to perform step 1 on UNIX machines:

        #! /bin/sh
        sed '/^END/,/^BEGIN/d' $* | uudecode

    If you saved the pieces as "part01" "part02" and so on, then you
    just type "combine part*" and everything gets decodeded automatically.

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:<MSDOS.ARC-LBR>PK361.EXE   SIMTEL20
        ZIP     PKUNZIP  PD1:<MSDOS.ZIP>PKZ102.EXE      grape
        ZOO     ZOO      PD1:<MSDOS.ZOO>ZOO201.EXE      comp.binaries.ibm.pc
        PAK     PAK210   PD1:<MSDOS.ARC-LBR>PAK210.EXE  chyde.uwasa.fi
                ^^^ note: this is *different* from PKPAK.
        LZH     LHARC    PD1:<MSDOS.ARC-LBR>LH113c.EXE  chyde.uwasa.fi
        Z       COMPRESS PD1:<MSDOS.SQ-USQ>COMPRS16.ARC unix archive sites

    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.

    Mike Jones (mrj00496@uxa.cso.uiuc.edu) maintains a comprehensive
    list of archive formats, available for anonymous ftp from
    ux1.cso.uiuc.edu (128.174.5.59) in the directory doc/pcnet.


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.

        Here is a way to check if you are doing binary transfers correctly.
        Compile the following one-line C program: main(){puts("\250\n\250");}
        Run it by typing "a.out >binary.fil".  Transfer the file
        "binary.fil" to your IBM PC, and TYPE it to the screen from the
        DOS prompt.  If you are doing things correctly, you should see
        the following:
                ?
                 ?
        except that the question marks will be upside-down.


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.
    This is a very busy site, so try connecting at really obscure
    times of day.  (SIMTEL20 is in the Mountain time zone, 7 hours
    behind GMT.)

    In the PD1:<MSDOS.FILEDOCS> 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, Potsdam, NY USA)

        chyde.uwasa.fi          00readme        Timo Salmi (ts@chyde.uwasa.fi)
        128.214.12.3 (University of Vaasa, Finland)

    My email server has the index files for SIMTEL20, grape, and chyde.

    A very large list of ftp sites is maintained by odin@pilot.njin.net.
    The most recently list can be ftp'd from pilot.njin.net (128.6.7.38).

    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:<MSDOS.GRAPHICS>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".

    BITNET users can also send LISTSERV commands to LISTSERV@NDSUVM1
    or LISTSERV@RPIECS to accomplish the same thing.

    European users can use EARN TRICKLE servers.  Send commands to
    TRICKLE@site, where "site" is one of the following: 
        AWIWUW11 (Austria)      DB0FUB11 (Germany)      EB0UB011 (Spain) 
        BANUFS11 (Belgium)      DTUZDV1  (Germany)      TAUNIVM  (Israel)
        DKTC11   (Denmark)      IMIPOLI  (Italy)        TREARN   (Turkey)
        
    BITNET users can send email to BITFTP@PUCC to perform ftp.
    To receive instructions, send email consisting of the single
    word HELP to BITFTP@PUCC.  Using this service to ftp to SIMTEL20
    is discouraged, however.

    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.  



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:<MSDOS.INFO>INTER290.ZIP (as of 1 MAy 1990).
    This listing is updated four or five times per year.

    A list of books on programming the IBM PC can be found in the file
    "books" in my archives.

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.)  The file "flickerfree"
    in my archives contains tips on doing flicker-free video access.

    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 <dos.h>.  A similar trick can
    be used for accessing/setting the segment or offset portion
    of a far pointer.

    Note that this method works only for compilers which store pointers
    in segment:offset format (e.g., MSC, TC).  Other compilers
    (e.g., Lattice) may do things differently.  Consult your compiler
    manual to be sure.

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.  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.

    A useful mnemonic is that exPanded memory uses Paging.

    Allegedly, Zortech C has compiler support for expanded memory, and the
    shareware CXL library (In PD1:<MSDOS.C> on SIMTEL20) provide EMS
    handling for MSC and other compilers.

    More details can be found in the file "memory" in my archives.

2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

    This is a painfully well-known bug in Turbo C.  Just #include <math.h>
    and stick the line "(void)exp(1.0);" at the start of your main() and
    that should convince the linker to include the floating point formats.
    A patch exists to remedy this bug.

    Patches for Turbo C can be obtained from SIMTEL20, or from LIB 5 of
    the Borland Forum on CompuServe.  There is also a Turbo-C mailing list
    on LISTSERV@UCF1VM.BITNET.
    (There's also a Zortech-C mailing list on uunet!ztc-list-request.)


CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?

    Here's a checklist:

        [ ] Consult the files "products" and "old.questions" in my archives
            to see if somebody else has asked the same question and
            to see who responded.  Send them email asking them for their 
            opinions.

        [ ] Write a letter to the Better Business Bureau.

        [ ] If you're still not satisfied, then post a request.  But it
            is now your duty to 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?  What are the GIF,
      TIFF, BGI, OBJ, EXE file formats?  How can I write my own BGI driver?
      Does anybody have a BGI driver for X?

    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.

    If you still can't find what you want, you can always contact the
    company that produced the application.  

    GIF, TIFF and BGI file formats are available on SIMTEL20, and the 
    formats for .OBJ and .EXE files can be found in the MS-DOS Encyclopedia.
    On SIMTEL20 is also the Borland BGI toolkit, which can also be obtained
    directly from Borland.  Many questions and answers about BGI files
    are logged in the file "old.questions" in my archives.

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:<MSDOS.KEYBOARD> 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:      A slightly buggy version of the...
    80386DX:    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.
    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?

    After formatting a 360K disk in a 360K drive, that disk should be
    written to ONLY by another 360K drive, although both 360K and 1.2M
    drives can read it.

    Before formatting a 360K disk in a 1.2M drive, first BULK ERASE the
    diskette, then format it and write to it using ONLY a 1.2M drive.
    This floppy can be read reliably on a 360K drive.  This disk should
    be considered READ-ONLY in a 360K drive.

    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.  PS/2 hard drives can be formatted by booting
    the Reference disk and typing Ctrl-A to call up a hidden menu.

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?

    A record of these debates the last time they went around is
    kept in my archives; consult the file "24hrs".

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?  Is there a program that does X?

    These programs and others are available from SIMTEL20:

PD1:<MSDOS.SCREEN>PCCURS14.ARC    Unix-compatible version of Curses screen mgmt
PD1:<MSDOS.EDITOR>STEVIE.ARC      Clone of Unix 'vi' text editor
PD1:<MSDOS.EDITOR>VI-19A.ARC      Unix-like vi screen text editor for IBM PC
PD1:<MSDOS.SYSUTL>TSRCOM29.ARC    TSR memory management utils (MARK/RELEASE)
PD1:<MSDOS.TURBO-C>RESLB201.ARC   Function library for Turbo-C to make TSRs

    Books on TSR programming are listed in the file "books" in my archives.

    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.  The file "editor" in my archives discusses this, as well
    as other popular questions about editors.

    In general, if you are looking for a program, look first in the file
    PD1:<MSDOS.FILEDOCS>SIMIBM.ARC.  This is a directory of all the files
    in SIMTEL20's MS-DOS archives.
    You can also send requests to my email server to search through the
    index for a word or phrase.


5.3)  What about GIF images?  How do I view a GIF image?

    Archives for GIF images come and go (mostly go).
    GIF images are kept on wuarchive.wustl.edu (/graphics/gif),
    funic.funet.fi (/disk1/pub/misc/gif) and elsewhere.  GIF viewers can
    be found at those sites, as well as on SIMTEL20 (PD1:<MSDOS.GIF>).
    See the file "gif.info" in my archives for more information.

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:<MSDOS.BATUTL>ECHOOFF.PAT contains
    a list of the patches to apply depending on which version of DOS
    you are using.

5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?

    There are a few ways of setting a long path.  One solution is to set
    things up so you don't need a long path in the first place.  For
    example, create a \bat directory with lots of batch files which save
    the current path, set the path to something else, run a program, then
    reset the path to what it originally was.  Or, use the SUBST program
    to make drive-letter aliases for long pathnames.  If you really want a
    big path, fetch the program BIGPATH.ARC or SETPTH13.ARC from SIMTEL20.

    The size of the environment is controlled by the "/E" option to
    COMMAND.COM.  Add the line "SHELL=COMMAND.COM /P /E:xxx" to your
    CONFIG.SYS, where xxx is the desired environment size (in either
    bytes or paragraphs, depending on your DOS version).

    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:<MSDOS.SYSUTL>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.)


APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

    The archives I keep mentioning in this document are available
    for anonymous ftp (see question 1.1) from math.princeton.edu
    in the directory pub/rjc/csip.  The files are compressed via
    the UNIX "compress" program (see question 1.3).  The file "directory"
    describes the contents of the directory.

    People who cannot ftp can request the files via email.  Send
    email to rjc@math.princeton.edu with no subject and containing
    the single line "help" to receive instructions.

    The email server also looks up programs in the SIMTEL20 index,
    the grape index, and the chyde index.  (So you have no excuse
    for not looking in these indexes before posting a request.)

    One file in particular you might be interested in is "faq.more"
    which contains answers to MORE questions, but which weren't included
    here for reasons of space.  Its table of contents follows:

1)  I found a bug in program X!
2)  Why do I get disk full errors when I only have a bunch of tiny files
    in my root directory?
3)  I found that program X contains the string "Copyright Microsoft", so
    it must be a pirated copy of a commercial program, right?
4)  Can you summarize the history of the 80x86 family of processors?
5)  How about other chips that didn't make on the main faq list?
6)  Why do people say that the 80286 is "brain-dead"?
7)  How do I determine whether I am running on a monochrome or color
    machine?
8)  I have written a program that uses the mouse, and when I use
    CGA/EGA/VGA it is fine, but the mouse does not appear on
    a Hercules card. Why?
9)  Why does DOS use the \ instead of a / as a directory name separator?
    How can I tell DOS that I want to use slashes instead?
10) What is the SysReq key for?
11) How do I switch my screen into 43 line mode?  How can I detect the 
    number of lines from a program?
12) How do I echo a blank line from a batch file?
13) Why does my PC lose a day if I leave it unattended for more than 24 hours?
14) How can I toggle NumLock/CapsLock/ScrollLock from a batch file or program?
15) I just installed a high density (1.2M) floppy drive, and weird things
    are happening.  How do I fix it?
16) What is 4DOS?  Where can I get it?  How can I disable the annoying beeps
    that it makes when I run it?
--
Raymond Chen (raymond@math.berkeley.edu)

raymond@pepto-bismol.berkeley.edu (Raymond Chen) (11/03/90)

[$Id: csip.faq 4.12 90/11/02 13:02:30 raymond Exp $]

TABLE OF CONTENTS

CHAPTER 0:  INTRODUCTION

0.1)  What is 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?
0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?
0.4)  Somebody just asked a really simple question.  What should I do?

CHAPTER 1:  OBTAINING PROGRAMS FROM THE ARCHIVES

1.1)  What is anonymous ftp?  How do I use it?
1.2)  How do I use the programs that are posted to comp.binaries.ibm.pc?
1.3)  I've uudecoded it, and the file is on my PC.  Now what?
1.4)  The unpacking program said that the archive was corrupted.
1.5)  What public archives exist, and what are their IP numbers?
1.6)  I do not have ftp access.  Can somebody email me the files?

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?
2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?
2.3)  How do I reboot my computer via software?
2.4)  What is the difference between extended/expanded memory, and
      how can I access it from my C/Pascal program?
2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?
3.2)  I'm having trouble with product X.  Can anyone help me?
3.3)  What is the file format that application X uses?
3.4)  Rumor has it that company X is working on a new version of product Y.
      Does anybody have any information about it?
3.5)  I don't like my keyboard's layout.  How can I swap the X and Y keys?

CHAPTER 4:  HARDWARE

4.1)  What are the differences between chip X and chip Y?
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?
4.3)  How do I do a low-level reformat of my hard drive?
4.4)  What does interleave mean?  What interleave should I use?
4.5)  What do ESDI, SCSI, RLL, MFM mean?
4.6)  Can I use an RLL controller on my MFM drive?
4.7)  Should I leave my PC turned on all the time?  What about
      mounting it sideways?

CHAPTER 5:  MISCELLANEOUS

5.1)  How do I undelete a file?  Recover from an accidental reformat?
5.2)  Where can I get UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?
5.3)  What about GIF images?  How do I view a GIF image?
5.4)  How do I turn the ECHO off from a batch file?
5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?
5.6)  How do I install a new version of DOS on my hard drive?

APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE
APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

--------------------------------------------------------------------------
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.

    In particular, if you wish to add something to the FAQ, don't just
    post an article saying ``This should be in the FAQ'' because I probably
    will miss it.  Send me email directly.

    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.

    You should probably also check that your question hasn't been asked
    to death before.  Many of the files in my archives address
    commonly-asked questions whose answers are too long to list here.
    I also keep an index of previously-asked questions in my archives.
    Instructions on accessing the archive can be found in Appendix A.

0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?

    Oh, for crying out loud.  About twice a year some immature bozo
    posts a note like this and the flames don't die out for weeks.  If
    you consider yourself a mature human being, bite your lip and keep
    quiet.  Let the nincompoop think he's won.  If you absolutely
    positively can't keep quiet, flame the sucker by email.  But
    please, don't make the rest of us have to suffer through it.

    While I have your attention, here are a few more subjects that
    we're sick of seeing:

    FCC to impose surtax on modem usage:  This is simply not true.
        Consult the file "fcc" in my archives for a letter from
        the FCC debunking this rumor.

    Make Money Fast:  They're all pyramid schemes, and they're illegal,
        especially the one from Dave Rhodes.

    Dying Boy's Last Wish:  He broke the record in 1988, so stop it already.
        Besides, the poor child's address keeps changing, ranging from London
        to Atlanta.

0.4)  Somebody just asked a really simple question.  What should I do?

    Send him the answer by email.  Don't post the answer, since
    (trust me) about a dozen people will do it anyway.  If you
    want, drop me a line so I can add the question to the FAQ archives.


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.  It's only polite to minimize your connect
    time, 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 system administrator 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:<msdos.gif>          Switch to the proper directory
        tenex                       Magic word, see below
        get gif_lib.zip             Get the Turbo C GIF library (include source)
        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.

    Here's a script to perform step 1 on UNIX machines:

        #! /bin/sh
        sed '/^END/,/^BEGIN/d' $* | uudecode

    If you saved the pieces as "part01" "part02" and so on, then you
    just type "combine part*" and everything gets decodeded automatically.

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:<MSDOS.ARC-LBR>PK361.EXE   SIMTEL20
        ZIP     PKUNZIP  PD1:<MSDOS.ZIP>PKZ102.EXE      grape
        ZOO     ZOO      PD1:<MSDOS.ZOO>ZOO201.EXE      comp.binaries.ibm.pc
        PAK     PAK210   PD1:<MSDOS.ARC-LBR>PAK210.EXE  chyde.uwasa.fi
                ^^^ note: this is *different* from PKPAK.
        LZH     LHARC    PD1:<MSDOS.ARC-LBR>LH113c.EXE  chyde.uwasa.fi
        Z       COMPRESS PD1:<MSDOS.SQ-USQ>COMPRS16.ARC unix archive sites

    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.

    Mike Jones (mrj00496@uxa.cso.uiuc.edu) maintains a comprehensive
    list of archive formats, available for anonymous ftp from
    ux1.cso.uiuc.edu (128.174.5.59) in the directory doc/pcnet.


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.

        Here is a way to check if you are doing binary transfers correctly.
        Compile the following one-line C program: main(){puts("\250\n\250");}
        Run it by typing "a.out >binary.fil".  Transfer the file
        "binary.fil" to your IBM PC, and TYPE it to the screen from the
        DOS prompt.  If you are doing things correctly, you should see
        the following:
                ?
                 ?
        except that the question marks will be upside-down.


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.
    This is a very busy site, so try connecting at really obscure
    times of day.  (SIMTEL20 is in the Mountain time zone, 7 hours
    behind GMT.)

    In the PD1:<MSDOS.FILEDOCS> 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, Potsdam, NY USA)

        chyde.uwasa.fi          HELP          Timo Salmi (ts@chyde.uwasa.fi)
                                              Harri Valkama (hv@chyde.uwasa.fi)
        128.214.12.3 (University of Vaasa, Finland)

    My email server has the index files for SIMTEL20, grape, and chyde.

    A very large list of ftp sites is maintained by odin@pilot.njin.net.
    The most recently list can be ftp'd from pilot.njin.net (128.6.7.38).

    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:<MSDOS.GRAPHICS>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".

    BITNET users can also send LISTSERV commands to LISTSERV@NDSUVM1
    or LISTSERV@RPIECS to accomplish the same thing.

    European users can use EARN TRICKLE servers.  Send commands to
    TRICKLE@site, where "site" is one of the following: 
        AWIWUW11 (Austria)      DB0FUB11 (Germany)      EB0UB011 (Spain) 
        BANUFS11 (Belgium)      DTUZDV1  (Germany)      TAUNIVM  (Israel)
        DKTC11   (Denmark)      IMIPOLI  (Italy)        TREARN   (Turkey)
        
    BITNET users can send email to BITFTP@PUCC to perform ftp.
    To receive instructions, send email consisting of the single
    word HELP to BITFTP@PUCC.  Using this service to ftp to SIMTEL20
    is discouraged, however.

    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.  

    The archives at chyde.uwasa.fi are also serviced by a mail server
    that is still in an experimental stage.  Send mail to hv@chyde.uwasa.fi
    with a subject of "chyde-request" (no quotation marks, lowercase is
    important), and whose body contains the two words "send help" (again,
    no quotation marks, lowercase is important).  Do not include a signature
    because it confuses the server.  If you do not understand, don't
    use the email server.

    It must be emphasized that mail-based file transfer is frowned upon
    by system administrators, and you are strongly encouraged to use ftp
    if at all possible.

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:<MSDOS.INFO>INTERxxx.ZIP (the last three digits
    indicate the version number).

    A list of books on programming the IBM PC can be found in the file
    "books" in my archives.

2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?

    First comment is that direct video access is poor program engineering
    since it ties your program down to a particular hardware configuration.
    (Device drivers and TSRs are also known to reprogram the video board,
    thereby making accurate direct video access difficult.)

    Nevertheless, here's the answer, more to illustrate the concept
    rather than as a suggested method of action.  You can say

        #define screen ((char far*)0xB8000000)      /* B800:0000 */

    and treat "screen" as if it were an array.  You can 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.)  The file "flickerfree"
    in my archives contains tips on doing flicker-free video access.

    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 <dos.h>.  A similar trick can
    be used for accessing/setting the segment or offset portion
    of a far pointer.

    Note that this method works only for compilers which store pointers
    in segment:offset format (e.g., MSC, TC).  Other compilers
    (e.g., Lattice) may do things differently.  Consult your compiler
    manual to be sure.

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.  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.

    A useful mnemonic is that exPanded memory uses Paging.

    Allegedly, Zortech C has compiler support for expanded memory, and the
    shareware CXL library (In PD1:<MSDOS.C> on SIMTEL20) provide EMS
    handling for MSC and other compilers.

    More details can be found in the file "memory" in my archives.

2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

    This is a painfully well-known bug in Turbo C.  Just #include <math.h>
    and stick the line "(void)exp(1.0);" at the start of your main() and
    that should convince the linker to include the floating point formats.
    A patch exists to remedy this bug.

    Patches for Turbo C can be obtained from SIMTEL20, or from LIB 5 of
    the Borland Forum on CompuServe.  There is a Turbo-C mailing list
    on LISTSERV@UCF1VM.BITNET.

    There's a Zortech-C mailing list on uunet!ztc-list-request.


CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?

    Here's a checklist:

        [ ] Consult the files "products" and "old.questions" in my archives
            to see if somebody else has asked the same question and
            to see who responded.  Send them email asking them for their 
            opinions.

        [ ] Write a letter to the Better Business Bureau.  They've been
            archiving this sort of information for years.

        [ ] If you're still not satisfied, then post a request.  But it
            is now your duty to 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.

    In particular, a long summary of the debate over Mark Williams'
    "Coherent" product is available from my archives.

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?  What are the GIF,
      TIFF, BGI, PCX, OBJ, EXE file formats?  How can I write my own BGI driver?
      Does anybody have a BGI driver for X?

    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.

    If you still can't find what you want, you can always contact the
    company that produced the application.  

    SIMTEL20 has GIF, TIFF and BGI file formats, as well as the Borland BGI
    toolkit (also available from Borland).  The formats for .OBJ and .EXE
    files can be found in the MS-DOS Encyclopedia.  The PCX file format can
    be obtained from ZSoft (their address is in the old.questions file).

    Indeed, SIMTEL20's <MSDOS.INFO> directory is just chock full of
    assorted technical information.

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:<MSDOS.KEYBOARD> 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:      A slightly buggy version of the...
    80386DX:    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.
    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?

    After formatting a 360K disk in a 360K drive, that disk should be
    written to ONLY by another 360K drive, although both 360K and 1.2M
    drives can read it.

    Before formatting a 360K disk in a 1.2M drive, first BULK ERASE the
    diskette, then format it and write to it using ONLY a 1.2M drive.
    This floppy can be read reliably on a 360K drive.  This disk should
    be considered READ-ONLY in a 360K drive.

    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.  PS/2 hard drives can be formatted by booting
    the Reference disk and typing Ctrl-A to call up a hidden menu.

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?

    A record of these debates the last time they went around is
    kept in my archives; consult the file "24hrs".

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 UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?

    Here's just a *sample* of what's available from SIMTEL20:

PD1:<MSDOS.SCREEN>PCCURS14.ARC    Unix-compatible version of Curses screen mgmt
PD1:<MSDOS.EDITOR>STEVIE.ARC      Clone of Unix 'vi' text editor
PD1:<MSDOS.EDITOR>VI-19A.ARC      Unix-like vi screen text editor for IBM PC
PD1:<MSDOS.SYSUTL>TSRCOM29.ARC    TSR memory management utils (MARK/RELEASE)
PD1:<MSDOS.TURBO-C>RESLB201.ARC   Function library for Turbo-C to make TSRs

    There's plenty more where they came from.

    Books on TSR programming are listed in the file "books" in my archives.

    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.)

    The GNUish MS-DOS project is moderated by Thorsten Ohl
    <td12@ddagsi.bitnet>.  Their efforts can be found on SIMTEL20
    and elsewhere.

    There are several different emacs implementations for the PC.
    The file "editor" in my archives discusses this, as well
    as other popular questions about editors.

    In general, if you are looking for a program, look first in the file
    PD1:<MSDOS.FILEDOCS>SIMIBM.ARC.  This is a directory of all the files
    in SIMTEL20's MS-DOS archives.
    You can also send requests to my email server to search through the
    index for a word or phrase.


5.3)  What about GIF images?  How do I view a GIF image?

    Archives for GIF images come and go (mostly go).
    GIF images are kept on wuarchive.wustl.edu (/graphics/gif),
    funic.funet.fi (/disk1/pub/misc/gif) and elsewhere.  GIF viewers can
    be found at those sites, as well as on SIMTEL20 (PD1:<MSDOS.GIF>).
    See the file "gif.info" in my archives for more information.

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:<MSDOS.BATUTL>ECHOOFF.PAT contains
    a list of the patches to apply depending on which version of DOS
    you are using.

5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?

    There are a few ways of setting a long path.  One solution is to set
    things up so you don't need a long path in the first place.  For
    example, create a \bat directory with lots of batch files which save
    the current path, set the path to something else, run a program, then
    reset the path to what it originally was.  Or, use the SUBST program
    to make drive-letter aliases for long pathnames.  If you really want a
    big path, fetch the program BIGPATH.ARC or SETPTH13.ARC from SIMTEL20.

    The size of the environment is controlled by the "/E" option to
    COMMAND.COM.  Add the line "SHELL=COMMAND.COM /P /E:xxx" to your
    CONFIG.SYS, where xxx is the desired environment size (in either
    bytes or paragraphs, depending on your DOS version).

    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:<MSDOS.SYSUTL>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.)


APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

    The archives I keep mentioning in this document are available
    for anonymous ftp (question 1.1) from math.princeton.edu[128.112.128.157]
    in the directory pub/rjc/csip.  The files are compressed via
    the UNIX "compress" program (see question 1.3).  The file "directory"
    describes the contents of the directory.

    People who cannot ftp can request the files via email.  Before sending
    mail to the server, make sure you are using the instructions from the
    most recent version of this file.

    Send email to rjc@math.princeton.edu with no subject and containing
    the two lines

        path your-return-address
        help

    replacing "your-return-address" with a valid reply path
    *from*me*to*you*.  (British users take careful note!)
    Actually, the server tries to guess the return path,
    so the "path" command is needed only if your mailer puts bogus
    headers on outgoing mail.

    The email server also looks up programs in the SIMTEL20 index,
    the grape index, and the chyde index.  (So you have no excuse
    for not looking in these indexes before posting a request.)

APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

    The answers to the following questions can be obtained from the
    archives described above, as the file "faq.more".

1)  I found a bug in program X!
2)  Why do I get disk full errors when I only have a bunch of tiny files
    in my root directory?
3)  I found that program X contains the string "Copyright Microsoft", so
    it must be a pirated copy of a commercial program, right?
4)  Can you summarize the history of the 80x86 family of processors?
5)  How about other chips that didn't make on the main faq list?
6)  Why do people say that the 80286 is "brain-dead"?
7)  How do I determine whether I am running on a monochrome or color
    machine?
8)  I have written a program that uses the mouse, and when I use
    CGA/EGA/VGA it is fine, but the mouse does not appear on
    a Hercules card. Why?
9)  Why does DOS use the \ instead of a / as a directory name separator?
    How can I tell DOS that I want to use slashes instead?
10) What is the SysReq key for?
11) How do I switch my screen into 43 line mode?  How can I detect the 
    number of lines from a program?
12) How do I echo a blank line from a batch file?
13) Why does my PC lose a day if I leave it unattended for more than 24 hours?
14) Why is my program limited to only 20 open files?  How can I increase
    this value?
15) I just installed a high density (1.2M) floppy drive, and weird things
    are happening.  How do I fix it?
16) What is 4DOS?  Where can I get it?  How can I disable the annoying beeps
    that it makes when I run it?
17) How do I disable call waiting?
18) Redirecting printer output into a file.

    Prof. Timo Salmi also has his own collection of Frequently Asked Questions.
    Watch for his periodic postings.

raymond@math.berkeley.edu (Raymond Chen) (12/07/90)

[PS.  I've updated various files at the math.princeton.edu archives, too.]

[$Id: csip.faq 4.12 90/11/02 13:02:30 raymond Exp Locker: raymond $]

TABLE OF CONTENTS

CHAPTER 0:  INTRODUCTION

0.1)  What is 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?
0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?
0.4)  Somebody just asked a really simple question.  What should I do?

CHAPTER 1:  OBTAINING PROGRAMS FROM THE ARCHIVES

1.1)  What is anonymous ftp?  How do I use it?
1.2)  How do I use the programs that are posted to comp.binaries.ibm.pc?
1.3)  I've uudecoded it, and the file is on my PC.  Now what?
1.4)  The unpacking program said that the archive was corrupted.
1.5)  What public archives exist, and what are their IP numbers?
1.6)  I do not have ftp access.  Can somebody email me the files?

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?
2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?
2.3)  How do I reboot my computer via software?
2.4)  What is the difference between extended/expanded memory, and
      how can I access it from my C/Pascal program?
2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?
3.2)  I'm having trouble with product X.  Can anyone help me?
3.3)  What is the file format that application X uses?
3.4)  Rumor has it that company X is working on a new version of product Y.
      Does anybody have any information about it?
3.5)  I don't like my keyboard's layout.  How can I swap the X and Y keys?

CHAPTER 4:  HARDWARE

4.1)  What are the differences between chip X and chip Y?
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?
4.3)  How do I do a low-level reformat of my hard drive?
4.4)  What does interleave mean?  What interleave should I use?
4.5)  What do ESDI, SCSI, RLL, MFM mean?
4.6)  Can I use an RLL controller on my MFM drive?
4.7)  Should I leave my PC turned on all the time?  What about
      mounting it sideways?

CHAPTER 5:  MISCELLANEOUS

5.1)  How do I undelete a file?  Recover from an accidental reformat?
5.2)  Where can I get UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?
5.3)  What about GIF images?  How do I view a GIF image?
5.4)  How do I turn the ECHO off from a batch file?
5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?
5.6)  How do I install a new version of DOS on my hard drive?

APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE
APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

--------------------------------------------------------------------------
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.

    In particular, if you wish to add something to the FAQ, don't just
    post an article saying ``This should be in the FAQ'' because I probably
    will miss it.  Send me email directly.

    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.

    You should probably also check that your question hasn't been asked
    to death before.  Many of the files in my archives address
    commonly-asked questions whose answers are too long to list here.
    I also keep an index of previously-asked questions in my archives.
    Instructions on accessing the archive can be found in Appendix A.

0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?

    Oh, for crying out loud.  About twice a year some immature bozo
    posts a note like this and the flames don't die out for weeks.  If
    you consider yourself a mature human being, bite your lip and keep
    quiet.  Let the nincompoop think he's won.  If you absolutely
    positively can't keep quiet, flame the sucker by email.  But
    please, don't make the rest of us have to suffer through it.

    While I have your attention, here are a few more subjects that
    we're sick of seeing:

    FCC to impose surtax on modem usage:  This is simply not true.
        Consult the file "fcc" in my archives for a letter from
        the FCC debunking this rumor.

    Make Money Fast:  They're all pyramid schemes, and they're illegal,
        especially the one from Dave Rhodes.

    Dying Boy's Last Wish:  He broke the record in 1988, so stop it already.
        Besides, the poor child's address keeps changing, ranging from London
        to Atlanta.

0.4)  Somebody just asked a really simple question.  What should I do?

    Send him the answer by email.  Don't post the answer, since
    (trust me) about a dozen people will do it anyway.  If you
    want, drop me a line so I can add the question to the FAQ archives.


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.  It's only polite to minimize your connect
    time, 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 system administrator 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:<msdos.gif>          Switch to the proper directory
        tenex                       Magic word, see below
        get gif_lib.zip             Get the Turbo C GIF library (include source)
        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.

    Here's a script to perform step 1 on UNIX machines:

        #! /bin/sh
        sed '/^END/,/^BEGIN/d' $* | uudecode

    If you saved the pieces as "part01" "part02" and so on, then you
    just type "combine part*" and everything gets decodeded automatically.

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:<MSDOS.ARC-LBR>PK361.EXE   SIMTEL20
        ZIP     PKUNZIP  PD1:<MSDOS.ZIP>PKZ102.EXE      grape
        ZOO     ZOO      PD1:<MSDOS.ZOO>ZOO201.EXE      comp.binaries.ibm.pc
        PAK     PAK250   PD1:<MSDOS.ARC-LBR>PAK250.EXE  chyde.uwasa.fi
                ^^^ note: this is *different* from PKPAK.
        LZH     LHARC    PD1:<MSDOS.ARC-LBR>LH113c.EXE  chyde.uwasa.fi
        Z       COMPRESS PD1:<MSDOS.SQ-USQ>COMPRS16.ARC unix archive sites

    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.

    Mike Jones (mrj00496@uxa.cso.uiuc.edu) maintains a comprehensive
    list of archive formats, available for anonymous ftp from
    ux1.cso.uiuc.edu (128.174.5.59) in the directory doc/pcnet.


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.

        Here is a way to check if you are doing binary transfers correctly.
        Compile the following one-line C program: main(){puts("\250\n\250");}
        Run it by typing "a.out >binary.fil".  Transfer the file
        "binary.fil" to your IBM PC, and TYPE it to the screen from the
        DOS prompt.  If you are doing things correctly, you should see
        the following:
                ?
                 ?
        except that the question marks will be upside-down.


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.
    This is a very busy site, so try connecting at really obscure
    times of day.  (SIMTEL20 is in the Mountain time zone, 7 hours
    behind GMT.)

    In the PD1:<MSDOS.FILEDOCS> 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, Potsdam, NY USA)

        chyde.uwasa.fi          HELP          Timo Salmi (ts@chyde.uwasa.fi)
                                              Harri Valkama (hv@chyde.uwasa.fi)
        128.214.12.3 (University of Vaasa, Finland)

    My email server has the index files for SIMTEL20, grape, and chyde.

    A very large list of ftp sites is maintained by odin@pilot.njin.net.
    The most recently list can be ftp'd from pilot.njin.net (128.6.7.38).

    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:<MSDOS.GRAPHICS>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".

    BITNET users can also send LISTSERV commands to LISTSERV@NDSUVM1
    or LISTSERV@RPIECS to accomplish the same thing.

    The administrators of these two servers are Marty Hoag (info@vm1.nodak.edu)
    and John Fisher (fisher@vm.ecs.rpi.edu), respectively.

    European users can use EARN TRICKLE servers.  Send commands to
    TRICKLE@site, where "site" is one of the following: 
        AWIWUW11 (Austria)      DB0FUB11 (Germany)      EB0UB011 (Spain) 
        BANUFS11 (Belgium)      DTUZDV1  (Germany)      TAUNIVM  (Israel)
        DKTC11   (Denmark)      IMIPOLI  (Italy)        TREARN   (Turkey)
        
    BITNET users can send email to BITFTP@PUCC to perform ftp.
    To receive instructions, send email consisting of the single
    word HELP to BITFTP@PUCC.  Using this service to ftp to SIMTEL20
    is discouraged, however.

    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.  

    The archives at chyde.uwasa.fi are also serviced by a mail server.
    Send mail to hv@chyde.uwasa.fi
    with a subject of "chyde-request" (no quotation marks, lowercase is
    important), and whose body contains the two words "send help" (again,
    no quotation marks, lowercase is important).  Do not include a signature
    because it confuses the server.  If you do not understand, don't
    use the email server.

    It must be emphasized that mail-based file transfer is frowned upon
    by system administrators, and you are strongly encouraged to use ftp
    if at all possible.

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:<MSDOS.INFO>INTERxxx.ZIP (the last three digits
    indicate the version number).

    A list of books on programming the IBM PC can be found in the file
    "books" in my archives.

2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?

    First comment is that direct video access is poor program engineering
    since it ties your program down to a particular hardware configuration.
    (Device drivers and TSRs are also known to reprogram the video board,
    thereby making accurate direct video access difficult.)

    Nevertheless, here's the answer, more to illustrate the concept
    rather than as a suggested method of action.  You can say

        #define screen ((char far*)0xB8000000)      /* B800:0000 */

    and treat "screen" as if it were an array.  You can 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.)  The file "flickerfree"
    in my archives contains tips on doing flicker-free video access.

    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 <dos.h>.  A similar trick can
    be used for accessing/setting the segment or offset portion
    of a far pointer.

    Note that this method works only for compilers which store pointers
    in segment:offset format (e.g., MSC, TC).  Other compilers
    (e.g., Lattice) may do things differently.  Consult your compiler
    manual to be sure.

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.  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.

    A useful mnemonic is that exPanded memory uses Paging.

    Allegedly, Zortech C has compiler support for expanded memory, and the
    shareware CXL library (In PD1:<MSDOS.C> on SIMTEL20) provide EMS
    handling for MSC and other compilers.

    More details can be found in the file "memory" in my archives.

2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

    This is a painfully well-known bug in Turbo C.  Just #include <math.h>
    and stick the line "(void)exp(1.0);" at the start of your main() and
    that should convince the linker to include the floating point formats.
    A patch exists to remedy this bug.

    Patches for Turbo C can be obtained from SIMTEL20, or from LIB 5 of
    the Borland Forum on CompuServe.  There is a Turbo-C mailing list
    on LISTSERV@UCF1VM.BITNET.

    There's a Zortech-C mailing list on uunet!ztc-list-request.


CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?

    Here's a checklist:

        [ ] Consult the files "products" and "old.questions" in my archives
            to see if somebody else has asked the same question and
            to see who responded.  Send them email asking them for their 
            opinions.

        [ ] Write a letter to the Better Business Bureau.  They've been
            archiving this sort of information for years.

        [ ] If you're still not satisfied, then post a request.  But it
            is now your duty to 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.

    In particular, a long summary of the debate over Mark Williams'
    "Coherent" product is available from my archives.

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?  What are the GIF,
      TIFF, BGI, PCX, OBJ, EXE file formats?  How can I write my own BGI driver?
      Does anybody have a BGI driver for X?

    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.

    If you still can't find what you want, you can always contact the
    company that produced the application.  

    SIMTEL20 has GIF, TIFF and BGI file formats, as well as the Borland BGI
    toolkit (also available from Borland).  The formats for .OBJ and .EXE
    files can be found in the MS-DOS Encyclopedia.  The PCX file format can
    be obtained from ZSoft (their address is in the old.questions file).

    Indeed, SIMTEL20's <MSDOS.INFO> directory is just chock full of
    assorted technical information.

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:<MSDOS.KEYBOARD> 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:      A slightly buggy version of the...
    80386DX:    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.
    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?

    After formatting a 360K disk in a 360K drive, that disk should be
    written to ONLY by another 360K drive, although both 360K and 1.2M
    drives can read it.

    Before formatting a 360K disk in a 1.2M drive, first BULK ERASE the
    diskette, then format it and write to it using ONLY a 1.2M drive.
    This floppy can be read reliably on a 360K drive.  This disk should
    be considered READ-ONLY in a 360K drive.

    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.  PS/2 hard drives can be formatted by booting
    the Reference disk and typing Ctrl-A to call up a hidden menu.

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?

    A record of these debates the last time they went around is
    kept in my archives; consult the file "24hrs".

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 UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?

    Here's just a *sample* of what's available from SIMTEL20:

PD1:<MSDOS.SCREEN>PCCURS14.ARC    Unix-compatible version of Curses screen mgmt
PD1:<MSDOS.EDITOR>STEVIE.ARC      Clone of Unix 'vi' text editor
PD1:<MSDOS.EDITOR>VI-19A.ARC      Unix-like vi screen text editor for IBM PC
PD1:<MSDOS.SYSUTL>TSRCOM29.ARC    TSR memory management utils (MARK/RELEASE)
PD1:<MSDOS.TURBO-C>RESLB201.ARC   Function library for Turbo-C to make TSRs

    There's plenty more where they came from.

    Books on TSR programming are listed in the file "books" in my archives.

    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.)

    The GNUish MS-DOS project is moderated by Thorsten Ohl
    <td12@ddagsi.bitnet>.  Their efforts can be found on SIMTEL20
    and elsewhere.

    There are several different emacs implementations for the PC.
    The file "editor" in my archives discusses this, as well
    as other popular questions about editors.

    In general, if you are looking for a program, look first in the file
    PD1:<MSDOS.FILEDOCS>SIMIBM.ARC.  This is a directory of all the files
    in SIMTEL20's MS-DOS archives.
    You can also send requests to my email server to search through the
    index for a word or phrase.


5.3)  What about GIF images?  How do I view a GIF image?

    Archives for GIF images come and go (mostly go).
    GIF images are kept on wuarchive.wustl.edu (/graphics/gif),
    funic.funet.fi (/disk1/pub/misc/gif) and elsewhere.  GIF viewers can
    be found at those sites, as well as on SIMTEL20 (PD1:<MSDOS.GIF>).
    See the file "gif.info" in my archives for more information.

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:<MSDOS.BATUTL>ECHOOFF.PAT contains
    a list of the patches to apply depending on which version of DOS
    you are using.

5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?

    There are a few ways of setting a long path.  One solution is to set
    things up so you don't need a long path in the first place.  For
    example, create a \bat directory with lots of batch files which save
    the current path, set the path to something else, run a program, then
    reset the path to what it originally was.  Or, use the SUBST program
    to make drive-letter aliases for long pathnames.  If you really want a
    big path, fetch the program BIGPATH.ARC or SETPTH13.ARC from SIMTEL20.

    The size of the environment is controlled by the "/E" option to
    COMMAND.COM.  Add the line "SHELL=COMMAND.COM /P /E:xxx" to your
    CONFIG.SYS, where xxx is the desired environment size (in either
    bytes or paragraphs, depending on your DOS version).

    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:<MSDOS.SYSUTL>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.)


APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

    The archives I keep mentioning in this document are available
    for anonymous ftp (question 1.1) from math.princeton.edu[128.112.128.157]
    in the directory pub/rjc/csip.  The files are compressed via
    the UNIX "compress" program (see question 1.3).  The file "directory"
    describes the contents of the directory.

    People who cannot ftp can request the files via email.  Before sending
    mail to the server, make sure you are using the instructions from the
    most recent version of this file.

    Send email to rjc@math.princeton.edu with no subject and containing
    the two lines

        path your-return-address
        help

    replacing "your-return-address" with a valid reply path
    *from*me*to*you*.  (British users take careful note!)
    Actually, the server tries to guess the return path,
    so the "path" command is needed only if your mailer puts bogus
    headers on outgoing mail.

    The email server also looks up programs in the SIMTEL20 index,
    the grape index, and the chyde index.  (So you have no excuse
    for not looking in these indexes before posting a request.)

APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

    The answers to the following questions can be obtained from the
    archives described above, as the file "faq.more".

1)  I found a bug in program X!
2)  Why do I get disk full errors when I only have a bunch of tiny files
    in my root directory?
3)  I found that program X contains the string "Copyright Microsoft", so
    it must be a pirated copy of a commercial program, right?
4)  Can you summarize the history of the 80x86 family of processors?
5)  How about other chips that didn't make on the main faq list?
6)  Why do people say that the 80286 is "brain-dead"?
7)  How do I determine whether I am running on a monochrome or color
    machine?
8)  I have written a program that uses the mouse, and when I use
    CGA/EGA/VGA it is fine, but the mouse does not appear on
    a Hercules card. Why?
9)  Why does DOS use the \ instead of a / as a directory name separator?
    How can I tell DOS that I want to use slashes instead?
10) What is the SysReq key for?
11) How do I switch my screen into 43 line mode?  How can I detect the 
    number of lines from a program?
12) How do I echo a blank line from a batch file?
13) Why does my PC lose a day if I leave it unattended for more than 24 hours?
14) Why is my program limited to only 20 open files?  How can I increase
    this value?
15) I just installed a high density (1.2M) floppy drive, and weird things
    are happening.  How do I fix it?
16) What is 4DOS?  Where can I get it?  How can I disable the annoying beeps
    that it makes when I run it?
17) How do I disable call waiting?
18) Redirecting printer output into a file.

    Prof. Timo Salmi also has his own collection of Frequently Asked Questions,
    available as the file /pc/ts/tsfaq##.arc (where ## is a version umber)
    from chyde.uwasa.fi.  Its tables of contents follow:
--------------------------------------------------------------------
 1) How do I capture text from the screen to a file?
 2) How do I redirect the output from the screen to the printer?
 3) How can I direct all output to a file instead of the printer?
 4) Where can I get VT102 emulation codes?
 5) Problems with Procomm or Telix VT102 emulation.
 6) Is there a program to convert Pascal to C?
 7) I need a bigger cursor for my laptop.
 8) Where to find a source code for detecting which CPU my PC has?
 9) Can anyone recommend me a good linear programming package?
10) Where can I find sources for Unix z-modem?
11) Where can I find sources for Unix arc, lharc, zip, and zoo?
12) How to delete non-empty directories fast?
13) I can't run this file I got with a .zip (.arc etc) extension.
14) Reply by email, I don't usually read this group.
15) What is an appropriate maximum length of a signature?
16) What is the best archiver?
17) Can someone point me to a list of ftp sites?
-------------------------------------------------------------------
 1) How do I disable or capture the break key in Turbo Pascal?
 2) How do I get a printed documentation of my students' TP runs?
 3) What is the code for the weekday of a given date?
 4) Need a program to format Turbo Pascal source code consistently
 5) Can someone give me advice for writing a tsr program?
 6) Why can't I read / write the com ports?
 7) What are interrupts and how to use them in Turbo Pascal?
 8) Should I upgrade my Turbo Pascal version?
 9) How do I execute an MsDos command from within a TP program?
10) How is millisecond timing done?
-------------------------------------------------------------------

raymond@math.berkeley.edu (Raymond Chen) (01/16/91)

[No changes since the 7 Dec 90 version, though I have received
some minor corrections.  They'll be ready by next month, I hope. --rjc]

[$Id: csip.faq 4.12 90/11/02 13:02:30 raymond Exp Locker: raymond $]

TABLE OF CONTENTS

CHAPTER 0:  INTRODUCTION

0.1)  What is 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?
0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?
0.4)  Somebody just asked a really simple question.  What should I do?

CHAPTER 1:  OBTAINING PROGRAMS FROM THE ARCHIVES

1.1)  What is anonymous ftp?  How do I use it?
1.2)  How do I use the programs that are posted to comp.binaries.ibm.pc?
1.3)  I've uudecoded it, and the file is on my PC.  Now what?
1.4)  The unpacking program said that the archive was corrupted.
1.5)  What public archives exist, and what are their IP numbers?
1.6)  I do not have ftp access.  Can somebody email me the files?

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?
2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?
2.3)  How do I reboot my computer via software?
2.4)  What is the difference between extended/expanded memory, and
      how can I access it from my C/Pascal program?
2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?
3.2)  I'm having trouble with product X.  Can anyone help me?
3.3)  What is the file format that application X uses?
3.4)  Rumor has it that company X is working on a new version of product Y.
      Does anybody have any information about it?
3.5)  I don't like my keyboard's layout.  How can I swap the X and Y keys?

CHAPTER 4:  HARDWARE

4.1)  What are the differences between chip X and chip Y?
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?
4.3)  How do I do a low-level reformat of my hard drive?
4.4)  What does interleave mean?  What interleave should I use?
4.5)  What do ESDI, SCSI, RLL, MFM mean?
4.6)  Can I use an RLL controller on my MFM drive?
4.7)  Should I leave my PC turned on all the time?  What about
      mounting it sideways?

CHAPTER 5:  MISCELLANEOUS

5.1)  How do I undelete a file?  Recover from an accidental reformat?
5.2)  Where can I get UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?
5.3)  What about GIF images?  How do I view a GIF image?
5.4)  How do I turn the ECHO off from a batch file?
5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?
5.6)  How do I install a new version of DOS on my hard drive?

APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE
APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

--------------------------------------------------------------------------
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.

    In particular, if you wish to add something to the FAQ, don't just
    post an article saying ``This should be in the FAQ'' because I probably
    will miss it.  Send me email directly.

    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.

    You should probably also check that your question hasn't been asked
    to death before.  Many of the files in my archives address
    commonly-asked questions whose answers are too long to list here.
    I also keep an index of previously-asked questions in my archives.
    Instructions on accessing the archive can be found in Appendix A.

0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?

    Oh, for crying out loud.  About twice a year some immature bozo
    posts a note like this and the flames don't die out for weeks.  If
    you consider yourself a mature human being, bite your lip and keep
    quiet.  Let the nincompoop think he's won.  If you absolutely
    positively can't keep quiet, flame the sucker by email.  But
    please, don't make the rest of us have to suffer through it.

    While I have your attention, here are a few more subjects that
    we're sick of seeing:

    FCC to impose surtax on modem usage:  This is simply not true.
        Consult the file "fcc" in my archives for a letter from
        the FCC debunking this rumor.

    Make Money Fast:  They're all pyramid schemes, and they're illegal,
        especially the one from Dave Rhodes.

    Dying Boy's Last Wish:  He broke the record in 1988, so stop it already.
        Besides, the poor child's address keeps changing, ranging from London
        to Atlanta.

0.4)  Somebody just asked a really simple question.  What should I do?

    Send him the answer by email.  Don't post the answer, since
    (trust me) about a dozen people will do it anyway.  If you
    want, drop me a line so I can add the question to the FAQ archives.


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.  It's only polite to minimize your connect
    time, 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 system administrator 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:<msdos.gif>          Switch to the proper directory
        tenex                       Magic word, see below
        get gif_lib.zip             Get the Turbo C GIF library (include source)
        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.

    Here's a script to perform step 1 on UNIX machines:

        #! /bin/sh
        sed '/^END/,/^BEGIN/d' $* | uudecode

    If you saved the pieces as "part01" "part02" and so on, then you
    just type "combine part*" and everything gets decodeded automatically.

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:<MSDOS.ARC-LBR>PK361.EXE   SIMTEL20
        ZIP     PKUNZIP  PD1:<MSDOS.ZIP>PKZ102.EXE      grape
        ZOO     ZOO      PD1:<MSDOS.ZOO>ZOO201.EXE      comp.binaries.ibm.pc
        PAK     PAK250   PD1:<MSDOS.ARC-LBR>PAK250.EXE  chyde.uwasa.fi
                ^^^ note: this is *different* from PKPAK.
        LZH     LHARC    PD1:<MSDOS.ARC-LBR>LH113c.EXE  chyde.uwasa.fi
        Z       COMPRESS PD1:<MSDOS.SQ-USQ>COMPRS16.ARC unix archive sites

    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.

    Mike Jones (mrj00496@uxa.cso.uiuc.edu) maintains a comprehensive
    list of archive formats, available for anonymous ftp from
    ux1.cso.uiuc.edu (128.174.5.59) in the directory doc/pcnet.


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.

        Here is a way to check if you are doing binary transfers correctly.
        Compile the following one-line C program: main(){puts("\250\n\250");}
        Run it by typing "a.out >binary.fil".  Transfer the file
        "binary.fil" to your IBM PC, and TYPE it to the screen from the
        DOS prompt.  If you are doing things correctly, you should see
        the following:
                ?
                 ?
        except that the question marks will be upside-down.


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.
    This is a very busy site, so try connecting at really obscure
    times of day.  (SIMTEL20 is in the Mountain time zone, 7 hours
    behind GMT.)

    In the PD1:<MSDOS.FILEDOCS> 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, Potsdam, NY USA)

        chyde.uwasa.fi          HELP          Timo Salmi (ts@chyde.uwasa.fi)
                                              Harri Valkama (hv@chyde.uwasa.fi)
        128.214.12.3 (University of Vaasa, Finland)

    My email server has the index files for SIMTEL20, grape, and chyde.

    A very large list of ftp sites is maintained by odin@pilot.njin.net.
    The most recently list can be ftp'd from pilot.njin.net (128.6.7.38).

    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:<MSDOS.GRAPHICS>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".

    BITNET users can also send LISTSERV commands to LISTSERV@NDSUVM1
    or LISTSERV@RPIECS to accomplish the same thing.

    The administrators of these two servers are Marty Hoag (info@vm1.nodak.edu)
    and John Fisher (fisher@vm.ecs.rpi.edu), respectively.

    European users can use EARN TRICKLE servers.  Send commands to
    TRICKLE@site, where "site" is one of the following: 
        AWIWUW11 (Austria)      DB0FUB11 (Germany)      EB0UB011 (Spain) 
        BANUFS11 (Belgium)      DTUZDV1  (Germany)      TAUNIVM  (Israel)
        DKTC11   (Denmark)      IMIPOLI  (Italy)        TREARN   (Turkey)
        
    BITNET users can send email to BITFTP@PUCC to perform ftp.
    To receive instructions, send email consisting of the single
    word HELP to BITFTP@PUCC.  Using this service to ftp to SIMTEL20
    is discouraged, however.

    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.  

    The archives at chyde.uwasa.fi are also serviced by a mail server.
    Send mail to hv@chyde.uwasa.fi
    with a subject of "chyde-request" (no quotation marks, lowercase is
    important), and whose body contains the two words "send help" (again,
    no quotation marks, lowercase is important).  Do not include a signature
    because it confuses the server.  If you do not understand, don't
    use the email server.

    It must be emphasized that mail-based file transfer is frowned upon
    by system administrators, and you are strongly encouraged to use ftp
    if at all possible.

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:<MSDOS.INFO>INTERxxx.ZIP (the last three digits
    indicate the version number).

    A list of books on programming the IBM PC can be found in the file
    "books" in my archives.

2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?

    First comment is that direct video access is poor program engineering
    since it ties your program down to a particular hardware configuration.
    (Device drivers and TSRs are also known to reprogram the video board,
    thereby making accurate direct video access difficult.)

    Nevertheless, here's the answer, more to illustrate the concept
    rather than as a suggested method of action.  You can say

        #define screen ((char far*)0xB8000000)      /* B800:0000 */

    and treat "screen" as if it were an array.  You can 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.)  The file "flickerfree"
    in my archives contains tips on doing flicker-free video access.

    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 <dos.h>.  A similar trick can
    be used for accessing/setting the segment or offset portion
    of a far pointer.

    Note that this method works only for compilers which store pointers
    in segment:offset format (e.g., MSC, TC).  Other compilers
    (e.g., Lattice) may do things differently.  Consult your compiler
    manual to be sure.

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.  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.

    A useful mnemonic is that exPanded memory uses Paging.

    Allegedly, Zortech C has compiler support for expanded memory, and the
    shareware CXL library (In PD1:<MSDOS.C> on SIMTEL20) provide EMS
    handling for MSC and other compilers.

    More details can be found in the file "memory" in my archives.

2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

    This is a painfully well-known bug in Turbo C.  Just #include <math.h>
    and stick the line "(void)exp(1.0);" at the start of your main() and
    that should convince the linker to include the floating point formats.
    A patch exists to remedy this bug.

    Patches for Turbo C can be obtained from SIMTEL20, or from LIB 5 of
    the Borland Forum on CompuServe.  There is a Turbo-C mailing list
    on LISTSERV@UCF1VM.BITNET.

    There's a Zortech-C mailing list on uunet!ztc-list-request.


CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?

    Here's a checklist:

        [ ] Consult the files "products" and "old.questions" in my archives
            to see if somebody else has asked the same question and
            to see who responded.  Send them email asking them for their 
            opinions.

        [ ] Write a letter to the Better Business Bureau.  They've been
            archiving this sort of information for years.

        [ ] If you're still not satisfied, then post a request.  But it
            is now your duty to 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.

    In particular, a long summary of the debate over Mark Williams'
    "Coherent" product is available from my archives.

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?  What are the GIF,
      TIFF, BGI, PCX, OBJ, EXE file formats?  How can I write my own BGI driver?
      Does anybody have a BGI driver for X?

    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.

    If you still can't find what you want, you can always contact the
    company that produced the application.  

    SIMTEL20 has GIF, TIFF and BGI file formats, as well as the Borland BGI
    toolkit (also available from Borland).  The formats for .OBJ and .EXE
    files can be found in the MS-DOS Encyclopedia.  The PCX file format can
    be obtained from ZSoft (their address is in the old.questions file).

    Indeed, SIMTEL20's <MSDOS.INFO> directory is just chock full of
    assorted technical information.

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:<MSDOS.KEYBOARD> 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:      A slightly buggy version of the...
    80386DX:    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.
    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?

    After formatting a 360K disk in a 360K drive, that disk should be
    written to ONLY by another 360K drive, although both 360K and 1.2M
    drives can read it.

    Before formatting a 360K disk in a 1.2M drive, first BULK ERASE the
    diskette, then format it and write to it using ONLY a 1.2M drive.
    This floppy can be read reliably on a 360K drive.  This disk should
    be considered READ-ONLY in a 360K drive.

    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.  PS/2 hard drives can be formatted by booting
    the Reference disk and typing Ctrl-A to call up a hidden menu.

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?

    A record of these debates the last time they went around is
    kept in my archives; consult the file "24hrs".

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 UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?

    Here's just a *sample* of what's available from SIMTEL20:

PD1:<MSDOS.SCREEN>PCCURS14.ARC    Unix-compatible version of Curses screen mgmt
PD1:<MSDOS.EDITOR>STEVIE.ARC      Clone of Unix 'vi' text editor
PD1:<MSDOS.EDITOR>VI-19A.ARC      Unix-like vi screen text editor for IBM PC
PD1:<MSDOS.SYSUTL>TSRCOM29.ARC    TSR memory management utils (MARK/RELEASE)
PD1:<MSDOS.TURBO-C>RESLB201.ARC   Function library for Turbo-C to make TSRs

    There's plenty more where they came from.

    Books on TSR programming are listed in the file "books" in my archives.

    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.)

    The GNUish MS-DOS project is moderated by Thorsten Ohl
    <td12@ddagsi.bitnet>.  Their efforts can be found on SIMTEL20
    and elsewhere.

    There are several different emacs implementations for the PC.
    The file "editor" in my archives discusses this, as well
    as other popular questions about editors.

    In general, if you are looking for a program, look first in the file
    PD1:<MSDOS.FILEDOCS>SIMIBM.ARC.  This is a directory of all the files
    in SIMTEL20's MS-DOS archives.
    You can also send requests to my email server to search through the
    index for a word or phrase.


5.3)  What about GIF images?  How do I view a GIF image?

    Archives for GIF images come and go (mostly go).
    GIF images are kept on wuarchive.wustl.edu (/graphics/gif),
    funic.funet.fi (/disk1/pub/misc/gif) and elsewhere.  GIF viewers can
    be found at those sites, as well as on SIMTEL20 (PD1:<MSDOS.GIF>).
    See the file "gif.info" in my archives for more information.

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:<MSDOS.BATUTL>ECHOOFF.PAT contains
    a list of the patches to apply depending on which version of DOS
    you are using.

5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?

    There are a few ways of setting a long path.  One solution is to set
    things up so you don't need a long path in the first place.  For
    example, create a \bat directory with lots of batch files which save
    the current path, set the path to something else, run a program, then
    reset the path to what it originally was.  Or, use the SUBST program
    to make drive-letter aliases for long pathnames.  If you really want a
    big path, fetch the program BIGPATH.ARC or SETPTH13.ARC from SIMTEL20.

    The size of the environment is controlled by the "/E" option to
    COMMAND.COM.  Add the line "SHELL=COMMAND.COM /P /E:xxx" to your
    CONFIG.SYS, where xxx is the desired environment size (in either
    bytes or paragraphs, depending on your DOS version).

    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:<MSDOS.SYSUTL>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.)


APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

    The archives I keep mentioning in this document are available
    for anonymous ftp (question 1.1) from math.princeton.edu[128.112.128.157]
    in the directory pub/rjc/csip.  The files are compressed via
    the UNIX "compress" program (see question 1.3).  The file "directory"
    describes the contents of the directory.

    People who cannot ftp can request the files via email.  Before sending
    mail to the server, make sure you are using the instructions from the
    most recent version of this file.

    Send email to rjc@math.princeton.edu with no subject and containing
    the two lines

        path your-return-address
        help

    replacing "your-return-address" with a valid reply path
    *from*me*to*you*.  (British users take careful note!)
    Actually, the server tries to guess the return path,
    so the "path" command is needed only if your mailer puts bogus
    headers on outgoing mail.

    The email server also looks up programs in the SIMTEL20 index,
    the grape index, and the chyde index.  (So you have no excuse
    for not looking in these indexes before posting a request.)

APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

    The answers to the following questions can be obtained from the
    archives described above, as the file "faq.more".

1)  I found a bug in program X!
2)  Why do I get disk full errors when I only have a bunch of tiny files
    in my root directory?
3)  I found that program X contains the string "Copyright Microsoft", so
    it must be a pirated copy of a commercial program, right?
4)  Can you summarize the history of the 80x86 family of processors?
5)  How about other chips that didn't make on the main faq list?
6)  Why do people say that the 80286 is "brain-dead"?
7)  How do I determine whether I am running on a monochrome or color
    machine?
8)  I have written a program that uses the mouse, and when I use
    CGA/EGA/VGA it is fine, but the mouse does not appear on
    a Hercules card. Why?
9)  Why does DOS use the \ instead of a / as a directory name separator?
    How can I tell DOS that I want to use slashes instead?
10) What is the SysReq key for?
11) How do I switch my screen into 43 line mode?  How can I detect the 
    number of lines from a program?
12) How do I echo a blank line from a batch file?
13) Why does my PC lose a day if I leave it unattended for more than 24 hours?
14) Why is my program limited to only 20 open files?  How can I increase
    this value?
15) I just installed a high density (1.2M) floppy drive, and weird things
    are happening.  How do I fix it?
16) What is 4DOS?  Where can I get it?  How can I disable the annoying beeps
    that it makes when I run it?
17) How do I disable call waiting?
18) Redirecting printer output into a file.

    Prof. Timo Salmi also has his own collection of Frequently Asked Questions,
    available as the file /pc/ts/tsfaq##.arc (where ## is a version umber)
    from chyde.uwasa.fi.  Its tables of contents follow:
--------------------------------------------------------------------
 1) How do I capture text from the screen to a file?
 2) How do I redirect the output from the screen to the printer?
 3) How can I direct all output to a file instead of the printer?
 4) Where can I get VT102 emulation codes?
 5) Problems with Procomm or Telix VT102 emulation.
 6) Is there a program to convert Pascal to C?
 7) I need a bigger cursor for my laptop.
 8) Where to find a source code for detecting which CPU my PC has?
 9) Can anyone recommend me a good linear programming package?
10) Where can I find sources for Unix z-modem?
11) Where can I find sources for Unix arc, lharc, zip, and zoo?
12) How to delete non-empty directories fast?
13) I can't run this file I got with a .zip (.arc etc) extension.
14) Reply by email, I don't usually read this group.
15) What is an appropriate maximum length of a signature?
16) What is the best archiver?
17) Can someone point me to a list of ftp sites?
-------------------------------------------------------------------
 1) How do I disable or capture the break key in Turbo Pascal?
 2) How do I get a printed documentation of my students' TP runs?
 3) What is the code for the weekday of a given date?
 4) Need a program to format Turbo Pascal source code consistently
 5) Can someone give me advice for writing a tsr program?
 6) Why can't I read / write the com ports?
 7) What are interrupts and how to use them in Turbo Pascal?
 8) Should I upgrade my Turbo Pascal version?
 9) How do I execute an MsDos command from within a TP program?
10) How is millisecond timing done?
-------------------------------------------------------------------

raymond@purina.berkeley.edu (Raymond Chen) (03/03/91)

[$Id: csip.faq 4.15 91/03/02 10:58:34 raymond Exp $]

TABLE OF CONTENTS

CHAPTER 0:  INTRODUCTION

0.1)  What is 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?
0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?
0.4)  Somebody just asked a really simple question.  What should I do?

CHAPTER 1:  OBTAINING PROGRAMS FROM THE ARCHIVES

1.1)  What is anonymous ftp?  How do I use it?
1.2)  How do I use the programs that are posted to comp.binaries.ibm.pc?
1.3)  I've uudecoded it, and the file is on my PC.  Now what?
1.4)  The unpacking program said that the archive was corrupted.
1.5)  What public archives exist, and what are their IP numbers?
1.6)  I do not have ftp access.  Can somebody email me the files?

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?
2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?
2.3)  How do I reboot my computer via software?
2.4)  What is the difference between extended/expanded memory, and
      how can I access it from my C/Pascal program?
2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?
3.2)  I'm having trouble with product X.  Can anyone help me?
3.3)  What is the file format that application X uses?
3.4)  Rumor has it that company X is working on a new version of product Y.
      Does anybody have any information about it?
3.5)  I don't like my keyboard's layout.  How can I swap the X and Y keys?

CHAPTER 4:  HARDWARE

4.1)  What are the differences between chip X and chip Y?
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?
4.3)  How do I do a low-level reformat of my hard drive?
4.4)  What does interleave mean?  What interleave should I use?
4.5)  What do ESDI, SCSI, RLL, MFM mean?
4.6)  Can I use an RLL controller on my MFM drive?
4.7)  Should I leave my PC turned on all the time?  What about
      mounting it sideways?

CHAPTER 5:  MISCELLANEOUS

5.1)  How do I undelete a file?  Recover from an accidental reformat?
5.2)  Where can I get UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?
5.3)  What about GIF images?  How do I view a GIF image?
5.4)  How do I turn the ECHO off from a batch file?
5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?
5.6)  How do I install a new version of DOS on my hard drive?

APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE
APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

--------------------------------------------------------------------------
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.

    In particular, if you wish to add something to the FAQ, don't just
    post an article saying ``This should be in the FAQ'' because I probably
    will miss it.  Send me email directly.

    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.

    You should probably also check that your question hasn't been asked
    to death before.  Many of the files in my archives address
    commonly-asked questions whose answers are too long to list here.
    I also keep an index of previously-asked questions in my archives.
    Instructions on accessing the archive can be found in Appendix A.

0.3)  Somebody just said that a { Mac, Amiga } beats the socks of a PC.
      I have my flame thrower ready.  Any last words?

    Oh, for crying out loud.  About twice a year some immature bozo
    posts a note like this and the flames don't die out for weeks.  If
    you consider yourself a mature human being, bite your lip and keep
    quiet.  Let the nincompoop think he's won.  If you absolutely
    positively can't keep quiet, flame the sucker by email.  But
    please, don't make the rest of us have to suffer through it.

    While I have your attention, here are a few more subjects that
    we're sick of seeing:

    FCC to impose surtax on modem usage:  This is simply not true.
        Consult the file "fcc" in my archives for a letter from
        the FCC debunking this rumor.

    Make Money Fast:  They're all pyramid schemes, and they're illegal,
        especially the one from Dave Rhodes.

    Dying Boy's Last Wish:  He broke the record in 1988, so stop it already.
        Besides, the poor child's address keeps changing, ranging from London
        to Atlanta.

0.4)  Somebody just asked a really simple question.  What should I do?

    Send him the answer by email.  Don't post the answer, since
    (trust me) about a dozen people will do it anyway.  If you
    want, drop me a line so I can add the question to the FAQ archives.


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.  It's only polite to minimize your connect
    time, 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 system administrator 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:<msdos.gif>          Switch to the proper directory
        tenex                       Magic word, see below
        get gif_lib.zip             Get the Turbo C GIF library (include source)
        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.

    Here's a script to perform step 1 on UNIX machines:

        #! /bin/sh
        sed '/^END/,/^BEGIN/d' $* | uudecode

    If you saved the pieces as "part01" "part02" and so on, then you
    just type "combine part*" and everything gets decodeded automatically.

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   Where you might
        sion    to use     and directory on SIMTEL20    find this format

        ARC     PKUNPAK  PD1:<MSDOS.ARC-LBR>PK361.EXE   SIMTEL20
        ZIP     PKUNZIP  PD1:<MSDOS.ZIP>PKZ110EU.EXE    grape
        ZOO     ZOO      PD1:<MSDOS.ZOO>ZOO201.EXE      comp.binaries.ibm.pc
        PAK     PAK251   PD1:<MSDOS.ARC-LBR>PAK250.EXE  garbo.uwasa.fi
                ^^^ note: this is *different* from PKPAK.
        LZH     LHARC    PD1:<MSDOS.ARC-LBR>LH113c.EXE  garbo.uwasa.fi
        ARJ     ARJ      PD1:<MSDOS.ARC-LBR>ARJ020.ZIP  ?
        Z       COMPRESS PD1:<MSDOS.SQ-USQ>COMPRS16.ARC unix archive sites
        TAR     PDTAR    PD1:<MSDOS.FILEUTL>PDTAR.ARC   unix archive sites

    (As a special note, files with the ".tar.Z" extension should first
    be uncompressed, then de-tar'd.)

    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.

    Mike Jones (mrj00496@uxa.cso.uiuc.edu) maintains a comprehensive
    list of archive formats, available for anonymous ftp from
    ux1.cso.uiuc.edu (128.174.5.59) in the directory doc/pcnet.

    Information about archiving in general is posted periodically
    to comp.binaries.ibm.pc.

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.

        Here is a way to check if you are doing binary transfers correctly.
        Compile the following one-line C program: main(){puts("\250\n\250");}
        Run it by typing "a.out >binary.fil".  Transfer the file
        "binary.fil" to your IBM PC, and TYPE it to the screen from the
        DOS prompt.  If you are doing things correctly, you should see
        the following:
                ?
                 ?
        except that the question marks will be upside-down.


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.
    This is a very busy site, so try connecting at really obscure
    times of day.  (SIMTEL20 is in the Mountain time zone, 7 hours
    behind GMT.)

    In the PD1:<MSDOS.FILEDOCS> 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.

        sol.deakin.oz.au        ?               ?
        128.184.1.1 (Australia)
                A duplicate of the SIMTEL20 archives is kept in
                pub/PC/simtel-20.

        grape.ecs.clarkson.edu  00readme        root@grape.ecs.clarkson.edu
        128.153.13.196 (Clarkson University, Potsdam, NY USA)

        garbo.uwasa.fi          HELP          Timo Salmi (ts@chyde.uwasa.fi)
                                              Harri Valkama (hv@chyde.uwasa.fi)
        128.214.12.37 (University of Vaasa, Finland)

    My email server has the index files for SIMTEL20, grape, and garbo.

    A very large list of ftp sites is maintained by odin@pilot.njin.net.
    The most recently list can be ftp'd from pilot.njin.net (128.6.7.38).

    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:<MSDOS.GRAPHICS>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".

    BITNET users can also send LISTSERV commands to LISTSERV@NDSUVM1
    or LISTSERV@RPIECS to accomplish the same thing.

    The administrators of these two servers are Marty Hoag (info@vm1.nodak.edu)
    and John Fisher (fisher@vm.ecs.rpi.edu), respectively.

    European users can use EARN TRICKLE servers.  Send commands to
    TRICKLE@site, where "site" is one of the following: 
        AWIWUW11 (Austria)      DS0RUS1I (Germany)      EB0UB011 (Spain)
        BANUFS11 (Belgium)                              TAUNIVM  (Israel)
        DKTC11   (Denmark)      IMIPOLI  (Italy)        TREARN   (Turkey)
        
    BITNET users can send email to BITFTP@PUCC to perform ftp.
    To receive instructions, send email consisting of the single
    word HELP to BITFTP@PUCC.  Using this service to ftp to SIMTEL20
    is discouraged, however.

    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.  

    The archives at garbo.uwasa.fi are also serviced by a mail server.
    Send mail to mailserv@garbo.uwasa.fi
    with a subject of "garbo-request" (no quotation marks, lowercase is
    important), and whose body contains the two words "send help" (again,
    no quotation marks, lowercase is important).  Do not include a signature
    because it confuses the server.  If you do not understand, don't
    use the email server.

    It must be emphasized that mail-based file transfer is frowned upon
    by system administrators, and you are strongly encouraged to use ftp
    if at all possible.

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:<MSDOS.INFO>INTERxxx.ZIP (the last three digits
    indicate the version number).

    A list of books on programming the IBM PC can be found in the file
    "books" in my archives.

2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?

    First comment is that direct video access is poor program engineering
    since it ties your program down to a particular hardware configuration.
    (Device drivers and TSRs are also known to reprogram the video board,
    thereby making accurate direct video access difficult.)

    Nevertheless, here's the answer, more to illustrate the concept
    rather than as a suggested method of action.  You can say

        #define screen ((char far*)0xB8000000)      /* B800:0000 */

    and treat "screen" as if it were an array.  You can 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.)  The file "flickerfree"
    in my archives contains tips on doing flicker-free video access.

    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 <dos.h>.  A similar trick can
    be used for accessing/setting the segment or offset portion
    of a far pointer.

    Note that this method works only for compilers which store pointers
    in segment:offset format (e.g., MSC, TC).  Other compilers
    (e.g., Lattice) may do things differently.  Consult your compiler
    manual to be sure.

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.  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.

    A useful mnemonic is that exPanded memory uses Paging.

    Allegedly, Zortech C has compiler support for expanded memory, and the
    shareware CXL library (In PD1:<MSDOS.C> on SIMTEL20) provide EMS
    handling for MSC and other compilers.

    More details can be found in the file "memory" in my archives.

2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

    This is a painfully well-known bug in Turbo C.  Just #include <math.h>
    and stick the line "(void)exp(1.0);" at the start of your main() and
    that should convince the linker to include the floating point formats.
    A patch exists to remedy this bug.

    Patches for Turbo C can be obtained from SIMTEL20, or from LIB 5 of
    the Borland Forum on CompuServe.  There is a Turbo-C mailing list
    on LISTSERV@UCF1VM.BITNET.

    There's a Zortech-C mailing list on uunet!ztc-list-request.


CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?

    Here's a checklist:

        [ ] Consult the files "products" and "old.questions" in my archives
            to see if somebody else has asked the same question and
            to see who responded.  Send them email asking them for their 
            opinions.

        [ ] Write a letter to the Better Business Bureau.  They've been
            archiving this sort of information for years.

        [ ] If you're still not satisfied, then post a request.  But it
            is now your duty to 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.

    In particular, a long summary of the debate over Mark Williams'
    "Coherent" product and comments on various C compilers are
    available from my archives.

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?  What are the GIF,
      TIFF, BGI, PCX, OBJ, EXE file formats?  How can I write my own BGI driver?
      Does anybody have a BGI driver for X?

    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.

    If you still can't find what you want, you can always contact the
    company that produced the application.  

    SIMTEL20 has GIF, TIFF and BGI file formats, as well as the Borland BGI
    toolkit (also available from Borland).  The formats for .OBJ and .EXE
    files can be found in the MS-DOS Encyclopedia.  The PCX file format can
    be obtained from ZSoft (their address is in the old.questions file).
    The comp.graphics Frequently Asked Questions file provides some
    more sources.  Various requests (and sources) for BGI drivers are
    contained in the old.questions file.

    Indeed, SIMTEL20's <MSDOS.INFO> directory is just chock full of
    assorted technical information.

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:<MSDOS.KEYBOARD> 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:      A slightly buggy version of the...
    80386DX:    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.
    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?

    After formatting a 360K disk in a 360K drive, that disk should be
    written to ONLY by another 360K drive, although both 360K and 1.2M
    drives can read it.

    Before formatting a 360K disk in a 1.2M drive, first BULK ERASE the
    diskette, then format it and write to it using ONLY a 1.2M drive.
    This floppy can be read reliably on a 360K drive.  This disk should
    be considered READ-ONLY in a 360K drive.

    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.  PS/2 hard drives can be formatted by booting
    the Reference disk and typing Ctrl-A to call up a hidden menu.

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?

    A record of these debates the last time they went around is
    kept in my archives; consult the file "24hrs".

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 UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?

    Here's just a *sample* of what's available from SIMTEL20:

PD1:<MSDOS.SCREEN>PCCURS14.ARC    Unix-compatible version of Curses screen mgmt
PD1:<MSDOS.EDITOR>STEVIE.ARC      Clone of Unix 'vi' text editor
PD1:<MSDOS.EDITOR>VI-19A.ARC      Unix-like vi screen text editor for IBM PC
PD1:<MSDOS.SYSUTL>TSRCOM29.ARC    TSR memory management utils (MARK/RELEASE)
PD1:<MSDOS.TURBO-C>RESLB201.ARC   Function library for Turbo-C to make TSRs

    There's plenty more where they came from.

    Books on TSR programming are listed in the file "books" in my archives.

    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.)

    The GNUish MS-DOS project is moderated by Thorsten Ohl
    <td12@ddagsi.bitnet>.  Their efforts can be found on SIMTEL20
    and elsewhere.

    There are several different emacs implementations for the PC.
    The file "editor" in my archives discusses this, as well
    as other popular questions about editors.

    In general, if you are looking for a program, look first in the file
    PD1:<MSDOS.FILEDOCS>SIMIBM.ARC.  This is a directory of all the files
    in SIMTEL20's MS-DOS archives.
    You can also send requests to my email server to search through the
    index for a word or phrase.


5.3)  What about GIF images?  How do I view a GIF image?

    Archives for GIF images come and go (mostly go).
    GIF images are kept on wuarchive.wustl.edu (/graphics/gif),
    funic.funet.fi (/disk1/pub/misc/gif) and elsewhere.  GIF viewers can
    be found at those sites, as well as on SIMTEL20 (PD1:<MSDOS.GIF>).
    See the file "gif.info" in my archives for more information.
    See also the comp.graphics Frequently Asked Questions file.

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:<MSDOS.BATUTL>ECHOOFF.PAT contains
    a list of the patches to apply depending on which version of DOS
    you are using.

5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?

    There are a few ways of setting a long path.  One solution is to set
    things up so you don't need a long path in the first place.  For
    example, create a \bat directory with lots of batch files which save
    the current path, set the path to something else, run a program, then
    reset the path to what it originally was.  Or, use the SUBST program
    to make drive-letter aliases for long pathnames.  If you really want a
    big path, fetch the program BIGPATH.ARC or SETPTH13.ARC from SIMTEL20.

    The size of the environment is controlled by the "/E" option to
    COMMAND.COM.  Add the line "SHELL=COMMAND.COM /P /E:xxx" to your
    CONFIG.SYS, where xxx is the desired environment size (in either
    bytes or paragraphs, depending on your DOS version).

    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:<MSDOS.SYSUTL>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.)


APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

    The archives I keep mentioning in this document are available
    for anonymous ftp (question 1.1) from math.princeton.edu[128.112.128.157]
    in the directory pub/rjc/csip.  The files are compressed via
    the UNIX "compress" program (see question 1.3).  The file "directory"
    describes the contents of the directory.

    People who cannot ftp can request the files via email.  Before sending
    mail to the server, make sure you are using the instructions from the
    most recent version of this file.

    Send email to rjc@math.princeton.edu with no subject and containing
    the two lines

        path raymond@math.berkeley.edu
        help

    replacing "raymond@math.berkeley.edu" with your own return address,
    of course.  The return address must be in Internet domain-based format.
    Actually, the server tries to guess the return path,
    so the "path" command is needed only if your mailer puts bogus
    headers on outgoing mail.

    The email server also looks up programs in the SIMTEL20 index,
    the grape index, and the garbo index.  (So you have no excuse
    for not looking in these indexes before posting a request.)

APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

    Other useful Frequently Asked Questions Files can be found in

        comp.graphics:          Interconverting various graphics formats,
                                specifications for graphics formats.
        comp.windows.x:         IBM PC implementations of X windows.
        comp.lang.postscript:   Converting things to/from Postscript,
                                previewing Postscript.

    The answers to the following questions can be obtained from the
    archives described in Appendix A, as the file "faq.more".

1)  I found a bug in program X!
2)  Why do I get disk full errors when I only have a bunch of tiny files
    in my root directory?
3)  I found that program X contains the string "Copyright Microsoft", so
    it must be a pirated copy of a commercial program, right?
4)  Can you summarize the history of the 80x86 family of processors?
5)  How about other chips that didn't make on the main faq list?
6)  Why do people say that the 80286 is "brain-dead"?
7)  How do I determine whether I am running on a monochrome or color
    machine?
8)  I have written a program that uses the mouse, and when I use
    CGA/EGA/VGA it is fine, but the mouse does not appear on
    a Hercules card. Why?
9)  Why does DOS use the \ instead of a / as a directory name separator?
    How can I tell DOS that I want to use slashes instead?
10) What is the SysReq key for?
11) How do I switch my screen into 43 line mode?  How can I detect the 
    number of lines from a program?
12) How do I echo a blank line from a batch file?
13) Why does my PC lose a day if I leave it unattended for more than 24 hours?
14) Why is my program limited to only 20 open files?  How can I increase
    this value?
15) I just installed a high density (1.2M) floppy drive, and weird things
    are happening.  How do I fix it?
16) What is 4DOS?  Where can I get it?  How can I disable the annoying beeps
    that it makes when I run it?
17) How do I disable call waiting?
18) Redirecting printer output into a file.

    Prof. Timo Salmi also has his own collection of Frequently Asked Questions,
    available as the file /pc/ts/tsfaq##.arc (where ## is a version number)
    from garbo.uwasa.fi.  The tables of contents for tsfaq15 follows:
--------------------------------------------------------------------
1)  What does "Subject: Re: none" mean in the news?
2)  Why "Reply by email, I don't read this group" gets flamed?
3)  What is an appropriate maximum length of a signature?
4)  Can someone point me to a list of ftp sites?
5)  How do I extract from comp.binaries.ibm.pc binary postings?
6)  Should I offer to email this utility I have at my disposal?
7)  Someone email me a .zip extractor (or something equally common)
8)  How should I react to "a dying boy's last wish"?
9)  How should I react to crackpot messages?
10) How should I react to abusive email?
11) How do I submit my PC program to the binaries?
12) May just go ahead and I post binaries in non-moderated groups?
13) What is cross-posting? How do I do it?
14) Where can I find the net rules?
15) I just posted to a wrong newsgroup. Should I explain it next?
--------------------------------------------------------------------
1)  How do I capture text from the screen to a file?
2)  How do I redirect the output from the screen to the printer?
3)  How can I direct all output to a file instead of the printer?
4)  Where can I get VT102 emulation codes?
5)  Problems with Procomm or Telix VT102 emulation.
6)  Is there a program to convert Pascal to C?
7)  I need a bigger cursor for my laptop.
8)  Where to find a source code for detecting which CPU my PC has?
9)  Can anyone recommend me a good linear programming package?
10) Where can I find sources for Unix z-modem?
11) Where can I find sources for Unix arc, lharc, zip, and zoo?
12) How to delete non-empty directories fast?
13) I can't run this file I got with a .zip (.arc etc) extension.
14) What is the best archiver?
15) What is the best text editor?
16) Am I safe against viruses if download files from FTP sites?
17) Where can I find a program to expand the keyboard buffer?
18) How to make z-modem transfer between a Unix mainframe and my PC?
19) Where can I find Unix-like utilities for my MsDos PC?
20) How can I hide files and directories?
-------------------------------------------------------------------
 1) How do I disable or capture the break key in Turbo Pascal?
 2) How do I get a printed documentation of my students' TP runs?
 3) What is the code for the weekday of a given date?
 4) Need a program to format Turbo Pascal source code consistently
 5) Can someone give me advice for writing a tsr program?
 6) Why can't I read / write the com ports?
 7) What are interrupts and how to use them in Turbo Pascal?
 8) Should I upgrade my Turbo Pascal version?
 9) How do I execute an MsDos command from within a TP program?
10) How is millisecond timing done?
11) How can I customize the text characters to my own liking?
12) How to find the files in a directory and subdirectories?
13) I need a power function but there is none in Turbo Pascal.
14) How can I create arrays that are larger than 64 kilobytes?
15) How can I test that the printer is ready?
16) How can I clear the keyboard type-ahead buffer.
17) How can I utilize expanded memory (EMS) in my programs?
18) How can I obtain the entire command line?
19) How do I redirect text from printer to file in my TP program?
20) Turbo Pascal is for wimps. Use standard Pascal or C instead?
21) How do I turn the cursor off?
22) How to find all roots of a polynomial?
23) What is all this talk about "Pascal homework on the net"?
-------------------------------------------------------------------
1)  What is this anonymous ftp?
2)  Send file(s) to me by email.  (Or how to use the mail server?)
3)  Why announce programs in c.b.i.p.d when not everybody can ftp?
4)  Do you announce all additions to your archives in c.b.i.p.d?
5)  How is anonymous ftp used?
6)  When I try to unpack the package I received, it is corrupt.
7)  Send me a list where on Simtel20 I can find the same programs.
8)  What is garbo.uwasa.fi guest user-id?
9)  The packages won't run on my PC when I type their names.
10) I have made some programs myself. Are you interested?
11) I want a description of the programs to decide what to get.
12) Why don't you reply to my email messages?
13) I get an "unknown packing method" error message.
14) I need a program for such and such purpose. Any directions?
15) What are these peculiar files with a .Z extension?
16) Where does one get the files listed in files-mm.zip?
17) I have this technical problem with anonymous ftp.
18) Is there any way of automating getting the files?
19) Why doesn't your mail server respond to my correct request?

raymond@sunkist.berkeley.edu (Raymond Chen) (04/04/91)

[$Id: csip.faq 4.16 91/03/30 20:58:49 raymond Exp $]

TABLE OF CONTENTS

CHAPTER 0:  INTRODUCTION

0.1)  What is 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?
0.3)  Somebody just said that a { Mac, Amiga } beats the socks off a PC.
      I have my flame thrower ready.  Any last words?
0.4)  Somebody just asked a really simple question.  What should I do?

CHAPTER 1:  OBTAINING PROGRAMS FROM THE ARCHIVES

1.1)  What is anonymous ftp?  How do I use it?
1.2)  How do I use the programs that are posted to comp.binaries.ibm.pc?
1.3)  I've uudecoded it, and the file is on my PC.  Now what?
1.4)  The unpacking program said that the archive was corrupted.
1.5)  What public archives exist, and what are their IP numbers?
1.6)  I do not have ftp access.  Can somebody email me the files?

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?
2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?
2.3)  How do I reboot my computer via software?
2.4)  What is the difference between extended/expanded memory, and
      how can I access it from my C/Pascal program?
2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?
3.2)  I'm having trouble with product X.  Can anyone help me?
3.3)  What is the file format that application X uses?
3.4)  Rumor has it that company X is working on a new version of product Y.
      Does anybody have any information about it?
3.5)  I don't like my keyboard's layout.  How can I swap the X and Y keys?

CHAPTER 4:  HARDWARE

4.1)  What are the differences between chip X and chip Y?
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?
4.3)  How do I do a low-level reformat of my hard drive?
4.4)  What does interleave mean?  What interleave should I use?
4.5)  What do ESDI, SCSI, RLL, MFM mean?
4.6)  Can I use an RLL controller on my MFM drive?
4.7)  Should I leave my PC turned on all the time?  What about
      mounting it sideways?

CHAPTER 5:  MISCELLANEOUS

5.1)  How do I undelete a file?  Recover from an accidental reformat?
5.2)  Where can I get UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?
5.3)  What about GIF images?  How do I view a GIF image?
5.4)  How do I turn the ECHO off from a batch file?
5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?
5.6)  How do I install a new version of DOS on my hard drive?

APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE
APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

--------------------------------------------------------------------------
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.

    In particular, if you wish to add something to the FAQ, don't just
    post an article saying ``This should be in the FAQ'' because I probably
    will miss it.  Send me email directly.

    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.

    You should probably also check that your question hasn't been asked
    to death before.  Many of the files in my archives address
    commonly-asked questions whose answers are too long to list here.
    I also keep an index of previously-asked questions in my archives.
    Instructions on accessing the archive can be found in Appendix A.

0.3)  Somebody just said that a { Mac, Amiga } beats the socks off a PC.
      I have my flame thrower ready.  Any last words?

    Oh, for crying out loud.  About twice a year some immature bozo
    posts a note like this and the flames don't die out for weeks.  If
    you consider yourself a mature human being, bite your lip and keep
    quiet.  Let the nincompoop think he's won.  If you absolutely
    positively can't keep quiet, flame the sucker by email.  But
    please, don't make the rest of us have to suffer through it.

    While I have your attention, here are a few more subjects that
    we're sick of seeing:

    FCC to impose surtax on modem usage:  This is simply not true.
        Consult the file "fcc" in my archives for a letter from
        the FCC debunking this rumor.

    Make Money Fast:  They're all pyramid schemes, and they're illegal,
        especially the one from Dave Rhodes.

    Dying Boy's Last Wish:  He broke the record in 1988, so stop it already.
        Besides, the poor child's address keeps changing, ranging from London
        to Atlanta.

0.4)  Somebody just asked a really simple question.  What should I do?

    Send him the answer by email.  Don't post the answer, since
    (trust me) about a dozen people will do it anyway.  If you
    want, drop me a line so I can add the question to the FAQ archives.


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.  It's only polite to minimize your connect
    time, 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 system administrator 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:<msdos.gif>          Switch to the proper directory
        tenex                       Magic word, see below
        get gif_lib.zip             Get the Turbo C GIF library (include source)
        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.

    Here's a script to perform step 1 on UNIX machines:

        #! /bin/sh
        sed '/^END/,/^BEGIN/d' $* | uudecode

    If you saved the pieces as "part01" "part02" and so on, then you
    just type "combine part*" and everything gets decodeded automatically.

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   Where you might
        sion    to use     and directory on SIMTEL20    find this format

        ARC     PKUNPAK  PD1:<MSDOS.ARC-LBR>PK361.EXE   SIMTEL20
        ZIP     PKUNZIP  PD1:<MSDOS.ZIP>PKZ110EU.EXE    grape
        ZOO     ZOO      PD1:<MSDOS.ZOO>ZOO201.EXE      comp.binaries.ibm.pc
        PAK     PAK      PD1:<MSDOS.ARC-LBR>PAK251.EXE  garbo.uwasa.fi
                ^^^ note: this is *different* from PKPAK.
        LZH     LHARC    PD1:<MSDOS.ARC-LBR>LH113c.EXE  garbo.uwasa.fi
        ARJ     ARJ      PD1:<MSDOS.ARC-LBR>ARJ100.ZIP  ?
        Z       COMPRESS PD1:<MSDOS.SQ-USQ>COMPRS16.ARC unix archive sites
        TAR     PDTAR    PD1:<MSDOS.FILEUTL>PDTAR.ARC   unix archive sites

    (As a special note, files with the ".tar.Z" extension should first
    be uncompressed, then de-tar'd.)

    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.

    Mike Jones (mrj00496@uxa.cso.uiuc.edu) maintains a comprehensive
    list of archive formats, available for anonymous ftp from
    ux1.cso.uiuc.edu (128.174.5.59) in the directory doc/pcnet.

    Information about archiving in general is posted periodically
    to comp.binaries.ibm.pc.

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.

        Here is a way to check if you are doing binary transfers correctly.
        Compile the following one-line C program: main(){puts("\250\n\250");}
        Run it by typing "a.out >binary.fil".  Transfer the file
        "binary.fil" to your IBM PC, and TYPE it to the screen from the
        DOS prompt.  If you are doing things correctly, you should see
        the following:
                ?
                 ?
        except that the question marks will be upside-down.


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.
    This is a very busy site, so try connecting at really obscure
    times of day.  (SIMTEL20 is in the Mountain time zone, 7 hours
    behind GMT.)

    In the PD1:<MSDOS.FILEDOCS> 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.

        sol.deakin.oz.au        ?               ?
        128.184.1.1 (Australia)
                A duplicate of the SIMTEL20 archives is kept in
                pub/PC/simtel-20.

        grape.ecs.clarkson.edu  00readme        root@grape.ecs.clarkson.edu
        128.153.13.196 (Clarkson University, Potsdam, NY USA)

        garbo.uwasa.fi          HELP          Timo Salmi (ts@chyde.uwasa.fi)
                                              Harri Valkama (hv@chyde.uwasa.fi)
        128.214.12.37 (University of Vaasa, Finland)

    My email server has the index files for SIMTEL20, grape, and garbo.

    A very large list of ftp sites is maintained by odin@pilot.njin.net.
    The most recently list can be ftp'd from pilot.njin.net (128.6.7.38).

    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:<MSDOS.GRAPHICS>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".

    BITNET users can also send LISTSERV commands to LISTSERV@NDSUVM1
    or LISTSERV@RPIECS to accomplish the same thing.

    The administrators of these two servers are Marty Hoag (info@vm1.nodak.edu)
    and John Fisher (fisher@vm.ecs.rpi.edu), respectively.

    European users can use EARN TRICKLE servers.  Send commands to
    TRICKLE@site, where "site" is one of the following: 
        AWIWUW11 (Austria)      DS0RUS1I (Germany)      EB0UB011 (Spain)
        BANUFS11 (Belgium)                              TAUNIVM  (Israel)
        DKTC11   (Denmark)      IMIPOLI  (Italy)        TREARN   (Turkey)
        
    BITNET users can send email to BITFTP@PUCC to perform ftp.
    To receive instructions, send email consisting of the single
    word HELP to BITFTP@PUCC.  Using this service to ftp to SIMTEL20
    is discouraged, however.

    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.  

    The archives at garbo.uwasa.fi are also serviced by a mail server.
    Send mail to mailserv@garbo.uwasa.fi
    with a subject of "garbo-request" (no quotation marks, lowercase is
    important), and whose body contains the two words "send help" (again,
    no quotation marks, lowercase is important).  Do not include a signature
    because it confuses the server.  If you do not understand, don't
    use the email server.

    It must be emphasized that mail-based file transfer is frowned upon
    by system administrators, and you are strongly encouraged to use ftp
    if at all possible.

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:<MSDOS.INFO>INTERxxx.ZIP (the last three digits
    indicate the version number).

    A list of books on programming the IBM PC can be found in the file
    "books" in my archives.

2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?

    First comment is that direct video access is poor program engineering
    since it ties your program down to a particular hardware configuration.
    (Device drivers and TSRs are also known to reprogram the video board,
    thereby making accurate direct video access difficult.)

    Nevertheless, here's the answer, more to illustrate the concept
    rather than as a suggested method of action.  You can say

        #define screen ((char far*)0xB8000000)      /* B800:0000 */

    and treat "screen" as if it were an array.  You can 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.)  The file "flickerfree"
    in my archives contains tips on doing flicker-free video access.

    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 <dos.h>.  A similar trick can
    be used for accessing/setting the segment or offset portion
    of a far pointer.

    Note that this method works only for compilers which store pointers
    in segment:offset format (e.g., MSC, TC).  Other compilers
    (e.g., Lattice) may do things differently.  Consult your compiler
    manual to be sure.

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.  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.

    A useful mnemonic is that exPanded memory uses Paging.

    Allegedly, Zortech C has compiler support for expanded memory, and the
    shareware CXL library (In PD1:<MSDOS.C> on SIMTEL20) provide EMS
    handling for MSC and other compilers.

    More details can be found in the file "memory" in my archives.

2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

    This is a painfully well-known bug in Turbo C.  Just #include <math.h>
    and stick the line "(void)exp(1.0);" at the start of your main() and
    that should convince the linker to include the floating point formats.
    A patch exists to remedy this bug.

    Patches for Turbo C can be obtained from SIMTEL20, or from LIB 5 of
    the Borland Forum on CompuServe.  There is a Turbo-C mailing list
    on LISTSERV@UCF1VM.BITNET.

    There's a Zortech-C mailing list on uunet!ztc-list-request.


CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?

    Here's a checklist:

        [ ] Consult the files "products" and "old.questions" in my archives
            to see if somebody else has asked the same question and
            to see who responded.  Send them email asking them for their 
            opinions.

        [ ] Write a letter to the Better Business Bureau.  They've been
            archiving this sort of information for years.

        [ ] If you're still not satisfied, then post a request.  But it
            is now your duty to 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.

    In particular, a long summary of the debate over Mark Williams'
    "Coherent" product and comments on various C compilers are
    available from my archives.

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?  What are the GIF,
      TIFF, BGI, PCX, OBJ, EXE file formats?  How can I write my own BGI driver?
      Does anybody have a BGI driver for X?

    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.

    If you still can't find what you want, you can always contact the
    company that produced the application.  

    SIMTEL20 has GIF, TIFF and BGI file formats, as well as the Borland BGI
    toolkit (also available from Borland).  The formats for .OBJ and .EXE
    files can be found in the MS-DOS Encyclopedia.  The PCX file format can
    be obtained from ZSoft (their address is in the old.questions file).
    The comp.graphics Frequently Asked Questions file provides some
    more sources.  Various requests (and sources) for BGI drivers are
    contained in the old.questions file.

    Indeed, SIMTEL20's <MSDOS.INFO> directory is just chock full of
    assorted technical information.

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:<MSDOS.KEYBOARD> 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:      A slightly buggy version of the...
    80386DX:    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.
    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 instructions 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?

    After formatting a 360K disk in a 360K drive, that disk should be
    written to ONLY by another 360K drive, although both 360K and 1.2M
    drives can read it.

    Before formatting a 360K disk in a 1.2M drive, first BULK ERASE the
    diskette, then format it and write to it using ONLY a 1.2M drive.
    This floppy can be read reliably on a 360K drive.  This disk should
    be considered READ-ONLY in a 360K drive.

    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.  PS/2 hard drives can be formatted by booting
    the Reference disk and typing Ctrl-A to call up a hidden menu.

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?

    A record of these debates the last time they went around is
    kept in my archives; consult the file "24hrs".

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 UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?

    Here's just a *sample* of what's available from SIMTEL20:

PD1:<MSDOS.SCREEN>PCCURS14.ARC    Unix-compatible version of Curses screen mgmt
PD1:<MSDOS.EDITOR>STEVIE.ARC      Clone of Unix 'vi' text editor
PD1:<MSDOS.EDITOR>VI-19A.ARC      Unix-like vi screen text editor for IBM PC
PD1:<MSDOS.SYSUTL>TSRCOM29.ARC    TSR memory management utils (MARK/RELEASE)
PD1:<MSDOS.TURBO-C>RESLB201.ARC   Function library for Turbo-C to make TSRs

    There's plenty more where they came from.

    Books on TSR programming are listed in the file "books" in my archives.

    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.)

    The GNUish MS-DOS project is moderated by Thorsten Ohl
    <td12@ddagsi.bitnet>.  Their efforts can be found on SIMTEL20
    and elsewhere.

    There are several different emacs implementations for the PC.
    The file "editor" in my archives discusses this, as well
    as other popular questions about editors.

    In general, if you are looking for a program, look first in the file
    PD1:<MSDOS.FILEDOCS>SIMIBM.ARC.  This is a directory of all the files
    in SIMTEL20's MS-DOS archives.
    You can also send requests to my email server to search through the
    index for a word or phrase.


5.3)  What about GIF images?  How do I view a GIF image?

    Archives for GIF images come and go (mostly go).
    GIF images are kept on wuarchive.wustl.edu (/graphics/gif),
    funic.funet.fi (/disk1/pub/misc/gif) and elsewhere.  GIF viewers can
    be found at those sites, as well as on SIMTEL20 (PD1:<MSDOS.GIF>).
    See the file "gif.info" in my archives for more information.
    See also the comp.graphics Frequently Asked Questions file.

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:<MSDOS.BATUTL>ECHOOFF.PAT contains
    a list of the patches to apply depending on which version of DOS
    you are using.

5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?

    There are a few ways of setting a long path.  One solution is to set
    things up so you don't need a long path in the first place.  For
    example, create a \bat directory with lots of batch files which save
    the current path, set the path to something else, run a program, then
    reset the path to what it originally was.  Or, use the SUBST program
    to make drive-letter aliases for long pathnames.  If you really want a
    big path, fetch the program BIGPATH.ARC or SETPTH13.ARC from SIMTEL20.

    The size of the environment is controlled by the "/E" option to
    COMMAND.COM.  Add the line "SHELL=COMMAND.COM /P /E:xxx" to your
    CONFIG.SYS, where xxx is the desired environment size (in either
    bytes or paragraphs, depending on your DOS version).

    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:<MSDOS.SYSUTL>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.)


APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

    The archives I keep mentioning in this document are available
    for anonymous ftp (question 1.1) from math.princeton.edu[128.112.128.157]
    in the directory pub/rjc/csip.  The files are compressed via
    the UNIX "compress" program (see question 1.3).  The file "directory"
    describes the contents of the directory.

    People who cannot ftp can request the files via email.  Before sending
    mail to the server, make sure you are using the instructions from the
    most recent version of this file.

    Send email to rjc@math.princeton.edu with no subject and containing
    the two lines

        path raymond@math.berkeley.edu
        help

    replacing "raymond@math.berkeley.edu" with your own return address,
    of course.  The return address must be in Internet domain-based format.
    Actually, the server tries to guess the return path,
    so the "path" command is needed only if your mailer puts bogus
    headers on outgoing mail.

    The email server also looks up programs in the SIMTEL20 index,
    the grape index, and the garbo index.  (So you have no excuse
    for not looking in these indexes before posting a request.)

APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

    Other useful Frequently Asked Questions Files can be found in

        comp.graphics:          Interconverting various graphics formats,
                                specifications for graphics formats.
        comp.windows.x:         IBM PC implementations of X windows.
        comp.lang.postscript:   Converting things to/from Postscript,
                                previewing Postscript.

    The answers to the following questions can be obtained from the
    archives described in Appendix A, as the file "faq.more".

1)  I found a bug in program X!
2)  Why do I get disk full errors when I only have a bunch of tiny files
    in my root directory?
3)  I found that program X contains the string "Copyright Microsoft", so
    it must be a pirated copy of a commercial program, right?
4)  Can you summarize the history of the 80x86 family of processors?
5)  How about other chips that didn't make on the main faq list?
6)  Why do people say that the 80286 is "brain-dead"?
7)  How do I determine whether I am running on a monochrome or color
    machine?
8)  I have written a program that uses the mouse, and when I use
    CGA/EGA/VGA it is fine, but the mouse does not appear on
    a Hercules card. Why?
9)  Why does DOS use the \ instead of a / as a directory name separator?
    How can I tell DOS that I want to use slashes instead?
10) What is the SysReq key for?
11) How do I switch my screen into 43 line mode?  How can I detect the 
    number of lines from a program?
12) How do I echo a blank line from a batch file?
13) Why does my PC lose a day if I leave it unattended for more than 24 hours?
14) Why is my program limited to only 20 open files?  How can I increase
    this value?
15) I just installed a high density (1.2M) floppy drive, and weird things
    are happening.  How do I fix it?
16) What is 4DOS?  Where can I get it?  How can I disable the annoying beeps
    that it makes when I run it?
17) How do I disable call waiting?
18) Redirecting printer output into a file.

    Prof. Timo Salmi also has his own collection of Frequently Asked Questions,
    available as the file /pc/ts/tsfaq##.arc (where ## is a version number)
    from garbo.uwasa.fi.  The tables of contents for tsfaq15 follows:
--------------------------------------------------------------------
1)  What does "Subject: Re: none" mean in the news?
2)  Why "Reply by email, I don't read this group" gets flamed?
3)  What is an appropriate maximum length of a signature?
4)  Can someone point me to a list of ftp sites?
5)  How do I extract from comp.binaries.ibm.pc binary postings?
6)  Should I offer to email this utility I have at my disposal?
7)  Someone email me a .zip extractor (or something equally common)
8)  How should I react to "a dying boy's last wish"?
9)  How should I react to crackpot messages?
10) How should I react to abusive email?
11) How do I submit my PC program to the binaries?
12) May just go ahead and I post binaries in non-moderated groups?
13) What is cross-posting? How do I do it?
14) Where can I find the net rules?
15) I just posted to a wrong newsgroup. Should I explain it next?
--------------------------------------------------------------------
1)  How do I capture text from the screen to a file?
2)  How do I redirect the output from the screen to the printer?
3)  How can I direct all output to a file instead of the printer?
4)  Where can I get VT102 emulation codes?
5)  Problems with Procomm or Telix VT102 emulation.
6)  Is there a program to convert Pascal to C?
7)  I need a bigger cursor for my laptop.
8)  Where to find a source code for detecting which CPU my PC has?
9)  Can anyone recommend me a good linear programming package?
10) Where can I find sources for Unix z-modem?
11) Where can I find sources for Unix arc, lharc, zip, and zoo?
12) How to delete non-empty directories fast?
13) I can't run this file I got with a .zip (.arc etc) extension.
14) What is the best archiver?
15) What is the best text editor?
16) Am I safe against viruses if download files from FTP sites?
17) Where can I find a program to expand the keyboard buffer?
18) How to make z-modem transfer between a Unix mainframe and my PC?
19) Where can I find Unix-like utilities for my MsDos PC?
20) How can I hide files and directories?
-------------------------------------------------------------------
 1) How do I disable or capture the break key in Turbo Pascal?
 2) How do I get a printed documentation of my students' TP runs?
 3) What is the code for the weekday of a given date?
 4) Need a program to format Turbo Pascal source code consistently
 5) Can someone give me advice for writing a tsr program?
 6) Why can't I read / write the com ports?
 7) What are interrupts and how to use them in Turbo Pascal?
 8) Should I upgrade my Turbo Pascal version?
 9) How do I execute an MsDos command from within a TP program?
10) How is millisecond timing done?
11) How can I customize the text characters to my own liking?
12) How to find the files in a directory and subdirectories?
13) I need a power function but there is none in Turbo Pascal.
14) How can I create arrays that are larger than 64 kilobytes?
15) How can I test that the printer is ready?
16) How can I clear the keyboard type-ahead buffer.
17) How can I utilize expanded memory (EMS) in my programs?
18) How can I obtain the entire command line?
19) How do I redirect text from printer to file in my TP program?
20) Turbo Pascal is for wimps. Use standard Pascal or C instead?
21) How do I turn the cursor off?
22) How to find all roots of a polynomial?
23) What is all this talk about "Pascal homework on the net"?
-------------------------------------------------------------------
1)  What is this anonymous ftp?
2)  Send file(s) to me by email.  (Or how to use the mail server?)
3)  Why announce programs in c.b.i.p.d when not everybody can ftp?
4)  Do you announce all additions to your archives in c.b.i.p.d?
5)  How is anonymous ftp used?
6)  When I try to unpack the package I received, it is corrupt.
7)  Send me a list where on Simtel20 I can find the same programs.
8)  What is garbo.uwasa.fi guest user-id?
9)  The packages won't run on my PC when I type their names.
10) I have made some programs myself. Are you interested?
11) I want a description of the programs to decide what to get.
12) Why don't you reply to my email messages?
13) I get an "unknown packing method" error message.
14) I need a program for such and such purpose. Any directions?
15) What are these peculiar files with a .Z extension?
16) Where does one get the files listed in files-mm.zip?
17) I have this technical problem with anonymous ftp.
18) Is there any way of automating getting the files?
19) Why doesn't your mail server respond to my correct request?

raymond@herb-ox.berkeley.edu (Raymond Chen) (05/01/91)

[I'm still looking for a new FAQ owner.  Any takers please email.]

[$Id: csip.faq 4.17 91/04/30 21:09:50 raymond Exp $]

TABLE OF CONTENTS

CHAPTER 0:  INTRODUCTION

0.1)  What is 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?
0.3)  Somebody just said that a { Mac, Amiga } beats the socks off a PC.
      I have my flame thrower ready.  Any last words?

CHAPTER 1:  OBTAINING PROGRAMS FROM THE ARCHIVES

1.1)  What is anonymous ftp?  How do I use it?
1.2)  How do I use the programs that are posted to comp.binaries.ibm.pc?
1.3)  I've uudecoded it, and the file is on my PC.  Now what?
1.4)  The unpacking program said that the archive was corrupted.
1.5)  What public archives exist, and what are their IP numbers?
1.6)  I do not have ftp access.  Can somebody email me the files?
1.7)  I missed X in comp.binaries.ibm.pc; can somebody email it to me?

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?
2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?
2.3)  How do I reboot my computer via software?
2.4)  What is the difference between extended/expanded memory, and
      how can I access it from my C/Pascal program?
2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?
3.2)  I'm having trouble with product X.  Can anyone help me?
3.3)  What is the file format that application X uses?
3.4)  I don't like my keyboard's layout.  How can I swap the X and Y keys?

CHAPTER 4:  HARDWARE

4.1)  What are the differences between chip X and chip Y?
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?
4.3)  How do I do a low-level reformat of my hard drive?
4.4)  What does interleave mean?  What interleave should I use?
4.5)  Can I use an RLL controller on my MFM drive?
4.6)  Should I leave my PC turned on all the time?  What about
      mounting it sideways?
4.7)  How do I read an { Apple, Mac, Commodore, etc. } disk on my PC?

CHAPTER 5:  MISCELLANEOUS

5.1)  How do I undelete a file?  Recover from an accidental reformat?
5.2)  Where can I get UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?
5.3)  What about GIF images?  How do I view a GIF image?
5.4)  How do I turn the ECHO off from a batch file?
5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?

APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE
APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

--------------------------------------------------------------------------
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.

    In particular, if you wish to add something to the FAQ, don't just
    post an article saying ``This should be in the FAQ'' because I probably
    will miss it.  Send me email directly.

    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.

    You should probably also check that your question hasn't been asked
    to death before.  Many of the files in my archives address
    commonly-asked questions whose answers are too long to list here.
    I also keep an index of previously-asked questions in my archives.
    Instructions on accessing the archive can be found in Appendix A.

0.3)  Somebody just said that a { Mac, Amiga } beats the socks off a PC.
      I have my flame thrower ready.  Any last words?

    Every so often, some immature bozo posts a note like this and the
    flames don't die out for weeks.  Just bite your lip and keep
    quiet.  Let the nincompoop think he's won.  If you absolutely
    positively can't keep quiet, flame the sucker by email.  But
    please, don't make the rest of us have to suffer through it.

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.  It's only polite to minimize your connect
    time, 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 system administrator 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:<msdos.gif>          Switch to the proper directory
        tenex                       Magic word, see below
        get gif_lib.zip             Get the Turbo C GIF library (include source)
        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.

    Here's a script to perform step 1 on UNIX machines:

        #! /bin/sh
        sed '/^END/,/^BEGIN/d' $* | uudecode

    If you saved the pieces as "part01" "part02" and so on, then you
    just type "combine part*" and everything gets decodeded automatically.

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   Where you might
        sion    to use     and directory on SIMTEL20    find this format

        ARC     PKUNPAK  PD1:<MSDOS.ARC-LBR>PK361.EXE   SIMTEL20
        ZIP     PKUNZIP  PD1:<MSDOS.ZIP>PKZ110EU.EXE    grape
        ZOO     ZOO      PD1:<MSDOS.ZOO>ZOO201.EXE      comp.binaries.ibm.pc
        PAK     PAK      PD1:<MSDOS.ARC-LBR>PAK251.EXE  garbo.uwasa.fi
                ^^^ note: this is *different* from PKPAK.
        LZH     LHARC    PD1:<MSDOS.ARC-LBR>LH113c.EXE  garbo.uwasa.fi
        ARJ     ARJ      PD1:<MSDOS.ARC-LBR>ARJ100.ZIP  ?
        Z       COMPRESS PD1:<MSDOS.SQ-USQ>COMPRS16.ARC unix archive sites
        TAR     PDTAR    PD1:<MSDOS.FILEUTL>PDTAR.ARC   unix archive sites

    (As a special note, files with the ".tar.Z" extension should first
    be uncompressed, then de-tar'd.)

    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.

    Mike Jones (mrj00496@uxa.cso.uiuc.edu) maintains a comprehensive
    list of archive formats, available for anonymous ftp from
    ux1.cso.uiuc.edu (128.174.5.59) in the directory doc/pcnet.

    Information about archiving in general is posted periodically
    to comp.binaries.ibm.pc.

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.

        Here is a way to check if you are doing binary transfers correctly.
        Compile the following one-line C program: main(){puts("\250\n\250");}
        Run it by typing "a.out >binary.fil".  Transfer the file
        "binary.fil" to your IBM PC, and TYPE it to the screen from the
        DOS prompt.  If you are doing things correctly, you should see
        the following:
                ?
                 ?
        except that the question marks will be upside-down.


1.5)  What public archives exist, and what are their IP numbers?

    The most famous such is WSMR-SIMTEL20.ARMY.MIL [192.88.110.20],
    the White Sands Missile Range in New Mexico USA.
    This is a very busy site, so try connecting at really obscure
    times of day.  (SIMTEL20 is in the Mountain time zone, 7 hours
    behind GMT.)

    In the PD1:<MSDOS.FILEDOCS> 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.

        sol.deakin.oz.au        ?               ?
        128.184.1.1 (Australia)
                A duplicate of the SIMTEL20 archives is kept in
                pub/PC/simtel-20.

        grape.ecs.clarkson.edu  00readme        root@grape.ecs.clarkson.edu
        128.153.13.196 (Clarkson University, Potsdam, NY USA)

        garbo.uwasa.fi          HELP          Timo Salmi (ts@chyde.uwasa.fi)
                                              Harri Valkama (hv@chyde.uwasa.fi)
        128.214.12.37 (University of Vaasa, Finland)

    My email server has the index files for SIMTEL20, grape, and garbo.

    A very large list of ftp sites is maintained by odin@pilot.njin.net.
    The most recently list can be ftp'd from pilot.njin.net (128.6.7.38).

    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:<MSDOS.GRAPHICS>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".

    BITNET users can also send LISTSERV commands to LISTSERV@NDSUVM1
    or LISTSERV@RPIECS to accomplish the same thing.

    The administrators of these two servers are Marty Hoag (info@vm1.nodak.edu)
    and John Fisher (fisher@vm.ecs.rpi.edu), respectively.

    European users can use EARN TRICKLE servers.  Send commands to
    TRICKLE@site, where "site" is one of the following: 
        AWIWUW11 (Austria)      DS0RUS1I (Germany)      EB0UB011 (Spain)
        BANUFS11 (Belgium)                              TAUNIVM  (Israel)
        DKTC11   (Denmark)      IMIPOLI  (Italy)        TREARN   (Turkey)
        
    BITNET users can send email to BITFTP@PUCC to perform ftp.
    To receive instructions, send email consisting of the single
    word HELP to BITFTP@PUCC.  Using this service to ftp to SIMTEL20
    is discouraged, however.

    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.  

    The archives at garbo.uwasa.fi are also serviced by a mail server.
    Send mail to mailserv@garbo.uwasa.fi
    with a subject of "garbo-request" (no quotation marks, lowercase is
    important), and whose body contains the two words "send help" (again,
    no quotation marks, lowercase is important).  Do not include a signature
    because it confuses the server.  If you do not understand, don't
    use the email server.

    It must be emphasized that mail-based file transfer is frowned upon
    by system administrators, and you are strongly encouraged to use ftp
    if at all possible.

1.7)  I missed part X of Y; can somebody email it to me?

    Bob Sloane (sloane@kuhub.cc.ukans.edu) has generously installed a mail
    server which will resend articles posted to comp.binaries.ibm.pc within
    the past 30 days or so.  To request a file, send email to

        cbipserv@kuhub.cc.ukans.edu

    where the body of the message (NOT the subject line) contains the lines

        address raymond@math.berkeley.edu
        sendme vnnimmm

    where you should replace `raymond@math.berkeley.edu' with your email
    address, and `vnnimmm' with the volume identification number of the
    file you want.  IMPORTANT:  Your return address must contain a fully
    qualified domain name.  UUCP bang paths are NOT supported.

    Another mail server is archive-server@sixhub.uucp, administered by the
    comp.binaries.ibm.pc moderator, Bill Davidsen.  It will resend articles
    between five and fifteen days after their date of posting.  To use it,
    put the following in the SUBJECT line:

        send cbip/v06i721 to raymond@math.berkeley.edu

    where you should replace `raymond@math.berkeley.edu' with your email
    address, and `v06i721' with the volume identification number of the
    file you want.  If you are a site appearing in the uucp maps, then
    site.uucp is valid.  Bang paths are not valid.  If you send some address
    with fancy stuff in it, colons, percents, or exclamations, the request
    will be ignored.

    Note, however, that Bill Davidsen's server will service only twenty
    requests per day, to save on his phone bill.

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:<MSDOS.INFO>INTERxxx.ZIP (the last three digits
    indicate the version number).

    A list of books on programming the IBM PC can be found in the file
    "books" in my archives.

2.2)  How do I do direct video access from C?  Read/write an arbitrary byte?

    First comment is that direct video access is poor program engineering
    since it ties your program down to a particular hardware configuration.
    (Device drivers and TSRs are also known to reprogram the video board,
    thereby making accurate direct video access difficult.)

    Nevertheless, here's the answer, more to illustrate the concept
    rather than as a suggested method of action.  You can say

        #define screen ((char far*)0xB8000000)      /* B800:0000 */

    and treat "screen" as if it were an array.  You can 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.)  The file "flickerfree"
    in my archives contains tips on doing flicker-free video access.

    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 <dos.h>.  A similar trick can
    be used for accessing/setting the segment or offset portion
    of a far pointer.

    Note that this method works only for compilers which store pointers
    in segment:offset format (e.g., MSC, TC).  Other compilers
    (e.g., Lattice) may do things differently.  Consult your compiler
    manual to be sure.

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.  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.

    A useful mnemonic is that exPanded memory uses Paging.

    Allegedly, Zortech C has compiler support for expanded memory, and the
    shareware CXL library (In PD1:<MSDOS.C> on SIMTEL20) provide EMS
    handling for MSC and other compilers.

    More details can be found in the file "memory" in my archives.

2.5)  I get the message "floating point formats not linked" when I
      try to run my C program.  Why?

    This is a painfully well-known bug in Turbo C.  Just #include <math.h>
    and stick the line "(void)exp(1.0);" at the start of your main() and
    that should convince the linker to include the floating point formats.
    A patch exists to remedy this bug.

    Patches for Turbo C can be obtained from SIMTEL20, or from LIB 5 of
    the Borland Forum on CompuServe.  There is a Turbo-C mailing list
    on LISTSERV@UCF1VM.BITNET.

    There's a Zortech-C mailing list on uunet!ztc-list-request.


CHAPTER 3:  SOFTWARE AND VENDORS

3.1)  Has anyone had any experience with {company X, product Y}?

    Here's a checklist:

        [ ] Consult the files "products" and "old.questions" in my archives
            to see if somebody else has asked the same question and
            to see who responded.  Send them email asking them for their 
            opinions.

        [ ] Write a letter to the Better Business Bureau.  They've been
            archiving this sort of information for years.

        [ ] If you're still not satisfied, then post a request.  But it
            is now your duty to 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.

    In particular, a long summary of the debate over Mark Williams'
    "Coherent" product and comments on various C compilers are
    available from my archives.

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?  What are the GIF,
      TIFF, BGI, PCX, OBJ, EXE file formats?  How can I write my own BGI driver?
      Does anybody have a BGI driver for X?

    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.

    If you still can't find what you want, you can always contact the
    company that produced the application.  

    SIMTEL20 has GIF, TIFF and BGI file formats, as well as the Borland BGI
    toolkit (also available from Borland).  The formats for .OBJ and .EXE
    files can be found in the MS-DOS Encyclopedia.  The PCX file format can
    be obtained from ZSoft (their address is in the old.questions file).
    The comp.graphics Frequently Asked Questions file provides some
    more sources.  Various requests (and sources) for BGI drivers are
    contained in the old.questions file.

    Indeed, SIMTEL20's <MSDOS.INFO> directory is just chock full of
    assorted technical information.

3.4)  I don't like my keyboard's layout.  How can I swap the X and Y keys?

    Look in SIMTEL20's PD1:<MSDOS.KEYBOARD> 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:      A slightly buggy version of the...
    80386DX:    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.
    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 instructions 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?

    After formatting a 360K disk in a 360K drive, that disk should be
    written to ONLY by another 360K drive, although both 360K and 1.2M
    drives can read it.

    Before formatting a 360K disk in a 1.2M drive, first BULK ERASE the
    diskette, then format it and write to it using ONLY a 1.2M drive.
    This floppy can be read reliably on a 360K drive.  This disk should
    be considered READ-ONLY in a 360K drive.

    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.  PS/2 hard drives can be formatted by booting
    the Reference disk and typing Ctrl-A to call up a hidden menu.

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)  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.6)  Should I leave my PC turned on all the time?  What about
      mounting it sideways?

    A record of these debates the last time they went around is
    kept in my archives; consult the file "24hrs".

4.7)  How do I read an { Apple, Mac, Amiga, etc. } disk on my PC?

    The quick answer is, ``You can't read Apple/Mac/Amiga disks
    without special hardware.''  But all hope is not lost.  You can
    read PC disks from a Mac and an Amiga.  An IBM PC can read
    many kinds of CP/M disks with the proper software.

    See the `convert' file in the archives for a more detailed
    discussion of the hardware/software requirements.


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 UNIX-like utilities?  How do I remove a TSR from memory?
      How do I write my own TSR?  Is there a program that does X?

    Here's just a *sample* of what's available from SIMTEL20:

PD1:<MSDOS.SCREEN>PCCURS14.ARC    Unix-compatible version of Curses screen mgmt
PD1:<MSDOS.EDITOR>STEVIE.ARC      Clone of Unix 'vi' text editor
PD1:<MSDOS.EDITOR>VI-19A.ARC      Unix-like vi screen text editor for IBM PC
PD1:<MSDOS.SYSUTL>TSRCOM29.ARC    TSR memory management utils (MARK/RELEASE)
PD1:<MSDOS.TURBO-C>RESLB201.ARC   Function library for Turbo-C to make TSRs

    There's plenty more where they came from.

    Books on TSR programming are listed in the file "books" in my archives.

    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.)

    The GNUish MS-DOS project is moderated by Thorsten Ohl
    <td12@ddagsi.bitnet>.  Their efforts can be found on SIMTEL20
    and elsewhere.

    There are several different emacs implementations for the PC.
    The file "editor" in my archives discusses this, as well
    as other popular questions about editors.

    In general, if you are looking for a program, look first in the file
    PD1:<MSDOS.FILEDOCS>SIMIBM.ARC.  This is a directory of all the files
    in SIMTEL20's MS-DOS archives.
    You can also send requests to my email server to search through the
    index for a word or phrase.

5.3)  What about GIF images?  How do I view a GIF image?

    Archives for GIF images come and go (mostly go).
    GIF images are kept on wuarchive.wustl.edu (/graphics/gif),
    funic.funet.fi (/disk1/pub/misc/gif) and elsewhere.  GIF viewers can
    be found at those sites, as well as on SIMTEL20 (PD1:<MSDOS.GIF>).
    See the file "gif.info" in my archives for more information.
    See also the comp.graphics Frequently Asked Questions file.

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:<MSDOS.BATUTL>ECHOOFF.PAT contains
    a list of the patches to apply depending on which version of DOS
    you are using.

5.5)  How can I set a long path?  How can I enlarge my environment?
      How do I get/set an environment variable from a C/pascal program?

    There are a few ways of setting a long path.  One solution is to set
    things up so you don't need a long path in the first place.  For
    example, create a \bat directory with lots of batch files which save
    the current path, set the path to something else, run a program, then
    reset the path to what it originally was.  Or, use the SUBST program
    to make drive-letter aliases for long pathnames.  If you really want a
    big path, fetch the program BIGPATH.ARC or SETPTH13.ARC from SIMTEL20.

    The size of the environment is controlled by the "/E" option to
    COMMAND.COM.  Add the line "SHELL=COMMAND.COM /P /E:xxx" to your
    CONFIG.SYS, where xxx is the desired environment size (in either
    bytes or paragraphs, depending on your DOS version).

    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:<MSDOS.SYSUTL>SETENVJW.ARC for an example.  (There are other 
    programs on SIMTEL20 that claim to do roughly the same thing as this.)

APPENDIX A: ANSWERS TO MORE QUESTIONS and AVAILABILITY OF THIS FILE

    The archives I keep mentioning in this document are available
    for anonymous ftp (question 1.1) from math.princeton.edu[128.112.128.157]
    in the directory pub/rjc/csip.  The files are compressed via
    the UNIX "compress" program (see question 1.3).

    People who cannot ftp can request the files via email.  Before sending
    mail to the server, make sure you are using the instructions from the
    most recent version of this file.

    Send email to rjc@math.princeton.edu with no subject and containing
    the two lines

        path raymond@math.berkeley.edu
        help

    replacing "raymond@math.berkeley.edu" with your own return address,
    of course.  The return address must be in Internet domain-based format.
    Actually, the server tries to guess the return path,
    so the "path" command is needed only if your mailer puts bogus
    headers on outgoing mail.

    The email server also looks up programs in the SIMTEL20 index,
    the grape index, and the garbo index.  (So you have no excuse
    for not looking in these indexes before posting a request.)

    You may have noticed that several mail-based archive servers have
    been mentioned in this file, and no two of them are alike!  Please
    make sure to follow the correct set of instructions for the server
    in question.

APPENDIX B: OTHER SOURCES OF ANSWERS TO FREQUENTLY-ASKED QUESTIONS

    Other useful Frequently Asked Questions Files can be found in

        comp.graphics:          Interconverting various graphics formats,
                                specifications for graphics formats.
        comp.windows.x:         IBM PC implementations of X windows.
        comp.lang.postscript:   Converting things to/from Postscript,
                                previewing Postscript.

    The answers to the following questions can be obtained from the
    archives described in Appendix A, as the file "faq.more".

1)  I found a bug in program X!
2)  Why do I get disk full errors when I only have a bunch of tiny files
    in my root directory?
3)  I found that program X contains the string "Copyright Microsoft", so
    it must be a pirated copy of a commercial program, right?
4)  Can you summarize the history of the 80x86 family of processors?
5)  How about other chips that didn't make on the main faq list?
6)  Why do people say that the 80286 is "brain-dead"?
7)  How do I determine whether I am running on a monochrome or color
    machine?
8)  I have written a program that uses the mouse, and when I use
    CGA/EGA/VGA it is fine, but the mouse does not appear on
    a Hercules card. Why?
9)  Why does DOS use the \ instead of a / as a directory name separator?
    How can I tell DOS that I want to use slashes instead?
10) What is the SysReq key for?
11) How do I switch my screen into 43 line mode?  How can I detect the 
    number of lines from a program?
12) How do I echo a blank line from a batch file?
13) Why does my PC lose a day if I leave it unattended for more than 24 hours?
14) Why is my program limited to only 20 open files?  How can I increase
    this value?
15) I just installed a high density (1.2M) floppy drive, and weird things
    are happening.  How do I fix it?
16) What is 4DOS?  Where can I get it?  How can I disable the annoying beeps
    that it makes when I run it?
17) How do I disable call waiting?
18) Redirecting printer output into a file.

    Prof. Timo Salmi also has his own collection of Frequently Asked Questions,
    available as the file /pc/ts/tsfaq##.arc (where ## is a version number)
    from garbo.uwasa.fi.  The tables of contents for tsfaq15 follows:
--------------------------------------------------------------------
1)  What does "Subject: Re: none" mean in the news?
2)  Why "Reply by email, I don't read this group" gets flamed?
3)  What is an appropriate maximum length of a signature?
4)  Can someone point me to a list of ftp sites?
5)  How do I extract from comp.binaries.ibm.pc binary postings?
6)  Should I offer to email this utility I have at my disposal?
7)  Someone email me a .zip extractor (or something equally common)
8)  How should I react to "a dying boy's last wish"?
9)  How should I react to crackpot messages?
10) How should I react to abusive email?
11) How do I submit my PC program to the binaries?
12) May just go ahead and I post binaries in non-moderated groups?
13) What is cross-posting? How do I do it?
14) Where can I find the net rules?
15) I just posted to a wrong newsgroup. Should I explain it next?
--------------------------------------------------------------------
1)  How do I capture text from the screen to a file?
2)  How do I redirect the output from the screen to the printer?
3)  How can I direct all output to a file instead of the printer?
4)  Where can I get VT102 emulation codes?
5)  Problems with Procomm or Telix VT102 emulation.
6)  Is there a program to convert Pascal to C?
7)  I need a bigger cursor for my laptop.
8)  Where to find a source code for detecting which CPU my PC has?
9)  Can anyone recommend me a good linear programming package?
10) Where can I find sources for Unix z-modem?
11) Where can I find sources for Unix arc, lharc, zip, and zoo?
12) How to delete non-empty directories fast?
13) I can't run this file I got with a .zip (.arc etc) extension.
14) What is the best archiver?
15) What is the best text editor?
16) Am I safe against viruses if download files from FTP sites?
17) Where can I find a program to expand the keyboard buffer?
18) How to make z-modem transfer between a Unix mainframe and my PC?
19) Where can I find Unix-like utilities for my MsDos PC?
20) How can I hide files and directories?
-------------------------------------------------------------------
 1) How do I disable or capture the break key in Turbo Pascal?
 2) How do I get a printed documentation of my students' TP runs?
 3) What is the code for the weekday of a given date?
 4) Need a program to format Turbo Pascal source code consistently
 5) Can someone give me advice for writing a tsr program?
 6) Why can't I read / write the com ports?
 7) What are interrupts and how to use them in Turbo Pascal?
 8) Should I upgrade my Turbo Pascal version?
 9) How do I execute an MsDos command from within a TP program?
10) How is millisecond timing done?
11) How can I customize the text characters to my own liking?
12) How to find the files in a directory and subdirectories?
13) I need a power function but there is none in Turbo Pascal.
14) How can I create arrays that are larger than 64 kilobytes?
15) How can I test that the printer is ready?
16) How can I clear the keyboard type-ahead buffer.
17) How can I utilize expanded memory (EMS) in my programs?
18) How can I obtain the entire command line?
19) How do I redirect text from printer to file in my TP program?
20) Turbo Pascal is for wimps. Use standard Pascal or C instead?
21) How do I turn the cursor off?
22) How to find all roots of a polynomial?
23) What is all this talk about "Pascal homework on the net"?
-------------------------------------------------------------------
1)  What is this anonymous ftp?
2)  Send file(s) to me by email.  (Or how to use the mail server?)
3)  Why announce programs in c.b.i.p.d when not everybody can ftp?
4)  Do you announce all additions to your archives in c.b.i.p.d?
5)  How is anonymous ftp used?
6)  When I try to unpack the package I received, it is corrupt.
7)  Send me a list where on Simtel20 I can find the same programs.
8)  What is garbo.uwasa.fi guest user-id?
9)  The packages won't run on my PC when I type their names.
10) I have made some programs myself. Are you interested?
11) I want a description of the programs to decide what to get.
12) Why don't you reply to my email messages?
13) I get an "unknown packing method" error message.
14) I need a program for such and such purpose. Any directions?
15) What are these peculiar files with a .Z extension?
16) Where does one get the files listed in files-mm.zip?
17) I have this technical problem with anonymous ftp.
18) Is there any way of automating getting the files?
19) Why doesn't your mail server respond to my correct request?