index next


Running Windows from RAM disk


Introduction

I think its very annoying that each version of Windows uses the harddrive more intensively then the previous one and I think most people agree with me.
For me its clear that this is one of many ways in which commercial software- (like Microsoft;-) and hardware vendors manipulate markets.

Computers nowadays have RAM (Random Accessable Memory) of 64 Mb, 128 Mb and even more.
In the early days it was normal for a computer to have a harddisk with the same (and even less) capacity!
Already in good old DOS it was easy to create a so called virtual disk ( i.e. a disk that is created in RAM).
Utilities for creating such a virtual disk are available in most versions of DOS, but also third
party programs are available.

Since virtual disks are much quicker than even the fastest harddrive and make no noise at all it would be very nice to
have a computer that runs Windows (or another Operating System) from RAM disk.

Here I have written down my experiences with such computers until now.

Windows 3.1x

I am succesfully Running Windows 3.11 or Windows For Workgroups (WfW) from RAM and its pretty straightforward.
The procedures for Windows 3.1 and earlier versions (like 3.0, 2.0 and even 1.0 ;-) are similar.

The standard utilies that come with various versions of DOS can create a virtual disk with a capacity of up to 32 Mb.
Lets consider a (minimalistic;-) computer with 24 Mb RAM and one harddrive C: (i.e. only one partion).
Lets say we create a RAM disk of 12 Mb (read your DOS manual or help how to create a RAM disk).
In this way 12 Mb working memory will be left for Windows 3.11.
The virtual drive that is created will (normally) be D:.
Its possible to install Windows 3.11 on this D: drive in the directory called: D:\WINDOWS.
After installing the computer must NOT be restarted but you have to quit to DOS.
Of course if you restart all data on the virtual drive will be LOST and your installation also will be lost, so this is not what you want.
Now copy the entire D:\WINDOWS directory to the C: drive like this:

MD C:\WIMAGE
XCOPY D:\WINDOWS\*.*  C:\WIMAGE /S /E

The /S and /E switches are used to make sure all subdirectories (like \WINDOWS\SYSTEM) and the files in it are also copied.

Now these line must be added to AUTOEXEC.BAT:

MD D:\WINDOWS
XCOPY   C:\WIMAGE\*.* D:\WINDOWS /S /E

Now you have a system that runs Windows 3.11 from RAM disk!

Here are some other things/refinements to consider.

- To create a virtual drive that is larger then 32 Mb I think its best to use the Freeware program called XMSDISK.
- COMMAND.COM can also be placed on the virtual drive and COMSPEC can point to it in this way:

XCOPY C:\COMMAND.COM D:\
SET COMSPEC=D:\COMMAND.COM

- The TEMP variable can also point to a directory on the virtual drive
This can be done in this way (of course these line can be added to AUTOEXEC.BAT):

MD D:\TEMP
SET TEMP=D:\TEMP

- Don't use a permanent swap file when running Windows 3.11 from RAM (it makes no sense).
- Of course its better to have a larger amount of RAM and (thus) a larger virtual disk . In this way its possible to run more than a minimalistic Windows 3.11 installation from RAM. I have read somewhere that Windows 3.11 uses a maximum of 32 Mb of RAM for working space, so I think all RAM that is available above 32 Mb can be used for a virtual drive.
- If you have more than 64Mb RAM you must use HIMEM.SYS from Windows 9x or higher, otherwise only 64Mb is recognised.
- I myself prefer installing all Windows 3.1x programs in subdirectories of the \WINDOWS directory. In this way copying from RAM drive  to C: is easier.
Some programs (like Netscape Navigator/Communicator 4.08 16-bits) don't allow this, so the \NETSCAPE directory must be copied seperately from RAM disk to harddisk after installing).
- Its possible to use the DOS program PKZIP to copy and compress the RAM drive.
In this way XCOPY is not needed anymore and restoring goes quicker (if your processor is quick enough ;-).
This is how I use PKZIP:

PKZIP  -ex -r -P D.ZIP d:\*.*

In this way D.ZIP contains the image of the Windows installation on the virtual drive.
 

Finally an example of how I run Windows 3.11 from RAM:

System:
- Intel Celeron 466 Mhz
- 128 Mb RAM
- Ati Rage Lt Pro AGP videocard (with appropriate Windows 3.1x driver)
- Soundblaster 16 PnP
- MS-DOS 6.22 NL, WfW 3.11 NL with appropriate updates (like TCP/IP)
- 3Com NIC 90xx 10/100 Mbit connected to cable modem

My CONFIG.SYS:

SWITCHES=/F
DEVICE=C:\BIN\HIMEM.SYS /TESTMEM:OFF
DOS=HIGH
FILES=30
SHELL=C:\DOS\COMMAND.COM C:\DOS\  /p
DEVICE = C:\BIN\CDROM.SYS /D:MSCD000 /DMA
REM Device from Windows directory:
DEVICE=C:\BIN\IFSHLP.SYS
REM SoundBlaster 16 PnP device:
REM DEVICE=C:\BIN\CTCM.EXE
STACKS=0,0

Please note that HIMEM.SYS  is from Windows 98, otherwise memory above 64Mb is not recognised in DOS.
Also IFSHLP.SYS was needed since this installation needs networking (with cablemodem to the internet).
Normally IFSHLP.SYS is located in the Windows directory (but it does not exist at the time CONFIG.SYS is executed!;-), so I had to copy it to the physical drive first.

My AUTOEXEC.BAT:

@ECHO OFF
PATH D:\WINDOWS;D:\WINDOWS\MSIE50;C:\BIN;C:\DOS;C:\DISPLAY
SET TEMP=C:\TEMP
REM LH SMARTDRV
LH XMSDSK 98006 /T /Y
LH MSCDEX.EXE /S /D:MSCD000
D:
UNZIP C:\D\*.ZIP
D:\WINDOWS\net start
SET COMSPEC=D:\COMMAND.COM
SET MIDI=SYNTH:1 MAP:E
SET CTCM=D:\WINDOWS\SB16
D:\WINDOWS\SB16\DIAGNOSE /S /W=D:\WINDOWS
D:\WINDOWS\SB16\MIXERSET /P /Q
D:\WINDOWS\SB16\CTCU.EXE /S /W=D:\WINDOWS
SET SOUND=D:\WINDOWS\SB16
SET BLASTER=A220 I5 D1 H1 P330 T6
REM SET BLASTER=A220 I5 D1 H1 P330 T6

In this example the TEMP directory is still on the physical C: drive, because this Windows 3.11 installation of mine was very large and it didn't leave enough space left on the virtual D: drive (which is 96 Mb) for temporary swapping.
The C:\D directory is where my compressed backup file of the D: drive resides.

Windows 95

I haven't tried Windows 95 yet but I think its possible to run it from RAM.
For Windows 9x there are some  problems that don't apply to Windows 3.11.
First of all you need a larger virtual disk than 32 MB so I use XMSDSK.
Second problem is that Windows 9x can't be installed on a virtual disk like I did with Windows 3.11.
This will result in problems with driveletters if you just copy your Windows 9x installation from C: to a (virtual) D: drive.
I think this problem can be solved by installing Windows 9x first to a PHYSICAL drive with letter D:.
Of course this can be done by placing a second harddrive temporarily and after installing just copy the image to the C: drive and then remove the second drive.
Its also possible to make a second partition and afterwards removing it (there are many tools for doing this while leaving the data on the first partition unharmed).
In this way the RAM drive will have the (correct) letter D.
The third problem that arises is how Long File Names (LNF) are conserved while copying in DOS.
This last problem can be solved with a program called LCOPY I guess.

I also think its best to use FAT16 for the physical drive D:, because when the RAM disk is used afterwards it might give problems if FAT32 is used originally.

As I said I havent tried yet.
Here are some other ideas I have, maybe someone can help/has suggestions:

Is it possible to use utilities like Norton Ghost?
This may be a stupid question, but I really don't have experience (until now) with network booting:
In what way does a Network computer gets its image from the OS?
So I am talking here about a diskless Network client (a terminal).
I know of bootrom, but I think bootrom is only large enough to boot something like DOS?
If no bootrom is available its easy to boot from floppy to DOS with DOS networkcard drivers I guess.
For Windows 3.11 it would be easy to create a virtual disk from bootrom or floppy and then copy the Windows 3.11 installation from network drive to virtual drive.
What about Windows 9x??????????

index next