
  I think you are aware of one of the "32-bit problems" of OS/2 - it cannot
  access memory above 4Gb.

  This driver, in conjunction with QSINIT - designed to use this memory, at
  least, for RAM disk.

  Use RAMDISK command in QSINIT shell to create it.

  This disk will be visible in OS/2 like another one HDD - just add
  HD4DISK.ADD to CONFIG.SYS and put it into ?:\OS2\BOOT.

  There is one limitation - you MUST use QSINIT as boot loader, i.e., it should
  load KERNEL file directly (not via IBM or OS/4 loader with RESTART option).

  The reason - ADD driver must ask QSINIT about disk location and only QSINIT
  can manage memory tables for kernel with ram disk in mind.

  There is a chance to avoid this limitation - but if only memory above 4GB
  is used (driver just looks to the start of memory above 4GB limit - if no
  QSINIT loader found).

  By default this emulated HDD contain one primary partition, formatted with
  FAT or FAT32 (depends on size). This can be altered by RAMDISK command keys
  or manual partition creation by DMGR command.

  You can put swap file to this disk`s partition :) (with exception of FAT32,
  FAT32.IFS has no swap support).

  ADD driver works fine with Warp 3 (tested on FP43).

  You can also use ArcaOS version of HD4DISK.ADD (they are interchangeable).

  Since QSINIT rev.599 PAE RAM disk memory can be hidden - from OS/4 kernel
  for example (use HIDEMEM option).

  On some BIOS models you, even, can get a "persistent" RAM disk (if only
  memory above 4GB used). I.e., a lot of BIOS models ignore this area during
  warm reboot. Adding "PERSIST" option to the RAMDISK command give you a
  chance to recovery such disk after reboot. This option guarantees nothing,
  actualy. As example - my current PC`s BIOS clears 1Mb above 4Gb border at
  every boot - this makes it useless. But in many cases it works.

  GPT partition table can be created instead of MBR (you need GPT.FLT to
  access this disk then).

  Some examples of RAMDISK command:

  1. use all memory above 4Gb and no memory below 4Gb.
     One partition, FAT (if disk smaller 2Gb) or FAT32 with LVM letter z:

        ramdisk z:

     On a typical PC with 4Gb - 500-700Mb always moved above 4Gb, so disk
     will have such size.

        ramdisk z: hpfs

     does the same, but applies HPFS format instead of FAT. JFS can be used
     in the same way.

  2. use all memory above 4Gb, but can use 100Mb of memory below 4Gb to create
     guaranteed disk size of 100Mb. If disk size greater than 100Mb - it will
     be splitted to two partitions. 
     First is Z: FAT and second (if exist one) - Q:, FAT or FAT32 - depends on
     size.
     First partition LVM name forced to be "Vol1", second "Vol2". Volume
     label for the second partition will be "SADUMP".
     (RAMDISKNAME shell variable defines LVM names for RAMDISK command and
      RAMDISKLABEL - volume labels).

        set ramdiskname = Vol1, Vol2
        set ramdisklabel = ,SADUMP
        ramdisk min=100 z: q: div=100

  3. use no more than 500Mb of memory above 4Gb, but can use 400Mb of memory
     below 4Gb to create a guaranteed 400Mb disk size.
     Disk will have one unformatted partition with LVM letter W:

        ramdisk min=400 max=500 w: nofmt

  4. QSINIT batch file to create a 50Mb disk in memory below 4Gb with one
     logical (not primary!) FAT formatted partition W:
     It will be mounted to E: in QSINIT (mount required for FORMAT command).
     You can read help for the shell commands to understand what they do
     here:
        ramdisk /q nopt nohigh min=50
        if errorlevel 1 goto err
        dmgr pm %ramdisk% create 0 l 100%
        mount e: %ramdisk% 0
        format e: /quick /q /f:1
        lvm assign %ramdisk% 0 w: force
        echo ok!
        exit
        :err
        echo error!

  5. Create a disk of at least 200Mb with a first 100Mb FAT partition and
     a second HPFS-formatted logical partition (437 codepage).

        ramdisk /q nopt min=200
        if errorlevel 1 exit
        rem --> create partitions
        dmgr pm %ramdisk% create 0 p 100
        dmgr pm %ramdisk% create 0 l 100%
        rem --> 100mb partition
        mount f: %ramdisk% 0
        rem --> second partition
        mount g: %ramdisk% 1
        rem --> format/LVM v: first
        format f: /quick /q /f:1
        lvm assign %ramdisk% 0 v: force
        rem --> format/LVM w: second
        chcp 437
        format g: /quick /q /fs:hpfs
        lvm assign %ramdisk% 1 w: force


  Parameters accepted by HD4DISK.ADD:
      /v - print at least something ;)

      /i - do not install disk, but leave driver in memory.
           This allow to use disk memory as storage for one app at time.
           (example code in QS_SDK.ZIP\QS\system\src\usrapps\rdtest)

      /1 - use STRAT1 instead of STRAT2.
           Add this key if you are NOT using FAT32 and JFS on a RAM disk.
           (i.e. RAMDISK NOFAT32 should be used to create it).

           STRAT2 calls are designed to be more advanced for real hardware
           i/o, but add an additional delay to the RAM disk.
           
           STRAT1 is an ancient, simple and fast method - but it works only
           with FAT and HPFS file systems. Old (eCS) versions of FAT32 just
           hung the system on trying to mount and JFS is unable to mount too.

           Note that if you plan to use ramdisk for a swap file :) - STRAT1
           is **MUCH** better because in most cases it shows very high speed.

           Just try to copy any huge file from the ram disk`s volume to NUL
           in File Commander and look at transfer rate ...

      /n - disable NMI during i/o (not needed, actually)

      /h - hide disk via UF_NODASD_SUPT flag (dev.only feature)

  For more details QSINIT loader log must be on (driver prints some messages
into it).

  Note, what if you are using HPFS386 - is it better to turn off its lazy
writer for ramdisk volume in hpfs386.ini, for ex.:
      [lazywriter]
      lazy       = *: ON
      lazy       = v: OFF
  This will noticeably increase performance. But, still nothing better, than
STRAT1 mode, of course.

  And, finally, you can BOOT from PAE RAM disk :)

  There is no special menu implementation for this type of boot now and
batch file must be used. SOURCE option of BOOTOS2.EXE is the way to change
boot partition to another FAT - including PAE RAM disk.

  There is one problem: if any partition with the same LVM drive letter
exists on real HDD - system boot will fail if it will be discovered first.
To solve this, HD4DISK.ADD must be the *first* ADD driver in CONFIG.SYS -
before DANIS or AHCI.

  Boot disk creation sequence:

  1. Make OS/2 installation on FAT drive Q: (without WPS, because no EA
     support in QSINIT). Q: is example letter.

  2. Copy HD4DISK.ADD to Q:\OS2\BOOT on this installation and add

        BASEDEV=HD4DISK.ADD

     to CONFIG.SYS of it.

  3. Pack entire system to FATOS2.ZIP (example name).

  4. Make QSINIT boot disk (flash drive, for example). This can be FAT, FAT32
     or, even exFAT partition, big floppy and so on... CD-ROM boot is also
     supported. It is no need for OS/2 to have access to this device at the
     boot stage - only BIOS must able to boot from it.

     Run tool\instboot.cmd from QS_LDR.ZIP to make it bootable in OS/2
     or Windows.

  5. Copy your ZIP file to the root of this disk.

  6. Create QSSETUP.CMD (example contents) in this root:

     rem create FAT ramdisk with max 1900Mb and guaranteed 100Mb size
     rem and Q: LVM drive letter
     RAMDISK Q: min=100 max=1900
     rem ramdisk mounted to the first available QSINIT drive letter, this will
     rem be C:, so unzip ZIP to drive C:
     echo unzipping...
     unzip /q /boot FATOS2.ZIP c:\
     rem launch OS2KRNL from the root of RAM disk
     bootos2 os2krnl source=c

     Note, that SOURCE option in bootos2 has support for autodetection of PAE
     ram disk`s volume letter. Just use @ symbol instead of drive letter
     (i.e. "bootos2 os2krnl source=@").

  7. Boot from this device.

  8. The same process can be used for PXE boot (with PXEOS4).
     Just put QSSETUP.CMD and FATOS2.ZIP to TFTP dir for this PC. 

     On gigabit network it takes 10 seconds to download 30Mb zip with tiny
     OS/2 installation.

     CD-ROM boot in non-emulation mode looks identical: put well known files
     into the root of CD disk, select cdboot\cdboot.bin as a boot code,
     burn it and boot it.

  9. Menus can be used in the same way as on normal boot: put qsinit.ini to
     the root of disk with ZIP file and fill it with kernel options. Only one
     difference here - "source=c" (or "source=@") must be added into [CONFIG]
     section or appended to options in every line of [kernel] section.
     Remove "bootos2" line from the batch file above, add
        set start_menu = bootos2
     and go.

 10. The memory requirements for booting from a RAM disk are really low.
     I created a tiny bootable CD with a 15Mb zip archive that requires at
     least 32Mb RAM disk, and it ran on my HP Vectra PPro with 64MB RAM.
