[comp.sys.ibm.pc] command.com in RAM drive...

oolidjr@hubcap.UUCP (Joe Moll) (05/18/88)

Sorry to send so much, but I needed to straighten this one out.


>>From article <26530@clyde.ATT.COM>, by meb@floyd.ATT.COM:
>> What I have:      Tandy 1000EX
>>                   1-720K Floppy
>>                   1-360K Floppy
>>                   DOS 2.11
>> 
>> What I want to do:  I would like to copy command.com into a ramdrive and
>>                     have DOS look for it there instead of in drive A.
>>                     I have looked through my DOS manual and several DOS
>>                     books but I can't seem to find anything that covers
>>                     this topic.


Eric Wickberg writes in responce ...


>From: eric@umb.umb.edu (Eric Wickberg)
>Newsgroups: comp.sys.ibm.pc


>Looks like you are gonna have some problems in doing that.  The main
>problem is that when dos loads in (when you boot the A drive), it loads an
>image into memory, and, unfortunately, molds itself around the boot drive.  If
>you have noticed, the machine will access the A drive when exiting from some
>programs, and if it doesn't find the command.com in the drive it booted from,
>it tends to get very upset.  Now, in copying the command.com to the ramdrive
>AFTER dos boots, DOS is still gonna look for command.com in the A drive.  Now,
>you can't boot to the ramdrive, because DOS creates it.  So, as I see it, you
>have a pretty interesting catch-22.

>Lemme know if you find a solution to the problem..

>Good luck,

>Eric Wickberg

Well, I'm glad to say that you can copy COMMAND.COM into a RAM drive and
use it from there after boot.  I have done this on my Tandy
1000sx up until I recently bought my Hard-Card.

The trick is DOS's environment.  If you just type 'set' from a dos
prompt, it will report to you the current environment settings.  Setting
the environment variable 'COMSPEC' (yes, in CAPS) to the path where
your new copy of COMMAND.COM is now (i.e. C:\COMMAND.COM if your RAM drive is
drive C, which was my case) will cause DOS to make all accesses to
COMMAND.COM on the RAM drive, just as if you had booted from there.

Example:

In your autoexec ...

---
copy command.com c:
set COMSPEC=C:\COMMAND.COM    	<--	_Must_ be in caps.  DOS's Initial
					setting is in caps.  Will not overwrite
					if new one is in lowercase.
---

That is essentially what I had.  Worked great.  RAM drives are soooo
fast!!


Sorry Eric ....


-- 
                   /=----------+^ jlmoll@clemson.bitnet
Joe Moll  --------=\  Internet |  oolidjr@hubcap.clemson.edu
Clemson University  \     UUCP |  {pick a hub}!hubcap!oolidjr
Clemson, SC   \     |\=--------+--------/`

lbach@uxh.cso.uiuc.edu.UUCP (05/18/88)

In a recent article in PCM, they told how to do this (it was 3 issues back,
I think).  I think what you need to do is define the environment variable
COMSPEC which tells dos where to look for command.com.  For instance, if your
ram drive is C:, then in your autoexec (or is it the config.sys?) you should
have

set comspec=c:\command.com

and you must also have the copy of command.com on the ramdrive.  I think this is
right (I'm no expert, so don't flame me if it isn't).  I'll try to remember to 
look it up and if it's wrong, I'll reply.  The article was on configuring your
system, in case you want to look it up yourself.

Good luck,


---
Jim Loellbach
Dept. of Aeronuatical & Astronautical Eng.
Univ. of Illinois, Urbana
lbach@uicfda.aae.uiuc.edu

swh@hpsmtc1.HP.COM (Steve Harrold) (05/19/88)

Re: COMMAND.COM on a RAM-disk

Here's how I do it:

1) Edit your CONFIG.SYS to contain the line:

	shell=c:\command.com e:\ /p  /e:62
	      ^^^^^^^^^^^^^^ ^^^ ^^  ^^^^^
	      =======1====== =2= =3= ==4==

   What this says is:  
   =1=  load COMMAND.COM from the root directory on the boot disk (C:)
   =2=  do re-loads of the transient part from E:\ (which is the
        RAM-disk; insert whatever drive letter YOU use for this purpose)
   =3=  signifies that this is the permanently loaded copy, which means
	that it will execute the AUTOEXEC.BAT file
   =4=  this has nothing to do with the problem, but use the 
	opportunity to increase your environment space; the value
	selected depends on what version of DOS you have

2) Insert the following lines EARLY in your AUTOEXEC.BAT file:

	copy c:\command.com e:\
	set compsec=e:\command.com

From this point on, the DOS should look for itself on the E: drive, AND 
other programs that you have that escape to a subshell will find the new
COMSPEC environment variable and load from the location indicated therein.

---------------------
Steve Harrold			...hplabs!hpsmtc1!swh
				HPG200/13
				(408) 447-5580
---------------------

mvolo@ecsvax.UUCP (Michael R. Volow) (05/20/88)

In article <11470032@hpsmtc1.HP.COM>, swh@hpsmtc1.HP.COM (Steve Harrold) writes:
> 1) Edit your CONFIG.SYS to contain the line:
> 
> 	shell=c:\command.com e:\ /p  /e:62
> 	      ^^^^^^^^^^^^^^ ^^^ ^^  ^^^^^
> 	      =======1====== =2= =3= ==4==
> 
> 	copy c:\command.com e:\
> 	set compsec=e:\command.com
> 

However, with DOS 2.x, the above won't work unless the following
line is the last line in the autoexec.bat:

COMMAND /C COMMAND

I loadsanother copy of the comd processor.  I believe that DOS 2.x
looks for command.com in the drive from which  was last loaded.  It
is not necessary for DOS 3.x.

bjornb@rhi.hi.is (Bjorn H Bjornsson) (05/26/88)

 After you've put command.com in ram and set COMSPEC, you should mark
command.com as read-only to prevent accidental erasure.
 If DOS looks for command.com on the ram-disk and doesn't find it, the
machine does a "Can't-load-command.com. System-halted", and dies.
-- 
Bjorn Heimir Bjornsson		Internet:  bjornb@rhi.hi.is
University of Iceland		UUCP:	   {mcvax,enea}!hafro!rhi!bjornb

pkopp@potpourri.UUCP (Paul Kopp) (06/04/88)

in article <1653@hubcap.UUCP>, oolidjr@hubcap.UUCP (Joe Moll) says:
> Xref: gould comp.sys.ibm.pc:12923 comp.sys.tandy:640
>>>From article <26530@clyde.ATT.COM>, by meb@floyd.ATT.COM:
> Eric Wickberg writes in responce ...
>>From: eric@umb.umb.edu (Eric Wickberg)
>>Newsgroups: comp.sys.ibm.pc

[ all kinds of stuff deleted about command.com on a ram disk.]

I tried this too.  Well, actually, I was trying to move command.com out of
my root directory (same kind of thing).  To move this file, I had to do
TWO things.

1)   set COMSPEC = c:\dos\command.com      <---- in autoexec.bat  and

2)   command = c:\dos\command.com /p       <---- in config.sys (from
                                                 memory; I'm pretty sure
                                                 this is right.

Everything worked fine until I tried to format a floppy with the sys
option (format a:/s).  I kept getting prompted to place a disk with
command.com in drive a:.  I found the solution to this problem.  It
seems that in order to format a floppy with the "sys" option, the two
hidden files (msdos.sys and io.sys) needed to be in the same directory
pointed to by the above statements.  After I copied the two files over,
everything worked "as advertised." Now I'm not sure (because I haven't
tried it), but you're probably going to run into the same problem when
you move command.com to a ram disk.

-------------------------------------

Paul Kopp                                   The opinions (if any) expressed
Gould Inc., Computer Systems Division       are my own.
Fort Lauderdale, Florida
Mail paths?, oh yea mail paths:   ...!{sun,uunet,pur-ee,brl-bmd}!gould!pkopp
                                  ...!{ihnp4!codas,allegra}!novavax!gould!pkopp