Current status
The W2k3 loading system has turned out to be a revolutionary solution for creating MS systems that load an image in RAM and start it from there.
We have been using it for quite a while to load in RAM ISO or SDI images of PE systems.
The initial boot media (which can be a cd, a usb stick, a hd,...) is, after the loading, free to be removed or to be used for other purposes.
The ISO based system results in a system where the system drive appears as a ReadOnly one, leaving the bootmedia we booted from, free for further use.
The SDI based system is preferable since on one hand the system drive is Writable and on the other it can be prepared as a NTFS compressed filesystem leaving us more free space in RAM.
The disadvantage of a SDI based system is that its creation depends on the installation in our system of an extra SDI management system (MS Windows embedded subsystem) which is unnecessarily complex to use and not easy to fully automate.
New developements
In this post we will use an excellent idea (presented in the thread of Booting Xp from RamDisk) that has been recently used in the context of loading and booting a normal XP system from RAM !!!.
Thanks to the work of euhenio, dennis123123, jaclaz, HighwayStar ...
http://euhenio.mam.by/
http://www.911cd.net/forums//index.php?s=&...st&p=127683
we now know that the w2k3 loading system is capable of loading in RAM not only ISO and SDI images but also normal disk images like those created by filedisk freeware virtual disk management utility.
Note: This finding, although independent, is actually not new.
It has been known for several months now at boot-land but this knowledge unfortunately never found its way over to 911cd.
Highwaystar has used it and even developed winbuilder scripts for this (ramboot winbuilder scripts)
It turns out that we can build systems similar to the SDI based ones that however do not have the disadvantages that were mentioned above. The creation of the disk image is straightforward and is actually fully scriptable.
In short, the process involves the creation of a disk image (we may use filedisk to create it), the copying of the files of a PE system and replacing if necessary the ramdisk.sys driver with the w2k3sp1 version.
Finally, the loader files are the well known w2k3sp1 files which allow the loading of the image in RAM.
Below is an attempt to present a step-by-step description of the logic:
Building instructions
Needed Files
1. Find a copy of RAMDISK.SYS, SETUPLDR.BIN and NTDETECT.COM from a W2k3Sp1 source cd or system
and copy them in a directory of your choice. Let us represent it with %W2k3SP1%
2. Install filedisk:
http://www.acc.umu.se/~bosse/
http://www.acc.umu.se/~bosse/filedisk-15.zip
in your system (you need to do this only once)
Preferably put filedisk.exe in your path so that is easily accessible.
3. Prepare your files for your PE system.
Use any building environment you like (pebuilder, reatogo, ubcd4win, winbuilder,..)
We need either the final output files OR the prepared iso.
Keep the size small enough, in any case < 500M.
RW RamPE systems: The procedure
4. Specify a folder that contains the PE Files.
For the sake of the presentation let us call the path to the PE Files as %PEFilesDir%
(i) %PEFilesDir% could be for example the outdir of pebuilder (e.g. c:\pe\BartPE)
(ii) In case you want to start with an ISO containing the PEFiles (e.g. c:\pe\pe.iso) you can mount
the iso file with filedisk as a drive (say I:)
CODE
filedisk /mount 0 c:\pe\pe.iso /cd I:
and your %PEFilesDir% will be I:
5. Create somewhere in your system an initially empty disk image (say c:\pe\rampe.img) that is big enough to host the PEFiles (size<500M),
format it with NTFS compressed filesystem and mount it as a RW drive, say R:
CODE
filedisk /mount 1 c:\pe\rampe.img 256M R:
format R: /FS:NTFS /C /V:RAMPE
format R: /FS:NTFS /C /V:RAMPE
Choose the 256M size appropriately so that it is large enough to host the files of your build and also leave some free space.
Take into account that by using ntfs compression our files occupy less space than their total uncompressed size.
The extra space you leave will appear as available writable space on your pe system disk.
In this way you can spare the use of ramdrv if you like.
6. Copy the contents of %PEFilesDir% to R:
CODE
xcopy %PEFilesDir%\*.* R:\ /E /H /R /Y
NOTE: One may use robocopy instead of xcopy for more options
7. If your files were not generated from a W2k3-SP1 system you need to replace the ramdisk.sys with the w2k3 version
Supposing that you have the w2k3sp1 files in %W2k3SP1% dir
CODE
copy %W2k3SP1%\ramdisk.sys r:\i386\system32\drivers\RAMDISK.SYS
8. Unmount any filedisk drives
CODE
filedisk /umount I: # needed if you used step 4ii
filedisk /umount R:
filedisk /umount R:
9. Prepare W2k3 loading system (need files from a w2k3 with at least SP1)
The details depend on the boot media.
Below we describe two common cases where we boot from CD and from a USB stick.
9a. Boot from CD and load in RAM
Create a folder/file structure (upper case) in some folder, say RamPE
CODE
RamPE\
RamPE\BOOTSECT.BIN # cd bootsector from a bartpe system
RamPE\RAMPE.IMG # the (unmounted) image prepared above
RAMPE\WINNT.SIF # text file (see below)
RamPE\I386\
RamPE\I386\NTDETECT.COM # w2k3sp1 file
RamPE\I386\SETUPLDR.BIN # w2k3sp1 file
RamPE\BOOTSECT.BIN # cd bootsector from a bartpe system
RamPE\RAMPE.IMG # the (unmounted) image prepared above
RAMPE\WINNT.SIF # text file (see below)
RamPE\I386\
RamPE\I386\NTDETECT.COM # w2k3sp1 file
RamPE\I386\SETUPLDR.BIN # w2k3sp1 file
The contents of winnt.sif is
CODE
[SetupData]
BootDevice = "ramdisk(0)"
BootPath = "\i386\System32\"
OsLoadOptions = "/noguiboot /fastdetect /minint /rdpath=RAMPE.IMG"
BootDevice = "ramdisk(0)"
BootPath = "\i386\System32\"
OsLoadOptions = "/noguiboot /fastdetect /minint /rdpath=RAMPE.IMG"
Build an iso out of this by running mkisofs with a commandline similar to next code (we assume we are running from the directory that is the parent folder of RamPE folder of step 9a)
CODE
mkisofs -iso-level 4 -force-uppercase -volid "RAMPE" -b BOOTSECT.BIN -no-emul-boot -boot-load-size 4 -hide BOOTSECT.BIN -hide boot.catalog -o "RAMPE.ISO" "RamPE"
Burn the RAMPE.ISO and test your new boot cd.
9b. Boot from a properly formatted USB stick/disk
Format your USB (flash) drive with a utility (e.g. with standard XP format, HP utility, pe2usb, ...)
(we need a drive with standard MBR calling NTLDR)
Note: For better compatibility format with FAT16
Copy in the root of the USB stick the following
CODE
NTLDR # w2k3sp1 setupldr.bin renamed to NTLDR
NTDETECT.COM # w2k3sp1 file
WINNT.SIF # text file (see below)
RAMPE.IMG # the (unmounted) image file prepared above
NTDETECT.COM # w2k3sp1 file
WINNT.SIF # text file (see below)
RAMPE.IMG # the (unmounted) image file prepared above
The contents of winnt.sif is
CODE
[SetupData]
BootDevice = "ramdisk(0)"
BootPath = "\i386\System32\"
OsLoadOptions = "/noguiboot /fastdetect /minint /rdpath=rampe.img"
BootDevice = "ramdisk(0)"
BootPath = "\i386\System32\"
OsLoadOptions = "/noguiboot /fastdetect /minint /rdpath=rampe.img"
Boot with this USB drive and test.
Hope you find this guide usefull.
Regards

