
  =======================================================================
   1. About.
  -----------------------------------------------------------------------

   QSINIT is a some kind of boot loader ;) Basically it loads OS/2 kernel ;)
but it's suitable for many other things like playing tetris or implementing
a disk editor at boot time.

   The basic idea is something like a small 32-bit DOS with its own runtime
and modules. This "system" can work in both single-tasking and multi-tasking
mode.

   As a standalone package, QSINIT can be loaded from FAT16/32/exFAT/ISO9660
and used as a runtime with direct access to hardware (for example) or for other
service purposes.

   The EFI version starts as a regular EFI application from the system EFI
partition.

   Everything below is just a poor attempt at being documentation.
   It`s better to type HELP in QSINIT.

  =======================================================================
   2. Installation.
  -----------------------------------------------------------------------

 * rename original IBM OS2LDR to OS2LDR.OLD (for example). You can add it into
   loader menu as one of options (with RESTART key).

 * put OS2LDR and QSINIT.LDI to the root of boot drive.

 * QSINIT can be configured via configuration file (qsinit.ini). A full list
   of options is provided at the end of this file (section 12).
 
   So, create QSINIT.INI in the root, for example:
    [config]
    default=1
    timeout=4
    [kernel]
    os2krnl=Default boot
    os2krnl=Show driver names, ALTF2
    OS2LDR.OLD=Original boot, RESTART

 * reboot ;)


   2.1 Single mode installation
  ------------------------------

   QSINIT can be installed to FAT/FAT32/exFAT partition without OS/2.

   Use tool\instboot.cmd in Windows or OS/2 to install QSINIT bootsector and
modules to the selected disk volume.

   QSINIT.INI (in the root) can be created in the same way (for various
[config] section options, see full ref at the end of this text).

   And then add this volume in your boot manager bootables :)

   Install is also available in QSINIT shell, but named "sys". Mount any FAT
or exFAT partition via "mount" command and use it. Even simpler - in the
"Disk Management" in SysView - "Install QSINIT".

   Boot from a "big floppy" sticks is also possible.

   Loading from CD/DVD in "no emulation" mode is supported only for QSINIT
itself, further process is not supported by the OS/2 system.


   2.1.1 Using as a simple boot manager
  --------------------------------------

   The same as previous mode, but you can create a list of partitions to
boot from and force it as an "initial menu".

   Fill QSINIT.INI/OS2LDR.INI in the same manner:
    [config]
    default_partition=2
    timeout=4

    [partition]
    hd0/1 = Boot DOS/XP
    hd0/8 = eCS 2.0
    hd0/7 = Suse 12.3

   The step below is not required if you have no the "kernel" section in INI:
create QSSETUP.CMD in the root of the QSINIT boot partition and add a line
    set start_menu = bootpart

   Reboot - the "partition" menu be shown :)


   2.1.2 Using as UEFI boot manager
  ----------------------------------

   EFI version supports a simple menu with UEFI boot module selection, in
the same manner. Prepare QSINIT.INI (an example, module parameters can be
added after double-comma in the line):
    [config]
    default_efiboot=2
    timeout=10

    [efiboot]
    \efi\boot\win.efi   = WinX
    \efi\os2\aosldr.efi = ArcaOS,,F:
    shell.efi           = EFI Shell, NOMTRR

    Put QSINIT and QSINIT.INI to the UEFI system volume (QSINIT.EFI as
\EFI\BOOT\BOOTX64.EFI and both QSINIT.LDI and QSINIT.INI in \EFI\BOOT) and go.


   2.2 Quick test in any VM
  --------------------------
   Run tool\instimg.cmd with parameters and create a diskette or a small hard
disk image with FAT and written QSINIT.

   Mounting it in VM, boot, contemplate ... ;)


  =======================================================================
   3. Details.
  -----------------------------------------------------------------------

   Package contain two parts: basic loader (OS2LDR in the BIOS hosted version
and EFI executable for UEFI) and zip archive with apps and data (QSINIT.LDI,
common for both versions). At init this archive unpacked to a virtual "system"
volume in memory (for self use only, this memory will be available for OS/2).

   Execution mode determined by presence of OS2BOOT in the root of the boot
drive (it`s always here on bootable OS/2 volumes).

   In OS/2 mode QSINIT starts OS/2 boot after a small pause (by default).
   If QSINIT.INI file exists in the root - the menu with additional options
will be shown.
   In single mode - QSINIT apps menu will be opened immediately.

   Start process can be customized by creating QSSETUP.CMD in the root of the
boot volume - it will be called at the end of QSINIT initialization.

   Shell is incomplete now (no complete input/output redirections and so on;
just remember - this is not a BIG OS).

   Some available features (just as examples):
   * "sysview" app includes text & binary file editors, log viewer, disk
     management dialog, memory editor, sector-based physical disk editor,
     calculator and other options.

     It plays a GUI role, actually :)

   * "bootos2" - is an application that launches OS/2 :)
     Just type in the shell command line:
         bootos2 os2krnl

     Naturally you should not do this, boot menu executing it internally.

   * kernel options setup dialog is available from the kernel menu by pressing
     RIGHT key. It allow to change most of QSINIT.INI options for selected
     kernel.

   * "mount" command allows mounting of any FAT16/FAT32/exFAT partition to
     QSINIT and reading/writing it.
     HPFS and JFS are available to mount too, but with read-only access.

     ISOFS is also available, but mainly for ISO images since BIOSes that
     correctly show CD/DVD are extremly rare. But at least at CD/DVD boot this
     disk should be visible as A: (except cases with the very broken BIOS).

   * during PXE boot files can be copied from TFTP server to the local
     mounted partitions (only with PXEOS4 package, see below):
        copy /boot file_on_tftp local_name 
     or unzipped:
        unzip /boot rev_arch.zip c:\temp

   * "help" in the shell is quite complete and up-to-date. Full command
     reference is available only there.

   * and how to play tetris? Browse the QSINIT apps menu, or type "tetris"
     in the shell :)

   * "format" command can be used to format partition to FAT16/32/exFAT, HPFS
     or JFS. FAT16/32 type selected automatically (by the disk size), but you
     can vary cluster size (with including not supported by OS/2 64k FAT
     cluster).

     Mount partition to QSINIT before format it.

     All FAT structures will be aligned to 4k (for Advanced Format HDDs).
     This can be turned off by /noaf key.

     HPFS format requires a code page (by default 850 is set, but it can be
     selected in "chcp" command from a short list of available in QSINIT).

   * possibility of launching a boot sector from any partition.

     See boot.cmd or the Disk Management dialog in SysView.
     "Boot any partition" in the "Reboot" submenu is even easier.

     Note: all of such boot types starts with A20 gate opened. Any modern
     system works fine with it, only old versions of DOS himem.sys can hang.

   * "dmgr pm" command allow to create and delete both primary and logical
     partitions. The same options available from Disk Management dialog in
     SysView app.

     Partitions will be created in OS/2 LVM geometry if it present on this
     disk.

     GPT partition table is supported by this command too. Additional
     command "gpt" provide a special functions for it.

   * "dmgr clone" command can clone partition structure and data to another
     disk.
     It knows nothing about file systems, but simple copying can be done
     without changes in any file system.

     In case of FAT/exFAT/HPFS/JFS QSINIT updates boot sector of a target
     partition after cloning (set information about new volume location).

   * "lvm" command can change OS/2 LVM drive letters, write LVM signatures
     to disk and some misc.

     Useful example is "lvm query", which can search partition by LVM text
     name and save its disk name and index into environment variables:

       lvm query "[F32_PT1]" ft_disk ft_index
       mount c: %ft_disk% %ft_index%

   * sector-level cache is available, QSINIT loads it at any "mount" command.
     Caching is non-destructive (read-ahead only) and significantly speeds
     up FAT access.

     HPFS, JFS an ISO-9660 use file-level cache as well.

   * to copy "large amount of data" use xcopy.cmd in the shell ;)
     Since it works with unicode names, even names with unsupported national
     characters can be copied without problems.

   * "chcp" command can be used to select the code page for file operations
     (single byte only, no DBCS now, sorry). Without a selected code page,
     any names with national language letters will not be available (except
     for commands that can accept UTF-8).

     note: this command only makes these names operable, not displayable.

   * "mem hide" command can be used to hide memory ranges from OS/2.

   * "vhdd" command supports mounting of fixed size VHD, ISO and plain binary
     disk images.
     An example what you can do with binary file mounting:
       - get Arca OS UEFI boot ISO, open it in the binary file editor in
         sysview and search string MSDOS5.0 (FAT boot sector signature).
       - remember offset of this line, for example 1CA1800 
       - type 
             vhdd mount iso_file_path offset=0x1CA1800
         and then mount this new disk as a big floppy (in the disk
         management in SysView).
       - full access is available to the FAT image of the UEFI boot
         partition, used to boot from this ISO.

   * look for more in the section 5 below.

   QSINIT can be loaded by "WorkSpace On-Demand" PXE loader, but further
loading process is untested.

   And a note about QSINIT disk naming ...
   There are A:..Z: drive letters in QSINIT, A:-J: can also be named as
0:-9:, shell accepts both variants, SysView (based on Turbo Vision library) -
accepts only A:-Z:.

   Virtual disk with QSINIT apps and data is always mapped as drive B:/1:

   On FAT/FAT32/exFAT boot - boot partition is available as drive A:/0: and
you can modify it freely (edit files, copy them in shell and so on...). With
one exception - in UEFI version it mounted as r/o, because this is UEFI
service partition and access to it is shared with UEFI firmware.

   HPFS, JFS and ISOFS volumes are also supported, but read-only.

   Other drive letters (C:-Z:) are free to mount any FAT/FAT32/exFAT/HPFS/JFS
partitions or CD/DVD/image with ISO9660.

   For unknown file system types mount is possible as well, but for access
on a sector i/o level only, for example - to show partition`s BPB:

      dmgr bs c: bpb

  =======================================================================
   4. Additional customization.
  -----------------------------------------------------------------------

   4.1 Boot menu 
  ---------------

   Boot  menu  can be altered by editing menu.ini file inside of QSINIT.LDI
archive.  Location  of  this  file  can  be  overloaded by menu_source env.
variable
      set menu_source = A:\OS2\menu.ini

   Or menu can be copied from the root of the boot disk - via qssetup.cmd
      copy /boot menu.ini b:\menu.ini

   4.2 Switching to simple "boot manager" mode.
  ----------------------------------------------

   By adding this line into qssetup.cmd:
      
      set start_menu = bootpart

   you  can  switch  QSINIT to some kind of boot manager. This setting will
select as initial menu list of partitions, defined in "[partition]" section
of QSINIT.INI file (see notes below).

   4.3 Graphic console.
  ----------------------

   It is possible to use "graphic console" (console emulation in vesa modes).

      mode con list
     
   will show list of available modes.
   To set mode use

      mode con cols=x lines=y
      mode x,y
   or
      mode con id=mode_id

   Maximum monitor resolution can be specified by adding an environment string
into qssetup.cmd, for example (DDC is not used now):

      set vesa = on, maxw=1024, maxh=768

   QSINIT can be instructed to not touch VESA at all by the same option in
qssetup.cmd:

      set vesa = off

   (this will break VMTRR too, because it queries video memory address in it).

   "Graphic console" is much faster if you turn on write combining.

   Common syntax of this setup string is:
     set vesa = on/off [, maxw=..] [, maxh=..] [, nofb][, fbaddr=hex]

   NOFB parameter disable using of video memory linear frame pointer. This
causes the old method of bank switching in VESA and using the EFI graphics
functions in the EFI version. FBADDR affects EFI version only and forces the
video memory address to this value.

   It is possible to use own fonts (binary file with 1 bit per pixel - i.e.
8x16 x 256 chars will be 1 byte (8 bits) x 16 x 256 = 4096 bytes). Every
added font will add a number of graphic console modes (one for every available
graphic mode).

   Note, that supplied with QSINIT 10x20 & 8x14 fonts have 866 codepage and
9x19 - 850.

   4.4 Serial port console.
  --------------------------

   QSINIT supports serial port console (fixed to be 80x25 now).

   Use "SM VADD" command to add 16550-compatible COM port as a new console
device and then "SM ATTACH" to attach it to any active session (single session
in default QSINIT mode and any running session(s) in MT (multithread) mode).

   QSINIT simulates ANSI/VT100 terminal and should work fine with most of
terminal programs.

   Ctrl-Alt-F1 hotkey will switch current debug serial port into the such
console and attach current on-screen session to it (if it works in 80x25),
pressing it again will return log output back.

   Via SM command you can set up a real multi-terminal environment, where
each session will have own console (default display and several serial port
connections).

   4.5 Size of QSINIT.LDI file.
  ------------------------------

   Some modules can be removed from QSINIT.LDI archive without affecting
base functionality (when it must fit into diskette image for CD boot, for
example).
   cache.dll   - sector-level cache, used only for caching of FAT volumes
                 (if cruel life forces you to use QSINIT as a copy utility ;)
   cplib.dll   - CHCP command, this module provides code page support
   fsfat.dll   - FAT/exFAT support
   fslib.dll   - HPFS/JFS/ISOFS r/o support
   help.dll    - help support (it`s a bad idea to delete this ;))
   vdisk.dll   - PAE ramdisk
   vhdd.dll    - VHDD (disk image support - ISO, VHD)
   mtlib.dll   - threads, sessions (see below, not required for OS/2 boot)
   console.dll - graphic console, "mode con" command and graphic memory
                 information (required for VMTRR)
   partmgr.dll - disk management (MBR/GPT) support. Creating partitions,
                 deleting, mounting. This is a more critical thing, but still
                 not mandatory to have.
   extcmd.dll  - some additional shell/system functionality: MEM, MTRR, LOG,
                 PCI, PS, MD5, SETINI, SETKEY, BLDLEVEL, COMP shell commands
                 and VT100 console support. It`s also good, but not necessary
                 to have it.
   imglib.dll  - png/gif viewer
   zlib.dll    - zlib, needed only for imglib.dll

   The files msg\extcmd.ini and msg\msg.ini are also good to preserve.

   FNT files in MSG dir - custom fonts for graphic console (both in 866
codepage) - required for EFI build, basically (where own EFI console`s speed
is a nightmare). Also provide a lot of graphic console modes, selectable in
QSINIT menu.

   Also, you can remove games, of course... Finally, only things you need to
boot OS/2 is BOOTMENU.EXE, MENU.INI, BOOTOS2.EXE, START.* and files in OS2BOOT
directory.

   4.6 ArcaOS loader OS2LDR.CFG file.
  ------------------------------------

   QSINIT supports Arca OS loader configuration file. This file is used, at
least for HIDEMEM, MEMLIMIT, LOGSIZE, DBCARD, DB(G)PORT, RAMDISKNAME,
ACPIRESET, DUMP_SEARCH and RAMDISK options.
   But own QSINIT settings have a priority above options, listed above.

   This means that the QSINIT.INI setting will override the LOGSIZE value.
   
   MEMLIMIT will only be used if it is less than the limit found during QSINIT
processing - from QSINIT.INI or a rare cut of a small part of the 4th Gb (by
VMTRR).

   RAMDISK, RAMDISKNAME and RAMDISKLABEL keys will affect only if NO ramdisk
present (i.e. no RAMDISK command was used in qssetup.cmd).

   The DBCARD or DBPORT options will be used if the debug COM port is not
used (i.e. QSINIT.INI does not define it).

   To remove OS2DLR.CFG processing just delete AOSCFG.EXE from the QSINIT.LDI
archive.


  =======================================================================
   5. Several unobvious features.
  -----------------------------------------------------------------------

   5.1 MTRR registers setup.
  ---------------------------

   "mtrr" command allow to edit MTRR registers directly. You must be very
familiar with Intel architecture to do this ;) Edited values will be used
for OS/2 (including SMP) - by default or you may drop it by "mtrr reset"
command or NOMTRR qsinit.ini key.

   You can add mtrr setup into qssetup.cmd, for example (see above).

   Or you can use vmtrr utilite - it try do detect video memory size and
setup Write Combine automatically. Call it from settings menu or add "vmtrr"
string into qssetup.cmd.

   Single note: QSINIT must be used to load kernel file after VMTRR or MTRR
setup - else it leave "Write Combine" for 1st CPU only. It must catch other
CPUs start and setup MTRR registers in the same way - but can do this only
if it "main loader" (i.e. not launcher of another loader via RESTART option).

   Write Combine can be set for text mode video memory too, but only on AMD
cards (Intel and NV go crazy on this ;)). Command is:

      mtrr fixed 0xB8000 0x8000 WC

   5.2 Boot partition changing.
  ------------------------------

   One of non-obvious features is on-fly boot partition changing, without
booting from a boot sector.

   Default HPFS boot sector code depends on OS/2 MBR code or VPart/AirBoot.
If both is absent - it can fail. In this case such emergency way can be used.

   At first, mount partition to QSINIT drive letter (ex. D:), then type in
   shell:

      bootos2 os2krnl source=d

   and system will start from this partition, without use of boot sector code.

   This mean that you can load QSINIT from flash drive with FAT32 and then
switch boot to HPFS/JFS partition on HDD, for example.

   This function is also available in the Disk Management in SysView under the
"Boot OS/2" label (in partition actions).

   5.3 "Dirty" flag.
  -------------------

   "dmgr" command has an ability to set/reset "dirty" flag on HPFS and FAT
partitions. For example, command
        dmgr bs a: dirty on

    will force CHKDSK on current boot volume during system startup.

    It looks like Windows is ignoring dirty flag on exFAT now and supports
it only on FAT/FAT32.

   5.4 Loading iPXE.
  -------------------

   (iPXE is Open Source Network Boot Firmware - http://ipxe.org)
   Just pack ipxe.pxe (or undionly.kpxe) in QSINIT.LDI and use command
        restart /raw ipxe.pxe

   to start the iPXE code.

   5.5 "Kernel browser".
  -----------------------

   "IMPORT" button inside of kernel options dialog (invoked by "right" key
in the kernel selection menu) - will launch the "kernel browser". To use
this feature you should pack some kernels in REV_ARCH.ZIP file and put it
in the root of the boot drive. This ZIP will be loaded by pressing "IMPORT"
button and any file in it can be selected as kernel for current boot.

   ZIP file name can be overridden by REV_ARCH_PATH environment variable
(set REV_ARCH_PATH = ... in qssetup.cmd).

  =======================================================================
   6. Documented bugs (aka features).
  -----------------------------------------------------------------------

 * accidental loading a binary file into SysView text editor may cause a
   panic (because of reaching 16k characters per line limit). This is
   limitation of Turbo Vision library.

 * using VMs to test QSINIT.
   VPC & Vbox works, in most cases, with some exceptions:

    - no PAE paging mode in VPC. Hardware virtualization must be off too -
      it kills host OS in seconds, at least with VPC 2007 + AMD.

    - 8, 12, 13 exceptions stops VPC VM (because of task gates used).
      Add "NOTASK=1" to QSINIT.INI to disable task gates in this case.

    - VBox is much better, except PAE paging mode - it looks unstable
      (at least in VBox 4.x).

    - in some VBox 5.x versions QSINIT hangs on start into INT 4 interrupt.
      This is VBox bug in CPU _into_ command processing, just update QSINIT.

    - EFI version works in QEMU (with TianoCore), with possible small bugs
      (CPU _xlat_ command looks broken when 64-bit mode is on).

    - in VBox make sure, that 64-bit EFI firmware is launched. OS selection
      for UEFI version should be "Other" + "Unknown 64 bit".

    - Ctrl-Ins doesn`t work in VBox, use Ctrl-C in the shell.

 * note, that huge USB HDDs can be non-operable via BIOS, especially on old
   motherboards. Only a starting part of the disk can be accesible, up to
   128Gb, with garbage returned above this point. Looks like all ASUS MBs
   prior to EFI have this bug.

 * some ugly BIOS coders (HP laptops, for example) do not return the disk size
   information at all. This should not affect to OS/2 boot, but using this
   disk in QSINIT is impossible until disk size detection.

   "Detect size" option available in Disk Management dialog in SysView as well
   as "dmgr mode" command is able to set number of sectors directly.

 * if old BIOS returns zeroed high dword of disk size (i.e. 700Gb instead of
   2700Gb) and disk has GPT inside, then size can be fixed automatically.

 * pressing LEFT SHIFT key during load will cause skipping of QSSETUP.CMD and
   direct start of QSINIT shell (cmd.exe). This is some kind of safe mode
   which allows to ignore additional processing (like MTRR setup) - if this
   processing stops QSINIT boot.

   Debug COM port output is off in this mode.

   [[Loading]] message should be red in this mode. If it is green, then you
   have missed and/or too slow :)

 * F10 key in the start menu resets console mode to default 80x25 in the BIOS
   hosted version and default console in the UEFI version.

  =======================================================================
   7. QSINIT boot details.
  -----------------------------------------------------------------------

   QSINIT can be loaded:

   * via OS/2 boot FSD mechanism - i.e. QSINIT loader looks like OS2LDR for
     micro-FSD code.
     OS2LDR and QSINIT.LDI should be placed just to the root of boot volume.

   * via OS/2 PXE boot - the same.
     Files OS2LDR and QSINIT.LDI must be accessed from TFTP.

   * from FAT12/FAT16/FAT32/exFAT - by using OWN boot sector. Boot sector can
     be installed by tool\bootset? command.
     Boot sector assumes QSINIT file name for base loader (not OS2LDR as in
     FSD mechanism).

     I.e. files QSINIT and QSINIT.LDI must be in the root of boot disk.

     FAT boot should work anywhere - HDD/floppy/sticks, really ;)

   * from CD/DVD in "no-emulation" mode. In this case bootstrap code of
     CD disk is a micro-FSD. Look into CDBOOT directory for the details.

   QSINIT provides own MBR code both for MBR and GPT partition tables. It is
optional and can be installed to empty disk, for example, or in emergency
case.

   Common MBR code have no differences with other ones. It loads active
partition and launch it.
   In addition - it have special Boot Manager support (as OS/2 MBR).

   MBR code for GPT disks searches for 1st partition with "BIOS Bootable"
attribute ON (google UEFI Wiki about it) and then launches it. It should work
for any partition, _started_ below 2Tb border. If partition starts above 2Tb -
only exFAT able to boot from it.

   You can set "BIOS Bootable" attribute via "gpt" command or "sysview" app.

   With GPT.FLT in CONFIG.SYS it is possible to boot OS/2 from a GPT disk.

   An example - how to create a "dual boot" stick:
   * init an empty stick to GPT in the "Disk Managment" in SysView
   * create two partitions (small and big) and set type of the first
     to "EFI boot"
   * format first to FAT/FAT32, second to FAT/FAT32/exFAT
   * copy an EFI boot module to the first - named \EFI\BOOT\BOOTX64.EFI
     (something you like - EFI shell, EFI version of QSINIT, etc)
   * set up second as QSINIT boot partition: set "BIOS Bootable" attribute
     (just make it "Active" in the "Disk Managment") and install QSINIT to it)
   * then you can select in the EFI BIOS boot menu: "YOUR DRIVE" or 
     "UEFI: YOUR DRIVE", 1st will be QSINIT and 2nd - EFI boot.
   * in EFI boot mode EFI system partition is r/o by default, so if you want
     to write something to the stick - mount the second (big) partition.

   QSINIT provides own code for FAT/FAT32/exFAT/HPFS boot record. This code
is independent of Boot Manager and OS/2 MBR. You can install it on any
partition by mounting it in QSINIT and then use "dmgr bs" command in shell
(or just use the "Disk Management" menu in SysView).

   There is the same code for JFS, but CHKDSK will reset it back on a first
launch. Moreover, older versions of CHKDSK only restore half of this code,
resulting in a broken boot. So, it can only be used in emergency cases.

   You can learn MBR/boot sector code details in 
      \QS\system\src\ldrapps\partmgr\se.asm
   CD:
      \QS\system\src\tools\src\cdboot\cdboot.asm
   HPFS:
      \QS\system\src\ldrapps\partmgr\hpfs\boot.asm
   JFS:
      \QS\system\src\ldrapps\partmgr\jfs\jfsboot.asm
      \QS\system\src\ldrapps\partmgr\jfs\jfsmicro.c

   in QS_SDK.ZIP.

   It`s funny, but FAT bootsector code is able to launch Windows XP NTLDR.
This is the legacy of time, when MS & IBM were friends.

  =======================================================================
   8. Log.
  -----------------------------------------------------------------------

   You can send me QSINIT log in case of repeatable troubles ;)
   Log can be saved in some different ways:

     * via COM port cable (DBPORT/DBCARD options in QSINIT.INI)

     * by adding LOGLEVEL option into QSINIT.INI (see below). In this case
       QSINIT log will be merged with the kernel log and can be accessed via:
         copy oemhlp$ logfile.txt  - without ACPI.PSD
         copy ___hlp$ logfile.txt  - with ACPI.PSD
       This case is NOT working if RESTART option was used for kernel loading
       (i.e. another OS2LDR is running).

     * mount any available FAT16/FAT32/exFAT partition to QSINIT and save
       log directly to it. This can be done in SysView app or by using LOG
       shell command.

   If you get a QSINIT trap and the PC or VM has COM1 or COM2 but debug
   logging is not enabled, press Alt-1 or Alt-2 in the trap screen and then
   some dump hotkeys like Ctrl-Alt-F5, Ctrl-Alt-F11, and Ctrl-Alt-F12 and
   send me all that output.
       
  =======================================================================
   9. PAE ram disk (hd4disk.add basedev driver).
  -----------------------------------------------------------------------

   QSINIT can use memory above 4GB border (unlike OS/2 kernel :)).

   RAMDISK  command  in  shell  create  virtual ram disk in this memory (or
memory below 4GB - if specified so). Type RAMDISK /? for help.

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

   There is one limitation - you MUST use QSINIT as a boot loader, i.e. load
the kernel with it, not by any other loader (via RESTART option).
   The reason - ADD driver must ask QSINIT about disk location.

   By default this HDD contain one primary partition, formatted with FAT or
FAT32 (depends on size). You can format it to HPFS/JFS too. Variants available
via RAMDISK command keys or manual partition creation by DMGR command.

   You can put swap file to this disk :)

   For example, add to QSSETUP.CMD:

       ramdisk /q nohigh min=500 z:

   This  command  will quietly create 500Mb HDD in memory below 4Gb and set
Z: LVM drive letter to it.

   Read more in ramdisk\paedisk.txt.

   If you already using HD4DISK.ADD prior to rev.309 (Nov.2014) - it`s better
to update it to the latest version.

  =======================================================================
  10. Multithreading.
  -----------------------------------------------------------------------
   Latest QSINIT revisions have thread support inside :)
   
   By default, this mode is OFF and QSINIT still an old good single-thread
DOS-like environment.

   "Mode sys mt" command, API call or Ctrl-Esc press (task list invocation)
will  switch it to more OS-like mode, where threads and screen sessions are
available.  START,  STOP and DETACH shell commands will also turn this mode
on use.

   To  loop  sessions use Alt-Esc key (Ctrl-N in serial port console), task
list available via Ctrl-Esc (Ctrl-B).

   START command is a new session launch, STOP - process kill and DETACH -
a kind of OS/2 command analogue, still useful for long actions, like copying
of a huge zip from TFTP server (PXE boot):

     detach copy /boot /beep huge_file_via_pxe.zip c:\

   Another one advancement is "hlt" during idle time, i.e. QSINIT in MT mode
should make PC more quiet and peaceful ;)

   Most of QSINIT code is thread safe now.

   Multithreading   is  far  from  ideal.  For  example,  long  file  write
operations  can  cause  huge delays for other threads, but, hey!! - this is
not a premium desktop OS and it uses BIOS as a driver layer!
   At  least,  you  can play tetris while second session searches data on a
huge HDD (in SysView) - this is real.

   Additional setup is available, by SET string in qssetup.cmd:

     set mtlib = on/off [,noapic] [, timeres=..]
     set kbres = value

   where OFF parameter will disable MT mode at all, TIMERES set thread "tick"
time, in milliseconds (default is 16 (4 in EFI build)) and KBRES is keyboard
polling period (default is 18 ms (8 in EFI)).

   NOAPIC forces to use inaccurate system timer (irq 0) instead of APIC.
Anyway, this is still enough for QSINIT lazy multitasking.

   Shell command execution can be terminated by Ctrl-C in MT mode.

   Another unobvious feature is that all QSINIT Ctrl-Alt-Fx hotkeys (various
dumps) start to react at any time (not only during key waiting).

  =======================================================================
  11. Supported kernels
  -----------------------------------------------------------------------
   Warp  3  and Merlin (up to FP12) kernels can be loaded as well as Aurora
type  kernels.  Memory for such kernels is limited to 1Gb (if anybody knows
real  limit  -  please, tell me ;) Warp Server SMP kernel is not supported.
This is possible, but who need it? (Just ask me, if you really want it).

   Kernel type is determined automatically.

   OS/4 kernel is partially supported.

  =======================================================================
  12. QSINIT.INI options
  -----------------------------------------------------------------------

   QSINIT.INI file format is compatible with OS/4 ini file (OS2LDR.INI).
If QSINIT.INI is missing, the loader will try to use OS2LDR.INI.
   
   File format:
      [config]
      ; default kernel index (1..x) for kernel menu ([kernel] section below)
      default=1
      ; default index (1..x) for partition boot menu
      default_partition = 4
      ; default index (1..x) for efi boot menu
      default_efiboot = 3
      ; timeout, in sec - to wait before default item will be started
      timeout=4
   
      ; common options
      dbport=0x3F8
      ...
   
      [kernel]
      <kernel file name> = menu string [, option, option ...]
      ...
      OS2KRNL = Common boot
      OS2KRNL = Common boot with Alt-F2, ALTF2
   
      [partition]
      disk/partition [, boot sector file] = menu string [, option, option ...]
      ...
      hd0/0 = Boot 1st partition of disk 0
      hd0/0,bootsect.dos = The same but use bootsect.dos file as a boot sector
      hd1/1 = Boot 2nd partition of disk 1
      hd2   = Boot MBR of disk 2 (with MTRR reset), nomtrr

      [efiboot]
      \efi\boot\win.efi   = WinX
      shell.efi           = EFI Shell, NOMTRR
      \efi\os2\aosldr.efi = ArcaOS,,F:
      b:\shell.efi        = EFI Shell, NOMTRR

      [colors]
      ; override color schemes for the default dialog and list boxes
      ; value format (8 bytes from high to low):
      ; 00
      ; edit line
      ; high 4 bits - selected button ~hotkey, low 4 - normal button ~hotkey
      ; high 4 bits - button shadow, low - ~hotkey in a common text
      ; selected button
      ; normal button
      ; common text
      ; box color
      ;
      ; MSG_* strings: * is any color from MSGBOX command
      MSG_WHITE = 0xFEE0EAE7FF1F9

      ; comments supported only on 1st position of the line
      
   The "[partition]" section defines a list of partitions available to boot
and accessible from "Boot partition" menu in QSINIT. This menu will also be
selected as default if there is no [kernel] section.

   Partition indexes for "[partition]" can be queried by pressing F7 in menu.
   Boot sector file can be specified by direct QSINIT path or will be searched
in the root of this partition (any FAT type).

   TIMEOUT and USEBEEP parameters affect [partition] menu too (timeout counter
occurs during first launch only).
   Options for boot partition menu can be added to menu line only. Only two
of them are supported now: CPUCLOCK and NOMTRR.

   The [efiboot] section defines the boot menu for UEFI-hosted QSINIT. This is
a list of UEFI modules to run. It is also possible to add options (currently
only one is NOMTRR), anything after ,, (double comma) is assumed to be the
arguments for the UEFI application.

   Note that by default the files are looked for in the boot (UEFI system)
volume and the missing full path (starting with \) is equal to the starting
directory (\EFI\BOOT by default). The menu will also try to find a file
without a path in the root of the QSINIT volume B:, direct QSINIT path
is also supported.

   As well as the [partition] menu is supported only in BIOS hosted version,
the [efiboot] menu only works in UEFI mode.

   Alphabetical list of QSINIT.INI options:

 * ALTE      - (OS/4) invoke embedded config.sys editor during kernel startup.

 * ALTF1..ALTF5 - simulate Alt-F1..Alt-F5 keypress for the kernel.

 * BAUDRATE  - debug COM port baud rate (115200 by default). BAUDRATE in 
               "config" section affects both QSINIT and OS/2 kernel, in
               the kernel options - this kernel (menu line) only. 
               Supported values: 150,300,600,1200,2400,4800,9600,19200,38400,
               57600 and 115200.

 * BINNAME=name - alternative name for QSINIT.LDI (only short name on FAT/
               FAT32).

 * BOOTMOUNT=... - defines how to handle the boot volume in QSINIT. NO
               disables mounting QSINIT filesystem for it, YES - default
               mode, RO - forces boot volume to be read-only on sector i/o
               level (also for a filesystem), RW - forces boot volume to be
               writable (UEFI case where writing to the UEFI system volume
               is disabled by default because it is shared with UEFI firmware
               and direct writing can be dangerous).

               This key ignored in safe mode.

 * CALL=batch_file - call QSINIT batch file just before starting the kernel.
               "batch_file" must be a fully qualified path in QSINIT!
               I.e. A:\BATCH.CMD (boot disk), or C:\dir1\batch.cmd (from a
               mounted volume). VIEWMEM (if specified) will be called after
               this batch file and then kernel will be launched.

               At this moment kernel is loaded at final memory location, but
               QSINIT still fully functional. This is possible because QSINIT
               never touches kernel memory areas.

               This option can be used on FAT partitions to swap UNI/SMP
               doscalls versions, for example.

 * CFGEXT=EXT - use CONFIG.EXT file instead of CONFIG.SYS. File must be placed
               in the root directory. EXT - extension, up to 3 chars.

 * CPUCLOCK=1..16 - setup clock modulation on Intel CPUs. 1 = 6.25% of speed,
               16 = 100%. On middle aged processors actual step is 12.5% (it
               will be rounded automatically).

               Clock modulation available on P4 and later CPUs. It can be
               used to slow down DOS, launched from the partition menu, for
               example. With 12.5% on 3100 MHz Core Duo it shows ~400-600 Mhz
               in DOS performance tests. This can be useful for some old
               games, at least.

               Or you can look how badly you optimized your software code,
               when boot OS/2 at 1/6 of the default speed.

               This key works both in OS/2 boot and partition menu.

 * CTRLC=1   - (OS/4>=2970) enable Ctrl-C check for the kernel debugger.
               This options slows down the system reasonably. It forces
               kernel debugger to check for incoming Ctrl-C via serial
               port periodically.

 * CTRLN=1   - use Ctrl-N for session switching (in addition to Alt-Esc) and
               Ctrl-B for the task list (in addition to Ctrl-Esc). By default,
               they are only available in the serial console.
               Usable in QEMU, for example.

 * DBCARD = bus.slot.func,port_index  or
   DBCARD = vendor:device,[index,]port_index - query address of PCI COM port
               (specified "port_index" in it) and use it as debug COM port.
               In addition, this command will enable device i/o if it turned
               off by BIOS or UEFI.
               
               Optional "index" (1..x) can be used if the serial port adapter
               is mapped on multiple functions or you have two or more adapters
               with the same vendor:device ID.

               port_index - index of connection port in the list of card
               address ranges. It looks like this (in PCI.EXE output):
                   Address 0 is an I/O Port : 0000EC00h
                   Address 1 is an I/O Port : 0000E880h
                   Address 2 is an I/O Port : 0000E800h
               But value is 1-based here.

               Example:
                  we have NetMos 9710:9835 on 4.2.0:

               DBCARD=9710:9835,3         <- port E800h
               DBCARD=4.2.0,2             <- port E880h

 * DBPORT=addr - debug COM port address. Dec or 0xHEX value.
               This option turns COM port ON earlier, than DBCARD, but DBCARD
               is less dependent on PCI configuration changes.

 * DEFMSG    - use OS2LDR.MSG file instead of embedded messages.

 * FULLCABLE=1 - use hardware flow control for the COM port cable (requires
               full cable, off by default).

 * ININAME=name - (QSINIT>=594) use another QSINIT.INI. Works only in RESTART
               menu line. The file is first looked for in the root of the boot
               volume (if the full path is not supplied).

 * LETTER=X  - allow to change boot drive letter for OS/2.
               This option only changes letter for later boot, not partition.

               Wrong letter sometimes can be supplied by Boot Manager or the
               boot sector. But note that JFS boot code may ignore this value.

 * LOADSYM   - (OS/4>=4058) prepare SYM file for the kernel in the loader.

 * LOGSIZE=value - set log size for the resident part of the loader, in kb.
               This value will be rounded down to nearest 64k.
               Boot log is available on OS/2 user level:
                  "copy ___hlp$ boot.log"  - with ACPI.PSD running
                  "copy oemhlp$ boot.log"  - without ACPI.PSD

 * LOGLEVEL=0..3 - maximum level of QSINIT log messages to copy to OS/2 kernel
               log. By default - messages are not copied at all.

 * LVMMOUNT=1 - mount all LVM volumes to the same drive letters in QSINIT.
               This option slows QSINIT start a bit (because of mounting)
               and result may differ from OS/2 because of possible differences
               in the disks order between BIOS and OS/2.
                
               Also note that boot volume is still A: (unless BOOTMOUNT=NO) and
               mapped to its own drive letter via SUBST command.
                
               This key skipped in safe mode.

 * MEMALIGN=0 - (OS/4>=???) do not align PC memory table entries to 4Mb. This
               adds some memory (not a lot), but may cause an immediate reboot
               after starting the kernel on some configurations.
               Default value is 1 (align enabled).

 * MEMLIMIT=value - limit available memory for OS/2 to specified value in Mb.
               Where value >=16 & less than total available memory below 4Gb.

               Warp 3 kernels are always limited to <=1Gb, even without this
               parameter.

 * MENUPALETTE=value - color values for the [kernel] menu: byte 0 - text color,
               1 - selected row color, 2 - background, 3 - border.
               Default value is 0x0F070F01.

 * MFSDSYM=name - (OS/4>=4058) use "name" as a SYM file for mini-FSD.

 * MFSPRINT=1  do not disable BIOS screen and keyboard during micro-FSD
               (filesystem bootstrap) calls from the loader.

               By default QSINIT blocks them while reading from a boot device.
               This cause elimination of JFS boot copyright message (a kind of
               garbage on the screen) and deactivates PXE BIOS keyboard polling
               for ESC key (common PXE BIOS stucks the keyboard until the end
               of file load).

               Enabling this option is only relevant for those who write
               micro-FSD :)

 * NOAF      - turn OFF Advanced Format aligning for disk read/write ops.
               Affects both QSINIT and OS/2 boot (until start of IDE/SATA
               driver). By default most of long i/o ops are aligned to 4k.

 * NOCLOCK=1 - turn off clock in QSINIT menu, -1 forces to show both date
               and time instead (Fri 13, Feb 29, New Year and QSINIT`s birthday
               force the date to be shown).

 * NODBCS    - disable DBCS file loading (OS2DBCS, OS2DBCS.FNT). Option saves
               a small amount of memory in 1st Mb for the drivers in DBCS
               systems and has no any special effect (except missing graphic
               console at early boot stage).

 * NOKBD=1   - disable keyboard. Useful for boards w/o video and keyboard,
               which are emulated via serial port. In this case, it`s better
               to disable BIOS polling and use the QSINIT serial port console
               (you can setup it via SM command - see NOVGA below).

 * NOLOGO    - do not show the kernel logo.

 * NOMTRR    - do not use QSINIT MTRR changes in OS/2 boot.

               This key also works in [partition] menu.
               This can be actual for NTLDR (with a national language menu).

 * NOPRINT   - disable device drivers COM port printing via loader

 * NOREV     - do not show kernel revision.

 * NOTASK=1  - turns off task gate use (without this option VirtualPC shows
               a panic screen at any QSINIT trap).

 * NOVGA=1   - disable common video. You should use SM command in qssetup.cmd
               to create a COM port console (sm vadd) and switch boot session
               output to it (sm attach 1 1). Also see NOKBD.

 * OHTRACE=1..3 - print OEMHLP$ calls information into the log, (1 - ordinary
               debug; 2 - only PCI calls; 3 - both). Also note that ACPI.PSD
               intercepts most of OEMHLP calls when active. OS/4 kernel uses
               its own OEMHLP$ driver and that is extremly bad.

 * PCISCAN_ALL=1 - scan all 256 PCI buses. By default QSINIT scan only number
               of buses, reported by PCI BIOS. This key can be really sloooow
               on ancient PCs (2 minutes on my PPro).

 * PICMASK=and/or - set PIC mask, "and" is done first and "or" second.
               For example, PICMASK=/2 will disable the keyboard interrupt
               (IRQ 1). This does not affect OS/2, but in VDM the keyboard
               will be lost (since VDM also inherits real mode PIC mask).

               Under normal conditions, this parameter is practically not
               needed.

 * PRELOAD=1 - (OS/4>=2075) preload all files for BASEDEV boot stage before
               starting to launch them (as Windows do).

 * REIPL=value - reboot PC after fatal QSINIT errors (traps). value - number
               of seconds before reboot (>=1). By default - off.

 * RESETMODE=1 - this option will reset display mode to 80x25 before the menu
               or set it to the selected number of lines (80x25, 80x43, 80x50,
               80x60). 25, 43, 50 and 60 accepted here: RESETMODE=25.

 * RESTART   - this option turns off ANY other options and loads file in
               kernel selection menu as another OS2LDR (loader, not a kernel).

               I.e. this is "restart loader" option, simulate to RESTART shell
               command.

               You can even load Windows XP NTLDR on a FAT16 partition :) As
               said above, this is the legacy of time, when MS & IBM were
               friends.

 * RESTARTRAW  the same as RESTART, but RESTART /RAW shell command.
               iPXE and grub4dos can be launched using this option.

 * SOURCE=X  - this option replaces boot partition for OS/2 boot. X is QSINIT
               drive letter of mounted (to QSINIT!) FAT, HPFS or JFS volume.
               I.e. this key able to change boot partition without reboot.

               @ instead of the drive letter means the existing PAE RAM disk
               drive letter. Basically, this key is designed to boot from it,
               but also works fine for any partition.

 * SYM=name  - use "name" as SYM file for DEBUG kernel.
               Filename is up to 11 chars length (7.3, limited by patching
               of original IBM kernels)

 * UNZALL=1  - unpack all modules from QSINIT.LDI to virtual disk during init.
               By default, EXE/DLL modules only reserve space on disk - until
               first usage. Option suitable to check QSINIT.LDI consistency on
               every boot (unstable PXE connection, ugly SSD support in old
               BIOS, devices with bad sectors and so on).

 * USEBEEP=1 - turn on PC speaker sound in the kernel selection menu (for
               monitor-less configurations). It will beep with one tone on
               the first line and another tone on any other.

 * VALIMIT[=value] (OS/4>=4199) VIRTUALADDRESSLIMIT value, in Mb.
               Key can be used without memory size value, in this case value
               of VIRTUALADDRESSLIMIT in CONFIG.SYS will be used.

 * VIEWMEM   - open memory editor just before starting the kernel (when it
               loaded and ready to launch).

   In QSINIT.INI keys BAUDRATE, BINNAME, BOOTMOUNT, CTRLN, DBPORT, DBCARD,
LVMMOUNT, MFSPRINT, NOAF, NOKBD, NOVGA, PCISCAN_ALL, REIPL, RESETMODE, UNZALL
and USEBEEP affect QSINIT, any other is used only for OS/2 kernel menu/boot.

   LETTER,  LOGLEVEL, NOAF, CPUCLOCK, NOMTRR and BAUDRATE can be added both
to the kernel parameters line  and the to "config" section; RESETMODE, USEBEEP,
NOCLOCK, BINNAME, UNZALL, NOKBD, NOVGA, DBCARD and PCISCAN_ALL have effect in
"config" section only.

   ININAME is supported only in RESTART menu line.

   Min. system requirements: 80486DX, 24Mb (first 16 are reserved for the OS/2
kernel). It still works on a 8Mb PC, but cannot boot OS/2 and "out of memory"
errors are to be expected ...

   486SX appears to work and boot OS/2, but nothing is guaranteed since QSINIT
does not have FPU emulation. 386 is too buggy to support, sorry ;)

   Multithreading wants Pentium at least (rdtsc CPU instruction).

   PAE mode is obviously at least PPro where it came from ;)

   A small article in russian, you can try to googletranslate it (at least half
of the text will be readable ;)
      http://212.12.30.18/qs

   Made on Earth,
   Enjoy ;) and
   check ftp://212.12.30.18/public/QS for new versions and SDK ;)

   Or via http: http://212.12.30.18/other/QS_LDR.ZIP

   QSINIT source code available in the SDK archive.

   PXEOS4 package: ftp://212.12.30.18/public/QS/PXE/pxeos4-1.210510.zip

   Author: dixie, e-dixie@mail.ru
