Ŀ
۲ -=-=-= CyberRax Programming =-=-=- ۳



                                 presents:



     $$$$$$$$$$$  $$                        $$       $$$$$$$   $$$$$$
     $$                                     $$      $$     $$  $$    $$
     $$                $$$$$     $$$$$      $$     $$          $$     $$
     $$$$$        $$  $$   $$   $$   $$  $$$$$$$$  $$          $$     $$
     $$           $$  $$$$$$$  $$           $$     $$          $$     $$
     $$           $$  $$        $$   $$     $$      $$     $$  $$    $$
     $$$$$$$$$$$  $$   $$$$$$    $$$$$       $$      $$$$$$$   $$$$$$
                  $$
                 $$
                $$    v  e  r  s  i  o  n     1 . 0 1
               $$



Ŀ
 Introduction 


 EjectCD  is  a little memory resident utility which allows you to open/close
 the door of your CD-ROM drive by pressing F11


Ŀ
 A little closer 


 I wrote this TSR for 2 reasons:

   a) the eject-button of  my  CD-ROM  is  way  too  small  and  thus  hardly
      pressable;
   b) if  I'm in a sub directory and replace the CD-ROM then Volkov Commander
      (or DOS) doesn't notice it and doesn't change to root directory  as  by
      diskettes, but  says  "Can't  read disk".  The only solution to this is
      "cd E:\" from commandline.

 If you have the same problems then EjectCD is just right for you.


Ŀ
 Usage 


 Simple:

                      EJECTCD [switch1] [switch2] [etc.]


 Switches are somewhat optional, can be preceded by hypen (-)  or  slash  (/)
 and can be:

 I      -  Install.  That's  what  this  parameter does: installs the driver.
           This means you can't install EjectCD just  by  pressing  ENTER  on
           it's name in a shell, you must specify "I" on the command line
 U      -  Uninstall from memory.
 F      -  Force uninstallation.    EjectCD gives usually error if other TSRs
           which use the same interrupts have been  installed  after  it  and
           refuses to   uninstall.    With  "F"  switch  you  can  force  the
           uninstallation.  But be warned: the system might  become  unstable
           or even crash after that.
 E      -  Enable driver.   This switch is active by default and doesn't have
           to be specified by install.  It's mainly for re-enabling  the  TSR
           after it has been temporarily disabled
 D      -  Disable TSR. Causes the TSR not to react on F11.
 B      -  Beep by opening/closing. Default value.
 R      -  Change to root directory of CD drive (like in "cd \"). This option
           is also active by default.
 C      -  Make CD  to  current drive.  Meaning: you're on C: drive, press 2x
           F11 and you're on D: (or whatever drive your CD-ROM is) Simple  :)
           This is by default disabled.
 CS     -  Enable commander support.   Now  this  needs  a  little  bit  more
           explaining.   Nobody  is  using pure DOS nowadays (atleast not all
           the time), mostly everything is being done through some  shell:  a
           file  manager, some graphical shell (we're still talking about DOS
           here, so I don't mean Winblows). Anyway, if you're using some file
           manager (a "commander") you usually have 1 or two panels  where're
           the files  and  directories.  If you're now on your harddrive, you
           open and close the CD and "C" parameter  was  used,  then  nothing
           happens: the panel doesn't reflect the contents of D: drive.  It's
           because  the  setting  took  place in background and the commander
           doesn't know that anything happened.    Until  you  try  to  enter
           another directory.   Decent file managers have for cases like this
           a special command by which they re-read the current directory.
           All "CS" switch does is to tell EjectCD to force the commander  to
           re-read the  directory  after the CD door has been closed.  So, if
           both this and the "C" switch are in use then  after  pressing  F11
           twice  the  commander shows what's on your CD-ROM. By default this
           option is disabled too.
 ALT    -  Use ALT+R as commander hotkey  for  re-reading  (if  you  use  DOS
           Navigator).
 CTRL   -  Use CTRL+R (default, because I use Volkov Commander).
 OPEN   -  opens the CD door without going resident.  This switch can be used
           for example in batch files.
 CLOSE  -  closes the drive door from the commandline.

 When I  said  "optional" then I meant: under some circumstances.  If EjectCD
 is not installed then executing it without parameters will give you the help
 screen with short description of switches.  On the other hand, if EjectCD is
 resident, no parameters cause the program to show current settings.  Several
 switches can be given together, but  they  must  be  separated  with  spaces
 (EjectCD  I  e ALT). As you might have already guessed they can be either in
 upper or lower case.   You  can  reverse  the  action  of  every  switch  by
 appending a minus to it (EjectCD C- /r- -B-)

 If  TSR has been successfully installed you simply have to push F11. On that
 the character "W" (for "Waiting...") is shown in the upper right  corner  of
 monitor.   If  DOS  sets  the  markers that it's not busy character "" (for
 opening) or "" (for closing) is displayed, a  bell  is  played  through  PC
 speaker  (if this feature hasn't been disabled) and DOS is given the command
 to open/close the CD-ROM's door.  When the operating  system  has  completed
 this the original character is restored on the screen and TSR ends.


Ŀ
 Notes 


 ****************************************************************************
 *   This  program,  as  my  first  AMIS  compliant, is dedicated to Ralf   *
 *   Brown, the author of Interrupt List, Alternate  Multiplex  Interrupt   *
 *   Specification,  SPAWNO,  AMISlib and several other products, for his   *
 *   enormous work on maintaining and expanding the Interrupt List.         *
 ****************************************************************************

 "Default" switches are ON if they were not set otherwise
 This means:             EJECTCD I
 is exactly the same as  EJECTCD I E B R C- CD-
 and                     EJECTCD I CS
 is the same as          EJECTCD I E B R C- CS CTRL
 So, by default EjectCD is enabled, beeps and changes to root directory,  but
 has no commander support nor makes the CD drive to current.

 DOS  doesn't  allow to use it while it's busy (EjectCD uses it for drive and
 directory setting) so if you did an almost-didn't-touch-the-key press on F11
 then you probably won't get anything.  Press F11 down and wait while the "W"
 appears in the right upper corner on monitor.  It won't take long.  Try it a
 few times to see what I mean.

 It seems that DOS ain't checking extended keys  in  pure  environment  (when
 you're  not using any shell) so you won't have much from this program if you
 don't use any commander.

 The resident part has a variable which will be reversed every time  the  TSR
 opens or  closes  the  CD  door.    Some actions are taken according to that
 variable and it's the only way EjectCD knows the status of the door.  So, if
 you choose to use EjectCD then use only it and don't press the  eject-button
 any more.   If the TSR only opens/closes the door and no drive, directory or
 commander setting is being done then there's no problem, but if it's not  so
 then you might get some error messages from your commander or DOS that drive
 can't be  accessed.    Just  set  the  door  to what it was when EjectCD was
 activated the last time before physical actions, and  everything  should  be
 fine again.

 If you  install  EjectCD  it expects the CD drive door to be closed.  Better
 set it this way.

 If you have DOS 5 or better (or third party appropriate utilities for  lower
 versions)  then I suggest you load this utility high (LH EjectCD.COM I) from
 your AUTOEXEC.BAT before executing the file manager.  This  might  save  you
 some bytes.

 If  you  don't  like  the annoying beep (atleast I don't) then turn off this
 feature of EjectCD or get a program to shorten the bell  (like  my  jTSR  or
 Eric Tauck's Warp Driver or Yura Zaitsev's YZBELL)

 You  can't  actually press F11 and right after that press F11 again and wait
 that the door opens and closes.  The door only  opens.    To  tell  you  the
 truth:  the whole computer won't respond while the opening/closing operation
 hasn't been completed.  If the CD drive is slow or the CD-ROM ain't the best
 then it might take some time.

 EjectCD will give an error message on  parameters  which  are  against  each
 other (a la "enable TSR" and "disable TSR" - "E D").

 The  TSR part gives the key code forward to the next handler of the keyboard
 interrupt.  Meaning: if there are any other TSR's which get activated on F11
 and are loaded before EjectCD then  they  will  still  activate  (after  our
 utility, of course).

 Sometimes the  opening takes a very long time.  There's two main reasons for
 that:
   a) EjectCD executes the necessary code only if DOS reports that  it's  not
      busy with  anything  else.    Because the TSR checks for this condition
      about 18,2 times per second it usually finds the a moment when  it  can
      activate.   But  this is not true for example by starting of MSD, which
      uses DOS to check the disks.  And checking CD-ROMs takes a  long  time,
      during which the TSR can't do anything else than show the "W".
   b) The preparation  for  opening  of  CD  drive by software is slow.  This
      doesn't apply only to EjectCD, but also to all  other  programs.    The
      reason for this is that calls to MSCDEX (the easiest way to perform the
      action) are simply slow.  End of story.

 See 'Tested' chapter about problems with M$ Winblows 9x.


Ŀ
 System requirements 


    MS-DOS 3.0 (or any compatible)
    80286 or better CPU
    extended keyboard (with 101 or more keys) and supporting BIOS
    a file manager (Volkov or Norton Commander is preferred)
    CD-ROM drive
    a CD driver (you must have it if you want to use the drive under DOS)
    some version of MSCDEX (or something compatible like SHSUCDX or NWCDEX)
    ca. 7kB memory during execution, about 900bytes when resident

 I can make this code work on a 8086, but it would be larger (besides that, I
 haven't  seen  a  computer  lower  than 386 which had a CD drive attached to
 it).  But if somebody asks a 8086 version then I'll do it.


Ŀ
 Advantages of EjectCD 


 + Freeware (don't you just love it?  :)
 + You can manage the drive door from your keyboard
 + No need for that ALT+F1 to change to drive
 + Nice beep every time you open/close the CD drive
 + No error because of  sub-directories  (if  anybody  besides  me  ever  had
   them  :)


Ŀ
 Disadvantages 


 - Max. 1,3kB less memory
 - Annoying beeping  (optional  :)
 - Possible  conflicts  with  other  TSRs  or programs (shouldn't be, but who
   knows)


Ŀ
 Tested 


 As I am AWFULLY lazy I tested EjectCD throughly only on 1 computer, my  own,
 which  is  an  AMD  486DX/100MHz, MS-DOS 6.22, with HIMEM + RDOSUMB (earlier
 HIRAM) for  memory  management.    Tested  a  beta  version   on   a   Cyrix
 486DLC/40MHz, Win95/MS-DOS  7.0  with  HIMEM/EMM386 for memory.  Worked, but
 see below.

 CD drive was FUNAI CD-E2450,  a  2x  CD-ROM  which  doesn't  currently  have
 drivers for Winboose.

 EjectCD worked fine with following CD2DOS drivers:

            Microsoft's MSCDEX 2.23
            John H. McCoy's SHSUCDX 1.1a and 1.4

 Tested shells ([*] - has been tested in a DOS box under Win95):

 Textmode shells:
    Menuing programs:
       Eugenio J. Alvarez's AUMenu for UNIX (DOS version) 1.4.3a
          Works, but no CS
       MicroFox Company's Hard Disk Menu 5.03
          Works, but no CS
    Commanders:
       V. V. Volkov's Volkov Commander 4.03SW [*] and 4.05SW
          Worked PERFECTLY!
       Eugene Roshal's FAR 1.63SW for Windows 95/NT [*]
          This  was a beta-release of EjectCD which had no commander support,
          so I don't  know  about  that,  but  everything  else  worked  fine
          (besides the fact that some x menu was set under F11 so it was also
          brought up)
       Symantec Corp's Norton Commander 4.0
          Everything's OK
       RIT Research Lab's DOS Navigator 1.51
          The rest is fine, but DN doesn't refresh the panel if...
             ...the drive is being changed
             ...the active directory also exists on the new disk
          In other words:
             a) changing  to  CD-ROM doesn't work completely: the commandline
                indicates a new drive but the file panel doesn't.
             b) if already on CD then you are changed to  root  only  if  the
                drive  doesn't  have  a directory with the name as the active
                one in the last disk.   The  file  panel  refreshing  doesn't
                occur before you try to enter a subdirectory
       Gordon Haff's Directory Freedom 4.61B
          No commander support, but everything else works
       G. A. Denes' FileWizard 1.25
          No  CS,  but  it  seems that this file manager can't access CD-ROMs
          anyway
       Enrico Ferro's The Pinco's Commander 2.2
          Again no CS
       Strathrory System Limited's Terminate Commander 2.11
          And again, no CS. And there's  by  default  DOS  Defrag  under  F11
          (which gets executed after door opening).
       Briggs Softwork's FILE MAVEN 3.5a
          Worked,  but  no  CS  (re-reading  can  be  accessed only through 2
          keypresses)
       M.R.E. Software's Stereo Shell 3.0
          Worked, but no CS
       DN-OSP Team's DOS  Navigator  Open  Source  Project  1.51.11/DPMI  and
       1.6.RC1/RM
          Everything's exactly as by the original DOS Navigator
    Other shells, which can't be classified as commanders or menuing systems:
       Marin Pacific Software's DOSamatic 2.03
          Works.  No  CS  because  this shell doesn't seem to support neither
          re-reading nor CDs
       Richard D. Rutter's ExpanDIR 1.0
          Works, but no  CS  and  a  second  beep  appears  (this  time  from
          ExpanDIR, which signals that F11 doesn't have any functions)
       PC Magazine's RX.COM 1.0(?)
          Works, no CS

 Graphical shells:
    Menuing programs:
       OSCS's QuikMenu 1.06
          Works,  but  no  CS and the spot where the markers were shown stays
          empty, ie the graphical character ain't being restored.    Although
          you can use the special TSR support by pressing F3 (a textscreen is
          presented so TSRs wouldn't mess up the graphics)
       Marc-Olivier Huynh's Fast Access 1.25
          Works,  but  no CS. And the block doesn't stay mostly empty, but an
          undefined character is displayed (I'm not sure whether it's EjectCD
          or Fast Access who's doing it)
       NeoSoft Corp.'s QuikMenu III 3.1h
          Exactly the same as QuikMenu 1.06 (seems to be  the  same  program,
          just  enhanced and sold to another company (or perhaps are OSCS and
          NeoSoft one and the same?))
    Windowed shells:
       Felix Ritter's DESKTOP 2.62e
          Worked, even the "waiting/opening/closing" characters  were  shown,
          but no  CS  and  the  usual  "black-box  syndrome".   Also: in File
          Manager there're "sort options" under F11
       Michal Stencl's SEAL 1d test
          DOESN'T WORK.
       Daniel L. Nice's DOS Start!  1.8g
          Works. Also by this shell the marker are  shown  and  also  here  a
          black box  appears  after  displaying  the markers.  And no CS (DOS
          Start!  does have a refresh button in File Manager, but it  doesn't
          have any hotkey)

 As  you  saw,  only Norton and Volkov Commander are supported 100% correctly
 (maybe FAR too...).  But "CS"  is  still  an  add-on,  the  main  operation,
 opening/closing  the  drive  door, is working under all tested shells except
 SEAL (which is a fully 32bit shell and  doesn't  give  the  key  forward  to
 real-mode handler)

 [*] About  Windoza9x,  well,  it's  like SEAL: it's controlling all keys and
     won't give them to DOS programs, so it's no use  to  load  EjectCD  from
     AUTOEXEC.BAT and  then press F11 on the Win desktop.  But you can create
     clickable shortcuts (actually PIFs) for opening and closing by using the
     appropriate commandline switches.
     Another  thing:  I  don't  know  why  but  the  beep  occurs  after  the
     opening/closing, not before as it should.  Strange...


Ŀ
 Technical about EjectCD 


 > Written in SPHINX C-- and compiled with 0.237 beta 6
 > Norton  Commander  Editor  (NCEdit, not Norton Editor) was mainly used for
   writing
 > Liu TaoTao's Super Tracer 2.03  and  2.52,  Borland's  Turbo  Debug  2.01,
   Micro$lot's  DEBUG  and  VAG's/OlegPro's  DeGlucker 0.05-VSL were used for
   debugging
 > SEN's HIEW 5.60 and 6.16 were used for examining the code
 > Lot of material from Interrupt List R60 and R61, HelpPC 2.10,  Tech  Help!
   4.0a and Norton Guides was used
 > Source's size is 46317 bytes (it's fully commented, that's why)
 > It has 1406 lines
 > The TSR is AMIS 3.5.1 compatible
 > Robs 800 - 864 bytes of your precious memory
 > Commander support is nothing more than putting the code of CTRL+R or ALT+R
   into the keyboard buffer


Ŀ
 History 


 For the complete list of changes see EJECTCD.HST


Ŀ
 Future 


 If there will ever be a next version of this toy then there will probably be
 these enhancements:

   + code  optimizations  (thus  smaller  size of executable and the resident
     code)
   + if I figure out how to make the command prompt return faster  then  I'll
     add the code to do so
   + support for the DOS' "pure environment"


Ŀ
 Greets 


 Today's greets fly to:

 Ralf Brown                -  whom this  program  is  dedicated to.  You're a
                              GOD!!!
 Undertaker                -  (I hope I spelled your name right).  I got  the
                              whole  idea  of EjectCD from your CDROM program
                              (I read about it  in  FakeCD's  documentation).
                              Thanks, dude!
 Mandragore/(now dead)DDT  -  the  routine for opening/closing is ripped from
                              your Replay II virus
 Peter Cellik              -  for inventing C--
 Mishel Sheker             -  for taking over the development  of  C--  after
                              Peter moved to other things
 VAG and OlegPro           -  DG is really HIGH TECH...
 Sen                       -  HIEW rocks!
 Vsevolod V. Volkov        -  VC's simply the coolest commander there is
 David Jurgens             -  HelpPC, well, what could I say...
 Dan Rollins               -  Tech Help! was VERY helpful
 Gary Chason               -  for  his  Interrupt  Helper, a great viewer for
                              Ralf's IntList
 Linkin Park               -  for their AWESOME album "Hybrid  Theory"  which
                              has been plying a lot in my CD player lately


Ŀ
 Validating 


 To  check  if  all files in this archive are OK store my public PGP key into
 your public-key-file (PGPK -a CYBERRAX.SIG), validate  CRCHECK.CRC  (PGP  -v
 CRCHECK.CRC)  and then execute ROSE SWE's CrCheck (if you don't have it, get
 it, it's great!)


Ŀ
 Closing 


 So, we have come to the end.  If you have any suggestions  or  bug  reports,
 you  want support to a particular commander or you want to say how lame this
 TSR is, you found a mistake in this text file or you have some  difficulties
 with the program than feel free to mail me at


                              cyberrax@yahoo.com


 Oh  yeah, forgive me my not so good English (not my native language, besides
 that, I'm notorious for my typos  :)


                                   CyberRax
                               the Hacking One
                                      of
                      -=-=-= CyberRax Programming =-=-=-
                          "has still a SLOW CD-ROM"

           December 4th, 2001; Tootsi, Parnu County, Estonia, Estonia
