[comp.sys.ibm.pc] RamdiskQ

sfn20715@uxa.cso.uiuc.edu (12/12/89)

I have several questions about ramdisks.  
 1) When I execute a program from a ramdisk, the OS copies the code from
 some area of ram allocated to the ramdisk into some area of ram not
 allocated and sets the program counter at the beginning of this new
 area, right?
 2) Wouldn't it be a lot better if a ramdisk were to use the OS's "Load but
 dont execute" function to load executables onto a ramdisk?
 That way, when the user wants to execute it, the ramdisk controller
 executes an "execute already loaded program", saving duplicating the
 program and all of the time requried in doing such, etc etc.
 When the program is to be deleted, just use the "unlink already loaded
 program" function.
 Data and/or nonexecutables could be kept in the usual ramdisk fashion.


 Would this work?

rob@prism.TMC.COM (12/14/89)

> 1) When I execute a program from a ramdisk, the OS copies the code from
> some area of ram allocated to the ramdisk into some area of ram not
> allocated and sets the program counter at the beginning of this new
> area, right?

   Pretty much, yes.

> 2) Wouldn't it be a lot better if a ramdisk were to use the OS's "Load but
> dont execute" function to load executables onto a ramdisk?
> That way, when the user wants to execute it, the ramdisk controller
> executes an "execute already loaded program", saving duplicating the
> program and all of the time requried in doing such, etc etc.
> When the program is to be deleted, just use the "unlink already loaded
> program" function.
> Data and/or nonexecutables could be kept in the usual ramdisk fashion.

  I see what you're getting at, and I agree that it sometimes seems wasteful 
to 'load' a program that's already in memory, but there are problems with 
this approach.

  First, it would require that the RAM disk supply its own program to
load executables onto itself; DOS COPY wouldn't work, since it wouldn't
perform the necessary 'pre-loading'. Remember that DOS officially
doesn't know that a RAMdisk is in memory; DOS just sees it as another 
block device.

  Second it would only work with RAMdisks in conventional DOS memory.
Many RAMdisks reside in expanded or extended memory. Executing programs 
from expanded or extended memory is a different ball game.

  Finally, the savings wouldn't be that great. The time required to load a
program from a RAMdisk, even on a slow machine, is small. The minor speedup, 
under fairly narrow circumstances, probably doesn't justify the added 
complexity.