Index: trunk/bootcode/AIR-BOOT.ASM
===================================================================
--- trunk/BOOTCODE/AIR-BOOT.ASM	(revision 55)
+++ 	(revision )
@@ -1,2480 +1,0 @@
-;
-; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
-;
-; This file is part of AiR-BOOT
-;
-; AiR-BOOT is free software: you can redistribute it and/or modify it under
-;  the terms of the GNU General Public License as published by the Free
-;  Software Foundation, either version 3 of the License, or (at your option)
-;  any later version.
-;
-; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
-;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
-;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-;  details.
-;
-; You should have received a copy of the GNU General Public License along with
-;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
-;
-
-
-
-
-
-
-
-;##############################################################################
-;                                                       AiR-BOOT / DEFINITIONS
-;##############################################################################
-
-;
-; Include AiR-BOOT Version Information.
-; This version-info is defined using simpel EQU's so it can serve as a
-; single source for other formats. The AiR-BOOT signature and the
-; OS/2 BLDLEVEL use this basic version information.
-;
-Include VERSION.INC
-
-;
-; Include OS/2 BLDLEVEL Information.
-; It uses the version-information in VERSION.INC to build it's signature.
-;
-Include BLDLEVEL.INC
-
-;
-; Include some macro's.
-; This file contains the ORIGIN macro that is used to detect overlaps.
-;
-Include ../INCLUDE/ASM.INC
-
-
-; We actually don't want to use this directive because it generates extra
-; NOP instructions that we can do without.
-; TASM also has a bug in that when the .ERR2 directive is used when
-; the .386 directive is in effect, the JUMPS directive is also active
-; and cannot be turned off.
-; NOJUMPS seems to have no effect in this situation.
-; In this case 4 NOP instructions are generated after forward referencing jump
-; instructions, to allow for automatic recoding by TASM.
-; This seems to be a TASM bug. (v2,v3,v4, dunno v5)
-IFDEF   TASM
-    ;~ JUMPS
-ENDIF
-
-
-;
-; If defined then each module is prefixed with it's name.
-; This is used for debugging purposes but it also increases code space.
-; It should be off in release code.
-;
-;~ MODULE_NAMES    EQU
-
-
-
-; -----------------------------------------------------------------------------
-;                                                                        DEBUG
-; -----------------------------------------------------------------------------
-
-;
-; Enable this to include Debug Modules and enable COM-port debugging.
-; To have room for the debug-code, the FX-code can only be enabled
-; when AUX_DEBUG is not defined.
-;
-;~ AUX_DEBUG       EQU
-
-;
-; To have FX enabled, make sure FX_ENABLE is defined.
-; There is no need (for now) to remove Cooper Bars from the setup-menu
-; because AiR-BOOT does not crash when enabling Cooper Bars while FX
-; is not compiled in. Only TAB to post-screen does not work.
-; Way to go Martin !
-;
-IFNDEF  AUX_DEBUG
-FX_ENABLED      EQU
-ENDIF
-
-;
-; If ReleaseCode is not defined, it will produce debug-able code...
-; Rousseau: This is currently *not* functional so don't use it !
-;           It was used to debug AiR-BOOT as a .COM file.
-;
-ReleaseCode             equ     -1
-
-
-; -----------------------------------------------------------------------------
-;                                                                          AUX
-; -----------------------------------------------------------------------------
-;
-; bits 7-5 = datarate
-;  (000=110,001=150,010=300,011=600,100=1200,101=2400,110=4800,111=9600 bps)
-; bits 4-3 = parity
-;  (00 or 10 = none, 01 = odd, 11 = even)
-; bit  2   = stop-bits
-;  (set = 2 stop-bits, clear = 1 stop-bit)
-; bits 1-0 = data-bits
-;  (00 = 5, 01 = 6, 10 = 7, 11 = 8)
-;
-
-; 9600 bps, no parity, 1 stop-bit, 8 bits per char
-AUX_INIT_PARMS          EQU     11100011b
-
-; Com-port for debugging, 0 is disabled
-BIOS_COM_PORT           EQU     1
-
-; Default word value for BIOS_AuxParms variable
-; Note that is has moved since v1.07
-BIOS_AUXPARMS_DEFAULT   EQU     (AUX_INIT_PARMS SHL 8) OR BIOS_COM_PORT
-
-
-
-
-; -----------------------------------------------------------------------------
-;                                                                       LABELS
-; -----------------------------------------------------------------------------
-; Address labels after code-move
-BootBaseSeg                 equ     08000h   ; Pre-boot, in the low 640K
-BootBasePtr                 equ         0h   ; We put our MBR to this location
-BootBaseExec                equ     BootBasePtr+offset MBR_RealStart
-StackSeg                    equ     07000h   ; Put the stack below the code
-
-; Use different addresses depending on whether in pre-boot
-; or debug (dos) environment.
-IFDEF ReleaseCode
-    StartBaseSeg    equ     00000h  ; Pre-boot, we are in low memory
-    StartBasePtr    equ     07C00h  ; BIOS starts our MBR at 0:7C00
-ELSE
-    ; Rousseau: where does this value come from ?
-    ; Should be CS.
-    ; Rectified in actual code by ignoring this value.
-    StartBaseSeg    equ     03A98h  ; Adjust to DOS segment
-    StartBasePtr    equ     00100h  ; We are a .COM file, DOS is active
-ENDIF
-
-
-
-; -----------------------------------------------------------------------------
-;                                                                        VIDEO
-; -----------------------------------------------------------------------------
-; Video pages, no INT 10h is used for menu-drawing etc.
-VideoIO_Page0               equ     0B800h
-VideoIO_Page1               equ     0B900h
-VideoIO_Page2               equ     0BA00h
-VideoIO_Page4               equ     0BC00h
-VideoIO_FXSegment           equ     0A000h
-
-; Special line-drawing characters
-TextChar_WinLineRight       equ     0C4h ; 'Ä'
-TextChar_WinLineDown        equ     0B3h ; '³'
-TextChar_WinRep1            equ     0D1h ; 'Ñ'
-TextChar_WinRep2            equ     0C5h ; 'Å'
-TextChar_WinRep3            equ     0CFh ; 'Ï'
-TextChar_WinRep4            equ     0B5h ; 'µ'
-TextChar_WinRep5            equ     0C6h ; 'Æ'
-TextChar_WinRep6            equ     0D8h ; 'Ø'
-
-
-
-; -----------------------------------------------------------------------------
-;                                                              PARTITION TABLE
-; -----------------------------------------------------------------------------
-; Offsets for Partition-Entries in MBR/EBRs
-LocBRPT_LenOfEntry          equ     16  ; Length of a standard MBR or EPR entry
-LocBRPT_Flags               equ     0   ; Bootable, Hidden, etc.
-LocBRPT_BeginCHS            equ     1   ; Packed CHS value
-LocBRPT_BeginHead           equ     1   ; Start head, usually < 16
-LocBRPT_BeginSector         equ     2   ; Start sector, max 63 + cyl high bits
-LocBRPT_BeginCylinder       equ     3   ; Start cylinder 8+2 bits, max 1023
-LocBRPT_SystemID            equ     4   ; Type of system using the partition
-LocBRPT_EndCHS              equ     5   ; Packed CHS value
-LocBRPT_EndHead             equ     5   ; End head, usually < 16
-LocBRPT_EndSector           equ     6   ; End sector, max 63 + cyl high bits
-LocBRPT_EndCylinder         equ     7   ; End cylinder 8+2 bits, max 1023
-LocBRPT_RelativeBegin       equ     8   ; LBA32 address of partition
-LocBRPT_AbsoluteLength      equ     12  ; 32-bit length of partition
-
-; Signature relative to start of MBR/EBR
-LocBR_Magic                 equ     510 ; Offset of 0AA55h signature
-
-; -----------------------------------------------------------------------------
-;                                                                   LVM RECORD
-; -----------------------------------------------------------------------------
-; Used as a quick compare in LVM.ASM
-LocLVM_SignatureByte0       equ     02h
-
-; Offsets for LVM Information Sector.
-; These are relative to the start of the LVM sector.
-LocLVM_SignatureStart       equ     00h ; 02h,'RMBPMFD' (8 bytes)
-LocLVM_CRC                  equ     08h ; CRC is a DWORD
-LocLVM_Heads                equ     1ch ; Number of heads
-LocLVM_Secs                 equ     20h ; Sectors per Track
-LocLVM_DiskName             equ     24h ; Name of the disk
-LocLVM_StartOfEntries       equ     3ch ; (contains maximum of 4 entries)
-LocLVM_LenOfEntry           equ     3ch ; Length of an LVM-entry
-
-; An LVM info-sector can contain information on max. 4 partitions.
-; All 4 entries will be used when there 4 primary partitions defined.
-; For logical partitions, the LVM info-sector is located below the start
-; of the logical partition and only one LVM entry is used in that logical
-; LVM info-sector.
-LocLVM_MaxEntries           equ     4   ; Max entries in an LVM-sector
-
-
-; -----------------------------------------------------------------------------
-;                                                                    LVM ENTRY
-; -----------------------------------------------------------------------------
-; Offsets for LVM entry.
-; These are relative to the start of the entry.
-LocLVM_VolumeID             equ     00h ; DWORD
-LocLVM_PartitionID          equ     04h ; DWORD
-LocLVM_PartitionSize        equ     08h ; DWORD
-LocLVM_PartitionStart       equ     0ch ; DWORD
-LocLVM_OnBootMenu           equ     10h ; is on IBM BM Bootmenu
-LocLVM_Startable            equ     11h ; is Startable (newly installed system)
-LocLVM_VolumeLetter         equ     12h ; Drive Letter for partition (C-Z or 0)
-LocLVM_Unknown              equ     13h ; unknown BYTE (can be used ?)
-LocLVM_InstallLetter        equ     13h ; unknown BYTE (can be used ?)
-
-; Truncated to 11 chars when  displayed in menu.
-; MiniLVM sets both to the same value.
-; Also, MiniLVM uses a 0-byte terminator, so the maximum length is 19d.
-; Same goes for LocLVM_DiskName.
-; These offsets are relative to an LVM entry.
-LocLVM_VolumeName           equ     14h ; 20 bytes
-LocLVM_PartitionName        equ     28h ; 20 bytes (Used in menu)
-
-; LVM constants.
-LocLVM_LabelLen             equ     14h ; Length of LVM Label (Disk/Part/Vol)
-LocLVM_DiskNameLen          equ     14h ; Length of LVM DiskName
-LocLVM_VolumeNameLen        equ     14h ; Length of LVM VolumeName
-LocLVM_PartitionNameLen     equ     14h ; Length of LVM PartitionName
-
-
-; -----------------------------------------------------------------------------
-;                                                                 AiR-BOOT IPT
-; -----------------------------------------------------------------------------
-; Offsets for IPT (Internal Partition Table)
-LocIPT_MaxPartitions        equ     max_partitions  ; 45 in v1.07+
-LocIPT_LenOfSizeElement     equ     6   ; Size of one Size-Element
-LocIPT_LenOfIPT             equ     34  ; Length of an IPT-entry
-LocIPT_Serial               equ     0   ; Serial from MBR ?
-LocIPT_Name                 equ     4   ; Name from FS or LVM  (part/vol)
-LocIPT_Drive                equ     15  ; Drive-ID             (80h,81h)
-LocIPT_SystemID             equ     16  ; Partition-Type       (06,07,etc)
-LocIPT_Flags                equ     17  ; AiR-BOOT Flags for part (see below)
-LocIPT_BootRecordCRC        equ     18  ; CRC of Boot-Record
-LocIPT_LocationBegin        equ     20  ; Begin of Partition
-LocIPT_LocationPartTable    equ     23  ; PartitionTable of Partition
-LocIPT_AbsoluteBegin        equ     26  ; Absolute Sector of Begin
-LocIPT_AbsolutePartTable    equ     30  ; Absolute Sector of PartTable
-
-
-; AiR-BOOT IPT-Flags
-LocIPT_DefaultFlags         equ     00000011b   ; Don't know if boot-able :)
-LocIPT_DefaultNonBootFlags  equ     00000010b   ; VIBR Detection is always on
-
-Flags_Bootable              equ     00000001b
-Flags_VIBR_Detection        equ     00000010b
-Flags_HideFeature           equ     00000100b
-Flags_DriveLetter           equ     00001000b   ; OS/2 FAT16/HPFS only
-Flags_ExtPartMShack         equ     00010000b   ; Ext. Partition M$-Hack req ?
-Flags_NoPartName            equ     01000000b
-Flags_NowFound              equ     10000000b   ; temp only in OldPartTable
-Flags_SpecialMarker         equ     10000000b   ; temp only for HiddenSetup
-
-FileSysFlags_BootAble       equ     00000001b   ; Is this Partition boot-able ?
-FileSysFlags_FAT32          equ     00010000b   ; FAT 32 specific name getting
-FileSysFlags_NoName         equ     00100000b   ; No Name - use PartitionName
-FileSysFlags_DriveLetter    equ     01000000b   ; DriveLetter Feature possible
-
-
-; -----------------------------------------------------------------------------
-;                                                                 AiR-BOOT HPT
-; -----------------------------------------------------------------------------
-; Hidden Partition Table
-; Length of an HPT-entry ((45 * 6 bits-per-part) / 8) * 45
-; 33.75 = 34 bytes for HPT-entry, coincidently same as length of IPT-entry.
-; Packed table !
-LocHPT_LenOfHPT             equ     34
-
-
-; -----------------------------------------------------------------------------
-;                                                              NAVIGATION KEYS
-; -----------------------------------------------------------------------------
-; Navigation keys
-Keys_Up                     equ     48h
-Keys_Down                   equ     50h
-Keys_Left                   equ     4Bh
-Keys_Right                  equ     4Dh
-Keys_PageUp                 equ     49h
-Keys_PageDown               equ     51h
-Keys_GrayPlus               equ     4Eh
-Keys_GrayMinus              equ     4Ah
-Keys_Plus                   equ     1Bh
-Keys_Minus                  equ     35h
-Keys_ENTER                  equ     1Ch
-Keys_ESC                    equ     1h
-Keys_F1                     equ     3Bh
-Keys_F10                    equ     44h
-Keys_C                      equ     2Eh     ; Add. Check for Ctrl!
-Keys_Y                      equ     2Ch
-Keys_Z                      equ     15h
-Keys_N                      equ     31h
-Keys_TAB                    equ     0Fh
-Keys_Delete                 equ     53h
-Keys_Backspace              equ     0Eh
-Keys_Space                  equ     20h
-
-Keys_Flags_EnterSetup       equ     1100b   ; Strg+Alt (AL)
-
-
-; -----------------------------------------------------------------------------
-;                                                                         MISC
-; -----------------------------------------------------------------------------
-; Initial value for the FreeDriveletterMap
-; Meaning A,B not free; C-Z free, rest unused. (right to left)
-; Each partition with an assigned drive-letter clears a bit in this map.
-; (Not implemented yet)
-InitialFreeDriveletterMap   equ     00000011111111111111111111111100b
-
-;
-; The first harddisk is BIOS coded 80h.
-; This makes a total of 128 disks that could be supported using this coding.
-; This value is used to store disk-information and this info is allocated
-; in the BSS. 64 disks ought to be enough for everybody :-)
-;
-MaxDisks                    equ     64
-
-
-
-
-
-
-;##############################################################################
-;                                                         AiR-BOOT / MAIN-CODE
-;##############################################################################
-
-;
-; Because of the TASM-bug the processor had to be changed to turn JUMPS
-; off. Existing movzx instructions were replaced with 286 equivalent code.
-; Out of range relative jumps have been recoded.
-;
-; Since version 1.0.8, JWasm is the preferred assembler and Tasm will be
-; dropped. Also, the chances of AiR-BOOT being used on a 286-machine are
-; very slim, so a future version will revert back to .386 and also incorporate
-; 32-bit code. This will enable some enhanced constructs such as scaled
-; indexing, bit-instructions, 32-bit registers and what not.
-;
-.286
-
-;
-; For Tasm, MODEL is needed for the USES directive to work.
-; So always use a model when assembling with Tasm otherwise registers on
-; function calls that use USES are not saved and restored.
-; The model itself, has no real effect because we generate a binary image
-; and not a segmented executable.
-; For the other assemblers we define no model to get rid of the default C/C++
-; segments for future object-linked versions of AiR-BOOT.
-;
-IFDEF   TASM
-    ;~ .model large, basic
-    .model  tiny,c
-ENDIF
-
-;
-; The below is used to switch between the original 1-segment (code_seg) layout
-; and the new 2-segment (code_seg and bss_data) layout.
-; It will be removed in future versions.
-; The 2-segment layout was needed for JWasm because it does not treat
-; db ? at the end of a code segment as bss-data.
-; Therefore, a true BSS segment is now used.
-; Both the code_seg and the bss_data are grouped to the logical AIRBOOT
-; segment.
-; Note that this influences the offsets in the BSS in the list-file and
-; the wdis disassembly file (.WDA).
-; They are now segment-relative. The true offset is resolved at link
-; time.
-;
-SEGMENTED   EQU
-
-    IFDEF   SEGMENTED
-        AIRBOOT     GROUP   LDRIMAGE,VOLATILE
-    ENDIF
-
-    ; Our code-segment starts here.
-    LDRIMAGE    SEGMENT     USE16   PUBLIC  'CODE'
-
-    IFDEF   SEGMENTED
-        ASSUME  CS:AIRBOOT, DS:AIRBOOT, ES:nothing, SS:nothing
-    ELSE
-        ASSUME  CS:LDRIMAGE,DS:LDRIMAGE,ES:nothing, SS:nothing
-    ENDIF
-
-
-
-;==============================================================================
-;                                                                     Sector 1
-;==============================================================================
-
-;------------------------------------------------------------------------------
-                ; We are not a .COM file at 100h but a BINARY image
-                ; of which only the 1st sector gets loaded at 0000:07c00h
-                ; by the BIOS. The code in this 1st sector is position
-                ; independent and moves itself to a new location at 8000:0000h.
-                ; Then it jumps to a new entry-point and loads the rest of
-                ; the image to the new location.
-                org 00000h
-;------------------------------------------------------------------------------
-
-
-;
-; Since AiR-BOOT is a boot-loader residing in track0, the first 512 bytes
-; have the layout of a Master Boot Record (MBR). When AiR-BOOT get's installed,
-; the first 512 bytes of this code get's merged with the Partition Table.
-; The rest is installed in the remaining sectors with sector 62 (LBA 61)
-; being the last sector used by AiR-BOOT. Sector 63 is reserved for IBM LVM.
-; The last sector used by AiR-BOOT is a copy of the MBR that AiR-BOOT makes
-; every time a system gets booted.
-;
-
-;
-; Due to the addition of an extra 'I13X' sugnature and code to preserve the
-; values of the registers on entry, the MBR-code has become a bit messy.
-; This will be cleaned-up in future versions.
-;
-
-;
-; Martin had a short jump followed by the AiRBOOT signature at first.
-; Then he encountered strange behaviour by some M$ operating-systems
-; if the the first insruction was not a CLI.
-; But there was no room to insert the CLI and of course he did not want to
-; change the location of the AiR-BOOT signature.
-; He solved this by inserting the M$ needed CLI at offset 0 followed by a short
-; jump that uses the 'A' of the AiR-BOOT signature as the jump displacement.
-;
-
-
-; -----------------------------------------------------------------------------
-;                                                            FIRST ENTRY-POINT
-; -----------------------------------------------------------------------------
-; BOOKMARK: FIRST ENTRY-POINT (Invoked by BIOS)
-; ######################################################
-; # ENTRY-POINT WHERE THE BIOS TRANSFERS CONTROL TO US #
-; ######################################################
-AiR_BOOT:
-                ; Some M$ operating systems need a CLI
-                ; here otherwise they will go beserk
-                ; and will do funny things during
-                ; boot phase, it's laughable!
-    MBR_1stOpc: cli
-
-                ; JMP-Short -> MBR_Start
-                ; Uses the 'A' from the signature as the displacement !
-    MBR_JmpOpc  db      0EBh
-
-                ; ID String, Date (DD,MM,CC,YY), Version Number, Language ID
-                ;~ db      'AiRBOOT',24h,02h,20h,12h,01h,08h,TXT_LanguageID
-    MBR_ABSig:  InsertAirbootSignature  TXT_LanguageID
-
-                    ; Total Code Sectors Count.
-                    ; Actual value will be inserted by FIXCODE.
-    MBR_CodeSecs    db      1
-
-                    ; Total Code Sectors Count, dynamically calculated.
-                    ;~ db      (code_end-$)/512
-
-                    ; Check-Sum for Code
-    MBR_CheckCode   dw      0
-
-
-
-; -----------------------------------------------------------------------------
-;                                                            THIRD ENTRY-POINT
-; -----------------------------------------------------------------------------
-; BOOKMARK: THIRD ENTRY-POINT (Relocate code)
-;
-; No single instruction below should be changed, added or removed in the code
-; below as this will cause the jump-link to go haywire.
-;
-MBR_Start:
-                ;
-                ; When we arrive here, no registers have been used yet.
-                ; So, they still contain the values the BIOS left in them.
-                ; We want to preserve those value's for later inspection
-                ; by putting them on the stack.
-                ;
-
-                ; No space for this instruction here.
-                ; We'll enable interrupts later.
-                ;sti            ; This opcode is dedicated to:
-                                ; =MICROSOFT JUMP DEPARTMENT=
-
-
-                ; Push all registers with values provided by the BIOS
-                ; on the stack.
-                pusha
-                ; Temporary save SS and SP so we still have access to this
-                ; stack after we have setup our own.
-                mov     dx,ss
-                mov     bx,sp
-
-                ;
-                ; Setup some base stuff
-                ; AX got loaded wrongly for debug, changed the instructions
-                ; without modifying the number of bytes.
-                ; Don't comment-out the redundant instruction below because it
-                ; *will* change the number of bytes and break the jump-chain.
-                ;
-
-                ; The segment we are moving ourself from (NOT USED)
-                ;mov     ax, StartBaseSeg
-                ;mov     ds, ax
-
-                ; Make sure DS points to CS.
-                push    cs
-                pop     ds
-
-                ; Setup the source and destination for the code move.
-                mov     si, StartBasePtr    ; The offset we move ourself from
-                mov     ax, BootBaseSeg     ; The target segment we move to
-                mov     es, ax
-                ;mov     di, BootBasePtr    ; The target offset we move to
-                ; Changed the instruction to make room.
-                ; So, BootBasePtr is not used !
-                ; The offset in the target segment is assumed to be 0000
-                ; anyway.
-                xor     di,di
-                ;sti
-
-            ; Depending on pre-boot or debug.
-            ; Note that ReleaseCode is obsolete, so we will always move
-            ; 256 words; aka this sector, the MBR.
-            IFDEF ReleaseCode
-                mov     cx, 256          ; Pre-boot environment
-            ELSE
-                mov     cx, 32700        ; Old Debug environment (move ~64kB)
-            ENDIF
-
-                ;
-                ; This moves this 512-byte sector, loaded by the BIOS at
-                ; 0000:7c00 to 8000:0000.
-                ;
-                cld
-                rep     movsw
-
-                ; Code an intersegment jump to the new location.
-                ; jmp    BootBaseSeg:BootBaseExec
-                ; Note that DX:BX containts the old SS:SP.
-                db      0EAh
-                dw      BootBaseExec    ; This is MBR_RealStart + BootBasePtr
-                dw      BootBaseSeg     ; This is 08000h
-
-
-
-
-; -----------------------------------------------------------------------------
-;                                                         SIMPLE MBR FUNCTIONS
-; -----------------------------------------------------------------------------
-;
-; Some MBR-functions to provide absolute minimum functionality.
-;
-
-;
-; BOOKMARK: Halt System
-; Entry-point for halting the system.
-;
-MBR_HaltSystem:
-                mov     ax, 8600h
-                xor     cx, cx
-                mov     dx, 500
-                int     15h         ; Wait to display the whole screen :]
-MBR_HaltSys:
-                cli
-                jmp     MBR_HaltSys
-
-
-                ;
-                ; Some small space for variables.
-                ;
-                ORIGIN  0003Ch
-
-; Comport settings.
-; It had to be moved to create room for the double I13X signature.
-; It cannot be in the config-area (sector 55)
-; because that area is crc-protected and would not allow 'poking'.
-BIOS_AuxParms   dw      BIOS_AUXPARMS_DEFAULT
-
-
-IFDEF   AUX_DEBUG
-reserved        db      6   dup('X')
-ELSE
-reserved        db      6   dup(0)
-ENDIF
-
-
-
-
-; -----------------------------------------------------------------------------
-;                                                           SECOND ENTRY-POINT
-; -----------------------------------------------------------------------------
-                ;
-                ; We arrive here after the first jump using the 'A' of the
-                ; AiR-BOOT signature. So we ensure the jump is always at
-                ; this offset. We jump here, because Martin needed to
-                ; insert a CLI on start and did not want to change the
-                ; AiR-BOOT signature because of Microsoft inventions...
-                ;
-                ORIGIN  00044h
-
-                ; Jump again...
-                ; This time to the code that relocates to 8000:0000.
-                ; BOOKMARK: SECOND ENTRY_POINT (Skipped over AB signature)
-                jmp     MBR_Start
-
-;
-; Entry-point when loading fails.
-;
-                db      'LOAD ERROR!', 0
-MBR_LoadError   Proc Near
-        mov     si, offset $-12
-        push    cs
-        pop     ds
-        call    MBR_Teletype
-    MBRLE_Halt:
-        jmp     MBRLE_Halt
-MBR_LoadError   EndP
-
-;
-; Entry-point when saving fails.
-;
-                db      'SAVE ERROR!', 0
-MBR_SaveError   Proc Near
-        mov     si, offset $-12
-        push    cs
-        pop     ds
-        call    MBR_Teletype
-    MBRSE_Halt:
-        jmp     MBRSE_Halt
-MBR_SaveError   EndP
-
-
-; Put text on the screen using the BIOS tele-type function.
-; No attributes like color are supported.
-;        In: SI - Pointer to begin of string (EOS is 0)
-; Destroyed: SI
-MBR_Teletype    Proc Near   Uses ax bx cx
-        mov     ah, 0Eh
-        mov     bx, 7
-    MBRT_Loop:
-        lodsb
-        or      al, al
-        jz      MBRT_End
-        int     10h
-        jmp     MBRT_Loop
-    MBRT_End:
-        ret
-MBR_Teletype    EndP
-
-;
-; Rousseau: DO NOT ADD CODE TO THIS SECTION !
-;
-
-;        In: BX     - Base Check
-;            DS:SI  - Pointer to 512-byte-area to be included
-;       Out: BX     - Base Check Result
-; Destroyed: SI will get updated (+512)
-MBR_GetCheckOfSector    Proc Near   Uses ax cx
-        mov     cx, 256
-    MBRGCOS_Loop:
-        lodsw
-        xor     ax, 0BABEh
-        xor     bx, ax
-        loop    MBRGCOS_Loop
-        or      bx, bx
-        jnz     MBRGCOS_NoFixUp
-        mov     bx, 1                   ; dont allow 0, cause 0 == empty
-    MBRGCOS_NoFixUp:
-        ret
-MBR_GetCheckOfSector    EndP
-
-
-
-
-
-
-; -----------------------------------------------------------------------------
-;                                                    ENTRY-POINT OF MOVED CODE
-; -----------------------------------------------------------------------------
-
-;
-; When we arrive here we are running at 8000:0000.
-; DX:BX contains the SS:SP of the old stack.
-;
-
-;
-; This is where the rest of AiR-BOOT gets loaded from track0.
-;
-; BOOKMARK: Running at relocated position (Load additional sectors)
-;------------------------------------------------------------------------------
-MBR_RealStart:
-                ;
-                ; Setup new stack and other segment registers.
-                ;
-                mov     ax, StackSeg    ; 07000h, below the moved code
-                mov     ss, ax
-                mov     sp, 7FFEh       ; Even is better
-                push    es              ; ES holds segment where we moved to
-                pop     ds              ; Set DS=ES to Code Segment
-
-                ;
-                ; Push the old SS:SP which was saved in DX:BX on the new stack.
-                ;
-                push    dx      ; Old SS
-                push    bx      ; Old SP
-
-
-            ; If we are in debug-mode, all code is moved already,
-            ; so we can directly jump to it.
-            ; One difference is that in debug-mode, the whole .com image is
-            ; loaded by dos while when air-boot is active from the MBR it
-            ; does the loading itself.
-            ; (This debug environment is obsolete and dis-fuctional)
-            IFNDEF ReleaseCode
-                jmp     AiR_BOOT_Start
-            ENDIF
-
-                ; Load the configuration-sectors from disk.
-                ; These are the main configuration sector and the various
-                ; tables that follow it upto but not including the MBR backup.
-                mov     bx, offset Configuration
-                mov     dx, 0080h       ; First harddrive
-                mov     cx, 0037h       ; Config sector is at 55d (CHS)
-
-                ; Call the i/o-part
-                call    MBR_LoadConfig
-                jnc     MBR_ConfigCopy_NoError
-
-                ; Some error occured
-    MBR_ConfigCopy_LoadError:
-                call    MBR_LoadError               ; Will Abort BootUp
-
-                ; Load the code sectors
-    MBR_ConfigCopy_NoError:
-                mov     bx, offset FurtherMoreLoad  ; Directly after MBR in mem
-                mov     dx, 0080h                   ; First harddrive
-                mov     cx, 0002h                   ; Start at second sector
-                mov     ah, 02h                     ; Read sectors
-
-                ; This location is in the MBR.
-                ; It is filled in by the FIXCODE helper that post processes
-                ; the AIRBOOT loader image after it has been built.
-                ; FIXCODE also embeds the MBR protection-image.
-                mov     al, ds:[10h]                ; Number of code sectors
-                int     13h                         ; Call BIOS service
-                jnc     MBR_RealStart_NoError
-                jmp     MBR_ConfigCopy_LoadError
-
-
-                ; [v1.05+]
-                ; Signature for IBM's LVM to detect our "powerful" features ;)
-                ;
-                ; [v1.0.8+]
-                ; Reworked MBR code to be able to create a
-                ; double 'I13X' signature.
-                ; MBR's created with LVM eCS v1.x have the signature at 0d5h
-                ; MBR's created with LVM eCS v2.x have the signature at 0d0h
-                ; See eCS bugtracker issue #3002
-                ;
-                ; Update: These are actually MOV EAX,'X31I' instructions
-                ; in the eCS LVM MBR-code. They are at different places in
-                ; the v1.x and v2.x LVM MBR-code. Other code might depend on
-                ; their presence. Let's protect their location.
-                ORIGIN  000d0h
-                db      'I13X',0,'I13X',0
-
-
-    MBR_RealStart_NoError:
-                ; Now Check Code with CheckSum
-                mov     si, offset FurtherMoreLoad
-
-                ;movzx   cx, bptr ds:[10h]
-                mov     cl, ds:[10h]
-                mov     ch,0
-
-                ; Claculate checksum
-                xor     bx, bx
-    MBR_RealStart_CheckCodeLoop:
-                call    MBR_GetCheckOfSector
-                loop    MBR_RealStart_CheckCodeLoop
-
-
-                cmp     MBR_CheckCode, bx
-                je      MBR_RealStart_CheckSuccess
-
-                mov     si, offset TXT_ERROR_Attention
-                call    MBR_Teletype
-                mov     si, offset TXT_ERROR_CheckCode
-                call    MBR_Teletype
-                mov     si, offset TXT_ERROR_CheckFailed
-                call    MBR_Teletype
-                jmp     MBR_HaltSystem
-
-
-                ;
-                ; OK, all loading went fine so the rest of the code
-                ; is present now, so we jump to it.
-                ; The old SS:SP is still on the stack.
-                ;
-    MBR_RealStart_CheckSuccess:
-                jmp     AiR_BOOT_Start
-
-
-
-
-
-;------------------------------------------------------------------------------
-Include TEXT/TXTMBR.ASM                        ; All translateable Text in MBR
-;------------------------------------------------------------------------------
-
-
-
-; This is an ugly kludge function to create space for the
-; double 'I13X' signature.
-; It loads the configuration sectors, but bx,cx and dx are not initialized
-; in this function. That's done around line 500.
-; Putting this few bytes here creates just enough room.
-MBR_LoadConfig  Proc Near
-        ; Changed from conditional assembler to calculated value
-        ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"
-        ; Size of the ab-configuration in 512 byte sectors
-        mov     al, (MBR_BackUpMBR - Configuration) / 200h
-        mov     ah,02h
-        int     13h
-        ret
-MBR_LoadConfig  EndP
-
-
-                ; Disk Signature
-                ; Note that in an LVM 2.x MBR this collides
-                ; with the dummy PTE that it uses to look for IBM-BM
-                ; on the second harddisk.
-                ORIGIN  001B8h
-
-                ; AiR-BOOT installer will merge the field
-                ; from the MBR it replaces.
-    MBR_DrvSig  db      'DSIG'
-
-                ; Unused word at 01BCh.
-                ; An LVM 2.x MBR puts 0CC33h here.
-                ; AiR-BOOT installer will merge the field
-                ; from the MBR it replaces.
-    MBR_Spare   dw      '$$'
-
-
-                ;
-                ; Partition Table.
-                ;
-                ORIGIN  001BEh
-
-                ; The 4 entries just for show.
-                ; AiR-BOOT installer will merge them from the MBR it replaces.
-    MBR_PartTable:
-                db      16  dup('0')
-                db      16  dup('1')
-                db      16  dup('2')
-                db      16  dup('3')
-
-                ; Boot Sigbature
-    MBR_Sig     dw      0aa55h
-
-
-
-
-
-
-
-;==============================================================================
-;                                                                     Sector 2
-;==============================================================================
-
-; -----------------------------------------------------------------------------
-;                                                           FILE-SYSTEM TABLES
-; -----------------------------------------------------------------------------
-
-
-                ORIGIN  00200h
-
-;
-; Everything beyond this point is loaded on startup
-; and is NOT existant at first
-;
-FurtherMoreLoad:
-
-;
-; Filesystem table correlating id with name.
-;
-
-                ; first Normal-Partition-ID, Hidden-Partition-ID
-                ; and Default-Partition-Flags.
-                ; 01h -> Boot-Able
-                ; 10h -> FAT32 - Name Getting Scheme
-                ; 20h -> No Name To Get (use Partition Name from IPT)
-                ; 40h -> 'L' flag possible
-                db      'AiRSYS-TABLE'
-FileSysIDs      db      01h, 11h,01h, 04h,014h,01h, 06h,016h,41h, 0Eh,00Eh,01h
-                db      07h, 17h,41h, 08h,017h,21h, 35h,035h,20h,0FCh,017h,41h
-                db      09h, 19h,11h, 0Bh,01Bh,11h, 0Ch,01Ch,11h,0EBh,0EBh,01h
-                db      63h, 63h,21h, 81h,081h,21h, 83h,083h,21h, 40h,040h,21h
-                db     0A5h,0A5h,21h,0A6h,0A6h,21h, 82h,082h,20h,0A7h,0A7h,21h
-                db      63h, 63h,21h, 4Dh,04Dh,21h, 4Eh,04Eh,21h, 4Fh,04Fh,21h
-                db      01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
-                db      01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
-                db      01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
-                db      01h, 01h,01h,0FDh,0FDh,20h, 84h,084h,20h,0A0h,0A0h,20h
-                db      0Ah, 0Ah,20h,0FEh,0FEh,21h,0FFh,0FFh,21h, 00h,000h,21h
-                db      16 dup (0)
-
-FileSysNames    db  'FAT12   ', 'FAT16   ', 'FAT16Big', 'FAT16Big'
-                db  'HPFS    ', 'NTFS    ', 'LVM-Data', 'JFS     '
-                db  'FAT32   ', 'FAT32   ', 'FAT32   ', 'BeOS    '
-                db  'Unix    ', 'Minix   ', 'Linux   ', 'Venix   ' ; x row ;)
-                db  'BSD/386 ', 'OpenBSD ', 'LinuxSwp', 'NeXTSTEP'
-                db  'GNU HURD', 'QNX     ', 'QNX     ', 'QNX     '
-                db  '        ', '        ', '        ', '        '
-                db  '        ', '        ', '        ', '        '
-                db  '        ', '        ', '        ', '        '
-                db  '        ', 'Kernel  ', '        ', '0V-Award'
-;                db  'OS/2 Man', 'via BIOS', 'Floppy  ', 'Unknown '
-                db  'OS2-BMGR', 'via BIOS', 'Floppy  ', 'Unknown '
-                         ; -> 44 Partition-Types
-
-
-
-
-
-
-;==============================================================================
-;                                                                     Sector 3
-;==============================================================================
-
-; -----------------------------------------------------------------------------
-;                               ENTRY-POINT AFTER LOADING THE REST OF THE CODE
-; -----------------------------------------------------------------------------
-
-                ORIGIN  00400h
-
-
-; ############################################
-; # ENTRY-POINT AFTER ALL THE INITIAL HASSLE #
-; ############################################
-; BOOKMARK: AiR_BOOT_Start (AiR-BOOT now completely loaded)
-AiR_BOOT_Start:
-
-
-        ;
-        ; Enable interrupts.
-        ;
-        sti
-
-        ;
-        ; Pop the old SS:SP from the stack and save it in the BSS.
-        ; Note that this is outside the normal variable area that gets cleared.
-        ; This allows AiR-BOOT to restart itself when debugging and come-up
-        ; with access to the original values of registers the BIOS passed.
-        ;
-        pop     [OldSP]
-        pop     [OldSS]
-
-
-; -----------------------------------------------------------------------------
-;                                                      IBM-BM BOOT PREPARATION
-; -----------------------------------------------------------------------------
-        ;
-        ; Since v1.0.8, AiR-BOOT is able to chainload IBM-BM.
-        ; When IBM-BM resides above the 1024-cylinder limit, the 'I13X'
-        ; signature is required at 3000:0000, FS needs to contain 3000h
-        ; and the 32-bit LBA address needs to follow the 'I13X' signature.
-        ; For booting IBM-BM from the second disk, a copy of the MBR of the
-        ; first disk is also required at 0000:7E00.
-        ; This information is derived from the eCS 2.x LVM MBR.
-        ;
-        ; So, now is a good time to copy the MBR of the first disk to
-        ; 0000:7E00 in case the partition that will be started is IBM-BM.
-        ; This copy is located at 8000:0000 and DS already points to this
-        ; segment. The 'I13X' signature and FS will be setup later.
-        ;
-        pusha                           ; Save all the general purpose regs
-        push    es                      ; We need ES too, so save its value
-        xor     ax,ax                   ; Segment 0000h
-        mov     es,ax                   ; Make ES point to it
-        mov     si,offset BootBasePtr   ; Start of AiR-BOOT which has the MBR
-        mov     di,7e00h                ; Destination for the MBR for IBM-BM
-        mov     cx,100h                 ; 256 words = 512 bytes
-        cld                             ; Direction from low to high
-        rep     movsw                   ; Copy the 256 words of the MBR
-        pop     es                      ; Restore previous value of ES
-        popa                            ; Restore all the general purpose regs
-
-
-; -----------------------------------------------------------------------------
-;                                                                      PRECRAP
-; -----------------------------------------------------------------------------
-
-                ;
-                ; First it clears the BSS area.
-                ; Note that the old SS:SP is stored outside this area so this
-                ; does not get lost.
-                ; Then initialize various runtime variables and structures.
-                ;
-                ; BOOKMARK: Pre Crap
-                call    PRECRAP_Main
-                ; Number of harddisks and other system-info is now known.
-
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Let's see what the BIOS supplied us with...
-            ;! Uncomment below to activate.
-            ;!
-            __DUMP_BIOS_REGS__  EQU
-            IFDEF   AUX_DEBUG
-                IFDEF   __DUMP_BIOS_REGS__
-                    pushf
-                    pusha
-                    ; Print title.
-                    mov     si,offset [bios_reg]
-                    call    AuxIO_Print
-                    ; Save the current stack (SS:SP).
-                    mov     ax,ss
-                    mov     [CurrentSS],ax
-                    mov     [CurrentSP],sp
-
-                    ; Restore the old stack.
-                    mov     ss,[OldSS]
-                    mov     sp,[OldSP]
-
-                    ; Pop the registers with the BIOS values.
-                    popa
-                    ; Push them back for AiR-BOOT restart (debug mode).
-                    pusha
-                    ; Dump them to the serial-port.
-                    call    DEBUG_DumpRegisters
-                    ; Restore the current stack.
-                    mov     ax,[CurrentSS]
-                    mov     ss,ax
-                    mov     sp,[CurrentSP]
-
-                    ; Restore registers.
-                    popa
-                    popf
-                ENDIF
-            ENDIF
-
-
-
-
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Dump the registers at this point.
-            ;! Uncomment below to activate.
-            ;!
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpRegisters
-                ; Dump drive-letters of dl-feature before partitions are
-                ; scanned and processed.
-                call    DEBUG_DumpDriveLetters
-                call    DEBUG_DumpVolumeLetters
-                call    DEBUG_DumpPartitionXref
-            ENDIF
-
-; -----------------------------------------------------------------------------
-;                                                               PARTITION SCAN
-; -----------------------------------------------------------------------------
-                ;
-                ; BOOKMARK: Scan all partitions
-                ;
-                call    PARTSCAN_ScanForPartitions
-                ; Internal Partition Table is now populated.
-
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Dump various tables.
-            ;! Uncomment below to activate.
-            ;!
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpIPT
-                ;~ call    DEBUG_DumpPartitionPointers
-                ;~ call    DEBUG_DumpNewPartTable
-                ;~ call    DEBUG_DumpDriveLetters
-                call    DEBUG_DumpDriveLetters
-                call    DEBUG_DumpVolumeLetters
-                call    DEBUG_DumpPartitionXref
-            ENDIF
-
-
-; -----------------------------------------------------------------------------
-;                                 RESTORE FORCED DRIVELETTER CORRELATION [LVM]
-; -----------------------------------------------------------------------------
-
-                ;
-                ; Reconnect forced drive-letters to their corresponding
-                ; partitions.
-                ;
-                ; BOOKMARK: Update Driveletters so they are in-sync again
-                call    PARTSCAN_UpdateDriveLetters
-                ; Driveletter <-> Partition correlation is now restored.
-
-
-
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Dump various tables.
-            ;! Uncomment below to activate.
-            ;!
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpIPT
-                ;~ call    DEBUG_DumpPartitionPointers
-                ;~ call    DEBUG_DumpNewPartTable
-                ;~ call    DEBUG_DumpDriveLetters
-                call    DEBUG_DumpDriveLetters
-                call    DEBUG_DumpVolumeLetters
-                call    DEBUG_DumpPartitionXref
-            ENDIF
-
-
-; -----------------------------------------------------------------------------
-;                                                            SHOW WE ARE ALIVE
-; -----------------------------------------------------------------------------
-
-                ;
-                ; Put some info about AiR-BOOT and the system on the screen.
-                ;
-
-                ; Display number of physical disks found
-                mov     si, offset DisksFound
-                call    MBR_Teletype
-                mov     al, [TotalHarddiscs]
-                call    VideoIO_SyncPos
-                call    VideoIO_PrintByteDynamicNumber
-                xor     si,si
-                call    MBR_TeletypeNL
-
-                ; Display number of partitions found
-                mov     si, offset PartitionsFound
-                call    MBR_Teletype
-                mov     al, [CFG_Partitions]
-                call    VideoIO_SyncPos
-                call    VideoIO_PrintByteDynamicNumber
-
-                ; Dump summier disk-info for disks found
-                xor     si,si
-                call    MBR_TeletypeNL
-                call    MBR_TeletypeNL
-                call    VideoIO_SyncPos
-                mov     dl,80h
-                call    VideoIO_DumpDiskInfo
-
-
-
-
-
-; -----------------------------------------------------------------------------
-;                                                     eComStation PHASE1 CHECK
-; -----------------------------------------------------------------------------
-
-                ;
-                ; BOOKMARK: Check for eCS being installed
-                ; Here we check if eComStation v2.1+ is being installed.
-                ; If so, we forgo the menu and directly boot it.
-                ;
-
-                ; If the first byte of the name of the Install Volume is not 0
-                ; then we potentially have a phase1 boot.
-                test    byte ptr [eCS_InstallVolume],0ffh
-                ; Nope, so continue normally.
-                jz      MBR_Main_ContinueBoot
-
-                ; Setup phase1.
-                ; It is still possible that a name was set for the
-                ; Install Volume that does not exist.
-                ; In that case CY will be clear and AL=0FFh.
-                call    PART_SetupPhase1
-                ; Oops, Install Volume not found, continue normally.
-                jnc     MBR_Main_ContinueBoot
-
-
-                ;
-                ; == Install Volume Found ==
-                ;
-
-
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Dump various tables.
-            ;! Uncomment below to activate.
-            ;!
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpIPT
-                ;~ call    DEBUG_DumpPartitionPointers
-                ;~ call    DEBUG_DumpPartitionXref
-                ;~ call    DEBUG_DumpNewPartTable
-                ;~ call    DEBUG_DumpDriveLetters
-            ENDIF
-
-
-                ; BOOKMARK: Scan for Partitions (Only if eCS install going on)
-                ; Because one or more partitions are possibly added, the
-                ; PartitionXref table is not 'in sync' and could cause the
-                ; wrong system to be automatically booted.
-                ; So we rescan all partitions causing the PartitionXref
-                ; table to be filled with correct values so the auto-boot
-                ; from the new partition will work correctly.
-                call    PARTSCAN_ScanForPartitions
-
-
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Dump various tables.
-            ;! Uncomment below to activate.
-            ;!
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpIPT
-                ;~ call    DEBUG_DumpPartitionPointers
-                ;~ call    DEBUG_DumpPartitionXref
-                ;~ call    DEBUG_DumpNewPartTable
-                ;~ call    DEBUG_DumpDriveLetters
-            ENDIF
-
-                ; Setup automatic boot to forgo the Menu.
-                ; PART_SetupPhase1 has filled in the other variables.
-                mov     byte ptr [CFG_AutomaticBoot],1
-
-                ;
-                ; At this point the AiR-BOOT configuration has been altered
-                ; to automatically boot the newly installed system without
-                ; displaying the menu.
-                ; Code further down the road will take care of that.
-                ;
-                jmp     MBR_Main_ContinueBoot
-
-
-
-
-    ;
-    ; Wether a new system is being installed or not,
-    ; booting continues here.
-    ;
-    MBR_Main_ContinueBoot:
-
-                ;
-                ; Inform user how to switch between post-screen and menu
-                ; by putting this info on the screen.
-                ;
-                xor     si,si
-                call    MBR_TeletypeNL
-                xor     si,si
-                call    MBR_TeletypeNL
-                call    MBR_TeletypeSyncPos
-                xor     si,si
-                call    MBR_TeletypeNL
-                call    MBR_TeletypeNL
-                mov     si, offset ShowMenu
-                call    MBR_TeletypeBold
-
-
-                ;
-                ; Debug stop.
-                ;
-
-                ;
-                ; ####################### WAIT FOR KEY ########################
-                ;
-
-                ; Wait for key so we can see debug log if ab-menu hangs.
-                ;~ xor     ax, ax
-                ;~ int     16h
-                ;call     SOUND_Beep
-
-
-                ; Copy BIOS POST to Second Page
-                mov     ax, VideoIO_Page1
-                call    VideoIO_BackUpTo
-
-                ;call     SOUND_Beep
-
-
-                ; BOOKMARK: Save Configuration
-                ; Save configuration so phase1 boot-through is disabled
-                ; on next boot.
-                mov     byte ptr [eCS_InstallVolume], 0
-                call    DriveIO_SaveConfiguration
-
-
-
-                ;
-                ; See if setup needs to be entered.
-                ;
-    MBR_Main_ReEnterSetup:
-                call    SETUP_CheckEnterSETUP
-
-                ;
-                ; Do some post processing.
-                ;
-                ; BOOKMARK: After Crap
-                call    AFTERCRAP_Main
-
-                ; [Linux support removed since v1.02]
-                ; Now get FAT16-Linux Kernel Partition, If requested
-                ;cmp     [CFG_LinuxKrnlPartition], 0FFh
-                ;je      MBR_Main_NoLinuxKrnlPartition
-                ;call    LINUX_InitFAT16access
-    ;MBR_Main_NoLinuxKrnlPartition:
-
-
-
-    MBR_Main_ReEnterBootMenuPre:
-                ; SetUp PartitionPointers for BootMenu (filter non-bootable)
-                call    PART_CalculateMenuPartPointers
-
-                ; ...and count that one...
-                cmp     byte ptr [PartitionPointerCount], 0
-                jne     MBR_Main_SomethingBootAble
-                mov     si, offset TXT_NoBootAble
-                call    MBR_Teletype
-                jmp     MBR_HaltSystem
-
-    MBR_Main_SomethingBootAble:
-                ; FixUp Values, define Timed Setup booting, etc.
-                call    PART_FixUpDefaultPartitionValues
-
-
-
-                ; -------------------------------------------------- BOOT-MENU
-    MBR_Main_ReEnterBootMenu:
-                call    BOOTMENU_ResetMenuVars ; reset has to be done
-                test    byte ptr [CFG_AutomaticBoot], 1
-                jz      MBR_Main_NoAutomaticBooting
-
-
-                ; ------------------------------------------ AUTOMATIC BOOTING
-                ; Select automatic partition, disable automatic booting for
-                ;  next time and boot system...
-                mov     byte ptr [CFG_AutomaticBoot], 0
-                call    PASSWORD_AskSystemPwd
-                mov     al, Menu_EntryAutomatic
-
-                ;mov     al, 2
-
-                mov     Menu_EntrySelected, al      ; zero based
-                jmp     MBR_Main_NoBootMenu
-
-
-    MBR_Main_NoAutomaticBooting:
-
-                ;call   SOUND_Beep
-
-                test    byte ptr [CFG_BootMenuActive], 0FFh
-                jnz     MBR_Main_GotBootMenu
-                ; ----------------------------------------------- NO BOOT-MENU
-                ; Select default partition and boot system...
-                call    PASSWORD_AskSystemPwd
-
-                ;call    VideoIO_DBG_WriteString2
-
-                mov     al, Menu_EntryDefault
-                ;mov     al,0                         ; zero based
-                mov     Menu_EntrySelected, al
-                jmp     MBR_Main_NoBootMenu
-
-    MBR_Main_GotBootMenu:
-                ; ------------------------------------------ BOOT-MENU VISUALS
-
-
-            IFDEF   FX_ENABLED
-                call    FX_StartScreen
-            ENDIF
-
-                ; BOOKMARK: Build Main Menu
-                call    BOOTMENU_BuildBackground
-                call    BOOTMENU_BuildMain
-
-            IFDEF   FX_ENABLED
-                call    FX_EndScreenRight
-            ENDIF
-
-                call    PASSWORD_AskSystemPwd
-                call    BOOTMENU_ResetTimedBoot
-
-                ; BOOKMARK: Display Main Menu
-                call    BOOTMENU_Execute
-
-                jc      MBR_Main_ReEnterSetup
-                call    BOOTMENU_SetVarsAfterMenu
-
-                ; ---------------------------------------------------- BOOTING
-    MBR_Main_NoBootMenu:
-
-            IFDEF   FX_ENABLED
-                call    FX_StartScreen
-            ENDIF
-
-                ; BOOKMARK: Display bye-screen and start selected partition
-                call    BOOTMENU_BuildGoodBye
-
-            IFDEF   FX_ENABLED
-                call    FX_EndScreenRight
-            ENDIF
-
-                call    PASSWORD_AskChangeBootPwd
-
-            IFNDEF ReleaseCode
-                ; Debug Code to terminate DOS .COM program - used for
-                ;  testing AiR-BOOT
-                ; Obsolete.
-                int     3
-                mov     ax, 6200h
-                int     21h
-                mov     es, bx
-                mov     ax, 4C00h    ; Quit program
-                int     21h
-            ENDIF
-                call    ANTIVIR_SaveBackUpMBR
-
-                ; Preload the selected menu-entry
-                ; However, this value will be wrong if eCS phase1 is
-                ; active and the installation partition is newly created.
-                ; See below for the adjustment.
-                mov     dl, byte ptr [Menu_EntrySelected]
-
-
-                ;
-                ; Prepare to start the partition.
-                ;
-                jmp     MBR_Main_StartPartition
-
-
-
-; -----------------------------------------------------------------------------
-;                                                              START PARTITION
-; -----------------------------------------------------------------------------
-
-    MBR_Main_StartPartition:
-
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpIPT
-                ;~ call    DEBUG_DumpPartitionPointers
-                ;~ call    DEBUG_DumpPartitionXref
-                ;~ call    DEBUG_DumpNewPartTable
-            ENDIF
-
-
-                ; -------------------------------------------- START PARTITION
-                ; THIS DOES NOT RETURN !
-                call    PART_StartPartition
-
-
-
-
-;
-; This entry-point restarts AiR-BOOT almost from scratch.
-; It skips the movement of the MBR but otherwise it is a functional restart.
-; The old BIOS SS:SP where the registers on entry are stored is passed along.
-; This entry-point is used for debugging purposes.
-;
-; BOOKMARK: AiR-BOOT Restart (used for debugging)
-AirbootRestart:
-        mov     bx, [OldSP]     ; Old SP when BIOS transferred control to AB
-        mov     dx, [OldSS]     ; Old SS when BIOS transferred control to AB
-        jmp     MBR_RealStart
-
-
-;
-; This entry-point displays a popup that the system is halted
-; and then halts the system.
-; It is entered on severe error conditions.
-;
-; BOOKMARK: Halt System
-HaltSystem:
-        call    VideoIO_ClearScreen
-        mov     ax,0ababh
-        mov     cx, 0C04h
-        mov     si, offset SystemHalted
-        call    SETUP_ShowErrorBox
-        ; Halt the system.
-        jmp     MBR_HaltSystem
-
-
-
-
-
-
-                ;
-                ; The following section includes various assembler modules
-                ; at the source level. These contain functionality for a
-                ; multitude of categories like disk-access, video-io, lvm,
-                ; debugging, etc. Later versions of AiR-BOOT will use such
-                ; modules at the object-file level so they can be shared
-                ; more easily.
-                ;
-
-
-; -----------------------------------------------------------------------------
-;                                                        INCLUDED FILE SECTION
-; -----------------------------------------------------------------------------
-
-; BOOKMARK: Include Section
-
-;
-; Include other code-modules here.
-;
-
-b_std_txt:
-Include REGULAR/STD_TEXT.ASM    ; Standard (non-translateable text)
-size_std_txt = $-b_std_txt
-
-b_driveio:
-Include REGULAR/DRIVEIO.ASM     ; Drive I/O, Config Load/Save
-size_driveio = $-b_driveio
-
-b_lvm:
-Include SPECIAL/LVM.ASM         ; LVM-specific code
-size_lvm = $-b_lvm
-
-b_videoio:
-Include REGULAR/VIDEOIO.ASM     ; Video I/O
-size_videoio = $-b_videoio
-
-b_timer:
-Include REGULAR/TIMER.ASM       ; Timer
-size_timer = $-b_timer
-
-b_partmain:
-Include REGULAR/PARTMAIN.ASM    ; Regular Partition Routines
-size_partmain = $-b_partmain
-
-b_partscan:
-Include REGULAR/PARTSCAN.ASM    ; Partition Scanning
-size_partscan = $-b_partscan
-
-b_bootmenu:
-Include REGULAR/BOOTMENU.ASM    ; Boot-Menu
-size_bootmenu = $-b_bootmenu
-
-b_password:
-Include REGULAR/PASSWORD.ASM    ; Password related
-size_password = $-b_password
-
-b_other:
-Include REGULAR/OTHER.ASM       ; Other Routines
-size_other = $-b_other
-
-b_main:
-Include SETUP/MAIN.ASM          ; The whole AiR-BOOT SETUP
-size_main = $-b_main
-
-b_math:
-Include REGULAR/MATH.ASM        ; Math functions (like 32-bit multiply)
-size_math = $-b_math
-
-b_txtother:
-Include TEXT/TXTOTHER.ASM       ; All translateable Text-Strings
-size_txtother = $-b_txtother
-
-b_txtmenus:
-Include TEXT/TXTMENUS.ASM       ; All translateable Menu-text
-size_txtmenus = $-b_txtmenus
-
-b_charset:
-Include TEXT/CHARSET.ASM        ; Special Video Charsets (if needed)
-size_charset = $-b_charset
-
-b_conv:
-Include REGULAR/CONV.ASM        ; Various conversion routines
-size_conv = $-b_conv
-
-b_virus:
-Include SPECIAL/VIRUS.ASM       ; Virus Detection / Anti-Virus
-size_virus = $-b_virus
-
-; [Linux support removed since v1.02]
-;Include SPECIAL/FAT16.ASM       ; FAT-16 Support
-;Include SPECIAL/LINUX.ASM       ; Linux Kernel Support
-
-b_billsuxx:
-Include SPECIAL/F00K/BILLSUXX.ASM   ; Extended Partition - Microsoft-Hack
-size_billsuxx = $-b_billsuxx
-
-b_sound:
-Include SPECIAL/SOUND.ASM       ; Sound
-size_sound = $-b_sound
-
-b_apm:
-Include SPECIAL/APM.ASM         ; Power Managment Support
-size_apm = $-b_apm
-
-
-
-;
-; Cyrillic support.
-;
-IFDEF   TXT_IncludeCyrillic
-b_ccharset:
-   Include SPECIAL/CHARSET.ASM  ; Charset Support (e.g. Cyrillic)
-size_ccharset = $-b_ccharset
-ENDIF
-
-; Various debugging routines, uses AUXIO and CONV
-IFDEF   AUX_DEBUG
-b_debug:
-Include REGULAR/DEBUG.ASM       ; Debug module
-size_debug = $-b_debug
-b_auxio:
-Include REGULAR/AUXIO.ASM       ; Com-port support for debugging
-size_auxio = $-b_auxio
-ENDIF
-
-;
-; We only include this if FX_ENABLED is defined.
-; FX is disabled when debugging to have more room for debug-code.
-; The module compiles to 50eh = 1294 bytes, so that is a lot.
-;
-IFDEF   FX_ENABLED
-b_fx:
-Include SPECIAL/FX.ASM          ; l33t Cooper-Bars/Scrolling <bg>
-size_fx = $-b_fx
-ENDIF
-
-
-                ;
-                ; End of code marker.
-                ;
-                ; BOOKMARK: END OF CODE
-                db      'BABE'
-                db      'FACE'
-
-
-; -----------------------------------------------------------------------------
-;                                                                  END OF CODE
-; -----------------------------------------------------------------------------
-code_end:
-
-
-
-
-
-
-
-
-
-
-; -----------------------------------------------------------------------------
-;                                                         BLDLEVEL INFORMATION
-; -----------------------------------------------------------------------------
-
-                ; BOOKMARK: BLDLEVEL Information
-                ORIGIN  068A0h
-
-;
-; The space between this offset and code_end is the space
-; available for code.
-;
-zzz_code_space = $ - code_end
-
-
-bld_level:
-                ;
-                ; Here we insert the OS/2 BLDLEVEL Information.
-                ; It is composed of the AiR-BOOT version-info and other
-                ; information. It is unique for each release of AiR-BOOT.
-                ;
-
-                ;
-                ; ?? When AUX_DEBUG is enabled and the above org is active,
-                ; the BLDLEVEL gets corrupted eventhough it gets inserted here
-                ; explicitly. The effect is almost like an 'OR' or a merge
-                ; with the already generated FX code.
-                ; Tasm and JWasm produce different results.
-                ; ??
-                ;
-                InsertBuildLevel
-
-
-
-
-
-;==============================================================================
-;                                                                    Sector 53
-;==============================================================================
-
-                ;
-                ; From here on, the layout of the image consists of:
-                ; - AiR-BOOT Protection Image
-                ; - AiR-BOOT Configuration
-                ; - DriveLetters
-                ; - Install Volume
-                ; - Floppy/CDROM/BIOS BOOT ENTRIES
-                ; - Internal Partition Table (IPT)
-                ; - Hidden Partition Table (HPT)
-                ; - MBR Backup
-                ;
-
-                ;
-                ; After that, the BSS follows with several runtime
-                ; variables and structures.
-                ; The BSS is not part of the image on disk of course.
-                ;
-
-; -----------------------------------------------------------------------------
-;                                                             PROTECTION IMAGE
-; -----------------------------------------------------------------------------
-
-                ;
-                ; This is the AiR-BOOT MBR Protection Image.
-                ; The stuff generated here gets overwritten when the
-                ; MBR_PROT module, which is assembled separately,
-                ; gets binary merged.
-                ; So you won't find the string below in the generated binary.
-                ;
-                ; BOOKMARK: AiR-BOOT MBR Protection Image
-                ORIGIN  06900h
-
-
-
-
-;
-; Hardcoded to 768 bytes (MBR_PROT.ASM)
-; The string below is searched for by the FIXCODE helper and *must* be
-; page (256 bytes) aligned.
-;
-; It seems to be possible to shrink the protection-image to 768 bytes.
-; That gives us an additional 256 bytes of code-space.
-; MBR-PROT.ASM,FIXCODE.C,PARTMAIN.ASM and AIR-BOOT.ASM need to be adjusted for that.
-; Also the granularity needs to change from 512 bytes to 256 bytes since
-; 6900h is not a 512-byte boundary.
-;
-; 20120908 - Done.
-;
-MBR_Protection  db 'AiR-BOOT MBR-Protection Image'
-
-                ; Just fill.
-                ;~ db  1024-($-MBR_Protection)  dup('M')
-                db  768-($-MBR_Protection)  dup('M')
-
-
-
-
-
-
-
-;==============================================================================
-;                                                                    Sector 55
-;==============================================================================
-; -----------------------------------------------------------------------------
-;                                                       AiR-BOOT CONFIGURATION
-; -----------------------------------------------------------------------------
-
-                ;
-                ; This section contains the AiR-BOOT configuration.
-                ; Note that it has a version that should be updated
-                ; when stuff is added.
-                ; Also add stuff to the end so that offsets of other
-                ; variables remain vaild.
-                ;
-                ; BOOKMARK: AiR-BOOT Configuration Sector
-                ORIGIN  06C00h
-
-Configuration:
-                ; THERE IS A NON-ASCII CHAR HERE !!
-                ; Your editor may not display this non-ASCII
-                ; character at the end if the 'AiRCFG-TABLE'
-                ; string. When this character get's deleted,
-                ; AiR-BOOT will not function because it cannot
-                ; find the config-signature which includes this
-                ; invisible character. The code of the char is: 0adh.
-                db  'AiRCFG-TABLE­'
-                db  01h, 10h, 'U' ; "Compressed" ID String
-                ; Version 1.02 was for code 1.06, 1.03 was internal
-                ; and 1.04,1.05 and 1.06 do not exist.
-                ;
-                ; 1.07 was used with AB v1.07 and introduced the phase1
-                ; system-name. For the rest it is compatible with v1.02.
-                ;
-                ; 1.0.8 is introduced with AB v1.0.8 and indicates the movement
-                ; of several components and the packing of the hideparttable.
-                ; The core configuration has not changed but the generated
-                ; configuration has. The v1.0.8 installer handles upgrading.
-                ;
-                ; It has been decided that uneven minor numbers will be
-                ; test-versions. Therefore v1.0.8 has been bumbed to v1.1.0.
-                ; 
-                ; It is not required for the config to have the
-                ; same version as the code, so in the future
-                ; the code version might be higher than the
-                ; config version if there are no changes to the latter.
-                ;
-
-CFG_LastTimeEditLow     dw  0   ; Last Time Edited Stamp (will incr every setup)
-CFG_LastTimeEditHi      dw  0   ; second 16 bit part...
-
-CFG_CheckConfig         dw  0   ; Check-Sum for Configuration
-
-CFG_Partitions          db  0   ; Count of partitions in IPT
-CFG_MiscFlags           db  1   ; Miscellaneous Flags (See EQUates)
-CFG_PartDefault         db  0   ; Default-Partition (Base=0)
-
-CFG_PartLast            db  0   ; Which Partition was booted last time ? (Base=0)
-CFG_TimedBoot           db  0   ; Timed Boot Enable (for REAL Enable look TimedBootEnable)
-CFG_TimedSecs           db  15  ; Timed Boot - How Many Seconds Till Boot
-CFG_TimedDelay          dw  123 ; Timed Boot - Delay
-CFG_TimedBootLast       db  1   ; Timed Boot - Boot From Last Drive Booted From
-CFG_RememberBoot        db  1   ; Remember Manual Boot Choice
-CFG_RememberTimed       db  0   ; Remember if Timed Boot (if both disabled: Boot Default)
-CFG_IncludeFloppy       db  1   ; Include Floppy Drives in Boot-Menu
-CFG_BootMenuActive      db  1   ; Display Boot-Menu (if Disabled: Boot Default)
-                                         ; v0.29+ -> 2 - Detailed Bootmenu
-CFG_PartitionsDetect    db  1   ; Autodetect New Partitions (Auto-Add!)
-CFG_PasswordSetup       db  0   ; Ask Password when entering Setup
-CFG_PasswordSystem      db  0   ; Ask Password when booting System
-CFG_PasswordChangeBoot  db  0   ; Ask Password when changing boot partition
-CFG_ProtectMBR          db  0   ; Protect MBR via TSR ?
-CFG_IgnoreWriteToMBR    db  0   ; Just ignore writes to MBR, otherwise crash
-CFG_FloppyBootGetName   db  0   ; Gets floppy name for display purposes
-CFG_DetectVirus         db  0   ; Detect Virus ?
-CFG_DetectStealth       db  0   ; Detect Stealth-Virus ?
-CFG_DetectVIBR          db  0   ; Detect BootRecord-Virus ?
-CFG_AutoEnterSetup      db  0   ; Automatic Enter Setup (first install!)
-CFG_MasterPassword      dw  0101Fh  ; Encoded Password (this is just CR)
-                        dw  07A53h
-                        dw  0E797h
-                        dw  0A896h
-CFG_BootPassword        dw  0101Fh  ; Another CR... ;-)
-                        dw  07A53h
-                        dw  0E797h
-                        dw  0A896h
-                        db  0   ; Rude-Protection - Removed since v0.28b
-CFG_LinuxRootPartition  db  0   ; Linux Root Partition (Base=0)
-CFG_TimedKeyHandling    db  0   ; Timed Key Handling (for Timed Boot)
-                                    ; 0 - Do Nothing
-                                    ; 1 - Reset Time
-                                    ; 2 - Stop Time
-CFG_MakeSound           db  0   ; Should be clear ;)
-CFG_FloppyBootGetTimer  db  0   ; Floppy Name will get updated every 2 secs
-CFG_ResumeBIOSbootSeq   db  1   ; If BIOS Boot Sequence should be resumed
-                                    ; 0 - Disabled
-                                    ; 1 - CD-ROM
-                                    ; 2 - Network
-                                    ; 3 - ZIP/LS120
-CFG_CooperBars          db  0   ; If Cooper Bars should be shown
-CFG_LinuxCommandLine    db  75 dup (0)  ; Linux Command Line
-CFG_LinuxKrnlPartition  db  0FFh    ; FAT-16 Linux Kernel Partition (Base=0)
-                                        ;  FFh -> Disabled
-CFG_LinuxDefaultKernel  db  'DEFAULT', 4 dup (32), 0    ; Default Kernel Name
-CFG_LinuxLastKernel     db  11 dup (32), 0  ; Last-Booted Kernel Name
-CFG_ExtPartitionMShack  db  0   ; Extended Partition M$-Hack Global Enable
-CFG_AutomaticBoot       db  0   ; Automatic Booting (only one bootup)
-CFG_PartAutomatic       db  0   ; Partition-No for automatic booting
-CFG_ForceLBAUsage       db  1   ; LBA-BIOS-API forced on any HDD I/O
-CFG_IgnoreLVM           db  0   ; Ignores any LVM-Information
-
-
-;
-; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES
-;
-
-                ;
-                ; Drive Letters.
-                ;
-                ; BOOKMARK: Stored Drive Letters
-                ORIGIN  06CB0h
-
-
-; -----------------------------------------------------------------------------
-;                                                                DRIVE LETTERS
-; -----------------------------------------------------------------------------
-
-;
-; Moved here to make room for packed hiddenparttable.
-; This gets filled when drive-letters that are assigned using the dl-feature.
-;
-DriveLetters            db  LocIPT_MaxPartitions dup (0)
-                        ; Format is:
-                        ;============
-                        ; Drive-Letter : BYTE (80h-C:, 81h-D:)
-                        ; --------------------> 1 Byte * 45
-
-
-
-; -----------------------------------------------------------------------------
-;                                                               INSTALL VOLUME
-; -----------------------------------------------------------------------------
-
-                ;
-                ; Allways have the name of the installation volume
-                ; at this offset.
-                ; So future config changes will not break auto-install.
-                ;
-                ; BOOKMARK: Name of eCS Installation Volume
-                ORIGIN  06D00h
-
-; SET(A)BOOT stores the volume name of the eCS system being installed here.
-; It is truncated to 11 chars because AiR-BOOT currently does not support
-; longer labelnames. The name is also capitalized.
-;eCS_InstallVolume       db  12 dup (0)
-;eCS_InstallVolume       db  'HIGHLOG' ,0
-;eCS_InstallVolume       db  'ECS-MIDDLE',0,0
-;eCS_InstallVolume       db  'ECS-HIGH',0,0,0,0
-;eCS_InstallVolume       db  'ECS-HIGH',0,'NO',0
-;eCS_InstallVolume       db  'KANWEG2',0
-eCS_InstallVolume       db  0,'NOPHASEONE' ,0
-
-;
-; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES
-;
-
-
-; -----------------------------------------------------------------------------
-;                                               FLOPPY/CDROM/BIOS BOOT ENTRIES
-; -----------------------------------------------------------------------------
-
-                ;
-                ; 06DABh - 06C00h = 01ABh = 427 bytes.
-                ; Entries allocated down from 06E00 boundary.
-                ;
-                ; BOOKMARK: Floppy/CD-ROM/BIOS Boot Entries
-                ORIGIN  06DABh                                  ; 427 Boundry
-
-; (432 - 5 = 427)
-AutoDrvLetter           db  0
-AutoDrvLetterSerial     dd  0
-
-; This entry is also 34 bytes long (466 - 34 = 432)
-BIOScontIPTentry:
-                        db  0, 0, 0, 0, '           '
-                        db  0, 0FEh, Flags_Bootable
-                        dw  0     ; No Checksum :)
-                        db  0, 1, 0
-                        db  0, 1, 0 ; Location of Partition/Boot Record
-                        dd  0, 0
-
-; VIR variables are for the AiR-BOOT Anti Virus Code
-; Most of them are backups of Interrupt Points, so we can check, if a
-; stealth virus is on-line, we can intercept its call.
-; Normal (non stealth) virus are trapped simply by rereading the MBR sector.
-; If a virus is found, we will restore MBR from Sektor 60/62 and stop the
-; system from working, so the user has to press reset.
-; That's saver than a Reboot.
-;
-; If a virus is found on the partition to boot, the system will ONLY halt,
-; nothing more, because we can not remove it. The user shall do it :)
-; Those viruses are detected via a real nasty method...Checksum-Checking of the
-; boot-record, which is to be executed. If it does not match the one in our
-; internal partition table, we will stop. You may however switch this detection
-; off or just reset it by switching 'VIBR Detection'.
-
-; 478 - 12 = 466                                                ; 466 Sub-Part
-CFG_VIR_INT08           dd  0    ; pointer to saved 08h entry point
-CFG_VIR_INT13           dd  0    ; pointer to saved 13h entry point
-CFG_VIR_INT1C           dd  0    ; pointer to saved 1Ch entry point
-
-; 478 Boundry (512-34)
-; This entry is also 34 bytes long
-FloppyIPTentry          db  0, 0, 0, 0, 'FloppyDrive'
-                        db  0, 0FFh, Flags_Bootable
-                        dw  0           ; No Checksum :)
-                        db  0, 1, 0
-                        db  0, 1, 0     ; Location of Partition/Boot Record
-                        dd  0, 0
-
-
-
-; -----------------------------------------------------------------------------
-;                                               INTERNAL PARTITION TABLE (IPT)
-; -----------------------------------------------------------------------------
-
-                ;
-                ; AiR-BOOT Internal Partition Table (IPT)
-                ;
-                ; BOOKMARK: Internal Partition Table
-                ORIGIN  % (image_size - 0a00h - (image_size - image_size_60secs))
-
-
-;
-; Rousseau: This is the start of the AiR-BOOT IPT
-;
-PartitionTable  db  (LocIPT_MaxPartitions * LocIPT_LenOfIPT) dup (0)
-; no-partitions detected... :]
-;                             db    1, 0, 0, 0, 'Harddisc  1'
-;                             db    0, 0FFh, Flags_BootAble
-;                             dw    0    ; No Checksum :)
-;                             db    0, 0, 1
-;                             db    0, 0, 1 ; Location of Partition/Boot Record
-;                             dd    0, 0
-
-    ; Format is:
-    ;============
-    ; SerialNumber    * 4
-    ; PartitionName   * 11
-    ; Drive           * 1
-    ; SystemID        * 1 (means the partition type)
-    ; Flags           * 1
-    ; Checksum        * 2 (for virus checking)
-    ; LocationBegin   * 3 (where the partition begins)
-    ; LocationPartTab * 3 (where the partition table is)
-    ; AbsoluteBegin   * 4 (where the partition begins, in absolute sectors)
-    ; AbsolutePartTab * 4 (where the partition table is, in absolute sectors)
-    ; --------------------> 34 Bytes (total maximum partition-entries = 30)
-
-
-
-                ; No need to check overlap here because this string will
-                ; be overwritten if the maximum partition count is reached.
-                ; So this is not a critical boundary.
-                ORG     (image_size - 600h - (image_size - image_size_60secs) / 2 - 10)
-
-                db 'AiRBOOTPAR' ; 1K internal partition table
-
-
-
-; -----------------------------------------------------------------------------
-;                                                 HIDDEN PARTITION TABLE (HPT)
-; -----------------------------------------------------------------------------
-
-                ;
-                ; Hidden Partition Table (6-bit packed as of v1.0.8)
-                ;
-                ; BOOKMARK: Hidden Partition Table (packed)
-                ORIGIN  % (image_size - 600h - (image_size - image_size_60secs) / 2)
-
-HidePartitionTable      db  (LocIPT_MaxPartitions * LocHPT_LenOfHPT) dup (0FFh)
-                        ; Format is:
-                        ;============
-                        ; PartitionPtr : BYTE * 30
-                        ; --------------------> 30 Bytes * 45
-
-;
-; Driveletters were here.
-; Moved down to make room for packed hideparttable.
-;
-
-
-                ;
-                ; End of hidden partition table.
-                ; Check overlap here for security reasons.
-                ;
-                ORIGIN  % (image_size - 200h - 5)
-
-; 79fa - end of packed hide table
-                        db  'ABHID'    ; 1K internal Hide-partition table
-
-
-
-
-;==============================================================================
-;                                                                    Sector 62
-;==============================================================================
-; -----------------------------------------------------------------------------
-;                                                                   MBR BACKUP
-; -----------------------------------------------------------------------------
-
-                ;
-                ; AiR-BOOT MBR Backup.
-                ;
-                ; BOOKMARK: MBR Backup
-                ORIGIN  % (image_size - 200h)
-
-
-MBR_BackUpMBR           db  'AiR-BOOT MBR-BackUp',\
-                            ' - Just to fill this sector with something',0
-AirBootRocks            db  'AiR-BOOT Rocks!',0
-
-                        db  (512 - ($-MBR_BackUpMBR) - 2)  dup('M')
-
-                ; End of Image signature.
-                ;
-                ORIGIN  % (image_size - 2)
-                        dw      0BABEh
-
-
-                ;
-                ; End of Image.
-                ;
-                ORIGIN  % (image_size)
-
-
-
-;
-; Terminate LDRIMAGE segment.
-;
-IFDEF   SEGMENTED
-LDRIMAGE    ENDS
-ENDIF
-
-
-
-
-
-
-
-;##############################################################################
-;                                                                  BSS SEGMENT
-;##############################################################################
-
-; BOOKMARK: BSS Segment
-
-;
-; Open BSS segment.
-;
-IFDEF   SEGMENTED
-VOLATILE        SEGMENT     USE16   PUBLIC  'BSS'
-ENDIF
-
-
-
-sobss:
-;------------------------------------------------------------------------------
-
-                            ;
-                            ; Removed ORG for BSS data to be more compatible
-                            ; with segment-concatenated layout.
-                            ;
-                            ; What happens before this space ??
-                            ; If org 0 corruption occurs.
-                            ;
-
-                            ;
-                            ; Filling hiddenparttable goes out-of-bounds !
-                            ; Fixed with 6-bit packing.
-                            ;
-
-;
-; If segmented, offsets are relative to the BSS segment.
-; They are resolved at link-time.
-; If not segmented, offsets are relative to the CODE segment.
-;
-IFDEF   SEGMENTED
-                            ORG 02400h
-ELSE
-                            ORG 0A000h
-ENDIF
-
-
-; -----------------------------------------------------------------------------
-;                                                            START OF BSS DATA
-; -----------------------------------------------------------------------------
-
-; This space actually gets initialized in PreCrap to NUL (till EndOfVariables)
-BeginOfVariables:
-
-
-; -----------------------------------------------------------------------------
-;                                                               SECTOR BUFFERS
-; -----------------------------------------------------------------------------
-; BOOKMARK: Sector Buffers
-PartitionSector     db  512 dup (?) ; Temporary Sector for Partition
-PBRSector           db  512 dup (?) ; Temporary Sector for JFS/HPFS writeback
-LVMSector           db  512 dup (?) ; Temporary Sector for LVM
-TmpSector           db  512 dup (?) ; Temporary Sector
-Scratch             db  256 dup (?) ; Scratch buffer
-
-; -----------------------------------------------------------------------------
-;                                                          NEW PARTITION TABLE
-; -----------------------------------------------------------------------------
-; Everything used to build a new IPT and reference it to the old one
-; BOOKMARK: New Partition Table
-NewPartTable                db  1536 dup (?)    ; New Partition Table
-
-
-; -----------------------------------------------------------------------------
-;                                                     NEW HIDE PARTITION TABLE
-; -----------------------------------------------------------------------------
-; BOOKMARK: New Hide-Partition Table
-NewHidePartTable            db  LocIPT_MaxPartitions * LocHPT_LenOfHPT dup (?)
-
-    ;~ even
-
-; -----------------------------------------------------------------------------
-;                                                            NEW DRIVE LETTERS
-; -----------------------------------------------------------------------------
-; BOOKMARK: Logical Drive-Letters
-NewDriveLetters             db  LocIPT_MaxPartitions dup (?)
-
-    ;~ even
-
-; -----------------------------------------------------------------------------
-;                                                         PARTITION SIZE TABLE
-; -----------------------------------------------------------------------------
-; Size-Table (6 bytes per partition)
-; BOOKMARK: Partition Size Table
-PartitionSizeTable          db  LocIPT_MaxPartitions * 6 dup (?)
-
-
-; -----------------------------------------------------------------------------
-;                                                           PARTITION POINTERS
-; -----------------------------------------------------------------------------
-; Maximum is 52 word entries till now
-; BOOKMARK: Partition Pointers
-PartitionPointers           dw  52 dup (?)
-
-; Count of total Partition Pointers
-PartitionPointerCount       db  ?
-
-; -----------------------------------------------------------------------------
-;                                                                   XREF TABLE
-; -----------------------------------------------------------------------------
-
-; X-Reference Table (holds new partnr, index is old part nr)
-; BOOKMARK: Xref Table
-PartitionXref               db  LocIPT_MaxPartitions dup (?)
-
-; -----------------------------------------------------------------------------
-;                                                               VOLUME LETTERS
-; -----------------------------------------------------------------------------
-
-; Volume-Letters
-; 0 - no LVM support
-; 1 - LVM support, but no letter
-; 'C'-'Z' - assigned drive letter
-; BOOKMARK: Volume Drive Letters
-PartitionVolumeLetters      db  LocIPT_MaxPartitions dup (?)
-
-
-
-; -----------------------------------------------------------------------------
-;                                                          MISC VARS AND FLAGS
-; -----------------------------------------------------------------------------
-; BOOKMARK: Misc Vars and Flags
-TotalHarddiscs          db  ?           ; Total harddrives (by POST)
-LBASwitchTable          db  128 dup (?) ; Bit 25-18 for CHS/LBA Switching
-NewPartitions           db  ?           ; Freshly found partitions
-                                            ; Independent of SaveConfiguration
-TooManyPartitions       db  ?           ; Non-zero if too many partitions found
-
-VideoIO_Segment         dw  ?           ; Segment for Video I/O
-
-ExtendedAbsPos          dd  ?           ; Extended Partition Absolute Position
-ExtendedAbsPosSet       db  ?           ; If Absolute Position set
-
-CurPartition_Location   dw  4 dup (?)   ; Where did current partition come from?
-CurIO_UseExtension      db  ?           ; 1-Use INT 13h EXTENSIONS
-                                        ; (filled out by PreCrap)
-CurIO_Scanning          db  ?           ; 1-AiR-BOOT is scanning partitions
-                                            ; (for detailed error message)
-
-; [Linux support removed since v1.02]
-;GotLinux                     db     ?    ; 1-Linux found
-
-
-; -----------------------------------------------------------------------------
-;                                                            MENU RELATED VARS
-; -----------------------------------------------------------------------------
-Menu_EntrySelected  db  ?   ; Which partition we boot this time...
-Menu_UpperPart      db  ?   ; Which number (Base=0) is the partition upper pos
-Menu_AbsoluteX      db  ?   ; Pos where Menu stuff starts
-Menu_TotalParts     db  ?   ; Copy of CFG_BootParts
-Menu_TotalLines     db  ?   ; Total Lines on Screen used for BootMenu
-Menu_EntryDefault   db  ?   ; Default Entry in filtered View
-Menu_EntryLast      db  ?   ; LastBooted Entry in filtered View
-Menu_EntryAutomatic db  ?   ; Automatic Entry in filtered View
-                                         ;  - All adjusted to menu locations
-
-; -----------------------------------------------------------------------------
-;                                                       PARTITION RELATED VARS
-; -----------------------------------------------------------------------------
-PartSetup_UpperPart     db  ?   ; Partition-Setup (like Menu_UpperPart)
-PartSetup_ActivePart    db  ?   ; Active Partition
-PartSetup_HiddenUpper   db  ?   ; (like Menu_UpperPart)
-PartSetup_HiddenX       db  ?   ; Pos for Hidden-Setup
-PartSetup_HiddenAdd     db  ?   ; Adjust for Hidden-Setup
-
-; -----------------------------------------------------------------------------
-;                                                   TIMER / SETUP RELATED VARS
-; -----------------------------------------------------------------------------
-TimedBootEnable     db  ?   ; Local Enable/Disable for timed boot
-TimedTimeOut        dd  ?   ; TimeOut Timer for TimedBoot (too much time here;)
-TimedSecondLeft     db  ?   ; How many seconds are left till boom ?
-TimedSecondBack     db  ?   ; To get a modification noticed
-TimedBootUsed       db  ?   ; Timed Boot used for bootup ?
-FloppyGetNameTimer  dd  ?   ; Timer for Floppy-Get-Name
-SETUP_KeysOnEntry   db  ?   ; which Shift Status was there, when booting ?
-SETUP_ExitEvent     db  ?   ; Exit Event to end SETUP
-TempPasswordEntry   db  17 dup (?)
-SETUP_OldPwd        db  17 dup (?)
-SETUP_NewPwd        db  17 dup (?)
-SETUP_VerifyPwd     db  17 dup (?)
-StartSoundPlayed    db  ?
-ChangePartNameSave  db  ?   ; Save label after user-edit ?
-SyncLvmLabels       db  ?   ; Sync LVM labels after user-edit ?
-
-
-; -----------------------------------------------------------------------------
-;                                                              FX RELATED VARS
-; -----------------------------------------------------------------------------
-FX_UseCount                 dw  ?
-FX_OverallTimer             dw  ?
-FX_WideScrollerTimer        dw  ?
-FX_WideScrollerCurPos       dw  ?
-FX_WideScrollerSpeed        db  ?
-FX_WideScrollerSpeedState   db  ?
-FX_WideScrollerDirection    db  ?
-FX_WideScrollerAbsDirection db  ?
-FX_WideScrollerBounceSpeed  db  ?
-FX_CooperBarsTimer          dw  ?
-
-; Dynamically Generated Tables - do not need to get initialized with NUL
-FX_CooperColors     db   672 dup (?) ; 7 cooper bars*96 - runtime calculated
-FX_CooperState      db     7 dup (?)
-FX_SinusPos         db     7 dup (?)
-FX_CooperPos        dw     7 dup (?)
-
-
-; -----------------------------------------------------------------------------
-;                                                               CHARSET BUFFER
-; -----------------------------------------------------------------------------
-CharsetTempBuffer   db  4096 dup (?) ; Uninitialized Charset buffer
-
-; -----------------------------------------------------------------------------
-;                                                                LVM CRC TABLE
-; -----------------------------------------------------------------------------
-LVM_CRCTable        dd   256 dup (?) ; LVM-CRC (->SPECiAL\LVM.asm)
-
-;~ ; [Linux support removed since v1.02]
-;~ FAT16_Drive             db     ?    ; FAT-16: Drive of FAT16-partition
-;~ FAT16_AbsPartitionBegin dd     ?    ; FAT-16: LBA Begin of Partition
-;~ FAT16_SecsPerCluster    db     ?    ; FAT-16: Sectors Per Cluster
-;~ FAT16_NumOfRootEntries  dw     ?    ; FAT-16: Number of Root Entries
-;~ FAT16_SecsPerFAT        dw     ?    ; FAT-16: Sectors Per FAT
-;~ FAT16_AbsFATBegin       dd     ?    ; FAT-16: LBA Begin of FAT
-;~ FAT16_AbsRootBegin      dd     ?    ; FAT-16: LBA Begin of Root
-;~ FAT16_AbsClusterBegin   dd     ?    ; FAT-16: LBA Begin of Clusters
-;~ FAT16_FATCacheSector    db     ?    ; FAT-16: FAT-Sector No in Cache
-;~ FAT16_FATCache          db   512 dup (?) ; FAT-16: FAT-Area Cache
-;~ LINUX_KernelEntries     db   680 dup (?) ; 34*20 -> Space for Kernel-Entries
-;~ LINUX_KernelNo          db     ?         ; Total of Kernels in KernelEntries
-;~ LINUX_KernelSizeTable   db   120 dup (?) ; Size-Table (6 bytes per kernel)
-
-
-;
-; Rousseau: added some stuff.
-;
-; -----------------------------------------------------------------------------
-;                                                           ECS PHASE1 RELATED
-; -----------------------------------------------------------------------------
-Phase1Active                db      ?
-OldPartitionCount           db      ?
-
-
-; -----------------------------------------------------------------------------
-;                                                              DISK PARAMETERS
-; -----------------------------------------------------------------------------
-                              ;EVEN
-HugeDisk                    db      MaxDisks  dup(?)
-TrueSecs                    dd      MaxDisks  dup(?)
-
-; BIOS geometry of the boot-drive
-; Note that heads cannot be 256 due to legacy DOS/BIOS bug
-; If Int13X is supported those values are used, otherwise the legacy values.
-BIOS_Cyls                   dd      MaxDisks  dup(?)
-BIOS_Heads                  dd      MaxDisks  dup(?)
-BIOS_Secs                   dd      MaxDisks  dup(?)
-BIOS_Bytes                  dw      MaxDisks  dup(?)
-BIOS_TotalSecs              dq      MaxDisks  dup(?)
-
-; LBA geometry of the boot-drive
-; Note that these values are taken from the BPB of a partition boot-record
-LVM_Cyls                    dd      MaxDisks  dup(?)
-LVM_Heads                   dd      MaxDisks  dup(?)
-LVM_Secs                    dd      MaxDisks  dup(?)
-LVM_Bytes                   dw      MaxDisks  dup(?)
-LVM_TotalSecs               dq      MaxDisks  dup(?)
-
-; OS/2 geometry of the boot-drive
-; Note that these values are taken from the BPB of a partition boot-record
-LOG_Cyls                    dd      MaxDisks  dup(?)
-LOG_Heads                   dd      MaxDisks  dup(?)
-LOG_Secs                    dd      MaxDisks  dup(?)
-LOG_Bytes                   dw      MaxDisks  dup(?)
-LOG_TotalSecs               dq      MaxDisks  dup(?)
-
-; Get's initialized at startup to: 00000011111111111111111111111100b
-; Meaning A,B not free; C-Z free, rest unused. (right to left)
-; Each partition with an assigned drive-letter clears a bit in this map.
-FreeDriveletterMap          dd      ?
-
-; LBA address of master LVM sector, zero if non-existant
-MasterLVMLBA                dd      ?
-
-
-; -----------------------------------------------------------------------------
-;                                                                  I13X BUFFER
-; -----------------------------------------------------------------------------
-;
-; BOOKMARK: Temporary buffer for 48h INT13X bios call.
-;
-
-            ; Size of the buffer.
-            ; this param *must* be filled in.
-            ; Code inserts it.
-i13xbuf     dw  1   dup (?)
-
-            ; The buffer itself.
-            db  126 dup(?)
-
-            ; Size of buffer calculated.
-            ; (excluding the size word at the start).
-            i13xbuf_size = $-offset i13xbuf-2
-
-            ; Some debug area.
-ott         db  512 dup(?)
-
-
-; End of transient variables.
-EndOfVariables:
-
-
-
-
-; -----------------------------------------------------------------------------
-;                                                           OLD AND NEW STACKS
-; -----------------------------------------------------------------------------
-; BOOKMARK: Storage for Old and New Stack Pointers
-;
-; These need to be outside the variable section because AiR-BOOT can restart
-; itself in debug-mode. If the OldSP and OldSS would be in the variable area,
-; they would be cleared on AiR-BOOT restart.
-;
-
-; The variable section is cleared word-wise, so it could clear one byte extra
-; depending on the alignment and size. This DD prevents the OldSP and OldSS
-; to be partly overwritten by the clearing routine.
-                            dd      ?
-
-; SS:SP from before our relocation.
-; The registers values when the BIOS transferred control to us were pushed
-; on this stack.
-
-OldSP                       dw      ?
-OldSS                       dw      ?
-
-; SS:SP currently in use.
-; They are temporarily dumped here so we can pop the resgisters from
-; the old stack to display them in debug mode.
-CurrentSP                   dw      ?
-CurrentSS                   dw      ?
-
-
-
-;
-; End of BSS segment.
-;
-eobss:
-
-;
-; Close BSS segment.
-;
-IFDEF   SEGMENTED
-    VOLATILE    ENDS
-ELSE
-    LDRIMAGE    ENDS
-ENDIF
-
-            ; BOOKMARK: End of Module
-            END     AiR_BOOT
-
Index: trunk/bootcode/AIR-BOOT.HIS
===================================================================
--- trunk/BOOTCODE/AIR-BOOT.HIS	(revision 55)
+++ 	(revision )
@@ -1,429 +1,0 @@
-;
-; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
-;
-; This file is part of AiR-BOOT
-;
-; AiR-BOOT is free software: you can redistribute it and/or modify it under
-;  the terms of the GNU General Public License as published by the Free
-;  Software Foundation, either version 3 of the License, or (at your option)
-;  any later version.
-;
-; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
-;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
-;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-;  details.
-;
-; You should have received a copy of the GNU General Public License along with
-;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
-;
-
-
-
-
-; ------------------------------------------------
-; Rousseau: Fixes, Enhancements and fresh bugs :-)
-; ------------------------------------------------
-;
-; v1.1.0-final
-; ============
-; # Bumped Version Number
-;   During v1.0.8 is was decided that odd minor versions will be test-versions.
-;   Since v1.0.8 was a test-version all the way, the final stuff has been
-;   bumped to v1.1.0, including the version of the configuration.
-;   v1.1.1 will be any following test-version, with build-dates separating
-;   test-releases. Version 1.1.2 would be a next release.
-;
-; # Updated version numbers
-;   All version identifiers updated from v1.0.8 to v1.1.0
-;   AIRBOOT.BIN, INSTALL[D2WL].EXE and SETABOOT.EXE.
-;
-; # Fixed Virus Regression
-;   Using the enhanced drive-letter feature to boot eCS installations using
-;   the same drive-letter caused the PBR-virus protection to activate.
-;   This was caused by a missing update to the PBR CRC in the AB configuration.
-;   This has been fixed.
-;
-; # Only clear bootable flag on boot-drive
-;  This interferred with booting other drives, not containing AiR-BOOT,
-;  directly from the BIOS. Now AiR-BOOT only clears the bootable-flag on the
-;  boot-drive, which is the one where AiR-BOOT got activated from.
-;
-; # Check for INT13X extensions before using them
-;   Now the availability of INT13X is checked and a popup is displayed and the
-;   system halted when they are not available. INT13X is a requirement for
-;   this and higher versions of AiR-BOOT.
-;
-; v1.0.8-rc3-bld20120909
-; ----------------------
-; # Added Show LVM Drive Letters in SETUP/BASIC #
-;   This will toggle the display of LVM drive-letters in the main menu.
-;   By default this option is enabled.
-;
-; # Reduced MBR Protection Image from 1024 bytes to 768 bytes #
-;   The fight for code-space continues...
-;   Luckily the MBR Protection Image code does not exceed 768 bytes,
-;   so that gives us another 256 bytes of precious code-space.
-;   Now the non-EN versions are happy again.
-;   Note that the alignment for the image changed from 512 to 256 bytes.
-;   MBR-PROT.ASM, FIXCODE.C, PARTMAIN.ASM and AIR-BOOT.ASM have been
-;   adjusted for this change.
-;
-; # Updating from v1.06 now also copies over drive-letters #
-;   When the user has forced drive-letters in v1.06 these will be copied over
-;   to the v1.0.8 configuration when upgrading.
-;   Because the drive-letter feature is broken in v1.07, the drive-letter
-;   table does not get copied over when upgrading from v1.07.
-;
-; # Fixed a minor bug with displaying LVM drive-letters #
-;   When more partitions that can be displayed were present, scrolling the
-;   menu would not scroll the drive-letter. Fixed.
-;
-; # Added DOCU directory for documentation #
-;   This contains the AiR-BOOT User Manual in Open Office .odt-format.
-;   To also have OS/2 INF format, a transformation script and sheet have been
-;   created to convert the .odt document to an ipf-source that can be compiled
-;   with Watcoms wipfc ipf compiler. (IBM ipfc does not work correctly)
-;   This makes it possible to write documentation in OOo Writer and export that
-;   to PDF and INF format.
-;
-; # Fixed a bug with regard to the drive-letter feature #
-;   When partitions were deleted, and some partitions above the deleted
-;   partition(s) had a drive-letter forced, these partitions would lose this
-;   assignment. This bug is also present in v1.06.
-;
-; # Implemented a very simple interactive debugger #
-;   Making use of the main menu-loop, pressing a digit or a letter activates
-;   some debugging routine. Mostly such a routine dumps a part of the internal
-;   state to the com-port. Other purposes are the interrogation of certain
-;   BIOS functions, as these can differ substantially between machines.
-;
-; # Made FX-code optional to compile in #
-;   The FX-code supplies the shifting screen-effects when 'Cooper Bars' is
-;   enabled in the setup. With the current enhancements made however,
-;   there is a continuous lack of code-space, especially when debug-code is
-;   included during development. The FX-code occupies some 1200 bytes, a space
-;   that can be put to better use. Therefore inclusion the FX-code has been
-;   made conditional to make room for either debugging or future new features.
-;
-; # Also write PBR to HPFS #
-;   Earlier, a fix was made to write a modified PBR back in case JFS was used.
-;   This was done to enable the drive-letter feature on JFS, since the PBR
-;   JFS-bootcode does not use the supplied PBR in memory.
-;   With the enhancements in the drive-letter feature, the HPFS PBR needs to
-;   be updated on disk also, to cope with zero drive-letters in the HPFS PBR.
-;
-; # Added drive-letters in display for LVM volumes #
-;   A populair request was to show drive-letter information in the menu.
-;   Drive-letters however, are OS specific and AiR-BOOT cannot accurately
-;   predict what drive-letter DOS would assign to what partition.
-;   eCS LVM drive-letters however are stored in the LVM-record and can thus
-;   be displayed. This has been implemented.
-;
-; # Enhanced drive-letter feature #
-;   Enable multiple eComStation installations using the same drive-letter
-;   This makes it possible to clone a system with XCOPY /h /e /s /t /r /v
-;   to another drive and have that boot from the same drive-letter.
-;   (Or installing to the same drive by hiding the other system)
-;
-; # Removed Force LBA Usage from Setup #
-;   When AiR-BOOT is installed on an USB-stick, there is a possibility that
-;   the CHS-geometry varies between different machines where the stick is
-;   booted. This would invalidate the CHS-values in the partition table
-;   and also the values that were stored in the AiR-BOOT's internal partition
-;   table, the IPT.
-;   To prevent more nasty things like below from happening, LBA-addressing
-;   is now always used and the setting has been removed from the setup-menu.
-;   While this may prevent AiR-BOOT from running on very old systems,
-;   the focus of AiR-BOOT development is geared towards the future.
-;   Such old systems can use v1.06.
-;
-; # Added extra MBR protection #
-;   When AiR-BOOT is active, it is only AiR-BOOT that writes to the MBR.
-;   To protect the MBR from programming errors, like the one below,
-;   any write to the MBR is now checked for validity.
-;   In essence this is protecting your MBR from bad programming done by me...
-;
-;!## Fixed a very very nasty bug that can destroy the MBR on multiple disks ##!
-;   When Force BIOS-LBA usage is disabled (the default is enabled), and the
-;   the driveletter feature is being set, and valid LVM information is present,
-;   then the MBR of the disk containing the partition of which the driveletter
-;   is changed will be overwritten with the LVM sector !
-;   In addition, if the driveletter was already in use by another partition
-;   on another disk, the MBR of that disk will be overwritten too !!
-;
-; # Fixed a nasty bug when eCS phase1 is active #
-;   When creating a partition in a free space between partitions for
-;   eCS installation, the phase1 boot-through code would calculate the
-;   wrong index for the new partition. As a result the next partition
-;   would be auto-booted instead of the newly installed system.
-;   This has been fixed.
-;   This bug is also present in v1.07 and does not apply to previous versions.
-;
-; v1.0.8-rc2-bld20120423
-; ----------------------
-; # Fixed some minor Installer bugs with SPT < 63 #
-;   Some extra var StatusCode was used instead of Status_Code.
-;   This caused too few tracks not to be reported.
-;   No installation was done however.
-;   This bug is also present in the v1.06 code.
-;
-; # Fixed Installer to handle packed hideparttable #
-;   Implemented upgrading from v1.06 directly to v1.0.8.
-;   Fixed minor stuff when upgrading from v1.06 to v1.07.
-;   Hide partition configuration is now preserved when upgrading.
-;   Fixed minor display bug when SPT < 63.
-;
-; # Implemented DOS code in C cross-platform installer
-;   There is now one C source for 4 platforms:
-;   DOS,WIN32,OS2 and LINUX (Linux portion not ready yet)
-;   This obsoletes AIRBOOT.ASM/AIRBOOT.COM.
-;   DOS Installer is now AIRBOOTD.EXE.
-;
-; # Merged 16-bit Assembler bitfield code to the Installer #
-;   The installer needs to handle the v1.0.8 configuration.
-;   This requires access to the 6-bit packed 'hideparttable'.
-;   To 'not-reinvent-the-wheel', by coding this in C, the Assembler
-;   bitfield functions are integrated using Open Watcom's '_asm' capability.
-;   It may not be pretty and the functions themselves are limited,
-;   but this method prevents maintaining seperate Asm and C implementations.
-;   Will be improved later.
-;
-; # Implemented BLDLEVEL support #
-;   AIRBOOT.BIN, the Installers and SET(A)BOOT now support OS/2 BLDLEVEL
-;   information. This enhances identification and problem tracking/solving.
-;   While BLDLEVEL is an OS/2 command, the BLDLEVEL information itself can
-;   be embedded in any binary. Invoking BLDLEVEL from within OS/2 on, let's
-;   say, the AIRBOOTL.ELF Linux executable, will also show the BLDLEVEL info.
-;   A slight deficiency of BLDLEVEL is that is forces a format on the version.
-;   So, AiR-BOOT v1.0.8 will be shown as v1.00.8.
-;
-; # Added support for Masm6 and Wasm v1.9 -- Experimental use only #
-;   Trying to assemble with Masm6 or Wasm v1.9 reveiled some interesting
-;   behavior aspects in general. While this version can now be assembled with
-;   Masm6 and Wasm too, this was only done to get a 'cross-feeling' for this
-;   project. Future versions will drop support for Tasm, Masm6 and Wasm since
-;   much conditional assembly is needed to support all of them. This was an
-;   experimental excercise only. JWasm is the assembler of choise for this
-;   project and any future versions.
-;
-; # Implemented stop scanning when max. partitions limit exceeded #
-;   Previous versions halted the system when the maximum number of partitions
-;   that can be handled (45) was exceeded.
-;   This required the user to boot from alternate media to correct the problem.
-;   Now, when the partition limit is exceeded, AiR-BOOT displays a pop-up
-;   and waits for a key-press. When the user presses a key, AiR-BOOT continues
-;   and the boot-menu is shown, enabling the user to boot a system to correct
-;   the problem. To indicate this situation, the color of the selection-bar
-;   is displayed in red.
-;
-; # Fixed hiding partitions above old max 30-partitions limit #
-;   Hiding partitions is a per partition setting and it is kept in a table
-;   in the AiR-BOOT image on disk. In previous versions, including v1.0.8-rc1,
-;   this table still held the old number of maximum partitions (30).
-;   So configuring a hide-setting for partitions >30 or hiding more than
-;   30 partitions per partition would not work properly.
-;   Unfortunately, there was no room to expand this table, since it resides
-;   just below the MBR backup, at the end of the AiR-BOOT image.
-;   To work around this, the table now uses a 6-bits packed format and the
-;   drive-letter array, which followed this table has been moved elsewhere.
-;   This is a change in the configuration layout since the previous version,
-;   so the config-version has been bumped to v1.0.8.
-;   TODO: Add upgrade-code to the installer to cope with this.
-;
-; # Removed requirement for LVM P and V name to be the same to edit #
-;   However, when both are the same before the edit, the V name will be
-;   synved to the P name to have them both the same again after the edit.
-;   If they differ, only the V name is updated.
-;
-; # Trying to edit the label of a type 0x35 partition now shows a popup #
-;   The user is informed that type 0x35 labels cannot be edited.
-;
-; # Type 0x35 partitions cannot be added to the AB-menu anymore #
-;   They are not bootable anyway. The user is informed by a popup.
-;
-; # De-tasemized the Assembler sources for JWasm compatibility #
-;   AiR-BOOT can now be built using JWasm, which is the preferred
-;   assembler as of this release. Tasm support will be dropped in the future.
-;
-; # Completely reworked the build-system #
-;   Everything is now done with Makefiles using WMake, Wlink and the
-;   C/C++ Compilers from the Open Watcom development tools together with JWasm.
-;   This obsoletes tasm, tlink and exe2bin.
-;
-; # Cross-Platform support #
-;   AiR-BOOT and it's helpers can now be built on: DOS, Win32, OS/2 and Linux.
-;
-; # Rewrote FIXCODE.ASM in C so the tool-chain is not dependent on a DOS .COM #
-;   Now FIXCODE is built platform-specific and takes care of the embedding
-;   of MPR-protection image.
-;
-; # Created FIXCODE bash-script to accomplish embedding of MBR-protection #
-;   Building on Linux requires that no DOS-tools are used in the tool-chain.
-;   This script essentially performs the same functionality but does not check
-;   certain conditions, like image-too-big, etc.
-;   It is a 'quick-hack' until the Linux version of FIXCODE is operational.
-;
-; v1.0.8-rc1-bld20120124
-; ----------------------
-; # Changed version format to be more WarpIN compatible #
-;   This is a cosmetic change only, the internal format has not changed.
-;
-; # Show LVM VolumeName instead of LVM PartitionName #
-;   Previous versions of AiR-BOOT used the LVM PartitionName as the Label
-;   if LVM-info was present for the partition.
-;   This is inconsistent with MiniLVM which shows the LVM VolumeName.
-;   Starting with v1.0.8 the LVM VolumeName is displayed.
-;
-; # LVM Partition and Volume name Synchronization #
-;   Changing the Label of a partition with LVM-info now synchronizes
-;   the LVM Partition Name with the LVM Volume Name.
-;   This is the same behavior as MiniLVM.
-;   Note however that the Label can only be changed when both the
-;   LVM PartitionName and LVM VolumeName are the same.
-;   See protected editing below.
-;
-; # Protected editing of the Label when LVM-info is present #
-;   When the LVM VolumeName differs from the LVM PartitionName, the user can
-;   edit the label but it will not be saved to the LVM record on disk.
-;   This is to protect configurations created with the classic LVM tool.
-;   Since MiniLVM assigns the same name to both the Partition and the Volume,
-;   the Label can be edited and will be saved for such partitions.
-;   To further protect a given configuration, LVM volumes with type 0x35
-;   cannot be edited at all. This is to ensure that the LVM PartitionNames
-;   remain unique when Spanning Volumes are used.
-;
-; # Editing the Label appended spaces #
-;   When editing and changing the Label of a System using SETUP,
-;   trailing spaces were stored in the LVM Volume and Partition names.
-;   These labels need to be padded with zero's.
-;   This has been fixed.
-;   This bug is also present in v1.06.
-;
-; # Reworked Primary Partition <-> LVM-info association #
-;   The previous way was to use a 1:1 correspondence between the PT-index
-;   and the LVM-index. However, when the PT is cross-linked, lower entries
-;   pointing to higher locations on the disk, or vice-versa, incorrect
-;   LVM-info was associated. Such a cross-linked PT is sometimes generated
-;   by the LVM engine when creating or deleting multiple partitions at once.
-;   Best is to intermediately save after creating or deleting a partition
-;   with (Mini)LVM.
-;   The new way is to search the LVM-entries for the partition requested.
-;
-; # Reworked MBR-code to provide two I13X signatures #
-;   The normal LVM MBR-code uses a special setup to indicate Int13X capability.
-;   It contains the instruction, MOV EAX,'X31I', and some software checks
-;   for the presence of the 'I13X' string in the MBR.
-;   However, the location of this instruction differs between eCS 1.x and
-;   eCS 2.x LVM MBR-code.
-;   For compatibility, the v1.0.8 MBR has the 'I13X' string at both locations.
-;
-; # Fixed booting older eCS installations on HPFS #
-;   When restoring systems from archive or otherwise generated systems,
-;   the HPFS BPB sometimes lacked information that AiR-BOOT did not fill in.
-;   The result was that a wrong partition was booted or that booting
-;   stalled with the "unable to operate harddisk" message.
-;   This has been fixed.
-;
-; # Fixed booting Windows from a logical partition with loader on FAT32 #
-;   Depending on the configuration, sometimes the NTLDR could not be found.
-;   This has been fixed.
-;
-; # Fixed drive-letter feature which was broken in v1.07 #
-;   a)  v1.07 did remember the drive-letter feature was active for a partition,
-;       but it failed to store the drive-letter because too few configuration
-;       sectors were saved. This resulted in arbitrary values to be assigned
-;       to the drive-letter for the partition.
-;   b)  The JFS PBR-code does not use the in-memory BPB but uses the one
-;       that is on disk. This prevented AiR-BOOT from passing the user assigned
-;       drive-letter. AiR-BOOT now inserts the drive-letter in the BPB on disk,
-;       but only if the partition is JFS.
-;       AB v1.06 is also unable to use the drive-letter feature on JFS.
-;   As a convenience, a drive-letter in the dl-feature pop-up can now be set
-;   to "Disabled" by pressing backspace.
-;   (As opposed to arrowing up/down to get to the "Disabled" entry)
-;
-; # Fixed stuck phase1 indicator when wrong name entered #
-;   When using SET(A)BOOT /4:NAME with the MEMDRIVE env-var set,
-;   and NAME being a non-existing partition, the phase1 indicator
-;   would stay stuck between reboots.
-;   This has been fixed.
-;
-; # Fixed DOS installer (AIRBOOT.COM) #
-;   Behavior should now be the same as the eCS and WIN installers.
-;   This re-enables the use of a bootable floppy or usb-stick
-;   to install AiR-BOOT.
-;
-; # Fixed booting from FloppyDrive #
-;   This is actually also broken in v1.06 when Int13X is forced on.
-;   Now regular BIOS calls are used when booting from floppydrive.
-;   A fresh AiR-BOOT installation now includes the floppydrive menu entry.
-;
-; # Fixed chainloading IBM Boot Manager #
-;   AiR-BOOT v1.06 could chainload IBM-BM but only when it resided on
-;   the first disk and was located below the 1024 cylinder and forced Int13X
-;   extensions were disabled.
-;   AiR-BOOT v1.0.8 can now chainload IBM-BM with forced Int13X extensions
-;   enabled (the default) and if IBM-BM resides above the 1024 cylinder limit.
-;   Also, chainloading IBM-BM from the second disk is supported.
-;   Do not use chainloading IBM-BM unless you really have a need to.
-;   See the AiR-BOOT Manual for "gotcha's" when using both AiR-BOOT and IBM-BM.
-;
-; # Corrected contact links #
-;   Version 1.07 still presented the old contact links to the sourceforge
-;   repository and the original author.
-;   This caused confusion with regard to issues with v1.07.
-;   This has been corrected.
-;
-; NOTE:
-;   AB v1.07 had a bug with saving and loading the correct size of the
-;   configuration. This broke the drive-letter feature.
-;   As a result, the CRC over the config was also calculated wrongly.
-;   While AB v1.0.8 fixes this, it has to use the v1.07 way of CRC calculation.
-;   Otherwise SET(A)BOOT from the eCS v2.1 would break on AB v1.0.8 because it
-;   sees a corrupt AiR-BOOT configuration.
-;   This means that the CRC over the AB config is calculated over 5 sectors
-;   instead of 7, just like in v1.07.
-;
-; NOTE:
-;   Because of space constraints most of the debug code has been commented
-;   out in this version.
-;   Possibly it will be re-enabled after code cleanup and changing to JWasm.
-;
-;
-; v1.07-final
-; ===========
-; # Huge Drives and LVM #
-;   When using disks >512GB under eComStation, the drive geometry changes to
-;   127 or 255 sectors per track. Since LVM-info is written at the last sector
-;   of a track, and AiR-BOOT uses the geometry of the MBR, it cannot find the
-;   LVM-info and the eCS partition / volume bootsector.
-;   This has been fixed.
-;   Now, when an eCS-partition is discovered and the drive is >512GB, AiR-BOOT
-;   will use the eCS geometry to locate the LVM-info and the bootsector.
-;
-; # Special loader handling #
-;   The special handling of partition boot-loaders has been enhanced to
-;   enable booting of legacy systems on huge drives with or without OS/2
-;   extended geometry.
-;
-; # eComStation boot-through after phase 1 #
-;   Special functionality is implemented to directly boot a newly
-;   installed eCS system after completing phase 1 of the installation.
-;   This works in conjuntion with the OS/2 specific SET(A)BOOT.EXE program,
-;   also part of the AiR-BOOT package.
-;
-; # Math, Debug, Conv and Aux modules #
-;   These are used for 32-bit arithmatic on 16-bit code,
-;   debug the boot process, converting between data-types
-;   and outputting log-data to the com-port.
-;
-;
-; v1.06
-; =====
-; This is the last version developed by Martin Kiewitz.
-; It serves as the base for the versions above.
-; Please do not post your feedback on sourceforge or bother Martin with
-; regard to issues with the above versions.
-; Use the eCS bug-tracker or the Trac project-page at netlabs and see the
-; documentation of this newer versions for the relevant contact information.
-
Index: trunk/bootcode/AIRBOOT.MD5
===================================================================
--- trunk/BOOTCODE/AIRBOOT.MD5	(revision 55)
+++ 	(revision )
@@ -1,1 +1,0 @@
-92fc6c0fd19a5e86b7359da216663576 *AIRBOOT.BIN
Index: trunk/bootcode/BLDLEVEL.INC
===================================================================
--- trunk/BOOTCODE/BLDLEVEL.INC	(revision 55)
+++ 	(revision )
@@ -1,161 +1,0 @@
-;
-; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
-;
-; This file is part of AiR-BOOT
-;
-; AiR-BOOT is free software: you can redistribute it and/or modify it under
-;  the terms of the GNU General Public License as published by the Free
-;  Software Foundation, either version 3 of the License, or (at your option)
-;  any later version.
-;
-; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
-;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
-;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-;  details.
-;
-; You should have received a copy of the GNU General Public License along with
-;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
-;
-
-
-
-
-;
-; OS/2 BLDLEVEL Information.
-;
-
-
-;
-; The version values in here are derived from the AiR-BOOT versions
-; as defined in VERSION.INC.
-;
-
-;
-; For some reason JWasm and Tasm don't accept 'EN' for instance, but need
-; it to be split-up. While 'iEN' does work. So all the strings that were not
-; accepted are split-up.
-;
-; Changed langid to be just one letter in build-level, conforming to the
-; AiR-BOOT signature.
-;
-
-; Vendor
-BLDLVL_VENDOR           EQU     'KIEWITZ'
-; Version
-BLDLVL_MAJOR_VERSION    EQU     AB_MAJOR_VERSION    + '0'
-BLDLVL_MIDDLE_VERSION   EQU     AB_MIDDLE_VERSION   + '0'
-BLDLVL_MINOR_VERSION    EQU     AB_MINOR_VERSION    + '0'
-; Build date
-BLDLVL_YEAR             EQU     (AB_YEAR SHR 12 AND 0Fh)+'0',(AB_YEAR SHR 8 AND 0Fh)+'0',(AB_YEAR SHR 4 AND 0Fh)+'0',(AB_YEAR AND 0Fh)+'0'
-BLDLVL_MONTH            EQU     (AB_MONTH SHR 4)+'0',(AB_MONTH AND 0Fh)+'0'
-BLDLVL_DAY              EQU     (AB_DAY SHR 4)+'0',(AB_DAY AND 0Fh)+'0'
-; Build time
-BLDLVL_HOURS            EQU     (AB_HOURS SHR 4)+'0',(AB_HOURS AND 0Fh)+'0'
-BLDLVL_MINUTES          EQU     (AB_MINUTES SHR 4)+'0',(AB_MINUTES AND 0Fh)+'0'
-BLDLVL_SECONDS          EQU     (AB_SECONDS SHR 4)+'0',(AB_SECONDS AND 0Fh)+'0'
-; Build machine
-BLDLVL_MACHINE          EQU     '*UNKNOWN*'    ; 16 chars max.
-; Build language
-IFDEF   WASM
-    ; Wasm can only process the reference to 'lang' in pass 2 because it comes
-    ; from an included file which it has not processed yet at pass 1.
-    IF2
-        BLDLVL_LANGUAGE EQU     TXT_LanguageID
-    ENDIF
-; The other assemblers process 'lang' correctly in pass 1.
-ELSE
-    BLDLVL_LANGUAGE     EQU     TXT_LanguageID
-ENDIF
-; Description
-BLDLVL_DESCRIPTION      EQU     'AiR-BOOT Boot Manager'
-
-
-
-;~ bliep   struct
-    ;~ db  '@#'
-    ;~ db  BLDLVL_VENDOR
-    ;~ db  ':'
-    ;~ db  BLDLVL_MAJOR_VERSION
-    ;~ db  '.'
-    ;~ db  BLDLVL_MIDDLE_VERSION
-    ;~ db  '.'
-    ;~ db  BLDLVL_MINOR_VERSION
-    ;~ db  '#@##1## '
-;~ bld_level_date_start    db  BLDLVL_YEAR
-    ;~ db  '/'
-    ;~ db  BLDLVL_MONTH
-    ;~ db  '/'
-    ;~ db  BLDLVL_DAY
-    ;~ db  ' '
-    ;~ db  BLDLVL_HOURS
-    ;~ db  ':'
-    ;~ db  BLDLVL_MINUTES
-    ;~ db  ':'
-    ;~ db  BLDLVL_SECONDS
-;~ bld_level_date_end    db  '      '
-    ;~ db  BLDLVL_MACHINE
-    ;~ db  '::'
-    ;~ ; Wasm can only process the reference to 'lang' in pass 2 because it
-    ;~ ;comes from an included file which it has not processed yet at pass 1.
-    ;~ IFDEF   WASM
-        ;~ IF2
-            ;~ db  BLDLVL_LANGUAGE
-        ;~ ENDIF
-    ;~ ; The other assemblers process 'lang' correctly in pass 1.
-    ;~ ELSE
-        ;~ db  BLDLVL_LANGUAGE
-    ;~ ENDIF
-    ;~ db  '::'
-    ;~ db  BLDLVL_MINOR_VERSION
-    ;~ db  '::@@'
-    ;~ db  BLDLVL_DESCRIPTION
-    ;~ db  0
-;~ bliep   ends
-
-
-;
-; This macro inserts the BLDLEVEL string at the place where it is invoked.
-;
-InsertBuildLevel    MACRO
-    db  '@#'
-    db  BLDLVL_VENDOR
-    db  ':'
-    db  BLDLVL_MAJOR_VERSION
-    db  '.'
-    db  BLDLVL_MIDDLE_VERSION
-    db  '.'
-    db  BLDLVL_MINOR_VERSION
-    db  '#@##1## '
-bld_level_date_start:
-    db  BLDLVL_YEAR
-    db  '/'
-    db  BLDLVL_MONTH
-    db  '/'
-    db  BLDLVL_DAY
-    db  ' '
-    db  BLDLVL_HOURS
-    db  ':'
-    db  BLDLVL_MINUTES
-    db  ':'
-    db  BLDLVL_SECONDS
-bld_level_date_end:
-    db  '      '
-    db  BLDLVL_MACHINE
-    db  '::'
-    ; Wasm can only process the reference to 'lang' in pass 2 because it comes
-    ; from an included file which it has not processed yet at pass 1.
-    IFDEF   WASM
-        IF2
-            db  BLDLVL_LANGUAGE
-        ENDIF
-    ; The other assemblers process 'lang' correctly in pass 1.
-    ELSE
-        db  BLDLVL_LANGUAGE
-    ENDIF
-    db  '::'
-    db  BLDLVL_MINOR_VERSION
-    db  '::@@'
-    db  BLDLVL_DESCRIPTION
-    db  0
-ENDM
-
Index: trunk/bootcode/VERSION.INC
===================================================================
--- trunk/BOOTCODE/VERSION.INC	(revision 55)
+++ 	(revision )
@@ -1,69 +1,0 @@
-;
-; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
-;
-; This file is part of AiR-BOOT
-;
-; AiR-BOOT is free software: you can redistribute it and/or modify it under
-;  the terms of the GNU General Public License as published by the Free
-;  Software Foundation, either version 3 of the License, or (at your option)
-;  any later version.
-;
-; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
-;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
-;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-;  details.
-;
-; You should have received a copy of the GNU General Public License along with
-;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
-;
-
-
-;
-; AiR-BOOT Version Information.
-;
-
-;
-; First we define the numeric (BCD) AiR-BOOT version information.
-; This is used to derive ASCII and other representations.
-;
-
-; AiR-BOOT version conform WarpIN format with implicit 0 as fourth number.
-; Note that the config-version is managed manually.
-AB_MAJOR_VERSION    EQU     1
-AB_MIDDLE_VERSION   EQU     1
-AB_MINOR_VERSION    EQU     0
-
-; The Year, Month and Day in BCD so we can easily extract nibbles.
-AB_YEAR             EQU     2013h
-AB_MONTH            EQU     04h
-AB_DAY              EQU     05h
-
-; The Hours, Minutes and Seconds, again in BCD for easy manipulation.
-AB_HOURS            EQU     01h
-AB_MINUTES          EQU     01h
-AB_SECONDS          EQU     00h
-
-; The AiR-BOOT signature uses big-endian so we shuffle some bits around.
-AB_SIG_VERSION      EQU     (((AB_MIDDLE_VERSION SHL 4) OR AB_MINOR_VERSION) SHL 8) OR AB_MAJOR_VERSION
-AB_SIG_YEAR         EQU     ((AB_YEAR SHR 8) OR (AB_YEAR SHL 8) AND 0FFFFh)
-AB_SIG_DATE         EQU     (AB_MONTH SHL 8) OR AB_DAY
-
-;
-; This macro inserts the AiR-BOOT signature at the place where it is invoked.
-;
-InsertAirbootSignature  MACRO   lang
-    db      'AiRBOOT'
-    dw      AB_SIG_DATE
-    dw      AB_SIG_YEAR
-    dw      AB_SIG_VERSION
-    ; Wasm can only process the reference to 'lang' in pass 2 because it comes
-    ; from an included file which it has not processed yet at pass 1.
-    IFDEF   WASM
-        IF2
-            db      lang
-        ENDIF
-    ; The other assemblers process 'lang' correctly in pass 1.
-    ELSE
-        db      lang
-    ENDIF
-ENDM
Index: trunk/bootcode/air-boot.asm
===================================================================
--- trunk/bootcode/air-boot.asm	(revision 57)
+++ trunk/bootcode/air-boot.asm	(revision 57)
@@ -0,0 +1,2480 @@
+;
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+
+
+
+
+
+
+
+;##############################################################################
+;                                                       AiR-BOOT / DEFINITIONS
+;##############################################################################
+
+;
+; Include AiR-BOOT Version Information.
+; This version-info is defined using simpel EQU's so it can serve as a
+; single source for other formats. The AiR-BOOT signature and the
+; OS/2 BLDLEVEL use this basic version information.
+;
+Include VERSION.INC
+
+;
+; Include OS/2 BLDLEVEL Information.
+; It uses the version-information in VERSION.INC to build it's signature.
+;
+Include BLDLEVEL.INC
+
+;
+; Include some macro's.
+; This file contains the ORIGIN macro that is used to detect overlaps.
+;
+Include ../INCLUDE/ASM.INC
+
+
+; We actually don't want to use this directive because it generates extra
+; NOP instructions that we can do without.
+; TASM also has a bug in that when the .ERR2 directive is used when
+; the .386 directive is in effect, the JUMPS directive is also active
+; and cannot be turned off.
+; NOJUMPS seems to have no effect in this situation.
+; In this case 4 NOP instructions are generated after forward referencing jump
+; instructions, to allow for automatic recoding by TASM.
+; This seems to be a TASM bug. (v2,v3,v4, dunno v5)
+IFDEF   TASM
+    ;~ JUMPS
+ENDIF
+
+
+;
+; If defined then each module is prefixed with it's name.
+; This is used for debugging purposes but it also increases code space.
+; It should be off in release code.
+;
+;~ MODULE_NAMES    EQU
+
+
+
+; -----------------------------------------------------------------------------
+;                                                                        DEBUG
+; -----------------------------------------------------------------------------
+
+;
+; Enable this to include Debug Modules and enable COM-port debugging.
+; To have room for the debug-code, the FX-code can only be enabled
+; when AUX_DEBUG is not defined.
+;
+;~ AUX_DEBUG       EQU
+
+;
+; To have FX enabled, make sure FX_ENABLE is defined.
+; There is no need (for now) to remove Cooper Bars from the setup-menu
+; because AiR-BOOT does not crash when enabling Cooper Bars while FX
+; is not compiled in. Only TAB to post-screen does not work.
+; Way to go Martin !
+;
+IFNDEF  AUX_DEBUG
+FX_ENABLED      EQU
+ENDIF
+
+;
+; If ReleaseCode is not defined, it will produce debug-able code...
+; Rousseau: This is currently *not* functional so don't use it !
+;           It was used to debug AiR-BOOT as a .COM file.
+;
+ReleaseCode             equ     -1
+
+
+; -----------------------------------------------------------------------------
+;                                                                          AUX
+; -----------------------------------------------------------------------------
+;
+; bits 7-5 = datarate
+;  (000=110,001=150,010=300,011=600,100=1200,101=2400,110=4800,111=9600 bps)
+; bits 4-3 = parity
+;  (00 or 10 = none, 01 = odd, 11 = even)
+; bit  2   = stop-bits
+;  (set = 2 stop-bits, clear = 1 stop-bit)
+; bits 1-0 = data-bits
+;  (00 = 5, 01 = 6, 10 = 7, 11 = 8)
+;
+
+; 9600 bps, no parity, 1 stop-bit, 8 bits per char
+AUX_INIT_PARMS          EQU     11100011b
+
+; Com-port for debugging, 0 is disabled
+BIOS_COM_PORT           EQU     1
+
+; Default word value for BIOS_AuxParms variable
+; Note that is has moved since v1.07
+BIOS_AUXPARMS_DEFAULT   EQU     (AUX_INIT_PARMS SHL 8) OR BIOS_COM_PORT
+
+
+
+
+; -----------------------------------------------------------------------------
+;                                                                       LABELS
+; -----------------------------------------------------------------------------
+; Address labels after code-move
+BootBaseSeg                 equ     08000h   ; Pre-boot, in the low 640K
+BootBasePtr                 equ         0h   ; We put our MBR to this location
+BootBaseExec                equ     BootBasePtr+offset MBR_RealStart
+StackSeg                    equ     07000h   ; Put the stack below the code
+
+; Use different addresses depending on whether in pre-boot
+; or debug (dos) environment.
+IFDEF ReleaseCode
+    StartBaseSeg    equ     00000h  ; Pre-boot, we are in low memory
+    StartBasePtr    equ     07C00h  ; BIOS starts our MBR at 0:7C00
+ELSE
+    ; Rousseau: where does this value come from ?
+    ; Should be CS.
+    ; Rectified in actual code by ignoring this value.
+    StartBaseSeg    equ     03A98h  ; Adjust to DOS segment
+    StartBasePtr    equ     00100h  ; We are a .COM file, DOS is active
+ENDIF
+
+
+
+; -----------------------------------------------------------------------------
+;                                                                        VIDEO
+; -----------------------------------------------------------------------------
+; Video pages, no INT 10h is used for menu-drawing etc.
+VideoIO_Page0               equ     0B800h
+VideoIO_Page1               equ     0B900h
+VideoIO_Page2               equ     0BA00h
+VideoIO_Page4               equ     0BC00h
+VideoIO_FXSegment           equ     0A000h
+
+; Special line-drawing characters
+TextChar_WinLineRight       equ     0C4h ; 'Ä'
+TextChar_WinLineDown        equ     0B3h ; '³'
+TextChar_WinRep1            equ     0D1h ; 'Ñ'
+TextChar_WinRep2            equ     0C5h ; 'Å'
+TextChar_WinRep3            equ     0CFh ; 'Ï'
+TextChar_WinRep4            equ     0B5h ; 'µ'
+TextChar_WinRep5            equ     0C6h ; 'Æ'
+TextChar_WinRep6            equ     0D8h ; 'Ø'
+
+
+
+; -----------------------------------------------------------------------------
+;                                                              PARTITION TABLE
+; -----------------------------------------------------------------------------
+; Offsets for Partition-Entries in MBR/EBRs
+LocBRPT_LenOfEntry          equ     16  ; Length of a standard MBR or EPR entry
+LocBRPT_Flags               equ     0   ; Bootable, Hidden, etc.
+LocBRPT_BeginCHS            equ     1   ; Packed CHS value
+LocBRPT_BeginHead           equ     1   ; Start head, usually < 16
+LocBRPT_BeginSector         equ     2   ; Start sector, max 63 + cyl high bits
+LocBRPT_BeginCylinder       equ     3   ; Start cylinder 8+2 bits, max 1023
+LocBRPT_SystemID            equ     4   ; Type of system using the partition
+LocBRPT_EndCHS              equ     5   ; Packed CHS value
+LocBRPT_EndHead             equ     5   ; End head, usually < 16
+LocBRPT_EndSector           equ     6   ; End sector, max 63 + cyl high bits
+LocBRPT_EndCylinder         equ     7   ; End cylinder 8+2 bits, max 1023
+LocBRPT_RelativeBegin       equ     8   ; LBA32 address of partition
+LocBRPT_AbsoluteLength      equ     12  ; 32-bit length of partition
+
+; Signature relative to start of MBR/EBR
+LocBR_Magic                 equ     510 ; Offset of 0AA55h signature
+
+; -----------------------------------------------------------------------------
+;                                                                   LVM RECORD
+; -----------------------------------------------------------------------------
+; Used as a quick compare in LVM.ASM
+LocLVM_SignatureByte0       equ     02h
+
+; Offsets for LVM Information Sector.
+; These are relative to the start of the LVM sector.
+LocLVM_SignatureStart       equ     00h ; 02h,'RMBPMFD' (8 bytes)
+LocLVM_CRC                  equ     08h ; CRC is a DWORD
+LocLVM_Heads                equ     1ch ; Number of heads
+LocLVM_Secs                 equ     20h ; Sectors per Track
+LocLVM_DiskName             equ     24h ; Name of the disk
+LocLVM_StartOfEntries       equ     3ch ; (contains maximum of 4 entries)
+LocLVM_LenOfEntry           equ     3ch ; Length of an LVM-entry
+
+; An LVM info-sector can contain information on max. 4 partitions.
+; All 4 entries will be used when there 4 primary partitions defined.
+; For logical partitions, the LVM info-sector is located below the start
+; of the logical partition and only one LVM entry is used in that logical
+; LVM info-sector.
+LocLVM_MaxEntries           equ     4   ; Max entries in an LVM-sector
+
+
+; -----------------------------------------------------------------------------
+;                                                                    LVM ENTRY
+; -----------------------------------------------------------------------------
+; Offsets for LVM entry.
+; These are relative to the start of the entry.
+LocLVM_VolumeID             equ     00h ; DWORD
+LocLVM_PartitionID          equ     04h ; DWORD
+LocLVM_PartitionSize        equ     08h ; DWORD
+LocLVM_PartitionStart       equ     0ch ; DWORD
+LocLVM_OnBootMenu           equ     10h ; is on IBM BM Bootmenu
+LocLVM_Startable            equ     11h ; is Startable (newly installed system)
+LocLVM_VolumeLetter         equ     12h ; Drive Letter for partition (C-Z or 0)
+LocLVM_Unknown              equ     13h ; unknown BYTE (can be used ?)
+LocLVM_InstallLetter        equ     13h ; unknown BYTE (can be used ?)
+
+; Truncated to 11 chars when  displayed in menu.
+; MiniLVM sets both to the same value.
+; Also, MiniLVM uses a 0-byte terminator, so the maximum length is 19d.
+; Same goes for LocLVM_DiskName.
+; These offsets are relative to an LVM entry.
+LocLVM_VolumeName           equ     14h ; 20 bytes
+LocLVM_PartitionName        equ     28h ; 20 bytes (Used in menu)
+
+; LVM constants.
+LocLVM_LabelLen             equ     14h ; Length of LVM Label (Disk/Part/Vol)
+LocLVM_DiskNameLen          equ     14h ; Length of LVM DiskName
+LocLVM_VolumeNameLen        equ     14h ; Length of LVM VolumeName
+LocLVM_PartitionNameLen     equ     14h ; Length of LVM PartitionName
+
+
+; -----------------------------------------------------------------------------
+;                                                                 AiR-BOOT IPT
+; -----------------------------------------------------------------------------
+; Offsets for IPT (Internal Partition Table)
+LocIPT_MaxPartitions        equ     max_partitions  ; 45 in v1.07+
+LocIPT_LenOfSizeElement     equ     6   ; Size of one Size-Element
+LocIPT_LenOfIPT             equ     34  ; Length of an IPT-entry
+LocIPT_Serial               equ     0   ; Serial from MBR ?
+LocIPT_Name                 equ     4   ; Name from FS or LVM  (part/vol)
+LocIPT_Drive                equ     15  ; Drive-ID             (80h,81h)
+LocIPT_SystemID             equ     16  ; Partition-Type       (06,07,etc)
+LocIPT_Flags                equ     17  ; AiR-BOOT Flags for part (see below)
+LocIPT_BootRecordCRC        equ     18  ; CRC of Boot-Record
+LocIPT_LocationBegin        equ     20  ; Begin of Partition
+LocIPT_LocationPartTable    equ     23  ; PartitionTable of Partition
+LocIPT_AbsoluteBegin        equ     26  ; Absolute Sector of Begin
+LocIPT_AbsolutePartTable    equ     30  ; Absolute Sector of PartTable
+
+
+; AiR-BOOT IPT-Flags
+LocIPT_DefaultFlags         equ     00000011b   ; Don't know if boot-able :)
+LocIPT_DefaultNonBootFlags  equ     00000010b   ; VIBR Detection is always on
+
+Flags_Bootable              equ     00000001b
+Flags_VIBR_Detection        equ     00000010b
+Flags_HideFeature           equ     00000100b
+Flags_DriveLetter           equ     00001000b   ; OS/2 FAT16/HPFS only
+Flags_ExtPartMShack         equ     00010000b   ; Ext. Partition M$-Hack req ?
+Flags_NoPartName            equ     01000000b
+Flags_NowFound              equ     10000000b   ; temp only in OldPartTable
+Flags_SpecialMarker         equ     10000000b   ; temp only for HiddenSetup
+
+FileSysFlags_BootAble       equ     00000001b   ; Is this Partition boot-able ?
+FileSysFlags_FAT32          equ     00010000b   ; FAT 32 specific name getting
+FileSysFlags_NoName         equ     00100000b   ; No Name - use PartitionName
+FileSysFlags_DriveLetter    equ     01000000b   ; DriveLetter Feature possible
+
+
+; -----------------------------------------------------------------------------
+;                                                                 AiR-BOOT HPT
+; -----------------------------------------------------------------------------
+; Hidden Partition Table
+; Length of an HPT-entry ((45 * 6 bits-per-part) / 8) * 45
+; 33.75 = 34 bytes for HPT-entry, coincidently same as length of IPT-entry.
+; Packed table !
+LocHPT_LenOfHPT             equ     34
+
+
+; -----------------------------------------------------------------------------
+;                                                              NAVIGATION KEYS
+; -----------------------------------------------------------------------------
+; Navigation keys
+Keys_Up                     equ     48h
+Keys_Down                   equ     50h
+Keys_Left                   equ     4Bh
+Keys_Right                  equ     4Dh
+Keys_PageUp                 equ     49h
+Keys_PageDown               equ     51h
+Keys_GrayPlus               equ     4Eh
+Keys_GrayMinus              equ     4Ah
+Keys_Plus                   equ     1Bh
+Keys_Minus                  equ     35h
+Keys_ENTER                  equ     1Ch
+Keys_ESC                    equ     1h
+Keys_F1                     equ     3Bh
+Keys_F10                    equ     44h
+Keys_C                      equ     2Eh     ; Add. Check for Ctrl!
+Keys_Y                      equ     2Ch
+Keys_Z                      equ     15h
+Keys_N                      equ     31h
+Keys_TAB                    equ     0Fh
+Keys_Delete                 equ     53h
+Keys_Backspace              equ     0Eh
+Keys_Space                  equ     20h
+
+Keys_Flags_EnterSetup       equ     1100b   ; Strg+Alt (AL)
+
+
+; -----------------------------------------------------------------------------
+;                                                                         MISC
+; -----------------------------------------------------------------------------
+; Initial value for the FreeDriveletterMap
+; Meaning A,B not free; C-Z free, rest unused. (right to left)
+; Each partition with an assigned drive-letter clears a bit in this map.
+; (Not implemented yet)
+InitialFreeDriveletterMap   equ     00000011111111111111111111111100b
+
+;
+; The first harddisk is BIOS coded 80h.
+; This makes a total of 128 disks that could be supported using this coding.
+; This value is used to store disk-information and this info is allocated
+; in the BSS. 64 disks ought to be enough for everybody :-)
+;
+MaxDisks                    equ     64
+
+
+
+
+
+
+;##############################################################################
+;                                                         AiR-BOOT / MAIN-CODE
+;##############################################################################
+
+;
+; Because of the TASM-bug the processor had to be changed to turn JUMPS
+; off. Existing movzx instructions were replaced with 286 equivalent code.
+; Out of range relative jumps have been recoded.
+;
+; Since version 1.0.8, JWasm is the preferred assembler and Tasm will be
+; dropped. Also, the chances of AiR-BOOT being used on a 286-machine are
+; very slim, so a future version will revert back to .386 and also incorporate
+; 32-bit code. This will enable some enhanced constructs such as scaled
+; indexing, bit-instructions, 32-bit registers and what not.
+;
+.286
+
+;
+; For Tasm, MODEL is needed for the USES directive to work.
+; So always use a model when assembling with Tasm otherwise registers on
+; function calls that use USES are not saved and restored.
+; The model itself, has no real effect because we generate a binary image
+; and not a segmented executable.
+; For the other assemblers we define no model to get rid of the default C/C++
+; segments for future object-linked versions of AiR-BOOT.
+;
+IFDEF   TASM
+    ;~ .model large, basic
+    .model  tiny,c
+ENDIF
+
+;
+; The below is used to switch between the original 1-segment (code_seg) layout
+; and the new 2-segment (code_seg and bss_data) layout.
+; It will be removed in future versions.
+; The 2-segment layout was needed for JWasm because it does not treat
+; db ? at the end of a code segment as bss-data.
+; Therefore, a true BSS segment is now used.
+; Both the code_seg and the bss_data are grouped to the logical AIRBOOT
+; segment.
+; Note that this influences the offsets in the BSS in the list-file and
+; the wdis disassembly file (.WDA).
+; They are now segment-relative. The true offset is resolved at link
+; time.
+;
+SEGMENTED   EQU
+
+    IFDEF   SEGMENTED
+        AIRBOOT     GROUP   LDRIMAGE,VOLATILE
+    ENDIF
+
+    ; Our code-segment starts here.
+    LDRIMAGE    SEGMENT     USE16   PUBLIC  'CODE'
+
+    IFDEF   SEGMENTED
+        ASSUME  CS:AIRBOOT, DS:AIRBOOT, ES:nothing, SS:nothing
+    ELSE
+        ASSUME  CS:LDRIMAGE,DS:LDRIMAGE,ES:nothing, SS:nothing
+    ENDIF
+
+
+
+;==============================================================================
+;                                                                     Sector 1
+;==============================================================================
+
+;------------------------------------------------------------------------------
+                ; We are not a .COM file at 100h but a BINARY image
+                ; of which only the 1st sector gets loaded at 0000:07c00h
+                ; by the BIOS. The code in this 1st sector is position
+                ; independent and moves itself to a new location at 8000:0000h.
+                ; Then it jumps to a new entry-point and loads the rest of
+                ; the image to the new location.
+                org 00000h
+;------------------------------------------------------------------------------
+
+
+;
+; Since AiR-BOOT is a boot-loader residing in track0, the first 512 bytes
+; have the layout of a Master Boot Record (MBR). When AiR-BOOT get's installed,
+; the first 512 bytes of this code get's merged with the Partition Table.
+; The rest is installed in the remaining sectors with sector 62 (LBA 61)
+; being the last sector used by AiR-BOOT. Sector 63 is reserved for IBM LVM.
+; The last sector used by AiR-BOOT is a copy of the MBR that AiR-BOOT makes
+; every time a system gets booted.
+;
+
+;
+; Due to the addition of an extra 'I13X' sugnature and code to preserve the
+; values of the registers on entry, the MBR-code has become a bit messy.
+; This will be cleaned-up in future versions.
+;
+
+;
+; Martin had a short jump followed by the AiRBOOT signature at first.
+; Then he encountered strange behaviour by some M$ operating-systems
+; if the the first insruction was not a CLI.
+; But there was no room to insert the CLI and of course he did not want to
+; change the location of the AiR-BOOT signature.
+; He solved this by inserting the M$ needed CLI at offset 0 followed by a short
+; jump that uses the 'A' of the AiR-BOOT signature as the jump displacement.
+;
+
+
+; -----------------------------------------------------------------------------
+;                                                            FIRST ENTRY-POINT
+; -----------------------------------------------------------------------------
+; BOOKMARK: FIRST ENTRY-POINT (Invoked by BIOS)
+; ######################################################
+; # ENTRY-POINT WHERE THE BIOS TRANSFERS CONTROL TO US #
+; ######################################################
+AiR_BOOT:
+                ; Some M$ operating systems need a CLI
+                ; here otherwise they will go beserk
+                ; and will do funny things during
+                ; boot phase, it's laughable!
+    MBR_1stOpc: cli
+
+                ; JMP-Short -> MBR_Start
+                ; Uses the 'A' from the signature as the displacement !
+    MBR_JmpOpc  db      0EBh
+
+                ; ID String, Date (DD,MM,CC,YY), Version Number, Language ID
+                ;~ db      'AiRBOOT',24h,02h,20h,12h,01h,08h,TXT_LanguageID
+    MBR_ABSig:  InsertAirbootSignature  TXT_LanguageID
+
+                    ; Total Code Sectors Count.
+                    ; Actual value will be inserted by FIXCODE.
+    MBR_CodeSecs    db      1
+
+                    ; Total Code Sectors Count, dynamically calculated.
+                    ;~ db      (code_end-$)/512
+
+                    ; Check-Sum for Code
+    MBR_CheckCode   dw      0
+
+
+
+; -----------------------------------------------------------------------------
+;                                                            THIRD ENTRY-POINT
+; -----------------------------------------------------------------------------
+; BOOKMARK: THIRD ENTRY-POINT (Relocate code)
+;
+; No single instruction below should be changed, added or removed in the code
+; below as this will cause the jump-link to go haywire.
+;
+MBR_Start:
+                ;
+                ; When we arrive here, no registers have been used yet.
+                ; So, they still contain the values the BIOS left in them.
+                ; We want to preserve those value's for later inspection
+                ; by putting them on the stack.
+                ;
+
+                ; No space for this instruction here.
+                ; We'll enable interrupts later.
+                ;sti            ; This opcode is dedicated to:
+                                ; =MICROSOFT JUMP DEPARTMENT=
+
+
+                ; Push all registers with values provided by the BIOS
+                ; on the stack.
+                pusha
+                ; Temporary save SS and SP so we still have access to this
+                ; stack after we have setup our own.
+                mov     dx,ss
+                mov     bx,sp
+
+                ;
+                ; Setup some base stuff
+                ; AX got loaded wrongly for debug, changed the instructions
+                ; without modifying the number of bytes.
+                ; Don't comment-out the redundant instruction below because it
+                ; *will* change the number of bytes and break the jump-chain.
+                ;
+
+                ; The segment we are moving ourself from (NOT USED)
+                ;mov     ax, StartBaseSeg
+                ;mov     ds, ax
+
+                ; Make sure DS points to CS.
+                push    cs
+                pop     ds
+
+                ; Setup the source and destination for the code move.
+                mov     si, StartBasePtr    ; The offset we move ourself from
+                mov     ax, BootBaseSeg     ; The target segment we move to
+                mov     es, ax
+                ;mov     di, BootBasePtr    ; The target offset we move to
+                ; Changed the instruction to make room.
+                ; So, BootBasePtr is not used !
+                ; The offset in the target segment is assumed to be 0000
+                ; anyway.
+                xor     di,di
+                ;sti
+
+            ; Depending on pre-boot or debug.
+            ; Note that ReleaseCode is obsolete, so we will always move
+            ; 256 words; aka this sector, the MBR.
+            IFDEF ReleaseCode
+                mov     cx, 256          ; Pre-boot environment
+            ELSE
+                mov     cx, 32700        ; Old Debug environment (move ~64kB)
+            ENDIF
+
+                ;
+                ; This moves this 512-byte sector, loaded by the BIOS at
+                ; 0000:7c00 to 8000:0000.
+                ;
+                cld
+                rep     movsw
+
+                ; Code an intersegment jump to the new location.
+                ; jmp    BootBaseSeg:BootBaseExec
+                ; Note that DX:BX containts the old SS:SP.
+                db      0EAh
+                dw      BootBaseExec    ; This is MBR_RealStart + BootBasePtr
+                dw      BootBaseSeg     ; This is 08000h
+
+
+
+
+; -----------------------------------------------------------------------------
+;                                                         SIMPLE MBR FUNCTIONS
+; -----------------------------------------------------------------------------
+;
+; Some MBR-functions to provide absolute minimum functionality.
+;
+
+;
+; BOOKMARK: Halt System
+; Entry-point for halting the system.
+;
+MBR_HaltSystem:
+                mov     ax, 8600h
+                xor     cx, cx
+                mov     dx, 500
+                int     15h         ; Wait to display the whole screen :]
+MBR_HaltSys:
+                cli
+                jmp     MBR_HaltSys
+
+
+                ;
+                ; Some small space for variables.
+                ;
+                ORIGIN  0003Ch
+
+; Comport settings.
+; It had to be moved to create room for the double I13X signature.
+; It cannot be in the config-area (sector 55)
+; because that area is crc-protected and would not allow 'poking'.
+BIOS_AuxParms   dw      BIOS_AUXPARMS_DEFAULT
+
+
+IFDEF   AUX_DEBUG
+reserved        db      6   dup('X')
+ELSE
+reserved        db      6   dup(0)
+ENDIF
+
+
+
+
+; -----------------------------------------------------------------------------
+;                                                           SECOND ENTRY-POINT
+; -----------------------------------------------------------------------------
+                ;
+                ; We arrive here after the first jump using the 'A' of the
+                ; AiR-BOOT signature. So we ensure the jump is always at
+                ; this offset. We jump here, because Martin needed to
+                ; insert a CLI on start and did not want to change the
+                ; AiR-BOOT signature because of Microsoft inventions...
+                ;
+                ORIGIN  00044h
+
+                ; Jump again...
+                ; This time to the code that relocates to 8000:0000.
+                ; BOOKMARK: SECOND ENTRY_POINT (Skipped over AB signature)
+                jmp     MBR_Start
+
+;
+; Entry-point when loading fails.
+;
+                db      'LOAD ERROR!', 0
+MBR_LoadError   Proc Near
+        mov     si, offset $-12
+        push    cs
+        pop     ds
+        call    MBR_Teletype
+    MBRLE_Halt:
+        jmp     MBRLE_Halt
+MBR_LoadError   EndP
+
+;
+; Entry-point when saving fails.
+;
+                db      'SAVE ERROR!', 0
+MBR_SaveError   Proc Near
+        mov     si, offset $-12
+        push    cs
+        pop     ds
+        call    MBR_Teletype
+    MBRSE_Halt:
+        jmp     MBRSE_Halt
+MBR_SaveError   EndP
+
+
+; Put text on the screen using the BIOS tele-type function.
+; No attributes like color are supported.
+;        In: SI - Pointer to begin of string (EOS is 0)
+; Destroyed: SI
+MBR_Teletype    Proc Near   Uses ax bx cx
+        mov     ah, 0Eh
+        mov     bx, 7
+    MBRT_Loop:
+        lodsb
+        or      al, al
+        jz      MBRT_End
+        int     10h
+        jmp     MBRT_Loop
+    MBRT_End:
+        ret
+MBR_Teletype    EndP
+
+;
+; Rousseau: DO NOT ADD CODE TO THIS SECTION !
+;
+
+;        In: BX     - Base Check
+;            DS:SI  - Pointer to 512-byte-area to be included
+;       Out: BX     - Base Check Result
+; Destroyed: SI will get updated (+512)
+MBR_GetCheckOfSector    Proc Near   Uses ax cx
+        mov     cx, 256
+    MBRGCOS_Loop:
+        lodsw
+        xor     ax, 0BABEh
+        xor     bx, ax
+        loop    MBRGCOS_Loop
+        or      bx, bx
+        jnz     MBRGCOS_NoFixUp
+        mov     bx, 1                   ; dont allow 0, cause 0 == empty
+    MBRGCOS_NoFixUp:
+        ret
+MBR_GetCheckOfSector    EndP
+
+
+
+
+
+
+; -----------------------------------------------------------------------------
+;                                                    ENTRY-POINT OF MOVED CODE
+; -----------------------------------------------------------------------------
+
+;
+; When we arrive here we are running at 8000:0000.
+; DX:BX contains the SS:SP of the old stack.
+;
+
+;
+; This is where the rest of AiR-BOOT gets loaded from track0.
+;
+; BOOKMARK: Running at relocated position (Load additional sectors)
+;------------------------------------------------------------------------------
+MBR_RealStart:
+                ;
+                ; Setup new stack and other segment registers.
+                ;
+                mov     ax, StackSeg    ; 07000h, below the moved code
+                mov     ss, ax
+                mov     sp, 7FFEh       ; Even is better
+                push    es              ; ES holds segment where we moved to
+                pop     ds              ; Set DS=ES to Code Segment
+
+                ;
+                ; Push the old SS:SP which was saved in DX:BX on the new stack.
+                ;
+                push    dx      ; Old SS
+                push    bx      ; Old SP
+
+
+            ; If we are in debug-mode, all code is moved already,
+            ; so we can directly jump to it.
+            ; One difference is that in debug-mode, the whole .com image is
+            ; loaded by dos while when air-boot is active from the MBR it
+            ; does the loading itself.
+            ; (This debug environment is obsolete and dis-fuctional)
+            IFNDEF ReleaseCode
+                jmp     AiR_BOOT_Start
+            ENDIF
+
+                ; Load the configuration-sectors from disk.
+                ; These are the main configuration sector and the various
+                ; tables that follow it upto but not including the MBR backup.
+                mov     bx, offset Configuration
+                mov     dx, 0080h       ; First harddrive
+                mov     cx, 0037h       ; Config sector is at 55d (CHS)
+
+                ; Call the i/o-part
+                call    MBR_LoadConfig
+                jnc     MBR_ConfigCopy_NoError
+
+                ; Some error occured
+    MBR_ConfigCopy_LoadError:
+                call    MBR_LoadError               ; Will Abort BootUp
+
+                ; Load the code sectors
+    MBR_ConfigCopy_NoError:
+                mov     bx, offset FurtherMoreLoad  ; Directly after MBR in mem
+                mov     dx, 0080h                   ; First harddrive
+                mov     cx, 0002h                   ; Start at second sector
+                mov     ah, 02h                     ; Read sectors
+
+                ; This location is in the MBR.
+                ; It is filled in by the FIXCODE helper that post processes
+                ; the AIRBOOT loader image after it has been built.
+                ; FIXCODE also embeds the MBR protection-image.
+                mov     al, ds:[10h]                ; Number of code sectors
+                int     13h                         ; Call BIOS service
+                jnc     MBR_RealStart_NoError
+                jmp     MBR_ConfigCopy_LoadError
+
+
+                ; [v1.05+]
+                ; Signature for IBM's LVM to detect our "powerful" features ;)
+                ;
+                ; [v1.0.8+]
+                ; Reworked MBR code to be able to create a
+                ; double 'I13X' signature.
+                ; MBR's created with LVM eCS v1.x have the signature at 0d5h
+                ; MBR's created with LVM eCS v2.x have the signature at 0d0h
+                ; See eCS bugtracker issue #3002
+                ;
+                ; Update: These are actually MOV EAX,'X31I' instructions
+                ; in the eCS LVM MBR-code. They are at different places in
+                ; the v1.x and v2.x LVM MBR-code. Other code might depend on
+                ; their presence. Let's protect their location.
+                ORIGIN  000d0h
+                db      'I13X',0,'I13X',0
+
+
+    MBR_RealStart_NoError:
+                ; Now Check Code with CheckSum
+                mov     si, offset FurtherMoreLoad
+
+                ;movzx   cx, bptr ds:[10h]
+                mov     cl, ds:[10h]
+                mov     ch,0
+
+                ; Claculate checksum
+                xor     bx, bx
+    MBR_RealStart_CheckCodeLoop:
+                call    MBR_GetCheckOfSector
+                loop    MBR_RealStart_CheckCodeLoop
+
+
+                cmp     MBR_CheckCode, bx
+                je      MBR_RealStart_CheckSuccess
+
+                mov     si, offset TXT_ERROR_Attention
+                call    MBR_Teletype
+                mov     si, offset TXT_ERROR_CheckCode
+                call    MBR_Teletype
+                mov     si, offset TXT_ERROR_CheckFailed
+                call    MBR_Teletype
+                jmp     MBR_HaltSystem
+
+
+                ;
+                ; OK, all loading went fine so the rest of the code
+                ; is present now, so we jump to it.
+                ; The old SS:SP is still on the stack.
+                ;
+    MBR_RealStart_CheckSuccess:
+                jmp     AiR_BOOT_Start
+
+
+
+
+
+;------------------------------------------------------------------------------
+Include TEXT/TXTMBR.ASM                        ; All translateable Text in MBR
+;------------------------------------------------------------------------------
+
+
+
+; This is an ugly kludge function to create space for the
+; double 'I13X' signature.
+; It loads the configuration sectors, but bx,cx and dx are not initialized
+; in this function. That's done around line 500.
+; Putting this few bytes here creates just enough room.
+MBR_LoadConfig  Proc Near
+        ; Changed from conditional assembler to calculated value
+        ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"
+        ; Size of the ab-configuration in 512 byte sectors
+        mov     al, (MBR_BackUpMBR - Configuration) / 200h
+        mov     ah,02h
+        int     13h
+        ret
+MBR_LoadConfig  EndP
+
+
+                ; Disk Signature
+                ; Note that in an LVM 2.x MBR this collides
+                ; with the dummy PTE that it uses to look for IBM-BM
+                ; on the second harddisk.
+                ORIGIN  001B8h
+
+                ; AiR-BOOT installer will merge the field
+                ; from the MBR it replaces.
+    MBR_DrvSig  db      'DSIG'
+
+                ; Unused word at 01BCh.
+                ; An LVM 2.x MBR puts 0CC33h here.
+                ; AiR-BOOT installer will merge the field
+                ; from the MBR it replaces.
+    MBR_Spare   dw      '$$'
+
+
+                ;
+                ; Partition Table.
+                ;
+                ORIGIN  001BEh
+
+                ; The 4 entries just for show.
+                ; AiR-BOOT installer will merge them from the MBR it replaces.
+    MBR_PartTable:
+                db      16  dup('0')
+                db      16  dup('1')
+                db      16  dup('2')
+                db      16  dup('3')
+
+                ; Boot Sigbature
+    MBR_Sig     dw      0aa55h
+
+
+
+
+
+
+
+;==============================================================================
+;                                                                     Sector 2
+;==============================================================================
+
+; -----------------------------------------------------------------------------
+;                                                           FILE-SYSTEM TABLES
+; -----------------------------------------------------------------------------
+
+
+                ORIGIN  00200h
+
+;
+; Everything beyond this point is loaded on startup
+; and is NOT existant at first
+;
+FurtherMoreLoad:
+
+;
+; Filesystem table correlating id with name.
+;
+
+                ; first Normal-Partition-ID, Hidden-Partition-ID
+                ; and Default-Partition-Flags.
+                ; 01h -> Boot-Able
+                ; 10h -> FAT32 - Name Getting Scheme
+                ; 20h -> No Name To Get (use Partition Name from IPT)
+                ; 40h -> 'L' flag possible
+                db      'AiRSYS-TABLE'
+FileSysIDs      db      01h, 11h,01h, 04h,014h,01h, 06h,016h,41h, 0Eh,00Eh,01h
+                db      07h, 17h,41h, 08h,017h,21h, 35h,035h,20h,0FCh,017h,41h
+                db      09h, 19h,11h, 0Bh,01Bh,11h, 0Ch,01Ch,11h,0EBh,0EBh,01h
+                db      63h, 63h,21h, 81h,081h,21h, 83h,083h,21h, 40h,040h,21h
+                db     0A5h,0A5h,21h,0A6h,0A6h,21h, 82h,082h,20h,0A7h,0A7h,21h
+                db      63h, 63h,21h, 4Dh,04Dh,21h, 4Eh,04Eh,21h, 4Fh,04Fh,21h
+                db      01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
+                db      01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
+                db      01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
+                db      01h, 01h,01h,0FDh,0FDh,20h, 84h,084h,20h,0A0h,0A0h,20h
+                db      0Ah, 0Ah,20h,0FEh,0FEh,21h,0FFh,0FFh,21h, 00h,000h,21h
+                db      16 dup (0)
+
+FileSysNames    db  'FAT12   ', 'FAT16   ', 'FAT16Big', 'FAT16Big'
+                db  'HPFS    ', 'NTFS    ', 'LVM-Data', 'JFS     '
+                db  'FAT32   ', 'FAT32   ', 'FAT32   ', 'BeOS    '
+                db  'Unix    ', 'Minix   ', 'Linux   ', 'Venix   ' ; x row ;)
+                db  'BSD/386 ', 'OpenBSD ', 'LinuxSwp', 'NeXTSTEP'
+                db  'GNU HURD', 'QNX     ', 'QNX     ', 'QNX     '
+                db  '        ', '        ', '        ', '        '
+                db  '        ', '        ', '        ', '        '
+                db  '        ', '        ', '        ', '        '
+                db  '        ', 'Kernel  ', '        ', '0V-Award'
+;                db  'OS/2 Man', 'via BIOS', 'Floppy  ', 'Unknown '
+                db  'OS2-BMGR', 'via BIOS', 'Floppy  ', 'Unknown '
+                         ; -> 44 Partition-Types
+
+
+
+
+
+
+;==============================================================================
+;                                                                     Sector 3
+;==============================================================================
+
+; -----------------------------------------------------------------------------
+;                               ENTRY-POINT AFTER LOADING THE REST OF THE CODE
+; -----------------------------------------------------------------------------
+
+                ORIGIN  00400h
+
+
+; ############################################
+; # ENTRY-POINT AFTER ALL THE INITIAL HASSLE #
+; ############################################
+; BOOKMARK: AiR_BOOT_Start (AiR-BOOT now completely loaded)
+AiR_BOOT_Start:
+
+
+        ;
+        ; Enable interrupts.
+        ;
+        sti
+
+        ;
+        ; Pop the old SS:SP from the stack and save it in the BSS.
+        ; Note that this is outside the normal variable area that gets cleared.
+        ; This allows AiR-BOOT to restart itself when debugging and come-up
+        ; with access to the original values of registers the BIOS passed.
+        ;
+        pop     [OldSP]
+        pop     [OldSS]
+
+
+; -----------------------------------------------------------------------------
+;                                                      IBM-BM BOOT PREPARATION
+; -----------------------------------------------------------------------------
+        ;
+        ; Since v1.0.8, AiR-BOOT is able to chainload IBM-BM.
+        ; When IBM-BM resides above the 1024-cylinder limit, the 'I13X'
+        ; signature is required at 3000:0000, FS needs to contain 3000h
+        ; and the 32-bit LBA address needs to follow the 'I13X' signature.
+        ; For booting IBM-BM from the second disk, a copy of the MBR of the
+        ; first disk is also required at 0000:7E00.
+        ; This information is derived from the eCS 2.x LVM MBR.
+        ;
+        ; So, now is a good time to copy the MBR of the first disk to
+        ; 0000:7E00 in case the partition that will be started is IBM-BM.
+        ; This copy is located at 8000:0000 and DS already points to this
+        ; segment. The 'I13X' signature and FS will be setup later.
+        ;
+        pusha                           ; Save all the general purpose regs
+        push    es                      ; We need ES too, so save its value
+        xor     ax,ax                   ; Segment 0000h
+        mov     es,ax                   ; Make ES point to it
+        mov     si,offset BootBasePtr   ; Start of AiR-BOOT which has the MBR
+        mov     di,7e00h                ; Destination for the MBR for IBM-BM
+        mov     cx,100h                 ; 256 words = 512 bytes
+        cld                             ; Direction from low to high
+        rep     movsw                   ; Copy the 256 words of the MBR
+        pop     es                      ; Restore previous value of ES
+        popa                            ; Restore all the general purpose regs
+
+
+; -----------------------------------------------------------------------------
+;                                                                      PRECRAP
+; -----------------------------------------------------------------------------
+
+                ;
+                ; First it clears the BSS area.
+                ; Note that the old SS:SP is stored outside this area so this
+                ; does not get lost.
+                ; Then initialize various runtime variables and structures.
+                ;
+                ; BOOKMARK: Pre Crap
+                call    PRECRAP_Main
+                ; Number of harddisks and other system-info is now known.
+
+            ;!
+            ;! DEBUG_BLOCK
+            ;! Let's see what the BIOS supplied us with...
+            ;! Uncomment below to activate.
+            ;!
+            __DUMP_BIOS_REGS__  EQU
+            IFDEF   AUX_DEBUG
+                IFDEF   __DUMP_BIOS_REGS__
+                    pushf
+                    pusha
+                    ; Print title.
+                    mov     si,offset [bios_reg]
+                    call    AuxIO_Print
+                    ; Save the current stack (SS:SP).
+                    mov     ax,ss
+                    mov     [CurrentSS],ax
+                    mov     [CurrentSP],sp
+
+                    ; Restore the old stack.
+                    mov     ss,[OldSS]
+                    mov     sp,[OldSP]
+
+                    ; Pop the registers with the BIOS values.
+                    popa
+                    ; Push them back for AiR-BOOT restart (debug mode).
+                    pusha
+                    ; Dump them to the serial-port.
+                    call    DEBUG_DumpRegisters
+                    ; Restore the current stack.
+                    mov     ax,[CurrentSS]
+                    mov     ss,ax
+                    mov     sp,[CurrentSP]
+
+                    ; Restore registers.
+                    popa
+                    popf
+                ENDIF
+            ENDIF
+
+
+
+
+            ;!
+            ;! DEBUG_BLOCK
+            ;! Dump the registers at this point.
+            ;! Uncomment below to activate.
+            ;!
+            IFDEF   AUX_DEBUG
+                ;~ call    DEBUG_DumpRegisters
+                ; Dump drive-letters of dl-feature before partitions are
+                ; scanned and processed.
+                call    DEBUG_DumpDriveLetters
+                call    DEBUG_DumpVolumeLetters
+                call    DEBUG_DumpPartitionXref
+            ENDIF
+
+; -----------------------------------------------------------------------------
+;                                                               PARTITION SCAN
+; -----------------------------------------------------------------------------
+                ;
+                ; BOOKMARK: Scan all partitions
+                ;
+                call    PARTSCAN_ScanForPartitions
+                ; Internal Partition Table is now populated.
+
+            ;!
+            ;! DEBUG_BLOCK
+            ;! Dump various tables.
+            ;! Uncomment below to activate.
+            ;!
+            IFDEF   AUX_DEBUG
+                ;~ call    DEBUG_DumpIPT
+                ;~ call    DEBUG_DumpPartitionPointers
+                ;~ call    DEBUG_DumpNewPartTable
+                ;~ call    DEBUG_DumpDriveLetters
+                call    DEBUG_DumpDriveLetters
+                call    DEBUG_DumpVolumeLetters
+                call    DEBUG_DumpPartitionXref
+            ENDIF
+
+
+; -----------------------------------------------------------------------------
+;                                 RESTORE FORCED DRIVELETTER CORRELATION [LVM]
+; -----------------------------------------------------------------------------
+
+                ;
+                ; Reconnect forced drive-letters to their corresponding
+                ; partitions.
+                ;
+                ; BOOKMARK: Update Driveletters so they are in-sync again
+                call    PARTSCAN_UpdateDriveLetters
+                ; Driveletter <-> Partition correlation is now restored.
+
+
+
+            ;!
+            ;! DEBUG_BLOCK
+            ;! Dump various tables.
+            ;! Uncomment below to activate.
+            ;!
+            IFDEF   AUX_DEBUG
+                ;~ call    DEBUG_DumpIPT
+                ;~ call    DEBUG_DumpPartitionPointers
+                ;~ call    DEBUG_DumpNewPartTable
+                ;~ call    DEBUG_DumpDriveLetters
+                call    DEBUG_DumpDriveLetters
+                call    DEBUG_DumpVolumeLetters
+                call    DEBUG_DumpPartitionXref
+            ENDIF
+
+
+; -----------------------------------------------------------------------------
+;                                                            SHOW WE ARE ALIVE
+; -----------------------------------------------------------------------------
+
+                ;
+                ; Put some info about AiR-BOOT and the system on the screen.
+                ;
+
+                ; Display number of physical disks found
+                mov     si, offset DisksFound
+                call    MBR_Teletype
+                mov     al, [TotalHarddiscs]
+                call    VideoIO_SyncPos
+                call    VideoIO_PrintByteDynamicNumber
+                xor     si,si
+                call    MBR_TeletypeNL
+
+                ; Display number of partitions found
+                mov     si, offset PartitionsFound
+                call    MBR_Teletype
+                mov     al, [CFG_Partitions]
+                call    VideoIO_SyncPos
+                call    VideoIO_PrintByteDynamicNumber
+
+                ; Dump summier disk-info for disks found
+                xor     si,si
+                call    MBR_TeletypeNL
+                call    MBR_TeletypeNL
+                call    VideoIO_SyncPos
+                mov     dl,80h
+                call    VideoIO_DumpDiskInfo
+
+
+
+
+
+; -----------------------------------------------------------------------------
+;                                                     eComStation PHASE1 CHECK
+; -----------------------------------------------------------------------------
+
+                ;
+                ; BOOKMARK: Check for eCS being installed
+                ; Here we check if eComStation v2.1+ is being installed.
+                ; If so, we forgo the menu and directly boot it.
+                ;
+
+                ; If the first byte of the name of the Install Volume is not 0
+                ; then we potentially have a phase1 boot.
+                test    byte ptr [eCS_InstallVolume],0ffh
+                ; Nope, so continue normally.
+                jz      MBR_Main_ContinueBoot
+
+                ; Setup phase1.
+                ; It is still possible that a name was set for the
+                ; Install Volume that does not exist.
+                ; In that case CY will be clear and AL=0FFh.
+                call    PART_SetupPhase1
+                ; Oops, Install Volume not found, continue normally.
+                jnc     MBR_Main_ContinueBoot
+
+
+                ;
+                ; == Install Volume Found ==
+                ;
+
+
+            ;!
+            ;! DEBUG_BLOCK
+            ;! Dump various tables.
+            ;! Uncomment below to activate.
+            ;!
+            IFDEF   AUX_DEBUG
+                ;~ call    DEBUG_DumpIPT
+                ;~ call    DEBUG_DumpPartitionPointers
+                ;~ call    DEBUG_DumpPartitionXref
+                ;~ call    DEBUG_DumpNewPartTable
+                ;~ call    DEBUG_DumpDriveLetters
+            ENDIF
+
+
+                ; BOOKMARK: Scan for Partitions (Only if eCS install going on)
+                ; Because one or more partitions are possibly added, the
+                ; PartitionXref table is not 'in sync' and could cause the
+                ; wrong system to be automatically booted.
+                ; So we rescan all partitions causing the PartitionXref
+                ; table to be filled with correct values so the auto-boot
+                ; from the new partition will work correctly.
+                call    PARTSCAN_ScanForPartitions
+
+
+            ;!
+            ;! DEBUG_BLOCK
+            ;! Dump various tables.
+            ;! Uncomment below to activate.
+            ;!
+            IFDEF   AUX_DEBUG
+                ;~ call    DEBUG_DumpIPT
+                ;~ call    DEBUG_DumpPartitionPointers
+                ;~ call    DEBUG_DumpPartitionXref
+                ;~ call    DEBUG_DumpNewPartTable
+                ;~ call    DEBUG_DumpDriveLetters
+            ENDIF
+
+                ; Setup automatic boot to forgo the Menu.
+                ; PART_SetupPhase1 has filled in the other variables.
+                mov     byte ptr [CFG_AutomaticBoot],1
+
+                ;
+                ; At this point the AiR-BOOT configuration has been altered
+                ; to automatically boot the newly installed system without
+                ; displaying the menu.
+                ; Code further down the road will take care of that.
+                ;
+                jmp     MBR_Main_ContinueBoot
+
+
+
+
+    ;
+    ; Wether a new system is being installed or not,
+    ; booting continues here.
+    ;
+    MBR_Main_ContinueBoot:
+
+                ;
+                ; Inform user how to switch between post-screen and menu
+                ; by putting this info on the screen.
+                ;
+                xor     si,si
+                call    MBR_TeletypeNL
+                xor     si,si
+                call    MBR_TeletypeNL
+                call    MBR_TeletypeSyncPos
+                xor     si,si
+                call    MBR_TeletypeNL
+                call    MBR_TeletypeNL
+                mov     si, offset ShowMenu
+                call    MBR_TeletypeBold
+
+
+                ;
+                ; Debug stop.
+                ;
+
+                ;
+                ; ####################### WAIT FOR KEY ########################
+                ;
+
+                ; Wait for key so we can see debug log if ab-menu hangs.
+                ;~ xor     ax, ax
+                ;~ int     16h
+                ;call     SOUND_Beep
+
+
+                ; Copy BIOS POST to Second Page
+                mov     ax, VideoIO_Page1
+                call    VideoIO_BackUpTo
+
+                ;call     SOUND_Beep
+
+
+                ; BOOKMARK: Save Configuration
+                ; Save configuration so phase1 boot-through is disabled
+                ; on next boot.
+                mov     byte ptr [eCS_InstallVolume], 0
+                call    DriveIO_SaveConfiguration
+
+
+
+                ;
+                ; See if setup needs to be entered.
+                ;
+    MBR_Main_ReEnterSetup:
+                call    SETUP_CheckEnterSETUP
+
+                ;
+                ; Do some post processing.
+                ;
+                ; BOOKMARK: After Crap
+                call    AFTERCRAP_Main
+
+                ; [Linux support removed since v1.02]
+                ; Now get FAT16-Linux Kernel Partition, If requested
+                ;cmp     [CFG_LinuxKrnlPartition], 0FFh
+                ;je      MBR_Main_NoLinuxKrnlPartition
+                ;call    LINUX_InitFAT16access
+    ;MBR_Main_NoLinuxKrnlPartition:
+
+
+
+    MBR_Main_ReEnterBootMenuPre:
+                ; SetUp PartitionPointers for BootMenu (filter non-bootable)
+                call    PART_CalculateMenuPartPointers
+
+                ; ...and count that one...
+                cmp     byte ptr [PartitionPointerCount], 0
+                jne     MBR_Main_SomethingBootAble
+                mov     si, offset TXT_NoBootAble
+                call    MBR_Teletype
+                jmp     MBR_HaltSystem
+
+    MBR_Main_SomethingBootAble:
+                ; FixUp Values, define Timed Setup booting, etc.
+                call    PART_FixUpDefaultPartitionValues
+
+
+
+                ; -------------------------------------------------- BOOT-MENU
+    MBR_Main_ReEnterBootMenu:
+                call    BOOTMENU_ResetMenuVars ; reset has to be done
+                test    byte ptr [CFG_AutomaticBoot], 1
+                jz      MBR_Main_NoAutomaticBooting
+
+
+                ; ------------------------------------------ AUTOMATIC BOOTING
+                ; Select automatic partition, disable automatic booting for
+                ;  next time and boot system...
+                mov     byte ptr [CFG_AutomaticBoot], 0
+                call    PASSWORD_AskSystemPwd
+                mov     al, Menu_EntryAutomatic
+
+                ;mov     al, 2
+
+                mov     Menu_EntrySelected, al      ; zero based
+                jmp     MBR_Main_NoBootMenu
+
+
+    MBR_Main_NoAutomaticBooting:
+
+                ;call   SOUND_Beep
+
+                test    byte ptr [CFG_BootMenuActive], 0FFh
+                jnz     MBR_Main_GotBootMenu
+                ; ----------------------------------------------- NO BOOT-MENU
+                ; Select default partition and boot system...
+                call    PASSWORD_AskSystemPwd
+
+                ;call    VideoIO_DBG_WriteString2
+
+                mov     al, Menu_EntryDefault
+                ;mov     al,0                         ; zero based
+                mov     Menu_EntrySelected, al
+                jmp     MBR_Main_NoBootMenu
+
+    MBR_Main_GotBootMenu:
+                ; ------------------------------------------ BOOT-MENU VISUALS
+
+
+            IFDEF   FX_ENABLED
+                call    FX_StartScreen
+            ENDIF
+
+                ; BOOKMARK: Build Main Menu
+                call    BOOTMENU_BuildBackground
+                call    BOOTMENU_BuildMain
+
+            IFDEF   FX_ENABLED
+                call    FX_EndScreenRight
+            ENDIF
+
+                call    PASSWORD_AskSystemPwd
+                call    BOOTMENU_ResetTimedBoot
+
+                ; BOOKMARK: Display Main Menu
+                call    BOOTMENU_Execute
+
+                jc      MBR_Main_ReEnterSetup
+                call    BOOTMENU_SetVarsAfterMenu
+
+                ; ---------------------------------------------------- BOOTING
+    MBR_Main_NoBootMenu:
+
+            IFDEF   FX_ENABLED
+                call    FX_StartScreen
+            ENDIF
+
+                ; BOOKMARK: Display bye-screen and start selected partition
+                call    BOOTMENU_BuildGoodBye
+
+            IFDEF   FX_ENABLED
+                call    FX_EndScreenRight
+            ENDIF
+
+                call    PASSWORD_AskChangeBootPwd
+
+            IFNDEF ReleaseCode
+                ; Debug Code to terminate DOS .COM program - used for
+                ;  testing AiR-BOOT
+                ; Obsolete.
+                int     3
+                mov     ax, 6200h
+                int     21h
+                mov     es, bx
+                mov     ax, 4C00h    ; Quit program
+                int     21h
+            ENDIF
+                call    ANTIVIR_SaveBackUpMBR
+
+                ; Preload the selected menu-entry
+                ; However, this value will be wrong if eCS phase1 is
+                ; active and the installation partition is newly created.
+                ; See below for the adjustment.
+                mov     dl, byte ptr [Menu_EntrySelected]
+
+
+                ;
+                ; Prepare to start the partition.
+                ;
+                jmp     MBR_Main_StartPartition
+
+
+
+; -----------------------------------------------------------------------------
+;                                                              START PARTITION
+; -----------------------------------------------------------------------------
+
+    MBR_Main_StartPartition:
+
+            IFDEF   AUX_DEBUG
+                ;~ call    DEBUG_DumpIPT
+                ;~ call    DEBUG_DumpPartitionPointers
+                ;~ call    DEBUG_DumpPartitionXref
+                ;~ call    DEBUG_DumpNewPartTable
+            ENDIF
+
+
+                ; -------------------------------------------- START PARTITION
+                ; THIS DOES NOT RETURN !
+                call    PART_StartPartition
+
+
+
+
+;
+; This entry-point restarts AiR-BOOT almost from scratch.
+; It skips the movement of the MBR but otherwise it is a functional restart.
+; The old BIOS SS:SP where the registers on entry are stored is passed along.
+; This entry-point is used for debugging purposes.
+;
+; BOOKMARK: AiR-BOOT Restart (used for debugging)
+AirbootRestart:
+        mov     bx, [OldSP]     ; Old SP when BIOS transferred control to AB
+        mov     dx, [OldSS]     ; Old SS when BIOS transferred control to AB
+        jmp     MBR_RealStart
+
+
+;
+; This entry-point displays a popup that the system is halted
+; and then halts the system.
+; It is entered on severe error conditions.
+;
+; BOOKMARK: Halt System
+HaltSystem:
+        call    VideoIO_ClearScreen
+        mov     ax,0ababh
+        mov     cx, 0C04h
+        mov     si, offset SystemHalted
+        call    SETUP_ShowErrorBox
+        ; Halt the system.
+        jmp     MBR_HaltSystem
+
+
+
+
+
+
+                ;
+                ; The following section includes various assembler modules
+                ; at the source level. These contain functionality for a
+                ; multitude of categories like disk-access, video-io, lvm,
+                ; debugging, etc. Later versions of AiR-BOOT will use such
+                ; modules at the object-file level so they can be shared
+                ; more easily.
+                ;
+
+
+; -----------------------------------------------------------------------------
+;                                                        INCLUDED FILE SECTION
+; -----------------------------------------------------------------------------
+
+; BOOKMARK: Include Section
+
+;
+; Include other code-modules here.
+;
+
+b_std_txt:
+Include REGULAR/STD_TEXT.ASM    ; Standard (non-translateable text)
+size_std_txt = $-b_std_txt
+
+b_driveio:
+Include REGULAR/DRIVEIO.ASM     ; Drive I/O, Config Load/Save
+size_driveio = $-b_driveio
+
+b_lvm:
+Include SPECIAL/LVM.ASM         ; LVM-specific code
+size_lvm = $-b_lvm
+
+b_videoio:
+Include REGULAR/VIDEOIO.ASM     ; Video I/O
+size_videoio = $-b_videoio
+
+b_timer:
+Include REGULAR/TIMER.ASM       ; Timer
+size_timer = $-b_timer
+
+b_partmain:
+Include REGULAR/PARTMAIN.ASM    ; Regular Partition Routines
+size_partmain = $-b_partmain
+
+b_partscan:
+Include REGULAR/PARTSCAN.ASM    ; Partition Scanning
+size_partscan = $-b_partscan
+
+b_bootmenu:
+Include REGULAR/BOOTMENU.ASM    ; Boot-Menu
+size_bootmenu = $-b_bootmenu
+
+b_password:
+Include REGULAR/PASSWORD.ASM    ; Password related
+size_password = $-b_password
+
+b_other:
+Include REGULAR/OTHER.ASM       ; Other Routines
+size_other = $-b_other
+
+b_main:
+Include SETUP/MAIN.ASM          ; The whole AiR-BOOT SETUP
+size_main = $-b_main
+
+b_math:
+Include REGULAR/MATH.ASM        ; Math functions (like 32-bit multiply)
+size_math = $-b_math
+
+b_txtother:
+Include TEXT/TXTOTHER.ASM       ; All translateable Text-Strings
+size_txtother = $-b_txtother
+
+b_txtmenus:
+Include TEXT/TXTMENUS.ASM       ; All translateable Menu-text
+size_txtmenus = $-b_txtmenus
+
+b_charset:
+Include TEXT/CHARSET.ASM        ; Special Video Charsets (if needed)
+size_charset = $-b_charset
+
+b_conv:
+Include REGULAR/CONV.ASM        ; Various conversion routines
+size_conv = $-b_conv
+
+b_virus:
+Include SPECIAL/VIRUS.ASM       ; Virus Detection / Anti-Virus
+size_virus = $-b_virus
+
+; [Linux support removed since v1.02]
+;Include SPECIAL/FAT16.ASM       ; FAT-16 Support
+;Include SPECIAL/LINUX.ASM       ; Linux Kernel Support
+
+b_billsuxx:
+Include SPECIAL/F00K/BILLSUXX.ASM   ; Extended Partition - Microsoft-Hack
+size_billsuxx = $-b_billsuxx
+
+b_sound:
+Include SPECIAL/SOUND.ASM       ; Sound
+size_sound = $-b_sound
+
+b_apm:
+Include SPECIAL/APM.ASM         ; Power Managment Support
+size_apm = $-b_apm
+
+
+
+;
+; Cyrillic support.
+;
+IFDEF   TXT_IncludeCyrillic
+b_ccharset:
+   Include SPECIAL/CHARSET.ASM  ; Charset Support (e.g. Cyrillic)
+size_ccharset = $-b_ccharset
+ENDIF
+
+; Various debugging routines, uses AUXIO and CONV
+IFDEF   AUX_DEBUG
+b_debug:
+Include REGULAR/DEBUG.ASM       ; Debug module
+size_debug = $-b_debug
+b_auxio:
+Include REGULAR/AUXIO.ASM       ; Com-port support for debugging
+size_auxio = $-b_auxio
+ENDIF
+
+;
+; We only include this if FX_ENABLED is defined.
+; FX is disabled when debugging to have more room for debug-code.
+; The module compiles to 50eh = 1294 bytes, so that is a lot.
+;
+IFDEF   FX_ENABLED
+b_fx:
+Include SPECIAL/FX.ASM          ; l33t Cooper-Bars/Scrolling <bg>
+size_fx = $-b_fx
+ENDIF
+
+
+                ;
+                ; End of code marker.
+                ;
+                ; BOOKMARK: END OF CODE
+                db      'BABE'
+                db      'FACE'
+
+
+; -----------------------------------------------------------------------------
+;                                                                  END OF CODE
+; -----------------------------------------------------------------------------
+code_end:
+
+
+
+
+
+
+
+
+
+
+; -----------------------------------------------------------------------------
+;                                                         BLDLEVEL INFORMATION
+; -----------------------------------------------------------------------------
+
+                ; BOOKMARK: BLDLEVEL Information
+                ORIGIN  068A0h
+
+;
+; The space between this offset and code_end is the space
+; available for code.
+;
+zzz_code_space = $ - code_end
+
+
+bld_level:
+                ;
+                ; Here we insert the OS/2 BLDLEVEL Information.
+                ; It is composed of the AiR-BOOT version-info and other
+                ; information. It is unique for each release of AiR-BOOT.
+                ;
+
+                ;
+                ; ?? When AUX_DEBUG is enabled and the above org is active,
+                ; the BLDLEVEL gets corrupted eventhough it gets inserted here
+                ; explicitly. The effect is almost like an 'OR' or a merge
+                ; with the already generated FX code.
+                ; Tasm and JWasm produce different results.
+                ; ??
+                ;
+                InsertBuildLevel
+
+
+
+
+
+;==============================================================================
+;                                                                    Sector 53
+;==============================================================================
+
+                ;
+                ; From here on, the layout of the image consists of:
+                ; - AiR-BOOT Protection Image
+                ; - AiR-BOOT Configuration
+                ; - DriveLetters
+                ; - Install Volume
+                ; - Floppy/CDROM/BIOS BOOT ENTRIES
+                ; - Internal Partition Table (IPT)
+                ; - Hidden Partition Table (HPT)
+                ; - MBR Backup
+                ;
+
+                ;
+                ; After that, the BSS follows with several runtime
+                ; variables and structures.
+                ; The BSS is not part of the image on disk of course.
+                ;
+
+; -----------------------------------------------------------------------------
+;                                                             PROTECTION IMAGE
+; -----------------------------------------------------------------------------
+
+                ;
+                ; This is the AiR-BOOT MBR Protection Image.
+                ; The stuff generated here gets overwritten when the
+                ; MBR_PROT module, which is assembled separately,
+                ; gets binary merged.
+                ; So you won't find the string below in the generated binary.
+                ;
+                ; BOOKMARK: AiR-BOOT MBR Protection Image
+                ORIGIN  06900h
+
+
+
+
+;
+; Hardcoded to 768 bytes (MBR_PROT.ASM)
+; The string below is searched for by the FIXCODE helper and *must* be
+; page (256 bytes) aligned.
+;
+; It seems to be possible to shrink the protection-image to 768 bytes.
+; That gives us an additional 256 bytes of code-space.
+; MBR-PROT.ASM,FIXCODE.C,PARTMAIN.ASM and AIR-BOOT.ASM need to be adjusted for that.
+; Also the granularity needs to change from 512 bytes to 256 bytes since
+; 6900h is not a 512-byte boundary.
+;
+; 20120908 - Done.
+;
+MBR_Protection  db 'AiR-BOOT MBR-Protection Image'
+
+                ; Just fill.
+                ;~ db  1024-($-MBR_Protection)  dup('M')
+                db  768-($-MBR_Protection)  dup('M')
+
+
+
+
+
+
+
+;==============================================================================
+;                                                                    Sector 55
+;==============================================================================
+; -----------------------------------------------------------------------------
+;                                                       AiR-BOOT CONFIGURATION
+; -----------------------------------------------------------------------------
+
+                ;
+                ; This section contains the AiR-BOOT configuration.
+                ; Note that it has a version that should be updated
+                ; when stuff is added.
+                ; Also add stuff to the end so that offsets of other
+                ; variables remain vaild.
+                ;
+                ; BOOKMARK: AiR-BOOT Configuration Sector
+                ORIGIN  06C00h
+
+Configuration:
+                ; THERE IS A NON-ASCII CHAR HERE !!
+                ; Your editor may not display this non-ASCII
+                ; character at the end if the 'AiRCFG-TABLE'
+                ; string. When this character get's deleted,
+                ; AiR-BOOT will not function because it cannot
+                ; find the config-signature which includes this
+                ; invisible character. The code of the char is: 0adh.
+                db  'AiRCFG-TABLE­'
+                db  01h, 10h, 'U' ; "Compressed" ID String
+                ; Version 1.02 was for code 1.06, 1.03 was internal
+                ; and 1.04,1.05 and 1.06 do not exist.
+                ;
+                ; 1.07 was used with AB v1.07 and introduced the phase1
+                ; system-name. For the rest it is compatible with v1.02.
+                ;
+                ; 1.0.8 is introduced with AB v1.0.8 and indicates the movement
+                ; of several components and the packing of the hideparttable.
+                ; The core configuration has not changed but the generated
+                ; configuration has. The v1.0.8 installer handles upgrading.
+                ;
+                ; It has been decided that uneven minor numbers will be
+                ; test-versions. Therefore v1.0.8 has been bumbed to v1.1.0.
+                ; 
+                ; It is not required for the config to have the
+                ; same version as the code, so in the future
+                ; the code version might be higher than the
+                ; config version if there are no changes to the latter.
+                ;
+
+CFG_LastTimeEditLow     dw  0   ; Last Time Edited Stamp (will incr every setup)
+CFG_LastTimeEditHi      dw  0   ; second 16 bit part...
+
+CFG_CheckConfig         dw  0   ; Check-Sum for Configuration
+
+CFG_Partitions          db  0   ; Count of partitions in IPT
+CFG_MiscFlags           db  1   ; Miscellaneous Flags (See EQUates)
+CFG_PartDefault         db  0   ; Default-Partition (Base=0)
+
+CFG_PartLast            db  0   ; Which Partition was booted last time ? (Base=0)
+CFG_TimedBoot           db  0   ; Timed Boot Enable (for REAL Enable look TimedBootEnable)
+CFG_TimedSecs           db  15  ; Timed Boot - How Many Seconds Till Boot
+CFG_TimedDelay          dw  123 ; Timed Boot - Delay
+CFG_TimedBootLast       db  1   ; Timed Boot - Boot From Last Drive Booted From
+CFG_RememberBoot        db  1   ; Remember Manual Boot Choice
+CFG_RememberTimed       db  0   ; Remember if Timed Boot (if both disabled: Boot Default)
+CFG_IncludeFloppy       db  1   ; Include Floppy Drives in Boot-Menu
+CFG_BootMenuActive      db  1   ; Display Boot-Menu (if Disabled: Boot Default)
+                                         ; v0.29+ -> 2 - Detailed Bootmenu
+CFG_PartitionsDetect    db  1   ; Autodetect New Partitions (Auto-Add!)
+CFG_PasswordSetup       db  0   ; Ask Password when entering Setup
+CFG_PasswordSystem      db  0   ; Ask Password when booting System
+CFG_PasswordChangeBoot  db  0   ; Ask Password when changing boot partition
+CFG_ProtectMBR          db  0   ; Protect MBR via TSR ?
+CFG_IgnoreWriteToMBR    db  0   ; Just ignore writes to MBR, otherwise crash
+CFG_FloppyBootGetName   db  0   ; Gets floppy name for display purposes
+CFG_DetectVirus         db  0   ; Detect Virus ?
+CFG_DetectStealth       db  0   ; Detect Stealth-Virus ?
+CFG_DetectVIBR          db  0   ; Detect BootRecord-Virus ?
+CFG_AutoEnterSetup      db  0   ; Automatic Enter Setup (first install!)
+CFG_MasterPassword      dw  0101Fh  ; Encoded Password (this is just CR)
+                        dw  07A53h
+                        dw  0E797h
+                        dw  0A896h
+CFG_BootPassword        dw  0101Fh  ; Another CR... ;-)
+                        dw  07A53h
+                        dw  0E797h
+                        dw  0A896h
+                        db  0   ; Rude-Protection - Removed since v0.28b
+CFG_LinuxRootPartition  db  0   ; Linux Root Partition (Base=0)
+CFG_TimedKeyHandling    db  0   ; Timed Key Handling (for Timed Boot)
+                                    ; 0 - Do Nothing
+                                    ; 1 - Reset Time
+                                    ; 2 - Stop Time
+CFG_MakeSound           db  0   ; Should be clear ;)
+CFG_FloppyBootGetTimer  db  0   ; Floppy Name will get updated every 2 secs
+CFG_ResumeBIOSbootSeq   db  1   ; If BIOS Boot Sequence should be resumed
+                                    ; 0 - Disabled
+                                    ; 1 - CD-ROM
+                                    ; 2 - Network
+                                    ; 3 - ZIP/LS120
+CFG_CooperBars          db  0   ; If Cooper Bars should be shown
+CFG_LinuxCommandLine    db  75 dup (0)  ; Linux Command Line
+CFG_LinuxKrnlPartition  db  0FFh    ; FAT-16 Linux Kernel Partition (Base=0)
+                                        ;  FFh -> Disabled
+CFG_LinuxDefaultKernel  db  'DEFAULT', 4 dup (32), 0    ; Default Kernel Name
+CFG_LinuxLastKernel     db  11 dup (32), 0  ; Last-Booted Kernel Name
+CFG_ExtPartitionMShack  db  0   ; Extended Partition M$-Hack Global Enable
+CFG_AutomaticBoot       db  0   ; Automatic Booting (only one bootup)
+CFG_PartAutomatic       db  0   ; Partition-No for automatic booting
+CFG_ForceLBAUsage       db  1   ; LBA-BIOS-API forced on any HDD I/O
+CFG_IgnoreLVM           db  0   ; Ignores any LVM-Information
+
+
+;
+; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES
+;
+
+                ;
+                ; Drive Letters.
+                ;
+                ; BOOKMARK: Stored Drive Letters
+                ORIGIN  06CB0h
+
+
+; -----------------------------------------------------------------------------
+;                                                                DRIVE LETTERS
+; -----------------------------------------------------------------------------
+
+;
+; Moved here to make room for packed hiddenparttable.
+; This gets filled when drive-letters that are assigned using the dl-feature.
+;
+DriveLetters            db  LocIPT_MaxPartitions dup (0)
+                        ; Format is:
+                        ;============
+                        ; Drive-Letter : BYTE (80h-C:, 81h-D:)
+                        ; --------------------> 1 Byte * 45
+
+
+
+; -----------------------------------------------------------------------------
+;                                                               INSTALL VOLUME
+; -----------------------------------------------------------------------------
+
+                ;
+                ; Allways have the name of the installation volume
+                ; at this offset.
+                ; So future config changes will not break auto-install.
+                ;
+                ; BOOKMARK: Name of eCS Installation Volume
+                ORIGIN  06D00h
+
+; SET(A)BOOT stores the volume name of the eCS system being installed here.
+; It is truncated to 11 chars because AiR-BOOT currently does not support
+; longer labelnames. The name is also capitalized.
+;eCS_InstallVolume       db  12 dup (0)
+;eCS_InstallVolume       db  'HIGHLOG' ,0
+;eCS_InstallVolume       db  'ECS-MIDDLE',0,0
+;eCS_InstallVolume       db  'ECS-HIGH',0,0,0,0
+;eCS_InstallVolume       db  'ECS-HIGH',0,'NO',0
+;eCS_InstallVolume       db  'KANWEG2',0
+eCS_InstallVolume       db  0,'NOPHASEONE' ,0
+
+;
+; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES
+;
+
+
+; -----------------------------------------------------------------------------
+;                                               FLOPPY/CDROM/BIOS BOOT ENTRIES
+; -----------------------------------------------------------------------------
+
+                ;
+                ; 06DABh - 06C00h = 01ABh = 427 bytes.
+                ; Entries allocated down from 06E00 boundary.
+                ;
+                ; BOOKMARK: Floppy/CD-ROM/BIOS Boot Entries
+                ORIGIN  06DABh                                  ; 427 Boundry
+
+; (432 - 5 = 427)
+AutoDrvLetter           db  0
+AutoDrvLetterSerial     dd  0
+
+; This entry is also 34 bytes long (466 - 34 = 432)
+BIOScontIPTentry:
+                        db  0, 0, 0, 0, '           '
+                        db  0, 0FEh, Flags_Bootable
+                        dw  0     ; No Checksum :)
+                        db  0, 1, 0
+                        db  0, 1, 0 ; Location of Partition/Boot Record
+                        dd  0, 0
+
+; VIR variables are for the AiR-BOOT Anti Virus Code
+; Most of them are backups of Interrupt Points, so we can check, if a
+; stealth virus is on-line, we can intercept its call.
+; Normal (non stealth) virus are trapped simply by rereading the MBR sector.
+; If a virus is found, we will restore MBR from Sektor 60/62 and stop the
+; system from working, so the user has to press reset.
+; That's saver than a Reboot.
+;
+; If a virus is found on the partition to boot, the system will ONLY halt,
+; nothing more, because we can not remove it. The user shall do it :)
+; Those viruses are detected via a real nasty method...Checksum-Checking of the
+; boot-record, which is to be executed. If it does not match the one in our
+; internal partition table, we will stop. You may however switch this detection
+; off or just reset it by switching 'VIBR Detection'.
+
+; 478 - 12 = 466                                                ; 466 Sub-Part
+CFG_VIR_INT08           dd  0    ; pointer to saved 08h entry point
+CFG_VIR_INT13           dd  0    ; pointer to saved 13h entry point
+CFG_VIR_INT1C           dd  0    ; pointer to saved 1Ch entry point
+
+; 478 Boundry (512-34)
+; This entry is also 34 bytes long
+FloppyIPTentry          db  0, 0, 0, 0, 'FloppyDrive'
+                        db  0, 0FFh, Flags_Bootable
+                        dw  0           ; No Checksum :)
+                        db  0, 1, 0
+                        db  0, 1, 0     ; Location of Partition/Boot Record
+                        dd  0, 0
+
+
+
+; -----------------------------------------------------------------------------
+;                                               INTERNAL PARTITION TABLE (IPT)
+; -----------------------------------------------------------------------------
+
+                ;
+                ; AiR-BOOT Internal Partition Table (IPT)
+                ;
+                ; BOOKMARK: Internal Partition Table
+                ORIGIN  % (image_size - 0a00h - (image_size - image_size_60secs))
+
+
+;
+; Rousseau: This is the start of the AiR-BOOT IPT
+;
+PartitionTable  db  (LocIPT_MaxPartitions * LocIPT_LenOfIPT) dup (0)
+; no-partitions detected... :]
+;                             db    1, 0, 0, 0, 'Harddisc  1'
+;                             db    0, 0FFh, Flags_BootAble
+;                             dw    0    ; No Checksum :)
+;                             db    0, 0, 1
+;                             db    0, 0, 1 ; Location of Partition/Boot Record
+;                             dd    0, 0
+
+    ; Format is:
+    ;============
+    ; SerialNumber    * 4
+    ; PartitionName   * 11
+    ; Drive           * 1
+    ; SystemID        * 1 (means the partition type)
+    ; Flags           * 1
+    ; Checksum        * 2 (for virus checking)
+    ; LocationBegin   * 3 (where the partition begins)
+    ; LocationPartTab * 3 (where the partition table is)
+    ; AbsoluteBegin   * 4 (where the partition begins, in absolute sectors)
+    ; AbsolutePartTab * 4 (where the partition table is, in absolute sectors)
+    ; --------------------> 34 Bytes (total maximum partition-entries = 30)
+
+
+
+                ; No need to check overlap here because this string will
+                ; be overwritten if the maximum partition count is reached.
+                ; So this is not a critical boundary.
+                ORG     (image_size - 600h - (image_size - image_size_60secs) / 2 - 10)
+
+                db 'AiRBOOTPAR' ; 1K internal partition table
+
+
+
+; -----------------------------------------------------------------------------
+;                                                 HIDDEN PARTITION TABLE (HPT)
+; -----------------------------------------------------------------------------
+
+                ;
+                ; Hidden Partition Table (6-bit packed as of v1.0.8)
+                ;
+                ; BOOKMARK: Hidden Partition Table (packed)
+                ORIGIN  % (image_size - 600h - (image_size - image_size_60secs) / 2)
+
+HidePartitionTable      db  (LocIPT_MaxPartitions * LocHPT_LenOfHPT) dup (0FFh)
+                        ; Format is:
+                        ;============
+                        ; PartitionPtr : BYTE * 30
+                        ; --------------------> 30 Bytes * 45
+
+;
+; Driveletters were here.
+; Moved down to make room for packed hideparttable.
+;
+
+
+                ;
+                ; End of hidden partition table.
+                ; Check overlap here for security reasons.
+                ;
+                ORIGIN  % (image_size - 200h - 5)
+
+; 79fa - end of packed hide table
+                        db  'ABHID'    ; 1K internal Hide-partition table
+
+
+
+
+;==============================================================================
+;                                                                    Sector 62
+;==============================================================================
+; -----------------------------------------------------------------------------
+;                                                                   MBR BACKUP
+; -----------------------------------------------------------------------------
+
+                ;
+                ; AiR-BOOT MBR Backup.
+                ;
+                ; BOOKMARK: MBR Backup
+                ORIGIN  % (image_size - 200h)
+
+
+MBR_BackUpMBR           db  'AiR-BOOT MBR-BackUp',\
+                            ' - Just to fill this sector with something',0
+AirBootRocks            db  'AiR-BOOT Rocks!',0
+
+                        db  (512 - ($-MBR_BackUpMBR) - 2)  dup('M')
+
+                ; End of Image signature.
+                ;
+                ORIGIN  % (image_size - 2)
+                        dw      0BABEh
+
+
+                ;
+                ; End of Image.
+                ;
+                ORIGIN  % (image_size)
+
+
+
+;
+; Terminate LDRIMAGE segment.
+;
+IFDEF   SEGMENTED
+LDRIMAGE    ENDS
+ENDIF
+
+
+
+
+
+
+
+;##############################################################################
+;                                                                  BSS SEGMENT
+;##############################################################################
+
+; BOOKMARK: BSS Segment
+
+;
+; Open BSS segment.
+;
+IFDEF   SEGMENTED
+VOLATILE        SEGMENT     USE16   PUBLIC  'BSS'
+ENDIF
+
+
+
+sobss:
+;------------------------------------------------------------------------------
+
+                            ;
+                            ; Removed ORG for BSS data to be more compatible
+                            ; with segment-concatenated layout.
+                            ;
+                            ; What happens before this space ??
+                            ; If org 0 corruption occurs.
+                            ;
+
+                            ;
+                            ; Filling hiddenparttable goes out-of-bounds !
+                            ; Fixed with 6-bit packing.
+                            ;
+
+;
+; If segmented, offsets are relative to the BSS segment.
+; They are resolved at link-time.
+; If not segmented, offsets are relative to the CODE segment.
+;
+IFDEF   SEGMENTED
+                            ORG 02400h
+ELSE
+                            ORG 0A000h
+ENDIF
+
+
+; -----------------------------------------------------------------------------
+;                                                            START OF BSS DATA
+; -----------------------------------------------------------------------------
+
+; This space actually gets initialized in PreCrap to NUL (till EndOfVariables)
+BeginOfVariables:
+
+
+; -----------------------------------------------------------------------------
+;                                                               SECTOR BUFFERS
+; -----------------------------------------------------------------------------
+; BOOKMARK: Sector Buffers
+PartitionSector     db  512 dup (?) ; Temporary Sector for Partition
+PBRSector           db  512 dup (?) ; Temporary Sector for JFS/HPFS writeback
+LVMSector           db  512 dup (?) ; Temporary Sector for LVM
+TmpSector           db  512 dup (?) ; Temporary Sector
+Scratch             db  256 dup (?) ; Scratch buffer
+
+; -----------------------------------------------------------------------------
+;                                                          NEW PARTITION TABLE
+; -----------------------------------------------------------------------------
+; Everything used to build a new IPT and reference it to the old one
+; BOOKMARK: New Partition Table
+NewPartTable                db  1536 dup (?)    ; New Partition Table
+
+
+; -----------------------------------------------------------------------------
+;                                                     NEW HIDE PARTITION TABLE
+; -----------------------------------------------------------------------------
+; BOOKMARK: New Hide-Partition Table
+NewHidePartTable            db  LocIPT_MaxPartitions * LocHPT_LenOfHPT dup (?)
+
+    ;~ even
+
+; -----------------------------------------------------------------------------
+;                                                            NEW DRIVE LETTERS
+; -----------------------------------------------------------------------------
+; BOOKMARK: Logical Drive-Letters
+NewDriveLetters             db  LocIPT_MaxPartitions dup (?)
+
+    ;~ even
+
+; -----------------------------------------------------------------------------
+;                                                         PARTITION SIZE TABLE
+; -----------------------------------------------------------------------------
+; Size-Table (6 bytes per partition)
+; BOOKMARK: Partition Size Table
+PartitionSizeTable          db  LocIPT_MaxPartitions * 6 dup (?)
+
+
+; -----------------------------------------------------------------------------
+;                                                           PARTITION POINTERS
+; -----------------------------------------------------------------------------
+; Maximum is 52 word entries till now
+; BOOKMARK: Partition Pointers
+PartitionPointers           dw  52 dup (?)
+
+; Count of total Partition Pointers
+PartitionPointerCount       db  ?
+
+; -----------------------------------------------------------------------------
+;                                                                   XREF TABLE
+; -----------------------------------------------------------------------------
+
+; X-Reference Table (holds new partnr, index is old part nr)
+; BOOKMARK: Xref Table
+PartitionXref               db  LocIPT_MaxPartitions dup (?)
+
+; -----------------------------------------------------------------------------
+;                                                               VOLUME LETTERS
+; -----------------------------------------------------------------------------
+
+; Volume-Letters
+; 0 - no LVM support
+; 1 - LVM support, but no letter
+; 'C'-'Z' - assigned drive letter
+; BOOKMARK: Volume Drive Letters
+PartitionVolumeLetters      db  LocIPT_MaxPartitions dup (?)
+
+
+
+; -----------------------------------------------------------------------------
+;                                                          MISC VARS AND FLAGS
+; -----------------------------------------------------------------------------
+; BOOKMARK: Misc Vars and Flags
+TotalHarddiscs          db  ?           ; Total harddrives (by POST)
+LBASwitchTable          db  128 dup (?) ; Bit 25-18 for CHS/LBA Switching
+NewPartitions           db  ?           ; Freshly found partitions
+                                            ; Independent of SaveConfiguration
+TooManyPartitions       db  ?           ; Non-zero if too many partitions found
+
+VideoIO_Segment         dw  ?           ; Segment for Video I/O
+
+ExtendedAbsPos          dd  ?           ; Extended Partition Absolute Position
+ExtendedAbsPosSet       db  ?           ; If Absolute Position set
+
+CurPartition_Location   dw  4 dup (?)   ; Where did current partition come from?
+CurIO_UseExtension      db  ?           ; 1-Use INT 13h EXTENSIONS
+                                        ; (filled out by PreCrap)
+CurIO_Scanning          db  ?           ; 1-AiR-BOOT is scanning partitions
+                                            ; (for detailed error message)
+
+; [Linux support removed since v1.02]
+;GotLinux                     db     ?    ; 1-Linux found
+
+
+; -----------------------------------------------------------------------------
+;                                                            MENU RELATED VARS
+; -----------------------------------------------------------------------------
+Menu_EntrySelected  db  ?   ; Which partition we boot this time...
+Menu_UpperPart      db  ?   ; Which number (Base=0) is the partition upper pos
+Menu_AbsoluteX      db  ?   ; Pos where Menu stuff starts
+Menu_TotalParts     db  ?   ; Copy of CFG_BootParts
+Menu_TotalLines     db  ?   ; Total Lines on Screen used for BootMenu
+Menu_EntryDefault   db  ?   ; Default Entry in filtered View
+Menu_EntryLast      db  ?   ; LastBooted Entry in filtered View
+Menu_EntryAutomatic db  ?   ; Automatic Entry in filtered View
+                                         ;  - All adjusted to menu locations
+
+; -----------------------------------------------------------------------------
+;                                                       PARTITION RELATED VARS
+; -----------------------------------------------------------------------------
+PartSetup_UpperPart     db  ?   ; Partition-Setup (like Menu_UpperPart)
+PartSetup_ActivePart    db  ?   ; Active Partition
+PartSetup_HiddenUpper   db  ?   ; (like Menu_UpperPart)
+PartSetup_HiddenX       db  ?   ; Pos for Hidden-Setup
+PartSetup_HiddenAdd     db  ?   ; Adjust for Hidden-Setup
+
+; -----------------------------------------------------------------------------
+;                                                   TIMER / SETUP RELATED VARS
+; -----------------------------------------------------------------------------
+TimedBootEnable     db  ?   ; Local Enable/Disable for timed boot
+TimedTimeOut        dd  ?   ; TimeOut Timer for TimedBoot (too much time here;)
+TimedSecondLeft     db  ?   ; How many seconds are left till boom ?
+TimedSecondBack     db  ?   ; To get a modification noticed
+TimedBootUsed       db  ?   ; Timed Boot used for bootup ?
+FloppyGetNameTimer  dd  ?   ; Timer for Floppy-Get-Name
+SETUP_KeysOnEntry   db  ?   ; which Shift Status was there, when booting ?
+SETUP_ExitEvent     db  ?   ; Exit Event to end SETUP
+TempPasswordEntry   db  17 dup (?)
+SETUP_OldPwd        db  17 dup (?)
+SETUP_NewPwd        db  17 dup (?)
+SETUP_VerifyPwd     db  17 dup (?)
+StartSoundPlayed    db  ?
+ChangePartNameSave  db  ?   ; Save label after user-edit ?
+SyncLvmLabels       db  ?   ; Sync LVM labels after user-edit ?
+
+
+; -----------------------------------------------------------------------------
+;                                                              FX RELATED VARS
+; -----------------------------------------------------------------------------
+FX_UseCount                 dw  ?
+FX_OverallTimer             dw  ?
+FX_WideScrollerTimer        dw  ?
+FX_WideScrollerCurPos       dw  ?
+FX_WideScrollerSpeed        db  ?
+FX_WideScrollerSpeedState   db  ?
+FX_WideScrollerDirection    db  ?
+FX_WideScrollerAbsDirection db  ?
+FX_WideScrollerBounceSpeed  db  ?
+FX_CooperBarsTimer          dw  ?
+
+; Dynamically Generated Tables - do not need to get initialized with NUL
+FX_CooperColors     db   672 dup (?) ; 7 cooper bars*96 - runtime calculated
+FX_CooperState      db     7 dup (?)
+FX_SinusPos         db     7 dup (?)
+FX_CooperPos        dw     7 dup (?)
+
+
+; -----------------------------------------------------------------------------
+;                                                               CHARSET BUFFER
+; -----------------------------------------------------------------------------
+CharsetTempBuffer   db  4096 dup (?) ; Uninitialized Charset buffer
+
+; -----------------------------------------------------------------------------
+;                                                                LVM CRC TABLE
+; -----------------------------------------------------------------------------
+LVM_CRCTable        dd   256 dup (?) ; LVM-CRC (->SPECiAL\LVM.asm)
+
+;~ ; [Linux support removed since v1.02]
+;~ FAT16_Drive             db     ?    ; FAT-16: Drive of FAT16-partition
+;~ FAT16_AbsPartitionBegin dd     ?    ; FAT-16: LBA Begin of Partition
+;~ FAT16_SecsPerCluster    db     ?    ; FAT-16: Sectors Per Cluster
+;~ FAT16_NumOfRootEntries  dw     ?    ; FAT-16: Number of Root Entries
+;~ FAT16_SecsPerFAT        dw     ?    ; FAT-16: Sectors Per FAT
+;~ FAT16_AbsFATBegin       dd     ?    ; FAT-16: LBA Begin of FAT
+;~ FAT16_AbsRootBegin      dd     ?    ; FAT-16: LBA Begin of Root
+;~ FAT16_AbsClusterBegin   dd     ?    ; FAT-16: LBA Begin of Clusters
+;~ FAT16_FATCacheSector    db     ?    ; FAT-16: FAT-Sector No in Cache
+;~ FAT16_FATCache          db   512 dup (?) ; FAT-16: FAT-Area Cache
+;~ LINUX_KernelEntries     db   680 dup (?) ; 34*20 -> Space for Kernel-Entries
+;~ LINUX_KernelNo          db     ?         ; Total of Kernels in KernelEntries
+;~ LINUX_KernelSizeTable   db   120 dup (?) ; Size-Table (6 bytes per kernel)
+
+
+;
+; Rousseau: added some stuff.
+;
+; -----------------------------------------------------------------------------
+;                                                           ECS PHASE1 RELATED
+; -----------------------------------------------------------------------------
+Phase1Active                db      ?
+OldPartitionCount           db      ?
+
+
+; -----------------------------------------------------------------------------
+;                                                              DISK PARAMETERS
+; -----------------------------------------------------------------------------
+                              ;EVEN
+HugeDisk                    db      MaxDisks  dup(?)
+TrueSecs                    dd      MaxDisks  dup(?)
+
+; BIOS geometry of the boot-drive
+; Note that heads cannot be 256 due to legacy DOS/BIOS bug
+; If Int13X is supported those values are used, otherwise the legacy values.
+BIOS_Cyls                   dd      MaxDisks  dup(?)
+BIOS_Heads                  dd      MaxDisks  dup(?)
+BIOS_Secs                   dd      MaxDisks  dup(?)
+BIOS_Bytes                  dw      MaxDisks  dup(?)
+BIOS_TotalSecs              dq      MaxDisks  dup(?)
+
+; LBA geometry of the boot-drive
+; Note that these values are taken from the BPB of a partition boot-record
+LVM_Cyls                    dd      MaxDisks  dup(?)
+LVM_Heads                   dd      MaxDisks  dup(?)
+LVM_Secs                    dd      MaxDisks  dup(?)
+LVM_Bytes                   dw      MaxDisks  dup(?)
+LVM_TotalSecs               dq      MaxDisks  dup(?)
+
+; OS/2 geometry of the boot-drive
+; Note that these values are taken from the BPB of a partition boot-record
+LOG_Cyls                    dd      MaxDisks  dup(?)
+LOG_Heads                   dd      MaxDisks  dup(?)
+LOG_Secs                    dd      MaxDisks  dup(?)
+LOG_Bytes                   dw      MaxDisks  dup(?)
+LOG_TotalSecs               dq      MaxDisks  dup(?)
+
+; Get's initialized at startup to: 00000011111111111111111111111100b
+; Meaning A,B not free; C-Z free, rest unused. (right to left)
+; Each partition with an assigned drive-letter clears a bit in this map.
+FreeDriveletterMap          dd      ?
+
+; LBA address of master LVM sector, zero if non-existant
+MasterLVMLBA                dd      ?
+
+
+; -----------------------------------------------------------------------------
+;                                                                  I13X BUFFER
+; -----------------------------------------------------------------------------
+;
+; BOOKMARK: Temporary buffer for 48h INT13X bios call.
+;
+
+            ; Size of the buffer.
+            ; this param *must* be filled in.
+            ; Code inserts it.
+i13xbuf     dw  1   dup (?)
+
+            ; The buffer itself.
+            db  126 dup(?)
+
+            ; Size of buffer calculated.
+            ; (excluding the size word at the start).
+            i13xbuf_size = $-offset i13xbuf-2
+
+            ; Some debug area.
+ott         db  512 dup(?)
+
+
+; End of transient variables.
+EndOfVariables:
+
+
+
+
+; -----------------------------------------------------------------------------
+;                                                           OLD AND NEW STACKS
+; -----------------------------------------------------------------------------
+; BOOKMARK: Storage for Old and New Stack Pointers
+;
+; These need to be outside the variable section because AiR-BOOT can restart
+; itself in debug-mode. If the OldSP and OldSS would be in the variable area,
+; they would be cleared on AiR-BOOT restart.
+;
+
+; The variable section is cleared word-wise, so it could clear one byte extra
+; depending on the alignment and size. This DD prevents the OldSP and OldSS
+; to be partly overwritten by the clearing routine.
+                            dd      ?
+
+; SS:SP from before our relocation.
+; The registers values when the BIOS transferred control to us were pushed
+; on this stack.
+
+OldSP                       dw      ?
+OldSS                       dw      ?
+
+; SS:SP currently in use.
+; They are temporarily dumped here so we can pop the resgisters from
+; the old stack to display them in debug mode.
+CurrentSP                   dw      ?
+CurrentSS                   dw      ?
+
+
+
+;
+; End of BSS segment.
+;
+eobss:
+
+;
+; Close BSS segment.
+;
+IFDEF   SEGMENTED
+    VOLATILE    ENDS
+ELSE
+    LDRIMAGE    ENDS
+ENDIF
+
+            ; BOOKMARK: End of Module
+            END     AiR_BOOT
+
Index: trunk/bootcode/air-boot.his
===================================================================
--- trunk/bootcode/air-boot.his	(revision 57)
+++ trunk/bootcode/air-boot.his	(revision 57)
@@ -0,0 +1,429 @@
+;
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+
+
+
+
+; ------------------------------------------------
+; Rousseau: Fixes, Enhancements and fresh bugs :-)
+; ------------------------------------------------
+;
+; v1.1.0-final
+; ============
+; # Bumped Version Number
+;   During v1.0.8 is was decided that odd minor versions will be test-versions.
+;   Since v1.0.8 was a test-version all the way, the final stuff has been
+;   bumped to v1.1.0, including the version of the configuration.
+;   v1.1.1 will be any following test-version, with build-dates separating
+;   test-releases. Version 1.1.2 would be a next release.
+;
+; # Updated version numbers
+;   All version identifiers updated from v1.0.8 to v1.1.0
+;   AIRBOOT.BIN, INSTALL[D2WL].EXE and SETABOOT.EXE.
+;
+; # Fixed Virus Regression
+;   Using the enhanced drive-letter feature to boot eCS installations using
+;   the same drive-letter caused the PBR-virus protection to activate.
+;   This was caused by a missing update to the PBR CRC in the AB configuration.
+;   This has been fixed.
+;
+; # Only clear bootable flag on boot-drive
+;  This interferred with booting other drives, not containing AiR-BOOT,
+;  directly from the BIOS. Now AiR-BOOT only clears the bootable-flag on the
+;  boot-drive, which is the one where AiR-BOOT got activated from.
+;
+; # Check for INT13X extensions before using them
+;   Now the availability of INT13X is checked and a popup is displayed and the
+;   system halted when they are not available. INT13X is a requirement for
+;   this and higher versions of AiR-BOOT.
+;
+; v1.0.8-rc3-bld20120909
+; ----------------------
+; # Added Show LVM Drive Letters in SETUP/BASIC #
+;   This will toggle the display of LVM drive-letters in the main menu.
+;   By default this option is enabled.
+;
+; # Reduced MBR Protection Image from 1024 bytes to 768 bytes #
+;   The fight for code-space continues...
+;   Luckily the MBR Protection Image code does not exceed 768 bytes,
+;   so that gives us another 256 bytes of precious code-space.
+;   Now the non-EN versions are happy again.
+;   Note that the alignment for the image changed from 512 to 256 bytes.
+;   MBR-PROT.ASM, FIXCODE.C, PARTMAIN.ASM and AIR-BOOT.ASM have been
+;   adjusted for this change.
+;
+; # Updating from v1.06 now also copies over drive-letters #
+;   When the user has forced drive-letters in v1.06 these will be copied over
+;   to the v1.0.8 configuration when upgrading.
+;   Because the drive-letter feature is broken in v1.07, the drive-letter
+;   table does not get copied over when upgrading from v1.07.
+;
+; # Fixed a minor bug with displaying LVM drive-letters #
+;   When more partitions that can be displayed were present, scrolling the
+;   menu would not scroll the drive-letter. Fixed.
+;
+; # Added DOCU directory for documentation #
+;   This contains the AiR-BOOT User Manual in Open Office .odt-format.
+;   To also have OS/2 INF format, a transformation script and sheet have been
+;   created to convert the .odt document to an ipf-source that can be compiled
+;   with Watcoms wipfc ipf compiler. (IBM ipfc does not work correctly)
+;   This makes it possible to write documentation in OOo Writer and export that
+;   to PDF and INF format.
+;
+; # Fixed a bug with regard to the drive-letter feature #
+;   When partitions were deleted, and some partitions above the deleted
+;   partition(s) had a drive-letter forced, these partitions would lose this
+;   assignment. This bug is also present in v1.06.
+;
+; # Implemented a very simple interactive debugger #
+;   Making use of the main menu-loop, pressing a digit or a letter activates
+;   some debugging routine. Mostly such a routine dumps a part of the internal
+;   state to the com-port. Other purposes are the interrogation of certain
+;   BIOS functions, as these can differ substantially between machines.
+;
+; # Made FX-code optional to compile in #
+;   The FX-code supplies the shifting screen-effects when 'Cooper Bars' is
+;   enabled in the setup. With the current enhancements made however,
+;   there is a continuous lack of code-space, especially when debug-code is
+;   included during development. The FX-code occupies some 1200 bytes, a space
+;   that can be put to better use. Therefore inclusion the FX-code has been
+;   made conditional to make room for either debugging or future new features.
+;
+; # Also write PBR to HPFS #
+;   Earlier, a fix was made to write a modified PBR back in case JFS was used.
+;   This was done to enable the drive-letter feature on JFS, since the PBR
+;   JFS-bootcode does not use the supplied PBR in memory.
+;   With the enhancements in the drive-letter feature, the HPFS PBR needs to
+;   be updated on disk also, to cope with zero drive-letters in the HPFS PBR.
+;
+; # Added drive-letters in display for LVM volumes #
+;   A populair request was to show drive-letter information in the menu.
+;   Drive-letters however, are OS specific and AiR-BOOT cannot accurately
+;   predict what drive-letter DOS would assign to what partition.
+;   eCS LVM drive-letters however are stored in the LVM-record and can thus
+;   be displayed. This has been implemented.
+;
+; # Enhanced drive-letter feature #
+;   Enable multiple eComStation installations using the same drive-letter
+;   This makes it possible to clone a system with XCOPY /h /e /s /t /r /v
+;   to another drive and have that boot from the same drive-letter.
+;   (Or installing to the same drive by hiding the other system)
+;
+; # Removed Force LBA Usage from Setup #
+;   When AiR-BOOT is installed on an USB-stick, there is a possibility that
+;   the CHS-geometry varies between different machines where the stick is
+;   booted. This would invalidate the CHS-values in the partition table
+;   and also the values that were stored in the AiR-BOOT's internal partition
+;   table, the IPT.
+;   To prevent more nasty things like below from happening, LBA-addressing
+;   is now always used and the setting has been removed from the setup-menu.
+;   While this may prevent AiR-BOOT from running on very old systems,
+;   the focus of AiR-BOOT development is geared towards the future.
+;   Such old systems can use v1.06.
+;
+; # Added extra MBR protection #
+;   When AiR-BOOT is active, it is only AiR-BOOT that writes to the MBR.
+;   To protect the MBR from programming errors, like the one below,
+;   any write to the MBR is now checked for validity.
+;   In essence this is protecting your MBR from bad programming done by me...
+;
+;!## Fixed a very very nasty bug that can destroy the MBR on multiple disks ##!
+;   When Force BIOS-LBA usage is disabled (the default is enabled), and the
+;   the driveletter feature is being set, and valid LVM information is present,
+;   then the MBR of the disk containing the partition of which the driveletter
+;   is changed will be overwritten with the LVM sector !
+;   In addition, if the driveletter was already in use by another partition
+;   on another disk, the MBR of that disk will be overwritten too !!
+;
+; # Fixed a nasty bug when eCS phase1 is active #
+;   When creating a partition in a free space between partitions for
+;   eCS installation, the phase1 boot-through code would calculate the
+;   wrong index for the new partition. As a result the next partition
+;   would be auto-booted instead of the newly installed system.
+;   This has been fixed.
+;   This bug is also present in v1.07 and does not apply to previous versions.
+;
+; v1.0.8-rc2-bld20120423
+; ----------------------
+; # Fixed some minor Installer bugs with SPT < 63 #
+;   Some extra var StatusCode was used instead of Status_Code.
+;   This caused too few tracks not to be reported.
+;   No installation was done however.
+;   This bug is also present in the v1.06 code.
+;
+; # Fixed Installer to handle packed hideparttable #
+;   Implemented upgrading from v1.06 directly to v1.0.8.
+;   Fixed minor stuff when upgrading from v1.06 to v1.07.
+;   Hide partition configuration is now preserved when upgrading.
+;   Fixed minor display bug when SPT < 63.
+;
+; # Implemented DOS code in C cross-platform installer
+;   There is now one C source for 4 platforms:
+;   DOS,WIN32,OS2 and LINUX (Linux portion not ready yet)
+;   This obsoletes AIRBOOT.ASM/AIRBOOT.COM.
+;   DOS Installer is now AIRBOOTD.EXE.
+;
+; # Merged 16-bit Assembler bitfield code to the Installer #
+;   The installer needs to handle the v1.0.8 configuration.
+;   This requires access to the 6-bit packed 'hideparttable'.
+;   To 'not-reinvent-the-wheel', by coding this in C, the Assembler
+;   bitfield functions are integrated using Open Watcom's '_asm' capability.
+;   It may not be pretty and the functions themselves are limited,
+;   but this method prevents maintaining seperate Asm and C implementations.
+;   Will be improved later.
+;
+; # Implemented BLDLEVEL support #
+;   AIRBOOT.BIN, the Installers and SET(A)BOOT now support OS/2 BLDLEVEL
+;   information. This enhances identification and problem tracking/solving.
+;   While BLDLEVEL is an OS/2 command, the BLDLEVEL information itself can
+;   be embedded in any binary. Invoking BLDLEVEL from within OS/2 on, let's
+;   say, the AIRBOOTL.ELF Linux executable, will also show the BLDLEVEL info.
+;   A slight deficiency of BLDLEVEL is that is forces a format on the version.
+;   So, AiR-BOOT v1.0.8 will be shown as v1.00.8.
+;
+; # Added support for Masm6 and Wasm v1.9 -- Experimental use only #
+;   Trying to assemble with Masm6 or Wasm v1.9 reveiled some interesting
+;   behavior aspects in general. While this version can now be assembled with
+;   Masm6 and Wasm too, this was only done to get a 'cross-feeling' for this
+;   project. Future versions will drop support for Tasm, Masm6 and Wasm since
+;   much conditional assembly is needed to support all of them. This was an
+;   experimental excercise only. JWasm is the assembler of choise for this
+;   project and any future versions.
+;
+; # Implemented stop scanning when max. partitions limit exceeded #
+;   Previous versions halted the system when the maximum number of partitions
+;   that can be handled (45) was exceeded.
+;   This required the user to boot from alternate media to correct the problem.
+;   Now, when the partition limit is exceeded, AiR-BOOT displays a pop-up
+;   and waits for a key-press. When the user presses a key, AiR-BOOT continues
+;   and the boot-menu is shown, enabling the user to boot a system to correct
+;   the problem. To indicate this situation, the color of the selection-bar
+;   is displayed in red.
+;
+; # Fixed hiding partitions above old max 30-partitions limit #
+;   Hiding partitions is a per partition setting and it is kept in a table
+;   in the AiR-BOOT image on disk. In previous versions, including v1.0.8-rc1,
+;   this table still held the old number of maximum partitions (30).
+;   So configuring a hide-setting for partitions >30 or hiding more than
+;   30 partitions per partition would not work properly.
+;   Unfortunately, there was no room to expand this table, since it resides
+;   just below the MBR backup, at the end of the AiR-BOOT image.
+;   To work around this, the table now uses a 6-bits packed format and the
+;   drive-letter array, which followed this table has been moved elsewhere.
+;   This is a change in the configuration layout since the previous version,
+;   so the config-version has been bumped to v1.0.8.
+;   TODO: Add upgrade-code to the installer to cope with this.
+;
+; # Removed requirement for LVM P and V name to be the same to edit #
+;   However, when both are the same before the edit, the V name will be
+;   synved to the P name to have them both the same again after the edit.
+;   If they differ, only the V name is updated.
+;
+; # Trying to edit the label of a type 0x35 partition now shows a popup #
+;   The user is informed that type 0x35 labels cannot be edited.
+;
+; # Type 0x35 partitions cannot be added to the AB-menu anymore #
+;   They are not bootable anyway. The user is informed by a popup.
+;
+; # De-tasemized the Assembler sources for JWasm compatibility #
+;   AiR-BOOT can now be built using JWasm, which is the preferred
+;   assembler as of this release. Tasm support will be dropped in the future.
+;
+; # Completely reworked the build-system #
+;   Everything is now done with Makefiles using WMake, Wlink and the
+;   C/C++ Compilers from the Open Watcom development tools together with JWasm.
+;   This obsoletes tasm, tlink and exe2bin.
+;
+; # Cross-Platform support #
+;   AiR-BOOT and it's helpers can now be built on: DOS, Win32, OS/2 and Linux.
+;
+; # Rewrote FIXCODE.ASM in C so the tool-chain is not dependent on a DOS .COM #
+;   Now FIXCODE is built platform-specific and takes care of the embedding
+;   of MPR-protection image.
+;
+; # Created FIXCODE bash-script to accomplish embedding of MBR-protection #
+;   Building on Linux requires that no DOS-tools are used in the tool-chain.
+;   This script essentially performs the same functionality but does not check
+;   certain conditions, like image-too-big, etc.
+;   It is a 'quick-hack' until the Linux version of FIXCODE is operational.
+;
+; v1.0.8-rc1-bld20120124
+; ----------------------
+; # Changed version format to be more WarpIN compatible #
+;   This is a cosmetic change only, the internal format has not changed.
+;
+; # Show LVM VolumeName instead of LVM PartitionName #
+;   Previous versions of AiR-BOOT used the LVM PartitionName as the Label
+;   if LVM-info was present for the partition.
+;   This is inconsistent with MiniLVM which shows the LVM VolumeName.
+;   Starting with v1.0.8 the LVM VolumeName is displayed.
+;
+; # LVM Partition and Volume name Synchronization #
+;   Changing the Label of a partition with LVM-info now synchronizes
+;   the LVM Partition Name with the LVM Volume Name.
+;   This is the same behavior as MiniLVM.
+;   Note however that the Label can only be changed when both the
+;   LVM PartitionName and LVM VolumeName are the same.
+;   See protected editing below.
+;
+; # Protected editing of the Label when LVM-info is present #
+;   When the LVM VolumeName differs from the LVM PartitionName, the user can
+;   edit the label but it will not be saved to the LVM record on disk.
+;   This is to protect configurations created with the classic LVM tool.
+;   Since MiniLVM assigns the same name to both the Partition and the Volume,
+;   the Label can be edited and will be saved for such partitions.
+;   To further protect a given configuration, LVM volumes with type 0x35
+;   cannot be edited at all. This is to ensure that the LVM PartitionNames
+;   remain unique when Spanning Volumes are used.
+;
+; # Editing the Label appended spaces #
+;   When editing and changing the Label of a System using SETUP,
+;   trailing spaces were stored in the LVM Volume and Partition names.
+;   These labels need to be padded with zero's.
+;   This has been fixed.
+;   This bug is also present in v1.06.
+;
+; # Reworked Primary Partition <-> LVM-info association #
+;   The previous way was to use a 1:1 correspondence between the PT-index
+;   and the LVM-index. However, when the PT is cross-linked, lower entries
+;   pointing to higher locations on the disk, or vice-versa, incorrect
+;   LVM-info was associated. Such a cross-linked PT is sometimes generated
+;   by the LVM engine when creating or deleting multiple partitions at once.
+;   Best is to intermediately save after creating or deleting a partition
+;   with (Mini)LVM.
+;   The new way is to search the LVM-entries for the partition requested.
+;
+; # Reworked MBR-code to provide two I13X signatures #
+;   The normal LVM MBR-code uses a special setup to indicate Int13X capability.
+;   It contains the instruction, MOV EAX,'X31I', and some software checks
+;   for the presence of the 'I13X' string in the MBR.
+;   However, the location of this instruction differs between eCS 1.x and
+;   eCS 2.x LVM MBR-code.
+;   For compatibility, the v1.0.8 MBR has the 'I13X' string at both locations.
+;
+; # Fixed booting older eCS installations on HPFS #
+;   When restoring systems from archive or otherwise generated systems,
+;   the HPFS BPB sometimes lacked information that AiR-BOOT did not fill in.
+;   The result was that a wrong partition was booted or that booting
+;   stalled with the "unable to operate harddisk" message.
+;   This has been fixed.
+;
+; # Fixed booting Windows from a logical partition with loader on FAT32 #
+;   Depending on the configuration, sometimes the NTLDR could not be found.
+;   This has been fixed.
+;
+; # Fixed drive-letter feature which was broken in v1.07 #
+;   a)  v1.07 did remember the drive-letter feature was active for a partition,
+;       but it failed to store the drive-letter because too few configuration
+;       sectors were saved. This resulted in arbitrary values to be assigned
+;       to the drive-letter for the partition.
+;   b)  The JFS PBR-code does not use the in-memory BPB but uses the one
+;       that is on disk. This prevented AiR-BOOT from passing the user assigned
+;       drive-letter. AiR-BOOT now inserts the drive-letter in the BPB on disk,
+;       but only if the partition is JFS.
+;       AB v1.06 is also unable to use the drive-letter feature on JFS.
+;   As a convenience, a drive-letter in the dl-feature pop-up can now be set
+;   to "Disabled" by pressing backspace.
+;   (As opposed to arrowing up/down to get to the "Disabled" entry)
+;
+; # Fixed stuck phase1 indicator when wrong name entered #
+;   When using SET(A)BOOT /4:NAME with the MEMDRIVE env-var set,
+;   and NAME being a non-existing partition, the phase1 indicator
+;   would stay stuck between reboots.
+;   This has been fixed.
+;
+; # Fixed DOS installer (AIRBOOT.COM) #
+;   Behavior should now be the same as the eCS and WIN installers.
+;   This re-enables the use of a bootable floppy or usb-stick
+;   to install AiR-BOOT.
+;
+; # Fixed booting from FloppyDrive #
+;   This is actually also broken in v1.06 when Int13X is forced on.
+;   Now regular BIOS calls are used when booting from floppydrive.
+;   A fresh AiR-BOOT installation now includes the floppydrive menu entry.
+;
+; # Fixed chainloading IBM Boot Manager #
+;   AiR-BOOT v1.06 could chainload IBM-BM but only when it resided on
+;   the first disk and was located below the 1024 cylinder and forced Int13X
+;   extensions were disabled.
+;   AiR-BOOT v1.0.8 can now chainload IBM-BM with forced Int13X extensions
+;   enabled (the default) and if IBM-BM resides above the 1024 cylinder limit.
+;   Also, chainloading IBM-BM from the second disk is supported.
+;   Do not use chainloading IBM-BM unless you really have a need to.
+;   See the AiR-BOOT Manual for "gotcha's" when using both AiR-BOOT and IBM-BM.
+;
+; # Corrected contact links #
+;   Version 1.07 still presented the old contact links to the sourceforge
+;   repository and the original author.
+;   This caused confusion with regard to issues with v1.07.
+;   This has been corrected.
+;
+; NOTE:
+;   AB v1.07 had a bug with saving and loading the correct size of the
+;   configuration. This broke the drive-letter feature.
+;   As a result, the CRC over the config was also calculated wrongly.
+;   While AB v1.0.8 fixes this, it has to use the v1.07 way of CRC calculation.
+;   Otherwise SET(A)BOOT from the eCS v2.1 would break on AB v1.0.8 because it
+;   sees a corrupt AiR-BOOT configuration.
+;   This means that the CRC over the AB config is calculated over 5 sectors
+;   instead of 7, just like in v1.07.
+;
+; NOTE:
+;   Because of space constraints most of the debug code has been commented
+;   out in this version.
+;   Possibly it will be re-enabled after code cleanup and changing to JWasm.
+;
+;
+; v1.07-final
+; ===========
+; # Huge Drives and LVM #
+;   When using disks >512GB under eComStation, the drive geometry changes to
+;   127 or 255 sectors per track. Since LVM-info is written at the last sector
+;   of a track, and AiR-BOOT uses the geometry of the MBR, it cannot find the
+;   LVM-info and the eCS partition / volume bootsector.
+;   This has been fixed.
+;   Now, when an eCS-partition is discovered and the drive is >512GB, AiR-BOOT
+;   will use the eCS geometry to locate the LVM-info and the bootsector.
+;
+; # Special loader handling #
+;   The special handling of partition boot-loaders has been enhanced to
+;   enable booting of legacy systems on huge drives with or without OS/2
+;   extended geometry.
+;
+; # eComStation boot-through after phase 1 #
+;   Special functionality is implemented to directly boot a newly
+;   installed eCS system after completing phase 1 of the installation.
+;   This works in conjuntion with the OS/2 specific SET(A)BOOT.EXE program,
+;   also part of the AiR-BOOT package.
+;
+; # Math, Debug, Conv and Aux modules #
+;   These are used for 32-bit arithmatic on 16-bit code,
+;   debug the boot process, converting between data-types
+;   and outputting log-data to the com-port.
+;
+;
+; v1.06
+; =====
+; This is the last version developed by Martin Kiewitz.
+; It serves as the base for the versions above.
+; Please do not post your feedback on sourceforge or bother Martin with
+; regard to issues with the above versions.
+; Use the eCS bug-tracker or the Trac project-page at netlabs and see the
+; documentation of this newer versions for the relevant contact information.
+
Index: trunk/bootcode/airboot.md5
===================================================================
--- trunk/bootcode/airboot.md5	(revision 57)
+++ trunk/bootcode/airboot.md5	(revision 57)
@@ -0,0 +1,1 @@
+92fc6c0fd19a5e86b7359da216663576 *AIRBOOT.BIN
Index: trunk/bootcode/bldlevel.inc
===================================================================
--- trunk/bootcode/bldlevel.inc	(revision 57)
+++ trunk/bootcode/bldlevel.inc	(revision 57)
@@ -0,0 +1,161 @@
+;
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+
+
+
+
+;
+; OS/2 BLDLEVEL Information.
+;
+
+
+;
+; The version values in here are derived from the AiR-BOOT versions
+; as defined in VERSION.INC.
+;
+
+;
+; For some reason JWasm and Tasm don't accept 'EN' for instance, but need
+; it to be split-up. While 'iEN' does work. So all the strings that were not
+; accepted are split-up.
+;
+; Changed langid to be just one letter in build-level, conforming to the
+; AiR-BOOT signature.
+;
+
+; Vendor
+BLDLVL_VENDOR           EQU     'KIEWITZ'
+; Version
+BLDLVL_MAJOR_VERSION    EQU     AB_MAJOR_VERSION    + '0'
+BLDLVL_MIDDLE_VERSION   EQU     AB_MIDDLE_VERSION   + '0'
+BLDLVL_MINOR_VERSION    EQU     AB_MINOR_VERSION    + '0'
+; Build date
+BLDLVL_YEAR             EQU     (AB_YEAR SHR 12 AND 0Fh)+'0',(AB_YEAR SHR 8 AND 0Fh)+'0',(AB_YEAR SHR 4 AND 0Fh)+'0',(AB_YEAR AND 0Fh)+'0'
+BLDLVL_MONTH            EQU     (AB_MONTH SHR 4)+'0',(AB_MONTH AND 0Fh)+'0'
+BLDLVL_DAY              EQU     (AB_DAY SHR 4)+'0',(AB_DAY AND 0Fh)+'0'
+; Build time
+BLDLVL_HOURS            EQU     (AB_HOURS SHR 4)+'0',(AB_HOURS AND 0Fh)+'0'
+BLDLVL_MINUTES          EQU     (AB_MINUTES SHR 4)+'0',(AB_MINUTES AND 0Fh)+'0'
+BLDLVL_SECONDS          EQU     (AB_SECONDS SHR 4)+'0',(AB_SECONDS AND 0Fh)+'0'
+; Build machine
+BLDLVL_MACHINE          EQU     '*UNKNOWN*'    ; 16 chars max.
+; Build language
+IFDEF   WASM
+    ; Wasm can only process the reference to 'lang' in pass 2 because it comes
+    ; from an included file which it has not processed yet at pass 1.
+    IF2
+        BLDLVL_LANGUAGE EQU     TXT_LanguageID
+    ENDIF
+; The other assemblers process 'lang' correctly in pass 1.
+ELSE
+    BLDLVL_LANGUAGE     EQU     TXT_LanguageID
+ENDIF
+; Description
+BLDLVL_DESCRIPTION      EQU     'AiR-BOOT Boot Manager'
+
+
+
+;~ bliep   struct
+    ;~ db  '@#'
+    ;~ db  BLDLVL_VENDOR
+    ;~ db  ':'
+    ;~ db  BLDLVL_MAJOR_VERSION
+    ;~ db  '.'
+    ;~ db  BLDLVL_MIDDLE_VERSION
+    ;~ db  '.'
+    ;~ db  BLDLVL_MINOR_VERSION
+    ;~ db  '#@##1## '
+;~ bld_level_date_start    db  BLDLVL_YEAR
+    ;~ db  '/'
+    ;~ db  BLDLVL_MONTH
+    ;~ db  '/'
+    ;~ db  BLDLVL_DAY
+    ;~ db  ' '
+    ;~ db  BLDLVL_HOURS
+    ;~ db  ':'
+    ;~ db  BLDLVL_MINUTES
+    ;~ db  ':'
+    ;~ db  BLDLVL_SECONDS
+;~ bld_level_date_end    db  '      '
+    ;~ db  BLDLVL_MACHINE
+    ;~ db  '::'
+    ;~ ; Wasm can only process the reference to 'lang' in pass 2 because it
+    ;~ ;comes from an included file which it has not processed yet at pass 1.
+    ;~ IFDEF   WASM
+        ;~ IF2
+            ;~ db  BLDLVL_LANGUAGE
+        ;~ ENDIF
+    ;~ ; The other assemblers process 'lang' correctly in pass 1.
+    ;~ ELSE
+        ;~ db  BLDLVL_LANGUAGE
+    ;~ ENDIF
+    ;~ db  '::'
+    ;~ db  BLDLVL_MINOR_VERSION
+    ;~ db  '::@@'
+    ;~ db  BLDLVL_DESCRIPTION
+    ;~ db  0
+;~ bliep   ends
+
+
+;
+; This macro inserts the BLDLEVEL string at the place where it is invoked.
+;
+InsertBuildLevel    MACRO
+    db  '@#'
+    db  BLDLVL_VENDOR
+    db  ':'
+    db  BLDLVL_MAJOR_VERSION
+    db  '.'
+    db  BLDLVL_MIDDLE_VERSION
+    db  '.'
+    db  BLDLVL_MINOR_VERSION
+    db  '#@##1## '
+bld_level_date_start:
+    db  BLDLVL_YEAR
+    db  '/'
+    db  BLDLVL_MONTH
+    db  '/'
+    db  BLDLVL_DAY
+    db  ' '
+    db  BLDLVL_HOURS
+    db  ':'
+    db  BLDLVL_MINUTES
+    db  ':'
+    db  BLDLVL_SECONDS
+bld_level_date_end:
+    db  '      '
+    db  BLDLVL_MACHINE
+    db  '::'
+    ; Wasm can only process the reference to 'lang' in pass 2 because it comes
+    ; from an included file which it has not processed yet at pass 1.
+    IFDEF   WASM
+        IF2
+            db  BLDLVL_LANGUAGE
+        ENDIF
+    ; The other assemblers process 'lang' correctly in pass 1.
+    ELSE
+        db  BLDLVL_LANGUAGE
+    ENDIF
+    db  '::'
+    db  BLDLVL_MINOR_VERSION
+    db  '::@@'
+    db  BLDLVL_DESCRIPTION
+    db  0
+ENDM
+
Index: trunk/bootcode/mbr-prot/.build
===================================================================
--- trunk/bootcode/mbr-prot/.build	(revision 57)
+++ trunk/bootcode/mbr-prot/.build	(revision 57)
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+#make clean
+make
Index: trunk/bootcode/mbr-prot/.clean
===================================================================
--- trunk/bootcode/mbr-prot/.clean	(revision 57)
+++ trunk/bootcode/mbr-prot/.clean	(revision 57)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+make clean rmbin
Index: trunk/bootcode/mbr-prot/GNUmakefile
===================================================================
--- trunk/bootcode/mbr-prot/GNUmakefile	(revision 57)
+++ trunk/bootcode/mbr-prot/GNUmakefile	(revision 57)
@@ -0,0 +1,8 @@
+###############################################################################
+# GNUmakefile :: This Makefile works as a front-end to other Make Utilities.  #
+###############################################################################
+
+#
+# Include the forwarder.
+#
+include		../../INCLUDE/MAKEFRWD.MIF
Index: trunk/bootcode/mbr-prot/Makefile
===================================================================
--- trunk/bootcode/mbr-prot/Makefile	(revision 57)
+++ trunk/bootcode/mbr-prot/Makefile	(revision 57)
@@ -0,0 +1,286 @@
+###############################################################################
+# Makefile :: Builds the MBR-PROT.BIN 16-bits RAW Protection Image.           #
+###############################################################################
+# rousseau@ecomstation.com
+#
+# Derived from the AIR-BOOT Makefile.
+#
+
+#
+# This Makefile builds the MBR_PROT.BIN image.
+# This image is embedded in the AIRBOOT.BIN image to provide virus protection.
+# The FIXCODE program embeds this image in AIRBOOT.BIN.
+#
+
+
+#
+# Include a Master Makefile with several cross-platform definitions and macros.
+# This is used to compensate for the differences between the target platforms.
+#
+!include	../../INCLUDE/MAKEFILE.MIF
+
+#
+# Specifies the level of debugging.
+# Level 0 is no debugging (release) and each higher level may use other
+# assembler / compiler / linker flags and define jammed-in constants
+# to influence source assembly / compilation.
+#
+DEBUG_LEVEL=0
+MAX_DEBUG_LEVEL=2
+
+#
+# Protect against missing or invalid debug-levels.
+#
+!ifndef DEBUG_LEVEL
+!error DEBUG_LEVEL not defined !
+!elseifndef MAX_DEBUG_LEVEL
+!error MAX_DEBUG_LEVEL not defined !
+!elseif $(DEBUG_LEVEL) > $(MAX_DEBUG_LEVEL)
+!error DEBUG_LEVEL cannot exceed $(MAX_DEBUG_LEVEL) !
+!elseif $(DEBUG_LEVEL) < 0
+!error DEBUG_LEVEL cannot be negative !
+!endif
+
+#
+# Source Level base-name of Target to build.
+#
+BASENAME=MBR-PROT
+
+#
+# Bin Level base-name.
+#
+MODULE=$(BASENAME)
+
+#
+# This is a list of the Targets to be built.
+# For MBR_PROT there is only one real target: MBR-PROT.BIN.
+#
+TARGET=$(MODULE).BIN
+
+#
+# Assembler Tools.
+#
+#ASM=masm
+#ASM=alp
+#ASM=tasm
+#ASM=wasm
+ASM=jwasm
+
+#
+# There are no masm or alp for Linux and the yasm tasm-mode is incompatible.
+# So we override to jwasm when a non-jwasm assembler is specified and
+# we are building on Linux.
+#
+!ifdef	__LINUX__
+!if "$(ASM)"=="masm" | "$(ASM)"=="tasm" | "$(ASM)"=="alp"
+ASM=jwasm
+!endif
+!endif
+
+!if "$(ASM)"=="jwasm"
+# -Cp	= case sensitive symbols
+# -zcw	= no _ prefix on symbols (C model)
+ASM_FLAGS_D0=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -Cp -zcw -Fo$^&.OBJ -Sa -Fl=$^&.LST -Fw$^&.ERR
+ASM_FLAGS_D1=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -Cp -zcw -Zd -Zi -Fo$^&.OBJ -Sa -Fl=$^&.LST -Fw$^&.ERR
+ASM_FLAGS_D2=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -Cp -zcw -Zd -Zi -Fo$^&.OBJ -Sa -Fl=$^&.LST -Fw$^&.ERR
+!elseif "$(ASM)"=="masm"
+ASM_FLAGS_D0=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dMASM -zq -fo=$^&.OBJ -fr=$^&.ERR
+ASM_FLAGS_D1=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dMASM -zq -d1 -fo=$^&.OBJ -fr=$^&.ERR
+ASM_FLAGS_D2=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dMASM -zq -d1 -fo=$^&.OBJ -fr=$^&.ERR
+!elseif "$(ASM)"=="wasm"
+ASM_FLAGS_D0=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dWASM -zq -fo=$^&.OBJ -fr=$^&.ERR
+ASM_FLAGS_D1=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dWASM -zq -d1 -fo=$^&.OBJ -fr=$^&.ERR
+ASM_FLAGS_D2=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dWASM -zq -d1 -fo=$^&.OBJ -fr=$^&.ERR
+!elseif "$(ASM)"=="tasm"
+# -ml	= case sensitive symbols
+ASM_FLAGS_D0=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -ml -m9 -l
+ASM_FLAGS_D1=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -ml -m9 -z -zi -c -la
+ASM_FLAGS_D2=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -ml -m9 -z -zi -c -la
+!elseif "$(ASM)"=="alp"
+ASM_FLAGS_D0=-D:DEBUG_LEVEL=$(DEBUG_LEVEL) -D:ALP -Mb +Feo:OBJ +Fl +Fel:LST +Fm +Fem:ERR
+ASM_FLAGS_D1=-D:DEBUG_LEVEL=$(DEBUG_LEVEL) -D:ALP -Mb +Od:MS16 +Feo:OBJ +Fl +Fel:LST +Fm +Fem:ERR
+ASM_FLAGS_D2=-D:DEBUG_LEVEL=$(DEBUG_LEVEL) -D:ALP
+!else
+!error Unknown Assembler specified !
+!endif
+ASM_FLAGS=$(ASM_FLAGS_D$(DEBUG_LEVEL))
+
+#
+# Linker
+#
+LNK=wlink
+LNK_FLAGS_D0=op q op v disa {1014 1023} op map=$^&.MAP
+LNK_FLAGS_D1=op q op v d all op map=$^&.MAP
+LNK_FLAGS_D2=op q op v d all op map=$^&.MAP
+LNK_FLAGS=$(LNK_FLAGS_D$(DEBUG_LEVEL))
+
+
+#
+# This is executed before Makefile processing.
+#
+.BEFORE
+#	@echo == BEFORE ==
+
+#
+# This is executed after Makefile processing.
+#
+.AFTER
+#	@echo == AFTER ==
+!ifdef	__MSDOS__
+	@echo $(WARN_DOS_BLD_ENV)
+!endif
+
+
+#
+# This builds the target using normal dependency rules.
+# If this Makefile was modified, all targets are forcefully rebuilt.
+#
+all:	.SYMBOLIC Makefile.bu header $(TARGET) footer
+
+
+#
+# Show the header.
+#
+header:	.SYMBOLIC
+	@echo.
+	@echo =====================================================================
+	@echo = MODULE: $(TARGET)               [16-bits Raw Protection Image] =
+	@echo =====================================================================
+#	@echo.
+
+
+#
+# Show the footer.
+#
+footer:	.SYMBOLIC
+#	$(RM) $(TARGET)
+	@echo All targets up to date !
+	@echo.
+
+
+#
+# Create a backup of the Makefile when it is modified.
+# This also forces a rebuild of all targets.
+# So, when changing i.e. the DEBUG_LEVEL, all targets are rebuilt
+# using the new level.
+#
+Makefile.bu:	Makefile
+	@echo.
+	@echo Makefile modified, forcing rebuild of all targets !
+	@echo.
+	@%MAKE clean
+	$(CP) Makefile Makefile.bu
+
+
+
+#
+# MAIN TARGETS
+#
+
+###############################################################################
+# 16-bits RAW :: MBR virus protection to be embedded in the AIRBOOT.BIN image.
+###############################################################################
+#$(TARGET):	$(BASENAME).COM
+#	$(LNK) $(LNK_FLAGS) file $^&.OBJ name $^. sys dos com
+#	$(CP) $(BASENAME).COM $(TARGET)
+#	@echo $(%BLD_LANG)>$^.
+#	@if exist $^. @echo		$^. $(MSG_SUCCESS) - [$(%BLD_LANG) version]
+#	$(RM) $(TARGET)
+#	@echo.
+
+
+
+###############################################################################
+# 16-bits RAW :: MBR virus protection to be embedded in the AIRBOOT.BIN image.
+###############################################################################
+$(TARGET):	$(BASENAME).ASM
+	@echo TARGET: $^.	[DOS 16-bits Raw Image]
+	$(ASM) $(ASM_FLAGS) $(BASENAME).ASM
+	@wdis -fi $^&.OBJ > $^&.WDA
+	$(LNK) $(LNK_FLAGS) file $^&.OBJ name $^. sys dos com
+#	$(LNK) $(LNK_FLAGS) file $^&.OBJ name $^. form raw
+	@if exist $^. @echo		$^. $(MSG_SUCCESS)
+	@ndisasm -k9,0 $^. > $^&.NDA
+#	@echo.
+
+#$(BASENAME).OBJ:	$(BASENAME).ASM
+#	@echo.
+#	@echo TARGET: $^.	[DOS 16-bits Raw Image]
+#	$(ASM) $(ASM_FLAGS) $(BASENAME).ASM
+#	@wdis -fi $^. > $^&.WDA
+
+
+
+#
+# MAIN ACTIONS
+#
+
+
+#
+# Rebuild all targets.
+#
+rebuild:	.SYMBOLIC
+	@%MAKE clean
+	@%MAKE all
+
+#
+# Remove all generated files.
+#
+clean:	.SYMBOLIC
+#	@echo CLEANING UP
+#	@for %%i in ($(TARGET)) do @if exist %%i $(RM) %%i
+	@if exist *.COM $(RM) *.COM
+	@if exist *.BIN $(RM) *.BIN
+	@if exist *.OBJ $(RM) *.OBJ
+	@if exist *.WDA $(RM) *.WDA
+	@if exist *.NDA $(RM) *.NDA
+	@if exist *.MAP $(RM) *.MAP
+	@if exist *.LST $(RM) *.LST
+	@if exist *.ERR $(RM) *.ERR
+	@if exist *.o   $(RM) *.o
+
+#
+# Remove all residual .BIN files.
+#
+rmbin:	.SYMBOLIC
+	@if exist *.BIN $(RM) *.BIN
+
+
+#
+# Help on using this Makefile.
+#
+help:	.SYMBOLIC
+	@echo.
+	@echo		The following actions are available:
+	@echo		wmake 		to build all targets and all languages
+	@echo		wmake list	to show the list of buildable targets
+	@echo		wmake clean 	to remove almost all generated files
+	@echo		wmake rmbin 	to remove all residual BIN files
+	@echo		wmake rebuild	to rebuild all targets
+	@echo		wmake help 	for this information
+	@echo.
+
+#
+# Show the list of buildable targets.
+#
+show:	.SYMBOLIC
+	@echo.
+	@echo		The following [case sensitive] targets can be built:
+	@for %%i in ($(TARGET)) do @echo 	%%i
+	@echo.
+# Alias for show
+list:	.SYMBOLIC
+	@%MAKE show
+
+#
+# Inform user that a rebuild might help if the build process fails.
+#
+.ERROR
+	@echo.
+	@echo		Oops!
+	@echo		Some error occured in this build session.
+	@echo		If it's a linker problem, it could be
+	@echo		the result of out-of-sync object files.
+	@echo		Doing a wmake rebuild might solve the problem.
+	@%MAKE help
+	@echo.
Index: trunk/bootcode/mbr-prot/_build.cmd
===================================================================
--- trunk/bootcode/mbr-prot/_build.cmd	(revision 57)
+++ trunk/bootcode/mbr-prot/_build.cmd	(revision 57)
@@ -0,0 +1,1 @@
+@wmake
Index: trunk/bootcode/mbr-prot/_clean.cmd
===================================================================
--- trunk/bootcode/mbr-prot/_clean.cmd	(revision 57)
+++ trunk/bootcode/mbr-prot/_clean.cmd	(revision 57)
@@ -0,0 +1,1 @@
+@wmake clean rmbin
Index: trunk/bootcode/mbr-prot/mbr-prot.asm
===================================================================
--- trunk/bootcode/mbr-prot/mbr-prot.asm	(revision 57)
+++ trunk/bootcode/mbr-prot/mbr-prot.asm	(revision 57)
@@ -0,0 +1,190 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                         AiR-BOOT SETUP / GENERIC & GENERAL SETUP ROUTINES
+;---------------------------------------------------------------------------
+                ;
+                ; First define processor so when a model is specified
+                ; the correct default segments are created.
+                ;
+                .286
+
+; Tasm needs a memory model for USES on PROC to work.
+IFDEF   TASM
+    ;~ .model large, basic
+    .model  tiny,c
+ENDIF
+
+;_TEXT           SEGMENT     USE16   PUBLIC  'CODE'
+;_TEXT           ENDS
+
+MBRPROT         GROUP       CODE_SEG
+;DGROUP          GROUP       CODE_SEG
+
+CODE_SEG        SEGMENT     USE16   PUBLIC  'CODE'
+
+                ;assume cs:MBRPROT, ds:MBRPROT, es:nothing, ss:nothing
+                assume cs:MBRPROT, ds:MBRPROT, es:nothing, ss:nothing
+
+                org 0000h
+                ;.386p
+                ;.286
+
+;
+; Storage for old interrupt vectors.
+;
+OldInterrupt10  dd      0
+OldInterrupt13  dd      0
+
+MBR_IgnoreWrite db      0
+
+MBRP_Routine:
+    cmp     ah, 03h
+    je      MBRP_NormalWriteTest
+    cmp     ah, 0Bh
+    je      MBRP_NormalWriteTest
+    cmp     ah, 43h
+    je      MBRP_ExtendedWriteTest
+  MBRP_ResumeCall:
+    jmp     dword ptr cs:[OldInterrupt13]
+
+  MBRP_NormalWriteTest:
+    cmp     ch, 0
+    jne     MBRP_ResumeCall
+    cmp     dh, 0
+    jne     MBRP_ResumeCall
+    ; We don't mind which sector, AiR-BOOT is everywhere ;-)
+    test    dl, 80h
+    jz      MBRP_ResumeCall
+    jmp     MBRP_FakeOkay
+
+  MBRP_ExtendedWriteTest:
+    cmp     word ptr ds:[si+0Eh], 0
+    jne     MBRP_ResumeCall
+    cmp     word ptr ds:[si+0Ch], 0
+    jne     MBRP_ResumeCall
+    cmp     word ptr ds:[si+0Ah], 0
+    jne     MBRP_ResumeCall
+    cmp     word ptr ds:[si+08h], 63  ; If Logical Block-Number =>63
+    jae     MBRP_ResumeCall
+    jmp     MBRP_FakeOkay
+
+  MBRP_FakeOkay:
+    test    cs:[MBR_IgnoreWrite], 1
+    jz      MBRP_CrunchSession
+    xor     ah, ah
+    clc
+    retf 2
+
+   MBRP_CrunchSession:
+    ; We are ruining registers here, but we won't get back to caller...
+    mov     ax, 03h                        ; Graphic: Set Mode 3
+    pushf
+    call    dword ptr cs:[OldInterrupt10]
+
+    mov     ax, cs
+    mov     ds, ax
+    mov     ax, 0B800h
+    mov     es, ax
+    xor     di, di
+    mov     ax, 4F20h
+    mov     cx, 2000h                       ; Clears whole screen (using RED)
+    rep     stosw
+
+    mov     si, offset MBRP_Line1
+    mov     di, 1120
+    call    MBRProt_WriteBorderLine
+    mov     cx, 4
+    call    MBRProt_WriteLine
+    mov     si, offset MBRP_EmptyLine
+    mov     cx, 1
+    call    MBRProt_WriteLine
+    mov     si, offset MBRP_Line2
+    mov     cx, 3
+    call    MBRProt_WriteLine
+    mov     si, offset MBRP_EmptyLine
+    mov     cx, 1
+    call    MBRProt_WriteLine
+    mov     si, offset MBRP_Line3
+    call    MBRProt_WriteBorderLine
+
+    mov     ax, 8600h
+    xor     cx, cx
+    mov     dx, 500
+    int     15h                             ; Wait for display...
+   WindowsProcessing:
+    cli
+    jmp     WindowsProcessing
+
+MBRProt_WriteLine              Proc Near    Uses ax bx cx dx
+    add     di, 26
+    mov     ah, 4Ch                      ; red/brightred
+    lodsb
+    stosw
+    mov     ah, 4Fh                      ; red/brightwhite
+    mov     dx, 53
+   MBRP_WriteChar:
+      lodsb
+      stosw
+      dec     dx
+      jnz     MBRP_WriteChar
+    mov     ah, 4Ch                      ; red/brightred
+    lodsb
+    stosw
+    add     di, 24
+    dec     cx
+    jnz     MBRProt_WriteLine
+    ret
+MBRProt_WriteLine              EndP
+
+MBRProt_WriteBorderLine        Proc Near
+   add     di, 26
+   mov     ah, 4Ch
+   mov     dx, 55
+  MBRP_WriteBorderChar:
+      lodsb
+      stosw
+   dec     dx
+   jnz     MBRP_WriteBorderChar
+   add     di, 24
+   ret
+MBRProt_WriteBorderLine        EndP
+
+MBRP_Line1      db      'ÕÍÍŽ!ATTENTION! -> A V1RU5 WAS FOUND <- !ATTENTION!ÃÍÍž'
+MBRP_EmptyLine  db      '³                                                     ³'
+                db      '³ A program tried to write to your Master Boot Record ³'
+                db      '³     AiR-BOOT supposes this as a viral act, so it    ³'
+                db      '³        intercepted it and crashed the system.       ³'
+MBRP_Line2      db      '³ If you tried to install a OS or something like that ³'
+                db      '³  you have to deactivate MBR PROTECTION in AiR-BOOT  ³'
+                db      '³             or contact your supervisor.             ³'
+;MBRP_Line3      db      'ÔÍÍÍŽAiR-BOOT (c) Copyright by M. Kiewitz 1999-2009ÃÍÍŸ'
+MBRP_Line3      db      'ÔÍÍÍŽAiR-BOOT (c) Copyright by M. Kiewitz 1999-2012ÃÍÍŸ'
+
+xxx:
+
+;~ org             1019
+org             763
+
+                ;
+                ; MBR-PROT signature at end.
+                ;
+                db  'MBRPI'
+
+CODE_SEG        ENDS
+                end
Index: trunk/bootcode/regular/auxio.asm
===================================================================
--- trunk/bootcode/regular/auxio.asm	(revision 57)
+++ trunk/bootcode/regular/auxio.asm	(revision 57)
@@ -0,0 +1,456 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                    AiR-BOOT / AUXILARY I/O
+;---------------------------------------------------------------------------
+
+
+; -----------------------
+; Rousseau: # AUXIO.ASM #
+; -----------------------
+; Output some stuff to the serial port.
+; The aux parameters in the MBR must be initialized for this.
+; Lower byte is com-port, 0=disabled, 1=com1, etc.
+; High byte is initialization; see below. (0e3h)
+
+IFDEF   MODULE_NAMES
+DB 'AUXIO',0
+ENDIF
+
+; Initialize the com-port, but only when logging is enabled.
+; It get's it's parameters from the value in the MBR.
+; Out:         AX - line status
+AuxIO_Init      Proc  Near  Uses dx si
+        ; bits 7-5 = datarate   (000=110,001=150,010=300,011=600,100=1200,101=2400,110=4800,111=9600 bps)
+        ; bits 4-3 = parity     (00 or 10 = none, 01 = odd, 11 = even)
+        ; bit  2   = stop-bits  (set = 2 stop-bits, clear = 1 stop-bit)
+        ; bits 1-0 = data-bits  (00 = 5, 01 = 6, 10 = 7, 11 = 8)
+        ; mov      [BIOS_AuxParms],ax             ; save initialization and port
+        mov     dx,[BIOS_AuxParms]            ; DL=port, 0=disabled, 1=com1; DH=config-parms
+        test    dl,dl                         ; see if logging is enabled, if not, skip initialization
+        jz      AuxIO_Init_NoLogging
+
+        dec     dl                            ; adjust port-number
+        and     dl,03h                        ; 3 is max value
+
+        ; Initialization message
+        mov     si,offset AuxInitMsg
+        call    MBR_Teletype
+
+        ; Port number
+        call    VideoIO_SyncPos
+        mov     al,dl
+        inc     al
+        call    VideoIO_PrintByteDynamicNumber
+        xor     si,si
+        call    MBR_TeletypeNL
+
+        ; Do the initialization
+        mov     al,dh                         ; initialization parameters to al
+        mov     dh,0                          ; DX now contains port-number
+        mov     ah,0
+        int     14h                           ; intialize com-port
+    AuxIO_Init_NoLogging:
+        ret
+AuxIO_Init      EndP
+
+
+;
+; Send the Build Information to the COM-port.
+;
+AuxIO_PrintBuildInfo    Proc    Near    Uses ax cx si di
+        ; Print header.
+        mov     si, offset build_info
+        call    AuxIO_Print
+
+        ; Prepare info in temorary buffer.
+        mov     si,offset bld_level_date_start
+        mov     cx,offset bld_level_date_end
+        sub     cx,si
+        mov     di,offset Scratch
+        cld
+        rep     movsb
+
+        ; Fill spaces until assembler specification.
+        mov     al,' '
+        mov     cx,37
+        rep     stosb
+
+        ; Copy assembler specification.
+    IFDEF       JWASM
+        mov     al,'['
+        stosb
+        mov     si,offset jwasm_txt
+    ELSEIFDEF   TASM
+        mov     al,' '
+        stosb
+        mov     al,'['
+        stosb
+        mov     si,offset tasm_txt
+
+    ELSEIFDEF   WASM
+        mov     al,' '
+        stosb
+        mov     al,'['
+        stosb
+        mov     si,offset wasm_txt
+    ELSEIFDEF   MASM
+        mov     al,' '
+        stosb
+        mov     al,'['
+        stosb
+        mov     si,offset masm_txt
+    ELSE
+        mov     al,' '
+        stosb
+        mov     al,'['
+        stosb
+        mov     si,offset unknown_txt
+    ENDIF
+
+    AuxIO_PrintBuildInfo_a1:
+        lodsb
+        test    al,al
+        jz      AuxIO_PrintBuildInfo_e1
+        stosb
+        jmp     AuxIO_PrintBuildInfo_a1
+    AuxIO_PrintBuildInfo_e1:
+        mov     al,']'
+        stosb
+
+        ; Insert NULL Terminator.
+        xor     al,al
+        stosb
+
+        ; Print Info.
+        mov     si, offset Scratch
+        call    AuxIO_Print
+        call    AuxIO_TeletypeNL
+
+        ; OS/2 BLDLEVEL information.
+        mov     si, offset bld_level
+        call    AuxIO_Print
+        call    AuxIO_TeletypeNL
+
+        ret
+AuxIO_PrintBuildInfo    EndP
+
+
+; Print char to com-port (teletype style)
+AuxIO_Teletype  Proc     Near  Uses  ax dx
+
+
+    ;~ pusha
+    ;~ xor     dx,dx
+    ;~ mov     ah,03h
+    ;~ mov     al,00h
+    ;~ int     14h
+    ;~ mov     ah,al
+    ;~ shr     al,4
+    ;~ and     al,0fh
+    ;~ add     al,'0'
+    ;~ cmp     al,'9'
+    ;~ jbe     @F
+    ;~ add     al,7
+;~ @@: push    ax
+    ;~ xor     dx,dx
+    ;~ mov     ah,01h
+    ;~ int     14h
+    ;~ pop     ax
+    ;~ mov     al,ah
+    ;~ and     al,0fh
+    ;~ add     al,'0'
+    ;~ cmp     al,'9'
+    ;~ jbe     @F
+    ;~ add     al,7
+;~ @@: xor     dx,dx
+    ;~ mov     ah,01h
+    ;~ int     14h
+    ;~ popa
+
+        ;~ pusha
+;~ @@:
+        ;~ xor     dx,dx
+        ;~ mov     ah,03h
+        ;~ mov     al,00h
+        ;~ int     14h
+        ;~ and     al,20h
+        ;~ cmp     al,20h
+        ;~ jnz     @B
+        ;~ popa
+
+
+        mov     dx,[BIOS_AuxParms]            ; get port and parameters
+        xor     dh,dh                         ; we don't need the parameters
+        test    dl,dl                         ; test if logging is enabled
+        jz      AuxIO_Teletype_NoLogging      ; nope, return immediately
+        dec     dl                            ; adjust port-number
+        and     dl,03h                        ; 3 is max value
+        mov     ah,01h
+        int     14h                           ; send char to com-port
+    AuxIO_Teletype_NoLogging:
+        ret
+AuxIO_Teletype  EndP
+
+
+; Print newline char (unix) to com-port (teletype style)
+AuxIO_TeletypeNL    Proc     Near  Uses  ax
+        mov     al,10
+        call    AuxIO_Teletype
+        ret
+AuxIO_TeletypeNL    EndP
+
+
+; Print Bin-byte to com-port (teletype style)
+; This outputs 8 characters ('0' or '1' for each bit)
+; In:          AL - byte to send
+; Out:         AL - byte sent
+; Destroyed:   None
+AuxIO_TeletypeBinByte   Proc    Near Uses   ax cx
+        mov     ah,al
+        mov     cx,8
+    AuxIO_TeletypeBinByte_nextchar:
+        xor     al,al
+        rcl     ah,1
+        rcl     al,1
+        add     al,'0'
+        call    AuxIO_Teletype
+        loop    AuxIO_TeletypeBinByte_nextchar
+        ret
+AuxIO_TeletypeBinByte   EndP
+
+; Print Bin-word to com-port (teletype style)
+; This outputs 16 characters ('0' or '1' for each bit)
+; In:          AX - byte to send
+; Out:         AX - byte sent
+; Destroyed:   None
+AuxIO_TeletypeBinWord   Proc
+        xchg    al,ah                      ; High byte first
+        call    AuxIO_TeletypeBinByte      ; Output to com-port
+        xchg    al,ah                      ; low byte next
+        call    AuxIO_TeletypeBinByte      ; Output to com-port
+        ret
+AuxIO_TeletypeBinWord   EndP
+
+; Print Bin-dword to com-port (teletype style)
+; This outputs 32 characters ('0' or '1' for each bit)
+; In:          DX:AX - dword to send
+; Out:         DX:AX - dword sent
+; Destroyed:   None
+AuxIO_TeletypeBinDWord  Proc     Near
+        xchg    ax,dx
+        call    AuxIO_TeletypeBinWord      ; High word first
+        xchg    ax,dx
+        call    AuxIO_TeletypeBinWord      ; Low word next
+        ret
+AuxIO_TeletypeBinDWord  EndP
+
+; Print Bin-qword to com-port (teletype style)
+; This outputs 64 characters ('0' or '1' for each bit)
+; In:          BX:CX:DX:AX - qword to send
+; Out:         BX:CX:DX:AX - qword sent
+; Destroyed:   None
+AuxIO_TeletypeBinQWord  Proc     Near
+        xchg    dx,bx
+        xchg    ax,cx
+        call    AuxIO_TeletypeBinDWord     ; High dword first
+        xchg    dx,bx
+        xchg    ax,cx
+        call    AuxIO_TeletypeBinDWord     ; Low dword next
+        ret
+AuxIO_TeletypeBinQWord  EndP
+
+
+; Print hex-byte to com-port (teletype style)
+; This outputs two characters
+; In:          AL - byte to send
+; Out:         AL - byte sent
+; Destroyed:   None
+AuxIO_TeletypeHexByte   Proc     Near  Uses  ax
+        call    CONV_BinToAsc              ; Returns high hex-nibble in AH, low hex-nibble in AL
+        xchg    al,ah                      ; High hex-nibble first
+        call    AuxIO_Teletype             ; Output to com-port
+        xchg    al,ah                      ; Low hex-nibble next
+        call    AuxIO_Teletype             ; Output to com-port
+        ret
+AuxIO_TeletypeHexByte   EndP
+
+; Print hex-word to com-port (teletype style)
+; This outputs four characters
+; In:          AX - word to send
+; Out:         AX - word sent
+; Destroyed:   None
+AuxIO_TeletypeHexWord   Proc     Near
+        xchg    al,ah                      ; High byte first
+        call    AuxIO_TeletypeHexByte      ; Output to com-port
+        xchg    al,ah                      ; low byte next
+        call    AuxIO_TeletypeHexByte      ; Output to com-port
+        ret
+AuxIO_TeletypeHexWord   EndP
+
+
+; Print hex-dword to com-port (teletype style)
+; This outputs eight characters
+; In:          DX:AX - dword to send
+; Out:         DX:AX - dword sent
+; Destroyed:   None
+AuxIO_TeletypeHexDWord  Proc     Near
+        xchg    ax,dx
+        call    AuxIO_TeletypeHexWord      ; High word first
+        xchg    ax,dx
+        call    AuxIO_TeletypeHexWord      ; Low word next
+        ret
+AuxIO_TeletypeHexDWord  EndP
+
+
+; Print hex-qword to com-port (teletype style)
+; This outputs sixteen characters
+; In:          BX:CX:DX:AX - qword to send
+; Out:         BX:CX:DX:AX - qword sent
+; Destroyed:   None
+AuxIO_TeletypeHexQWord  Proc     Near
+        xchg    dx,bx
+        xchg    ax,cx
+        call    AuxIO_TeletypeHexDWord     ; High dword first
+        xchg    dx,bx
+        xchg    ax,cx
+        call    AuxIO_TeletypeHexDWord     ; Low dword next
+        ret
+AuxIO_TeletypeHexQWord  EndP
+
+
+
+; Print 0-terminated string to com-port
+AuxIO_Print     Proc     Near  Uses  ax bx cx dx
+    AuxIO_PrintNext:
+        lodsb
+        test    al,al
+        jz      AuxIO_PrintEOS
+        call    AuxIO_Teletype
+        jmp     AuxIO_PrintNext
+    AuxIO_PrintEOS:
+        ret
+AuxIO_Print     EndP
+
+
+; Dump a 16-byte block of memory to the com-port in debug-format (hex-bytes and ascii-bytes)
+; In:    DS:SI - pointer to memory to dump
+;
+AuxIO_DumpParagraph     Proc  Near  Uses  ax cx dx si
+
+        ; Dump the index dword
+        xor     dx,dx
+        mov     ax,si
+        call    AuxIO_TeletypeHexDWord
+
+        ; Separate it from the dump
+        mov     al,' '
+        call    AuxIO_Teletype
+        mov     al,' '
+        call    AuxIO_Teletype
+        mov     al,'|'
+        call    AuxIO_Teletype
+        mov     al,' '
+        call    AuxIO_Teletype
+
+        ; Save si for later
+        push    si
+
+        ; Four groups of 4 bytes
+        mov     cx,4
+
+
+    AuxIO_DumpParagraph_Next_1:
+
+        ; byte at offset 0
+        lodsb
+        call    AuxIO_TeletypeHexByte
+
+        ; space separator
+        mov     al,' '
+        call    AuxIO_Teletype
+
+        ; byte at offset 1
+        lodsb
+        call    AuxIO_TeletypeHexByte
+
+        ; space separator
+        mov     al,' '
+        call    AuxIO_Teletype
+
+        ; byte at offset 2
+        lodsb
+        call    AuxIO_TeletypeHexByte
+
+        ; space separator
+        mov      al,' '
+        call    AuxIO_Teletype
+
+        ; byte at offset 3
+        lodsb
+        call    AuxIO_TeletypeHexByte
+
+        ; space separator
+        mov      al,' '
+        call    AuxIO_Teletype
+
+        ; separator
+        mov      al,'|'
+        call    AuxIO_Teletype
+
+        ; space separator
+        mov      al,' '
+        call    AuxIO_Teletype
+
+        loop    AuxIO_DumpParagraph_Next_1
+
+        ; space separator
+        mov      al,' '
+        call    AuxIO_Teletype
+
+        ; recall pointer
+        pop     si
+
+        ; 16 ascii bytes to print
+        mov     cx,16
+
+    AuxIO_DumpParagraph_Next_2:
+        mov     ah,'.'                              ; char to use ufnot printable
+        lodsb                                       ; load byte
+        call    CONV_ConvertToPrintable             ; use dot's if not printable
+        call    AuxIO_Teletype                      ; print it
+        loop    AuxIO_DumpParagraph_Next_2
+        ret
+AuxIO_DumpParagraph     EndP
+
+
+
+AuxIO_DumpSector    Proc  Near  Uses  cx si
+        mov     cx,32                      ; Number of paragraphs in a sector
+    AuxIO_DumpSector_Next:
+        call    AuxIO_DumpParagraph        ; Dump the paragraph
+        add     si,16                      ; Advance pointer
+        call    AuxIO_TeletypeNL
+        loop    AuxIO_DumpSector_Next
+        ret
+AuxIO_DumpSector    EndP
+
+
+AuxIOHello  db 10,10,10,10,10,'AiR-BOOT com-port debugging',10,0
+
+
Index: trunk/bootcode/regular/bootmenu.asm
===================================================================
--- trunk/bootcode/regular/bootmenu.asm	(revision 57)
+++ trunk/bootcode/regular/bootmenu.asm	(revision 57)
@@ -0,0 +1,1135 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                      AiR-BOOT / BOOT-MENU
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'BOOTMENU',0
+ENDIF
+
+BOOTMENU_BuildBackground        Proc Near   Uses es di
+   call    VideoIO_CursorOff
+   ; -------------------------------------------
+   mov     ax, VideoIO_Segment
+   mov     es, ax
+   xor     di, di
+   mov     cx, 2000
+   mov     ax, 0720h
+   rep     stosw                         ; Clear Screen
+   ret
+BOOTMENU_BuildBackground        EndP
+
+CLR_COPYRIGHT_CLASSIC   = 0f00h
+CLR_COPYRIGHT_BM  = 0700h
+
+BOOTMENU_BuildMain              Proc Near   Uses es di
+   ; 1st line with Copyright information...
+   mov     cx, 0101h
+   call    VideoIO_Locate
+   mov     cx, CLR_COPYRIGHT_BM
+   call    VideoIO_Color
+   mov     si, offset Copyright
+   call    VideoIO_Print                 ; Print Copyright Line...
+
+   ; Boot-Window...
+CLR_BOOT_WINDOW_CLASSIC    = 0901h
+CLR_BOOT_WINDOW_BM         = 0701h
+
+   mov     cx, CLR_BOOT_WINDOW_BM
+   call    VideoIO_Color
+   mov     bx, 0201h
+   mov     dx, 0550h
+   add     dh, Menu_TotalLines
+   call    VideoIO_MakeWindow
+   ; The little separator line...
+   mov     cx, 0402h
+   call    VideoIO_Locate
+   mov     al, TextChar_WinLineRight
+   mov     cl, 78
+   call    VideoIO_Internal_MakeWinRight
+
+   mov     dl, 18h
+   cmp     byte ptr [CFG_BootMenuActive], 2
+   jne     BMBM_NoDetailed1
+   mov     dl, 15h
+  BMBM_NoDetailed1:
+   mov     Menu_AbsoluteX, dl
+
+   ; Display Top-Infos (labels) in Boot-Window
+
+CLR_TOP_INFOS_CLASSIC    = 0b01h
+CLR_TOP_INFOS_BM  = 0301h
+
+   mov     cx, CLR_TOP_INFOS_BM
+   call    VideoIO_Color
+   mov     ch, 03h
+   mov     cl, dl
+   call    VideoIO_Locate
+   mov     si, offset TXT_TopInfos_No
+   call    VideoIO_Print
+   add     cl, 5
+   call    VideoIO_Locate
+   ; Dynamic change, if detailed view...
+   mov     si, offset TXT_TopInfos_Hd
+   add     cl, 5
+   cmp     byte ptr [CFG_BootMenuActive], 2
+   jne     BMBM_NoDetailed2
+   mov     si, offset TXT_TopInfos_HdSize
+   add     cl, 8
+  BMBM_NoDetailed2:
+   call    VideoIO_Print
+   ; End of dynamic change
+   call    VideoIO_Locate
+   mov     si, offset TXT_TopInfos_Label
+   call    VideoIO_Print
+   add     cl, 14
+   call    VideoIO_Locate
+   mov     si, offset TXT_TopInfos_Type
+   call    VideoIO_Print
+
+   ; Now make the separating vertical lines...
+CLR_SEP_VERT_LINES_CLASSIC    = 0901h
+CLR_SEP_VERT_LINES_BM   = 0701h
+
+   mov     cx, CLR_SEP_VERT_LINES_BM
+   call    VideoIO_Color
+   mov     ch, 03h
+   mov     cl, Menu_AbsoluteX
+   add     cl, 3
+   mov     dx, cx
+   call    VideoIO_Locate
+   mov     cl, 2
+   add     cl, Menu_TotalLines
+   mov     al, TextChar_WinLineDown
+   call    VideoIO_Internal_MakeWinDown  ; Line between "No" and "Hd"
+   push    cx
+      add     dl, 5
+      cmp     byte ptr [CFG_BootMenuActive], 2
+      jne     BMBM_NoDetailed3
+      add     dl, 8
+     BMBM_NoDetailed3:
+      mov     cx, dx
+      call    VideoIO_Locate
+   pop     cx
+   call    VideoIO_Internal_MakeWinDown  ; Line between "Hd" and "Label"
+   push    cx
+      add     dl, 14
+      mov     cx, dx
+      call    VideoIO_Locate
+   pop     cx
+   call    VideoIO_Internal_MakeWinDown  ; Line between "Label" and "Type"
+
+   ; Finally the little tweaks to make it look good...
+   mov     cl, Menu_AbsoluteX
+   add     cl, 3
+   mov     dl, 3                         ; 3 Steps in Total
+  BMBM_BootWinTweakLoop:
+      mov     ch, 02h
+      call    VideoIO_Locate
+      mov     al, TextChar_WinRep1
+      call    VideoIO_PrintSingleChar
+      mov     ch, 04h
+      call    VideoIO_Locate
+      mov     al, TextChar_WinRep2
+      call    VideoIO_PrintSingleChar
+      mov     ch, 05h
+      add     ch, Menu_TotalLines
+      call    VideoIO_Locate
+      mov     al, TextChar_WinRep3
+      call    VideoIO_PrintSingleChar
+      dec     dl
+      jz      BMBM_EndBootWinTweakLoop
+      cmp     dl, 2
+      jb      BMBM_3rdTweak
+      add     cl, 5
+      cmp     byte ptr [CFG_BootMenuActive], 2
+      jne     BMBM_BootWinTweakLoop
+      add     cl, 8
+      jmp     BMBM_BootWinTweakLoop
+     BMBM_3rdTweak:
+      add     cl, 14
+      jmp     BMBM_BootWinTweakLoop
+  BMBM_EndBootWinTweakLoop:
+
+   ; Display Boot-Information...
+   xor     al, al
+   mov     Menu_UpperPart, al
+   call    BOOTMENU_RefreshPartitionText
+   ; Boot-Window is DONE
+
+; Rousseau: = Colors =
+; FG
+; BG
+; 7 = grey
+; 6 = brown
+; 5 = magenta
+; 4 = red
+; 3 = cyan
+; 2 = green
+; 1 = blue
+
+CLR_INFO_WINDOW_CLASSIC    = 0c04h
+CLR_INFO_WINDOW_BM   = 0701h
+
+   mov     cx, CLR_INFO_WINDOW_BM
+   ;mov     cx, 0C06h ; brown, main background
+   call    VideoIO_Color                    ; Color info window
+
+   mov     bx, 1401h
+   mov     dx, 1950h
+   call    VideoIO_MakeWindow               ; Information-Window
+   ; den kleinen Strich...
+   mov     cx, 1602h
+   call    VideoIO_Locate
+   mov     al, TextChar_WinLineRight
+   mov     cl, 78
+   call    VideoIO_Internal_MakeWinRight
+
+   call    BOOTMENU_BuildTimedBootText
+
+   mov     cx, 1703h
+   call    VideoIO_Locate
+
+CLR_INFO_TEXT_CLASSIC   = 0f04h
+CLR_INFO_TEXT_BM   = 0701h
+
+   mov     cx, CLR_INFO_TEXT_BM             ; Info text
+   call    VideoIO_Color                    ; Color info text
+
+   mov     si, offset TXT_BootMenuHelpText1
+   call    VideoIO_Print
+   mov     cx, 1803h
+   call    VideoIO_Locate
+   mov     si, offset TXT_BootMenuHelpText2
+   call    VideoIO_Print
+
+
+CLR_F10_SETUP_CLASSIC   = 0c04h
+CLR_F10_SETUP_BM        = 0901h
+
+   mov     cx, CLR_F10_SETUP_BM                            ; background F10 enter Setup
+   call    VideoIO_Color
+
+   ; Additional message how to power off system
+   mov     si, offset TXT_BootMenuPowerOff
+   call    GetLenOfString
+   mov     dx, 1902h
+   ;~ sub     dl, cl
+   mov     cx, dx
+   call    VideoIO_Locate
+   mov     al, TextChar_WinRep4
+   call    VideoIO_PrintSingleChar
+   call    VideoIO_Print
+   mov     al, TextChar_WinRep5
+   call    VideoIO_PrintSingleChar
+
+
+   ; Additional message how to enter setup
+   mov     si, offset TXT_BootMenuEnterSetup
+   call    GetLenOfString
+   mov     dx, 194Eh
+   sub     dl, cl
+   mov     cx, dx
+   call    VideoIO_Locate
+   mov     al, TextChar_WinRep4
+   call    VideoIO_PrintSingleChar
+   call    VideoIO_Print
+   mov     al, TextChar_WinRep5
+   call    VideoIO_PrintSingleChar
+   ; HelpWindow done...
+
+
+   ; Rousseau: Debug Stuff, put here after building Main Menu
+   ;call    VideoIO_DBG_WriteString
+   ;call    VideoIO_DBG_WriteString2
+
+   ret
+BOOTMENU_BuildMain              EndP
+
+
+
+BOOTMENU_BuildGoodBye           Proc Near   Uses es di
+   mov     ax, VideoIO_Segment
+   mov     es, ax
+   xor     di, di
+   mov     cx, 2000
+   mov     ax, 0720h
+   rep     stosw
+   ; -------------------------------------------
+
+CLR_GOODBYE_WINDOW_CLASSIC = 0d05h
+CLR_GOODBYE_WINDOW_BM   = 0f01h
+
+   mov     cx, CLR_GOODBYE_WINDOW_BM
+   call    VideoIO_Color
+   mov     bx, 0101h
+   mov     dx, 0550h
+   call    VideoIO_MakeWindow            ; Information-Window
+   xor     di, di
+   mov     cx, 10
+   mov     ax, 0720h
+   rep     stosw
+   mov     di, 162
+   mov     cx, 9
+   mov     al, WinCharRight
+
+   ; Little part before version in goodbye-window
+   ; Does not use color-function
+   ;mov     ah, 05Dh
+   mov     ah, 01fh
+   rep     stosw
+
+   mov     cx, 010Bh
+   call    VideoIO_Locate
+   mov     al, WinCharBB
+   call    VideoIO_PrintSingleChar
+   mov     cx, 0201h
+   call    VideoIO_Locate
+   mov     al, WinCharBB
+   call    VideoIO_PrintSingleChar
+   mov     cx, 000Bh
+   call    VideoIO_Locate
+   mov     al, WinCharEE
+   call    VideoIO_PrintSingleChar
+   ; --------------------------------------- Window done
+   mov     cx, 010Ch
+   call    VideoIO_Locate
+   mov     al, TextChar_WinRep4
+   call    VideoIO_PrintSingleChar
+
+CLR_GOODBYE_AB_VERSION_CLASSIC   = 0e01h
+CLR_GOODBYE_AB_VERSION_BM  = 0e03h
+
+   mov     cx, CLR_GOODBYE_AB_VERSION_BM
+   call    VideoIO_Color
+   mov     si, offset Copyright
+   mov     cl, 11+CopyrightVersionLen
+   call    VideoIO_FixedPrint
+
+   mov     cx, CLR_GOODBYE_WINDOW_BM
+
+   call    VideoIO_Color
+   mov     al, TextChar_WinRep5
+   call    VideoIO_PrintSingleChar
+   mov     cx, 020Dh
+   call    VideoIO_Locate
+
+   CLR_GOODBYE_WINDOW_CLASSIC_2    = 0f05h
+   CLR_GOODBYE_WINDOW_BM_2   = 0701h
+
+   mov     cx,  CLR_GOODBYE_WINDOW_BM_2
+   call    VideoIO_Color
+   inc     si
+   call    VideoIO_Print                 ; Print Copyright to the end...
+   mov     cx, 0303h
+   call    VideoIO_Locate
+   mov     si, offset BootEndMsg         ; Print End-Message...
+   call    VideoIO_Print
+   mov     cx, 0403h
+   call    VideoIO_Locate
+   mov     si, offset BootEndMsg2        ; Print GPL-Message...
+   call    VideoIO_Print
+   ; -------------------------------------------
+   mov     ah, 02h
+   mov     bh, 00h
+   mov     dx, 0600h                     ; Sets cursor location to 7, 1
+   int     10h
+   call    VideoIO_CursorOn
+   ret
+BOOTMENU_BuildGoodBye           EndP
+
+
+
+; Must preserve AX!
+BOOTMENU_BuildTimedBootText     Proc Near   Uses ax cx si es di
+   mov     cx, 1503h ;
+   call    VideoIO_Locate
+
+CLR_NON_TIMED_BAR_CLASSIC  = 0e04h
+CLR_NON_TIMED_BAR_BM = 0701h
+
+   mov     cx, CLR_NON_TIMED_BAR_BM                      ; non-timed time bar
+   call    VideoIO_Color
+   call    VideoIO_Internal_SetRegs
+   mov     cx, 76
+   mov     al, 20h                       ; Space
+   rep     stosw                         ; delete all at first
+   mov     al, TimedBootEnable
+   or      al, al
+   jz      BMBTBT_NoTimed
+   jmp     BMBTBT_TimedBoot
+  BMBTBT_NoTimed:
+   mov     si, offset TXT_TimedBootDisabled
+   call    VideoIO_Print
+   ret
+
+  BMBTBT_TimedBoot:
+   mov     cx, 1503h
+   call    VideoIO_Locate
+
+CLR_TIMED_BAR_CLASSIC   = 0e04h
+CLR_TIMED_BAR_BM  = 0e04h
+
+   mov     cx, CLR_TIMED_BAR_BM ; timed time bar, yellow on red
+   call    VideoIO_Color
+   mov     si, offset TXT_TimedBootLine  ; will print TimedBootEntryName too
+   call    VideoIO_Print
+   mov     si, offset TXT_TimedBootLine2
+   call    VideoIO_Print
+   mov     al, TimedSecondLeft
+   call    VideoIO_PrintByteDynamicNumber
+   mov     si, offset TXT_TimedBootSecond ; 'Second.'
+   cmp     al, 1
+   je      BMBTBT_JustOneLeft
+   mov     si, offset TXT_TimedBootSeconds ; 'Seconds.'
+  BMBTBT_JustOneLeft:
+   call    VideoIO_Print
+   ret
+BOOTMENU_BuildTimedBootText     EndP
+
+BOOTMENU_RefreshPartitionText   Proc Near Uses cx dx
+   mov     dl, Menu_UpperPart  ; Current Partition to Display
+   mov     ch, 5               ; Line On Screen
+   mov     cl, Menu_TotalLines ; Total Lines to Display
+  BMRPT_Loop:
+      ; Write Partition-Info (partition DL) to Screen at CH
+      call    BOOTMENU_BuildPartitionText
+      inc     ch
+      inc     dl
+   dec     cl
+   jnz     BMRPT_Loop
+   ret
+BOOTMENU_RefreshPartitionText   EndP
+
+
+CLR_VOLUME_INDEX_CLASSIC   = 0f01h
+CLR_VOLUME_INDEX_BM  = 0f01h
+
+; Writes Partition-Information to Screen (Boot-Menu)
+;        In: CH - Line to print info
+;            DL - Number of Partition (Base=0)
+; Destroyed: None
+BOOTMENU_BuildPartitionText     Proc Near   Uses ax cx dx si
+   local PartPointer:word
+
+   call    PART_GetPartitionPointer      ; Gets pointer to partition (DL) -> SI
+   mov     PartPointer, si
+
+   ; === Display Boot-Number ===
+   mov     cl, Menu_AbsoluteX
+   mov     dh, cl
+   call    VideoIO_Locate
+   mov     cx, CLR_VOLUME_INDEX_BM                     ; Bwhite, blue
+   call    VideoIO_Color
+   mov     al, dl
+   inc     al
+   call    VideoIO_PrintByteNumber
+
+   ; === Display Drive-Number and Size (Size only in detailed view) ===
+   add     dh, 5
+   ;movzx   cx, dh
+   mov   cl,dh
+   mov   ch,0
+
+   call    VideoIO_Locate
+
+CLR_HD_INDEX_CLASSIC    = 0d01h
+CLR_HD_INDEX_BM   = 0701h
+
+   mov     cx, CLR_HD_INDEX_BM
+   call    VideoIO_Color                 ; Violet, blue
+   mov     si, PartPointer
+   mov     al, [si+LocIPT_Drive]
+   sub     al, 7Fh                       ; Will only display numbers up to 99,
+   call    VideoIO_PrintByteNumber       ;  so only showing harddrives...
+   add     dh, 5
+   cmp     byte ptr [CFG_BootMenuActive], 2
+   jne     BMBPT_NoDetailed
+      add     dh, 8
+      cmp     al, 99
+      jbe     BMBPT_IsHarddrive
+      mov     al, ' '
+      mov     cl, 7
+      call    VideoIO_PrintSingleMultiChar ; Fill up Size-Space with spaces
+      jmp     BMBPT_NoDetailed
+     BMBPT_IsHarddrive:
+      ; Now display Size-Element...
+
+CLR_HD_SIZE_CLASSIC  = 0501h
+CLR_HD_SIZE_BM = 0701h
+
+      mov     cx, CLR_HD_SIZE_BM
+      call    VideoIO_Color              ; Dark-Violet, Blue
+      mov     al, '/'
+      call    VideoIO_PrintSingleChar
+      mov     cx, CLR_HD_SIZE_BM
+      call    VideoIO_Color              ; Violet, Blue
+      mov     ax, PartPointer            ; Get Size-Element from PartPtr (AX)
+      call    PART_GetSizeElementPointer ; DS:SI -> Size-Element...
+      mov     cl, 4
+      call    VideoIO_FixedPrint         ; Display 4 chars from DS:SI
+      inc     TextPosX                   ; Manual-Hackin to adjust TextPos
+      mov     cl, 2
+      call    VideoIO_FixedPrint         ; Display 2 chars from DS:SI
+  BMBPT_NoDetailed:
+
+   ; === Display Label ===
+   ;movzx   cx, dh
+   mov   cl,dh
+   mov   ch,0
+
+   call    VideoIO_Locate
+
+CLR_LABEL_CLASSIC    = 0e01h
+CLR_LABEL_BM   = 0f01h
+
+   mov     cx, CLR_LABEL_BM
+   call    VideoIO_Color                 ; Yellow, blue
+   mov     si, PartPointer
+   add     si, LocIPT_Name
+   mov     cl, 11
+   call    VideoIO_FixedPrint
+
+   ; === Display Type ===
+   add     dh, 14
+   ;movzx   cx, dh
+   mov   cl,dh
+   mov   ch,0
+
+   call    VideoIO_Locate
+   mov     si, PartPointer
+   mov     al, [si+LocIPT_SystemID]
+   call    PART_SearchFileSysName
+
+CLR_FS_NAME_CLASSIC  =  0c01h
+CLR_FS_NAME_BM =  0701h
+
+; Color for drive-letter
+CLR_DL_BM   = 0f01h
+
+   mov     cx, CLR_FS_NAME_BM
+   call    VideoIO_Color                 ; Hrot, Blau
+   mov     cl, 8
+   call    VideoIO_FixedPrint
+
+
+
+DRIVELETTERS_ENABLE     EQU
+
+    IFDEF   DRIVELETTERS_ENABLE
+
+        ;
+        ; THIS IS WHERE WE CAN SHOW DRIVE-LETTERS !
+        ;
+
+        pusha
+
+        mov     al,[CFG_MiscFlags]
+        and     al,00000001b
+        jz      skip_show_dl
+
+
+        ; Dirty hack to clear remaining line when menu is scrolled.
+        ; Padd with spaces.
+        ; Should be implemented in scrolling routine.
+        push    word ptr [TextPosX]
+        mov     si, offset spaces
+        mov     cl,24
+        call    VideoIO_FixedPrint
+        pop     word ptr [TextPosX]
+
+        mov     si, [PartPointer]
+        mov     ah, [si+LocIPT_SystemID]
+
+    IFDEF   AUX_DEBUG
+        mov     al, ' '
+        call    VideoIO_PrintSingleChar
+        mov     al, ah
+        call    VideoIO_PrintHexByte
+        mov     al, ' '
+        call    VideoIO_PrintSingleChar
+    ENDIF
+
+        mov     al, ah
+
+        cmp     al, 07h
+        je      show_dl
+        cmp     al, 0fch
+        je      show_dl
+
+        jmp     skip_show_dl
+
+    show_dl:
+
+        ;~ mov     al, ' '
+        ;~ call    VideoIO_PrintSingleChar
+
+        mov     dl, byte ptr [si+LocIPT_Drive]
+        mov     cx, [si+LocIPT_AbsoluteBegin+00h]
+        mov     bx, [si+LocIPT_AbsoluteBegin+02h]
+
+        mov     si, offset [TmpSector]
+        mov     di,ds
+        call    DriveIO_LoadSectorLBA
+        mov     al, [si+25h]
+
+    IFDEF   AUX_DEBUG
+        call    VideoIO_PrintHexByte
+    ENDIF
+
+        mov     dh,al
+        sub     dh,3dh
+
+        call    LVM_GetDriveLetter
+
+        test    al,al
+        jnz     show_dl2
+
+
+
+        mov     si, offset [dl_hidden]
+        mov     cx, CLR_DL_BM
+        call    VideoIO_Color
+        call    VideoIO_Print
+
+        mov     cx, 0701h
+        call    VideoIO_Color
+
+        mov     al, dh
+        call    VideoIO_PrintSingleChar
+        mov     al, ':'
+        call    VideoIO_PrintSingleChar
+
+        jmp     skip_show_dl
+
+    show_dl2:
+
+        mov     si, offset [dl_text]
+
+        call    VideoIO_Print
+
+        mov     cx, CLR_DL_BM
+        call    VideoIO_Color
+
+        call    VideoIO_PrintSingleChar
+        mov     al,':'
+        call    VideoIO_PrintSingleChar
+
+    skip_show_dl:
+        popa
+
+    ENDIF
+
+
+   ret
+BOOTMENU_BuildPartitionText     EndP
+
+dl_text     db  '   on drive ',0
+dl_hidden   db  '   hidden   ',0
+spaces      db  '                        ',0
+
+;        In: DL - Active Partition
+;            DH - New Active Partition (may not be correct number)
+;       Out: DX - will get returned (fixed, if needed)
+BOOTMENU_BuildChoiceBar         Proc near   Uses ax es di
+
+   ;call  SOUND_Beep
+
+   call    VideoIO_WaitRetrace
+
+
+   ;call  SOUND_Beep
+
+   mov     cl, 10h    ; Color BLUE, Partition DL
+   call    BOOTMENU_ReColorPart
+
+   ;call  SOUND_Beep
+
+   ; Check, if clipping needed...
+   cmp     dh, 0ffh
+   jne     BMBCB_RightMin
+   xor     dh, dh
+  BMBCB_RightMin:
+   cmp     dh, Menu_TotalParts           ; DH is base 0, TotalParts is counter
+   jb      BMBCB_AfterClipping           ; That's why JB and not JBE
+   mov     dh, Menu_TotalParts
+   dec     dh                            ; Now base 0
+  BMBCB_AfterClipping:
+   ; After Clipping
+   mov     dl, dh
+   mov     cl, Menu_UpperPart
+   ; Now check, if we need to Scroll
+   cmp     dh, cl
+   jae     BMBCB_NoScrollUp
+  BMBCB_ScrollingUp:
+   dec     byte ptr [Menu_UpperPart]    ; Adjusted for Wasm
+   cmp     dh, Menu_UpperPart
+   jb      BMBCB_ScrollingUp
+   call    BOOTMENU_RefreshPartitionText
+   jmp     BMBCB_AfterScrolling
+
+  BMBCB_NoScrollUp:
+   add     cl, Menu_TotalLines
+   cmp     dh, cl
+   jb      BMBCB_AfterScrolling
+  BMBCB_ScrollingDown:
+   inc     cl
+   inc     byte ptr [Menu_UpperPart]    ; Adjusted for Wasm
+   cmp     dh, cl
+   jae     BMBCB_ScrollingDown
+   call    BOOTMENU_RefreshPartitionText
+
+
+; Keuze bar
+; 00h black
+; 10h blue
+; 20h green (also nice)
+; 30h cyan (also nice)
+; 40h red
+; 50h magenta
+; 60h brown (nice)
+; 70h white
+; 80h grey
+; 90h light blue (nice)
+; 0a0h bright green
+; 0b0h bright cyan
+; 0c0h bright red
+; 0d0h bright magenta
+; 0e0h bright yellow
+; 0f0h bright white
+
+
+CLR_SELECTION_BAR_CLASSIC  = 50h
+CLR_SELECTION_BAR_BM = 090h
+CLR_SELECTION_BAR_WARNING = 040h
+
+
+
+  BMBCB_AfterScrolling:
+   mov     cl, CLR_SELECTION_BAR_BM
+   test     byte ptr [TooManyPartitions],0ffh ; Check for too many partitions.
+   jz       BOOTMENU_BuildChoiceBar_normal
+   mov     cl, CLR_SELECTION_BAR_WARNING    ; Set red bar if so.
+   BOOTMENU_BuildChoiceBar_normal:
+   call    BOOTMENU_ReColorPart
+   ret
+BOOTMENU_BuildChoiceBar         EndP
+
+;        In: CL - Color, DL - Partition
+; Destroyed: None, but Locate-Pointer gets set
+BOOTMENU_ReColorPart    Proc Near   Uses bx cx es di
+
+        ; call  SOUND_Beep
+
+        mov     bh, cl     ; Color to BH
+        ; First calculate location of bar
+        cmp     Menu_UpperPart, dl
+        ja      BMRCP_NotInWindowView
+        mov     ch, dl
+        sub     ch, Menu_UpperPart          ; CH - Position relative to UpperPart
+        cmp     ch, 14                      ; 14 - Maximum Total in Window
+        ja      BMRCP_NotInWindowView
+        add     ch, 5                       ; Y-Position add-on fixed 5
+        mov     cl, 2                       ; X-Position is always 2
+        call    VideoIO_Locate              ; geht zu CX
+        call    VideoIO_Internal_SetRegs
+        inc     di                          ; DI - Destination+1 -> Color-Byte
+        mov     cl, 78                      ; Length of Bar is always 78
+    BMRCP_ClearLoop:
+        mov     al, es:[di]
+        and     al, 0Fh
+        or      al, bh                      ; Adds background color (from BH)
+
+        ;mov      al,97h
+
+        mov     es:[di], al
+        add     di, 2
+        dec     cl
+        jnz     BMRCP_ClearLoop
+    BMRCP_NotInWindowView:
+        ret
+BOOTMENU_ReColorPart    EndP
+
+
+; Calculate Menu-Variables for Boot-Menu, these use the filtered Part-Pointers
+BOOTMENU_ResetMenuVars      Proc Near   Uses dx
+        xor     dl, dl                        ; Partition at Pos 0 == 1st
+        mov     Menu_UpperPart, dl
+
+        ; = TIMED BOOTING =
+        mov     dl, CFG_TimedBoot
+        mov     TimedBootEnable, dl
+        mov     al, CFG_TimedSecs
+        mov     TimedSecondLeft, al
+        call    TIMER_TranslateSecToTic
+        add     ax, 16                        ; So that the required ammount will
+        mov     CFG_TimedDelay, ax            ; be shown and not Timer-1.
+        call    BOOTMENU_ResetTimedBoot
+        ; = FLOPPY-GET-NAME TIMER =
+        call    BOOTMENU_ResetGetFloppy
+
+        ; Resettet die Base-Variablen...
+        mov     dl, PartitionPointerCount
+        mov     Menu_TotalParts, dl
+
+        ; Copy device-name to the ContBIOSbootSeq-IPT entry
+        ;  Normally this does not need to get done here, but is done for safety
+        ;  reasons if e.g. IPT got changed by SETUP, but that setup was discarded.
+        call    PART_UpdateResumeBIOSName
+
+        ; Default-Partition -> Filtered View -> Menu_EntryDefault
+        mov     dl, CFG_PartDefault
+        call    PART_ConvertFromStraight
+        mov     Menu_EntryDefault, dl
+
+        ; Last-Booted-Partition -> Filtered View -> Menu_EntryLast
+        mov     dl, CFG_PartLast
+        call    PART_ConvertFromStraight
+        mov     Menu_EntryLast, dl
+
+        ; Automatic-Partition -> Filtered View -> Menu_EntryAutomatic
+        mov     dl, CFG_PartAutomatic
+        call    PART_ConvertFromStraight
+        mov     Menu_EntryAutomatic, dl
+
+        ;~ ; [Linux support removed since v1.02]
+        ;~ ; Okay, now we check if Default/Last Kernel Partition Name is available...
+        ;~ ;  if so, simply set Menu_EntryDefault/Menu_EntryLast.
+        ;~ mov     si, offset CFG_LinuxDefaultKernel
+        ;~ call    LINUX_SearchKernelName        ; DL - Filtered Entry No
+        ;~ cmp     dl, 0FFh
+        ;~ je      BMRMV_DefaultKernelNF
+        ;~ mov     Menu_EntryDefault, dl
+    ;~ BMRMV_DefaultKernelNF:
+        ;~ mov     si, offset CFG_LinuxLastKernel
+        ;~ call    LINUX_SearchKernelName        ; DL - Filtered Entry No
+        ;~ cmp     dl, 0FFh
+        ;~ je      BMRMV_LastKernelNF
+        ;~ mov     Menu_EntryLast, dl
+    ;~ BMRMV_LastKernelNF:
+
+        ; restlichen Variablen berechnen...
+        mov     dl, Menu_TotalParts
+        cmp     byte ptr [Menu_TotalParts], 14
+        jbe     BMRMV_NotMoreThan14
+        mov     dl, 14
+    BMRMV_NotMoreThan14:
+        mov     Menu_TotalLines, dl
+
+        ; Now copy the name of the Timed-Booted Partition to TimedBoot-Field
+        mov     dl, Menu_EntryDefault
+        test    byte ptr [CFG_TimedBootLast], 1
+        jz      BMRMV_TimedBootDefault
+        mov     dl, Menu_EntryLast
+    BMRMV_TimedBootDefault:
+        call    PART_GetPartitionPointer      ; Holt SI fr Partition DL
+        add     si, LocIPT_Name
+        mov     cx, 11
+        call    GetLenOfName
+        mov     di, offset TXT_TimedBootEntryName
+        jz      BMRMV_NoName
+        rep     movsb
+    BMRMV_NoName:
+        xor     al, al
+        stosb              ; Ending Zero
+        ret
+BOOTMENU_ResetMenuVars      EndP
+
+; Will Set some Vars after user selected entry to boot...
+;  ...don't select Straight View !
+BOOTMENU_SetVarsAfterMenu   Proc Near
+        ; No Straight View in here...we got filtered view since BootMenu-Startup...
+        mov     al, CFG_RememberTimed
+        test    byte ptr [TimedBootUsed], 1
+        jnz     BMSVAM_TimedBootUsed
+        mov     al, CFG_RememberBoot
+    BMSVAM_TimedBootUsed:
+        or      al, al
+        jz      BMSVAM_DontRememberBoot
+        mov     dl, Menu_EntrySelected
+        call    PART_ConvertToStraight        ; CFG_PartLast is non-filtered
+        ;~ mov     di, offset CFG_LinuxLastKernel
+        ;~ mov     cx, 11
+        cmp     dl, 0FDh                      ; Dont Remember on Floppy/CD-ROM/etc.
+        ja      BMSVAM_DontRememberBoot
+        ;   je      BMSVAM_RememberKernelBoot     ; but remember Kernel-Bootings...
+        mov     CFG_PartLast, dl              ; Remember partition in CFG_PartLast
+        ;~ mov     al, ' '
+        ;~ rep     stosb                         ; SPACE out CFG_LinuxLastKernel
+    BMSVAM_DontRememberBoot:
+        ret
+
+    ;~ BMSVAM_RememberKernelBoot:
+        ;~ mov     dl, Menu_EntrySelected
+        ;~ call    PART_GetPartitionPointer      ; SI - Pointer to Kernel Entry...
+        ;~ add     si, LocIPT_Name
+        ;~ rep     movsb                         ; Copy KernelName 2 CFG_LinuxLastKernel
+        ;~ ret
+BOOTMENU_SetVarsAfterMenu   EndP
+
+
+
+
+; Actually does the Boot-Menu Interaction
+; Sets Carry-flag, if Setup is to be entered, otherwise system shall get booted
+; On boot: Fills out some variables (like Menu_EntrySelected), when Booting
+BOOTMENU_Execute    Proc Near   Uses es di
+        ; Finds out, where to place the bar at first...
+        mov     dl, Menu_EntryDefault
+        test    byte ptr [CFG_RememberBoot], 1
+        jnz     BME_RememberMode
+        test    byte ptr [CFG_RememberTimed], 1
+        jz      BME_ForgetMode
+    BME_RememberMode:
+        mov     dl, Menu_EntryLast
+    BME_ForgetMode:
+        ; Got it, so display bar...
+        mov     dh, dl
+
+        ;~ call    SOUND_Beep
+
+        call    BOOTMENU_BuildChoiceBar       ; DH - Active, DL - Last Active
+
+        ;~ call    SOUND_Beep
+
+        call    SOUND_PreBootMenu
+
+
+    BME_MainLoop:
+
+        ;call    VideoIO_DBG_WriteString2    ; Rousseau
+
+        test    byte ptr [TimedBootEnable], 1
+        jz      BME_NoTimedBoot
+        ; ------------------------------------------------ TIMED BOOT
+        push    ax
+        push    dx
+        call    TIMER_GetTicCount
+        mov     dx, word ptr [TimedTimeOut]
+        sub     dx, ax
+        mov     ax, dx
+        call    TIMER_TranslateTicToSec ; DX - Timertics till ByeBye
+        cmp     al, TimedSecondLeft     ; -> AL - Seconds till ByeBye
+        je      BME_NoFixSecond
+        mov     TimedSecondLeft, al
+        call    BOOTMENU_BuildTimedBootText ; Display Timed-Boot-Text
+    BME_NoFixSecond:
+        cmp     al, 0
+        jne     BME_NoTimeOut
+        pop     dx
+        pop     ax
+        mov     dl, Menu_EntryDefault
+        and     byte ptr [CFG_TimedBootLast], 1
+        jz      BME_TimedBootDefault
+        mov     dl, Menu_EntryLast
+    BME_TimedBootDefault:
+        mov     Menu_EntrySelected, dl        ; Just boot default partition
+        mov     byte ptr [TimedBootUsed], 1           ; set flag...
+        clc                                ; Boot-Now!
+        ret
+
+    BME_NoTimeOut:
+        pop     dx
+        pop     ax
+    BME_NoTimedBoot:
+        ; ------------------------------------------------ FLOPPY-NAME TIMER
+        test    byte ptr [CFG_FloppyBootGetTimer], 1
+        jz      BME_NoFloppyNameTimer
+        ; Wait 2 Seconds everytime
+        push    ax
+        push    dx
+        call    TIMER_GetTicCount
+        cmp     dx, word ptr [FloppyGetNameTimer+2]
+        ja      BME_ExpiredGetFloppy
+        cmp     ax, word ptr [FloppyGetNameTimer+0]
+        jb      BME_NoFloppyNameExpired
+    BME_ExpiredGetFloppy:
+        call    BOOTMENU_ResetGetFloppy
+        pop     dx
+        pop     ax
+        jmp     BME_RefreshFloppyName
+    BME_NoFloppyNameExpired:
+        pop     dx
+        pop     ax
+    BME_NoFloppyNameTimer:
+        ; ------------------------------------------------ KEYBOARD
+        push    dx
+        mov     ah, 1
+        int     16h
+        pop     dx
+        jnz     BME_KeyAvailable
+        jmp     BME_MainLoop
+
+    BME_RefreshFloppyName:
+        test    byte ptr [CFG_IncludeFloppy], 1
+        jz      BME_NoRefreshFloppyName
+        test    byte ptr [CFG_FloppyBootGetName], 1
+        jz      BME_NoRefreshFloppyName
+        call    DriveIO_UpdateFloppyName
+        call    BOOTMENU_RefreshPartitionText
+        call    BOOTMENU_BuildChoiceBar ; Redisplay the selection-bar
+    BME_NoRefreshFloppyName:
+        jmp     BME_MainLoop
+
+        BME_KeyAvailable:
+        push    dx
+        mov     ah, 0
+        int     16h
+        pop     dx
+
+    ;!
+    ;! DEBUG_BLOCK
+    ;! Handle keys to activate debugging routines.
+    ;!
+    IFDEF   AUX_DEBUG
+        call    DEBUG_HandleKeypress
+    ENDIF
+
+      cmp     ah, Keys_ENTER
+        je      BME_KeyEnter
+        cmp     ah, Keys_F10
+        je      BME_KeyF10
+        cmp     ah, Keys_Delete
+        je      BME_KeyDelete
+        cmp     ah, Keys_ESC
+        je      BME_KeyESC
+        ; Upper Keys do not fall under Timed Boot Key Handling
+        test    byte ptr [TimedBootEnable], 1
+        je      BME_NoTimedKeyHandling
+        cmp     byte ptr [CFG_TimedKeyHandling], 1
+        jb      BME_NoTimedKeyHandling     ; = 0
+        je      BME_ResetTimedBoot         ; = 1
+        mov     al, TimedBootEnable        ; = 2
+        xor     al, 1                      ; Flip Flop Switch :]
+        mov     [TimedBootEnable], al
+    BME_ResetTimedBoot:
+        push    dx
+        call    BOOTMENU_ResetTimedBoot     ; Reset Timer
+        call    BOOTMENU_BuildTimedBootText ; Refresh TimedBootText
+        pop     dx
+    BME_NoTimedKeyHandling:
+        cmp     ah, Keys_TAB
+        je      BME_KeyTAB
+        cmp     ah, Keys_Up
+        je      BME_KeyUp
+        cmp     ah, Keys_Down
+        je      BME_KeyDown
+        jmp     BME_MainLoop
+
+    BME_KeyUp:
+        dec     dh
+        call    BOOTMENU_BuildChoiceBar       ; DH - Active, DL - Last Active
+        jmp     BME_MainLoop
+
+    BME_KeyDown:
+        inc     dh
+        call    BOOTMENU_BuildChoiceBar       ; DH - Active, DL - Last Active
+        jmp     BME_MainLoop
+
+    BME_KeyEnter:
+        mov     Menu_EntrySelected, dl
+        mov     byte ptr [TimedBootUsed], 0              ; reset flag...
+        clc                                   ; Boot-Now!
+        ret
+
+    BME_KeyF10:
+        mov     al, Keys_Flags_EnterSetup
+        mov     byte ptr [SETUP_KeysOnEntry], al         ; Simulate user wants to enter setup
+        stc                                   ; Go Re-Enter Setup
+        ret
+
+    BME_KeyDelete:
+        call    SOUND_ExecuteBoot
+        call    APM_TurnOffComputer
+        jmp     BME_MainLoop
+
+    BME_KeyESC:
+        mov     al, [TimedBootEnable]
+        xor     al, 1                         ; Flip Flop Switch :]
+        mov     [TimedBootEnable], al
+        push    dx
+        call    BOOTMENU_ResetTimedBoot     ; Reset Timer
+        call    BOOTMENU_BuildTimedBootText ; Refresh TimedBootText
+        pop     dx
+        jmp     BME_MainLoop
+
+    BME_KeyTAB:
+        push    dx
+        test    byte ptr [CFG_CooperBars], 1
+        jnz     BME_KeyTAB_ShowFX
+        mov     ax, 0501h                  ; Go To Page 1 -> BIOS POST crap
+        int     10h
+        mov     ah, 0
+        int     16h                        ; Wait for any key
+        call    BOOTMENU_ResetTimedBoot     ; Reset Timer
+        call    BOOTMENU_BuildTimedBootText ; Refresh TimedBootText
+        mov     ax, 0500h                  ; Go Back to Page 0
+        int     10h
+        pop     dx
+        jmp     BME_MainLoop
+    BME_KeyTAB_ShowFX:
+        pusha
+        mov     ax, VideoIO_Page1
+        mov     bx, VideoIO_Page0
+        mov     dx, 160
+        xor     di, di
+
+    IFDEF   FX_ENABLED
+        call    FX_InterleaveCopy
+        call    FX_ScrollScreenLeft
+    ENDIF
+
+        mov     ah, 0
+        int     16h                        ; Wait for any key
+        call    BOOTMENU_ResetTimedBoot     ; Reset Timer
+        call    BOOTMENU_BuildTimedBootText ; Refresh TimedBootText
+
+    IFDEF   FX_ENABLED
+        call    FX_ScrollScreenRight
+        call    FX_EndScreenInternalCleanUp
+    ENDIF
+
+        call    BOOTMENU_ResetTimedBoot    ; Reset Timer again...
+        popa
+        pop     dx
+        jmp     BME_MainLoop
+BOOTMENU_Execute                EndP
+
+; Resettet den TimedBoot Timer...
+BOOTMENU_ResetTimedBoot     Proc Near   Uses ax
+        call    TIMER_GetTicCount
+        add     ax, CFG_TimedDelay
+        adc     dx, 0
+        mov     word ptr [TimedTimeOut], ax
+        mov     word ptr [TimedTimeOut+2], dx
+        ret
+BOOTMENU_ResetTimedBoot     EndP
+
+; Resettet den Floppy-Get-Name Timer...
+BOOTMENU_ResetGetFloppy     Proc Near   Uses ax
+        call    TIMER_GetTicCount
+        add     ax, 36                      ; 18*2 -> 2 seconds
+        adc     dx, 0
+        mov     word ptr [FloppyGetNameTimer], ax
+        mov     word ptr [FloppyGetNameTimer+2], dx
+        ret
+BOOTMENU_ResetGetFloppy     EndP
+
+
+
Index: trunk/bootcode/regular/conv.asm
===================================================================
--- trunk/bootcode/regular/conv.asm	(revision 57)
+++ trunk/bootcode/regular/conv.asm	(revision 57)
@@ -0,0 +1,329 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                    AiR-BOOT / CONVERSION
+;---------------------------------------------------------------------------
+
+
+; ----------------------
+; Rousseau: # CONV.ASM #
+; ----------------------
+; This module contains various conversion routines.
+; Some have to do with bin to ascii, others with translation.
+
+
+IFDEF   MODULE_NAMES
+DB 'CONV',0
+ENDIF
+
+; Convert a byte in AL to it's Hex Ascii value.
+; In:          AL - value to convert
+; Out:         AX - two (Hex) Ascii digits
+; Destroyed:   none
+CONV_BinToAsc   Proc  Near
+        mov     ah,al                      ; Save value to process high nibble later
+        and     al,0fh                     ; Mask low nibble
+        add     al,'0'                     ; Convert to ASCII
+        cmp     al,'9'                     ; Is it in the range of '0' - '9' ?
+        jbe     CONV_BinToAsc_DecDigit_1   ; Yep, done
+        add     al,7                       ; Nope, adjust to Hex Ascii
+    CONV_BinToAsc_DecDigit_1:
+        xchg    al,ah                      ; Exchange with saved value to process high nibble
+        shr     al,4                       ; Move high nibble to low nibble (80186+)
+        ;shr     al
+        ;shr     al
+        ;shr     al
+        add     al,'0'                     ; Convert to ASCII
+        cmp     al,'9'                     ; Is it in the range of '0' - '9' ?
+        jbe     CONV_BinToAsc_DecDigit_2
+        add     al,7                       ; Nope, adjust to Hex Ascii
+    CONV_BinToAsc_DecDigit_2:
+        xchg    al,ah                      ; Correct order, AX now contains the two (hex) digits
+        ret
+CONV_BinToAsc   Endp
+
+
+
+; See if a character is printable.
+; Replace with a '.' if not.
+; In:          AL - char to print
+;              AH - char to print if AL is non-printable
+; Out:         AL - char printed (could be dot)
+; Destroyed:   none
+CONV_ConvertToPrintable     Proc  Near
+        cmp     al,20h
+        jb      CONV_ConvertToPrintable_NP       ; Below space, so not printable
+        cmp     al,7eh                           ; Above tilde, so not printable
+        ja      CONV_ConvertToPrintable_NP
+        jmp     CONV_ConvertToPrintable_End   ; Go output it
+    CONV_ConvertToPrintable_NP:
+        mov     al,ah                            ; Use the replacement character
+    CONV_ConvertToPrintable_End:
+        ret
+CONV_ConvertToPrintable     EndP
+
+
+
+; Convert CHS values to LBA address
+; Formula: LBA = ((c * H) + h) * S + s -1
+; c,h,s: requested
+; H,S: heads per cylinder and sectors per track
+; In:          DX:AX - Cylinder
+;              BX    - Head
+;              CX    - Sector
+; Out:         BX:CX:DX:AX - LBA address (64-bits)
+;              ZF=1 if upper 32-bits are zero (LBA32)
+; Destroyed:   none
+CONV_CHS2LBA    Proc  Near
+        local   req_cyl:dword
+        local   req_head:word
+        local   req_sec:word
+        local   lba:qword
+
+        ; Save parameters
+        mov     word ptr [req_cyl],ax      ; save low cyl
+        mov     word ptr [req_cyl+2],dx    ; save high cyl
+        mov     [req_head],bx              ; save head
+        test    cx,cx
+        jnz     CONV_CHS2LBA_sec_ok
+        mov     cx,1                       ; cannot have sector 0, so change to 1
+    CONV_CHS2LBA_sec_ok:
+        dec     cx                         ; prepare for calculation later
+        mov     [req_sec],cx               ; save sec
+
+        ; Clear return value
+        xor     ax,ax
+        mov     word ptr [lba+6],ax
+        mov     word ptr [lba+4],ax
+        mov     word ptr [lba+2],ax
+        mov     word ptr [lba+0],ax
+
+        ; Cyls * Heads
+        mov     dx,word ptr [req_cyl+2]    ; high word of requested cylinder
+        mov     ax,word ptr [req_cyl+0]    ; low word of requested cylinder
+        xor     bx,bx                      ; zero for 32-bit math
+        mov     cx,word ptr [BIOS_Heads]   ; number of heads
+        call    MATH_Mul32
+
+        ; WE DISCARD HIGH 32-BITS HERE BECAUSE CALCULATION
+        ; WOULD REQUIRE 64-bits MATH.
+        ; THIS WILL BE FIXED LATER.
+        ; THIS MEANS LBA >2TiB IS NOT SUPPORTED YET.
+
+        ; Add requested head
+        add     ax,[req_head]
+        adc     dx,0
+        ;adc     cx,0
+        ;adc     bx,0
+
+        ; * Secs
+        xor     bx,bx
+        mov     cx,word ptr [TrueSecs]       ; Implicitly address disk 80h
+        call    MATH_Mul32
+
+        ; Add requested sec
+        add     ax,[req_sec]
+        adc     dx,0
+        ;adc     cx,0
+        ;adc     bx,0
+
+        xor     bx,bx
+        xor     cx,cx
+
+        ; Set ZF if high upper 32-bits are zero
+        or      bx,cx
+
+      ret
+CONV_CHS2LBA    EndP
+
+
+CONV_LBA2CYLS   Proc  Near
+        ret
+CONV_LBA2CYLS   Endp
+
+
+; Convert a character to upper-case
+CONV_ToUpper    Proc  Near
+        cmp     al,'a'
+        jb      CONV_ToUpperSkip1
+        cmp     al,'z'
+        ja      CONV_ToUpperSkip1
+        sub     al,20h
+    CONV_ToUpperSkip1:
+        ret
+CONV_ToUpper   EndP
+
+
+;
+; The bitfield functions below are used to pack values into arrays.
+; A buffer needs to be provided, a bitfield width and an index into the array.
+; These functions are used to pack the hidden partition-table which is
+; too small in the 45-partition version.
+;
+
+
+; IN:   DL = Index to store bitfield
+;       DH = Bitfield width (1-8)
+;       BX = Pointer to bitfield array
+; OUT:  AL = Value of requested bitfield
+;       AH = Mask value
+CONV_GetBitfieldValue   Proc    Near    Uses bx cx dx
+        ; Normalize bit-width in DH.
+        dec     dh          ; Decrement bitfield width to mask invalid values.
+        and     dh,07h      ; Only 3 bits are significant to determine width.
+        mov     cl,dh       ; Save for later use to calculate mask.
+        inc     dh          ; Put back to normalized value.
+
+        ; Calculate corresponding AND-mask in CH.
+        mov     ch,2        ; Were going to shift 2...
+        shl     ch,cl       ; to obtain the mask corresponding...
+        dec     ch          ; to the bitfield width.
+
+        ; Calculate byte-index.
+        mov     al,dl       ; Index in AL.
+        inc     al          ; Increment for calculations.
+        mul     dh          ; Multiply by bitfield width to get bits.
+        mov     cl,8        ; Nr. of bits in a byte.
+        div     cl          ; Divide to get byte index.
+
+        ; Advance pointer to byte-index.
+        add     bl,al       ; Advance pointer...
+        adc     bh,0        ; to byte index.
+
+        ; Determine if we need 1 or 2 byte access to extract the bitfield.
+        mov     cl,ah       ; Get remainder in CL.
+        sub     cl,dh       ; Substract bitfield width to get shift-count.
+        mov     ah,0        ; Prepare upper=0 when field spans no byte bound.
+                            ; Don't change to xor ah,ah or any CY will be lost.
+
+        ; Jump if the bitfield does not span byte boundaries.
+        ; (Remainder - bitfield width >= 0)
+        jae     CONV_GetBitfieldValue_nospan
+
+        ; Bit-field spans byte boundaries, so adjust shift-count
+        ; and use AH to get first part of bitfield.
+        add     cl,8        ; Adjust shift-count.
+        mov     ah,[bx]     ; Get byte into AH instead.
+        dec     bx          ; Adjust pointer to load rest of bitfield.
+
+    CONV_GetBitfieldValue_nospan:
+        mov     al,[bx]     ; Load (rest of) bitfield into AL.
+        shr     ax,cl       ; Shift bitfield to the right.
+        mov     ah,ch       ; Get mask in AH.
+        and     al,ah       ; Mask value.
+        ret
+CONV_GetBitfieldValue   EndP
+
+
+
+
+; IN:   AL = Value to store
+;       DL = Index to store bitfield
+;       DH = Bitfield width (1-8)
+;       BX = Pointer to bitfield array
+; OUT:  AL = Value of stored bitfield
+;       AH = Mask value
+CONV_SetBitfieldValue   Proc    Near    Uses bx cx dx
+        ; Push value for later use.
+        push    ax
+
+        ; Normalize bit-width in DH.
+        dec     dh          ; Decrement bitfield width to mask invalid values.
+        and     dh,07h      ; Only 3 bits are significant to determine width.
+        mov     cl,dh       ; Save for later use to calculate mask.
+        inc     dh          ; Put back to normalized value.
+
+        ; Calculate corresponding AND-mask in CH.
+        mov     ch,2        ; Were going to shift 2...
+        shl     ch,cl       ; to obtain the mask corresponding...
+        dec     ch          ; to the bitfield width.
+
+        ; Calculate byte-index.
+        mov     al,dl       ; Index in AL.
+        inc     al          ; Increment for calculations.
+        mul     dh          ; Multiply by bitfield width to get bits.
+        mov     cl,8        ; Nr. of bits in a byte.
+        div     cl          ; Divide to get byte index.
+
+        ; Advance pointer to byte-index.
+        add     bl,al       ; Advance pointer...
+        adc     bh,0        ; to byte index.
+
+        ; Determine if we need 1 or 2 byte access to extract the bitfield.
+        mov     cl,ah       ; Get remainder in CL.
+        sub     cl,dh       ; Substract bitfield width to get shift-count.
+
+        ; Restore value to poke.
+        pop     ax
+
+
+        ; Jump if the bitfield does not span byte boundaries.
+        ; (Remainder - bitfield width >= 0)
+        jae     CONV_SetBitfieldValue_nospan
+
+        ; Bit-field spans byte boundaries, so adjust shift-count
+        ; and use 16-bit access.
+        add     cl,8        ; Adjust shift-count.
+
+        ; Merge the bitfield to the array.
+        push    cx          ; Save mask (CH) and shift-count (CL).
+        push    ax          ; Save value to store.
+        xor     ah,ah       ; Clear upper byte so we can shift in it.
+        and     al,ch       ; Mask value.
+        shl     ax,cl       ; Move the bitfield to the proper location.
+        mov     dh,[bx]     ; Get 1st part of bitfield from array.
+        dec     bx          ; Adjust pointer.
+        mov     dl,[bx]     ; Get 2nd part of bitfield from array.
+        push    bx          ; We need BX so save it.
+        xor     bh,bh       ; Clear upper byte so we can shift in it.
+        mov     bl,ch       ; Put mask in BL.
+        shl     bx,cl       ; Shift mask to proper location.
+        not     bx          ; Complement it to mask-out the required bitfield.
+        and     dx,bx       ; Mask-out the required bitfield.
+        pop     bx          ; Restore pointer.
+        or      ax,dx       ; Merge the bitfields.
+        mov     [bx],al     ; Store lower byte.
+        inc     bx          ; Adjust pointer.
+        mov     [bx],ah     ; Store upper byte.
+        pop     ax          ; Restore value.
+        pop     cx          ; Restore mask and shift-count.
+
+        ; Done.
+        jmp     CONV_SetBitfieldValue_end
+
+    CONV_SetBitfieldValue_nospan:
+        ; Merge the bitfield to the array.
+        push    cx          ; Save mask (CH) and shift-count (CL).
+        push    ax          ; Save value to store.
+        and     al,ch       ; Mask value.
+        shl     al,cl       ; Move the bitfield to the proper location.
+        mov     dl,[bx]     ; Get byte containing bitfield.
+        shl     ch,cl       ; Shift mask to proper location.
+        not     ch          ; Complement it to mask-out the required bitfield.
+        and     dl,ch       ; Mask-out the required bitfield.
+        or      al,dl       ; Merge the bitfields.
+        mov     [bx],al     ; Store byte containing bitfield.
+        pop     ax          ; Restore value.
+        pop     cx          ; Restore mask and shift-count.
+
+    CONV_SetBitfieldValue_end:
+        mov     ah,ch       ; Get mask in AH.
+        and     al,ah       ; Mask value.
+        ret
+CONV_SetBitfieldValue   EndP
+
Index: trunk/bootcode/regular/debug.asm
===================================================================
--- trunk/bootcode/regular/debug.asm	(revision 57)
+++ trunk/bootcode/regular/debug.asm	(revision 57)
@@ -0,0 +1,943 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                          AiR-BOOT / DEBUG
+;---------------------------------------------------------------------------
+
+
+; -----------------------
+; Rousseau: # DEBUG.ASM #
+; -----------------------
+; This module contains functions for debugging AiR-BOOT.
+; It is only included in debug builds and the codesize of AiR-BOOT increases
+; in that case. To compensate for that, the FX code is disabled when debugging
+; is active. Also, most of the debug-routines can selectively be disabled
+; by commenting-out the define above it.
+
+
+
+IFDEF   MODULE_NAMES
+DB 'DEBUG',0
+ENDIF
+
+;
+; Display a number that was put on the stack.
+; Used to track code-flow.
+;
+dbp     db  '>---------->> DebugProbe: ',0
+DEBUG_Probe     Proc
+        push    bp
+        mov     bp,sp
+        pushf
+        pusha
+
+        mov     si,offset [dbp]         ; Default probe-text.
+        call    AuxIO_Print
+        mov     ax,[bp+04]              ; Get probe-number from stack.
+        call    AuxIO_TeletypeHexWord
+        call    AuxIO_TeletypeNL
+
+        ; Also display registers.
+        popa
+        pusha
+        call    DEBUG_DumpRegisters
+
+        popa
+        popf
+        pop     bp
+        ret     2
+DEBUG_Probe     Endp
+
+
+
+;
+; Show help on keys.
+;
+dbh     db  10,'h=HELP, d=DRIVE-LETTERS, g=GEO, i=IPT, r=RESTART, v=VOL-LETTERS, x=XREF',10,10,0
+DEBUG_ShowHelp      Proc
+        pushf
+        pusha
+        mov     si, offset dbh
+        call    AuxIO_Print
+        popa
+        popf
+        ret
+DEBUG_ShowHelp      EndP
+
+
+;
+; Call list for debug hot-keys.
+;
+dbg_call_list:
+        db      'd'
+        dw      offset  DEBUG_DumpDriveLetters
+        db      'g'
+        dw      offset  DEBUG_DumpGeo
+        db      'h'
+        dw      offset  DEBUG_ShowHelp
+        db      'i'
+        dw      offset  DEBUG_DumpIPT
+        db      'r'
+        dw      offset  AirbootRestart
+        db      'v'
+        dw      offset  DEBUG_DumpVolumeLetters
+        db      'x'
+        dw      offset  DEBUG_DumpPartitionXref
+        db      'R'
+        dw      offset  AirbootRestart
+        db      0
+
+;
+; Handle keypresses when the main menu is active.
+;
+DEBUG_HandleKeypress    Proc
+        pushf
+        pusha
+
+        ; Save hot-key
+        mov     dl,al
+
+        ; Check for digit.
+        cmp     al,'0'
+        jb      DEBUG_HandleKeypress_exit
+        cmp     al,'9'
+        ja      DEBUG_HandleKeypress_try_alpha
+        ; It was a digit.
+        jmp     DEBUG_HandleKeypress_check_it
+
+        ; Check for alpha.
+    DEBUG_HandleKeypress_try_alpha:
+        ; Force upper-case.
+        and     al,11011111b
+        cmp     al,'A'
+        jb      DEBUG_HandleKeypress_exit
+        cmp     al,'Z'
+        ja      DEBUG_HandleKeypress_exit
+        ; It was an alpha.
+        jmp     DEBUG_HandleKeypress_check_it
+
+
+        ; Check if the key is a hot-key.
+    DEBUG_HandleKeypress_check_it:
+        cld
+        mov     si,offset dbg_call_list
+
+        ; Loop over jump-list.
+    DEBUG_HandleKeypress_next_entry:
+
+        ; Load the hot-key.
+        lodsb
+        ; No hot-key (not implemented) if end-of-list.
+        test    al,al
+        jz      DEBUG_HandleKeypress_ni
+
+        ; Compare hot-key and iterate if not the same.
+        cmp     dl,al
+        lodsw
+        jne     DEBUG_HandleKeypress_next_entry
+
+        ; Entry found, call corresponding routine.
+        mov     bx,ax
+        call    bx
+
+        ; Done.
+        jmp     DEBUG_HandleKeypress_exit
+
+        ; Call not-assigned routine.
+    DEBUG_HandleKeypress_ni:
+        call    DEBUG_NotAssigned
+        jmp     DEBUG_HandleKeypress_exit
+
+        ; Return to caller.
+    DEBUG_HandleKeypress_exit:
+        popa
+        popf
+        ret
+DEBUG_HandleKeypress    Endp
+
+
+
+;
+; Show not assigned message.
+;
+dbg_na  db  'This key is not assigned, press ''h'' for Help.',10,0
+DEBUG_NotAssigned       Proc
+        pushf
+        pusha
+        mov     si,offset dbg_na
+        call    AuxIO_Print
+        popa
+        popf
+        ret
+DEBUG_NotAssigned       Endp
+
+
+
+;
+; Dump information before the menu is displayed.
+;
+DEBUG_Dump1     Proc  Near
+        pushf
+        pusha
+
+        ; Hello message
+        mov     si, offset AuxIOHello
+        call    AuxIO_Print
+
+        ; Build Info
+        ;~ mov     si, offset BUILD_DATE
+        ;~ call    AuxIO_Print
+        call    AuxIO_PrintBuildInfo
+
+        ; Start new line
+        call    AuxIO_TeletypeNL
+        ;~ call    AuxIO_TeletypeNL
+
+        ;~ call    DEBUG_DumpHidePartTables
+        ;~ call    DEBUG_CheckMath
+        ;~ call    DEBUG_DumpGeo
+        ;~ call    DEBUG_CheckBitFields
+
+        popa
+        popf
+        ret
+DEBUG_Dump1     EndP
+
+
+;
+; Check the simple 32-bit math functions.
+;
+;~ __CHECK_MATH__  EQU
+DEBUG_CheckMath Proc    Near
+    IFDEF   __CHECK_MATH__
+        pushf
+        pusha
+
+        ; Msg check math-module
+        mov     si,offset db_checkmath
+        call    AuxIO_Print
+
+        ; Output hex-word
+        mov     ax,0BABEh
+        call    AuxIO_TeletypeHexWord
+
+        mov     al,' '
+        call    AuxIO_Teletype
+        mov     al,'*'
+        call    AuxIO_Teletype
+        mov     al,' '
+        call    AuxIO_Teletype
+
+        ; Output hex-word
+        mov     ax,0BABEh
+        call    AuxIO_TeletypeHexWord
+
+        mov     al,' '
+        call    AuxIO_Teletype
+        mov     al,'='
+        call    AuxIO_Teletype
+        mov     al,' '
+        call    AuxIO_Teletype
+
+        mov     ax,0BABEh
+        mul     ax
+        call    AuxIO_TeletypeHexDWord
+
+        ; Start new line
+        call    AuxIO_TeletypeNL
+
+        ; Output hex-dword
+        mov     dx,0DEADh
+        mov     ax,0FACEh
+        call    AuxIO_TeletypeHexDWord
+
+        mov     al,' '
+        call    AuxIO_Teletype
+        mov     al,'*'
+        call    AuxIO_Teletype
+        mov     al,' '
+        call     AuxIO_Teletype
+
+        ; Output hex-dword
+        mov     dx,0DEADh
+        mov     ax,0FACEh
+        call    AuxIO_TeletypeHexDWord
+
+        mov     al,' '
+        call    AuxIO_Teletype
+        mov     al,'='
+        call    AuxIO_Teletype
+        mov     al,' '
+        call    AuxIO_Teletype
+
+        mov     bx,0DEADh
+        mov     cx,0FACEh
+        mov     dx,0DEADh
+        mov     ax,0FACEh
+        call    MATH_Mul32
+        call    AuxIO_TeletypeHexQWord
+
+        call    AuxIO_TeletypeNL
+        call    AuxIO_TeletypeNL
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_CheckMath EndP
+
+
+;
+; Dump the geometry.
+;
+__DUMP_GEO__    EQU
+DEBUG_DumpGeo   Proc
+    IFDEF   __DUMP_GEO__
+        pushf
+        pusha
+
+        ; BIOS cyls
+        mov     dx,word ptr [BIOS_Cyls+02]
+        mov     ax,word ptr [BIOS_Cyls+00]
+        call    AuxIO_TeletypeHexDWord
+        call    AuxIO_TeletypeNL
+
+        ; BIOS heads
+        mov     dx,word ptr [BIOS_Heads+02]
+        mov     ax,word ptr [BIOS_Heads+00]
+        call    AuxIO_TeletypeHexDWord
+        call    AuxIO_TeletypeNL
+
+        ; BIOS secs
+        mov     dx,word ptr [BIOS_Secs+02]
+        mov     ax,word ptr [BIOS_Secs+00]
+        call    AuxIO_TeletypeHexDWord
+        call    AuxIO_TeletypeNL
+
+        ; Bytes per sector
+        mov     ax,[BIOS_Bytes]
+        call    AuxIO_TeletypeHexWord
+        call    AuxIO_TeletypeNL
+
+        ; Total secs
+        mov     bx, word ptr [BIOS_TotalSecs+06]
+        mov     cx, word ptr [BIOS_TotalSecs+04]
+        mov     dx, word ptr [BIOS_TotalSecs+02]
+        mov     ax, word ptr [BIOS_TotalSecs+00]
+        call    AuxIO_TeletypeHexDWord
+        call    AuxIO_TeletypeNL
+
+        ; CHS to LBA
+        mov     dx,1
+        mov     ax,29e5h
+        mov     bx,23h
+        mov     cx,9h
+        call    CONV_CHS2LBA
+        call     AuxIO_TeletypeHexDWord
+        call     AuxIO_TeletypeNL
+
+        popa
+        popf
+    ENDIF
+
+        ret
+DEBUG_DumpGeo   Endp
+
+
+;
+; Dump the internal partition table.
+;
+__DUMP_IPT__    EQU
+DEBUG_DumpIPT   Proc
+    IFDEF   __DUMP_IPT__
+        pushf
+        pusha
+
+        call    AuxIO_TeletypeNL
+
+        mov     si,offset [BIOScontIPTentry]
+        ;~ mov     si,offset [PartitionTable]
+        call    AuxIO_DumpSector
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_DumpIPT   EndP
+
+
+;
+; Dump the new  partitions table.
+;
+;~ __DUMP_NPT__    EQU
+DEBUG_DumpNewPartTable  Proc
+    IFDEF   __DUMP_NPT__
+        pushf
+        pusha
+
+        call    AuxIO_TeletypeNL
+
+        mov     si,offset [NewPartTable]
+        call    AuxIO_DumpSector
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_DumpNewPartTable  EndP
+
+
+;
+; Dump the partition pointers table.
+;
+;~ __DUMP_PP__     EQU
+DEBUG_DumpPartitionPointers     Proc
+    IFDEF   __DUMP_PP__
+        pushf
+        pusha
+
+        call    AuxIO_TeletypeNL
+
+        mov     si,offset [PartitionPointers]
+        mov     cx,7
+
+    DEBUG_DumpPartitionPointers_next:
+        call    AuxIO_DumpParagraph
+        add     si,16
+        call    AuxIO_TeletypeNL
+        loop    DEBUG_DumpPartitionPointers_next
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_DumpPartitionPointers     EndP
+
+
+;
+; Dump the partition x-ref table.
+;
+__DUMP_PX__     EQU
+DEBUG_DumpPartitionXref     Proc
+    IFDEF   __DUMP_PX__
+        pushf
+        pusha
+
+        mov     si, offset [xrt]
+        call    AuxIO_Print
+        ;~ call    AuxIO_TeletypeNL
+
+        mov     si,offset [PartitionXref]
+        mov     cx,3
+
+    DEBUG_DumpPartitionXref_next:
+        call    AuxIO_DumpParagraph
+        add     si,16
+        call    AuxIO_TeletypeNL
+        loop    DEBUG_DumpPartitionXref_next
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_DumpPartitionXref     EndP
+
+
+;
+; Dump the dl-feature drive-letters.
+;
+__DUMP_DL__     EQU
+DEBUG_DumpDriveLetters      Proc
+    IFDEF   __DUMP_DL__
+        pushf
+        pusha
+
+        mov     si, offset [ddl]
+        call    AuxIO_Print
+
+        ; Dump the old drive-letters as set with the dl-feature.
+        mov     si,offset [DriveLetters]
+        mov     cx,3
+    DEBUG_DumpDriveLetters_next_1:
+        call    AuxIO_DumpParagraph
+        add     si,16
+        call    AuxIO_TeletypeNL
+        loop    DEBUG_DumpDriveLetters_next_1
+
+        ; Dump the new drive-letters as composed when scanning partitions
+        ; and partitions were added or removed.
+        mov     si,offset [NewDriveLetters]
+        mov     cx,3
+    DEBUG_DumpDriveLetters_next_2:
+        call    AuxIO_DumpParagraph
+        add     si,16
+        call    AuxIO_TeletypeNL
+        loop    DEBUG_DumpDriveLetters_next_2
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_DumpDriveLetters      EndP
+
+
+;
+; Dump the lvm volume drive-letters.
+;
+__DUMP_VL__     EQU
+DEBUG_DumpVolumeLetters     Proc
+    IFDEF   __DUMP_VL__
+        pushf
+        pusha
+
+        mov     si, offset [dvl]
+        call    AuxIO_Print
+
+        mov     si,offset [PartitionVolumeLetters]
+        mov     cx,3
+
+    DEBUG_DumpVolumeLetters_next:
+        call    AuxIO_DumpParagraph
+        add     si,16
+        call    AuxIO_TeletypeNL
+        loop    DEBUG_DumpVolumeLetters_next
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_DumpVolumeLetters     EndP
+
+
+
+
+;
+; Dump the registers.
+;
+__DUMP_REG__    EQU
+IFDEF   __DUMP_REG__
+regAX   db  'AX:',0
+regBX   db  ' BX:',0
+regCX   db  ' CX:',0
+regDX   db  ' DX:',0
+regSI   db  ' SI:',0
+regDI   db  ' DI:',0
+
+regBP   db  'CS:',0
+regSP   db  ' DS:',0
+regCS   db  ' ES:',0
+regSS   db  ' SS:',0
+regDS   db  ' SP:',0
+regES   db  ' BP:',0
+
+;~ regFS   db  'FS:',0
+;~ regGS   db  ' GS:',0
+ENDIF
+DEBUG_DumpRegisters     Proc
+    IFDEF   __DUMP_REG__
+        pushf
+        pusha
+
+        push    si
+        mov     si, offset regAX
+        call    AuxIO_Print
+        call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        call    AuxIO_Print
+        mov     ax,bx
+        call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        call    AuxIO_Print
+        mov     ax,cx
+        call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        call    AuxIO_Print
+        mov     ax,dx
+        call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        call    AuxIO_Print
+        pop     ax
+        call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        call    AuxIO_Print
+        mov     ax,di
+        call    AuxIO_TeletypeHexWord
+        call    AuxIO_TeletypeNL
+
+
+
+        call    AuxIO_Print
+        mov     ax,cs
+        call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        call    AuxIO_Print
+        mov     ax,ds
+        call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        call    AuxIO_Print
+        mov     ax,es
+        call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        call    AuxIO_Print
+        mov     ax,ss
+        call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        call    AuxIO_Print
+        mov     ax,sp
+        call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        call    AuxIO_Print
+        mov     ax,bp
+        call    AuxIO_TeletypeHexWord
+        call    AuxIO_TeletypeNL
+
+        ;~ call    AuxIO_Print
+        ;~ mov     ax,fs
+        ;~ call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        ;~ call    AuxIO_Print
+        ;~ mov     ax,gs
+        ;~ call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+
+        call    AuxIO_TeletypeNL
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_DumpRegisters     EndP
+
+
+;
+; Dump CHS values.
+;
+__DUMP_CHS__    EQU
+DEBUG_DumpCHS   Proc    Near
+    IFDEF   __DUMP_CHS__
+        pushf
+        pusha
+        mov     al,'C'
+        call    AuxIO_Teletype
+        mov     al,':'
+        call    AuxIO_Teletype
+        mov     ah,cl
+        shr     ah,6
+        mov     al,ch
+        call    AuxIO_TeletypeHexWord
+        mov     al,' '
+        call    AuxIO_Teletype
+        mov     al,'H'
+        call    AuxIO_Teletype
+        mov     al,':'
+        call    AuxIO_Teletype
+        mov     al,dh
+        call    AuxIO_TeletypeHexByte
+        mov     al,' '
+        call    AuxIO_Teletype
+        mov     al,'S'
+        call    AuxIO_Teletype
+        mov     al,':'
+        call    AuxIO_Teletype
+        mov     al,cl
+        and     al,00111111b
+        call    AuxIO_TeletypeHexByte
+        call    AuxIO_TeletypeNL
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_DumpCHS   EndP
+
+
+;
+; Dump BSS.
+;
+;~ __DUMP_BSS__    EQU
+DEBUG_DumpBSSSectors    Proc    Near
+    IFDEF   __DUMP_BSS__
+        pushf
+        pusha
+
+        mov     si, offset [PartitionSector]
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+
+        mov     si, offset [PBRSector]
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+
+        mov     si, offset [LVMSector]
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+
+        mov     si, offset [TmpSector]
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+
+        mov     si, offset [NewPartTable]
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+        call    AuxIO_TeletypeNL
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_DumpBSSSectors    EndP
+
+
+;
+; Dump 6-bit packed hide partition table.
+;
+;~ __DUMP_HPT__    EQU
+DEBUG_DumpHidePartTables    Proc    Near
+    IFDEF   __DUMP_HPT__
+        pushf
+        pusha
+
+        mov     cx,3
+        mov     si, offset [HidePartitionTable]
+    again1:
+        call    AuxIO_DumpSector
+        add     si,512
+        loop    again1
+        call    AuxIO_TeletypeNL
+
+        mov     cx,3
+        mov     si, offset [PartitionXref]
+    again2:
+        call    AuxIO_DumpParagraph
+        call    AuxIO_TeletypeNL
+        add     si,16
+        loop    again2
+        call    AuxIO_TeletypeNL
+
+        mov     cx,3
+        mov     si, offset [NewHidePartTable]
+    again3:
+        call    AuxIO_DumpSector
+        add     si,512
+        loop    again3
+        call    AuxIO_TeletypeNL
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_DumpHidePartTables    EndP
+
+
+;
+; Check the bitfield routines.
+;
+;~ __CBF__     EQU
+DEBUG_CheckBitFields    Proc
+    IFDEF   __CBF__
+        pushf
+        pusha
+
+        mov     bx,offset [ott]
+
+        mov     al,0
+        mov     dl,0
+        mov     dh,6
+    DEBUG_CheckBitFields_next_write:
+        call    CONV_SetBitfieldValue
+        inc     al
+        inc     dl
+        jnz     DEBUG_CheckBitFields_next_write
+
+        mov     dl,0
+        mov     dh,6
+    DEBUG_CheckBitFields_next_read:
+        mov     al,dl
+        call    AuxIO_TeletypeHexByte
+        mov     al,':'
+        call    AuxIO_Teletype
+        call    CONV_GetBitfieldValue
+        call    AuxIO_TeletypeHexWord
+        call    AuxIO_TeletypeNL
+        inc     dl
+        jnz     DEBUG_CheckBitFields_next_read
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_CheckBitFields    EndP
+
+
+
+
+;
+; Dump information before the partition is booted.
+;
+;~ __DMP2__    EQU
+DEBUG_Dump2     Proc  Near
+    IFDEF   __DMP2__
+        pushf
+        pusha
+
+        call    AuxIO_TeletypeNL
+        call    AuxIO_TeletypeNL
+
+        mov     si,offset db_config
+        call    AuxIO_Print
+
+        mov     si,offset db_cfgparts
+        call    AuxIO_Print
+        mov     al,[CFG_Partitions]
+        call    AuxIO_TeletypeHexByte
+        call    AuxIO_TeletypeNL
+
+        mov     si,offset db_cfgpartdef
+        call    AuxIO_Print
+        mov     al,[CFG_PartDefault]
+        call    AuxIO_TeletypeHexByte
+        call    AuxIO_TeletypeNL
+
+        mov     si,offset db_cfgpartlast
+        call    AuxIO_Print
+        mov     al,[CFG_PartLast]
+        call    AuxIO_TeletypeHexByte
+        call    AuxIO_TeletypeNL
+        call    AuxIO_TeletypeNL
+
+        mov     si,offset db_vars
+        call    AuxIO_Print
+
+        mov     si,offset db_newpart
+        call    AuxIO_Print
+        mov     si,offset NewPartTable
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+        add     si,512
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+        call    AuxIO_TeletypeNL
+
+        mov     si,offset db_newhide
+        call    AuxIO_Print
+        mov     si,offset NewHidePartTable
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+        add     si,512
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+        call    AuxIO_TeletypeNL
+
+        mov     si,offset db_dletters
+        call    AuxIO_Print
+        mov     si,offset NewDriveLetters
+        call    AuxIO_DumpParagraph
+        call    AuxIO_TeletypeNL
+        add     si,16
+        call    AuxIO_DumpParagraph
+        call    AuxIO_TeletypeNL
+        call    AuxIO_TeletypeNL
+
+        mov     si,offset db_tmpec
+        call    AuxIO_Print
+        mov     si,offset TmpSector
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+        call    AuxIO_TeletypeNL
+
+        mov     si,offset db_partsec
+        call    AuxIO_Print
+        mov     si,offset PartitionSector
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+        call    AuxIO_TeletypeNL
+
+        popa
+        popf
+    ENDIF
+        ret
+DEBUG_Dump2     EndP
+
+
+
+xrt     db  10,'XrefTable:',10,0
+ddl     db  10,'Driveletters:',10,0
+dvl     db  10,'VolumeLetters:',10,0
+dlra    db  10,'LVM_DoLetterReassignment: ',0
+ptetb   db  10,'Partition Table Entry to boot',10,0
+bios_reg    db  10,'Registers passed by BIOS:',10,0
+;~ diopmbr db  10,'DriveIO_ProtectMBR',10,0
+dioss   db  10,'DriveIO_SaveSector',10,0
+
+
+;~ db_mbr              db "## MBR ##",10,0
+;~ db_masterlvm        db "## MLVMR ##",10,0
+
+;~ db_checkmath        db "## CHK MATH ##",10,0
+
+
+;~ db_config           db '## CFG (DMP2) ##',10,0
+;~ db_cfgparts         db 'CFG_Partitions:',0
+;~ db_cfgpartdef       db 'CFG_PartDefault:',0
+;~ db_cfgpartlast      db 'CFG_PartLast:',0
+
+
+;~ db_vars             db '## VARS ##',10,0
+;~ db_partsec          db 'PartitionSector:',10,0
+;~ db_lvmsec           db 'LVMSector :',10,0
+;~ db_tmpec            db 'TmpSector :',10,0
+
+;~ db_newpart          db 'NewPartTable :',10,0
+;~ db_newhide          db 'NewHideTable:',10,0
+;~ db_dletters         db 'NewDriveLetters:',10,0
+
+;~ db_partsize         db 'PartitionSizeTable:',10,0
+;~ db_partpoint        db 'PartitionPointers:',10,0
+;~ db_partpointcnt     db 'PartitionPointerCount:',0
+;~ db_partxref         db 'PartitionXref:',10,0
+;~ db_partvoldl        db 'PartitionVolumeLetters:',10,0
+
+;~ db_totaldisks       db 'TotalHarddiscs:',0
+;~ db_lbaswitchtab     db 'LBASwitchTable:',10,0
+;~ db_newparts         db 'NewPartitions:',0
+
+;~ db_exabspos         db 'ExtendedAbsPos:',0
+;~ db_exabsposset      db 'ExtendedAbsPosSet:',0
+
+;~ db_curpartloc       db 'CurPartition_Location:',0
+;~ db_curiox           db 'CurIO_UseExtension:',0
+
+;~ db_curlvmsec        db 'Current LVM Sector:',0
+
+
+;~ drive                   db 'drive                    : ',0
+;~ before_lvm_adjust       db 'before lvm adjust        : ',0
+;~ after_lvm_adjust        db 'after lvm adjust         : ',0
+;~ before_lvm_adjust_log   db 'before lvm logical adjust: ',0
+;~ after_lvm_adjust_log    db 'after lvm logical adjust : ',0
+;~ spt_used                db 'spt used                 : ',0
Index: trunk/bootcode/regular/driveio.asm
===================================================================
--- trunk/bootcode/regular/driveio.asm	(revision 57)
+++ trunk/bootcode/regular/driveio.asm	(revision 57)
@@ -0,0 +1,1467 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                      AiR-BOOT / DRIVE I/O
+;---------------------------------------------------------------------------
+
+
+
+IFDEF   MODULE_NAMES
+DB 'DRIVEIO',0
+ENDIF
+
+; Note: Some routines set DS/ES to CS or even address via CS, even if its not
+;        needed. This was done for SECURITY. So DO NOT remove it.
+;        Its there to make sure the correct data is loaded/written to/from
+;        harddrive.
+;
+;  IF YOU MODIFY ANYTHING IN HERE, YOU MAY EASILY BREAK YOUR HARDDRIVE!
+
+; Will only load base-configuration, will NOT load IPT nor Hide-Config
+;  Those are originally loaded on startup and will NOT get reloaded.
+DriveIO_LoadConfiguration   Proc Near   Uses ax bx cx dx es
+        mov     ax, cs
+        mov     es, ax
+        mov     bx, offset Configuration
+        mov     dx, 0080h                     ; First harddrive, Sector 55...
+        mov     cx, 0037h
+        mov     ax, 0201h                     ; Function 02, read 1 sector...
+        int     13h
+        jnc     DIOLC_NoError
+        call    MBR_LoadError                 ; Will Abort BootUp
+    DIOLC_NoError:
+        ret
+DriveIO_LoadConfiguration   EndP
+
+DriveIO_SaveConfiguration   Proc Near   Uses ax bx cx dx ds es si
+        mov     ax, cs
+        mov     ds, ax
+        mov     es, ax                        ; Safety first (CS==DS==ES)
+        ; --- Overwrite Floppy-Name with "FloppyDrive"
+        mov     si, offset TXT_Floppy_Drive
+        mov     di, offset PartitionTable
+        sub     di, 30                        ; Adjust to Floppy-Name
+        mov     cx, 11
+        rep     movsb
+        mov     si, offset Configuration      ; Calculate new checksum
+        xor     bx, bx
+
+        ; Changed from 5 to calculated value (not here, see compat. issue below)
+        ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"
+        ; Size of the ab-configuration in 512 byte sectors
+        ;mov     cx, (MBR_BackUpMBR - Configuration) / 200h
+
+        ; AB v1.07 stores a 5 sector configuration with a 5 sector checksum.
+        ; AB v1.0.8+ *should* stores a 7 sector configuration with a
+        ; 7 sector checksum.
+        ; Because 5 was hardcoded here, SET(A)BOOT v1.07 will see see an AB v1.0.8+
+        ; config as corrupted, while this is not the case.
+        ; So, for compatibility reasons, in v1.0.8+, the checksum stored is over
+        ; 5 sectors, to be compatible with v1.07.
+        ; This may change (be corrected) in future versions !
+        mov     cx,5
+
+        mov     dx, [CFG_CheckConfig]
+        mov     [CFG_CheckConfig], bx
+    DIOSC_Loop:
+        call    MBR_GetCheckOfSector
+        loop    DIOSC_Loop
+        mov     [CFG_CheckConfig], bx
+        ; --------------------------------------------------------------------
+        ; ES == CS
+        mov     bx, offset Configuration
+        mov     dx, 0080h                     ; First harddrive, Sector 55...
+        mov     cx, 0037h
+
+        ; Changed from 5 to calculated value
+        ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"
+        ; Size of the ab-configuration in 512 byte sectors
+        mov     al, (MBR_BackUpMBR - Configuration) / 200h
+        mov     ah,03h
+
+        int     13h
+        jnc     DIOSC_NoError
+        call    MBR_SaveError                 ; Will Abort BootUp
+    DIOSC_NoError:
+        ret
+DriveIO_SaveConfiguration   EndP
+
+DriveIO_UpdateFloppyName    Proc Near   Uses bx cx dx ds si es di
+        mov     ax, cs
+        mov     ds, ax
+        mov     es, ax
+
+        mov     ah, 00h                        ; Function 0 - Reset Drive
+        xor     dl, dl
+        int     13h
+        xor     dx, dx                         ; Cylinder=0, Head=0
+        mov     cx,  1                         ; Sector=1, Drive=0
+        mov     bx, offset TmpSector           ; ES:BX - TmpSector
+        mov     ax, 0201h                      ; Function 2 - Load Sector
+        int     13h
+        jnc     DIOUFN_AllFine
+
+        ; --- Overwrite Floppy-Name with "No Disc"
+        mov     si, offset TXT_Floppy_NoDisc
+        xor     ax, ax
+    DIOUFN_WriteFloppyName:
+        mov     di, offset PartitionTable
+        sub     di, 30                         ; Adjust to Floppy-Name
+        mov     cl, 11
+        rep     movsb
+        ret     ; AX=-1 -> GotDisc, =0 -> NoDisc
+
+        ; --- Floppy found and read, data in TempSector
+    DIOUFN_AllFine:
+        mov     ax, -1
+        mov     si, offset TXT_Floppy_NoName
+        cmp     wptr es:[bx+54], 'AF'
+        jne     DIOUFN_WriteFloppyName
+        cmp     wptr es:[bx+56], '1T'
+        jne     DIOUFN_WriteFloppyName
+        cmp     bptr es:[bx+58], '2'
+        jne     DIOUFN_WriteFloppyName
+        mov     si, bx
+        add     si, 43                         ; FAT12 - Volume Label Location
+        jmp     DIOUFN_WriteFloppyName
+DriveIO_UpdateFloppyName    EndP
+
+; =============================================================================
+;                      HARDDRIVE / GENERAL ACCESS
+; =============================================================================
+;  The following routines are used for harddisc/floppy access.
+;  The access is done via INT 13h/CHS or INT 13h/LBA.
+;  Access will be done prefered by INT 13h/CHS, because it's (I wonder!) much
+;   faster, than the LBA-method. I don't know, why LBA is so slow. Perhaps BIOS.
+;
+;  Internal access (to AiR-BOOT) is always done via INT 13h/CHS.
+
+DriveIO_GetHardDriveCount   Proc Near   Uses ds si
+        push    ds
+        push    si
+        push    0040h
+        pop     ds
+        mov     si, 0075h
+        mov     dh, ds:[si]                ; 40:75 -> POST: Total Harddiscs == DL
+        pop     si
+        pop     ds
+        mov     [TotalHarddiscs], dh
+        ret
+DriveIO_GetHardDriveCount   EndP
+
+
+; Fills our LBA-Usage table. It holds the LBA-address, where BIOS/CHS access is
+;  stopped and BIOS/LBA access is started.
+;  This is calculated by Sector*Heads. Comparing will get done with Bit 25-10
+;  on LBA sectors, so we actually divide sector number by 1024.
+DriveIO_InitLBASwitchTable  Proc Near   Uses es di
+        mov     di, offset LBASwitchTable
+        mov     dh, [TotalHarddiscs]
+        mov     dl, 80h
+    DIOILUT_DriveLoop:
+        push    dx
+        push    di
+        mov     ah, 08h
+        int     13h            ; DISK - GET DRIVE PARAMETERS
+        mov     ah, 0FBh       ; Assume 255 heads/63 sectors, if error
+        jc      DIOILUT_Error
+        and     cl, 111111b    ; Isolate lower 6 bits of CL -> sector count
+
+        ;movzx   ax, cl
+        mov   al,cl
+        mov   ah,0
+
+        mov     bl, dh         ; DH -> max head number
+        mul     bl             ; AX = Sectors*Heads
+        shl     ah, 1
+        shl     ah, 1          ; Shift 2 bits, so we are able to compare to
+                ;  bit 16-23 of the LBA address
+    DIOILUT_Error:
+        pop     di
+        pop     dx
+        mov     bptr ds:[di], ah  ; Save that value
+        inc     di                ; Go to next BYTE
+        inc     dl
+        dec     dh
+        jnz     DIOILUT_DriveLoop
+        ret
+DriveIO_InitLBASwitchTable  EndP
+
+
+
+
+;FIXME: Only LBA gets updated, need to update CHS too !!!!!!!
+
+; Adjusts BX:AX / CX:DX to meet LVM sector location
+; BX:AX / CX:DX point to MBR or EBR !
+;  Destroys SI
+; Rousseau: Enhanced to handle sector-numbers 127 and 255 besides 63 for LVM-info sectors.
+;           Ugly, need to cleanup.
+DriveIO_LVMAdjustToInfoSector   Proc Near
+        push    cx                      ; Save Cyl/Sec part
+        xor     ch,ch                   ; Clear low Cyl part
+        and     cl,63                   ; Clear high Cyl part
+        push    bx                      ; We need BX...
+        push    dx                      ; and DX temoraily
+        mov     bx,offset [TrueSecs]    ; Offset of sector table
+        xor     dh,dh                   ; Clear DH because we use DL as index
+        and     dl,01111111b            ; Remove high bit of BIOS disk-nr
+        shl     dx,2                    ; Index to DWORD table
+        add     bx,dx                   ; Point to TrueSecs for this disk
+        mov     si,[bx]                 ; Get SPT for this disk
+        pop     dx                      ; Restore DX...
+        pop     bx                      ; and BX
+        ;~ sub     si,cx                   ; Adjust offset                      !! INCORRECT FOR LBA (TP CX != 0 !!)
+        dec     si
+        pop     cx                      ; Restore Cyl/Sec part
+        add     ax,si                   ; Add offset to low part...
+        adc     bx,0                    ; and high part of LBA address
+        or      cl,63                   ; Adjust CHS part   !FIX ME for > 63!   !! FIX HUGE DRIVE !!
+        ret
+
+
+;;jmp bliep
+;;        pusha
+
+;;            push     dx
+;;            push     bx
+;;                xor      dh,dh
+;;                and      dl,01111111b
+;;                shl      dx,1
+;;                shl      dx,1
+;;                mov      bx, offset [TrueSecs]
+;;                add      bx,dx
+;;                mov      ax,word ptr [bx]
+;;            pop      bx
+;;            pop      dx
+
+
+            ;
+            ; AX now contains LVM secs
+            ;
+
+
+;;            pusha
+;;                push    dx
+;;                ; Location of extended position
+;;                mov     dx,word ptr [ExtendedAbsPos+02]
+;;                mov     ax,word ptr [ExtendedAbsPos+00]
+;;                ;call    AuxIO_TeletypeHexDWord
+;;                ;call    AuxIO_TeletypeNL
+;;                pop     dx
+
+;;                xor     dh,dh
+;;                and     dl,01111111b
+;;                shl     dx,1
+;;                shl     dx,1
+;;                mov     bx, offset [TrueSecs]
+;;                add     bx,dx
+;;                mov     ax, word ptr[bx]
+
+                ;call    AuxIO_TeletypeHexWord
+                ;call    AuxIO_TeletypeNL
+;;                mov     al,[ExtendedAbsPosSet]           ; if true -> 1st sector of extpart (EBR), not logpart(BPB)
+                ;call    AuxIO_TeletypeHexByte
+                ;call    AuxIO_TeletypeNL
+                ;mov     si,offset PartitionSector
+                ;call    AuxIO_DumpSector
+;;            popa
+
+            ; LBA
+            ;mov     si,offset before_lvm_adjust
+            ;call    AuxIO_Print
+
+            ;xchg    dx,bx
+            ;call    AuxIO_TeletypeHexDWord
+            ;call    AuxIO_TeletypeNL
+            ;xchg    bx,dx
+;;        popa
+
+
+;;bliep:
+
+      ;or       bx,ax
+;;      test     byte ptr [ExtendedAbsPosSet],1
+;;      jz       pri
+
+
+;;        push     dx
+;;        push     bx
+
+;;            xor      dh,dh
+;;            and      dl,01111111b           ; Strip high bit from disk
+;;            shl      dx,1                   ; Convert to index
+;;            shl      dx,1                   ; into TrueSecs table
+;;            mov      bx,offset [TrueSecs]   ; Base of table
+;;            add      bx,dx                  ; Point to entry for disk
+;;            mov      dx,[bx]                ; Get TrueSecs (LVM)
+;;            dec      dx
+;;            add      ax,dx
+
+;;        pop      bx
+;;        pop      dx
+;;        adc      bx,0
+
+
+;;        jmp      done
+
+
+
+;;    pri:
+
+
+;;        push    ax
+;;        push    cx
+;;            xor     ch, ch                           ; Zero out upper-byte
+
+;;            push    dx
+;;                xor     dh,dh
+;;                and     dl,01111111b
+;;                shl     dx,1
+;;                shl     dx,1
+
+;;                push    bx
+;;                    mov     bx,offset [TrueSecs]
+;;                    add     bx,dx
+;;                    mov     ax,[bx]
+                    ;mov     [ts2],ax
+;;                pop     bx
+;;            pop     dx
+
+
+
+            ;~ mov     al, 63
+            ;~ call    VideoIO_PrintByteDynamicNumber
+            ;~ self:   jmp self
+
+
+
+            ; DEZE WERKT SOMS NIET GOED
+            ; ROMMELT MET CYLINDERS
+            ; ALLEEN TOEPASSEN ALS INT13X NIET ACTIEF !
+
+;;            and     cl, al                           ; Isolate lower bits, because upper
+;;            mov     ah, 0
+;;            mov     si, ax                           ;  ones may be used for cylinder
+;;            sub     si, cx
+
+;;        pop     cx
+;;        pop     ax
+
+;;        or      cl, al                           ; Set sector to last sector
+;;        add     ax, si                           ; Adjust lower LBA
+;;        adc     bx, 0                            ; Adjust LBA Sector (BX:AX)
+
+
+
+        ;~ push    ax
+        ;~ call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+        ;~ mov     ax,[ts]
+        ;~ call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+        ;~ mov     ax,[ts2]
+        ;~ call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+        ;~ pop     ax
+
+        ;~ and      ax,[ts]
+
+;;      jmp done
+
+
+
+;;    done:
+
+        ;pusha
+            ;mov     si,offset after_lvm_adjust
+            ;~ call    AuxIO_Print
+            ; LBA
+            ;xchg    dx,bx
+            ;~ call    AuxIO_TeletypeHexDWord
+            ;~ call    AuxIO_TeletypeNL
+            ;xchg    bx,dx
+        ;popa
+
+        ;~ pusha
+        ;~ call    AuxIO_TeletypeNL
+;~
+        ;~ ; CYL
+        ;~ mov     al,ch
+        ;~ call    AuxIO_TeletypeHexByte
+        ;~ call    AuxIO_TeletypeNL
+;~
+        ;~ ; HEAD
+        ;~ mov     al,dh
+        ;~ call    AuxIO_TeletypeHexByte
+        ;~ call    AuxIO_TeletypeNL
+;~
+        ;~ ; SEC
+        ;~ mov     al,cl
+        ;~ call    AuxIO_TeletypeHexByte
+        ;~ call    AuxIO_TeletypeNL
+;~
+        ;~ ; DRIVE
+        ;~ mov     al,dl
+        ;~ call    AuxIO_TeletypeHexByte
+        ;~ call    AuxIO_TeletypeNL
+        ;~ popa
+
+;;      ret
+DriveIO_LVMAdjustToInfoSector   EndP
+
+
+
+
+
+
+; #########################################################################
+; Routine: Loads partition to ExecBase and checks for validity
+; #########################################################################
+; Calling : bx:ax - Absolute sector
+;           cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)
+; Returns : Carry Set if invalid partition encountered
+; Preserve: all registers
+; #########################################################################
+DriveIO_LoadPartition   Proc Near  Uses si
+        mov     wptr cs:[CurPartition_Location+0], ax
+        mov     wptr cs:[CurPartition_Location+2], bx
+        mov     wptr cs:[CurPartition_Location+4], dx
+        mov     wptr cs:[CurPartition_Location+6], cx ; Saves the location
+        mov     si, offset PartitionSector    ; DS:SI - ExecBase
+        call    DriveIO_LoadSector
+        clc
+        cmp     wptr [si+LocBR_Magic], 0AA55h
+        je      DIOLP_Success
+        ; We check, if we are scanning partitions. In that case, if CHS is not 0/0/1
+        ;  we will display a "bad partition table" message and halt the system.
+        cmp     cx, 0001h
+        jne     DIOLP_Failed
+        or      dh, dh
+        jnz     DIOLP_Failed
+        stc                                   ; Set carry, so no partition table
+    DIOLP_Success:
+
+    IFDEF   AUX_DEBUG
+        ; show current partition location
+        ;~ pushf
+        ;~ pusha
+        ;~ call     AuxIO_TeletypeNL
+        ;~ mov      si,offset db_curpartloc
+        ;~ call     AuxIO_Print
+        ;~ mov      dx,word ptr [CurPartition_Location+02]
+        ;~ mov      ax,word ptr [CurPartition_Location+00]
+        ;~ call     AuxIO_TeletypeHexDWord
+        ;~ call     AuxIO_TeletypeNL
+        ;~ mov      si,offset PartitionSector
+        ;~ call     AuxIO_DumpSector
+        ;~ call     AuxIO_TeletypeNL
+        ;~ popa
+        ;~ popf
+    ENDIF
+
+        ret
+    DIOLP_Failed:
+        jmp     DriveIO_GotLoadError
+DriveIO_LoadPartition   EndP
+
+; #########################################################################
+; Routine: Writes a partition from ExecBase to its original sector
+; #########################################################################
+; Calling : none
+; Returns : none
+; Preserve: all registers
+; #########################################################################
+DriveIO_SavePartition   Proc Near  Uses ax bx cx dx si
+        mov     ax, wptr cs:[CurPartition_Location+0]
+        mov     bx, wptr cs:[CurPartition_Location+2]
+        mov     dx, wptr cs:[CurPartition_Location+4]
+        mov     cx, wptr cs:[CurPartition_Location+6] ; Gets prev. saved location
+        mov     si, offset PartitionSector    ; DS:SI - ExecBase
+        cmp     wptr [si+LocBR_Magic], 0AA55h ; Checks for signature, if not found
+        jne     DIOSP_SevereError             ;  we assume a really bad error
+        call    DriveIO_SaveSector
+    DIOSP_SevereError:
+        ret
+DriveIO_SavePartition   EndP
+
+; Keeps DS:SI for caller
+DriveIO_LoadTmpSector   Proc Near
+        mov     si, offset TmpSector
+        call    DriveIO_LoadSector
+        ret
+DriveIO_LoadTmpSector   EndP
+
+; Keeps DS:SI for caller
+DriveIO_SaveTmpSector   Proc Near
+        mov     si, offset TmpSector
+        call    DriveIO_SaveSector
+        ret
+DriveIO_SaveTmpSector   EndP
+
+
+
+; Keeps DS:SI for caller, sets carry if valid LVM sector encountered
+DriveIO_LoadLVMSector   Proc Near  Uses ax bx cx dx
+        test    byte ptr [CFG_IgnoreLVM], 1            ; We are supposed to ignore LVM, so
+        jnz     DIOLLVMS_NoLVMSector          ;  don't load but declare as bad!
+        mov     ax, wptr cs:[CurPartition_Location+0]
+        mov     bx, wptr cs:[CurPartition_Location+2]
+        mov     dx, wptr cs:[CurPartition_Location+4]
+        mov     cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location
+
+        call    DriveIO_LVMAdjustToInfoSector
+
+        mov     si, offset LVMSector
+        call    DriveIO_LoadSector
+
+    IFDEF   AUX_DEBUG
+        ; show current partition location
+        ;~ pushf
+        ;~ pusha
+        ;~ call    AuxIO_TeletypeNL
+        ;~ mov     si,offset db_curlvmsec
+        ;~ call    AuxIO_Print
+        ;~ mov     dx,bx
+        ;~ call    AuxIO_TeletypeHexDWord
+        ;~ call    AuxIO_TeletypeNL
+        ;~ mov     si,offset LVMSector
+        ;~ call    AuxIO_DumpSector
+        ;~ call    AuxIO_TeletypeNL
+        ;~ popa
+        ;~ popf
+    ENDIF
+
+        call    LVM_CheckSectorSignature
+        jnc     DIOLLVMS_NoLVMSector
+        call    LVM_CheckSectorCRC
+        jnc     DIOLLVMS_NoLVMSector
+        ret
+        ; This here is called, if an invalid (or no) LVM information sector is found
+        ;  It will truncate the first byte of the sector, so all other routines
+        ;  will notice it easily by just comparing the first byte.
+    DIOLLVMS_NoLVMSector:
+        mov     bptr [si+LocLVM_SignatureStart], 0
+        ret
+DriveIO_LoadLVMSector   EndP
+
+
+
+; Keeps DS:SI for caller, saves at anytime w/o checks (!)
+DriveIO_SaveLVMSector   Proc Near  Uses ax bx cx dx
+        test    byte ptr [CFG_IgnoreLVM], 1            ; We are supposed to ignore LVM, so
+        jnz     DIOSLVMS_SevereError          ;  don't save at anytime (security!)
+        mov     ax, wptr cs:[CurPartition_Location+0]
+        mov     bx, wptr cs:[CurPartition_Location+2]
+        mov     dx, wptr cs:[CurPartition_Location+4]
+        mov     cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location
+        call    LVM_CheckSectorSignature
+        jnc     DIOSLVMS_SevereError                  ; LVM Signature must be there
+
+    IFDEF   AUX_DEBUG
+;~ dioatlvm    db 'DriveIO_LVMAdjustToInfoSector',10,0
+        ;~ pushf
+        ;~ pusha
+        ;~ mov     si,offset dioatlvm
+        ;~ call    AuxIO_Print
+        ;~ popa
+        ;~ popf
+        call    DEBUG_DumpRegisters
+        call    DEBUG_DumpCHS
+    ENDIF
+
+        call    DriveIO_LVMAdjustToInfoSector
+
+    IFDEF   AUX_DEBUG
+        call    DEBUG_DumpRegisters
+        call    DEBUG_DumpCHS
+    ENDIF
+
+        mov     si, offset LVMSector
+        call    DriveIO_SaveSector
+    DIOSLVMS_SevereError:
+        ret
+DriveIO_SaveLVMSector   EndP
+
+; Rousseau: Move this to BSS and merge with int13xbuf there.
+
+; Memory-Block that holds information for LBA-access via INT 13h
+DriveIO_DAP                 db      10h ; Size of paket
+                            db      0   ; Reserved
+DriveIO_DAP_NumBlocks       dw      0   ; Number of blocks
+DriveIO_DAP_Transfer        dd      0   ; Transfer Adress
+DriveIO_DAP_Absolute        dd      0   ; Absolute Sector
+                            dd      0   ; Second Part of QWORD
+
+; Special error message instead of "LOAD ERROR" during partition scanning,
+;  so users will notice that something is bad with their partition table(s)
+DriveIO_GotLoadError    Proc Near
+        test    byte ptr cs:[CurIO_Scanning], 1          ; Must be CS:, cause DS!=CS maybe here
+        jnz     InScanMode
+        jmp     MBR_LoadError
+    InScanMode:
+        mov     si, offset TXT_BrokenPartitionTable
+        push    cs
+        pop     ds
+        call    MBR_Teletype
+        mov     si, offset BrokenHDD
+        sub     dl, 50h                       ; 80h -> '0'
+        cmp     dl, 39h
+        jbe     DIOGLE_BelowA
+        add     dl, 7                         ; 3Ah -> 'A'
+    DIOGLE_BelowA:
+        mov     bptr [si+5], dl
+        call    MBR_Teletype
+
+        ; JWasm: cannot jump to local label in other procedure.
+        ; Changed to halt here.
+        ;jmp     MBRLE_Halt
+    DriveIO_GotLoadError_halt:
+        jmp     DriveIO_GotLoadError_halt
+DriveIO_GotLoadError    EndP
+
+; #########################################################################
+; Routine: Loads a specified sector to DS:DI
+; #########################################################################
+; Calling : bx:ax - Absolute sector
+;           cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)
+;           ds:si - Destination-Adress
+; Returns : none
+; Preserve: all registers
+; #########################################################################
+DriveIO_LoadSector      Proc Near  Uses ax bx cx dx ds si es di
+        ; Is the drive not a harddrive?
+        cmp     dl, 80h
+        jb      DIOLS_UseNormal
+
+        test    byte ptr cs:[CurIO_UseExtension], 1
+        jz      DIOLS_UseNormal
+        ; Are we forced do use LBA via Setting?
+        jnz     DIOLS_UseExtension
+
+        ; Upper 8 bits of LBA-address set?
+        ; Then use LBA (maximum boundary is 16320x16x63 = FB0400h)
+        or      bh, bh
+        jnz     DIOLS_UseExtension
+        ; Compare Switch-Table value to bit 16-23 of LBA-address
+        mov     di, dx
+        and     di, 007Fh
+        cmp     bptr cs:[LBASwitchTable+di], bl
+        jbe     DIOLS_UseExtension
+    DIOLS_UseNormal:
+        mov     di, 3
+    DIOLS_ErrorLoop:
+        push    ds
+        pop     es
+        mov     bx, si                     ; ES:BX - Destination
+        mov     ax, 0201h                  ; Function 2 - Load Sector
+        int     13h
+        jnc     DIOLS_Success
+        dec     di
+        jnz     DIOLS_ErrorLoop
+        ; Sector load failed...
+        jmp     DriveIO_GotLoadError
+
+    DIOLS_UseExtension:
+        push    cx
+        mov     cs:[DriveIO_DAP_NumBlocks], 1         ; Copy ONE sector
+        mov     wptr cs:[DriveIO_DAP_Transfer+0], si
+        mov     cx, ds
+        mov     wptr cs:[DriveIO_DAP_Transfer+2], cx ; Fill out Transfer Adress
+        mov     wptr cs:[DriveIO_DAP_Absolute+0], ax
+        mov     wptr cs:[DriveIO_DAP_Absolute+2], bx ; Fill out Absolute Sector
+        push    cs
+        pop     ds
+        mov     si, offset DriveIO_DAP
+        mov     ah, 42h                        ; Extended Read
+        int     13h
+        pop     cx
+        jnc     DIOLS_Success
+        ; Sector load failed...
+        jmp     DriveIO_GotLoadError
+
+    DIOLS_Success:
+        ret
+DriveIO_LoadSector      EndP
+
+
+
+;
+; ############################################################
+; # Load a specified sector from a disk using LBA addressing #
+; ############################################################
+;
+; In
+; --
+; DL     = Physical Disk
+; BX:CX  = LBA sector
+; DI:SI  = Target buffer
+;
+; Out
+; ---
+; AX     = Error code
+;
+DriveIO_LoadSectorLBA       Proc Near  Uses bx cx dx si di ds es
+        ; Get one sector
+        mov     cs:[DriveIO_DAP_NumBlocks], 1
+
+        ; Setup buffer address
+        mov     wptr cs:[DriveIO_DAP_Transfer+0], si
+        mov     wptr cs:[DriveIO_DAP_Transfer+2], di
+
+        ; Setup LBA address of requested sector
+        mov     wptr cs:[DriveIO_DAP_Absolute+0], cx
+        mov     wptr cs:[DriveIO_DAP_Absolute+2], bx
+        mov     wptr cs:[DriveIO_DAP_Absolute+4], 0
+        mov     wptr cs:[DriveIO_DAP_Absolute+6], 0
+
+        ; Address of packet
+        mov     si, offset DriveIO_DAP
+
+        ; Do the extended read
+        mov     ah, 42h
+        int     13h
+
+        ; Looking good so far
+        jnc     DriveIO_LoadSectorLBA_succes1
+
+        ; AH should not be zero, if it is then set to undefined and set carry
+        test    ah,ah
+        jnz     DriveIO_LoadSectorLBA_error1
+        mov     ah, 0bbh        ; Undefined error
+    DriveIO_LoadSectorLBA_error1:
+        stc
+        jmp     DriveIO_LoadSectorLBA_exit
+
+        ; AL should be zero, if not then set to undefined and set carry
+    DriveIO_LoadSectorLBA_succes1:
+        test    ah,ah
+        jz      DriveIO_LoadSectorLBA_exit
+        stc
+        jmp     DriveIO_LoadSectorLBA_exit
+
+        ; Return to caller
+    DriveIO_LoadSectorLBA_exit:
+        ret
+DriveIO_LoadSectorLBA       EndP
+
+
+
+;
+; ############################################################
+; # Check for a valid MBR-sector to be written to disk       #
+; ############################################################
+;
+; In
+; --
+; DL     = Physical Disk
+; BX:CX  = LBA sector
+; DI:SI  = Source buffer
+;
+; Out
+; ---
+; CY     = 1 if invalid MBR in source buffer, 0 if valid
+;
+; This routine is called when DriveIO_SaveSector attempts to write to the MBR.
+; It checks if the sector to be written has some sensible values in certain
+; places. In fact, if the sector is written to the boot-disk, the AiR-BOOT
+; signature should be present and the partition table should be the same
+; as the one at the start of the AiR-BOOT code in memory, except maybe for the
+; active flags.
+; For other disks, only the active flags are checked to be 00h or 80h and
+; the AA55h MBR signature.
+;
+DriveIO_ProtectMBR  Proc Near
+        pusha           ; Push all registers
+        push    es      ; Push ES because we need it for string instructions
+        push    cs      ; Make ES point...
+        pop     es      ; to CS
+
+        ; Save the pointer to the sector to write in BX
+        mov     bx,si
+
+        ;
+        ; If the sector to be written is not the boot-disk, then skip
+        ; checking the AiR-BOOT MBR.
+        ;
+        cmp     dl,80h
+        ja      DriveIO_ProtectMBR_is_not_bootdisk
+
+        ;
+        ; The boot-disk is accessed so the sector to be written must be
+        ; the AiR-BOOT MBR. This is the same as the first 512 bytes
+        ; relocated to 8000:0000 and this the start of the AB-code.
+        ;
+        mov     si,bx                       ; Get pointer to sector to write
+        xor     di,di                       ; Point DI to start of AB-code (MBR)
+        mov     cx, offset [MBR_PartTable]  ; Bytes upto P-table must be same
+        cld                                 ; Compare upwards
+        repe    cmpsb                       ; Compare upto P-table
+
+        ; If not the same this is not the an AiR-BOOT boot-disk MBR !
+        jne     DriveIO_ProtectMBR_not_valid_MBR            ; SEVERE ERROR !
+
+        ; Continue with signature check
+        jmp     DriveIO_ProtectMBR_check_signature
+
+
+    ;
+    ; The disk is not the boot-disk so we don't know what kind of MBR is on it.
+    ; Some sanity checks should be here.
+    ;
+    DriveIO_ProtectMBR_is_not_bootdisk:
+
+        ;
+        ; sanity checks...
+        ;
+
+        ; Continue with signature check
+        jmp     DriveIO_ProtectMBR_check_signature
+
+
+    DriveIO_ProtectMBR_check_signature:
+        ; See if the sector to write contains a valid signature
+        mov     si,bx                   ; Get pointer to sector to write
+        mov     di, offset [MBR_Sig]    ; Offset to MBR signature
+        add     si,di                   ; Make SI point to it in sec to write
+        lodsw                           ; Load it
+        cmp     ax,0aa55h               ; See if it is valid
+
+        ; If no signature this cannot be a valid MBR !
+        jne     DriveIO_ProtectMBR_not_valid_MBR            ; SEVERE ERROR !
+
+
+    ;
+    ; The sector to be written seems to be valid.
+    ; Set CY=0 to indicate a valid MBR.
+    ;
+    DriveIO_ProtectMBR_is_valid_MBR:
+        clc
+        jmp     DriveIO_ProtectMBR_end
+
+    ;
+    ; Something is terribly wrong; a non-MBR sector seems about to be written.
+    ; Set CY=1 and let the calling code handle this situation.
+    ;
+    DriveIO_ProtectMBR_not_valid_MBR:
+        stc
+        jmp     DriveIO_ProtectMBR_end
+
+    ;
+    ; Return to the caller with no registers modyfied except FLAGS.
+    ;
+    DriveIO_ProtectMBR_end:
+        pop     es
+        popa
+        ret
+DriveIO_ProtectMBR  Endp
+
+
+
+; #########################################################################
+; Routine: Checks if the MBR is addressed by either CHS or LBA
+; #########################################################################
+; Calling : bx:ax - Absolute sector
+;           cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)
+; Returns : ZF=1 if MBR is addressed, else ZF=0
+; Preserve: all registers
+; #########################################################################
+DriveIO_MBR_Addressed   Proc
+        push    ax
+        push    bx
+
+        or      bx,ax   ; Results in 0 in BX if MBR is addressed by LBA
+        jz      DriveIO_MBR_Addressed_done
+
+        mov     ax,cx   ; Results in 1 in AX if CYL 0, SEC 1 is addressed
+        add     al,dh   ; Results in 1 in AX if HEAD 0 is addressed
+        dec     ax      ; Results in 0 in AX if MBR is addressed by CHS
+
+    DriveIO_MBR_Addressed_done:
+        pop     bx
+        pop     ax
+        ret
+DriveIO_MBR_Addressed   EndP
+
+
+
+
+; #########################################################################
+; Routine: Writes DS:SI to a specified sector
+; #########################################################################
+; Calling : bx:ax - Absolute sector
+;           cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)
+;           ds:si - Source-Adress
+; Returns : none
+; Preserve: all registers
+; #########################################################################
+DriveIO_SaveSector              Proc Near  Uses ax bx cx dx ds si es di
+
+
+    ;!
+    ;! DEBUG_BLOCK
+    ;! Force write to LBA0 to test interception routine.
+    ;! Do *NOT* enable unless you are debugging, will overwrite MBR !
+    ;!
+    ;~ __DIO_FORCE_LBA0_WRITE__    EQU
+    IFDEF   AUX_DEBUG
+        IFDEF   __DIO_FORCE_LBA0_WRITE__
+        xor ax,ax
+        xor bx,bx
+        xor cx,cx
+        inc cx
+        xor dh,dh
+        ENDIF
+    ENDIF
+
+
+    ;!
+    ;! DEBUG_BLOCK
+    ;! Check what is being written to disk.
+    ;! Uncomment below to activate.
+    ;!
+    __DIO_SS_DMP__  EQU
+    IFDEF   AUX_DEBUG
+        IFDEF   __DIO_SS_DMP__
+        pusha
+        push    si
+        mov     si,offset dioss
+        call    AuxIO_Print
+        pop     si
+        call    DEBUG_DumpRegisters
+        call    AuxIO_DumpSector
+        call    AuxIO_TeletypeNL
+        popa
+        ENDIF
+    ENDIF
+
+        ;
+        ; Check if the MBR is the destination for the write.
+        ; ZF=1 if so.
+        ;
+        call    DriveIO_MBR_Addressed
+        jnz     DriveIO_SaveSector_continue_write
+
+
+        ; MBR is addressed, check the sector that is requested to be written.
+        ; For the bootdisk it should contain the AiR-BOOT signature, valid
+        ; partition-table entries and the AA55h signature.
+        ; If not, something is terribly wrong in some piece of the AB code.
+        ; For any other disk (80h+) at least a valid partition table should
+        ; be present together with the AA55h signature.
+        call    DriveIO_ProtectMBR
+        jnc     DriveIO_SaveSector_continue_write
+
+
+        ;
+        ; WE HAVE A SEVERE ERROR CONDITION !
+        ; SOME AB CODE TRIES TO WRITE A NON-MBR TO THE DISK !
+        ; ASK THE USER TO REPORT THIS !
+        ; HALT THE SYSTEM !
+        ;
+
+        ; Show error-box
+        mov     cx, 0C04h
+        mov     si, offset NonMBRwrite
+        call    SETUP_ShowErrorBox
+        mov     cx, 0C04h
+        mov     si, offset NonMBRwrite_rep
+        call    SETUP_ShowErrorBox
+
+
+    IFDEF   AUX_DEBUG
+        pusha
+        mov     si, offset NonMBRwrite
+        call    AuxIO_TeletypeNL
+        call    AuxIO_Print
+        call    AuxIO_TeletypeNL
+        popa
+    ENDIF
+
+        ; Show popup and halt the system.
+        jmp    HaltSystem
+
+
+
+    ;
+    ; Continue the write if not MBR sector or MBR to write is validated.
+    ;
+    DriveIO_SaveSector_continue_write:
+        test    byte ptr cs:[CurIO_UseExtension], 1
+        jz      DIOSS_UseNormal
+        ; Are we forced do use LBA via Setting?
+        ; Always use INT13X on v1.0.8+.
+        ;~ test    byte ptr cs:[CFG_ForceLBAUsage], 1
+        ;~ jnz     DIOSS_UseExtension
+        jmp     DIOSS_UseExtension
+        ; Is the drive not a harddrive?
+        cmp     dl, 80h
+        jb      DIOSS_UseNormal
+        ; Upper 8 bits of LBA-address set? -> Use LBA (maximum boundary is FB0400h)
+        or      bh, bh
+        jnz     DIOSS_UseExtension
+        ; Compare Switch-Table value to bit 16-23 of LBA-address
+        mov     di, dx
+        and     di, 007Fh
+        cmp     bptr cs:[LBASwitchTable+di], bl
+        jbe     DIOSS_UseExtension
+    DIOSS_UseNormal:
+        mov     di, 3
+    DIOSS_ErrorLoop:
+        push    ds
+        pop     es
+        mov     bx, si                     ; ES:BX - Destination
+        mov     ax, 0301h                  ; Function 3 - Write Sector
+        int     13h
+        jnc     DIOSS_Success
+        dec     di
+        jnz     DIOSS_ErrorLoop
+        call    MBR_SaveError
+
+    DIOSS_UseExtension:
+        push    cx
+        mov     cs:[DriveIO_DAP_NumBlocks], 1        ; Copy ONE sector
+        mov     wptr cs:[DriveIO_DAP_Transfer+0], si
+        mov     cx, ds
+        mov     wptr cs:[DriveIO_DAP_Transfer+2], cx ; Fill out Transfer Adress
+        mov     wptr cs:[DriveIO_DAP_Absolute+0], ax
+        mov     wptr cs:[DriveIO_DAP_Absolute+2], bx ; Fill out Absolute Sector
+        push    cs
+        pop     ds
+        mov     si, offset DriveIO_DAP
+        mov     ax, 4300h                  ; Extended Write (No Verify)
+        int     13h
+        pop     cx
+        jnc     DIOSS_Success
+        call    MBR_SaveError
+
+    DIOSS_Success:
+        ret
+DriveIO_SaveSector              EndP
+
+
+; See if a LVM-sector is valid.
+; In  : si, pointer to sector
+; Out : CY if valid LVM sector, NC if not
+DriveIO_LVMSectorValid           Proc  Near
+        pusha
+
+        call    LVM_CheckSectorSignature
+        ; NC if no signature found
+        jnc     DriveIO_LVMSectorValid_End
+
+        call    LVM_CheckSectorCRC
+        ; Force valid !!!
+        stc
+
+    DriveIO_LVMSectorValid_End:
+        popa
+        ret
+DriveIO_LVMSectorValid           EndP
+
+; ------------------------------------------------------
+; Rousseau: # Load the master LVM-sector if one exists #
+; ------------------------------------------------------
+; Load the master LVM-sector to get the number of sectors per track as
+; eCS views the drive. If no master LVM-sector is found it is assumed eCS
+; is not installed. The master LVM-sector can be located at three different
+; places depending on drive size and partitioning scheme and driver used.
+; When DANIS506.ADD is used, the eCS extended geometry will be 255/127 for
+; drives >502GiB but <1TiB. Then the location will be sector 127 which
+; is LBA 126 (7Eh).
+; IBM1S506.ADD will always use 255/255 for the extended eCS geometry.
+; DANIS506.ADD will use 255/255 for drives >1TiB.
+; Then the location of the master LVM-sector will be 255 which is LBA 254 (FEh).
+; When eCS is installed on a huge drive that alread had a system on it, eCS
+; will be confined to the lower 502GiB of the drive.
+; In this case the normal geometry from Int13X will be used.
+; This is also the case when no valid master LVM-sector can be found.
+;
+; Return CF when valid master LVM sector found, NC if not.
+; Loads sector at [LVMSector] !
+DriveIO_LoadMasterLVMSector     Proc  Near
+        pusha
+
+        ;~ mov      si,offset db_lmlvm
+        ;~ call     AuxIO_Print
+
+        ;~ ; Physical disk
+        ;~ mov     al,'<'
+        ;~ call    VideoIO_PrintSingleChar
+        ;~ mov     al,dl
+        ;~ call    VideoIO_PrintHexByte
+        ;~ mov     al,'>'
+        ;~ call    VideoIO_PrintSingleChar
+;~
+        ;~ call    AuxIO_TeletypeHexByte
+        ;~ call    AuxIO_TeletypeNL
+
+
+        ; Loop over the sector-translation table,
+        ; process the first three values from high (255) to low.
+        ; (bios spt, most likely 63)
+        mov     cx,3
+    DriveIO_LoadMasterLVMSector_NextTry:
+        ; Number of sectors to read
+        mov     [DriveIO_DAP_NumBlocks],1
+
+        ; Setup destination address
+        mov     si, offset [LVMSector]
+        mov     word ptr [DriveIO_DAP_Transfer+0],si
+        mov     ax, ds
+        mov     word ptr [DriveIO_DAP_Transfer+2],ax
+
+        ; Get the sector-number of the next possible LVM sector (255,127,63)
+        ; using the translation table and the counter as the index
+        mov     bx,offset secs_per_track_table
+        mov     ax,cx
+        dec     ax
+        xlatb
+        dec     al
+
+        ;
+        ; AX now contains the LBA address of the sector
+        ; that could be an LVM sector.
+        ; This is all in track0 so the address will not exceed 64kiB sectors.
+        ;
+
+        ;~ push    ax
+        ;~ push    ax
+        ;~ mov     al,'$'
+        ;~ call    VideoIO_PrintSingleChar
+        ;~ pop     ax
+        ;~ call    VideoIO_PrintHexByte
+        ;~ mov     al,'$'
+        ;~ call    VideoIO_PrintSingleChar
+        ;~ pop     ax
+
+    IFDEF   AUX_DEBUG
+        ; Dump the value
+        ;~ call     AuxIO_TeletypeHexByte
+        ;~ call     AuxIO_TeletypeNL
+    ENDIF
+
+        ; Setup the requested LBA sector number
+        mov     word ptr [DriveIO_DAP_Absolute+0],ax    ; LBA low                   NORMAL I/O GEBRUIKEN !
+        mov     word ptr [DriveIO_DAP_Absolute+2],00h   ; LBA high
+        mov     si, offset DriveIO_DAP                  ; address request packet
+        mov     ah, 42h
+        int     13h                                     ; do the i/o
+        cmc     ; Complement carry so we can exit imm. on error
+        jnc     DriveIO_LoadMasterLVMSector_End  ; oops, return with NC
+
+
+        mov     si,offset [LVMSector]
+
+        ; See if this is a valid LVM-sector
+        ; CY=1 if valid
+        call    DriveIO_LVMSectorValid
+
+;        pushf
+;        mov     ah,0
+;        rcl     ah,1
+;        mov     al,'|'
+;        call    VideoIO_PrintSingleChar
+;        mov     al,ah
+;        call    VideoIO_PrintHexByte
+;        mov     al,'|'
+;        call    VideoIO_PrintSingleChar
+;        popf
+
+
+        ; Yep, we found the master LVM-sector
+        jc      DriveIO_LoadMasterLVMSector_Found
+        ; Try next location
+        loop    DriveIO_LoadMasterLVMSector_NextTry
+
+        ; No master LVM-sector found, set CF=false
+        clc
+
+    DriveIO_LoadMasterLVMSector_Found:
+        ; Store the address for later use.
+        mov     ax, word ptr [DriveIO_DAP_Absolute]
+        mov     word ptr [MasterLVMLBA], ax
+
+    DriveIO_LoadMasterLVMSector_End:
+        popa
+        ret
+DriveIO_LoadMasterLVMSector     Endp
+
+
+
+
+; ---------------------------------------------------
+; Rousseau ## Large drives, (eCS) geometry and LBA ##
+; ---------------------------------------------------
+; A sector size of 512 bytes is assumed in the below calculations.
+; Note that this scheme changes when the sector size will be 4096 or larger,
+; like with modern drives that do not translate to 512 bytes per sector anymore.
+; These drives will have a capacity above the 2TiB LBA32 boundary.
+; For now, we assume drives <=2TiB with a sector size of 512 bytes.
+
+; There are a few boundaries that are of importance.
+; Note that these are disk-boundaries and not partition boundaries.
+; Even with a small partition, like <502GiB, OS/2 will use extended geometry on
+; an empty huge disk.
+; These boundaries are (from high to low):
+
+; (code 5)
+; 2^32 = 4294967296 = 100000000 sectors = 2048 GiB
+;   This is the LBA32 2TiB boundary.
+;   Everything above it must be addressed using LBA48.
+;   OS/2 can currently not address this space above.
+
+; (code4)
+; 65536*255*255 = 4261478400 = FE010000 sectors ~ 2032 GiB
+;   This is the max OS/2 boundary using 255/255 extended geometry.
+;   OS/2 can currently not address this space above.
+
+; (code 3)
+; 2^31 = 2147483648 = 80000000 sectors = 1024 GiB
+;   This is the LBA32 1TiB boundary.
+;   OS/2 can address this space and will use 255/255 extended geometry.
+
+; (code 2)
+; 65536*255*127 = 2122383360 = 7E810000 sectors ~ 1012 GiB
+;   This is the DANI 1TiB boundary.
+;   OS/2 can address this space and will use 255/255 extended geometry.
+;   Below this DANI will use 255/127 extended geometry.
+;   This matters on where the LVM-sectors are located !
+
+; (code 1)
+; 65536*255*63  = 1052835840 = 3EC10000 sectors ~ 502 GiB
+;   This is the current OS/2 limit using this geometry because OS/2 can
+;   currently not address more than 65536 cylinders.
+;   DANI will address space above with 255/127 extended geometry up until
+;   the DANI 1TiB boundary (code 2)
+
+; (code 0)
+; Everything below 65536*255*63 will be addressed using standard geometry.
+
+
+;
+; This function will return the following values:
+;
+
+; 5 = This drive is above the 2^32 LBA32 (2TB) boundary and has more
+;     than 4294967296 sectors.
+;     LBA48 addressing is needed to access the complete capacity of the drive.
+;     OS/2 is currently unable to do so.
+
+; 4 = This drive is above the 65536*255*255 (4261478400) boundary but below 2^32.
+;     This is an OS/2 boundary and OS/2 is not able to access the drive above
+;     this boundary.
+
+; 3 = This drive is above the 2^31 (1TB) boundary and has more than
+;     2147483648 sectors.
+;     OS/2 is able to access the drive using it's extended geometry.
+;     Both DANIS506 and IBM1S506 will use the 255/255 scheme.
+
+; 2 = This drive is above the 65536*255*127 (2122383360) boundary but below 2^31.
+;     OS/2 is able to access the drive using it's extended geometry.
+;     Both DANIS506 and IBM1S506 will use the 255/255 scheme.
+
+; 1 = This drive is above the 65536*255*63 (1052835840) boundary but
+;     below 65536*255*127.
+;     OS/2 is able to access the drive using it's extended geometry.
+;     Note that DANIS506 will use 255/127 and IBM1S506 will use 255/255 geometry !
+;     Using DANI or IBM influences the location of the LVM info-sectors !
+
+; 0 = This drive is below the 65536*255*63 (1052835840) boundary.
+;     OS/2 is able to access this drive using the standard 255/63 geometry.
+
+; So, any return value >0 means OS/2 extended geometry will be used.
+; Value 1 will use 255/127 with DANIS506 but 255/255 with IBM1S506.
+; Values 2 and 3 will use 255/255 on both drivers.
+; You can or with 0x01 and check for 3 in this case.
+; Any value above 3 will be a drive who's capacity cannot be fully used by OS/2
+; The upper limit of 65536*255*255 will be in effect here.
+
+; Note this function currently handles the boot-drive only !
+; It should be extended and use dl for the drive-number as a parameter.
+; Because we use this function to get this info in a number of places,
+; all regs and flags except AX are saved and restored.
+
+; DL contains BIOS disk-number; 80h for first, 81h for second, etc.
+DriveIO_GatherDiskInfo  Proc Near
+        pushf
+        push    bx
+        push    cx
+        push    dx
+        push    si
+        push    di
+        push    es
+
+        ; Set ES to CS for buffer clearing
+        push    cs
+        pop     es
+
+        ; Clear the buffer
+        ; Also setup the buffer size.
+        ; Old Phoenix BIOSses require word (flags) at 02 to be zero,
+        ; so we clear the whole buffer to be sure.
+        mov     cx, i13xbuf_size        ; Dynamically calculated by assembler.
+        mov     di, offset i13xbuf      ; Points to size field.
+        mov     [di],cx                 ; Setup buffer-size.
+        inc     di
+        inc     di                      ; Now pointing at actual buffer.
+        xor     ah,ah                   ; Fill value.
+        cld                             ; Direction up.
+        rep stosb                       ; Clear buffer.
+
+        ; Get the drive parameters
+        mov     ah, 48h                 ; Get Drive Parameters (extended version)
+        ;mov     dl, 80h                ; Drive number
+        mov     si, offset i13xbuf      ; Buffer for result-info
+        push    dx
+        int     13h                     ; Call the BIOS-function
+        pop     dx
+
+        ; Do some error-checking
+        or      ah,ah                       ; AH is zero if no error (ZF=1 if no error)
+        mov     ax,0                        ; Setup code for non-huge drive (does not influence ZF)
+        jz      DriveIO_GatherDiskInfo_ok   ; Return if error (AL<>0 thus ZF=0) but CY not set, assuming non-huge drive
+        jnc     DriveIO_GatherDiskInfo_ok   ; Return if error (CY=1), assuming non-huge drive
+        jmp     DriveIO_GatherDiskInfo_ret
+
+
+    DriveIO_GatherDiskInfo_ok:
+
+        ;
+        ; Store the drive geometry
+        ;
+
+        mov      si, offset i13xbuf
+
+        xor      dh,dh
+        and      dl,01111111b
+        shl      dx,1
+        shl      dx,1
+
+        ; Store number of cylinders on disk
+        mov      bx, offset BIOS_Cyls
+        add      bx,dx
+        mov      ax,[si+04h]
+
+        mov      word ptr [bx+00],ax
+        mov      ax,[si+06]
+        mov      word ptr [bx+02],ax
+
+        ; Store number of heads per cylinder
+        mov      bx, offset BIOS_Heads
+        add      bx,dx
+        mov      ax,[si+08h]
+        mov      word ptr [bx+00],ax
+        mov      ax,[si+0ah]
+        mov      word ptr [bx+02],ax
+
+        ; Store number of sectors per track
+        mov      bx, offset BIOS_Secs
+        add      bx,dx
+        mov      ax,[si+0ch]
+        mov      word ptr [bx+00],ax
+
+        ; Update first byte of translation-table to conform to BIOS SPT
+        mov      byte ptr [secs_per_track_table], al
+
+        mov      ax,[si+0eh]
+        mov      word ptr [bx+02],ax
+
+        ; Store total secs
+        mov      bx, offset BIOS_TotalSecs
+        add      bx,dx
+        add      bx,dx
+        mov      ax,[si+10h]
+
+        mov      word ptr [bx+00],ax
+        mov      ax,[si+12h]
+        mov      word ptr [bx+02],ax
+        mov      ax,[si+14h]
+        mov      word ptr [bx+04],ax
+        mov      ax,[si+18h]
+        mov      word ptr [bx+06],ax
+
+        ; Store number of bytes per sector
+        mov      bx, offset BIOS_Bytes
+        add      bx,dx
+        mov      ax,[si+18h]
+        mov      [bx],ax
+
+
+        ;
+        ; See of it's a huge drive of not
+        ;
+
+        ; Drive is larger than 2TiB
+        mov     ax,5                        ; Drive code (5)
+        mov     bx, [si+14h]                ; Low word of high dword of sector-count
+        or      bx, [si+16h]                ; High word of high dword of sector-count
+        jnz     DriveIO_GatherDiskInfo_ret  ; If non-zero we have a drive with >2^32 sectors and thus LBA48 addressing
+
+        ; Drive is larger than max OS/2 capacity
+        dec     ax                          ; Drive code (4)
+        mov     bx, [si+12h]                ; High word of low dword of sector-count
+        cmp     bx, 0fe01h                  ; Boundary
+        jae     DriveIO_GatherDiskInfo_ret  ; If above or equal to boundary,
+                                            ; we have a drive larger than to 65536*255*255 = FE010000 sectors
+
+        ; Drive can be completely utilized by OS/2
+        dec     ax                          ; Drive code (3)
+        cmp     bx, 8000h                   ; Boundary
+        jae     DriveIO_GatherDiskInfo_ret  ; If above or equal to boundary,
+                                            ; we have a drive larger than 2^31 sectors but smaller than 65536*255*255
+
+        ; This is the small area between DANI 1TiB and LBA 1TiB
+        dec     ax                          ; Drive code (2)
+        cmp     bx, 7e81h                   ; Boundary
+        jae     DriveIO_GatherDiskInfo_ret  ; If above or equal to boundary,
+                                            ; we have a drive larger than 65536*255*127 but <65536*255*255
+                                            ; DANIS506.ADD will use 255/255 extended geometry
+
+        ; DANI will use 255/127 in this area, this could impact the location of LVM-sectors ! (last sec on track)
+        dec     ax                          ; Drive code (1)
+        cmp     bx, 3ec1h                   ; Boundary
+        jae     DriveIO_GatherDiskInfo_ret  ; If above or equal to boundary,
+                                            ; we have a drive larger than 65536*255*63 sectors (OS/2 502GiB Limit!)
+                                            ; DANIS506.ADD will use 255/127 extended geometry !
+                                            ; IBM1S506.ADD will use 255/255 extended geometry !
+
+        ; We have a drive that can be addressed using standard 255/63 geometry
+        dec     ax                                      ; Drive code (0)
+                                            ; We have a drive smaller than 65536*255*63 = 3EC10000 sectors
+
+    DriveIO_GatherDiskInfo_ret:
+        pop     es
+        pop     di
+        pop     si
+        pop     dx
+        pop     cx
+        pop     bx
+
+        mov      byte ptr [CurIO_UseExtension],1
+
+        popf
+        ret
+DriveIO_GatherDiskInfo  EndP
+
+
+
+; Values for sectors per track table corresponding to DriveIO_IsHugeDrive return value.
+secs_per_track_table    db    63,127,255,255,255,255
+
+;db_lmlvm:   db 'Load Master LVM -- disk: ',0
Index: trunk/bootcode/regular/math.asm
===================================================================
--- trunk/bootcode/regular/math.asm	(revision 57)
+++ trunk/bootcode/regular/math.asm	(revision 57)
@@ -0,0 +1,97 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                           AiR-BOOT / MATH
+;---------------------------------------------------------------------------
+
+
+; ----------------------
+; Rousseau: # MATH.ASM #
+; ----------------------
+; This module contains 32-bit multiply.
+; Other math-stuff should be placed here.
+
+
+IFDEF   MODULE_NAMES
+DB 'MATH',0
+ENDIF
+
+; Multiply two 32-bit operands
+; In:          DX:AX - operand 1
+;              BX:CX - operand 2
+; Out:         BX:CX:DX:AX 64-bit result
+MATH_Mul32     Proc  Near
+      local    p3:word
+      local    p2:word
+      local    p1:word
+      local    p0:word
+      local    fb1:word
+      local    fb0:word
+      local    fa1:word
+      local    fa0:word
+
+      ; Save parameters
+      mov      [fb1],bx
+      mov      [fb0],cx
+      mov      [fa1],dx
+      mov      [fa0],ax
+
+      ; Clear return value
+      xor      ax,ax
+      mov      [p3],ax
+      mov      [p2],ax
+      mov      [p1],ax
+      mov      [p0],ax
+
+      ; Multiply high words
+      mov      ax,[fa1]
+      mul      [fb1]
+      mov      [p2],ax
+      mov      [p3],dx
+
+      ; Multiply high with low
+      mov      ax,[fa1]
+      mul      [fb0]
+      add      [p1],ax
+      adc      [p2],dx
+      adc      [p3],0
+
+
+      ; Multiply low with high
+      mov      ax,[fa0]
+      mul      [fb1]
+      add      [p1],ax
+      adc      [p2],dx
+      adc      [p3],0
+
+      ; Multiply low words
+      mov      ax,[fa0]
+      mul      [fb0]
+      mov      [p0],ax
+      add      [p1],dx
+      adc      [p2],0
+      adc      [p3],0
+
+      ; Return value BX:CX:DX:AX is QWORD result
+      mov      bx,[p3]
+      mov      cx,[p2]
+      mov      dx,[p1]
+      mov      ax,[p0]
+
+      ret
+MATH_Mul32     Endp
Index: trunk/bootcode/regular/other.asm
===================================================================
--- trunk/bootcode/regular/other.asm	(revision 57)
+++ trunk/bootcode/regular/other.asm	(revision 57)
@@ -0,0 +1,565 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                 AiR-BOOT / OTHER ROUTINES
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'OTHER',0
+ENDIF
+
+;        In: DS:SI - Pointer to begin of string
+;            CX - Len of string
+;       Out: CX - Supposed real len of string
+;            Zero Flag set if nul string
+; Destroyed: None
+GetLenOfName        Proc Near   Uses ax si
+        add     si, cx
+        dec     si
+    GLON_NameLoop:
+        mov     al, ds:[si]
+        dec     si
+        cmp     al, 32
+        ja      GLON_EndLoop
+        dec     cx
+        jnz     GLON_NameLoop
+    GLON_EndLoop:
+        or      cx, cx
+        ret                                   ; return supposed len
+GetLenOfName        EndP
+
+;        In: DS:SI - Pointer to NUL-terminated string
+;       Out: CX - Length of string
+;            Zero Flag set if nul string
+; Destroyed: None
+GetLenOfString      Proc Near   Uses ax si
+        xor     cx, cx
+    GLOS_StringLoop:
+        lodsb
+        or      al, al
+        jz      GLOS_EndOfString
+        inc     cx
+        jmp     GLOS_StringLoop
+
+    GLOS_EndOfString:
+        or      cx, cx
+        ret
+GetLenOfString      EndP
+
+;        In: DS:SI - Pointer to NUL-terminated strings
+;            CL    - Counter, how many strings to count
+;       Out: CX - Length of strings
+; Destroyed: None
+GetLenOfStrings     Proc Near   Uses bx dx si
+        mov     dh, cl
+        xor     dl, dl
+    GLOSS_StringsLoop:
+        call    GetLenOfString
+        add     dl, cl
+        add     si, cx
+        inc     si
+        dec     dh
+        jnz     GLOSS_StringsLoop
+        ;movzx   cx, dl
+        mov   cl,dl
+        mov   ch,0
+        ret
+GetLenOfStrings     EndP
+
+
+
+
+;
+; DO PREPARING STUFF.
+;
+PRECRAP_Main    Proc Near
+        ; First initialize Variable-Area (everything with NUL)
+        ; We use the start instead of the variables because they could be 'orged'
+        ; to an offset. We want everything after the code to be nullified.
+        mov     di, offset sobss
+        mov     cx, offset EndOfVariables - offset sobss
+        xor     ax, ax
+        shr     cx, 1
+        inc     cx
+        rep     stosw
+
+
+    ;
+    ; Tasm needs .386 to handle 32-bit constants so we push the current
+    ; operating state and switch temporarily to handle
+    ; InitialFreeDriveletterMap.
+    ;
+    IFDEF   TASM
+        pushstate
+        .386
+    ENDIF
+        ; Initialize the FreeDriveletterMap.
+        ; This is used by driveletter reassignment functions.
+        mov     di, offset [FreeDriveletterMap]
+        mov     ax, InitialFreeDriveletterMap AND 0ffffh
+        cld
+        stosw
+        mov     ax, InitialFreeDriveletterMap SHR 16
+        stosw
+    ;
+    ; Restore Tasm operating state.
+    ;
+    IFDEF   TASM
+        popstate
+    ENDIF
+
+
+        ; Use video page 0 for screen output
+        mov     word ptr [VideoIO_Segment], VideoIO_Page0
+
+        ; Don't use blinking attribute
+        call    VideoIO_NoBlinking
+
+        ; Get HardDriveCount
+        call    DriveIO_GetHardDriveCount
+
+
+        ; Rousseau: added
+        call    VideoIO_ClearScreen
+
+        ; Cursor to upper-left
+        mov     byte ptr [TextPosX], 0
+        mov     byte ptr [TextPosY], 0
+        call    VideoIO_CursorSet
+
+        ;~ mov     ax, VideoIO_Page1
+        ;~ call    VideoIO_BackUpTo   ; Copy BIOS POST to Second Page
+
+        ; Copyright
+        mov     si, offset Copyright
+        call    MBR_Teletype
+        xor     si,si
+        call    MBR_TeletypeNL
+
+
+        ;call    SOUND_Beep
+
+        ; Show build info
+        call    VideoIO_PrintBuildInfo
+
+    IFDEF   AUX_DEBUG
+        ; Initialize the com-port for debugging
+        call     AuxIO_Init
+    ENDIF
+
+        xor     si,si
+        call    MBR_TeletypeNL
+
+        xor     cx,cx
+    PRECRAP_Main_next_disk:
+
+        mov     dl,cl
+        or      dl,80h
+
+        ;
+        ; This also setup the size of the i13xbuf.
+        ;
+        call     DriveIO_GatherDiskInfo              ; Also used to fill the geo, should be separate function
+
+        mov      bx,offset [HugeDisk]
+        add      bx,cx
+        mov      [bx], al
+
+        call     DriveIO_LoadMasterLVMSector         ; returns NC if no valid LVM record found
+
+        pushf
+
+        ;~ mov     al,'#'
+        ;~ pushf
+        ;~ call    VideoIO_PrintSingleChar
+        ;~ popf
+        ;~ mov     al,0
+        ;~ rcl     al,1
+        ;~ call    VideoIO_PrintHexByte
+        ;~ mov     al,'#'
+        ;~ call    VideoIO_PrintSingleChar
+
+        mov      bx, offset [TrueSecs]
+        add      bx,cx
+        add      bx,cx
+        add      bx,cx
+        add      bx,cx
+        popf
+
+        ; bx now contains pointer to truesecs for this drive
+
+        jnc      NoValidMasterLVM
+
+        ; ?? 3f bij disk 80h maar 0 bij disk 81h
+        mov     si,offset [LVMSector]
+        mov     ax,[si+LocLVM_Secs]
+
+        ;~ pusha
+        ;~ mov     dx,ax
+        ;~ mov     al,'%'
+        ;~ call    VideoIO_PrintSingleChar
+        ;~ mov     ax,dx
+        ;~ call    VideoIO_PrintHexWord
+        ;~ mov     al,'%'
+        ;~ call    VideoIO_PrintSingleChar
+        ;~ popa
+
+        mov      word ptr [bx],ax
+        jmp      SkipUseBiosSecs
+
+
+    NoValidMasterLVM:
+        push    bx                   ; push truesecs pointer
+        mov     bx, offset [BIOS_Secs]
+        add     bx,cx
+        add     bx,cx
+        add     bx,cx
+        add     bx,cx
+
+        mov     ax,[bx]              ; get biossecs
+        pop     bx
+        mov     word ptr [bx],ax     ; store bios secs in truesecs
+
+
+    SkipUseBiosSecs:
+        inc     cx
+        cmp     cl,[TotalHarddiscs]
+        jb      PRECRAP_Main_next_disk
+
+
+
+    IFDEF   AUX_DEBUG
+        ; Write some debug-info to the com-port
+        call     DEBUG_Dump1
+    ENDIF
+
+        ;~ jz      NoValidMasterLVM
+;~
+        ;~ ; A valid Master LVM has been found.
+        ;~ ; We use the values in here to determine the number of sectors per track,
+        ;~ ; since this could be OS/2 extended geometry.
+;~
+        ;~ jmp     Continue1
+        ;~
+        ;~ mov     word ptr [LOG_Secs],63
+
+;               mov      al,[HugeDisk]           ;; fout, moet nog index bij
+;               call     AuxIO_TeletypeHexByte
+;               call     AuxIO_TeletypeNL
+
+;               mov      ax,word ptr [TrueSecs]  ;; fout, moet nog index bij
+;               call     AuxIO_TeletypeHexWord
+;               call     AuxIO_TeletypeNL
+
+
+
+        ; Huge Disk indicator
+        mov     si, offset [HugeBootDisk]
+        call    MBR_Teletype
+        mov     al,[HugeDisk]
+        mov     si, offset [No]
+        test    al,al
+        jz      MBR_HugeDriveIndicator
+        mov     si, offset [Yes]
+
+    MBR_HugeDriveIndicator:
+        call    MBR_Teletype
+        xor     si,si
+        call    MBR_TeletypeNL
+
+
+        ;
+        ; Phase 1 Indicator
+        ;
+        mov     si, offset [Phase1]
+        call    MBR_Teletype
+
+        mov     si, offset eCS_InstallVolume
+        mov     al, [si]
+        test    al,al                                 ; See if phase 1 is active
+        jnz     MBR_Main_BootThrough
+        mov     si, offset NotActive
+
+    MBR_Main_BootThrough:
+        call    MBR_Teletype
+        xor     si,si
+        call    MBR_TeletypeNL
+
+
+        ; Calculate Cooper-Bar Tables
+    IFDEF   FX_ENABLED
+        call    FX_CalculateTables
+    ENDIF
+
+        ; Calculate LVM-CRC-Table
+        call    LVM_InitCRCTable
+
+        ; Get HardDriveCount
+        call    DriveIO_GetHardDriveCount
+
+        ; Calculate CHS/LBA Switch Table
+        call    DriveIO_InitLBASwitchTable
+
+        ; Setup PartitionPointers-Table
+        call    PART_CalculateStraightPartPointers
+
+        ; Setup Cyrillic Charset, if needed
+    IFDEF TXT_IncludeCyrillic
+        call    CHARSET_IncludeCyrillic
+    ENDIF
+
+
+        ; This sets [CurIO_UseExtension] flag.
+        call    PRECRAP_CheckFor13extensions
+        mov     al,[CurIO_UseExtension]
+        test    al,al
+        jnz     INT13X_Supported
+
+        ;
+        ; Show Message that BIOS INT13X is not supported
+        ; and Halt the System.
+        ;
+        mov     cx, 0C04h
+        mov     si, offset TXT_NoINT13XSupport
+        call    SETUP_ShowErrorBox
+
+        ; Halt the system.
+        jmp     HaltSystem
+
+
+    ;
+    ; INT13X Supported so continue.
+    ;
+    INT13X_Supported:
+
+    IFNDEF ReleaseCode
+        ret
+    ENDIF
+
+
+        ;
+        ; Check valididy of the AiR-BOOT Configuration.
+        ;
+        call    PRECRAP_CheckConfiguration
+
+
+        ; =======================================
+        ; Checks for MBR Virii :) I love that job
+        ; =======================================
+        test    byte ptr [CFG_DetectStealth], 1
+        jz      PCM_NoStealthDetection
+        call    VIRUS_CheckForStealth
+    PCM_NoStealthDetection:
+        test    byte ptr [CFG_DetectVirus], 1
+        jz      PCM_NoVirusDetection
+        call    VIRUS_CheckForVirus
+    PCM_NoVirusDetection:
+
+
+        ; ============================================
+        ;  Delay for some time and get Strg/Alt State
+        ; ============================================
+        test    byte ptr [CFG_CooperBars], 1
+        jnz     PCM_ShortDelay
+        mov     al, 27                        ; About 1.5 seconds
+        test    byte ptr [CFG_FloppyBootGetName], 1
+        jz      PCM_LongDelay
+    PCM_ShortDelay:
+
+        mov     al, 13                        ; shorten delay,if floppy gets accessed
+    PCM_LongDelay:
+
+        call    TIMER_WaitTicCount
+
+        ; First check, if any normal key got pressed...
+        mov     ah, 1
+        int     16h
+        jz      PCM_NoNormalKeyPressed
+        ; User doesn't know what to do...or he is crazy <g> so display message
+        mov     si, offset TXT_HowEnterSetup
+        call    MBR_Teletype
+        mov     al, 54                        ; about 3 seconds, delay again
+
+        call    TIMER_WaitTicCount
+
+    PCM_NoNormalKeyPressed:
+        ; Now get keyboard Strg/Alt State
+        mov     ah, 02h
+        int     16h
+        mov     [SETUP_KeysOnEntry], al
+
+        ; Copy device-name to the ContBIOSbootSeq-IPT entry
+        ; We may not do this before PRECRAP_CheckConfiguration, because otherwise
+        ; this check will fail.
+        call    PART_UpdateResumeBIOSName
+        ret
+PRECRAP_Main    EndP
+
+
+
+
+AFTERCRAP_Main  Proc Near
+        ; ===================================================
+        ;  Now get volume label of FloppyDrive, if wanted...
+        ; ===================================================
+        test    byte ptr [CFG_FloppyBootGetName], 1
+        jz      ACM_NoFloppyGetName
+        call    DriveIO_UpdateFloppyName
+        or      ax, ax
+        jnz     ACM_NoFloppyGetName
+        ; Try a second time, if it failed to detect the Floppy
+        call    DriveIO_UpdateFloppyName
+    ACM_NoFloppyGetName:
+        ret
+AFTERCRAP_Main  EndP
+
+
+
+
+PRECRAP_CheckFor13extensions    Proc Near
+        mov     ah, 41h
+        mov     bx, 55AAh
+        mov     dl, 80h
+        int     13h
+        cmp     bx, 0AA55h
+        je      PCCF13E_Found
+    PCCF13E_NotFound:
+        ret
+    PCCF13E_Found:
+        and     cx, 1
+        jz      PCCF13E_NotFound
+        mov     byte ptr [CurIO_UseExtension], 1
+        ret
+PRECRAP_CheckFor13extensions    EndP
+
+
+; Checks Configuration CheckSum...Displays message, if failed.
+PRECRAP_CheckConfiguration      Proc Near  Uses ds si es di
+        mov     si, offset Configuration
+        xor     bx, bx
+
+        ; Changed from 5 to calculated value (not here, see compat. issue below)
+        ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"
+        ; Size of the ab-configuration in 512 byte sectors
+        ; mov     cx, (MBR_BackUpMBR - Configuration) / 200h
+
+        ; AB v1.07 stores a 5 sector configuration with a 5 sector checksum.
+        ; AB v1.0.8+ *should* stores a 7 sector configuration with a
+        ; 7 sector checksum.
+        ; Because 5 was hardcoded here, SET(A)BOOT v1.07 will see see an AB v1.0.8+
+        ; config as corrupted, while this is not the case.
+        ; So, for compatibility reasons, in v1.0.8+, the checksum stored is over
+        ; 5 sectors, to be compatible with v1.07.
+        ; This may change (be corrected) in future versions !
+        mov      cx,5
+
+        mov     dx, [CFG_CheckConfig]
+        mov     [CFG_CheckConfig], bx
+    PCCC_Loop:
+        call    MBR_GetCheckOfSector
+        loop    PCCC_Loop
+        cmp     bx, dx
+        jne     PCCC_Failed
+        mov     CFG_CheckConfig, dx
+        ret
+    PCCC_Failed:
+        mov     si, offset TXT_ERROR_CheckConfig
+        call    MBR_Teletype
+        mov     si, offset TXT_ERROR_CheckFailed
+        call    MBR_Teletype
+        jmp     MBR_HaltSystem
+PRECRAP_CheckConfiguration      EndP
+
+
+; Rousseau: added
+;        In: SI - Pointer to begin of string (EOS is 0)
+; Destroyed: SI
+; Fixme: Uses double writes to use attribute with teletype-function.
+MBR_TeletypeBold    Proc Near   Uses ax bx cx
+    MBRT_LoopBold:
+        lodsb
+        or      al, al
+        jz      MBRT_EndBold
+        push    ax
+        mov     ah,09h
+        mov     bx,15
+        mov     cx,1
+        int     10h
+        pop     ax
+        mov     ah,0eh
+        mov     bx,7            ; Does not do anything in text-modus
+        mov     cx,1
+        int     10h
+        jmp     MBRT_LoopBold
+    MBRT_EndBold:
+        ret
+MBR_TeletypeBold    EndP
+
+
+;        In: SI - Pointer to begin of string (EOS is 0)
+; Destroyed: SI
+; Fixme: Uses double writes to use attribute with teletype-function.
+MBR_TeletypeVolName     Proc Near   Uses ax bx cx
+        mov     cx, 11
+    MBRT_LoopVolName:
+        mov     dx,cx           ; Backup counter
+        lodsb
+        or      al, al
+        jz      MBRT_EndVolName
+        push    ax
+        mov     ah,09h
+        mov     bx,15
+        mov     cx,1
+        int     10h             ; DX is preserved
+        pop     ax
+        mov     ah,0eh
+        mov     bx,7            ; Does not do anything in text-modus
+        mov     cx,1
+        int     10h             ; DX is preserved
+        mov     cx,dx           ; Restore counter
+        loop    MBRT_LoopVolName
+    MBRT_EndVolName:
+        ret
+MBR_TeletypeVolName     EndP
+
+; Rousseau: added
+; Move cursor to next line
+; Just do a new-line if SI==0
+MBR_TeletypeNL      Proc Near   Uses ax bx cx
+        test    si,si
+        jz      MBR_TeletypeNL_NL
+        call    MBR_Teletype
+    MBR_TeletypeNL_NL:
+        push    si
+        mov     si, offset NL
+        call    MBR_Teletype
+        pop     si
+        ret
+MBR_TeletypeNL      EndP
+
+; Sync teletype position to VideoIO
+MBR_TeletypeSyncPos     Proc Near   Uses ax bx cx dx
+        pushf
+        mov     bh, 0
+        mov     ah, 02h
+        mov     dh,byte ptr [TextPosY]
+        mov     dl,byte ptr [TextPosX]
+        int     10h
+        popf
+        ret
+MBR_TeletypeSyncPos     EndP
Index: trunk/bootcode/regular/partmain.asm
===================================================================
--- trunk/bootcode/regular/partmain.asm	(revision 57)
+++ trunk/bootcode/regular/partmain.asm	(revision 57)
@@ -0,0 +1,2522 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                     AiR-BOOT / PARTiTiON REGULAR ROUTINES
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'PARTMAIN',0
+ENDIF
+
+PART_FixUpDefaultPartitionValues Proc Near  Uses dx si di
+    ; Fix-Up Default and Last Partition - If lost, search for Bootable
+    xor     bl, bl
+    mov     dl, CFG_PartDefault
+    call    PART_FixUpSelectionNumber
+    mov     CFG_PartDefault, dl
+    mov     dl, CFG_PartLast
+    call    PART_FixUpSelectionNumber
+    mov     CFG_PartLast, dl
+    mov     dl, CFG_PartAutomatic
+    call    PART_FixUpSelectionNumber
+    mov     CFG_PartAutomatic, dl
+
+; [Linux support removed since v1.02]
+;   ; Fix-Up Linux Kernel Partition - If lost, search for FAT-16
+;   mov     bl, 06h
+;   mov     dl, CFG_LinuxKrnlPartition
+;   call    PART_FixUpPartitionNumber
+;   mov     CFG_LinuxKrnlPartition, dl
+;
+;   ; Fix-Up Linux Root Partition - If lost, search for Linux partition (83h)
+;   mov     bl, 83h
+;   mov     dl, CFG_LinuxRootPartition
+;   call    PART_FixUpPartitionNumber
+;   mov     CFG_LinuxRootPartition, dl
+   ret
+PART_FixUpDefaultPartitionValues EndP
+
+; Our resync process for partition number is as specified:
+;==========================================================
+; - If 0FFh -> Partition Disabled, so don't do anything to it...
+; - Try to use GetXref to get the new partition no via X-Ref Table
+; - If failed, increase partition no, till overflow or hit on specific
+;    characteristic
+;    On overflow -> Resume search from partition no 0
+;
+; Characteristic is a partition id. If this id is 0, then a bootable partition
+;  is searched for.
+
+; Fixes a partition number, adjusting it to the new IPT after redetect
+;        In: DL - Number of partition
+;            BL - Requested Partition ID
+;       Out: DL - New number of partition (guessed normally ;)
+PART_FixUpSelectionNumber       Proc Near Uses ax cx
+        cmp     dl, 080h
+        je      PFUPN_SelectionDisabled
+        ja      PFUPN_SpecialSelection
+        call    PARTSCAN_GetXref              ; DL - PartitionNo prev IPT
+        cmp     dh, 0FFh                      ; DH -> Partition No in new IPT
+        je      PFUPN_SelectionGone
+        mov     dl, dh
+    PFUPN_SelectionDisabled:
+        ret
+
+    PFUPN_SpecialSelection:
+        cmp     dl, 0FEh                      ; Resume-BIOS?
+        ja      PFUPN_SpecialSelectionFloppy
+        cmp     byte ptr [CFG_ResumeBIOSbootSeq], 0
+        je      PFUPN_SelectionGone
+        jmp     PFUPN_Found
+    PFUPN_SpecialSelectionFloppy:
+        cmp     byte ptr [CFG_IncludeFloppy], 0
+        je      PFUPN_SelectionGone
+        jmp     PFUPN_Found
+
+    ; Partition is not referenced in New-IPT or Resume-BIOS/Floppy selected, but
+    ;  actual media is disabled...so dig for requested partition
+    PFUPN_SelectionGone:
+        mov     cl, CFG_Partitions
+        or      cl, cl
+        jz      PFUPN_NothingFound            ; No partitions available -> so fail
+        or      bl, bl
+        jz      PFUPN_BootableSearchLoop
+    ; Search for Partition ID "BL"
+    PFUPN_PartIDsearchLoop:
+        call    PART_GetPartitionPointer   ; Gets SI for partition DL
+        cmp     bptr ds:[si+LocIPT_SystemID], bl
+        je      PFUPN_Found
+        dec     cl
+        jz      PFUPN_NothingFound
+        inc     dl                            ; Increase
+        cmp     CFG_Partitions, dl
+        ja      PFUPN_PartIDsearchLoop
+        xor     dl, dl
+        jmp     PFUPN_PartIDsearchLoop
+
+    ; Search for Partition ID "BL"
+    PFUPN_BootableSearchLoop:
+        call    PART_GetPartitionPointer   ; Gets SI for partition DL
+        mov     al, ds:[si+LocIPT_Flags]
+        and     al, Flags_Bootable
+        jnz     PFUPN_Found
+        dec     cl
+        jz      PFUPN_NothingFound
+
+        inc     dl                         ; Increase
+        cmp     CFG_Partitions, dl
+        ja      PFUPN_PartIDsearchLoop
+        xor     dl, dl
+        jmp     PFUPN_PartIDsearchLoop
+
+    PFUPN_NothingFound:
+        mov     dl, 080h                      ; Now being Disabled
+    PFUPN_Found:
+        ret
+PART_FixUpSelectionNumber       EndP
+
+; ============================================================================
+;        In: DS:SI - IPT-Entry of partition
+;            DS:PartitionSector - Actual Boot-Record of partition
+;       Out: *none* (BootRecordCRC updated)
+; CHECKME: Verify the change (BX points to sector to CRC) is working OK
+PART_UpdateBootRecordCRC        Proc Near Uses bx
+        push    si
+        ;~ mov     si, offset PartitionSector
+        mov     si, bx
+        mov     bx, 4B4Dh            ; Magic: 'MK'
+        call    MBR_GetCheckOfSector
+        pop     si
+        mov     [si+LocIPT_BootRecordCRC], bx
+        ret
+PART_UpdateBootRecordCRC        EndP
+
+
+
+; Rousseau:
+; ---------
+; Bug:
+; When ResumeBIOSbootSeq is zero, BX still gets decremented and shifted left.
+; Then when used as an index into ContinueBIOSbootTable to get the address
+; of the device-name, the index is two bytes too low, and SI get's loaded
+; with whatever is before the ContinueBIOSbootTable.
+; Then when SI is used to copy a null-terminated string, it depends on the
+; bogus location SI points to where a null-byte will appear.
+; Since I placed some text before the ContinueBIOSbootTable, the bogus pointer
+; SI obtained pointed to an area where there was no null-byte in sight for
+; more than 11 bytes, causing SI to overwrite the CD-ROM IPT entry with
+; garbage. It took me a while to tackle this one because I was baffled why
+; moving text around in STD_TEXT.ASM, where ContinueBIOSbootTable resides,
+; mattered while the offset of ContinueBIOSbootTable did not change.
+; This bug is also present in v1.06 but never surfaced because STD_TEXT.ASM
+; is kinda static and luck has it that the word preceding ContinueBIOSbootTable
+; presumably pointed to an area where a null byte was near.
+;
+; BOOKMARK: The nasty pointer bug
+
+
+; Copies the device-name to the Resume-BIOS IPT entry
+PART_UpdateResumeBIOSName       Proc Near Uses ax bx cx si di
+
+        ; Get BIOS resume indicator.
+        ;movzx   bx, CFG_ResumeBIOSbootSeq
+        mov     bl,CFG_ResumeBIOSbootSeq
+        mov     bh,0
+
+        ; Clear name of IPT-entry.
+        mov     di, offset BIOScontIPTentry+LocIPT_Name
+        push    di
+            mov     cx, 11
+            mov     al, ' '
+            rep     stosb
+        pop     di
+
+        ; If no resume then exit.
+        test    bx,bx
+        jz      PURBN_NoResumeBootSeq
+
+        ; Convert to index in name-table.
+        dec     bx
+        shl     bx, 1
+
+        ; Put the pointer to the name in SI.
+        mov     si, word ptr [ContinueBIOSbootTable+bx]
+
+        ; Copy the name to the IPT-entry.
+    PURBN_BootDeviceCopyLoop:
+        lodsb
+         or     al, al
+        jz      PURBN_NoResumeBootSeq
+        stosb
+        jmp     PURBN_BootDeviceCopyLoop
+
+        ; We're done.
+    PURBN_NoResumeBootSeq:
+
+        ret
+PART_UpdateResumeBIOSName       EndP
+
+
+
+; ============================================================================
+;  Partition-Pointer Functions
+; ============================================================================
+
+; Builds Pointer-Table straight (without filtering, w/o Floppy/CD-ROM/Kernels)
+PART_CalculateStraightPartPointers Proc Near
+        mov     ax, offset PartitionTable
+        mov     bx, offset PartitionPointers
+        mov     cx, LocIPT_MaxPartitions
+
+    PCSPP_Loop:
+        mov     ds:[bx], ax                     ; Move address IPT entry to PPT
+        add     bx, 2                           ; Advance pointer to PPT entry
+        add     ax, LocIPT_LenOfIPT             ; Advance pointer to IPT entry
+        dec     cx                              ; Decrement counter
+        jnz     PCSPP_Loop                      ; Next iteration
+
+        mov     al, ds:[CFG_Partitions]         ; Get number of partitions
+        mov     ds:[PartitionPointerCount], al  ; Update number for PPT
+        ret
+PART_CalculateStraightPartPointers EndP
+
+; This here does PartitionPointers in order for displaying in BootMenu
+; [this means filtering and including Floppy/CD-ROM/Kernels, if wanted]
+PART_CalculateMenuPartPointers Proc Near Uses si
+
+;!
+;! DEBUG_PROBE
+;!
+IFDEF   AUX_DEBUGx
+    push    1241h
+    call    DEBUG_Probe
+ENDIF
+
+        mov     si, offset PartitionTable
+        mov     bx, offset PartitionPointers
+        test    byte ptr [CFG_IncludeFloppy], 1
+        jz      PCMPP_NoFloppyInclude
+        mov     ax, offset FloppyIPTentry
+        mov     ds:[bx], ax
+        add     bx, 2
+    PCMPP_NoFloppyInclude:
+
+        test    byte ptr [CFG_ResumeBIOSbootSeq], 0FFh
+        jz      PCMPP_NoResumeBootSeqInclude
+        mov     ax, offset BIOScontIPTentry
+        mov     ds:[bx], ax
+        add     bx, 2
+    PCMPP_NoResumeBootSeqInclude:
+
+; [Linux support removed since v1.02]
+;   ; Now include all Linux Kernels, if any available...
+;   movzx   cx, LINUX_KernelNo
+;   or      cx, cx
+;   jz      PCMPP_NoLinuxKernels
+;   mov     ax, offset LINUX_KernelEntries
+;  PCMPP_KernelLoop:
+;      mov     ds:[bx], ax
+;      add     bx, 2
+;      add     ax, LocIPT_LenOfIPT
+;   dec     cx
+;   jnz     PCMPP_KernelLoop
+;  PCMPP_NoLinuxKernels:
+
+        ;movzx   cx, CFG_Partitions ; LocIPT_MaxPartitions
+        mov   cl,CFG_Partitions ; LocIPT_MaxPartitions
+        mov   ch,0
+
+        or      cx, cx
+        jz      PCMPP_NoPartitions
+    PCMPP_Loop:
+        mov     al, ds:[si+LocIPT_Flags]
+        and     al, Flags_Bootable
+        jz      PCMPP_IsNotBootable
+        mov     ds:[bx], si
+        add     bx, 2
+    PCMPP_IsNotBootable:
+        add     si, LocIPT_LenOfIPT
+        dec     cx
+        jnz     PCMPP_Loop
+    PCMPP_NoPartitions:
+        sub     bx, offset PartitionPointers
+        shr     bx, 1
+        mov     ds:[PartitionPointerCount], bl
+        ret
+PART_CalculateMenuPartPointers EndP
+
+; Gets a pointer to the given partition
+;        In: DL - Number of partition
+;       Out: SI - Pointer to it
+PART_GetPartitionPointer        Proc Near   Uses bx
+        cmp     dl, 0FEh
+        je      PGPP_IsBIOSbootSeq            ; FEh -> Resume BIOS boot Sequence
+        ja      PGPP_IsFloppy                 ; FFh -> Floppy
+        ;movzx   bx, dl
+        mov   bl,dl
+        mov   bh,0
+
+        shl     bx, 1
+        mov     si, word ptr [PartitionPointers+bx]
+        ret
+
+    PGPP_IsBIOSbootSeq:
+;!
+;! DEBUG_PROBE
+;!
+IFDEF   AUX_DEBUGx
+    push    1242h
+    call    DEBUG_Probe
+ENDIF
+
+        mov     si, offset BIOScontIPTentry
+        ret
+
+    PGPP_IsFloppy:
+        mov     si, offset FloppyIPTentry     ; PartitionTable-LocIPT_LenOfIPT
+        ret
+PART_GetPartitionPointer        EndP
+
+; Gets the number of a partition pointer
+;        In: SI - Pointer to Partition
+;       Out: DL - Number of partition
+PART_GetPartitionNumber         Proc Near   Uses bx
+        mov     dl, ds:[PartitionPointerCount]
+        mov     bx, offset PartitionPointers
+    PGPN_SearchLoop:
+        cmp     word ptr ds:[bx], si
+        je      PGPN_Found
+        add     bx, 2
+        dec     dl
+        jnz     PGPN_SearchLoop
+        mov     dl, 0FFh
+        ret
+
+    PGPN_Found:
+        sub     dl, ds:[PartitionPointerCount]
+        dec     dl
+        not     dl
+        ret
+PART_GetPartitionNumber         EndP
+
+
+;
+; Following functions are only usable, when Partition-Pointer-View is filtered
+;
+
+; They will convert from and to unfiltered view (used in Boot-Menu)
+;        In: DL - Number of partition in filtered view
+;       Out: DL - Number of partition in straight view
+;
+; This gets the address of the IPT-entry from the Partition Pointer Table and
+; converts that to an index into the IPT; the straight view.
+;
+PART_ConvertToStraight          Proc Near
+        ;movzx   bx, dl
+        mov   bl,dl                                 ; Partition number to BX
+        mov   bh,0
+
+        shl     bx, 1                               ; Convert to word index
+        mov     ax, word ptr cs:[PartitionPointers+bx]  ; Get the partition pointer
+        cmp     ax, offset FloppyIPTentry           ; Check for Floppy
+        jb      PCTS_IsBIOSbootSeq                  ; Nope, is BIOS-bootseq
+        je      PCTS_IsFloppy                       ; Is Floppy
+
+; [Linux support removed since v1.02]
+;   cmp     ax, offset LINUX_KernelEntries
+;   jae     PCTS_IsKernelEntry
+
+        ;
+        ; Is partition, AX contains pointer to IPT entry
+        ;
+        sub     ax, offset PartitionTable       ; Make relative
+        mov     bl, LocIPT_LenOfIPT             ; Length of IPT entry
+        div     bl                              ; Divide with IPTlength
+        mov     dl, al                          ; Index in IPT
+        ret
+
+; [Linux support removed since v1.02]
+;  PCTS_IsKernelEntry:
+;   mov     dl, 0FDh
+;   ret
+
+    PCTS_IsBIOSbootSeq:
+        mov     dl, 0FEh
+        ret
+    PCTS_IsFloppy:
+        mov     dl, 0FFh
+        ret
+PART_ConvertToStraight          EndP
+
+
+
+;        In: DL - Number of partition in straight view
+;       Out: DL - Number of partition in filtered view
+;
+; This searches for the absolute offset of an IPT-entry in the
+; PartitionPointers table.
+; This table holds the offsets of IPT partition entries that are in the Menu ?
+; If the offset/entry is found it's index, the filtered number, is returned.
+;
+PART_ConvertFromStraight        Proc Near    Uses es di
+;!
+;! DEBUG_PROBE
+;!
+IFDEF   AUX_DEBUGx
+    push    1243h
+    call    DEBUG_Probe
+ENDIF
+
+        cmp     dl, 0FEh
+        jb      PCFS_IsPartition
+        mov     ax, offset BIOScontIPTentry
+        je      PCFS_DoSearch
+        mov     ax, offset FloppyIPTentry
+        jmp     PCFS_DoSearch
+
+
+    PCFS_IsPartition:
+        ; First we get Partition-Offset in AX
+        ;movzx   ax, dl
+        mov   al,dl                         ; Index in IPT to AX
+        mov   ah,0
+        mov     bl, LocIPT_LenOfIPT         ; Length of an IPT entry
+        mul     bl                          ; Mul to get relative offset
+        add     ax, offset PartitionTable   ; Add to get absolute offset
+
+        ;
+        ; AX now points to the IPT entry of the partition.
+        ; This address is searched for in the Partition Pointer Table.
+        ;
+
+    PCFS_DoSearch:
+        ; Now search for this offset in our filtered Partition-Pointer-Table
+        push    cs
+        pop     es
+        mov     di, offset PartitionPointers    ; Point to table
+        mov     cx, LocIPT_MaxPartitions        ; Max number of entries to search
+        xor     dl, dl                          ; Reply on Not-Found = Partition==0
+        repne   scasw                           ; Compare-Loop
+        jne     PCFS_NotFound
+        sub     di, 2                           ; One Back, so point to compared value
+        mov     dx, di                          ; Offset in DX
+        sub     dx, offset PartitionPointers    ; Make relative
+        shr     dx, 1                           ; Convert to Index
+    ; Adjust for IncludeFloppy/etc. is automatically done, due Pointer-LookUp
+    PCFS_NotFound:
+        ret
+PART_ConvertFromStraight        EndP
+
+
+
+;        In: AX - Pointer to IPT Entry
+;       Out: SI - Pointer to corresponding Size-Element
+; Destroyed: AX
+PART_GetSizeElementPointer      Proc Near   Uses bx
+; [Linux support removed since v1.02]
+;   cmp     ax, offset LINUX_KernelEntries
+;   jae     PGSEP_IsKernelEntry
+        mov     si, offset PartitionSizeTable
+        sub     ax, offset PartitionTable
+;   jmp     PGSEP_Continue
+; [Linux support removed since v1.02]
+;  PGSEP_IsKernelEntry:
+;   mov     si, offset LINUX_KernelSizeTable
+;   sub     ax, offset LINUX_KernelEntries
+;  PGSEP_Continue:
+        mov     bl, LocIPT_LenOfIPT
+        div     bl                            ; Divide with IPTlength
+        ;movzx   bx, al
+        mov   bl,al
+        mov   bh,0
+
+        shl     ax, 1
+        shl     bx, 2
+        add     ax, bx                        ; My way of multiplying with 6
+        add     si, ax                        ; SI - Partition Size-Element
+        ret
+PART_GetSizeElementPointer      EndP
+
+;        In: BX:AX - Sector Size (1=512 Bytes, 2=1024 Bytes, etc.)
+;            ES:DI - Pointer to Size-Element (6 bytes)
+;       Out: None, Size-Element filled out
+; Destroyed: AX, BX, DI
+PART_FillOutSizeElement         Proc Near   Uses cx dx
+        add     di, 3                         ; ES:DI - Last Digit of Size Digits
+        shr     bx, 1
+        rcr     ax, 1                         ; /2 -> Sector Size is now KByte Size
+        xor     cl, cl                        ; 0 - KByte, 1 - MByte, 2 - GByte
+    PFOSE_MakeSmallerLoop:
+        or      bx, bx
+        jnz     PFOSE_MakeSmaller
+        cmp     ax, 9999
+        jbe     PFOSE_IsSmallEnough
+    PFOSE_MakeSmaller:
+        mov     dx, bx
+        and     dx, 1023                   ; My crazy way of dividing a 32-bit
+        shr     ax, 10                     ; value through 1024 using 16-bit
+        shr     bx, 10                     ; instructions...
+        shl     dx, 6
+        or      ax, dx
+        inc     cl                         ; Value got smaller...
+        jmp     PFOSE_MakeSmallerLoop
+
+    PFOSE_IsSmallEnough:
+        ; First write the type of this Size-Element (KB/MB/GB)
+        mov     bx, 'BK'
+        cmp     cl, 1
+        jb      PFOSE_WriteType
+        je      PFOSE_IsMBtype
+        mov     bx, 'BG'
+        jmp     PFOSE_WriteType
+    PFOSE_IsMBtype:
+        mov     bx, 'BM'
+    PFOSE_WriteType:
+        mov     word ptr es:[di+1], bx
+        mov     bx, 10                        ; Digits are 10-Based
+        xor     dx, dx
+    PFOSE_DigitLoop:
+        xor     dx, dx
+        div     bx                         ; AX - Digit, DX - Remainder
+        add     dl, '0'                    ; Convert digit to ASCII digit
+        mov     es:[di], dl
+        or      ax, ax
+        jz      PFOSE_EndOfDigitLoop
+        dec     di                         ; Go to previous char
+        jmp     PFOSE_DigitLoop
+
+    PFOSE_EndOfDigitLoop:
+        ret
+PART_FillOutSizeElement         EndP
+
+
+
+
+
+
+
+
+
+
+
+; This routine is called to hide a partition
+;        In: DL - Partition to hide
+; Destroyed: None
+PART_HidePartition              Proc Near   Uses ax bx cx dx si di
+        call    PART_GetPartitionPointer      ; Pointer to partition (DL) -> SI
+
+        ; First load the partition table of that partition...
+        mov     ax, wptr [si+LocIPT_AbsolutePartTable+0]
+        mov     bx, wptr [si+LocIPT_AbsolutePartTable+2]
+        mov     cx, wptr [si+LocIPT_LocationPartTable+1]
+        mov     dh, bptr [si+LocIPT_LocationPartTable+0]
+        mov     dl, [si+LocIPT_Drive]
+        call    DriveIO_LoadPartition
+        ; Partition-Table now LOADED
+        mov     di, offset PartitionSector+446 ; ES:DI - 1st partitionentry...
+
+        ; Put our partition's location into registers...
+        mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
+        mov     bx, wptr [si+LocIPT_AbsoluteBegin+2]
+        sub     ax, wptr [si+LocIPT_AbsolutePartTable+0]
+        sbb     bx, wptr [si+LocIPT_AbsolutePartTable+2]
+        ; BX:AX - absolute position of partition relative to partition table
+        ; ...and search for it...
+    PHP_SearchLoop:
+        cmp     ax, wptr es:[di+LocBRPT_RelativeBegin]
+        jne     PHP_SearchMismatch
+        cmp     bx, wptr es:[di+LocBRPT_RelativeBegin+2]
+        jne     PHP_SearchMismatch
+        jmp     PHP_SearchMatch
+    PHP_SearchMismatch:
+        add     di, LocBRPT_LenOfEntry     ; 16 Bytes per partition entry
+        cmp     di, 500+offset PartitionSector
+        jb      PHP_SearchLoop
+        jmp     MBR_HaltSystem                ; not found, something is wrong here
+
+    ; Found entry...
+    PHP_SearchMatch:
+        mov     al, bptr es:[di+LocBRPT_SystemID] ; Partition-ID into AL
+        call    PART_SearchFileSysHiddenID    ; Put on =STEALTH=
+        mov     bptr es:[di+LocBRPT_SystemID], al
+    IFDEF ReleaseCode
+        call    DriveIO_SavePartition      ; Saves Partition-Table
+    ENDIF
+        ret
+PART_HidePartition              EndP
+
+
+
+
+
+; This here is for marking the first "good" non-hidden partition as being
+;  active. It requires the partition table at EXECBASE.
+;  Some BIOSes have problems with no primary marked active. Actually this is
+;  a buggy implementation, because the MBR-code should normally check,
+;  *not* the BIOS. This one *could* cause havoc to some systems, but I can't
+;  do anything else.
+PART_MarkFirstGoodPrimary       Proc Near   Uses ax si di
+    mov     di, offset PartitionSector+446 ; DS:SI - 1st partitionentry
+    ; First action to do: Remove the active flag from every partition
+    push    di
+        mov     cl, 4
+    PMPP_RemoveActiveFlagLoop:
+        and     bptr es:[di+LocBRPT_Flags], 7Fh
+        add     di, LocBRPT_LenOfEntry
+        dec     cl
+        jnz     PMPP_RemoveActiveFlagLoop
+    pop     di
+    ; First Search, will hit on any PartitionID that is:
+    ; a) not 0
+    ; b) not hidden
+    ; c) not extended partition (05h or 0Fh)
+    PMPP_Search1Loop:
+        mov     al, bptr es:[di+LocBRPT_SystemID]
+        or      al, al
+        jz      PMPP_Search1NoHit
+        cmp     al, 05h
+        je      PMPP_Search1NoHit
+        cmp     al, 0Fh
+        je      PMPP_Search1NoHit
+        mov     bl, al                     ; BL == AL == PartitionID
+        push    si
+        call    PART_SearchFileSysName
+        pop     si                         ; AL == UnhiddenPartitionID
+        cmp     al, bl                     ; if ID is unhidden...
+        je      PMPP_SearchHit
+        PMPP_Search1NoHit:
+        add     di, LocBRPT_LenOfEntry     ; 16 Bytes per Partition-Entry
+        cmp     di, 500+offset PartitionSector
+        jb      PMPP_Search1Loop
+
+        mov     di, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry
+    ; Second Search, hit on anything that is not an extended partition
+    ;  (05 or 0Fh)
+    PMPP_Search2Loop:
+        mov     al, bptr es:[di+LocBRPT_SystemID]
+        or      al, al
+        jz      PMPP_Search2NoHit
+        cmp     al, 05h
+        je      PMPP_Search2NoHit
+        cmp     al, 0Fh
+        jne     PMPP_SearchHit
+        PMPP_Search2NoHit:
+        add     di, LocBRPT_LenOfEntry     ; 16 Bytes per Partition-Entry
+        cmp     di, 500+offset PartitionSector
+        jb      PMPP_Search2Loop
+        jmp     PMPP_SearchFailed
+
+    PMPP_SearchHit:
+        or      bptr es:[di], 80h             ; SET ACTIVE PARTITION
+    PMPP_SearchFailed:
+        ret
+PART_MarkFirstGoodPrimary       EndP
+
+; Searches the Name and Flags to a FileSysID (PartitionID)
+;        In: AL - FileSysID
+;       Out: AL - Unhidden File-System-ID, AH - Flags for this File-System
+;            SI - Pointer to Name (8char)
+; Destroyed: *none*
+PART_SearchFileSysName          Proc Near  Uses bx dx
+        ;movzx   bx, al
+        mov   bl,al
+        mov   bh,0
+
+        mov     si, offset FileSysIDs
+    PSFSN_SearchLoop:
+        lodsw                              ; AL - NormalID, AH-HiddenID
+        mov     dl, ds:[si]                ; DL - File-System-Flags
+        inc     si
+        cmp     al, bl                     ; Check, if Unhidden-ID matches...
+        je      PSFSN_Match
+        cmp     ah, bl                     ; Check, if Hidden-ID matches...
+        je      PSFSN_Match
+        mov     al, bl                     ; So Unhidden-ID will be Original-ID
+        cmp     ah, 0                      ; Unknown (last ID in table)
+        je      PSFSN_Match
+        inc     bh
+        jmp     PSFSN_SearchLoop
+
+    PSFSN_Match:
+        ; AL is already Unhidden-ID
+        mov     ah, dl
+        ; AH is now the FileSystem-Flag
+        ;movzx   bx, bh
+        mov   bl,bh
+        mov   bh,0
+
+        shl     bx, 3   ; Offsets * 8
+        mov     si, offset FileSysNames
+        add     si, bx
+        ret
+PART_SearchFileSysName          EndP
+
+; Searches the Hidden ID corresponding to a FileSysID (PartitionID)
+;        In: AL - FileSysID
+;       Out: AL - Hidden File-System-ID
+PART_SearchFileSysHiddenID      Proc Near  Uses bx
+        ;movzx   bx, al
+        mov   bl,al
+        mov   bh,0
+
+        mov     si, offset FileSysIDs
+    PSFSHI_SearchLoop:
+        lodsw                              ; AL - NormalID, AH-HiddenID
+        inc     si
+        cmp     al, bl                     ; Check, if Unhidden-ID matches...
+        je      PSFSHI_Match
+        cmp     ah, bl                     ; Check, if Hidden-ID matches...
+        je      PSFSHI_Match
+        mov     ah, bl                     ; So Unhidden-ID will get replied...
+        cmp     ah, 0                      ; Unknown (last ID in table)
+        je      PSFSHI_Match
+        inc     bh
+        jmp     PSFSHI_SearchLoop
+
+    PSFSHI_Match:
+        mov     al, ah                        ; AL = Hidden ID
+        ret
+PART_SearchFileSysHiddenID      EndP
+
+;        In: DS:SI - Partition-Name, CX - Maximum/Total Length
+;       Out: Carry-Flag set, if valid Partition-Name
+; Destroyed: None
+PART_CheckForValidPartName      Proc Near   Uses ax cx dx si
+        ; Our logic is as follows:
+        ;  If all chars are U -> Invalid (due reformated signature)
+        ;  If anything below 32, but 0 -> Invalid (due invalid chars)
+        ;  If anything above 165 -> Invalid (due invalid chars)
+        ;  If anything between 123-128 -> Invalid (due invalid chars)
+        ;  DX - holds count of 'U's
+        push    cx
+            or      cx, cx
+            jz      PCFVPN_InvalidName
+            xor     dx, dx
+    PCFVPN_CheckLoop:
+            lodsb
+            cmp     al, 0
+            je      PCFVPN_ValidChar
+            cmp     al, 32
+            jb      PCFVPN_InvalidName
+            cmp     al, 165
+            ja      PCFVPN_InvalidName
+            cmp     al, 123
+            jb      PCFVPN_ValidChar
+            cmp     al, 128
+            jbe     PCFVPN_InvalidName
+    PCFVPN_ValidChar:
+            cmp     al, 'U'
+            jne     PCFVPN_NoMagic
+            inc     dx
+    PCFVPN_NoMagic:
+          dec     cx
+          jnz     PCFVPN_CheckLoop
+        pop     cx
+        cmp     cx, dx
+        clc
+        je      PCFVPN_WasMagic
+        stc
+    PCFVPN_WasMagic:
+        ret
+    PCFVPN_InvalidName:
+        pop     cx
+        clc
+        ret
+PART_CheckForValidPartName      EndP
+
+
+
+; Compare a volume-label in the IPT to the install-volume
+; SI holds pointer to entry in IPT
+; CY set if this entry is also the install-volume
+PART_IsInstallVolume            Proc Near   Uses ax cx dx si di
+        cld                                    ; Advance upwards with lodsb
+        mov   di, offset eCS_InstallVolume     ; Address of install-volume label (max. 11 chars)
+
+        mov   cx, 11                           ; Maximum length of label
+        xor   dl, dl                           ; Not found yet
+
+    ; Compare next character
+    PART_IsInstallVolumeNext:
+        lodsb                                  ; Load byte from SI (IPT-entry)
+        ;cmp      al,' '                        ; If space then use zero
+        ;jne      PART_IsInstallVolume_skip1
+        ;xor      al,al
+    PART_IsInstallVolume_skip1:
+        xchg     ah,al                         ; Save char to AH
+        xchg     si,di                         ; Exchange pointers
+        lodsb                                  ; Load byte from SI (install-volume label)
+        ;cmp      al,' '                        ; If space then use zero
+        ;jne      PART_IsInstallVolume_skip2
+        ;xor      al,al
+    PART_IsInstallVolume_skip2:
+        xchg     si,di                         ; Reexchange pointers
+        ;~ call     AuxIO_Teletype
+        call     CONV_ToUpper
+        ;~ call     AuxIO_Teletype
+        xchg     al,ah
+        ;~ call     AuxIO_Teletype
+        call     CONV_ToUpper
+        ;~ call     AuxIO_Teletype
+        ;~ call     AuxIO_TeletypeNL
+
+        ; Are both of them zero ?
+        ; Then the names could be the same, but cx must not equal 11
+        ; because that would indicate a null-string.
+        mov      dh,al
+        or       dh,ah
+        jz       PART_IsInstallVolumeFound
+
+        cmp      ah,al                         ; Are the the same ?
+        jnz      PART_IsInstallVolumeNotFound  ; Nope, compare ended
+        loop     PART_IsInstallVolumeNext      ; Yep, Compare next character
+
+    PART_IsInstallVolumeFound:
+        ; If CX is still 11 this was a zero string
+        ; and thus not a valid volume-name.
+        ; This should not occur as this function is only called when the first
+        ; byte is non-zero.
+        cmp      cx,11
+        je       PART_IsInstallVolumeNotFound
+        ; Found !
+        mov      dl,1                          ; Found
+        jmp      PART_IsInstallVolumeEnd
+
+
+    PART_IsInstallVolumeNotFound:
+        mov      dl,0
+        jmp      PART_IsInstallVolumeEnd
+
+
+    PART_IsInstallVolumeEnd:
+        ; Set the status in CY
+        mov      al,dl
+        add      al,'0'
+        ;~ call     AuxIO_TeletypeHexByte
+        ;~ call     AuxIO_TeletypeNL
+        rcr      dl,1                          ; Put found-flag in CY
+        ret
+PART_IsInstallVolume            EndP
+
+
+
+
+
+
+; If found CY=1, AL=partnum, else CY=0, AL=0FFH
+; BOOKMARK: Setup Phase1
+PART_SetupPhase1    Proc    Uses bx cx dx si di
+
+        ;
+        ; Enumberate Bootable Systems by name
+        ; and prepare Phase 1 if active.
+        ;
+        ; This can also be implemented using the
+        ; Installable LVM-flag I think.
+        ; But at the time I had lesser knowledge about LVM...
+        ; So this algorithm may change in the future.
+        ;
+        mov     byte ptr [Phase1Active],0   ; Clear phase1 indicator
+        mov     si, offset PartitionTable   ; Pointer to IPT
+        xor     cx,cx
+        mov     cl,[CFG_Partitions]         ; Partitions in IPT
+
+    ; Process next entry in IPT
+    MBR_Parts:
+        add     si, 4
+        ;push    si
+        ;push    si
+        ;call    MBR_TeletypeVolName
+        ;pop     si
+        call    PART_IsInstallVolume        ; Check if this is install-volume
+        jnc     MBR_Parts_NI
+
+        ;
+        ; Install Volume found
+        ;
+        mov     byte ptr [Phase1Active],1   ; Set phase1 indicator
+
+        mov     al,' '
+        mov     bl,7
+        mov     ah, 0eh
+        int     10h
+
+        mov     al,'('
+        mov     bl,7
+        mov     ah, 0eh
+        int     10h
+
+
+
+        mov     al,[CFG_Partitions]
+        sub     al,cl
+
+        mov     dh,al
+
+
+        mov     [CFG_PartAutomatic],al  ; Setup entry for install-volume
+        mov     [CFG_PartLast],al
+
+        add     al,'1'
+        mov     bl,7
+        mov     ah, 0eh
+        int     10h
+
+        mov     al,')'
+        mov     bl,7
+        mov     ah, 0eh
+        int     10h
+
+        ;mov     bx,cx       ; ????
+
+        mov     al,dh
+        stc
+        jmp     PART_SetupPhase1_found
+
+    MBR_Parts_NI:
+        ;xor     si,si
+        ;call    MBR_TeletypeNL
+        ;pop     si
+        add     si, 30      ; Add remainder of IPT entry
+        loop    MBR_Parts
+
+        mov     al,0ffh
+        clc
+
+    PART_SetupPhase1_found:
+
+        ret
+
+PART_SetupPhase1    EndP
+
+
+
+
+;~ PART_GetOldPartitionCount   Proc    Uses    cx dx di
+                ;~ mov     di,offset [PartitionXref]
+                ;~ mov     dx,LocIPT_MaxPartitions
+                ;~ mov     cx,dx
+                ;~ mov     al,0ffh
+                ;~ cld
+                ;~ repne   scasb
+                ;~ inc     cx
+                ;~ sub     dx,cx
+                ;~ mov     ax,dx
+                ;~ ret
+;~ PART_GetOldPartitionCount   EndP
+
+
+
+
+
+;~ HELEMAAL NAKIJKEN !
+;~ DRIVELETTER ASIGNMENT CORRIGEREN
+;~ WORDT TOCH BOOTDRIVE IN BPB GEZET ALS NON eCS SYSTEEM BOOT ?
+
+
+
+; ###################
+; # START PARTITION #
+; ###################
+
+; Starts Partition DL from Internal Partition Table.
+;        In: DL - Number of partition (filtered view)
+;       Out: No Return...
+; Destroyed: None, due to no return ;-)
+;     Logic: - Harddrive:   loads partition Table
+;                           sets partition active
+;                           saves partition table
+;                           hides partitions, if needed
+;                           Linux-Support, if needed
+;               load boot sector
+;               VIBR checking, if wanted
+;               install MBR Protection, if wanted
+;               Special Boot Support, if needed (OS/2 Extended partitions)
+;               Copy boot-sector to StartBase
+;               run boot sector...
+PART_StartPartition             Proc Near   Uses ax dx es di
+    ;
+    ; Local Storage for this much too large function.
+    ;
+    local BootPartNo:byte
+    local PhysDiskBpbIndex:word     ; Index into BPB to field of phys-disk
+    local FSType:byte               ; The FS used on the loaded BPB
+                                    ; Only used for FAT/HPFS/JFS
+    local LVMdl:byte                ; LVM drive-letter
+    local BPBdl:byte                ; BPB boot-drive-letter. (at 25h)
+
+
+    ; Get Partition-Pointer (SI) to Partition-To-Boot (DL).
+    ; DL is filtered partition number and thus uses the PPT.
+    ; Returned is the address of the IPT entry of the partition to boot.
+    call    PART_GetPartitionPointer
+
+
+    ;
+    ; SI now points to the IPT entry for the partition to be booted.
+    ;
+
+
+    ; This converts DL filered view to straight view, aka index into the IPT.
+    ; Needed for later.
+    ; Destroys AX,BX
+    call    PART_ConvertToStraight
+
+    ; Save for later use.
+    mov     [BootPartNo], dl
+    ; Straight - FFh -> Floppy boot
+    ;            FEh -> BIOS continue (CD-ROM, ZIP, etc.)
+
+    ; This converts the PPT to have pointers to all the IPT entries.
+    ; We need straight pointers from now on, so calculate the table...
+    ; Destroys AX,BX,CX
+    call    PART_CalculateStraightPartPointers
+
+
+
+    ; SI contains the pointer to the IPT to what partition to boot
+    ;  in this whole routine...it may never get messed up.
+
+    ; ------------------------------------------------- PRINT NAME BEING BOOTED
+
+    push    si
+        mov     dl, [si+LocIPT_Drive]       ; Disk where partition resides
+        mov     dh, [si+LocIPT_SystemID]    ; AB FileSystem ID (08=NTFS, FC=JFS)
+        ; Copy Partition-Name to BootingNow area for display purposes
+        add     si, LocIPT_Name             ; Advance to AB partition-name
+        mov     cx, 11                      ; Max. length of AB name/label
+        call    GetLenOfName                ; Returns CX with length of label
+        mov     di, offset TXT_BootingNowPartName
+        jz      PSP_NoName                  ; Don't copy if zero length label
+        rep     movsb                       ; Copy label-name to boot
+    PSP_NoName:
+        xor     al, al                      ; Null-terminate label-string
+        stosb              ; Ending Zero
+
+        ;
+        ; Display "Booting the system using "
+        ;
+        mov     si, offset TXT_BootingNow1
+        call    MBR_Teletype
+
+
+; [Linux support removed since v1.02]
+;      cmp     dh, 0FDh
+;      je      PSP_IsKernel
+
+        ;~ pusha
+        ;~ call    MBR_Teletype
+        ;~ mov     si,offset TXT_BootingNowPartName
+        ;~ call    MBR_Teletype
+        ;~ popa
+
+
+        ;
+        ; DL will be zero for floppy-disk or 80h+ for harddisk.
+        ; Note thus that DL contains the BIOS disk numer and not the AB value
+        ; for floppy or cdrom.
+        ;
+        or      dl, dl
+        jnz     PSP_IsHarddisc
+
+        ; When booting floppy/CD-ROM/etc., we got other text to be displayed...
+        mov     si, offset TXT_BootingNowPartName
+        call    MBR_TeletypeVolName
+        jmp     PSP_IsFloppyCDROMetc                                                ; JUMPS BUITEN SI POP !!! AANPASSEN
+
+
+; [Linux support removed since v1.02]
+;    PSP_IsKernel:
+;      IFDEF ReleaseCode
+;         ; Save configuration on HDD boots (save CFG_LinuxLastKernel)
+;         call    DriveIO_SaveConfiguration
+;      ENDIF
+;      call    MBR_Teletype       ; Prints out BootingNow2 including KernelName
+;      mov     si, offset TXT_BootingNowKernel
+;      call    MBR_Teletype
+;      jmp     PSP_IsFloppyCDROMetc
+
+
+    PSP_IsHarddisc:
+
+
+    IFDEF ReleaseCode
+        ;
+        ; Save configuration on HDD boots (save CFG_PartLast)
+        ;
+        call    DriveIO_SaveConfiguration
+    ENDIF
+
+
+        ;
+        ; Prints out BootingNow2 including PartitionName
+        ;
+        mov     si, offset TXT_BootingNowPartName
+        call    MBR_TeletypeVolName
+        mov     si, offset TXT_BootingNowPartition
+        call    MBR_Teletype
+
+    ; restores SI (IPT-pointer)
+    pop     si
+
+
+
+    ;
+    ; Get the CHS and LBA location of sector containing
+    ; the partition-table for the partition.
+    ;
+    mov     ax, wptr [si+LocIPT_AbsolutePartTable+0]
+    mov     bx, wptr [si+LocIPT_AbsolutePartTable+2]
+    mov     cx, wptr [si+LocIPT_LocationPartTable+1]
+    mov     dh, bptr [si+LocIPT_LocationPartTable+0]
+    mov     dl, [si+LocIPT_Drive]
+
+IFDEF   AUX_DEBUG
+    pusha
+    mov     si,offset ptetb
+    call    AuxIO_Print
+    call    DEBUG_DumpRegisters
+    call    AuxIO_TeletypeNL
+    mov     ax, word ptr [FreeDriveletterMap+00h]
+    mov     dx, word ptr [FreeDriveletterMap+02h]
+    call    AuxIO_TeletypeBinDWord
+    popa
+ENDIF
+
+
+    ;
+    ; This loads the MBR in case of PRI or the EBR in case of LOG partitions.
+    ;
+    ; BOOKMARK: PBR/EBR loading
+    call    DriveIO_LoadPartition         ; Load Table...                [LOAD]
+
+
+    ; -------------------------------------------------- MODIFY PARTITION TABLE
+
+    ; Make sure ES is correctly setup.
+    push    cs
+    pop     es
+
+    ; ES:DI - First Partitionentry
+    mov     di, offset PartitionSector+446
+
+    ; Remove all active-flags for safety reasons, primary partition table will
+    ; have one partition set active by ScanPartition-routine.
+    push    di
+        mov      cl, 4
+    PSP_RemoveActiveFlagLoop:
+        and      bptr es:[di+LocBRPT_Flags], 7Fh
+        add      di, LocBRPT_LenOfEntry
+        dec      cl
+        jnz      PSP_RemoveActiveFlagLoop
+    pop     di
+
+
+    ;
+    ; Put the partition-to-be-booted location into registers...
+    ;
+    mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
+    mov     bx, wptr [si+LocIPT_AbsoluteBegin+2]
+    sub     ax, wptr [si+LocIPT_AbsolutePartTable+0]
+    sbb     bx, wptr [si+LocIPT_AbsolutePartTable+2]
+
+
+    ; BX:AX - absolute position of partition relative to partition table
+    ; ...and search for it...
+    PSP_SearchLoop:
+        cmp     ax, wptr es:[di+LocBRPT_RelativeBegin]
+        jne     PSP_SearchMismatch
+        cmp     bx, wptr es:[di+LocBRPT_RelativeBegin+2]
+        jne     PSP_SearchMismatch
+        jmp     PSP_SearchMatch
+    PSP_SearchMismatch:
+        add     di, LocBRPT_LenOfEntry     ; 16 Bytes per Partition-Entry
+        cmp     di, 500+offset PartitionSector
+        jb      PSP_SearchLoop
+
+        ;
+        ; Entry not found, Halt System.
+        ;
+        jmp     MBR_HaltSystem
+
+    ; ------------------------------------------------------------- ENTRY FOUND
+    PSP_SearchMatch:
+        or      byte ptr es:[di+LocBRPT_Flags], 80h ; set ACTIVE partition
+
+
+
+    IFDEF ReleaseCode
+        ;
+        ; Save the Partition Table.
+        ;
+        call    DriveIO_SavePartition     ; Saves the Partition-Table    [SAVE]
+    ENDIF
+
+
+
+    ; --------------------------------------------------------- OS/2 / eCS I13X
+    ; Now check if the partition to get booted is above 8 GB.
+    ;  If yes, set magic bytes 'I13X' at 3000:0 for boot-loader to recognize.
+    ;  This method is (c) by IBM <g>
+    ; Rousseau: Booting IBM-BM also requires the LBA address of the IBM-BM
+    ; partitionafter the 'I13X' signature.
+    ; Also, FS needs to be set to 3000H.
+    ; This info was obtained by examining the LVM 2,x MBR-code.
+    mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
+    mov     bx, wptr [si+LocIPT_AbsoluteBegin+2]
+    add     ax, wptr es:[di+LocBRPT_AbsoluteLength+0] ; Add length to absolute
+    adc     bx, wptr es:[di+LocBRPT_AbsoluteLength+2] ; begin location
+    ; BX:AX -> Absolute End-Position of Partition
+
+
+    ;
+    ; Always use INT13X v1.0.8+.
+    ;
+    ;~ test    byte ptr [CFG_ForceLBAUsage], 1
+    ;~ jnz     PSP_ForceI13X
+    jmp     PSP_ForceI13X
+
+    ; LBA-boundary at 16450560 (FB0400h) (16320x16x63)
+    cmp     bx, 00FBh
+    jb      PSP_NoI13X
+
+    ;
+    ; BOOKMARK: Setup 'I13X' signature.
+    ;
+    PSP_ForceI13X:
+        push    es
+        push    di
+        push    si
+
+            ; Setup ES and FS.
+            ; FS needs to keep this address.
+            mov     ax, 3000h
+            mov     es, ax
+            ; mov fs,ax
+            db  08eh
+            db  0e0h
+
+            ; Insert signature
+            xor     di, di
+            mov     word ptr es:[di+00], '1I'
+            mov     word ptr es:[di+02], 'X3'
+
+            ;mov     wptr es:[di], 0
+            ;mov     wptr es:[di+2], 0
+
+            ; Insert LBA address.
+            mov     ax, [si+LocIPT_AbsoluteBegin+0]
+            mov     es:[di+04], ax
+            mov     ax, [si+LocIPT_AbsoluteBegin+2]
+            mov     es:[di+06], ax
+
+        pop     si
+        pop     di
+        pop     es
+
+
+
+    PSP_NoI13X:
+
+        ; now check, if we need to hide any partition
+        test    byte ptr [si+LocIPT_Flags], Flags_HideFeature
+        jz      PSP_NoHideFeature
+
+        ; ---------------------------------------------------- PARTITION HIDING
+
+        ; display "hide active"
+        push    si
+            mov     si, offset TXT_BootingHide
+            call    MBR_Teletype
+        pop     si
+
+
+        ; First, find Hide-Config
+        mov     dl, [BootPartNo]           ; EntryNumber is straight view
+        ;~ mov     ax, LocIPT_MaxPartitions
+        mov     ax, LocHPT_LenOfHPT
+        mul     dl
+        mov     di, offset HidePartitionTable
+        add     di, ax                     ; We got the pointer
+
+
+        ; So process Hide-Config. Read out Bitfield-Entries,
+        ; each points to a partition.
+        ; 3Fh is end-marker / maximum entries = CFG_Partitions
+        mov     cl, [CFG_Partitions]
+        mov     ch,0        ; Index in bitfield array.
+        mov     dh,6        ; Bitfield width.
+        mov     bx,di       ; Pointer to entry.
+
+    PSP_PartitionsHideLoop:
+        mov     dl,ch
+        call    CONV_GetBitfieldValue
+        mov     dl,al
+
+        ;~ mov     dl, es:[di]
+        ;~ inc     di
+        ;~ cmp     dl, 0FFh
+        cmp     dl,3fh  ; Max value for 6-bits field.
+        je      PSP_EndOfHideProcess    ; -> End of Hiding
+        call    PART_HidePartition      ; Now hide that partition
+        inc     ch      ; Next bitfield.
+        dec     cl
+        jnz     PSP_PartitionsHideLoop
+
+
+    PSP_EndOfHideProcess:
+
+        ; --- HIDE COMPLETED ---
+        ; So something got hidden and we have to remark a primary partition,
+        ;  if we are booting something non-primary from 1st hdd.
+        cmp     bptr [si+LocIPT_Drive], 80h
+        ja      PSP_HideAdjustPrimaryMark  ; When booting any hdd, but 1st
+        mov     ax, wptr [si+LocIPT_AbsolutePartTable]
+        mov     bx, wptr [si+LocIPT_AbsolutePartTable+2]
+        or      ax, ax
+        jnz     PSP_HideAdjustPrimaryMark  ; or booting non-primary partition
+        or      bx, bx                     ;  on 1st harddrive.
+        jz      PSP_NoHideAdjustPrimaryMark
+
+    PSP_HideAdjustPrimaryMark:
+        ; Load Primary Partition Table...
+        xor     ax, ax
+        xor     bx, bx
+        mov     cx, 0001h                  ; Cylinder 0, Sector 1
+        mov     dx, 0080h                  ; First HD, Head 0
+                                                                     ; Load MBR
+        call    DriveIO_LoadPartition      ; Load Primary Partition Table
+        call    PART_MarkFirstGoodPrimary
+
+    IFDEF ReleaseCode
+        call    DriveIO_SavePartition       ; Saves the Partition-Table
+    ENDIF
+
+
+    PSP_NoHideAdjustPrimaryMark:
+
+
+    PSP_NoHideFeature:
+        ; Check, if we are supposed to ignore LVM altogether...
+        test    byte ptr [CFG_IgnoreLVM], 1
+        jnz     PSP_NoLVMReassignment
+
+        ; ---------------------------------------------------- LVM REASSIGNMENT
+
+        ; Driveletter must be set for this partition
+        test    byte ptr [si+LocIPT_Flags], Flags_DriveLetter
+        jz      PSP_NoLVMReassignment
+        ;movzx   bx, BootPartNo              ; EntryNumber is straight view
+        mov     bl,[BootPartNo]               ; EntryNumber is straight view
+        mov     bh,0
+
+        mov     al, bptr [DriveLetters+bx]
+        sub     al, 3Dh                     ; Convert e.g. 80h -> 'C'
+        cmp     al, bptr [PartitionVolumeLetters+bx]
+
+
+        ;~ je      PSP_NoLVMReassignment   ; If driveletters match -> no change
+        ; Rousseau:
+        ; But there can still be other partitions with the same drive-letter.
+        ; For instance if the user did an advanced installation with multiple
+        ; eComStation systems using the same boot-drive-letter.
+        ; So, even if the drive-letter forced is the same as the
+        ; partition-volume-letter, other partitions still need to be checked
+        ; and possibly hidden. So we always do the drive-letter reassignment,
+        ; which is enhanced to keep data-partitions (those -not- in the Menu)
+        ; visible. So the 'je' instruction above is commented-out.
+
+
+        ;
+        ; Give partition SI letter AL
+        ;
+        call    LVM_DoLetterReassignment
+
+
+
+
+    PSP_NoLVMReassignment:
+        push    si
+        ; -------------------------------------------------- -"PLEASE WAIT..."-
+    PSP_IsFloppyCDROMetc:
+            mov     si, offset TXT_BootingWait
+            call    MBR_Teletype               ; display "please wait"                      ; SI staat nog op stack; aanpassen !!!!
+        pop     si
+
+        ; Process Partition Tables, if M$-Hack required (changes Ext Part Type)
+        call    MSHACK_ProcessPartTables
+
+        test    byte ptr [CFG_BootMenuActive], 0FFh
+        jz      PSP_NoMenuNoSound
+
+        ; ---------------------------------------------------------- BOOT-SOUND
+        call    SOUND_ExecuteBoot
+
+    PSP_NoMenuNoSound:
+
+        ; --------------------------------------------- SPECIAL BOOT PROCESSING
+        ; Check here, if the Boot shall be done via resume to BIOS...
+        mov     al, byte ptr [si+LocIPT_SystemID]
+        cmp     al, 0FEh        ; Via BIOS ? (aka resume BIOS boot sequence)
+        je      PSP_ResumeBIOSbootSeq
+
+; [Linux support removed since v1.02]
+;   cmp     al, 0FDh                        ; Kernel-Booting ?
+;   je      PSP_KernelBooting
+
+        jmp     PSP_StartNormal
+
+    PSP_ResumeBIOSbootSeq:
+        int     18h                         ; Give control back to BIOS
+        db      0EAh                        ; if return to here -> Reboot
+        dw      0FFF0h
+        dw      0F000h
+
+; [Linux support removed since v1.02]
+;  PSP_KernelBooting:
+;   call    LINUX_LoadKernel              ; DS:SI - Entry Pointer to Kernel
+;   db      0EAh                          ; if return to here -> Reboot
+;   dw      0FFF0h
+;   dw      0F000h
+
+
+
+    ; =======================================================================
+    ;  FROM THIS POINT ON, ONLY DS and SI REGISTER IS NEEDED TO BE PRESERVED
+    ; =======================================================================
+
+    PSP_StartNormal:
+        mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
+        mov     bx, wptr [si+LocIPT_AbsoluteBegin+2]
+        mov     cx, [si+LocIPT_LocationBegin+1]
+        mov     dh, [si+LocIPT_LocationBegin+0]
+        mov     dl, [si+LocIPT_Drive]
+
+        ; This loads the PBR of the partition.
+        call    DriveIO_LoadPartition   ; Loads boot-sector...   [PARTBOOTSEC]
+
+        ;
+        ; The JFS PBR-code does not use the passed BPB in memory but uses the BPB
+        ; on disk. This breaks the drive-letter feature on JFS.
+        ; So we make a copy of the PBR in memory, and if the partition is JFS
+        ; we later adjust the physical-disk and boot-drive-letter in this
+        ; copy and write it back to disk.
+        ; Then the JFS PBR-code will see the correct boot-drive-letter.
+        ;
+        pusha
+            mov     si,offset [PartitionSector]
+            mov     di,offset [PBRSector]
+            mov     cx,100h
+            cld
+            rep     movsw
+        popa
+
+
+
+        ; Check if the disk is a harddisk or a floppy.
+        mov     dl,[si+LocIPT_Drive]
+        cmp      dl, 80h
+        jae      is_harddisk
+
+        ;
+        ; This is a dirty hack to fix booting from a floppy.
+        ; With all the modifications made since v1.06 this feature was broken
+        ; because Int13X is used implicitly now, and that does not work
+        ; for diskette access.
+        ; This jumps to the code that loads and starts the pbr-code.
+        ; Note that it also skips virus checking !
+        ; This will be fixed at a later date.
+        jmp     boot_from_floppy
+
+    ;
+    ; The disk is a harddisk so we need to do various checks and fixes.
+    ;
+    is_harddisk:
+
+        test    byte ptr [CFG_DetectVIBR], 1
+        jz      PSP_NoVIBR
+        test    byte ptr [si+LocIPT_Flags], Flags_VIBR_Detection
+        jz      PSP_NoVIBR
+
+
+        ; ----------------------------------------------------- CHECKS FOR VIBR
+        ; BOOKMARK: Check for virus in PBR
+        push    si
+            mov     si, offset PartitionSector
+            mov     bx, 4B4Dh               ; Magic: 'MK'
+            call    MBR_GetCheckOfSector
+        pop     si
+
+        cmp     [si+LocIPT_BootRecordCRC], bx
+        je      PSP_NoVIBR
+        mov     bx, [si+LocIPT_BootRecordCRC]
+        or      bx, bx
+        jz      PSP_NoVIBR
+        ; Oh Oh, got a virus :(
+        mov     si, offset TXT_VirusFoundMain
+        call    MBR_Teletype
+        mov     si, offset TXT_VirusFound2 ; VIBR-Virus
+        call    MBR_Teletype
+        mov     si, offset TXT_VirusFoundEnd
+        call    MBR_Teletype
+        jmp     MBR_HaltSystem
+
+    PSP_NoVIBR:
+       test    byte ptr [CFG_ProtectMBR], 1
+       jz      PSP_NoMBRprotect
+        ; --------------------------------------------- INSTALLS MBR-PROTECTION
+        ; We need DS:SI later...
+        push    ds
+        push    si
+
+            ; First subtract 1024 bytes from Base-Memory...
+            push    ds
+                mov     ax, 40h
+                mov     ds, ax
+                mov     dx, word ptr ds:[13h]
+                dec     dx                      ; 1 == 1kbyte
+                mov     word ptr ds:[13h], dx
+            pop     ds
+            shl     dx, 6                      ; trick, now DX is a segment
+
+            ; Now copy in our code (to DX:0)...
+
+            mov     si, offset MBR_Protection  ; DS:SI - Source Image
+            mov     es, dx
+            xor     di, di                     ; ES:DI - Destination
+            ;~ mov     cx, 512
+            mov     cx, 384
+            rep     movsw                      ; Move 768 bytes...
+
+            ; Now fill in variables...
+
+            xor     ax, ax
+            mov     ds, ax
+            mov     si, 10h*4
+            xor     di, di                     ; INT 10h Vector to MBR Protection
+            ;movsd
+            movsw
+            movsw
+
+            mov     si, 13h*4                  ; INT 13h Vector to MBR Protection
+            ;movsd
+            movsw
+            movsw
+
+            mov     al, CFG_IgnoreWriteToMBR   ; Option to MBR Protection
+            stosb
+
+            ; Now switch INT 13h vector to MBR Protection
+
+            sub     si, 4
+            mov     ax, 9
+            mov     ds:[si], ax
+            mov     ds:[si+2], dx              ; Vector hardcoded at DS:0009
+            ; MBR-Protection now active :)
+
+        ; Restore DS:SI
+        pop     si
+        pop     ds
+
+
+
+    PSP_NoMBRprotect:
+
+        ; Display volume-name in bold
+        ; Just before booting the selected partition
+        ;pushf
+        ;pusha
+        ;push    si
+        ;add     si, LocIPT_Name
+        ;call    MBR_TeletypeVolName
+        ;xor     si,si
+        ;call    MBR_TeletypeNL
+        ;pop     si
+        ;popa
+        ;popf
+
+
+
+
+
+   ; ------------------------------------------------ SPECIAL PARTITION SUPPORT
+   ; needed by OS/2 Warp / eComStation
+
+
+        ;cmp     byte ptr [si+LocIPT_SystemID],08    ; I hate Microsuck NTFS check
+        mov     di, offset PartitionSector ; ES:DI - Actual Boot-Record
+
+        ; Special Support Detection
+        ;mov     ax, word ptr es:[di+18h]
+        ;cmp     ax, 003Fh                  ; Physical Layout-Sectors... Safety check
+
+
+
+        ;
+        ; At this point, SI points to IPT and DI points to the PBR from disk.
+        ; Depending on the type of BPB used, the physical disk field is at
+        ; different locations: 24h for old-style (OS/2) BPB's and 40h for
+        ; FAT32 BPB's.
+        ; The OS/2 boot-drive-letter is located at 25h in an old-style BPB,
+        ; while the corresponding field in a FAT32 BPB is located at 41h but
+        ; used for different purposes.
+        ; In case of HPFS, using old-style BPB's, the boot-drive-letter needs
+        ; to be adjusted if it is zero.
+        ; In that case we trace the LVM-info for that partition and use the
+        ; drive-letter defined there.
+        ; This fixes issues #3067 and #3119.
+        ; Adjusting the physical disk is always done but at different locations
+        ; depending on the BPB used.
+        ; Also, the "hidden sectors" field is adjusted to contain the absolute
+        ; offset from the start of the disk instead of the relative offset to
+        ; the start of the partition.
+        ; http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/bios-parameter-block.html
+        ;
+
+
+        ; Get index of phys-disk field in BX
+        call    PART_GetFieldIndex
+        mov     [PhysDiskBpbIndex],ax
+        mov     bx,ax
+
+        ; Locate cursor for output of debug-info
+        ;~ pusha
+        ;~ mov     ch,7
+        ;~ mov     cl,0
+        ;~ call    VideoIO_Color
+        ;~ mov     ch,6
+        ;~ mov     cl,1
+        ;~ call    VideoIO_Locate
+        ;~ popa
+
+
+        ; Debug display physdisk, ptype and physdisk offset in BPB
+        ;~ pusha
+        ;~ mov     ah,[si+LocIPT_Drive]
+        ;~ mov     al,[si+LocIPT_SystemID]
+        ;~ call    VideoIO_PrintHexWord
+        ;~ mov     ax,bx
+        ;~ call    VideoIO_PrintHexWord
+        ;~ mov     ax,[si+LocIPT_AbsolutePartTable+02]
+        ;~ call    VideoIO_PrintHexWord
+        ;~ mov     ax,[si+LocIPT_AbsolutePartTable+00]
+        ;~ call    VideoIO_PrintHexWord
+        ;~ mov     al,[ExtendedAbsPosSet]
+        ;~ call    VideoIO_PrintHexByte
+        ;~ mov     al,'-'
+        ;~ call    VideoIO_PrintSingleChar
+        ;~ mov     al,byte ptr [Menu_EntrySelected]
+        ;~ call    VideoIO_PrintHexByte
+        ;~ mov     al,byte ptr [CFG_PartAutomatic]
+        ;~ call    VideoIO_PrintHexByte
+        ;~ mov     al,byte ptr [Phase1Active]
+        ;~ call    VideoIO_PrintHexByte
+        ;~ mov     al,byte ptr [NewPartitions]
+        ;~ call    VideoIO_PrintHexByte
+        ;~ mov     al, byte ptr [OldPartitionCount]
+        ;~ call    VideoIO_PrintHexByte
+        ;~ popa
+
+
+        ;
+        ; If the partition is IBM-BM we skip all the BPB adjustments.
+        ; IBM-BM does no need them.
+        ;
+        cmp     byte ptr [si+LocIPT_SystemID], 0ah
+        jnz     no_os2_bm
+        jmp     chainload_ibm_bm
+
+
+    no_os2_bm:
+
+        ;
+        ; Update the phys-disk field
+        ; DI points to PartitionSector
+        ; BX holds index to phys-disk field
+        ;
+        mov     al,byte ptr [si+LocIPT_Drive]                                       ; Moet dit niet later gebeuren ??? (NT/WIN LDR hangs)
+        mov     es:[di+bx],al
+
+
+        ;
+        ; Legacy systems do not put the correct values in the "hidden sectors"
+        ; field. Also, this field will be incorrect if a partition is moved on
+        ; disk by a disktool not accounting for this field.
+        ; Linux does not have a BPB at all, and does not use this field.
+        ; So we set the correct value here obtained by the partition scanner.
+        ; This fixing is done by OS/2 BM as well, according to Martin.
+        ;
+
+        ; BOOKMARK: Fix hidden sectors field
+        mov     ax,[si+LocIPT_AbsoluteBegin]
+        mov     es:[di+1ch], ax     ; Low word of 32-bits "hidden sectors"
+
+        mov     ax,[si+LocIPT_AbsoluteBegin+2]
+        mov     es:[di+1eh], ax     ; High word of 32-bits "hidden sectors"
+
+        ;
+        ; Check partitions to see if boot-drive-letter fixing is needed.
+        ; FAT12/FAT16/HPFS/JFS will have the value at 25h fixed
+        ; to the LVM-info drive-letter. (+3dh to convert to BIOS notation)
+        ;
+
+
+        ; Setup partition disk and LBA address
+        mov     dl,byte ptr [si+LocIPT_Drive]
+        mov     cx,[si+LocIPT_AbsoluteBegin+00h]
+        mov     bx,[si+LocIPT_AbsoluteBegin+02h]
+
+        ; AL is gonna be used to shift-in CY status.
+        ; If the type of file-system is one of FAT12/FAT16/HPFS/JFS then
+        ; AL will be <> 0 and the boot-drive-letter can be tested / fixed.
+        mov     al,0
+
+
+        ;
+        ; The PBR is already loaded, no need to load it again in the
+        ; calls below.
+        ;
+        ; Better use the already done discovery to determine the system.
+        ;
+        ; FIXME: PBR Already loaded
+        
+        ; When FAT12/FAT16/HPFS/JFS then boot-drive-letter can be tested
+        ; or adjusted.
+        call    PART_IsJFS
+        rcl     al,1
+        call    PART_IsHPFS
+        rcl     al,1
+        call    PART_IsFAT
+        rcl     al,1
+        mov     ah,al
+
+        ; Store for later reference.
+        mov     [FSType],al
+
+
+        ;
+        ; When the phys-disk byte (80h) is put in this BPB in RAM,
+        ; Windows will not find it's loader if Windows itself
+        ; is installed in a logical partition but the loader is on FAT
+        ; in a primary.
+        ; This goes for all NT-based versions ?
+        ;
+
+
+        ;
+        ; See if phys-disk / boot-drive-letter fix is needed
+        ; depending on FS used.
+        ; AL will be 0 for any file-system other than FAT12/FAT16/HPFS/JFS.
+        ; In that case no fixing of boot-drive-letters is needed.
+        ;
+        test    al,al
+        jz      bdl_ok
+
+
+        ;
+        ; We have a partition that potentially can have incorrect values
+        ; for the boot-drive-letter or incorrect LVM drive-letters.
+        ;
+        ; The boot-drive-letter can be zero as the result of copying / moving
+        ; partitions or restoring a HPFS system from archive.
+        ; In that case the LVM drive-letter is used if present.
+        ;
+        ; Incorrect LVM drive-letters are the result of the drive-letter
+        ; reassign function when two or more eComStation installations use the
+        ; same boot-drive-letter.
+        ; In that case the boot-drive-letter is assigned to the
+        ; LVM drive-letter.
+        ;
+        ; If both are zero there is no way to obtain the correct
+        ; boot-drive-letter value. The user needs to examine CONFIG.SYS and
+        ; force that letter for the partition.
+        ;
+
+
+
+
+
+        ;
+        ; Get the drive-letter for the partition from the LVM-info.
+        ; Returns CY=1 if AL contains drive-letter, CY=0 and AL=0 if
+        ; no letter assigned (hidden) or no LVM info found.
+        ;
+        mov     dl,byte ptr [si+LocIPT_Drive]
+        mov     cx,[si+LocIPT_AbsoluteBegin+00h]
+        mov     bx,[si+LocIPT_AbsoluteBegin+02h]
+        call    LVM_GetDriveLetter
+
+
+        ; Save for later use.
+        mov     byte ptr [LVMdl], al
+
+        ; See if the drive-letter feature is active.
+        ; If active, we force the drive-letter from the user.
+        test    byte ptr [si+LocIPT_Flags], Flags_DriveLetter
+
+        ; Nope, it's not so we don't force the boot-drive-letter.
+        jz      PSP_NoLogicalSupport
+
+        ; Partition index in BX
+        mov     bl,[BootPartNo]     ; EntryNumber is straight view
+        mov     bh,0
+
+        ; Get the user specified boot-drive-letter.
+        ; 80h notation.
+        mov     al, bptr [DriveLetters+bx]
+
+        ; Safety check for zero value.
+        test    al,al
+        jz      PSP_NoValidUserDriveLetter
+
+        ; Convert 80h notation to ASCII.
+        sub     al,3dh              ; 80h - 3dh = 43h = 'C', etc.
+
+    PSP_NoValidUserDriveLetter:
+        ; Here we misuse the LVM-dl storage to store the user forced
+        ; or zero drive-letter.
+        mov     byte ptr [LVMdl], al
+
+
+    PSP_NoLogicalSupport:
+
+        ; A possibly valid drive-letter has been obtained from either
+        ; LVM-info or the drive-letter feature.
+        ; It's in [LDMdl] local storage.
+
+
+
+        ;
+        ; Get the boot-drive-letter from the BPB of the partition.
+        ;
+        mov     bx, [PhysDiskBpbIndex]
+        inc     bx
+        mov     al,es:[di+bx]       ; 80h=C:,81h=D:, etc.
+        ; Store it for later use
+        mov     byte ptr [BPBdl], al
+
+
+        ; See if both the LVM drive-letter and the BPB drive-letter are zero.
+        ; If so, then we have a problem.
+        ; No valid drive-letter can be obtained and the user has to examine
+        ; CONFIG.SYS and set that letter in the drive-letter feature
+        ; for the partition.
+        mov     ah,al
+        mov     al, byte ptr [LVMdl]
+        or      al,ah
+        jz      no_valid_boot_drive_letter_found
+
+
+        ; See if both the LVM drive-letter and the BPB drive-letter are
+        ; the same. In that case we should have a valid situation and no
+        ; adjustments need to be made.
+        cmp     al,ah
+        jz      PSP_valid_boot_drive
+
+
+        ;
+        ; Ok, at least one of them is valid.
+        ;
+
+        ; See if the BPB boot-drive-letter is valid
+        ; This one is supposed not to change since eCS cannot be booted
+        ; from another drive then it was installed on.
+        test    ah,ah
+        jnz     BPB_boot_drive_valid
+
+        ; Nope it's not.
+        ; So we use the LVM drive-letter for the BPB boot-drive-letter.
+        ; Convert to BIOS notation ('C'+3dh=80h, 'D'->81h, etc.)
+        ; This is where the user can fix this issue by using the
+        ; drive-letter feature.
+        add     al,3dh
+        mov     bx,[PhysDiskBpbIndex]
+        ; Advance to field for drive-letter in BIOS notation (OS/2 - eCS)
+        inc     bx
+        ; Fix the boot-drive-letter field in the BPB
+        mov     es:[di+bx],al
+
+        jmp     PSP_valid_boot_drive
+
+        ;
+        ; OS/2 uses this field to indicate the boot-drive-letter for the system.
+        ; It is in BIOS notation where 80h='C', 81h='D' ... 97h='Z'.
+        ; This is the field that get's forced to a specific value when the
+        ; drive-letter feature of AiR-BOOT is used.
+        ; Also, this field is the culprit of AiR-BOOT v1.07 not handling it
+        ; correctly when the system uses HPFS and this byte is zero.
+        ; This mostly involved booting older eCS versions on HPFS.
+        ; See issues #3067 and #3119 on http://bugs.ecomstation.nl
+        ;
+
+
+    ;
+    ; Here we enter when the LVM drive-letter is zero or not the same
+    ; as the BPB boot-drive-letter.
+    ; This can be the case when booting a hidden partition, LVM-dl = zero,
+    ; or the LVM-dl was reassigned because another system with the same
+    ; drive-letter was booted previously.
+    ; In any case, we set the LVM drive-letter to the BPB boot-drive-letter
+    ; so the system can be booted.
+    ; Driveletters on other partitions have already been reassigned by the
+    ; reassignement-procedure earlier.
+    ;
+    BPB_boot_drive_valid:
+
+
+
+
+        ;
+        ; ALWAYS SET LVM to BPB
+        ;
+        ;~ mov     dl,byte ptr [si+LocIPT_Drive]
+        ;~ mov     cx,[si+LocIPT_AbsoluteBegin+00h]
+        ;~ mov     bx,[si+LocIPT_AbsoluteBegin+02h]
+        ;~ mov     al,[BPBdl]
+        ;~ sub     al,3dh
+        ;~ call    LVM_SetDriveLetter                                                                  ; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
+        ;
+        ; ALWAYS SET BPB to LVM
+        ;
+        mov     dl,byte ptr [si+LocIPT_Drive]
+        mov     cx,[si+LocIPT_AbsoluteBegin+00h]
+        mov     bx,[si+LocIPT_AbsoluteBegin+02h]
+        call    LVM_GetDriveLetter                                                                  ; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        add     al,3dh
+        mov     bx,[PhysDiskBpbIndex]
+        inc     bx
+        mov     es:[di+bx],al
+
+
+    update_PBR:
+
+
+
+    ;
+    ; Here both the boot-drive-letter and the LVM drive-letter are zero.
+    ; So the only way to determine the drive-letter is to examine CONFIG.SYS.
+    ; Then force that drive-letter in the drive-letter feature.
+    no_valid_boot_drive_letter_found:
+        ; HERE SHOULD COME AN ERROR POP-UP ABOUT NO BOOT-DRIVE OR NO LVM-INFO.
+        ; WE CONTINUE BOOTING BUT OS/2 - eCS WILL MOST PROBABLY FAIL TO BOOT.
+
+        ; FIXME: Issue some kind of warning
+        
+        ;mov     ah,07h
+        ;mov     si,offset CheckID_MBR
+        ;call    VideoIO_Print
+
+    hang:
+        ;jmp     hang
+
+
+
+
+    PSP_valid_boot_drive:
+
+
+
+
+    ;
+    ; Boot DriveLetter OK.
+    ;
+    bdl_ok:
+
+
+IFDEF   AUX_DEBUG
+    pusha
+    call    AuxIO_TeletypeNL
+    mov     bx, [PhysDiskBpbIndex]
+    inc     bx
+    mov     al, [di+bx]
+    call    AuxIO_TeletypeHexByte
+    mov     bl,[BootPartNo]
+    mov     al, [DriveLetters+bx]
+    call    AuxIO_TeletypeHexByte
+    mov     al, [PartitionVolumeLetters+bx]
+    add     al, 3dh
+    call    AuxIO_TeletypeHexByte
+    mov     al, [LVMdl]
+    add     al, 3dh
+    call    AuxIO_TeletypeHexByte
+    mov     al, [si+LocIPT_SystemID]
+    call    AuxIO_TeletypeHexByte
+    mov     al,[FSType]
+    call    AuxIO_TeletypeHexByte
+    popa
+ENDIF
+
+        ;
+        ; If the partition getting booted is a JFS partition then write-back
+        ; the modified PBR to the disk.
+        ; Note that it's not the in-memory PBR that get's written back, but
+        ; a copy of the original where only the phys-disk and boot-drive-letter
+        ; are adjusted.
+        ;
+        pusha
+        mov     al,[FSType]
+        cmp     al,04h      ; JFS
+        je      write_back_pbr
+        cmp     al,02h      ; HPFS
+        je      write_back_pbr
+
+        jmp     no_jfs_pbr
+
+
+    write_back_pbr:
+
+        ; Save IPT pointer
+        push    si
+
+        ; Copy the boot-drive and boot-drive-letter fields.
+        mov     si,offset [PartitionSector]
+        mov     di,offset [PBRSector]
+        mov     al,[si+24h]
+        mov     [di+24h],al
+        mov     al,[si+25h]
+        mov     [di+25h],al
+
+        ; Restore IPT pointer
+        pop     si
+
+        
+        ; BOOKMARK: Update the CRC of the Partition Boot Record.
+        mov     bx, offset [PBRSector]
+        call    PART_UpdateBootRecordCRC
+        call    DriveIO_SaveConfiguration
+
+        
+        ; Setup the registers for the partition location.
+        mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
+        mov     bx, wptr [si+LocIPT_AbsoluteBegin+2]
+        mov     cx, [si+LocIPT_LocationBegin+1]
+        mov     dh, [si+LocIPT_LocationBegin+0]
+        mov     dl, [si+LocIPT_Drive]
+
+        
+        ; BOOKMARK: Write the adjusted HPFS/JFS PBR to disk.
+        mov     si, offset [PBRSector]
+        call    DriveIO_SaveSector
+
+    no_jfs_pbr:
+        popa
+
+
+
+    ; ----------------------------------------------- LOGICAL PARTITION SUPPORT
+
+
+
+    ; AiR-BOOT now works around it by using the LVM-info (DLAT) of
+    ; the partiton if present.
+    ; Note however that if the drive-letter feature is active,
+    ; this will override AB's automatic fixing.
+    ;
+    ; Test if the drive-letter feature is active for this partition.
+    ; If so, then the drive that the user defined will be placed at
+    ; byte 25h (37d) of the in-ram PartitionSector (BPB).
+    ; (BIOS 80h notation: 80h=C, 81h=D, etc.)
+    ; This is a remedy for when the corresponding field (25h) in the BPB on
+    ; disk is zero.
+    ;
+
+
+
+    ;
+    ; Control is transferred to this point if we are booting IBM-BM.
+    ; IBM-BM does not need the BPB fixes.
+    ; It does require a other special stuff, which is already taken care of.
+    ;
+    chainload_ibm_bm:
+
+    ;
+    ; Control is transferred to this point if we are booting a floppy.
+    ; Booting from floppy skips all the harddisk related stuff.
+    ; This is a dirty hack to fix the boot from floppy feature.
+    ;
+    boot_from_floppy:
+
+
+    
+
+        ;
+        ; Here we copy the prepared boot-record to 0000:7C00h
+        ; to give it control later on.
+        ;
+        push    es
+        push    si
+        mov     ax, StartBaseSeg
+        mov     es, ax
+        mov     cx, 256
+        mov     si, offset PartitionSector
+        mov     di, StartBasePtr
+        cld
+        rep     movsw
+        pop     si
+        pop     es
+
+    ; --------------------------------------------------- NOW START BOOT-RECORD
+
+
+
+
+    IFDEF   AUX_DEBUG
+        pusha
+        call    DEBUG_Dump2
+        ;~ call    DEBUG_DumpBSSSectors
+        call    DEBUG_DumpDriveLetters
+        call    DEBUG_DumpVolumeLetters
+        call    AuxIO_TeletypeNL
+        popa
+    ENDIF
+
+
+
+;
+; ################################## BYE BYE ##################################
+;
+
+    IFNDEF  AUX_DEBUG
+        ; Skip wait-for-key
+        jmp StartPBR
+    ENDIF
+
+        ;
+        ; Wait for keypress
+        ;
+        xor     ax, ax
+        int     16h
+
+        ; Is escape-key ?
+        cmp     al, 1bh
+
+        ; Nope, Go activate PBR loader
+        jne      StartPBR
+
+        ;push    ds
+        ;pop     es
+
+        ; Yep, restart AiR-BOOT so simulate load DX:BX with old BIOS SS:SP
+        jmp     AirbootRestart
+
+        ; Yep, Reenter bootmenu
+        ;~ jmp     MBR_Main_ReEnterBootMenuPre
+
+
+
+;
+; Transfer control to the PBR
+;
+StartPBR:
+
+        ; Debug display index
+        ;pusha
+        ;mov     al, cs:[si+LocIPT_Drive]        ; Drive Physical No
+        ;mov     ah, cs:[si+LocIPT_SystemID]     ; SystemID
+        ;call    VideoIO_PrintHexWord
+        ;xor     ax, ax
+        ;int     16h
+        ;popa
+
+        ;~ jmp     skip_delay
+
+
+        ;
+        ; Show dot's to indicate something is happening...
+        ;
+        call    VideoIO_ShowWaitDots
+
+    ;
+    ; Enter here to skip delay.
+    ;
+    skip_delay:
+
+
+
+
+        ;
+        ; BYE BYE   (prepare some registers? look at other MBR-code)
+        ;
+        xor     ax, ax
+        xor     bx, bx
+        xor     cx, cx
+        mov     ds, ax
+        mov     es, ax
+        xor     dh, dh
+        mov     dl, cs:[si+LocIPT_Drive]      ; Drive Physical No
+
+
+        ; BOOKMARK: JUMP TO PBR CODE
+        ; ###############################
+        ; # JUMP TO THE PBR LOADER CODE #
+        ; ###############################
+        IFDEF ReleaseCode
+            db      0EAh
+            dw      StartBasePtr
+            dw      StartBaseSeg
+        ENDIF
+
+
+PART_StartPartition             EndP
+
+
+
+
+
+
+
+
+;
+; ######################################
+; # Is this a primary partition or not #
+; ######################################
+;
+; In
+; --
+; DL    = Physical Disk
+; BX:CX = LBA sector
+;
+; Out
+; ---
+; AX    = Index in PT if found, otherwise -1
+; CY    = Set if Primary, clear if not
+;
+PART_IsPrimaryPartition Proc Near  Uses bx cx dx si di ds es
+        ; Push LBA address of partition
+        push     bx
+        push     cx
+
+        ; Load LBA sector 0 from the disk specified in DL
+        xor      bx,bx
+        xor      cx,cx
+        mov      di,ds
+        mov      si,offset [TmpSector]
+        call     DriveIO_LoadSectorLBA
+
+        ; Restore partitions LBA address to DI:SI
+        pop      si
+        pop      di
+
+        ; Return with index -1 and CY clear if there was an
+        ; error loading the sector.
+        mov      ax,-1
+        cmc
+        jnc      PART_IsPrimaryPartition_exit
+
+        ; Compare the partition address with each entry in the P-table
+        mov      cx,4                    ; Nr. of PT-entries
+        mov      dx,offset [TmpSector]
+        add      dx,01beh+08h            ; Point DX to 1st partition address
+
+    next_pe:
+        ; Computer pointer to PE
+        mov      bx,dx          ; Point BX to 1st partition address
+        mov      ax,cx          ; Get PE-index
+        dec      ax             ; Index is zero based so adjust it
+        shl      ax,4           ; PE's are 16 bytes in size
+        add      bx,ax          ; Make BX point to the PE
+
+        ; Compare LBA address
+        push     si
+        push     di
+        xor      si,[bx+00h]    ; Will put 0 in SI if the same
+        xor      di,[bx+02h]    ; Will put 0 in DI if the same
+        or       si,di          ; Wil set ZF if both zero
+        pop      di
+        pop      si
+        loopnz   next_pe        ; Try next entry if non-zero
+
+        ; Partition found or counter exhausted
+        mov      ax,-1
+        clc
+        ; Not found, so exit with NC and invalid index
+        jnz      PART_IsPrimaryPartition_exit
+
+        ; Partition is Primary, set CY and return index
+        mov      ax,cx
+        stc
+
+    PART_IsPrimaryPartition_exit:
+        ret
+PART_IsPrimaryPartition Endp
+
+
+
+;
+; #############################
+; # Is this an HPFS partition #
+; #############################
+;
+; In
+; --
+; SI    = Pointer to IPT entry
+;
+; Out
+; ---
+; CY    = Set if HPFS partition, clear if not
+;
+PART_IsHPFS     Proc Near  Uses ax
+        mov     al, [si+LocIPT_SystemID]    ; Get SystemID
+        cmp     al, 07h                     ; Compare with AiR-BOOT ID for HPFS
+        stc                                 ; Assume HPFS
+        je      PART_IsHPFS_exit            ; Yep
+        clc                                 ; Nope, clear CY
+    PART_IsHPFS_exit:
+        ret
+PART_IsHPFS     Endp
+
+
+;
+; ###########################
+; # Is this a JFS partition #
+; ###########################
+;
+; In
+; --
+; SI    = Pointer to IPT entry
+;
+; Out
+; ---
+; CY    = Set if JFS partition, clear if not
+;
+PART_IsJFS      Proc Near  Uses ax
+        mov     al, [si+LocIPT_SystemID]    ; Get SystemID
+        cmp     al, 0fch                    ; Compare with AiR-BOOT ID for JFS
+        stc                                 ; Assume JFS
+        je      PART_IsJFS_exit             ; Yep
+        clc                                 ; Nope, clear CY
+    PART_IsJFS_exit:
+        ret
+PART_IsJFS      Endp
+
+
+
+;
+; #############################
+; # Is this an NTFS partition #
+; #############################
+;
+; In
+; --
+; SI    = Pointer to IPT entry
+;
+; Out
+; ---
+; CY    = Set if NTFS partition, clear if not
+;
+PART_IsNTFS     Proc Near  Uses ax
+        mov     al, [si+LocIPT_SystemID]    ; Get SystemID
+        cmp     al, 08h                     ; Compare with AiR-BOOT ID for NTFS
+        stc                                 ; Assume NTFS
+        je      PART_IsNTFS_exit            ; Yep
+        clc                                 ; Nope, clear CY
+    PART_IsNTFS_exit:
+        ret
+PART_IsNTFS     Endp
+
+
+;
+; ######################################
+; # Is this a FAT12 or FAT16 partition #
+; ######################################
+;
+; In
+; --
+; SI    = Pointer to IPT entry
+;
+; Out
+; ---
+; CY    = Set if FAT12 or FAT16 partition, clear if not
+;
+PART_IsFAT    Proc Near  Uses ax
+        mov     al, [si+LocIPT_SystemID]    ; Get SystemID
+        cmp     al, 04h                     ; Is FAT12 ?
+        stc
+        je      PART_IsFAT_exit             ; Yep
+        cmp     al, 06h                     ; Is FAT16 CHS ?
+        stc
+        je      PART_IsFAT_exit             ; Yep
+        cmp     al, 0eh                     ; Is FAT16 LBA ?
+        stc
+        je      PART_IsFAT_exit             ; Yep
+        clc                                 ; Nope
+    PART_IsFAT_exit:
+        ret
+PART_IsFAT      Endp
+
+
+;
+; #############################
+; # Is this a FAT32 partition #
+; #############################
+;
+; In
+; --
+; SI    = Pointer to IPT entry
+;
+; Out
+; ---
+; CY    = Set if FAT32 partition, clear if not
+;
+PART_IsFAT32    Proc Near  Uses ax
+        mov     al, [si+LocIPT_SystemID]    ; Get SystemID
+        cmp     al, 0bh                     ; Is FAT32 CHS ?
+        stc
+        je      PART_IsFAT32_exit           ; Yep
+        cmp     al, 0ch                     ; Is FAT32 LBA ?
+        stc
+        je      PART_IsFAT32_exit           ; Yep
+        clc                                 ; Nope
+    PART_IsFAT32_exit:
+        ret
+PART_IsFAT32    Endp
+
+
+
+;
+; ##############################################################
+; # Does this partition have the Windows BootManager installed #
+; ##############################################################
+;
+; In
+; --
+; DL    = Physical Disk
+; BX:CX = LBA sector
+;
+; Out
+; ---
+; CY    = Set if BOOTMGR found, clear if not
+;
+;PART_IsWinBMGR  Proc Near  Uses ax bx cx dx si di ds es
+;
+;        ; Load specified LBA sector (BX:CX) from the disk in DL
+;        mov     di,ds
+;        mov     si,offset [TmpSector]
+;        call    DriveIO_LoadSectorLBA
+
+;        ; Point to location of 'BOOTMGR' signature.
+;        add     si,169h
+
+;        ; DL holds equality status
+;        xor     dl,dl
+;        cld
+
+;        ; Load letter into AL, xor with letter will result 0 if the same.
+;        ; Then or to DL.
+;        ; If at the end of the sequence DL is zero, the signature is present.
+;        lodsb
+;        xor     al,'B'
+;        or      dl,al
+;        lodsb
+;        xor     al,'O'
+;        or      dl,al
+;        lodsb
+;        xor     al,'O'
+;        or      dl,al
+;        lodsb
+;        xor     al,'T'
+;        or      dl,al
+;        lodsb
+;        xor     al,'M'
+;        or      dl,al
+;        lodsb
+;        xor     al,'G'
+;        or      dl,al
+;        lodsb
+;        xor     al,'R'
+;        or      dl,al
+
+;        ; Assume not present
+;        clc
+;        jnz     PART_IsWinBMGR_exit
+
+;        ; BOOTMGR signature found
+;        stc
+
+;    PART_IsWinBMGR_exit:
+;        ret
+;PART_IsWinBMGR  Endp
+
+
+;
+; ##########################################################
+; # Get the offset of the phys-disk field in the PBR (BPB) #
+; ##########################################################
+;
+; In
+; --
+; DS:SI = IPT
+;
+; Out
+; ---
+; AX    = Index in PBR for phys-disk field
+;
+PART_GetFieldIndex  Proc Near   uses bx cx dx
+        ; Check for FAT32 partition
+        mov     dl,bptr [si+LocIPT_Drive]
+        mov     cx,[si+LocIPT_AbsoluteBegin+00h]
+        mov     bx,[si+LocIPT_AbsoluteBegin+02h]
+        call    PART_IsFAT32
+        mov     ax,24h                              ; Offset in old-style BPB
+        jnc     PART_GetFieldIndex_exit
+        mov     ax,40h                              ; Offset in FAT32 BPB
+    PART_GetFieldIndex_exit:
+        ret
+PART_GetFieldIndex  EndP
Index: trunk/bootcode/regular/partscan.asm
===================================================================
--- trunk/bootcode/regular/partscan.asm	(revision 57)
+++ trunk/bootcode/regular/partscan.asm	(revision 57)
@@ -0,0 +1,1010 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                             AiR-BOOT / PARTiTiON SCANNING
+;---------------------------------------------------------------------------
+
+
+IFDEF   MODULE_NAMES
+DB 'PARTSCAN',0
+ENDIF
+
+; Note: This is complex code. So make sure that you know what you are doing in
+;        here.
+
+PARTSCAN_ScanForPartitions      Proc Near
+        ; Reset X-Reference
+        call    PARTSCAN_ResetXref
+
+        mov     dh, TotalHarddiscs
+        xor     al, al
+        mov     NewPartitions, al
+
+        mov     byte ptr [CurIO_Scanning], 1             ; Set flag due scanning partitions
+        mov     dl, 80h                       ; is first harddisc
+    PSSFP_HarddiscLoop:
+
+        push    dx
+        call    PARTSCAN_ScanDriveForPartitions
+        pop     dx
+        inc     dl
+        dec     dh
+        jnz     PSSFP_HarddiscLoop
+        mov     byte ptr [CurIO_Scanning], 0             ; Reset flag due scanning complete
+
+    IFDEF   AUX_DEBUG
+        ;~ pusha
+        ;~ call    DEBUG_DumpHidePartTables
+        ;~ popa
+    ENDIF
+        ; Use X-Reference to sync NewPartitionTable with Hide-Config
+        call    PARTSCAN_SyncHideConfigWithXref
+
+    IFDEF   AUX_DEBUG
+        ;~ pusha
+        ;~ call    DEBUG_DumpHidePartTables
+        ;~ popa
+    ENDIF
+
+        ; Now we copy the new IPT over the old one...
+        mov     si, offset NewPartTable
+        mov     di, offset PartitionTable
+        ;movzx   ax, NewPartitions
+        mov   al,NewPartitions
+        mov   ah,0
+
+        mov     CFG_Partitions, al
+        mov     bl, LocIPT_LenOfIPT
+        mul     bl
+        mov     cx, ax
+        rep     movsb
+
+        ; and the New Logical Drive Letter table as well...
+        mov     si, offset NewDriveLetters
+        mov     di, offset DriveLetters
+        mov     cx, LocIPT_MaxPartitions
+        rep     movsb
+
+; [Linux support removed since v1.02]
+;   ; Search for any Linux partition and remember, if it got found...
+;   mov     si, offset PartitionTable
+;   movzx   cx, CFG_Partitions
+;   xor     dl, dl                        ; DL - Is Linux here ?
+;   or      cx, cx
+;   jz      PSSFP_NoPartitions
+;  PSSFP_LinuxLoop:
+;      cmp     bptr [si+LocIPT_SystemID], 083h  ; Hard-Coded
+;      jne     PSSFP_NoLinux
+;      mov     dl, 1                      ; Linux found...
+;     PSSFP_NoLinux:
+;      add     si, LocIPT_LenOfIPT
+;   loop    PSSFP_LinuxLoop
+;  PSSFP_NoPartitions:
+;   mov     GotLinux, dl                  ; Set Flag
+
+        ; ...and finally check, if we need to set a Drive-Letter
+        mov     dl, AutoDrvLetter
+        or      dl, dl
+        jz      PSSFP_NoAutoDriveLetter
+        ;movzx   cx, CFG_Partitions
+        mov   cl,CFG_Partitions
+        mov   ch,0
+
+        or      cx, cx
+        jz      PSSFP_NoAutoDriveLetter
+        mov     si, offset PartitionTable
+        mov     di, offset DriveLetters
+        mov     ax, wptr [AutoDrvLetterSerial]
+        mov     bx, wptr [AutoDrvLetterSerial+2]
+    PSSFP_AutoDrvLetterLoop:
+        cmp     ax, [si+LocIPT_Serial]
+        jne     PSSFP_AutoDrvLetterNoMatch
+        cmp     bx, [si+LocIPT_Serial+2]
+        jne     PSSFP_AutoDrvLetterNoMatch
+        ; We got a match, so set Drive-Letter in DL
+        or      bptr [si+LocIPT_Flags], Flags_DriveLetter
+        mov     [di], dl
+    PSSFP_AutoDrvLetterNoMatch:
+        add     si, LocIPT_LenOfIPT
+        inc     di
+        loop    PSSFP_AutoDrvLetterLoop
+        mov     byte ptr [AutoDrvLetter], 0              ; Disable after processing...
+    PSSFP_NoAutoDriveLetter:
+        ret
+PARTSCAN_ScanForPartitions      EndP
+
+
+
+;
+; This function reconnects a forced drive-letter with it's partition
+; when partitions are removed.
+;
+PARTSCAN_UpdateDriveLetters     Proc
+        pusha
+        xor     bx,bx           ; index-pointer
+        xor     cx,cx           ; counter
+        xor     dx,dx           ; backup index-pointer
+        mov     cl,LocIPT_MaxPartitions     ; nr of entries to process
+        mov     si,offset [PartitionXref]   ; old-new relation table
+        mov     di,offset [DriveLetters]    ; forced drive-letters table
+
+        ;
+        ; Loop over each entry in the xref-table to see if the partition
+        ; has been removed or has been given a new index in the IPT.
+        ; A removed partition has 0ffh in it's slot and for a partition
+        ; that has a new index in the IPT the value at the slot is different
+        ; from the index of the slot in the xref-table.
+        ;
+    PARTSCAN_UpdateDriveLetters_next_entry:
+        jcxz    PARTSCAN_UpdateDriveLetters_done
+        dec     cl              ; decrement counter
+        mov     al,[si+bx]      ; get possibly old index for this entry
+        mov     dl,bl           ; save current index
+        inc     bl              ; advance index-pointer
+        inc     al              ; 0ffh will become 0, part removed so continue
+        jz      PARTSCAN_UpdateDriveLetters_next_entry
+
+        ;
+        ; If value in slot is the same as the index of the slot then
+        ; the partition has not moved in the IPT.
+        ;
+        dec     al              ; restore possibly out-of-date index
+        cmp     al,dl           ; same as array index? then ok, do next
+        je      PARTSCAN_UpdateDriveLetters_next_entry
+
+;!
+;! DEBUG_PROBE
+;!
+IFDEF   AUX_DEBUG
+    push    1234h
+    call    DEBUG_Probe
+ENDIF
+
+        ;
+        ; The partition has moved in the IPT so we lookup it's forced
+        ; drive-letter at the old location and put it at the new one.
+        ; The old location is identified by the index in the xref-table
+        ; and the new location is identified by the value at that index.
+        ; Thus, when no partitions have been deleted or added, the xref-table
+        ; contains the sequence 0,1,2,3,...,n,0ffh,0ffh, etc.
+        ; The value 0ffh means that no partition is using the slot.
+        ;
+        xor     ah,ah           ; no drive-letter
+        dec     bl              ; backup index-pointer one position
+        xchg    ah,[di+bx]      ; get drive-letter and store zero
+        xchg    bl,al           ; use slot value as new index
+        mov     [di+bx],ah      ; store drive-letter
+        xchg    al,bl           ; restore index-pointer
+        inc     bl              ; point to next entry
+        jmp     PARTSCAN_UpdateDriveLetters_next_entry
+    PARTSCAN_UpdateDriveLetters_done:
+        popa
+        ret
+PARTSCAN_UpdateDriveLetters     EndP
+
+
+
+
+; Scannt die Festplatte auf jegliche Partitionstabellen...
+; Falls eine fehlerhafte Partition gefunden wird, wird abgebrochen.
+; falls eine Extended Partition (DOS) gefunden wird, wird erneut gescannt.
+PARTSCAN_ScanDriveForPartitions Proc Near
+        xor     ax, ax
+        xor     bx, bx     ; Location Absoluter Sektor 0
+        mov     cx, 0001h
+        xor     dh, dh     ; Location Zylinder 0, Side 0, Sektor 1 MBR
+        mov     [ExtendedAbsPosSet], al
+        mov     wptr [ExtendedAbsPos+0], ax
+        mov     wptr [ExtendedAbsPos+2], ax
+    PSSDFP_LoadThisPartition:
+
+        call    DriveIO_LoadPartition                ; Load a partition record
+
+        jc      PSSDFP_InvalidPartition
+
+        ; LVM Support - Reads LVM Information Sector
+        call    DriveIO_LoadLVMSector                ; Load LVM sector
+
+        call    PARTSCAN_ScanPartition
+    IFDEF ReleaseCode
+        call    DriveIO_SavePartition
+    ENDIF
+        call    PARTSCAN_ScanPartitionForExtended
+        jc      PSSDFP_LoadThisPartition
+    PSSDFP_InvalidPartition:
+        ret
+PARTSCAN_ScanDriveForPartitions EndP
+
+; Scans Current Partition for Extended Partitions, if found, AX,BX,CX,DX will
+; be set to this location and Carry will be set
+PARTSCAN_ScanPartitionForExtended Proc Near  Uses si
+        mov     si, offset PartitionSector+446 ; DS:SI - 1st partition entry
+        xor     ax, ax
+    PSSPFE_ScanLoop:
+            mov     al, [si+LocBRPT_SystemID]
+            cmp     al, 5                      ; Is Partition EXTENDED ?
+            je      PSSPFE_ExtendedPartition
+            cmp     al, 0Fh                    ; Is Partition EXTENDED (M$) ?
+            je      PSSPFE_ExtendedPartition
+            jmp     PSSPFE_IgnorePartition
+        PSSPFE_ExtendedPartition:
+            mov     ax, wptr [si+LocBRPT_RelativeBegin]
+            mov     bx, wptr [si+LocBRPT_RelativeBegin+2]
+            add     ax, wptr [ExtendedAbsPos+0] ; Adjust...
+            adc     bx, wptr [ExtendedAbsPos+2] ; (Shit Design!)
+            test    byte ptr [ExtendedAbsPosSet], 1
+            jnz     PSSPFE_ExtendedMainKnown
+            mov     wptr [ExtendedAbsPos+0], ax
+            mov     wptr [ExtendedAbsPos+2], bx
+            mov     byte ptr [ExtendedAbsPosSet], 1
+        PSSPFE_ExtendedMainKnown:
+            mov     cx, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector
+            mov     dh, bptr [si+LocBRPT_BeginHead]   ; Head
+            mov     dl, bptr [CurPartition_Location+4] ; Drive
+            stc
+            jmp     PSSPFE_EndOfSearch
+        PSSPFE_IgnorePartition:
+            add     si, LocBRPT_LenOfEntry
+            cmp     si, 500+offset PartitionSector
+        jb      PSSPFE_ScanLoop
+        clc
+    PSSPFE_EndOfSearch:
+        ret
+PARTSCAN_ScanPartitionForExtended EndP
+
+; The following routines have NOT *DS* set to CS, so we must address via ES
+PARTSCAN_ScanPartition          Proc Near  Uses ax si
+        mov     si, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry
+    PSSP_ScanLoop:
+        mov     al, bptr [si+LocBRPT_SystemID]
+        cmp     al, 5                      ; Is Partition EXTENDED ?
+        je      PSSP_IgnorePartition
+        cmp     al, 0Fh                    ; Is Partition EXTENDED (M$-DOS7) ?
+        je      PSSP_IgnorePartition
+        cmp     al, 0                      ; Is Partition EMPTY ?
+        je      PSSP_IgnorePartition
+        ; Ignore these partitions, because there are no real Partitions
+
+        ;
+        ; Stop scanning if too many partitions.
+        ;
+        cmp     word ptr cs:[NewPartitions],LocIPT_MaxPartitions
+        jae     skip_check
+        call    PARTSCAN_CheckThisPartition
+        jmp     PSSP_IgnorePartition
+    skip_check:
+        ; Cannot boot LVM-Data partitions
+        pusha
+        mov     byte ptr cs:[TooManyPartitions],1
+        mov     cx, 0C04h
+        ;~ mov     si, offset TXT_ERROR_TooManyPartitions
+        mov     si, offset TXT_TooManyPartitions
+        add     si,5    ; We stole this string, so skip new-line and dash.
+        ;~ call    SETUP_Warning_AreYouSure
+        call    SETUP_ShowErrorBox
+        popa
+
+    PSSP_IgnorePartition:
+        ; Only clear the boot-flag on the boot-disk.
+        ; Clearing the boot-flags on other disks would prevent booting them
+        ; from the BIOS. (TRAC ticket #6)
+        cmp     dl, 080h                            ; See if this is boot-disk 
+        jne     PSSP_Skip_Clear_BootFlag            ; Nope, skip clear flag
+        and     byte ptr [si+LocBRPT_Flags], 7Fh    ; Reset the Active-Flag
+    PSSP_Skip_Clear_BootFlag:
+        add     si, LocBRPT_LenOfEntry     ; 16 Bytes per partition entry
+        cmp     si, 500+offset PartitionSector
+        jb      PSSP_ScanLoop
+        ; If we are on first HDD and in primary partition table -> mark primary
+        cmp     bptr [CurPartition_Location+4], 80h ; Drive
+        jne     PSSP_NoMarkPrimary
+        cmp     wptr [CurPartition_Location+0], 0
+        jne     PSSP_NoMarkPrimary
+        cmp     wptr [CurPartition_Location+2], 0 ; Absolute Location
+        jne     PSSP_NoMarkPrimary
+        call    PART_MarkFirstGoodPrimary
+    PSSP_NoMarkPrimary:
+        ret
+PARTSCAN_ScanPartition          EndP
+
+MBR_NoName_Patched           db  15 dup (0)
+
+; Will insert this partition into NewPartTable and compare it to our "old"
+; LocIPT-table. If the same partition is found there, Flags&CRC are taken from
+; the old table, otherwise they are generated freshly.
+; Will also fill out PartitionXref to sync HideConfig later
+;        In: SI - Points to Partition-Entry (16-Bytes)
+PARTSCAN_CheckThisPartition     Proc Near  Uses di si
+        local   PartSystemID:byte, PartTypeFlags:byte
+        local   PartCRC:word, PartPtr:word
+
+        mov     wptr [PartPtr], si          ; Save Pointer to PartitionEntry
+
+        mov     al, bptr [si+LocBRPT_SystemID]
+        mov     PartSystemID, al
+
+        mov     cx, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector
+        mov     dh, bptr [si+LocBRPT_BeginHead] ; Head
+        mov     dl, bptr [CurPartition_Location+4] ; Drive
+        mov     ax, wptr [si+LocBRPT_RelativeBegin] ; Absolute Sector
+        mov     bx, wptr [si+LocBRPT_RelativeBegin+2]
+        add     ax, wptr [CurPartition_Location+0] ; +Partition-Absolute
+        adc     bx, wptr [CurPartition_Location+2] ;  sectors
+
+
+
+        ; Sets up DS:SI - TmpSector
+        call    DriveIO_LoadTmpSector         ; Loads Boot record
+
+
+
+        push    si
+            mov     bx, 4B4Dh                  ; Magic 'MK' :)
+            call    MBR_GetCheckOfSector
+            mov     PartCRC, bx                ; Save Partition's-CRC
+
+            ; ------------------------------ Gets internal infos of partition type
+            mov     al, PartSystemID
+            call    PART_SearchFileSysName
+            ; Replies AH - FileSysFlags, AL - UnhiddenID, SI - FileSystemNamePtr
+            mov     di, si
+            mov     PartTypeFlags, ah
+            mov     PartSystemID, al           ; Use Unhidden-ID
+        pop     si
+
+        ;================================
+        ; AL - File System ID (Unhidden)
+        ; AH - File System Flags
+        ; SI - Boot-Record of Partition
+        ; DI - File System Name
+        ;================================
+
+        cmp     PartSystemID, 07h          ; We got IFS here?
+        jne     PCCTP_IFSdone
+        ; Check, if 'JFS ' is at DWORD offset 36h                                     ; Rousseau: JFS check (LVM / IPT?)
+        cmp     wptr [si+36h], 'FJ'
+        jne     PCCTP_IFSnoJFS
+        cmp     wptr [si+38h], ' S'
+        jne     PCCTP_IFSnoJFS
+        mov     PartSystemID, 0FCh         ; FC is JFS internally
+        jmp     PCCTP_IFSdone
+    PCCTP_IFSnoJFS:
+        ; Check, if 'HPFS' is at DWORD offset 36h
+        cmp     wptr [si+36h], 'PH'
+        jne     PCCTP_ProbablyNTFS
+        cmp     wptr [si+38h], 'SF'
+        je      PCCTP_IFSdone              ; 07 is HPFS internally
+    PCCTP_ProbablyNTFS:
+        inc     PartSystemID               ; 08 is NTFS instead of 07
+    PCCTP_IFSdone:
+
+
+        ; First check, if LVM Information Sector is available and this partition
+        ;  is supported.
+        push    ax
+        push    dx
+        push    si
+        push    di
+        mov     si, wptr [PartPtr]
+        mov     ax, wptr [si+LocBRPT_RelativeBegin] ; Absolute Sector
+        mov     dx, wptr [si+LocBRPT_RelativeBegin+2]
+        add     ax, wptr [CurPartition_Location+0] ; +Partition-Absolute
+        adc     dx, wptr [CurPartition_Location+2] ;  sectors
+        mov     si, offset LVMSector
+        call    LVM_SearchForPartition     ; Search for DX:AX partition
+        jnc     PCCTP_CheckBootRecord
+        ; Check, if volume has driveletter assigned and remember it for later
+        mov     al, [si+LocLVM_VolumeLetter]
+        or      al, al
+        jnz     PCCTP_HasVolumeLetter
+        mov     al, 1                      ; 0 would mean "not LVM supported"
+    PCCTP_HasVolumeLetter:
+        ; Save VolumeLetter in separate table
+        ;movzx   bx, NewPartitions          ; NewPartitions is one behind here, so
+        mov   bl,NewPartitions          ; NewPartitions is one behind here, so
+        mov   bh,0
+
+        mov     [PartitionVolumeLetters+bx], al ; it's already a zero-based offset
+        ; Now copy VolumeID and VolumeName to temporary space
+        mov     di, offset MBR_NoName_Patched
+        mov     ax, [si+LocLVM_PartitionID]
+        stosw
+        mov     ax, [si+LocLVM_PartitionID+2]
+        stosw
+                  ; Set Serial-Field to LVM-VolumeID
+
+        push     di
+        add     si, LocLVM_VolumeName     ; Use LVM VolumeName
+        ;add     si, LocLVM_PartitionName  ; Use LVM PartitionName
+        mov     cx, 5
+        rep     movsw                      ; Copy LVM-PartitionName to Temp Space
+        movsb                               ;  (11 bytes in total)
+        pop   di
+
+
+        ; Check if this is an IBM-BM partition
+        cmp   PartSystemID, 0ah
+        jne   PCCTP_NoIbmBm
+
+        ; It is, so override the name given by IBM-BM by one that
+        ; fits in 11 chars.
+        mov   si, offset ibm_bm_name
+        mov   cx,5
+        rep   movsw
+        movsb
+
+
+
+    PCCTP_NoIbmBm:
+        pop     di
+        pop     si
+        pop     dx
+        pop     ax
+        mov     si, offset MBR_NoName_Patched
+        xor     ah, ah                        ; no Flags_NoPartName
+        jmp     PCCTP_NameSearchInIPT
+
+    PCCTP_CheckBootRecord:
+        pop     di
+        pop     si
+        pop     dx
+        pop     ax
+
+        test    ah, FileSysFlags_NoName       ; No-Name-Flag ? -> No Partition Name
+
+        jz      PCCTP_ThereIsAName
+        jmp     PCCTP_ThereIsNoName           ;                    available
+
+    PCCTP_ThereIsAName:
+
+        ; We check for NTFS (got detected a little bit earlier in this routine)
+        cmp     PartSystemID, 08h          ; We got IFS/NTFS here?
+        jne     PCCTP_IsNoNTFS
+        jmp     PCCTP_ThereIsNoName        ; NTFS has no volume label
+    PCCTP_IsNoNTFS:
+        add     si, 2Bh                    ; DS:SI - Partition-Name
+        test    ah, FileSysFlags_FAT32     ; FAT32 specific name getting ?
+
+        jz      PCCTP_ResumeNormal
+
+        add     si, 1Ch                    ; Fix for FAT 32, shiat
+    PCCTP_ResumeNormal:
+        mov     cx, 11                     ;         11 bytes length
+        call    PART_CheckForValidPartName
+        jc    PCCTP_ThereIsAName2
+
+        jmp     PCCTP_ThereIsNoName
+
+    PCCTP_ThereIsAName2:
+
+      sub     si, 4                      ; DS:SI -> Serial&Name (15-Bytes)
+      xor     ah, ah                     ; no Flags_NoPartName
+;      jmp     PCCTP_NameSearchInIPT
+
+        ;=======================================================
+        ; NAME SEARCH in IPT-Table
+        ; DS:SI - Serial&Name of Current Partition (15-Bytes)
+        ;    AH - NoPartName-Flag (!MUST! be merged with Flags)
+        ;=======================================================
+    PCCTP_NameSearchInIPT:
+        xor     ah, ah                     ; no Flags_NoPartName cause PartName valid
+        mov     di, offset PartitionTable  ; ES:DI - IPT-Start
+        mov     dl, CFG_Partitions
+        or      dl, dl
+        jnz     PCCTP_SerialNameCompLoop
+        jmp     PCCTP_CompareFailed
+    PCCTP_SerialNameCompLoop:
+        mov     al, [di+LocIPT_Flags]
+        test    al, Flags_NowFound
+        jnz     PCCTP_SerialNameAlreadyFound
+        ; Now compare IPT with current Partition
+        mov     cx, 15                  ; Serial&Name (15-Bytes)
+        push    si
+        push    di
+        repz    cmpsb
+        pop     di
+        pop     si
+
+        jne   PCCTP_NoMatchYet
+
+        jmp      PCCTP_Match
+
+    PCCTP_NoMatchYet:
+
+    PCCTP_SerialNameAlreadyFound:
+        add     di, LocIPT_LenOfIPT
+        dec     dl
+        jnz     PCCTP_SerialNameCompLoop
+
+        ; if we didn't find Serial&Name, let's try Name-only without Serial
+        mov     di, offset PartitionTable  ; ES:DI - IPT-Start
+        mov     dl, CFG_Partitions
+    PCCTP_NameCompLoop:
+        mov     al, [di+LocIPT_Flags]
+        test    al, Flags_NowFound
+        jnz     PCCTP_NameAlreadyFound
+        ; Now compare IPT with current Partition
+        mov     cx, 11                  ; Name only (11-Bytes)
+        push    si
+        push    di
+        add     si, 4
+        add     di, 4                ; Skip over Serial-Field
+        repz    cmpsb
+        pop     di
+        pop     si
+        jne     PCCTP_NameNoMatch
+        mov     cx, [si+0]           ; Get Serial
+        mov     [di+0], cx
+        mov     cx, [si+2]
+        mov     [di+2], cx           ; ...and put it into IPT
+        jmp     PCCTP_Match
+    PCCTP_NameNoMatch:
+    PCCTP_NameAlreadyFound:
+        add     di, LocIPT_LenOfIPT
+        dec     dl
+        jnz     PCCTP_NameCompLoop
+    PCCTP_NameCompFailed:
+
+        ; So finally we search for Location and PartitionID
+        push    si
+        ; Initialize some stuff for Location-Search
+        mov     dh, PartSystemID
+        mov     si, [PartPtr]           ; DS:SI - Cur Partition Table
+        ; Relative Sector to MBR/EPR
+        mov     cx, wptr [si+LocBRPT_RelativeBegin]
+        mov     bx, wptr [si+LocBRPT_RelativeBegin+2]
+        add     cx, [CurPartition_Location+0]
+        add     bx, [CurPartition_Location+2]
+        ; BX:CX - Absolute First Sector of Partition on HDD
+        pop     si
+        mov     di, offset PartitionTable  ; ES:DI - IPT-Start
+        mov     dl, CFG_Partitions
+    PCCTP_NameLocCompLoop:
+        mov     al, [di+LocIPT_Flags]
+        test    al, Flags_NowFound
+        jnz     PCCTP_NameLocAlreadyFound
+        ; Now compare IPT with current Partition
+        cmp     dh, [di+LocIPT_SystemID]
+        jne     PCCTP_NameLocMismatch
+        cmp     cx, [di+LocIPT_AbsoluteBegin]
+        jne     PCCTP_NameLocMismatch
+        cmp     bx, [di+LocIPT_AbsoluteBegin+2]
+        jne     PCCTP_NameLocMismatch
+        ; We matched location, now copy the current PartitionID and Name to
+        ;  the old IPT.
+        push    di
+        add     di, LocIPT_Serial    ; DS:SI - LocIPT-Serial&Name
+        mov     cx, 15
+        rep     movsb                ; Copy 15 bytes
+        pop     di
+        jmp     PCCTP_Match
+    PCCTP_NameLocMismatch:
+    PCCTP_NameLocAlreadyFound:
+        add     di, LocIPT_LenOfIPT
+        dec     dl
+        jnz     PCCTP_NameLocCompLoop
+        ; None of the searches worked, so forget it...
+        jmp     PCCTP_CompareFailed
+
+    PCCTP_ThereIsNoName:
+        ; Try to find this partition by comparing location and PartitionID
+        ;  aka LocIPT_AbsoluteBegin:dword and LocIPT_SystemID
+        ; If found, simply go to the normal match-routine, otherwise use the
+        ;  File-System-Name to build the Volume-Label for the New IPT Entry.
+        mov     dh, PartSystemID
+        mov     si, [PartPtr]           ; DS:SI - Cur Partition Table
+        ; Relative Sector to MBR/EPR
+        mov     cx, wptr [si+LocBRPT_RelativeBegin]
+        mov     bx, wptr [si+LocBRPT_RelativeBegin+2]
+        add     cx, [CurPartition_Location+0]
+        add     bx, [CurPartition_Location+2]
+        ; Build a standard-Volume Label from FileSystemNamePtr
+        ;  We have to call SearchFileSysName again because of NTFS
+        push    ax
+        push    cx
+        mov     al, dh
+        call    PART_SearchFileSysName   ; We want SI here <- FileSystemNamePtr
+        mov     di, offset MBR_NoName_Patched
+        xor     ax, ax
+        stosw
+        stosw                           ; Set Serial-Field to "NUL"
+        mov     cx, 4
+        rep     movsw                   ; Copy FileSystemName to Temp Space
+        xor     ax, ax
+        stosw
+        stosb                           ; Fill last 3 bytes with "NUL"
+        mov     si, offset MBR_NoName_Patched
+        pop     cx
+        pop     ax
+        ;=======================================================
+        ; LOCATION SEARCH in IPT-Table
+        ;    DH - PartitionID of Current Partition
+        ; BX:CX - AbsoluteBegin of Current Partition
+        ;    AH - NoPartName-Flag (!MUST! be merged with Flags)
+        ; DS:SI - Serial&Name of Current Partition (15-Bytes)
+        ;=======================================================
+    PCCTP_LocSearchInIPT:
+        mov     ah, Flags_NoPartName       ;set Flags_NoPartName, PartName invalid
+        mov     di, offset PartitionTable  ; ES:DI - IPT-Start
+        mov     dl, CFG_Partitions
+        or      dl, dl
+        jz      PCCTP_LocCompFailed
+    PCCTP_LocCompLoop:
+        mov     al, [di+LocIPT_Flags]
+        test    al, Flags_NowFound
+        jnz     PCCTP_LocAlreadyFound
+        ; Now compare IPT with current Partition
+        cmp     dh, [di+LocIPT_SystemID]
+        jne     PCCTP_LocMismatch
+        cmp     cx, [di+LocIPT_AbsoluteBegin]
+        jne     PCCTP_LocMismatch
+        cmp     bx, [di+LocIPT_AbsoluteBegin+2]
+        jne     PCCTP_LocMismatch
+        jmp     PCCTP_Match
+    PCCTP_LocMismatch:
+    PCCTP_LocAlreadyFound:
+        add     di, LocIPT_LenOfIPT
+        dec     dl
+        jnz     PCCTP_LocCompLoop
+    PCCTP_LocCompFailed:
+        jmp     PCCTP_CompareFailed
+
+        ; ==================================
+        ; =MATCH=, found partition in IPT...
+        ;    AH - NoPartName-Flag (!MUST! be merged with Flags)
+        ;    DL - IPT Partition Number from Loop (inverted)
+        ; ES:DI - LocIPT-Pointer to found IPT-entry
+        ; ==================================
+    PCCTP_Match:
+        mov     ch, ah
+        ; Save the new location of this partition in the Xref-Table
+        ;  for converting HideConfig.
+        mov     dh, dl
+        mov     dl, CFG_Partitions
+        sub     dl, dh
+        mov     dh, NewPartitions             ; is actually a counter
+        call    PARTSCAN_DefXref              ; DL-IPT-Partition, DH-NewPartition
+
+        ; Get Saved-Flags...
+        mov     cl, bptr [di+LocIPT_Flags]    ; Use saved Flags
+
+        ; ...and Saved-CRC if available...
+        mov     ax, wptr [di+LocIPT_BootRecordCRC]
+        or      ax, ax
+        jz      PCCTP_UseNewComputedCRC
+        mov     PartCRC, ax                   ; Use saved IPT-CRC
+    PCCTP_UseNewComputedCRC:
+        ; ...and mark partition in IPT as already found
+        or      bptr [di+LocIPT_Flags], Flags_NowFound
+        ; ...get Serial&Name from IPT-table...
+        mov     si, di
+        add     si, LocIPT_Serial             ; DS:SI - LocIPT-Serial&Name
+        jmp     PCCTP_AddToNew
+
+        ; =================================
+        ; =FAILED= search, not found in IPT
+        ;    AH - NoPartName-Flag (!MUST! be merged with Flags)
+        ; DS:SI - Serial&Name of Current Partition (15-Bytes)
+        ; =================================
+    PCCTP_CompareFailed:
+        mov     ch, ah
+        ; Default Flags hinzufgen...
+        mov     cl, LocIPT_DefaultFlags
+
+        mov     al, PartTypeFlags
+        ; May I auto-add partitions ?
+        test    byte ptr [CFG_PartitionsDetect], 1
+        jz      PCCTP_MayNotAddAny ; add, but non-bootable
+        test    al, FileSysFlags_BootAble     ; AH kam von SearchFileSysName
+        jnz     PCCTP_PerhapsBootAble
+    PCCTP_MayNotAddAny:
+        mov     cl, LocIPT_DefaultNonBootFlags
+    PCCTP_PerhapsBootAble:
+
+        ; On FAT32-partitions, default to P-Flag (which means using M$-hack)
+        ;  Anyway, this hack has to be globaly activated by the user manually...
+        cmp     PartSystemID, 09h             ; Hardcoded: FAT32
+        je      PCCTP_NeedsExtMShack
+        cmp     PartSystemID, 0Bh
+        je      PCCTP_NeedsExtMShack
+        cmp     PartSystemID, 0Ch
+        je      PCCTP_NeedsExtMShack
+        cmp     PartSystemID, 0Eh             ; FAT16 above 8 GB
+        jne     PCCTP_NoExtMShack
+        ; We only get here, when the SystemID seems to be an M$ "invention"...
+    PCCTP_NeedsExtMShack:
+        or      cl, Flags_ExtPartMShack
+    PCCTP_NoExtMShack:
+
+        ;================================================
+        ; CL - IPT-Partition-Flags, CH - NoPartName-Flag
+        ; DS:SI - PartSerial&Name (15-Bytes)
+        ;================================================
+    PCCTP_AddToNew:
+        mov     al, Flags_NoPartName          ; Unset NoPartName
+        not     al
+        and     cl, al
+        or      cl, ch                        ; CL = Both CL and CH merged
+
+        ; Calculate Pointer to IPT
+        mov     di, offset NewPartTable       ; ES:DI - NewPartTable
+        ;movzx   ax, NewPartitions
+        mov   al,NewPartitions
+        mov   ah,0
+
+        mov     bl, LocIPT_LenOfIPT
+        mul     bl
+        add     di, ax                        ; ES:DI - Last+1 Entry of NewPartTable
+
+        ; Now finally write this partition to our IPT
+        ;=============================================
+        push    cx
+        mov     cx, 15                     ; Copy Serial&Name...
+        rep     movsb
+        pop     cx
+
+        mov     si, [PartPtr]                 ; DS:SI - Cur Partition Entry
+        mov     al, bptr [CurPartition_Location+4] ; Drive
+        stosb
+        mov     al, PartSystemID              ; Unhidden SystemID
+        stosb
+        mov     al, cl                        ; Partition-Flags from register...
+        stosb
+        mov     ax, PartCRC                   ; BootRecordCRC...
+        stosw
+        mov     al, bptr [si+LocBRPT_BeginHead]
+        stosb
+        mov     ax, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector
+        stosw
+        mov     al, bptr [CurPartition_Location+5] ; Head of Part-Table
+        stosb
+        mov     ax, wptr [CurPartition_Location+6] ; Cylinder/Sector
+        stosw
+        mov     ax, wptr [si+LocBRPT_RelativeBegin]
+        mov     bx, wptr [si+LocBRPT_RelativeBegin+2]
+        mov     cx, wptr [CurPartition_Location+0] ; +Partition-Absolute
+        mov     dx, wptr [CurPartition_Location+2] ;  sectors
+        add     ax, cx
+        adc     bx, dx
+        stosw
+        mov     ax, bx
+        stosw
+        mov     ax, cx                        ; Absolute sector of partition table
+        stosw
+        mov     ax, dx
+        stosw
+        inc     byte ptr [NewPartitions]; Adjusted for Wasm ; NEW IPT Entry DONE
+
+        cmp     byte ptr [NewPartitions], LocIPT_MaxPartitions
+        jbe     PCCTP_NotTooManyPartitions
+
+        ; Should not be reached since scanning is stopped outside this
+        ; function when partition limit exceeds.
+        mov     si, offset TXT_TooManyPartitions
+        call    MBR_Teletype
+        jmp     MBR_HaltSystem
+
+
+    PCCTP_NotTooManyPartitions:
+        ; UNHIDE PARTITION, if it was hidden previously
+        mov     al, PartSystemID
+        cmp     al, 08h                       ; internally IFS/NTFS?
+        je      PCCTP_GotInternalIFS
+        cmp     al, 0FCh                      ; internally IFS/JFS?
+        jne     PCCTP_NoInternalIFS
+    PCCTP_GotInternalIFS:
+        mov     al, 07h
+    PCCTP_NoInternalIFS:
+        mov     bptr [si+LocBRPT_SystemID], al
+
+        ; Calculate Size of this partition and put it into separate table...
+        ;movzx   ax, NewPartitions
+        mov   al,NewPartitions
+        mov   ah,0
+
+        dec     ax
+        mov     bx, ax
+        shl     ax, 1
+        shl     bx, 2
+        add     ax, bx                        ; My way [tm] of multiplying with 6
+        mov     di, offset PartitionSizeTable
+        add     di, ax                        ; DI - Partition Size-Element
+        mov     ax, wptr [si+LocBRPT_AbsoluteLength] ; Sector-Size
+        mov     bx, wptr [si+LocBRPT_AbsoluteLength+2]
+        call    PART_FillOutSizeElement
+        ret
+PARTSCAN_CheckThisPartition     EndP
+
+stop_scanning   db  0
+
+; ===================
+;  X-REFERENCE STUFF -> PartitionXref
+; ===================
+
+; Reset X-Reference
+PARTSCAN_ResetXref  Proc Near   Uses ax cx di
+        mov     di, offset PartitionXref        ; X-Reference for later syncing
+        mov     cx, LocIPT_MaxPartitions
+        mov     ax, 0FFFFh                      ; Fill up with FFh
+        rep     stosb
+        mov     di, offset NewHidePartTable     ; Temporary Hide-Config Table
+        ;~ mov     cx, LocIPT_MaxPartitions * LocIPT_LenOfIPT
+        mov     cx, LocIPT_MaxPartitions * LocHPT_LenOfHPT
+        rep     stosb                           ; Fill up with FFFFh
+        mov     di, offset NewDriveLetters
+        mov     cx, LocIPT_MaxPartitions        ; Temporary Logical-Drive Letter Table
+        xor     ax, ax
+        rep     stosb                           ; Fill up with 0000h
+        ret
+PARTSCAN_ResetXref  EndP
+
+
+
+;        In: DL - Partition Number in IPT
+;            DH - Partition Number in NewPartitionTable
+; Destroyed: None
+PARTSCAN_DefXref    Proc Near   Uses ax bx cx dx si di
+        ;movzx   bx, dl
+        mov   bl,dl
+        mov   bh,0
+
+        mov     bptr [PartitionXref+bx], dh      ; X-Reference
+        ; Copy Hide-Config of IPT partition to new location in new table
+        mov     si, offset HidePartitionTable
+        mov     di, offset NewHidePartTable
+        ;~ mov     bl, LocIPT_MaxPartitions
+        mov     bl, LocHPT_LenOfHPT
+        mov     al, dl
+        mul     bl
+        add     si, ax
+        mov     al, dh
+        mul     bl
+        add     di, ax
+        ;~ mov     cx, LocIPT_MaxPartitions
+        mov     cx, LocHPT_LenOfHPT
+        rep     movsb                            ; Copy Hide-Config to NewHideTable
+        ; Process Logical-Drive-Letter table as well...
+        ;movzx   bx, dl
+        mov   bl,dl
+        mov   bh,0
+
+        mov     al, bptr [DriveLetters+bx]       ; Get Drv-Letter from org. pos
+        ;movzx   bx, dh
+        mov   bl,dl
+        mov   bh,0
+
+        mov     bptr [NewDriveLetters+bx], al    ; Put Drv-Letter to new pos
+        ret
+PARTSCAN_DefXref    EndP
+
+
+
+;        In: DL - Partition Number in previous IPT
+;       Out: DH - Partition Number in NewPartitionTable
+; Destroyed: None
+PARTSCAN_GetXref    Proc Near   Uses bx
+        ;movzx   bx, dl
+        mov   bl,dl
+        mov   bh,0
+
+        mov     dh, bptr [PartitionXref+bx]      ; X-Reference
+        ret
+PARTSCAN_GetXref    EndP
+
+
+;
+; Rousseau: Adjusted for packed hidden-part-table !
+;           Needs to be re-written.
+;
+; This here updates the contents of the Hide-Configuration to the current IPT
+;  table.
+PARTSCAN_SyncHideConfigWithXref Proc Near Uses ax bx cx dx si di
+        mov     si, offset NewHidePartTable
+        mov     di, offset HidePartitionTable
+        mov     dh, LocIPT_MaxPartitions    ; Max entries in hide-tables.
+
+    PSSHCWX_SyncPartLoop:
+        mov     cl, LocIPT_MaxPartitions    ; Max entries per hide-entry.
+        xor     dl, dl                        ; Partition Lost Counter
+
+        mov     ch,0    ; Index.
+
+    PSSHCWX_SyncLoop:
+        mov     bx,si
+
+        ;~ lodsb                              ; Get Part-Pointer from Hide-Cfg
+
+        push    dx
+        mov     dl,ch
+        mov     dh,6
+        call    CONV_GetBitfieldValue
+        pop     dx
+
+        ;~ cmp     al, 0FFh
+        cmp     al, 3Fh
+        je      PSSHCWX_SyncEmpty
+        ;movzx   bx, al
+        mov   bl,al
+        mov   bh,0
+
+        mov     al, [PartitionXref+bx]     ; Translate it
+        ;~ cmp     al, 0FFh
+        cmp     al, 3Fh
+        je      PSSHCWX_PartLost
+
+    PSSHCWX_SyncEmpty:
+        mov     bx,di
+        ;~ stosb                              ; Put translated pointer to new table
+
+        push    dx
+        mov     dl,ch
+        mov     dh,6
+        call    CONV_SetBitfieldValue
+        pop     dx
+
+        inc     ch
+        dec     cl
+        jnz     PSSHCWX_SyncLoop
+
+        jmp     PSSHCWX_SyncLoopEnd
+
+    PSSHCWX_PartLost:
+        inc     dl                         ; One partition got lost...
+        dec     cl
+        jnz     PSSHCWX_SyncLoop
+
+    PSSHCWX_SyncLoopEnd:
+
+
+    IFDEF   AUX_DEBUG
+        ;~ pusha
+        ;~ mov     al,dl
+        ;~ call    AuxIO_TeletypeHexByte
+        ;~ call    AuxIO_TeletypeNL
+        ;~ popa
+    ENDIF
+
+
+        or      dl, dl
+        jz      PSSHCWX_NothingLost
+        ;~ mov     al, 0FFh                     ; Influences OVERWRITE BUG ! (OUT OF BOUNDS !!)
+        mov     al, 3Fh
+
+    PSSHCWX_LostFillLoop:                       ; CHECK !!
+        ;~ stosb
+        dec     cl
+        jnz     PSSHCWX_LostFillLoop
+
+    IFDEF   AUX_DEBUG
+        ; debug code
+        ;~ mov     ax,di
+        ;~ call    AuxIO_TeletypeHexWord
+        ;~ call    AuxIO_TeletypeNL
+    ENDIF
+
+    PSSHCWX_NothingLost:
+        add     si, LocHPT_LenOfHPT
+        add     di, LocHPT_LenOfHPT
+        dec     dh
+        jnz     PSSHCWX_SyncPartLoop
+
+        ret
+PARTSCAN_SyncHideConfigWithXref EndP
+
+ibm_bm_name     db 'OS2 BootMgr',0
+;win_bm_name:    db 'BOOTMGR',0
Index: trunk/bootcode/regular/password.asm
===================================================================
--- trunk/bootcode/regular/password.asm	(revision 57)
+++ trunk/bootcode/regular/password.asm	(revision 57)
@@ -0,0 +1,185 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                       AiR-BOOT / PASSWORD
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'PASSWORD',0
+ENDIF
+
+
+; Don't ask me, what I'm doing in here to encode the passwords. I don't even
+;  know by myself anymore. It's some kind of hash and I hope that it isn't weak
+;  and some mad uber-hacker-god will laugh about it - but i bet so ;-)
+
+PASSWORD_AskSystemPwd           Proc Near   Uses ax bx si di
+   ; Asks System Password, if set...
+   test    byte ptr [CFG_PasswordSystem], 1
+   jz      PASP_NoPassword
+      mov     ax, 0ABABh
+      mov     si, offset TXT_ProtectedSystem
+      xor     di, di                     ; May Access With ANY correct password
+      call    PASSWORD_AskSpecifiedPassword
+  PASP_NoPassword:
+   ret
+PASSWORD_AskSystemPwd           EndP
+
+PASSWORD_AskChangeBootPwd       Proc Near   Uses ax bx si di
+   ; Asks System Password, if set...
+   test    byte ptr [CFG_PasswordChangeBoot], 1
+   jz      PACBP_NoPassword
+   test    byte ptr [TimedBootUsed], 1
+   jnz     PACBP_NoPassword
+      mov     ax, 0ABABh
+      mov     si, offset TXT_ProtectedBootUp
+      xor     di, di                     ; May Access With ANY correct password
+      call    PASSWORD_AskSpecifiedPassword
+  PACBP_NoPassword:
+   ret
+PASSWORD_AskChangeBootPwd       EndP
+
+;CFG_MasterPassword           dw 0101Fh   ; Encoded Password (this is just CR)
+;                             dw 07A53h
+;                             dw 0E797h
+;                             dw 0A896h
+; BUGBUG - If unspecified password to ask, check if one of our two are CR
+;          And if that's the case, we need to skip over checking that one.
+;          If both are CR, return to caller
+
+
+;        In: ax - Magic for AskPassword Subroutine
+;            si - Text to show, when asking for password
+;            di - which password to check, use 0 to check any of both
+; Destroyed: None
+PASSWORD_AskSpecifiedPassword   Proc Near   Uses cx dx ds si es di bp
+   local AskPasswordMiss:byte, AskPasswordText:word, AskPasswordMagic:word, AskPasswordWhich:word
+   mov     [AskPasswordMagic], ax
+   mov     [AskPasswordText], si
+   mov     [AskPasswordWhich], di
+   mov     ax, cs
+   mov     ds, ax
+   mov     es, ax
+   mov     di, offset TempPasswordEntry
+   mov     al, 32
+   mov     cx, 8
+   rep     stosb                         ; Generates empty password
+   mov     byte ptr [AskPasswordMiss], 0
+   mov     ax, [AskPasswordWhich]
+   or      ax, ax
+   jnz     PASP_BadBoyRetry              ; Only check one
+   ; Encode empty Password...
+   mov     si, offset TempPasswordEntry
+   call    PASSWORD_Encode
+   mov     di, offset CFG_MasterPassword
+   mov     si, offset PasswordSpace      ; Check Thiz Out
+   mov     cx, 8
+   repe    cmpsb
+   je      PASP_DualCorrect1
+   jmp     PASP_LetUserGuessPassword
+  PASP_DualCorrect1:
+   mov     si, offset PasswordSpace      ; Check Thiz Out
+   mov     cx, 8
+   repe    cmpsb
+   je      PASP_CorrectPass
+   jmp     PASP_LetUserGuessPassword
+
+  PASP_BadBoyRetry:
+      ; Encode given Password...
+      mov     si, offset TempPasswordEntry
+      call    PASSWORD_Encode
+
+      ; ...and compare it to the specified on-board one
+      mov     di, [AskPasswordWhich]
+      or      di, di
+      jnz     PASP_OnlyCheckSpecified
+      mov     di, offset CFG_MasterPassword
+      mov     si, offset PasswordSpace   ; Check Thiz Out
+      mov     cx, 8
+      repe    cmpsb
+      je      PASP_CorrectPass
+      mov     di, offset CFG_BootPassword
+     PASP_OnlyCheckSpecified:
+      mov     si, offset PasswordSpace   ; Check Thiz Other Thingie Out
+      mov     cx, 8
+      repe    cmpsb
+      je      PASP_CorrectPass
+
+     PASP_LetUserGuessPassword:          ; ;-)))
+      mov     ax, [AskPasswordMagic]
+      mov     si, [AskPasswordText]
+      mov     di, offset TempPasswordEntry
+      call    SETUP_LetEnterPassword
+   inc     byte ptr [AskPasswordMiss]
+   cmp     byte ptr [AskPasswordMiss], 10
+   jae     PASP_BadBoyAlert
+   jmp     PASP_BadBoyRetry
+
+  PASP_BadBoyAlert:                      ; Whaddayawant ;)
+   mov     ax, 0ABABh
+   mov     cx, 0B03h
+   mov     si, offset TXT_TooManyTries
+   call    SETUP_ShowErrorBox
+   jmp     MBR_HaltSystem
+
+  PASP_CorrectPass:
+   ret
+PASSWORD_AskSpecifiedPassword   EndP
+
+PasswordSpace                db 16 dup (0) ; Space for Password-Encoding...
+                             dw 0BABEh     ; All of these 8 bytes are insider
+                             dw 0FC77h     ;  jokes. I bet no one will solve
+                             dw 0632Fh     ;  all of them =) they are used by
+                             dw 0CD09h     ;  the algo, so don't remove them.
+
+;        In: SI - Pointer to Password, fixed len (8 bytes)
+;       Out: Password-Space filled with encoded password
+; Destroyed: None
+PASSWORD_Encode                 Proc Near   Uses ax cx ds si es di
+   mov     ax, cs
+   mov     es, ax
+   mov     di, offset PasswordSpace
+   mov     cx, 8
+  PE_HashLoop:
+      lodsb
+      mov     es:[di], al
+      xor     al, 0ABh
+      and     al, 7
+      mov     es:[di+8], al              ; Init Hash Table
+      inc     di
+   loop    PE_HashLoop
+
+   mov     si, offset PasswordSpace
+   mov     cx, 8
+  PE_ContinueLoop:
+      mov     al, ds:[si]
+      ;movzx   bx, ds:[si+8]
+      mov   bl,ds:[si+8]
+      mov   bh,0
+
+      add     bl, 16
+      mov     ah, ds:[si+bx]
+
+      xor     al, ds:[si-1]
+      xor     al, ah
+      mov     ds:[si], al
+
+      inc    si
+   loop    PE_ContinueLoop
+   ret
+PASSWORD_Encode                 EndP
Index: trunk/bootcode/regular/std_text.asm
===================================================================
--- trunk/bootcode/regular/std_text.asm	(revision 57)
+++ trunk/bootcode/regular/std_text.asm	(revision 57)
@@ -0,0 +1,114 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                           AiR-BOOT / TEXT
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'STD_TEXT',0
+ENDIF
+
+; If you modify this Copyright and release this under your own name,
+; I'm going to sue your cheap ass, rape your dog and blow up your house. =)
+
+CopyrightVersionLen   equ   6
+;Copyright             db ' AiR-BOOT v1.06 - (c) 1998-2009 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
+;Copyright             db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Rousseau test-version >502G (build: #24)', 0
+;Copyright             db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz   -  Release Candidate 1  -  (build: #25)', 0
+;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc2-b27)', 0
+;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc3-b31)', 0
+;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc4-b33)', 0
+;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc5-b35)', 0
+;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
+;Copyright             db ' AiR-BOOT v1.0.8 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
+
+;Copyright             db ' AiR-BOOT v1.0.8-internal-beta - ** !! NOT FOR DISTRIBUTION !! **', 0
+;Copyright             db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz    <<Release Candidate>>    (build: #18)', 0
+;Copyright             db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz  <<Release Candidate 1>> (bld: 20120124)', 0
+;Copyright             db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz  <<Release Candidate 2>> (bld: 20120224)', 0
+
+
+;~ Copyright             db ' AiR-BOOT v',BLDLVL_MAJOR_VERSION,'.',BLDLVL_MIDDLE_VERSION,'.',BLDLVL_MINOR_VERSION,' - (c) ',BLDLVL_YEAR,' M. Kiewitz  <<Internal Release 2l>> (bld: ',BLDLVL_YEAR,BLDLVL_MONTH,BLDLVL_DAY,')', 0
+
+;
+; Masm found the above to be too complex, so we broke it up.
+;
+Copyright:
+            db ' AiR-BOOT v'
+            db BLDLVL_MAJOR_VERSION,'.'
+            db BLDLVL_MIDDLE_VERSION,'.'
+            db BLDLVL_MINOR_VERSION,' - (c) 1998-'
+            db BLDLVL_YEAR
+            ;~ db ' M. Kiewitz  <<Release Candidate 4>> (bld: '
+            db ' Martin Kiewitz, Dedicated to Gerd Kiewitz'
+            ;~ db BLDLVL_YEAR
+            ;~ db BLDLVL_MONTH
+            ;~ db BLDLVL_DAY,')'
+            db 0
+
+;
+; Normal copyright notice.
+;
+;~ Copyright   db ' AiR-BOOT v1.0.8 - (c) 1998-2012 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
+
+
+
+; License and source info.
+BootEndMsg      db 'This is GPLv3+ software, please visit: http://www.gnu.org/licenses/gpl.txt', 0
+BootEndMsg2     db 'To obtain the sources,   please visit: http://svn.netlabs.org/air-boot', 0
+
+; Bugger...
+CheckID_MBR     db 'AiRBOOT'
+BrokenHDD       db ' (HDDx)', 0
+
+; Colors for special words hard-coded. Keep all 0s.
+TXT_SETUP_LowerMessage      db 'This software is released under ', 0, 'GPLv3+', 0
+                            db 'http://www.gnu.org/licenses/gpl.txt', 0
+                            db 'For more information and source, please visit:', 0
+                            db 'http://svn.netlabs.org/air-boot', 0
+                            db 'Contact via e-mail: ', 0, 'airboot@ecomstation.com', 0
+
+; Table that points to BIOS device names.
+ContinueBIOSbootTable   dw offset TXT_SETUP_MAGIC_CDROM
+                        dw offset TXT_SETUP_MAGIC_Network
+                        dw offset TXT_SETUP_MAGIC_ZIPLS
+                        dw     0
+
+; Com-port debugging header.
+AuxInitMsg              db 'Initializing Serial Communications on COM',0
+
+; LVM protection messages; should be translated and moved to lang-files.
+TXT_SETUP_NoEditType35      db 'Labels of LVM-Data partitions cannot be changed', 0
+TXT_SETUP_NoBootType35      db 'LVM-Data partitions cannot be set bootable', 0
+TXT_BootMenuPowerOff        db 'DEL to Power Off', 0
+TXT_NoINT13XSupport         db  'This BIOS does not support Extended INT13h Functions', 0
+;~ TXT_ERROR_TooManyPartitions db 'Too many partitions! -- Proper operation not guaranteed!', 0
+
+; MBR protection; should also be translated and moved.
+NonMBRwrite     db  'AiR-BOOT TRIED TO WRITE A non-MBR TO DISK !!',0
+NonMBRwrite_rep db  'Please report this at airboot@ecomstation.com',0
+SystemHalted    db  'System Halted',0
+
+; Build Information string.
+build_info      db  'Build Date: ',0
+jwasm_txt       db  'JWasm',0
+masm_txt        db  'Masm',0
+wasm_txt        db  'Wasm',0
+tasm_txt        db  'Tasm',0
+unknown_txt     db  '????',0
+
Index: trunk/bootcode/regular/timer.asm
===================================================================
--- trunk/bootcode/regular/timer.asm	(revision 57)
+++ trunk/bootcode/regular/timer.asm	(revision 57)
@@ -0,0 +1,111 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                          AiR-BOOT / TIMER
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'TIMER',0
+ENDIF
+
+; This here is one of the rare cases that I'm using DIV and MUL opcodes. I
+;  could have coded around them in here as well, but I was too lazy. Most of
+;  the time, I'm not using them. If you want to look at something "leet", look
+;  at SPECIAL\FX.asm =)
+
+;        In: Nothing
+;       Out: DX:AX - Current TimerTicCount
+TIMER_GetTicCount               Proc Near   Uses ds si
+   push    0040h
+   pop     ds
+   mov     si, 006Ch
+   mov     ax, word ptr ds:[si]
+   mov     dx, word ptr ds:[si+2]
+   ret
+TIMER_GetTicCount               EndP
+
+;        In: AL - Timer-Tics to wait
+;       Out: Nothing
+TIMER_WaitTicCount              Proc Near   Uses ax bx dx
+   ;movzx   bx, al
+   mov   bl,al
+   mov   bh,0
+
+   call    TIMER_GetTicCount
+   add     bx, ax                        ; BX - Required lower Tic
+  TWTC_Loop:
+      call    TIMER_GetTicCount
+      cmp     ax, bx
+      jb      TWTC_Loop
+   ret
+TIMER_WaitTicCount              EndP
+
+;        In: AL - Seconds
+;       Out: AX - Tics
+TIMER_TranslateSecToTic         Proc Near   Uses bx dx
+   or      al, al
+   jz      TTSTT_Zerod
+   xor     ah, ah
+   mov     dl, 5
+   div     dl                            ; Seconds : 5
+   mov     bh, ah
+   xor     ah, ah
+   mov     bl, 91
+   mul     bl                            ; Result * 91
+   mov     dx, ax
+   ;movzx   ax, bh
+   mov   al,bh
+   mov   ah,0
+
+   mov     bl, 18
+   mul     bl                            ; Remainder * 18
+   add     ax, dx                        ; Add both together...
+  TTSTT_Zerod:
+   ret
+TIMER_TranslateSecToTic         EndP
+
+;        In: AX - Tics
+;       Out: AL - Seconds
+TIMER_TranslateTicToSec         Proc Near   Uses bx dx
+   or      ax, ax
+   jz      TTTTS_Overflow
+   cmp     ax, 23295
+   ja      TTTTS_Overflow
+   mov     dl, 91
+   div     dl                            ; Tics : 91
+   mov     dh, al
+   ;movzx   ax, ah
+   mov   al,ah
+   mov   ah,0
+
+   mov     dl, 18
+   div     dl                            ; Remainder : 18
+   xor     ah, ah                        ; We dont need that remainder
+   xchg    dh, al
+   mov     bl, 5
+   mul     bl                            ; Result * 5
+   ;movzx   dx, dh
+   mov   dl,dh
+   mov   dh,0
+
+   add     ax, dx                        ; Add both together...
+   ret
+  TTTTS_Overflow:
+   xor     ax, ax
+   ret
+TIMER_TranslateTicToSec         EndP
Index: trunk/bootcode/regular/videoio.asm
===================================================================
--- trunk/bootcode/regular/videoio.asm	(revision 57)
+++ trunk/bootcode/regular/videoio.asm	(revision 57)
@@ -0,0 +1,965 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                      AiR-BOOT / VIDEO I/O
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'VIDEOIO',0
+ENDIF
+
+VideoIO_WaitRetrace Proc Near   Uses ax dx
+        mov     dx, 3DAh
+    VIOWR_Jump1:
+        in      al, dx
+        test    al, 8
+        jnz     VIOWR_Jump1
+    VIOWR_Jump2:
+        in      al, dx
+        test    al, 8
+        jz      VIOWR_Jump2
+        ret
+VideoIO_WaitRetrace EndP
+
+
+
+; Holds the current position. Yeah, I know this is in the code area, but who
+;  cares :))
+TextPosY                    db  0h
+TextPosX                    db  0h
+TextColorFore               db  7h
+TextColorBack               db  0h
+
+;        In: CH - Cursor Column, CL - Cursor Row (Start at 1,1)
+; Destroyed: None
+VideoIO_Locate  Proc Near   Uses cx
+        or      ch, ch
+        jz      VIOL_IgnoreY
+        dec     ch
+        mov     TextPosY, ch
+    VIOL_IgnoreY:
+        or      cl, cl
+        jz      VIOL_IgnoreX
+        dec     cl
+        mov     TextPosX, cl
+    VIOL_IgnoreX:
+        ret
+VideoIO_Locate  EndP
+
+;        In: CH - Cursor Column, CL - Center Cursor Row (Start at 1,1)
+;            DX - Length to use for centering
+; Destroyed: None
+VideoIO_LocateToCenter          Proc Near   Uses cx dx
+   shr     dl, 1                         ; Length / 2
+   sub     cl, dl
+   call    VideoIO_Locate
+   ret
+VideoIO_LocateToCenter          EndP
+
+;        In: CH - Color Fore, CL - Color Back
+; Destroyed: None
+VideoIO_Color                   Proc Near   Uses cx
+    mov    TextColorFore, CH
+    mov    TextColorBack, CL
+    ret
+VideoIO_Color                   EndP
+
+VideoIO_CursorOff               Proc Near   Uses ax cx
+   mov     ax, 0102h                     ; 02 for fixup on AMI BIOS
+   mov     cx, 1000h
+   int     10h                           ; Clears cursor
+   ret
+VideoIO_CursorOff               EndP
+
+VideoIO_CursorOn                Proc Near   Uses ax cx
+   mov     ax, 0102h                     ; 02 for fixup on AMI BIOS
+   mov     cx, 0F0Eh
+   int     10h                           ; Builds cursor
+   ret
+VideoIO_CursorOn                EndP
+
+VideoIO_CursorSet               Proc Near   Uses ax bx dx
+   mov     ah, 02h
+   xor     bh, bh
+   mov     dh, TextPosY
+   mov     dl, TextPosX
+   int     10h
+   ret
+VideoIO_CursorSet               EndP
+
+VideoIO_Internal_SetRegs        Proc Near   Uses bx
+   mov     ax, VideoIO_Segment
+   mov     es, ax
+   ;movzx   ax, TextPosY
+   mov   al,TextPosY
+   mov   ah,0
+
+   mov     bl, 160
+   mul     bl
+   xor     bh, bh
+   mov     bl, TextPosX
+   shl     bl, 1
+   add     ax, bx
+   mov     di, ax                        ; Location at ES:DI
+   mov     ah, TextColorFore
+   mov     al, TextColorBack
+   shl     al, 4
+   or      ah, al                        ; Color Attribute in AH
+   ret
+VideoIO_Internal_SetRegs        EndP
+
+;        In: SI - String to Print (EOS is 0)
+; Destroyed: SI
+VideoIO_Print                   Proc Near   Uses ax es di
+   call    VideoIO_Internal_SetRegs
+     VIOP_Loop:
+      lodsb
+      or      al, al
+      jz      VIOP_End
+      mov     es:[di], al
+      mov     es:[di+1], ah
+      add     di, 2
+      inc     TextPosX
+      jmp     VIOP_Loop
+  VIOP_End:
+   ret
+VideoIO_Print                   EndP
+
+;        In: SI - String to Print (EOS is 0)
+; Destroyed: SI
+VideoIO_PrintLikeLenOfName      Proc Near   Uses cx es di
+   push    si
+      xor     cx, cx
+     VIOPLLON_Loop:
+         lodsb
+         inc     cx
+      or      al, al
+      jnz     VIOPLLON_Loop
+   pop     si
+   call    GetLenOfName                  ; Gets the real length...tricky ;)
+   jz      VIOPLLON_Nul
+   call    VideoIO_FixedPrint            ; we are lazy :)
+  VIOPLLON_Nul:
+   ret
+VideoIO_PrintLikeLenOfName      EndP
+
+;        In: SI - String to Print
+;            CL - Len Of String
+; Destroyed: SI
+VideoIO_FixedPrint              Proc Near   Uses es di
+   or      cl, cl
+   jz      VIOFP_NoString
+   call    VideoIO_Internal_SetRegs
+  VIOFP_Loop:
+      lodsb
+      mov     es:[di], al
+      mov     es:[di+1], ah
+      add     di, 2
+      inc     [TextPosX]
+  dec      cl
+  jnz      VIOFP_Loop
+ VIOFP_NoString:
+   ret
+VideoIO_FixedPrint              EndP
+
+; Rousseau:
+; Turn off blinking
+; http://www.ctyme.com/intr/rb-0088.htm does not mention this
+VideoIO_NoBlinking              Proc Near   Uses ax bx
+      mov      bx,0
+      mov      ax,1003h
+      int      10h
+   ret
+VideoIO_NoBlinking              EndP
+
+;        In: AL - Single Char to Print
+; Destroyed: None
+VideoIO_PrintSingleChar         Proc Near   Uses ax bx es di
+    mov     bl, al
+    call    VideoIO_Internal_SetRegs
+    mov     es:[di], bl
+    mov     es:[di+1], ah
+    inc     TextPosX
+    ret
+VideoIO_PrintSingleChar         EndP
+
+
+
+; Print hex-byte to screen
+; This outputs two characters
+; In:          AL - byte to send
+; Out:         AL - byte sent
+; Destroyed:   None
+VideoIO_PrintHexByte    Proc     Near  Uses  ax
+      call     CONV_BinToAsc              ; Returns high hex-nibble in AH, low hex-nibble in AL
+      xchg     al,ah                      ; High hex-nibble first
+      call     VideoIO_PrintSingleChar    ; Output to screen
+      xchg     al,ah                      ; Low hex-nibble next
+      call     VideoIO_PrintSingleChar    ; Output to screen
+      ret
+VideoIO_PrintHexByte    EndP
+
+
+; Print hex-word to screen
+; This outputs four characters
+; In:          AX - word to send
+; Out:         AX - word sent
+; Destroyed:   None
+VideoIO_PrintHexWord    Proc     Near
+      xchg     al,ah                      ; High byte first
+      call     VideoIO_PrintHexByte       ; Output to screen
+      xchg     al,ah                      ; low byte next
+      call     VideoIO_PrintHexByte       ; Output to screen
+      ret
+VideoIO_PrintHexWord    EndP
+
+
+; Print hex-dword to screen
+; This outputs eight characters
+; In:          DX:AX - dword to send
+; Out:         DX:AX - dword sent
+; Destroyed:   None
+VideoIO_PrintHexDWord   Proc     Near
+      xchg     ax,dx
+      call     VideoIO_PrintHexWord       ; High word first
+      xchg     ax,dx
+      call     VideoIO_PrintHexWord       ; Low word next
+      ret
+VideoIO_PrintHexDWord   EndP
+
+
+; Print hex-qword to screen
+; This outputs sixteen characters
+; In:          BX:CX:DX:AX - qword to send
+; Out:         BX:CX:DX:AX - qword sent
+; Destroyed:   None
+VideoIO_PrintHexQWord   Proc     Near
+      xchg     dx,bx
+      xchg     ax,cx
+      call     VideoIO_PrintHexDWord      ; High dword first
+      xchg     dx,bx
+      xchg     ax,cx
+      call     VideoIO_PrintHexDWord      ; Low dword next
+      ret
+VideoIO_PrintHexQWord   EndP
+
+
+
+
+
+;        In: AL - Single Char to Print
+;            CL - Times to print it
+; Destroyed: None
+VideoIO_PrintSingleMultiChar    Proc Near   Uses ax bx cx es di
+   or      cl, cl
+   jz      VIOPSMC_NoChars
+   mov     bl, al
+   call    VideoIO_Internal_SetRegs
+  VIOPSMC_Loop:
+      mov     es:[di], bl
+      mov     es:[di+1], ah
+      add     di, 2
+      inc     TextPosX
+   dec     cl
+   jnz     VIOPSMC_Loop
+  VIOPSMC_NoChars:
+   ret
+VideoIO_PrintSingleMultiChar    EndP
+
+; Will print a number to screen (2 bytes t.m. 0-99)
+;        In: AL - Single Byte to Print
+; Destroyed: None
+VideoIO_PrintByteNumber         Proc Near   Uses ax bx dx es di
+   cmp     al, 99
+   ja      VIOPBN_DoNotWriteAnything
+   ;movzx   bx, al
+   mov   bl,al
+   mov   bh,0
+
+   call    VideoIO_Internal_SetRegs
+   cmp     bl, 10
+   jb      VIOPBN_Lower10
+   push    ax
+      ;movzx   ax, bl
+      mov   al,bl
+      mov   ah,0
+
+      mov     dl, 10
+      div     dl
+      mov     bh, al                     ; BH = Upper Number
+      mov     bl, ah                     ; BL = Rest
+   pop     ax
+ VIOPBN_Lower10:
+   add     bh, 30h
+   add     bl, 30h
+   mov     es:[di], bh
+   mov     es:[di+1], ah
+   mov     es:[di+2], bl
+   mov     es:[di+3], ah
+ VIOPBN_DoNotWriteAnything:
+   add     TextPosX, 2
+   ret
+VideoIO_PrintByteNumber         EndP
+
+; Will print a number to screen (dynamic bytes from 0 to 255)
+;        In: AL - Single Byte to Print
+; Destroyed: None
+VideoIO_PrintByteDynamicNumber  Proc Near   Uses ax bx cx dx es di               ; Rousseau: cx was missing from push-list
+   xor     cl, cl
+   mov     bh, al
+   call    VideoIO_Internal_SetRegs
+   xchg    bh, ah                        ; Exchange backgroundcolor with Number
+   cmp     ah, 10
+   jb      VIOPBDN_Lower10
+   cmp     ah, 100
+   jb      VIOPBDN_Lower100
+   ;movzx   ax, ah
+   mov   al,ah
+   mov   ah,0
+
+   mov     dl, 100
+   div     dl
+   add     al, 30h
+   mov     es:[di], al
+   mov     es:[di+1], bh
+   inc     TextPosX
+   add     di, 2
+ VIOPBDN_Lower100:
+   ;movzx   ax, ah
+   mov   al,ah
+   mov   ah,0
+
+   mov     dl, 10
+   div     dl
+   add     al, 30h
+   mov     es:[di], al
+   mov     es:[di+1], bh
+   inc     TextPosX
+   add     di, 2
+ VIOPBDN_Lower10:
+   add     ah, 30h
+   mov     es:[di], ah
+   mov     es:[di+1], bh
+   inc     TextPosX
+   add     di, 2
+   ret
+VideoIO_PrintByteDynamicNumber  EndP
+
+
+;        In: AL - Zeichen zum Zeichnen, CL - Wie oft
+; Destroyed: None Important
+VideoIO_Internal_MakeWinDown    Proc Near   Uses dx di
+   ;movzx   dx, cl
+   mov   dl,cl
+   mov   dh,0
+
+   mov     bl, al
+   call    VideoIO_Internal_SetRegs
+   mov     al, bl
+  VIOIMWD_Loop:
+      mov     es:[di], al
+      mov     es:[di+1], ah
+      add     di, 160
+      inc     TextPosY
+   dec     dx
+   jnz     VIOIMWD_Loop
+   ret
+VideoIO_Internal_MakeWinDown    EndP
+
+;        In: AL - Zeichen zum Zeichnen, CL - Wie oft
+; Destroyed: None Important
+VideoIO_Internal_MakeWinRight   Proc Near   Uses dx di
+   ;movzx  dx, cl
+   mov   dl,cl
+   mov   dh,0
+
+   mov    bl, al
+   call   VideoIO_Internal_SetRegs
+   mov    al, bl
+  VIOIMWR_Loop:
+      mov    es:[di], al
+      mov    es:[di+1], ah
+      add    di, 2
+      inc    TextPosX
+      dec    dx
+   jnz    VIOIMWR_Loop
+   ret
+VideoIO_Internal_MakeWinRight   EndP
+
+WinBeginPosY    db        0h
+WinBeginPosX    db        0h
+WinEndPosY      db        0h
+WinEndPosX      db        0h
+WinCharRight    db      0CDh
+WinCharDown     db      0B3h
+WinCharBB       db      0D5h
+WinCharBE       db      0B8h
+WinCharEB       db      0D4h
+WinCharEE       db      0BEh
+
+;        In: BX - Begin Position, DX - End Position
+; Destroyed: BX DX
+VideoIO_MakeWindow              Proc Near   Uses ax bx cx es di
+   mov     WinBeginPosY, bh
+   mov     WinBeginPosX, bl
+   mov     WinEndPosY, dh
+   mov     WinEndPosX, dl
+   mov     cx, bx
+   inc     ch
+   call    VideoIO_Locate                ; StartPos left line
+   mov     cl, WinEndPosY
+   sub     cl, WinBeginPosY
+   dec     cl
+   mov     al, WinCharDown
+   push    cx
+   call    VideoIO_Internal_MakeWinDown
+   mov     ch, WinBeginPosY
+   mov     cl, WinEndPosX
+   inc     ch
+   call    VideoIO_Locate                ; StartPos right line
+   pop     cx
+   mov     al, WinCharDown
+   call    VideoIO_Internal_MakeWinDown
+   ; Left & Right are already done...
+   mov     ch, WinBeginPosY
+   mov     cl, WinBeginPosX
+   call    VideoIO_Locate                ; StartPos upper line
+   mov     al, WinCharBB
+   call    VideoIO_PrintSingleChar
+   mov     cl, WinEndPosX
+   sub     cl, WinBeginPosX
+   dec     cl
+   mov     al, WinCharRight
+   push    cx
+   call    VideoIO_Internal_MakeWinRight
+   mov     al, WinCharBE
+   call    VideoIO_PrintSingleChar
+   mov     ch, WinEndPosY
+   mov     cl, WinBeginPosX
+   call    VideoIO_Locate                ; StartPos lower line
+   mov     al, WinCharEB
+   call    VideoIO_PrintSingleChar
+   pop     cx
+   mov     al, WinCharRight
+   call    VideoIO_Internal_MakeWinRight
+   mov     al, WinCharEE
+   call    VideoIO_PrintSingleChar
+   ; Frame done, now just filling...
+   mov     bh, WinEndPosY
+   sub     bh, WinBeginPosY
+   dec     bh
+   mov     bl, WinEndPosX
+   sub     bl, WinBeginPosX
+   dec     bl
+
+  VIOIMW_Loop:
+      mov     ch, WinBeginPosY
+      add     ch, bh
+      mov     cl, WinBeginPosX
+      inc     cl
+      call    VideoIO_Locate
+
+      mov     al, 20h
+      mov     cl, bl
+      push    bx
+      call    VideoIO_Internal_MakeWinRight
+      pop     bx
+   dec     bh
+   jnz     VIOIMW_Loop
+   ret
+VideoIO_MakeWindow              EndP
+
+;        In: AX - Segment to copy B800 to...
+; Destroyed: BX DX
+VideoIO_BackUpTo                Proc Near   Uses cx ds si es di
+   mov     es, ax
+   mov     ax, 0B800h
+   mov     ds, ax
+   xor     si, si
+   xor     di, di
+   mov     cx, 800h                         ; Copy 1000h bytes
+   rep     movsw
+   ret
+VideoIO_BackUpTo                EndP
+
+VideoIO_RestoreFrom             Proc Near   Uses cx ds si es di
+   mov     ds, ax
+   mov     ax, 0B800h
+   mov     es, ax
+   xor     si, si
+   xor     di, di
+   mov     cx, 800h                         ; Copy 1000h bytes
+   rep     movsw
+   ret
+VideoIO_RestoreFrom             EndP
+
+;        In: CL - Total Length of String
+;            DS:SI - Actual String
+;       Out: Carry Set if String was ENTERd
+; Destroyed: *none*
+VideoIO_LetUserEditString       Proc Near   Uses ax bx cx dx si es di
+   local StartPosX:byte, LastPosX:byte
+   local StringLen:byte
+
+   or      cl, cl
+   jnz     VIOLUES_LenNotNUL
+   clc
+   ret
+
+  VIOLUES_LenNotNUL:
+   mov     al, TextPosX
+   inc     al
+   mov     StartPosX, al
+   mov     StringLen, cl
+
+   push    cx
+      call    VideoIO_Internal_SetRegs   ; ES:DI - Pos on Screen at Start
+
+      xor     ch, ch
+      call    GetLenOfName               ; CX - Actual Length of String
+      mov     dl, cl
+
+      ; Set Cursor behind String and turn it on...
+      add     cl, StartPosX
+      call    VideoIO_Locate
+      call    VideoIO_CursorSet
+      call    VideoIO_CursorOn           ; Set and turn cursor on
+
+      ; ES:DI - Screen-Position to Start of String
+      ; DL    - Position in String (relative to begin, base=0)
+
+     VIOLUES_Loop:
+         mov     ah, 0
+         int     16h
+         cmp     ah, Keys_ESC
+         je      VIOLUES_KeyESC
+         cmp     ah, Keys_ENTER
+         je      VIOLUES_KeyENTER
+         cmp     ah, Keys_Backspace
+         je      VIOLUES_KeyBACKSPACE
+         ; Check for valid char...
+         cmp     al, 32
+         jb      VIOLUES_Loop
+         cmp     al, 166
+         ja      VIOLUES_Loop
+         ; Okay, Character to add to string
+         cmp     dl, StringLen           ; String "full" ?
+         jae     VIOLUES_Loop
+         ;movzx   bx, dl
+         mov   bl,dl
+         mov   bh,0
+
+         shl     bx, 1
+         mov     es:[di+bx], al
+         inc     dl
+        VIOLUES_UpdateCursor:
+         mov     cl, dl
+         add     cl, StartPosX
+         call    VideoIO_Locate
+         call    VideoIO_CursorSet
+         jmp     VIOLUES_Loop
+
+        VIOLUES_KeyBACKSPACE:
+         or      dl, dl                  ; String "empty" ?
+         jz      VIOLUES_Loop
+         mov     al, ' '
+         dec     dl
+         ;movzx   bx, dl
+         mov   bl,dl
+         mov   bh,0
+
+         shl     bx, 1
+         mov     es:[di+bx], al
+         jmp     VIOLUES_UpdateCursor
+
+  VIOLUES_KeyESC:
+   pop     cx
+   call    VideoIO_CursorOff             ; Bye Bye cursor
+   clc
+   ret
+
+  VIOLUES_KeyENTER:
+   pop     cx
+   ; ENTERd, so copy data to String-Pointer...
+  VIOLUES_CopyLoop:
+      mov     al, es:[di]
+      add     di, 2
+      mov     ds:[si], al
+      inc     si
+   dec     cl
+   jnz     VIOLUES_CopyLoop
+   ; Finally Cursor off-line...
+   call    VideoIO_CursorOff
+   stc
+   ret
+VideoIO_LetUserEditString       EndP
+
+
+
+;
+; Rousseau Additions.
+;
+
+
+; Function Template
+;ProcName                        Proc Near   Uses ax bx cx dx si es di
+;ProcName                        EndP
+
+
+;
+; Clear the current page
+;
+VideoIO_ClearScreen             Proc Near   Uses ax bx cx dx si es di
+   mov   al, 0       ; clear entire window
+   mov   bh,07h      ; Attribute for new lines
+   xor   cx,cx       ; Row, Column ULC
+   xor   dx,dx
+   dec   dx          ; Row, Column LRC (does this corrupt other pages ?)
+   mov   ah, 06h     ; Function Code
+   int   10h         ; Do It !
+   ret
+VideoIO_ClearScreen             EndP
+
+;
+; Set position to teletype cursor
+;
+VideoIO_SyncPos                 Proc Near   Uses ax bx cx dx
+   pushf
+   mov   bh, 0
+   mov   ah, 03h
+   int   10h
+   mov   [TextPosX], dl
+   mov   [TextPosY], dh
+   popf
+   ret
+VideoIO_SyncPos                 EndP
+
+;
+; Put the Build Information at the POST BIOS screen.
+;
+VideoIO_PrintBuildInfo  Proc    Near    Uses ax cx si di
+        ; Print header.
+        mov     si, offset build_info
+        call    MBR_Teletype
+
+        ; Prepare info in temorary buffer.
+        mov     si,offset bld_level_date_start
+        mov     cx,offset bld_level_date_end
+        sub     cx,si
+        mov     di,offset Scratch
+        cld
+        rep     movsb
+
+        ; Fill spaces until assembler specification.
+        mov     al,' '
+        mov     cx,37
+        rep     stosb
+
+        ; Copy assembler specification.
+    IFDEF       JWASM
+        mov     al,'['
+        stosb
+        mov     si,offset jwasm_txt
+    ELSEIFDEF   TASM
+        mov     al,' '
+        stosb
+        mov     al,'['
+        stosb
+        mov     si,offset tasm_txt
+
+    ELSEIFDEF   WASM
+        mov     al,' '
+        stosb
+        mov     al,'['
+        stosb
+        mov     si,offset wasm_txt
+    ELSEIFDEF   MASM
+        mov     al,' '
+        stosb
+        mov     al,'['
+        stosb
+        mov     si,offset masm_txt
+    ELSE
+        mov     al,' '
+        stosb
+        mov     al,'['
+        stosb
+        mov     si,offset unknown_txt
+    ENDIF
+
+    VideoIO_PrintBuildInfo_a1:
+        lodsb
+        test    al,al
+        jz      VideoIO_PrintBuildInfo_e1
+        stosb
+        jmp     VideoIO_PrintBuildInfo_a1
+    VideoIO_PrintBuildInfo_e1:
+        mov     al,']'
+        stosb
+
+        ; Insert NULL Terminator.
+        xor     al,al
+        stosb
+
+        ; Print Info.
+        mov     si, offset Scratch
+        call    MBR_TeletypeNL
+        ret
+VideoIO_PrintBuildInfo  EndP
+
+;VideoIO_DBG_WriteString         Proc Near   Uses ax bx cx dx si es di
+;   mov   ch, [CFG_Partitions]                                                    ; y
+;   add   ch, 7
+;   add   ch, [CFG_IncludeFloppy]
+;   push cx
+;   mov   cl, 1                                                                   ; x
+;   call  VideoIO_Locate
+;   mov   ch, 15                                                                  ; fgc
+;   mov   cl, 0                                                                   ; bgc
+;   call  VideoIO_Color
+;   mov   si, offset ShowBootLog
+;   call  VideoIO_Print
+;   pop cx
+;   inc   ch
+
+;   ;mov   ch, 21                                                                 ; y
+;   mov   cl, 1                                                                   ; x
+;   call  VideoIO_Locate
+;   mov   ch, 15                                                                  ; fgc
+;   mov   cl, 0                                                                   ; bgc
+;   call  VideoIO_Color
+
+
+   ; Rousseau:
+;   mov al, [NewPartitions]
+   ;call  VideoIO_PrintByteDynamicNumber
+;   mov al, [CFG_Partitions]
+   ;call  VideoIO_PrintByteDynamicNumber
+;   ret
+;VideoIO_DBG_WriteString         EndP
+
+
+; Dump the disk-info.
+; Disk number is in DL.
+VideoIO_DumpDiskInfo    Proc Near uses ax bx cx dx
+
+    VideoIO_DumpDiskInfo_next_disk:
+        push    dx
+        xor     ax,ax
+        mov     al,[TextPosY]
+        push    ax
+
+        mov     ax,21
+        mov     dh,dl
+        and     dh,01111111b
+        mul     dh
+        mov     dh,al
+
+        mov     [TextPosX],dh
+
+        mov     si, offset [Disk]
+        call    VideoIO_Print
+        mov     al,dl
+
+        ; NIET GOED, GAAT FOUT > 9, HEX PRINT GEBRUIKEN !!
+        shr     al,4
+        add     al,'0'
+        call    VideoIO_PrintSingleChar
+        mov     al,dl
+        and     al,01111111b
+        add     al,'0'
+        call    VideoIO_PrintSingleChar
+        mov     al,'h'
+        call    VideoIO_PrintSingleChar
+
+        inc     [TextPosY]
+        mov     [TextPosX],dh
+
+        mov     al,'-'
+        mov     cl,17
+        call    VideoIO_PrintSingleMultiChar
+
+        ;~ inc     [TextPosY]
+        ;~ mov     [TextPosX],dh
+        ;~ mov     si, offset BiosCyls
+        ;~ call    VideoIO_Print
+
+        ;~ push    dx
+        ;~ mov     bx,offset BIOS_Cyls
+        ;~ xor     dh,dh
+        ;~ and     dl,01111111b
+        ;~ shl     dx,1
+        ;~ shl     dx,1
+        ;~ add     bx,dx
+        ;~ mov     ax,[bx]
+        ;~ mov     dx,[bx+02]
+        ;~ call    VideoIO_PrintHexDWord
+        ;~ pop     dx
+
+        inc     [TextPosY]
+        mov     [TextPosX],dh
+        mov     si, offset BiosHeads
+        call    VideoIO_Print
+
+        push    dx
+        mov     bx,offset BIOS_Heads
+        xor     dh,dh
+        and     dl,01111111b
+        shl     dx,1
+        shl     dx,1
+        add     bx,dx
+        mov     ax,[bx]
+        mov     dx,[bx+02]
+        call    VideoIO_PrintHexDWord
+        pop     dx
+
+        inc     [TextPosY]
+        mov     [TextPosX],dh
+        mov     si, offset BiosSecs
+        call    VideoIO_Print
+
+        push    dx
+        mov     bx,offset BIOS_Secs
+        xor     dh,dh
+        and     dl,01111111b
+        shl     dx,1
+        shl     dx,1
+        add     bx,dx
+        mov     ax,[bx]
+        mov     dx,[bx+02]
+        call    VideoIO_PrintHexDWord
+        pop     dx
+
+        inc     [TextPosY]
+        mov     [TextPosX],dh
+        mov     si, offset LvmSecs
+        call    VideoIO_Print
+
+        push    dx
+        ; Offset of array containing LVM SPT values for each disk found
+        mov     bx,offset TrueSecs
+        ; DX to index
+        xor     dh,dh
+        and     dl,01111111b
+        shl     dx,1
+        shl     dx,1
+        add     bx,dx
+        ; Get LVM SPT
+        mov     ax,[bx]
+        mov     dx,[bx+02]
+        call    VideoIO_PrintHexDWord
+        pop     dx
+
+        inc     [TextPosY]
+        mov     [TextPosX],dh
+        mov     si, offset BiosLBA
+        call    VideoIO_Print
+
+        push    dx
+        mov     bx,offset BIOS_TotalSecs
+        xor     dh,dh
+        and     dl,01111111b
+        shl     dx,1
+        shl     dx,1
+        shl     dx,1
+        add     bx,dx
+        mov     ax,[bx]
+        mov     dx,[bx+02]
+        call    VideoIO_PrintHexDWord
+        pop     dx
+
+        inc     [TextPosY]
+        mov     [TextPosX],dh
+
+        pop     ax
+        mov     [TextPosY],al
+        pop     dx
+
+        inc     dl
+        mov     al,dl
+        and     al,01111111b
+        cmp     al,[TotalHarddiscs]
+        jae     VideoIO_DumpDiskInfo_end
+        jmp     VideoIO_DumpDiskInfo_next_disk
+
+    VideoIO_DumpDiskInfo_end:
+        mov     [TextPosX],0
+        add     [TextPosY],6
+        ret
+VideoIO_DumpDiskInfo    EndP
+
+
+;
+; Set position to teletype cursor
+;
+VideoIO_ShowWaitDots    Proc
+        pusha
+        ; Color white on black
+        mov     ch,7
+        mov     cl,0
+        call    VideoIO_Color
+        ; Locate cursor for output of debug-info
+        mov     ch,8
+        mov     cl,1
+        call    VideoIO_Locate
+
+        ; Print dots with interval.
+        mov     cx,10
+    VideoIO_ShowWaitDots_next_dot:
+        mov     al,'.'
+        call    VideoIO_PrintSingleChar
+        ; Value 30 is about 1.5 seconds
+        mov     al,1
+        call    TIMER_WaitTicCount
+        loop    VideoIO_ShowWaitDots_next_dot
+        popa
+        ret
+VideoIO_ShowWaitDots    EndP
+
+
+
+; Disk Info to Dump to AB LogScreen
+Disk              db "DISK ",0
+;BiosCyls          db "Cyls    :",0
+BiosHeads         db "Heads   :",0
+BiosSecs          db "Secs    :",0
+LvmSecs           db "SecsLVM :",0
+BiosLBA           db "LBA Secs:",0
+
+
+HugeBootDisk      db "Boot Disk is Huge    : ",0
+DisksFound        db "Disks Found          : ",0
+PartitionsFound   db "Partitions Found     : ",0
+;AutoStartPart     db "Auto Start Partition : ",0
+
+Phase1            db "eCS Install Phase 1  : ",0
+
+
+ShowMenu          db "Press TAB to return to the AiR-BOOT Menu",0
+;ShowBootLog       db "Press TAB to see the Boot Log...",0
+
+Yes               db "YES",0
+No                db "NO",0
+;~ On                db "ON",0
+;~ Off               db "OFF",0
+;~ None              db "NONE",0
+;~ Active            db "ACTIVE",0
+NotActive         db "NOT ACTIVE",0
+
+; New Line for use by MBR_Teletype
+NL          db 0dh, 0ah, 0
Index: trunk/bootcode/setup/main.asm
===================================================================
--- trunk/bootcode/setup/main.asm	(revision 57)
+++ trunk/bootcode/setup/main.asm	(revision 57)
@@ -0,0 +1,1677 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                         AiR-BOOT SETUP / GENERIC & GENERAL SETUP ROUTINES
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'MAIN',0
+ENDIF
+
+;~ LocMENU_RoutinePtr           equ          0
+;~ LocMENU_VariablePtr          equ          2
+;~ LocMENU_ItemNamePtr          equ          4
+;~ LocMENU_ItemHelpPtr          equ          6
+;~ LocMENU_ItemPack             equ          8 ; only if VariablePtr>0
+
+SETUP_UpperFixString          db 'SETUP ',0 ; AddOn for "AiR-BOOT SETUP vX.XX"
+
+Include SETUP/MENUS.ASM                  ; Menu structures
+Include SETUP/PART_SET.ASM               ; Partition Setup (in extra file)
+
+;            CH - Current Item Number
+;       Out: SI - Pointer to Item Location
+; Destroyed: None
+SETUP_SwitchToSelectedItem      Proc Near   Uses ax cx
+   cmp     ch, 7
+   jne     SSTSI_ValidSize
+   stc     ; Invalid Item
+   ret
+  SSTSI_ValidSize:
+   test    ch, 1000b
+   jz      SSTSI_NoRightSide
+   and     ch, 111b
+   add     ch, 7                         ; fix Item-number to Real-Location
+  SSTSI_NoRightSide:
+   inc     ch                            ; So we will get a zero at the JZ
+   mov     si, bp
+   add     si, 3                         ; Skip FrontHeader for Menu
+  SSTSI_Loop:
+      dec     ch
+      jz      SSTSI_LoopEnd
+
+      mov     ax, word ptr ds:[si+LocMENU_VariablePtr]
+      or      ax, ax
+      jz      SSTSI_NoItemPack
+      add     si, LocMENU_LenOfItemPack  ; ItemPack bergehen
+     SSTSI_NoItemPack:
+      add     si, LocMENU_LenOfMenuPtrBlock ; Skip Ptr-Block (+3 deshalb, weil danach INC!)
+      jmp     SSTSI_Loop
+
+  SSTSI_LoopEnd:
+   clc
+   ret   ; Exit is here :)
+SETUP_SwitchToSelectedItem      EndP
+
+SETUP_CheckEnterSETUP           Proc Near
+
+   ; Rousseau: added
+   ;mov     SETUP_ExitEvent, 0
+   ;xor     al, al                        ; -PARTITION SETUP PreDefines-
+   ;mov     PartSetup_UpperPart, al       ; Upper-Partition == 0
+   ;mov     PartSetup_ActivePart, al      ; Active-Partition == 0
+
+   ; Setup PartitionPointers-Table...again (needed when re-entering setup)
+   ;call    PART_CalculateStraightPartPointers
+   ;call    VideoIO_DBG_WriteString
+   ; Rousseau: end added
+
+
+
+   test    byte ptr [CFG_AutoEnterSetup], 1
+   jnz     SCES_ForceEnter
+   mov     al, [SETUP_KeysOnEntry]
+   test    al, Keys_Flags_EnterSetup
+IFDEF ReleaseCode
+   jz      SCES_NoEnterSETUP
+ENDIF
+  SCES_ForceEnter:
+   call    SETUP_Main
+  SCES_NoEnterSETUP:
+   ret
+SETUP_CheckEnterSETUP           EndP
+
+SETUP_Main                      Proc Near   Uses si es bp
+   mov     byte ptr [SETUP_ExitEvent], 0
+   xor     al, al                        ; -PARTITION SETUP PreDefines-
+   mov     [PartSetup_UpperPart], al       ; Upper-Partition == 0
+   mov     [PartSetup_ActivePart], al      ; Active-Partition == 0
+
+   ; Setup PartitionPointers-Table...again (needed when re-entering setup)
+   call    PART_CalculateStraightPartPointers
+
+    IFDEF   FX_ENABLED
+        call    FX_StartScreen                 ; Start of new screen...
+    ENDIF
+
+   call    SETUP_DrawMenuBase
+   mov     bp, offset SETUP_MainMenu
+   call    SETUP_MenuTask                 ; calls Menu!
+   ret
+SETUP_Main                      EndP
+
+;        In: BP - Pointer to Menu
+;   CurMenu: Left Side 0-6, Right Side 8-14 (Bit 3!)
+SETUP_MenuTask                  Proc Near   ; the main-menu routine
+   cmp     byte ptr [SETUP_ExitEvent], 1
+   jne     SMT_NoImmediateExit
+   ret
+
+  SMT_NoImmediateExit:
+   call    SETUP_FillUpItemPacks
+   call    SETUP_DrawMenuOnScreen
+   mov     si, ds:[bp+1]     ; Ptr to Help-Text
+   call    SETUP_DrawMenuHelp
+
+   mov     ax, ds:[bp+1]   ; Help Pointer
+   cmp     ax, offset TXT_SETUPHELP_Main ; ask only in main-menu...
+   jne     SMT_NotMainMenu
+
+    IFDEF   FX_ENABLED
+        call    FX_EndScreenLeft              ; Do FX, if requested...
+    ENDIF
+
+   test    byte ptr [CFG_PasswordSetup], 1
+   jz      SMT_NotMainMenu
+   mov     ax, 0ABABh
+   mov     si, offset TXT_ProtectedSetup ; why bother again ?
+   mov     di, offset CFG_MasterPassword ; Only Access Using MASTER Pwd
+   call    PASSWORD_AskSpecifiedPassword
+  SMT_NotMainMenu:
+
+   mov     dl, dh
+  SMT_KeyBored:
+      ; Keyboard-Process Loop
+      push    dx
+         mov     ah, 0
+         int     16h
+      pop     dx
+
+;!
+;! DEBUG_PROBE
+;!
+IFDEF   AUX_DEBUGx
+    push    1234h
+    call    DEBUG_Probe
+    call    DEBUG_DumpIPT
+    call    DEBUG_DumpRegisters
+ENDIF
+
+
+
+      cmp     ah, Keys_Up
+      je      SMT_KeyUp
+      cmp     ah, Keys_Down
+      je      SMT_KeyDown
+      cmp     ah, Keys_Left
+      je      SMT_KeyLeftRight
+      cmp     ah, Keys_Right
+      je      SMT_KeyLeftRight
+      cmp     ah, Keys_ENTER
+      je      SMT_KeyENTER
+      cmp     ah, Keys_Plus
+      je      SMT_KeyPlus
+      cmp     ah, Keys_Minus
+      je      SMT_KeyMinus
+      cmp     ah, Keys_GrayPlus
+      je      SMT_KeyPlus
+      cmp     ah, Keys_GrayMinus
+      je      SMT_KeyMinus
+      cmp     ah, Keys_PageDown
+      je      SMT_KeyPlus
+      cmp     ah, Keys_PageUp
+      je      SMT_KeyMinus
+      cmp     ah, Keys_ESC
+      je      SMT_KeyEsc
+      cmp     ah, Keys_F1
+      jne   skip_xx
+      jmp      SMT_KeyHelp
+   skip_xx:
+      cmp     ah, Keys_F10
+      jne   skip_yy
+      jmp      SMT_SaveAndExitNOW
+   skip_yy:
+      ; ASCII values...
+      cmp     al, Keys_Space
+      je      SMT_KeyPlus
+   jmp     SMT_KeyBored
+
+  SMT_KeyUp:
+   dec     dh                            ; Current Item -1
+   mov     bx, offset SMT_KeyUp
+   jmp     SMT_FixUpModify
+
+  SMT_KeyDown:
+   inc     dh                            ; Current Item +1
+   mov     bx, offset SMT_KeyDown
+   jmp     SMT_FixUpModify
+
+  SMT_KeyLeftRight:
+   xor     dh, 1000b                     ; Little Trick Flip-Flop Left/Right
+   mov     bx, offset SMT_KeyLeftRight
+   jmp     SMT_FixUpModify
+
+  SMT_KeyENTER:                          ; Enters Menu, if no ItemPack available
+   mov     ch, dh
+   call    SETUP_SwitchToSelectedItem    ; Calculates SI for Item-No (CH)
+   mov     ax, ds:[si+LocMENU_RoutinePtr]
+   mov     bx, ds:[si+LocMENU_VariablePtr]
+   or      bx, bx                        ; VarPtr ?
+   jnz     SMT_DoNotExecute
+  SMT_DirectExecute:
+      mov     ds:[bp+0], dh              ; Saves current menu
+      call    ax                         ; Call to CodePtr
+      call    SETUP_DrawMenuOnScreen     ; Redraw after return
+      cmp     byte ptr [SETUP_ExitEvent], 1
+      je      SMT_ExitEvent
+  SMT_DoNotExecute:
+   jmp     SMT_KeyBored
+
+  SMT_ExitEvent:
+   ret                                   ; just return, to easy uh ?
+
+  SMT_KeyPlus:                           ; Changes ItemPack
+   mov     cl, 1
+   jmp     SMT_KeyChangeEvent
+  SMT_KeyMinus:
+   xor     cl, cl
+  SMT_KeyChangeEvent:
+   mov     ch, dh
+   call    SETUP_SwitchToSelectedItem    ; Calculates SI for Item-No (CH)
+   mov     ax, ds:[si+LocMENU_RoutinePtr]
+   mov     bx, ds:[si+LocMENU_VariablePtr]
+   or      bx, bx                        ; VarPtr ? =0 No ItemPack
+   jnz     SMT_DoItemPack
+   jmp     SMT_KeyBored
+  SMT_DoItemPack:
+      clc                                ; Modify this Item !
+      call    ax                         ; Call to Item-Code-Ptr
+   jmp     SMT_OkayReDisplay
+
+  SMT_KeyEsc:
+   mov     ax, ds:[bp+1]                 ; Help Pointer
+   cmp     ax, offset TXT_SETUPHELP_Main ; embarassing? ;-)
+   jne     SMT_ReturnPrev
+   jmp     SMT_ExitWithoutSaving
+  SMT_ReturnPrev:
+   mov     ds:[bp+0], dh                 ; Saves current menu
+   ret                                   ; just return to go to prev menu...
+
+  SMT_FixUpModify:
+   cmp     dh, 0FFh                      ; = 255 ?
+   jne     SMT_NoAdjustMin
+   mov     dh, 14                        ; Overflow -> 14!
+  SMT_NoAdjustMin:
+   cmp     dh, 14                        ; bigger as 14 ?
+   jbe     SMT_NoAdjustMax
+   xor     dh, dh                        ; Reset to 0
+  SMT_NoAdjustMax:
+   mov     ch, dh
+   call    SETUP_SwitchToSelectedItem    ; Calculates SI for Item-No (CH)
+   jnc     SMT_ValidItem
+   jmp     bx
+  SMT_ValidItem:
+   mov     ax, word ptr ds:[si]
+   or      ax, ax
+   jnz     SMT_OkayReDisplay
+   jmp     bx                            ; Do it again... :)
+  SMT_OkayReDisplay:
+   call    SETUP_DrawDeSelectItem
+   call    SETUP_DrawSelectItem
+   mov     dl, dh
+   jmp     SMT_KeyBored
+
+  SMT_KeyHelp:                           ; Shows help for selected Item...
+   mov     ch, dh
+   call    SETUP_SwitchToSelectedItem    ; Calculates SI for Item-No (CH)
+   mov     bx, ds:[si+LocMENU_ItemHelpPtr]
+   or      bx, bx                        ; Help-Ptr available ?
+   jz      SMT_NoHelpAvailable
+   call    SETUP_ShowHelp                ; Shows help...
+  SMT_NoHelpAvailable:
+   jmp     SMT_KeyBored
+
+  SMT_SaveAndExitNOW:                    ; Direct HackIn
+
+;!
+;! DEBUG_PROBE
+;!
+IFDEF   AUX_DEBUGx
+    push    1235h
+    call    DEBUG_Probe
+ENDIF
+
+   mov     ax, offset SETUP_EnterMenu_SaveAndExitSetup
+   jmp     SMT_DirectExecute
+
+  SMT_ExitWithoutSaving:                 ; Direct HackIn
+;!
+;! DEBUG_PROBE
+;!
+IFDEF   AUX_DEBUGx
+    push    1236h
+    call    DEBUG_Probe
+ENDIF
+
+   mov     ax, offset SETUP_EnterMenu_ExitWithoutSaving
+   jmp     SMT_DirectExecute
+SETUP_MenuTask                  EndP
+
+
+
+CLR_MENU_WINDOW_CLASSIC    = 0e01h
+CLR_MENU_WINDOW_BM   = 0e01h
+;        In: BP - Pointer to Menu
+;       Out: DH - Active Item on Screen
+SETUP_DrawMenuOnScreen          Proc Near
+   call    SETUP_DrawMenuWindow
+   mov     cx, CLR_MENU_WINDOW_BM
+   call    VideoIO_Color
+   xor     ch, ch
+  SDMOS_Loop:
+      call    SETUP_DrawItemOnScreen
+      inc     ch                         ; Total of 14 items to display
+      cmp     ch, 14
+      jbe     SDMOS_Loop
+   mov     dh, ds:[bp+0]
+   mov     dl, dh                        ; Active = Last
+   call    SETUP_DrawSelectItem          ; Marks active Item
+   mov     si, ds:[bp+1]                 ; Ptr to Item-Help-Text
+   call    SETUP_DrawMenuHelp
+   ret
+SETUP_DrawMenuOnScreen          EndP
+
+SETUP_FillUpItemPacks           Proc Near Uses cx
+   xor     ch, ch
+  SFUIP_Loop:
+      call    SETUP_FillUpItemPack_Now
+      inc     ch                         ; Total of 14 items to display
+   cmp     ch, 14
+   jbe     SFUIP_Loop
+   ret
+SETUP_FillUpItemPacks           EndP
+
+
+
+CLR_SELECTED_ITEM_CLASSIC  = 0f04h
+CLR_SELECTED_ITEM_BM = 0f04h
+; Displays selected Item on screen
+;        In: DH - Active Item
+; Destroyed: None
+SETUP_DrawSelectItem            Proc Near Uses cx
+   mov     cx, CLR_SELECTED_ITEM_BM
+   call    VideoIO_Color
+   mov     ch, dh
+   call    SETUP_DrawItemOnScreen
+   ret
+SETUP_DrawSelectItem            EndP
+
+
+CLR_DESELECTED_ITEM_CLASSIC  = 0e01h
+CLR_DESELECTED_ITEM_BM  = 0e01h
+; Display last-selected Item on screen (De-Select)
+;        In: DL - Active Item
+; Destroyed: None
+SETUP_DrawDeSelectItem          Proc Near Uses cx
+   mov     cx, CLR_DESELECTED_ITEM_BM
+   call    VideoIO_Color
+   mov     ch, dl
+   call    SETUP_DrawItemOnScreen
+   ret
+SETUP_DrawDeSelectItem          EndP
+
+; Actually displays Item on screen, Out of bounce checking included
+;        In: CH - CurItemNo
+; Destroyed: None
+SETUP_DrawItemOnScreen          Proc Near   Uses ax cx dx si es
+   call    SETUP_SwitchToSelectedItem    ; Calculates SI for Item-No (CH)
+   jnc     SDIOS_ValidItem
+   ret     ; Ignore all Invalid Items
+
+  SDIOS_ValidItem:
+   mov     dx, word ptr TextColorFore    ; BackUps TextColor for later
+   mov     cl, 3                         ; Left side: 3
+   test    ch, 1000b
+   jz      SDIOS_NoRightSide
+   and     ch, 111b
+   mov     cl, 42                        ; Right side: 42
+  SDIOS_NoRightSide:
+   mov     ax, ds:[si+LocMENU_VariablePtr] ; if available, we got ItemPack
+   or      ax, ax
+   jnz     SDIOS_ItemPackDraw
+   ; ------------------------------------------------------ Draw NAME
+   mov     ax, ds:[si+LocMENU_RoutinePtr] ; no Item-Code-Ptr? -> no name
+   or      ax, ax
+   jnz     SDIOS_Name_CodePtrAvailable
+   mov     TextColorFore, 0Fh            ; display in white letters
+   sub     cl, 2                         ; not optimized, i know :]
+  SDIOS_Name_CodePtrAvailable:
+   add     cl, 2                         ; Fix X-coordinate (for name)
+   add     ch, 6                         ; Fix Y-coordinate
+   cmp     cl, 40
+   jb      SDIOS_Name_NoFixUpName
+   inc     cl
+  SDIOS_Name_NoFixUpName:
+   call    VideoIO_Locate
+   mov     si, ds:[si+LocMENU_ItemNamePtr] ; SI - Name of Item
+   or      si, si
+   jz      SDIOS_Name_NoItemName
+   call    VideoIO_Print                 ; ...and print it.
+  SDIOS_Name_NoItemName:
+   mov     word ptr [TextColorFore], dx
+   ret
+
+   ; ------------------------------------------------------ Draw ITEMPACK
+  SDIOS_ItemPackDraw:
+   add     ch, 6                         ; Fix coordinate...
+   ; Display the Name and a double-point first
+   ; BackUp Coordinates and ItemPackPtr
+   push    cx
+   push    si
+      push    cx
+         cmp     cl, 40
+         jb      SDIOS_ItemPack_NoFixUpItemPack
+         inc     cl
+        SDIOS_ItemPack_NoFixUpItemPack:
+         call    VideoIO_Locate
+
+CLR_ITEM_PACK_CLASSIC   = 0f01h
+CLR_ITEM_PACK_BM  = 0f01h
+
+         mov     cx, CLR_ITEM_PACK_BM
+         call    VideoIO_Color           ; White on blue background
+         mov     si, ds:[si+LocMENU_ItemNamePtr] ; SI - Name of Item
+         or      si, si
+         jz      SDIOS_ItemPack_NoItemName
+         call    VideoIO_Print
+        SDIOS_ItemPack_NoItemName:
+      pop     cx
+      add     cl, 24
+      call    VideoIO_Locate
+      mov     al, 3Ah
+      call    VideoIO_PrintSingleChar    ; Write double-point
+      mov     word ptr TextColorFore, dx
+   pop     si
+   pop     cx
+   add     cl, 26                        ; Fix X-coordinate (for ItemPack)
+   call    VideoIO_Locate
+
+   add     si, LocMENU_ItemPack          ; Where ItemPack is located...
+   ; Filler berechnen
+  SDIOS_ItemPack_RetryGetLen:
+   mov     cx, 11
+   call    GetLenOfName
+   cmp     cx, 11
+   je      SDIOS_ItemPack_NoFiller
+   mov     al, cl
+   mov     cl, 11
+   sub     cl, al
+   mov     al, 20h                       ; Fill up with spaces
+   call    VideoIO_Internal_MakeWinRight ; and write...
+  SDIOS_ItemPack_NoFiller:
+   call    VideoIO_PrintLikeLenOfName    ; Write ItemPack
+   ret
+SETUP_DrawItemOnScreen          EndP
+
+SETUP_FillUpItemPack_Now        Proc Near Uses ax bx si
+   call    SETUP_SwitchToSelectedItem    ; Calculates SI for Item-No (CH)
+   jnc     SFUIPN_ValidItem
+  SFUIPN_Ignore:
+   ret                                   ; Ignore all Invalid Items
+
+  SFUIPN_ValidItem:
+   mov     bx, ds:[si+LocMENU_VariablePtr]
+   or      bx, bx
+   jz      SFUIPN_Ignore
+   mov     ax, ds:[si+LocMENU_RoutinePtr]
+   mov     cl, 1                         ; Add, if anything fails
+   stc                                   ; Just FillUp Call
+   call    ax                            ; CH-ItemNo, CL-Add/Sub, BX-PtrToVar
+   ret
+SETUP_FillUpItemPack_Now        EndP
+
+
+
+SETUP_DrawMenuWindow            Proc Near   Uses es
+   mov     cx, 0901h
+   call    VideoIO_Color
+   mov     bx, 0401h
+   mov     dx, 0E50h
+   call    VideoIO_MakeWindow
+   mov     bx, 0E01h
+   mov     dx, 1150h
+   call    VideoIO_MakeWindow
+   mov     cx, 0529h
+   call    VideoIO_Locate
+   mov     al, TextChar_WinLineDown
+   mov     cl, 12
+   call    VideoIO_Internal_MakeWinDown
+   ; the little fixups for better looking windows...
+   mov     cx, 0429h
+   call    VideoIO_Locate
+   mov     al, TextChar_WinRep1
+   call    VideoIO_PrintSingleChar
+   mov     cx, 0E29h
+   call    VideoIO_Locate
+   mov     al, TextChar_WinRep6
+   call    VideoIO_PrintSingleChar
+   mov     cx, 1129h
+   call    VideoIO_Locate
+   mov     al, TextChar_WinRep3
+   call    VideoIO_PrintSingleChar
+   mov     cx, 0E01h
+   call    VideoIO_Locate
+   mov     al, TextChar_WinRep5
+   call    VideoIO_PrintSingleChar
+   mov     cx, 0E50h
+   call    VideoIO_Locate
+   mov     al, TextChar_WinRep4
+   call    VideoIO_PrintSingleChar
+   ret
+SETUP_DrawMenuWindow            EndP
+
+SETUP_DrawMenuBase              Proc Near
+   call    BOOTMENU_BuildBackground
+   ; -------------------------------------------- Upper Copyright...
+   mov     cx, 0F00h
+   call    VideoIO_Color
+   mov     cx, 011Eh
+   call    VideoIO_Locate
+   mov     si, offset Copyright
+   inc     si
+   mov     cl, 9
+   call    VideoIO_FixedPrint            ; Put 'AiR-BOOT' to 1st line...
+   push    si
+      mov     si, offset SETUP_UpperFixString
+      call    VideoIO_Print              ; and 'SETUP'...
+   pop     si
+   mov     cl, CopyrightVersionLen
+   call    VideoIO_FixedPrint            ; and 'vX.XX'.
+
+   ; Rousseau:
+   ; Strange, had to adjust this value.
+   ; Somewhere some offset changed...
+   ; Possibly happened with the movzx change to 286 instructions because some
+   ; offsets are hard coded.
+   ;add     si, 3
+   add     si, 2
+
+   call    GetLenOfString                ; CX - Len of "Copyright" string
+   mov     dx, cx
+   mov     cx, 0228h
+   call    VideoIO_LocateToCenter        ; LocateToCenter 2, 40 using TotalLen
+   call    VideoIO_Print                 ; 'Copyright' to 2nd line...
+
+   mov     si, offset TXT_TranslationBy
+   call    GetLenOfString                ; CX - Len of "Translated by" string
+   mov     dx, cx
+   mov     cx, 0328h
+   call    VideoIO_LocateToCenter        ; LocateToCenter 3, 40 using TotalLen
+   call    VideoIO_Print                 ; 'Translated By' as well...
+   ; -------------------------------------------- Lower 1st Line
+   mov     si, offset TXT_SETUP_LowerMessage
+   mov     cl, 2
+   call    GetLenOfStrings               ; CX - Len of 5 Strings at [si]
+   mov     dx, cx
+   mov     cx, 1329h
+   call    VideoIO_LocateToCenter        ; LocateToCenter 21, 40 using TotalLen
+   call    VideoIO_Print                 ; Begin using WHITE again...
+   mov     cx, 0C00h
+   call    VideoIO_Color
+   call    VideoIO_Print                 ; contine red - 'GPLv3+'
+   ; -------------------------------------------- Lower 2nd Line
+   mov     cl, 1
+   call    GetLenOfStrings               ; CX - Len of 3 Strings at [si]
+   mov     dx, cx
+   mov     cx, 1429h
+   call    VideoIO_LocateToCenter        ; LocateToCenter 19, 40 using TotalLen
+   mov     cx, 0F00h
+   call    VideoIO_Color                 ; White...
+   call    VideoIO_Print                 ; Begin using WHITE...
+   ; -------------------------------------------- Lower 3rd Line
+   mov     cl, 1
+   call    GetLenOfString                ; CX - Len of String at [si]
+   mov     dx, cx
+   mov     cx, 1629h
+   call    VideoIO_LocateToCenter        ; LocateToCenter 22, 40 using TotalLen
+   mov     cx, 0F00h
+   call    VideoIO_Color                 ; White...
+   call    VideoIO_Print                 ; For more information...
+   ; -------------------------------------------- Lower 4th Line
+   mov     cl, 1
+   call    GetLenOfStrings               ; CX - Len of 5 Strings at [si]
+   mov     dx, cx
+   mov     cx, 1729h
+   call    VideoIO_LocateToCenter        ; LocateToCenter 24, 40 using TotalLen
+   mov     cx, 0B00h
+   call    VideoIO_Color
+   call    VideoIO_Print                 ; homepage
+   ; -------------------------------------------- Lower 5th Line
+   mov     cl, 2
+   call    GetLenOfStrings               ; CX - Len of 4 Strings at [si]
+   mov     dx, cx
+   mov     cx, 1929h
+   call    VideoIO_LocateToCenter        ; LocateToCenter 25, 40 using TotalLen
+   mov     cx, 0700h
+   call    VideoIO_Color
+   call    VideoIO_Print                 ; white - 'contact via e-mail'...
+   mov     cx, 0700h
+   call    VideoIO_Color
+   call    VideoIO_Print                 ; and finally the e-mail adress
+   ret
+SETUP_DrawMenuBase              EndP
+
+; Zeichnet die Men Hilfe aufn Bildschirm
+;        In: SI - Pointer to 4 HelpStrings...
+; Destroyed: None
+SETUP_DrawMenuHelp              Proc Near   Uses cx si
+   mov     cx, 0F01h
+   call    VideoIO_Color
+   mov     cx, 0F05h
+   call    VideoIO_Locate
+   call    VideoIO_Print
+   mov     cx, 1005h
+   call    VideoIO_Locate
+   call    VideoIO_Print
+   mov     cx, 0F2Dh
+   call    VideoIO_Locate
+   call    VideoIO_Print
+   mov     cx, 102Dh
+   call    VideoIO_Locate
+   call    VideoIO_Print
+   ret
+SETUP_DrawMenuHelp              EndP
+
+;        In: bx - HelpPtr
+; Destroyed: None
+SETUP_ShowHelp                  Proc Near   Uses cx dx ds si es di bp
+   mov     ax, VideoIO_Page2
+   call    VideoIO_BackUpTo
+
+   push    bx                            ; Push HelpPtr
+      mov     cx, 0B03h
+      call    VideoIO_Color
+      mov     bx, 0F33h
+      mov     dx, 174Eh
+      call    VideoIO_MakeWindow
+      ; Print at lower-right frame of window
+      mov     si, offset TXT_SETUPHELP_Enter
+      call    GetLenOfString             ; CX - Len of String
+      mov     dl, cl
+      mov     cx, 174Eh
+      sub     cl, dl
+      call    VideoIO_Locate             ; Locate 23, (78-LenOfString)
+      call    VideoIO_Print
+      mov     cx, 0F03h
+      call    VideoIO_Color
+      ; Center at upper frame of window
+      mov     si, offset TXT_SETUPHELP_Base
+      call    GetLenOfString
+      mov     dx, cx
+      mov     cx, 0F41h
+      call    VideoIO_LocateToCenter     ; LocateToCenter 15, 65 using LenOfStr
+      call    VideoIO_Print
+      ; beim R
+
+      mov     cx, 0E03h
+      call    VideoIO_Color
+   pop     si                            ; and restore HelpPtr to SI
+   mov     cx, 1136h
+
+  SSH_Loop:
+      call    VideoIO_Locate
+      call    VideoIO_Print
+      inc     ch                         ; TextPosY + 1
+   cmp     TextPosX, 36h
+   ja      SSH_Loop
+
+  SSH_KeyLoop:
+      mov     ah, 0
+      int     16h
+      cmp     ah, Keys_ENTER
+      je      SSH_EndOfHelp
+      cmp     ah, Keys_ESC
+      je      SSH_EndOfHelp
+   jmp     SSH_KeyLoop
+
+  SSH_EndOfHelp:
+   mov     ax, VideoIO_Page2
+   call    VideoIO_RestoreFrom
+   ret
+SETUP_ShowHelp                  EndP
+
+SETUP_EnterMenu_PartitionSetup  Proc Near   Uses dx bp
+   ; Extra-Full Featured Partition Setup
+   call    PARTSETUP_Main
+   ret
+SETUP_EnterMenu_PartitionSetup  EndP
+
+SETUP_EnterMenu_BasicOptions    Proc Near   Uses dx bp
+   mov     bp, offset SETUP_BasicOptions
+   call    SETUP_MenuTask                ; calls Menu!
+   ret
+SETUP_EnterMenu_BasicOptions    EndP
+
+SETUP_EnterMenu_AdvancedOptions Proc Near   Uses dx bp
+   mov     bp, offset SETUP_AdvancedOptions
+   call    SETUP_MenuTask                ; calls Menu!
+   ret
+SETUP_EnterMenu_AdvancedOptions EndP
+
+SETUP_EnterMenu_ExtendedOptions Proc Near   Uses dx bp
+   mov     bp, offset SETUP_ExtendedBootOptions
+   call    SETUP_MenuTask                ; calls Menu!
+   ret
+SETUP_EnterMenu_ExtendedOptions EndP
+
+; [Linux support removed since v1.02]
+;SETUP_EnterMenu_LinuxCommandLine Proc Near  Uses dx bp
+;   test    GotLinux, 1
+;   jz      SEMLCL_NoLinux
+;   call    SETUP_EnterMenu_EnterLinuxCmdLine
+;   ret
+;  SEMLCL_NoLinux:
+;   mov     cx, 0C04h
+;   mov     si, offset TXT_SETUP_NoLinuxInstalled
+;   call    SETUP_ShowErrorBox
+;   ret
+;SETUP_EnterMenu_LinuxCommandLine EndP
+
+SETUP_EnterMenu_DefineMasterPassword Proc Near
+   mov     di, offset CFG_MasterPassword
+   call    SETUP_EnterMenu_DefinePassword
+   ret
+SETUP_EnterMenu_DefineMasterPassword EndP
+
+SETUP_EnterMenu_DefineBootPassword Proc Near
+   mov     di, offset CFG_BootPassword
+   call    SETUP_EnterMenu_DefinePassword
+   ret
+SETUP_EnterMenu_DefineBootPassword EndP
+
+; ============================================================================
+
+; [Linux support removed since v1.02]
+;SETUP_EnterMenu_EnterLinuxCmdLine Proc Near
+;   mov     cx, 0D05h
+;   call    VideoIO_Color
+;   mov     bx, 0C02h
+;   mov     dx, 0F4Fh
+;   call    VideoIO_MakeWindow
+;   mov     cx, 0F05h
+;   call    VideoIO_Color
+;
+;   mov     si, offset TXT_SETUP_EnterLinuxCmdLine
+;   call    GetLenOfString                ; CX - Len of Error Message
+;   mov     dx, cx
+;   mov     cx, 0D28h
+;   call    VideoIO_LocateToCenter        ; LocateToCenter 13, 40 using LenOfStr
+;   call    VideoIO_Print                 ; Writes 'Please enter Linux-CmdLine'
+;
+;   mov     cx, 0E05h
+;   call    VideoIO_Color
+;   mov     cx, 0E04h
+;   call    VideoIO_Locate
+;   mov     al, ' '
+;   mov     cl, 74
+;   call    VideoIO_PrintSingleMultiChar
+;   mov     cx, 0E04h
+;   call    VideoIO_Locate
+;   mov     si, offset CFG_LinuxCommandLine
+;   push    si
+;      call    VideoIO_Print              ; Writes Linux Command-Line
+;   pop     si
+;   mov     cx, 0E04h
+;   call    VideoIO_Locate
+;
+;   push    cs
+;   pop     es                            ; ES == CS
+;   mov     di, offset TmpSector
+;   mov     cx, 37
+;   rep     movsw                         ; Copy LinuxCmdLine -> TmpSectorSpace
+;
+;   mov     si, offset TmpSector
+;   mov     cx, 74
+;   call    VideoIO_LetUserEditString     ; -> does actual editing
+;   jnc     SEMELCL_UserAbort             ; Did user abort ?
+;
+;   ; Otherwise copy TmpSectorSpace to LinuxCmdLine
+;   mov     di, offset CFG_LinuxCommandLine
+;   mov     cx, 74
+;   call    GetLenOfName                  ; Get real length of Cmd-Line into CX
+;   jz      SEMELCL_NulLine
+;   rep     movsb
+;  SEMELCL_NulLine:
+;   mov     ax, 75
+;   sub     ax, cx
+;   mov     cx, ax
+;   xor     al, al
+;   rep     stosb                         ; Fill up with NULs
+;
+;  SEMELCL_UserAbort:
+;   ret
+;SETUP_EnterMenu_EnterLinuxCmdLine EndP
+
+;        In: di - Place for Password to be defined
+; Destroyed: None
+SETUP_EnterMenu_DefinePassword  Proc Near   Uses dx es bp
+   push    di                            ; DI - Place of Password
+      mov     ax, cs
+      mov     es, ax                     ; ES == CS & Magic (AX) destroyed
+      mov     si, offset TXT_SETUP_PasswordOld
+      ;       di - Place of Password to Check (0 to check both passwords)
+      call    PASSWORD_AskSpecifiedPassword
+      mov     si, offset TXT_SETUP_PasswordDefine
+      mov     di, offset SETUP_NewPwd
+      call    SETUP_LetEnterPassword
+      xor     ax, ax                     ; Magic (AX) destroyed
+      mov     si, offset TXT_SETUP_PasswordVerify
+      mov     di, offset SETUP_VerifyPwd
+      call    SETUP_LetEnterPassword
+
+      mov     si, offset SETUP_NewPwd
+      mov     di, offset SETUP_VerifyPwd
+      mov     cx, 8
+      repe    cmpsb
+      jne     SEMDP_NoMatch
+
+      mov     si, offset SETUP_NewPwd
+      call    PASSWORD_Encode
+      mov     si, offset PasswordSpace
+   pop     di    ; DI = Place for Password
+   mov     cx, 4
+   rep     movsw     ; neues Passwort...
+
+   mov     di, offset SETUP_NewPwd
+   mov     al, 32
+   mov     cx, 8
+   repe    scasb
+   je      SEMDP_Disabled
+   mov     cx, 0A02h
+   mov     si, offset TXT_SETUP_PasswordMatched
+   call    SETUP_ShowErrorBox
+   jmp     SEMDP_ExitSub
+  SEMDP_Disabled:
+   mov     cx, 0A02h
+   mov     si, offset TXT_SETUP_PasswordDisabled
+   call    SETUP_ShowErrorBox
+   jmp     SEMDP_ExitSub
+
+     SEMDP_NoMatch:
+   pop     di                            ; DI = Place for Password <BUG>
+   mov     cx, 0C04h
+   mov     si, offset TXT_SETUP_PasswordMismatch
+   call    SETUP_ShowErrorBox
+   jmp     SEMDP_ExitSub
+
+  SEMDP_ExitSub:
+   ret
+SETUP_EnterMenu_DefinePassword  EndP
+
+;        In: DS:SI - Text-Line for Display
+;            ES:DI - Location for new password (must be 17 bytes)
+;            AX    - Magic, if set to ABAB, it will use a different layout and
+;                     will write 'Please Enter Password:'
+SETUP_LetEnterPassword          Proc Near   Uses bx cx dx si es di
+   local   EnterPwd_Location:word, EnterPwd_DefinePwd:word
+
+   mov     ax, VideoIO_Page2
+   call    VideoIO_BackUpTo
+   push    ax
+   push    di
+      mov     ax, 20h                    ; Space
+      mov     cx, 16
+      rep     stosb                      ; Kill new password
+      mov     es:[di], ah                ; ending NUL
+   pop     di
+   pop     ax
+   cmp     ax, 0ABABh                    ; Magic Processing...
+   je      SLEP_MagicLayOut
+   mov     cx, 0D05h
+   call    VideoIO_Color
+
+   call    GetLenOfString                ; CX - Len of Error Message
+   add     cl, 6                         ; Adjust to include 2 Spaces and Frame
+   push    cx
+      mov     bx, 0C28h
+      shr     cl, 1
+      sub     bl, cl
+   pop     cx
+   mov     dh, 0Fh
+   mov     dl, bl
+   add     dl, cl
+   dec     dl                            ; Size window to match given string...
+   call    VideoIO_MakeWindow
+   mov     cx, 0F05h
+   call    VideoIO_Color
+
+   mov     ch, 0Dh
+   mov     cl, bl
+   add     cl, 3
+   call    VideoIO_Locate
+   call    VideoIO_Print                 ; Uses given string 'Define or Verify'
+   mov     cx, 0E05h
+   call    VideoIO_Color
+   mov     word ptr [EnterPwd_Location], 0E26h
+   mov     word ptr [EnterPwd_DefinePwd], 1
+   jmp     SLEP_JumpToInputProcess
+
+  SLEP_MagicLayOut:
+   mov     cx, 0C04h
+   call    VideoIO_Color
+
+   call    GetLenOfString                 ; CX - Len of Error Message
+   add     cl, 4                          ; Adjust to include Space and Frame
+   push    cx
+      mov     bx, 0C28h
+      shr     cl, 1
+      sub     bl, cl
+   pop     cx
+   mov     dh, 10h
+   mov     dl, bl
+   add     dl, cl
+   dec     dl                            ; Size window to match given string...
+   call    VideoIO_MakeWindow
+   mov     cx, 0F04h
+   call    VideoIO_Color
+   mov     ch, 0Dh
+   mov     cl, bl
+   add     cl, 2
+   call    VideoIO_Locate
+   call    VideoIO_Print                 ; Uses given string...
+
+   mov     si, offset TXT_PleaseEnterPassword
+   call    GetLenOfString                ; CX - Len of Error Message
+   mov     dx, cx
+   mov     cx, 0E28h
+   call    VideoIO_LocateToCenter        ; LocateToCenter 14, 40 using LenOfStr
+   call    VideoIO_Print                 ; Writes 'Please Enter Password:'
+   mov     cx, 0E04h
+   call    VideoIO_Color
+   mov     EnterPwd_Location, 0F25h
+   mov     EnterPwd_DefinePwd, 0
+  SLEP_JumpToInputProcess:
+   call    SOUND_PreBootMenu
+   mov     si, di                        ; DS:SI - Current Password
+   xor     dl, dl
+   ; DL - location of cursor (first=0)
+  SLEP_Loop:
+   mov     cx, [EnterPwd_Location]
+   call    VideoIO_Locate
+   push    si
+      add     si, 8
+      call    VideoIO_Print              ; Prints current Password
+   pop     si
+   mov     ah, 0
+   int     16h
+   cmp     al, 61h
+   jb      SLEP_SkipFixLower
+   cmp     al, 7Ah
+   ja      SLEP_SkipFixLower
+   xor     al, 20h                       ; Convert to UpperCase (ELiTE)
+   jmp     SLEP_CorrectPwdChar
+  SLEP_SkipFixLower:
+   cmp     al, 41h
+   jb      SLEP_NonChar
+   cmp     al, 5Ah
+   ja      SLEP_NonChar
+   jmp     SLEP_CorrectPwdChar
+  SLEP_NonChar:
+   cmp     al, 30h
+   jb      SLEP_NonNum
+   cmp     al, 39h
+   ja      SLEP_NonNum
+   jmp     SLEP_CorrectPwdChar
+  SLEP_NonNum:
+   cmp     al, 0Dh
+   je      SLEP_Enter
+   cmp     al, 08h
+   je      SLEP_OneBack
+  SLEP_SkipThiz:
+   jmp     SLEP_Loop
+
+  SLEP_CorrectPwdChar:
+   cmp     dl, 8
+   je      SLEP_SkipThiz
+
+   ;movzx   bx, dl
+   mov   bl,dl
+   mov   bh,0
+
+   mov     ds:[si+bx], al
+   mov     al, 42                        ; fixed star :]
+   mov     ds:[si+bx+8], al
+   inc     dl
+   jmp     SLEP_Loop
+  SLEP_OneBack:
+   cmp     dl, 0
+   je      SLEP_SkipThiz
+   dec     dl
+
+   ;movzx   bx, dl
+   mov   bl,dl
+   mov   bh,0
+
+   mov     al, 32
+   mov     ds:[si+bx], al
+   mov     ds:[si+bx+8], al
+   jmp     SLEP_Loop
+  SLEP_Enter:
+   or      dl, dl
+   jnz     SLEP_GotSomePassword
+   cmp     word ptr [EnterPwd_DefinePwd], 1
+   je      SLEP_GotSomePassword
+   mov     cx, 8
+   mov     al, 1                         ; Fill empty password with [01]
+   rep     stosb                         ; ...only when Asking Password.
+  SLEP_GotSomePassword:
+   mov     ax, VideoIO_Page2
+   call    VideoIO_RestoreFrom
+   ret
+SETUP_LetEnterPassword          EndP
+
+; ============================================================================
+
+; CX = Color of Box, SI = String in Box
+; If AX = ABABh -> Thingie will not wait...
+SETUP_ShowErrorBox              Proc Near   Uses ax bx cx
+   push    ax
+      push    cx
+         call    VideoIO_Color
+         call    GetLenOfString          ; CX - Len of Error Message
+         add     cl, 4                   ; Adjust to include Space and Frame
+         push    cx
+            mov     bx, 0D28h
+            shr     cl, 1
+            sub     bl, cl
+         pop     cx
+         mov     dh, 0Fh
+         mov     dl, bl
+         add     dl, cl
+         dec     dl
+         call    VideoIO_MakeWindow
+      pop     cx
+      mov     ch, 0Fh
+      call    VideoIO_Color
+      mov     ch, 0Eh
+      mov     cl, bl
+      add     cl, 2
+      call    VideoIO_Locate
+      call    VideoIO_Print
+   pop     ax
+   cmp     ax, 0ABABh
+   je      SSEB_NoWait
+   mov     ah, 0
+   int     16h     ; Waits for key stroke
+  SSEB_NoWait:
+   ret
+SETUP_ShowErrorBox              EndP
+
+SETUP_EnterMenu_SaveAndExitSetup Proc Near   Uses dx bp
+   mov     si, offset TXT_SETUP_SaveAndExitNow
+   call    SETUP_Warning_AreYouSure
+   jnz     SEMSAES_UserAbort
+  SEMSAES_DoThis:
+   xor     al, al
+   mov     byte ptr [CFG_AutoEnterSetup], al
+   add     word ptr [CFG_LastTimeEditLow], 1
+   adc     word ptr [CFG_LastTimeEditHi], 0         ; Update Time-Stamp
+   IFDEF ReleaseCode
+      call    DriveIO_SaveConfiguration
+   ENDIF
+   mov     byte ptr [SETUP_ExitEvent], 1            ; Exit and continue boot process
+  SEMSAES_UserAbort:
+   ret
+SETUP_EnterMenu_SaveAndExitSetup EndP
+
+SETUP_EnterMenu_ExitWithoutSaving Proc Near   Uses dx bp
+   mov     si, offset TXT_SETUP_QuitWithoutSaveNow
+   call    SETUP_Warning_AreYouSure
+   jnz     SEMEWS_UserAbort
+   ; If we were forced to enter Setup, save configuration anyway...
+   test    byte ptr [CFG_AutoEnterSetup], 1
+   jz      SEMEWS_DoThis
+   jmp     SEMEWS_DoThis                 ; Cross-Jump to SaveAndExitSetup!
+
+  SEMEWS_DoThis:
+   IFDEF ReleaseCode                     ; Loads basic configuration...
+      call    DriveIO_LoadConfiguration  ; This is *NOT* IPT nor HideConfig
+   ENDIF
+   mov     byte ptr [SETUP_ExitEvent], 1            ; Exit and continue boot process
+  SEMEWS_UserAbort:
+   ret
+SETUP_EnterMenu_ExitWithoutSaving EndP
+
+; Displays and asks user, if he is sure
+;        In: SI - Sure about what (string, NUL-terminated)
+;       Out: Non-Zero Flag set -> User is sure
+; Destroyed: None
+SETUP_Warning_AreYouSure        Proc Near
+   mov     cx, 0C04h
+   call    VideoIO_Color
+   call    GetLenOfString                ; CX - Len of Given String
+   add     cl, 2+6                       ; Adjust to include Spaces and Frame
+   push    cx
+      mov     bx, 0B28h
+      shr     cl, 1
+      sub     bl, cl
+   pop     cx
+   mov     dh, 0Fh
+   mov     dl, bl
+   add     dl, cl
+   dec     dl
+   call    VideoIO_MakeWindow
+   mov     cx, 0F04h
+   call    VideoIO_Color
+
+   ; Display what the user has to be sure at...
+   call    GetLenOfString                ; CX - Len of Given String
+   mov     dx, cx
+   mov     cx, 0C28h
+   call    VideoIO_LocateToCenter        ; LocateToCenter 12, 40 using LenOfStr
+   call    VideoIO_Print                 ; Use given string...
+
+   mov     si, offset TXT_SETUP_AreYouSure2
+   call    GetLenOfString
+   mov     dx, cx
+   mov     cx, 0E28h
+   call    VideoIO_LocateToCenter        ; LocateToCenter 14, 40 using LenOfStr
+   call    VideoIO_Print
+   ; Now the 1st Warning sentence, because it should get yellow...
+   mov     cx, 0E04h
+   call    VideoIO_Color                 ; Yellow on Red
+   mov     si, offset TXT_SETUP_AreYouSure1
+   call    GetLenOfString
+   mov     dx, cx
+   mov     cx, 0D28h
+   call    VideoIO_LocateToCenter        ; LocateToCenter 13, 40 using LenOfStr
+   call    VideoIO_Print
+
+   ; Waits for user-response...
+  SWAYS_Loop:
+      mov     ah, 0
+      int     16h
+      and     al, 0DFh
+      cmp     al, TXT_SETUP_LetterYes
+      je      SWAYS_YES
+      cmp     al, TXT_SETUP_LetterYes2
+      je      SWAYS_YES
+      cmp     al, TXT_SETUP_LetterNo
+      je      SWAYS_NO
+      jmp     SWAYS_Loop
+
+  SWAYS_YES:
+   and     al, 0                         ; Sets Zero-Flag
+   ret
+
+  SWAYS_NO:
+   or      al, 1                         ; Resets Zero-Flag
+   ret
+SETUP_Warning_AreYouSure        EndP
+
+
+;Calling Conventions for Magics:
+;================================
+; BX - VarPtr
+; CH - ItemNo
+; CL - 1, add, 0 means subtract
+; SI - Pointer to current Item
+; Carry Flag - Refresh Item, do not modify
+
+SETUPMAGIC_InternalCopyTillNUL  Proc Near Uses ax cx
+  SMICTN_Loop:
+
+    ;!
+    ;! DEBUG_PROBE
+    ;!
+    IFDEF   AUX_DEBUGx
+        push    1239h
+        call    DEBUG_Probe
+        call    DEBUG_DumpRegisters
+        call    DEBUG_DumpIPT
+    ENDIF
+
+      lodsb
+      stosb
+      inc     cl
+   or      al, al
+   jnz     SMICTN_Loop                   ; Copies the string...
+   mov     al, 13
+   sub     al, cl
+   jz      SMICTN_NoFiller
+   dec     al
+
+   ;movzx   cx, al
+   mov   cl,al
+   mov   ch,0
+
+   xor     al, al
+   rep     stosb                         ; and fill up with NULs, if required
+  SMICTN_NoFiller:
+   ret
+SETUPMAGIC_InternalCopyTillNUL  EndP
+
+; Cur Value in DL, Maximum Value in DH. Add/Sub in CL
+SETUPMAGIC_InternalCheckUp      Proc Near
+;!
+;! DEBUG_PROBE
+;!
+IFDEF   AUX_DEBUGx
+    push    1238h
+    call    DEBUG_Probe
+    call    DEBUG_DumpRegisters
+ENDIF
+
+   or      cl, cl                        ; CL==0?    -> Decrease
+   jz      SMICU_Substract               ; otherwise -> Increase
+   inc     dl
+   jmp     SMICU_CheckNow
+  SMICU_Substract:
+   dec     dl
+  SMICU_CheckNow:
+   cmp     dl, 0FFh
+   jne     SMICU_DoNotModifyMin
+   mov     dl, dh                        ; -1? -> set to maximum
+  SMICU_DoNotModifyMin:
+   cmp     dl, dh
+   jbe     SMICU_DoNotModifyMax
+   xor     dl, dl                        ; Maximum exceeded? -> set 0
+  SMICU_DoNotModifyMax:
+   ret
+SETUPMAGIC_InternalCheckUp      EndP
+
+SETUPMAGIC_EnableDisable        Proc Near   Uses ax si es di
+   mov     al, ds:[bx]
+   jc      SMED_DoNotModify
+   xor     al, 1                         ; Do Flip-Flop :)
+  SMED_DoNotModify:
+   mov     ds:[bx], al
+   mov     di, si
+   mov     si, offset TXT_SETUP_MAGIC_Enabled
+   or      al, al
+   jnz     SMED_Enabled
+   mov     si, offset TXT_SETUP_MAGIC_Disabled
+  SMED_Enabled:
+   push    cs
+   pop     es
+   add     di, LocMENU_ItemPack          ; DI points to ItemPack...
+   call    SETUPMAGIC_InternalCopyTillNUL
+   ret
+SETUPMAGIC_EnableDisable        EndP
+
+SETUPMAGIC_ChangeBootDelay      Proc Near   Uses ax cx dx ds si es di
+   mov     dl, ds:[bx]                   ; Current Partition Number
+   jc      SMCBD_DoNotModify
+   mov     dh, 0FFh
+   call    SETUPMAGIC_InternalCheckUp    ; CheckUp DL (max. 255)
+  SMCBD_DoNotModify:
+   mov     ds:[bx], dl
+   mov     cx, 1A01h
+   call    VideoIO_Locate
+   mov     ax, VideoIO_Segment
+   mov     es, ax
+   mov     di, 4000
+   mov     cx, 8
+   xor     al, al
+   rep     stosb                         ; Writes 8x NUL
+   mov     al, dl
+   call    VideoIO_PrintByteDynamicNumber
+   ; Pseudo-(XCHG DS, ES)
+   push    ds
+   push    es
+   pop     ds
+   pop     es
+
+   mov     di, si
+   add     di, LocMENU_ItemPack          ; ES:DI - ItemPack
+   mov     si, 4000                      ; DS:SI - Screen Page 1
+   push    es
+   push    di
+      mov     cx, 4
+     SMCBD_Loop:
+         lodsw
+         stosb
+      loop    SMCBD_Loop                 ; okay we got it...trick!
+   ; DS:SI - ItemPack
+   pop     si
+   pop     ds
+   mov     cx, 12
+   call    GetLenOfName                  ; Gets the length of the number
+   add     si, cx
+   mov     al, 0FFh
+   mov     ds:[si], al                   ; and a Filler as last char (looks better)
+   ret
+SETUPMAGIC_ChangeBootDelay      EndP
+
+; Used by : Default Selection
+; Value   : Partition Number (Base=0, None=80h, ContinueBIOS=FEh, Floppy=FFh)
+; Method  : Changes to another bootable partition
+; Logic   : if no bootable selections are found -> will set 80h
+;           if already set to 80h -> will search through all selections
+SETUPMAGIC_ChangeDefaultSelection Proc Near   Uses ax cx dx si es di
+   mov     di, si
+   mov     dl, ds:[bx]                   ; Cur Selection No.
+   push    bx
+      pushf
+         cmp     dl, 080h
+         jne     SMCP_AlreadyGotSelection
+         ; Start at partition 0. So Continue-BIOS and Floppy will go last
+         xor     dl, dl
+        SMCP_AlreadyGotSelection:
+         ; We use BL in here for tracking how many selections left
+         mov     bl, [CFG_Partitions]
+         cmp     dl, 0FEh
+         jb      SMCP_DoneAdjust
+         je      SMCP_AdjustContinueBIOS
+         cmp     byte ptr [CFG_IncludeFloppy], 0
+         jne     SMCP_DoneAdjust
+         dec     dl                      ; No Floppy? -> Try Resume-BIOS
+        SMCP_AdjustContinueBIOS:
+         cmp     byte ptr [CFG_ResumeBIOSbootSeq], 0
+         jne     SMCP_DoneAdjust
+         xor     dl, dl                  ; No Resume-BIOS? -> Start partition 0
+        SMCP_DoneAdjust:
+         mov     dh, bl
+         inc     bl
+         dec     dh
+         or      cl, cl                        ; CL==0?    -> Decrease
+         jz      SMCP_SubstractSelection       ; otherwise -> Increase
+      popf
+      jc      SMCP_Dec_ModifyDone
+     SMCP_Inc_RejectPartition:
+      inc     dl                         ; Increase Selection No
+      cmp     dl, [CFG_Partitions]
+      jb      SMCP_Inc_ModifyDone
+      cmp     dl, 0FFh
+      je      SMCP_Inc_TryFloppy
+      mov     dl, 0FEh                   ; Try Resume-BIOS
+      cmp     byte ptr [CFG_ResumeBIOSbootSeq], 0
+      jne     SMCP_Inc_ModifyDone
+      inc     dl                         ; Try Floppy
+     SMCP_Inc_TryFloppy:
+      cmp     byte ptr [CFG_IncludeFloppy], 0
+      jne     SMCP_Inc_ModifyDone
+      cmp     byte ptr [CFG_Partitions], 0
+      je      SMCP_NoBootable
+      inc     dl                         ; Now start at partition 0 again
+     SMCP_Inc_ModifyDone:
+      dec     bl
+      jz      SMCP_NoBootable
+      ; Get Partition-Pointer (SI) from Partition-Number (DL)
+      call    PART_GetPartitionPointer
+      mov     ax, ds:[si+LocIPT_Flags]
+      test    ax, Flags_Bootable
+      jz      SMCP_Inc_RejectPartition
+      jmp     SMCP_GotSelection
+
+     SMCP_SubstractSelection:
+      popf
+      jc      SMCP_Dec_ModifyDone
+     SMCP_Dec_RejectPartition:
+      dec     dl                         ; Decrease Selection No
+      cmp     dl, 0FDh
+      jb      SMCP_Dec_ModifyDone        ; <FDh -> We are done
+      je      SMCP_Dec_TryPartition
+      cmp     dl, 0FFh
+      jb      SMCP_Dec_TryResumeBIOS
+      cmp     byte ptr [CFG_IncludeFloppy], 0
+      jne     SMCP_Dec_ModifyDone
+      dec     dl
+     SMCP_Dec_TryResumeBIOS:
+      cmp     byte ptr [CFG_ResumeBIOSbootSeq], 0
+      jne     SMCP_Dec_ModifyDone
+     SMCP_Dec_TryPartition:
+      mov     dl, [CFG_Partitions]
+      or      dl, dl
+      jz      SMCP_NoBootable
+      dec     dl                         ; Now start at last partition again
+     SMCP_Dec_ModifyDone:
+      dec     bl
+      jz      SMCP_NoBootable
+      ; Get Partition-Pointer (SI) from Partition-Number (DL)
+      call    PART_GetPartitionPointer
+      mov     ax, ds:[si+LocIPT_Flags]
+      test    ax, Flags_Bootable
+      jz      SMCP_Dec_RejectPartition
+
+     SMCP_GotSelection:
+   pop     bx
+   mov     ds:[bx], dl                   ; Set new partition
+   add     si, LocIPT_Name               ; Location of Name
+   push    cs
+   pop     es
+   add     di, LocMENU_ItemPack          ; DI points to ItemPack...
+   mov     cx, 11
+   rep     movsb                         ; Copy cur PartitionName to ItemPack
+   xor     al, al
+   stosb                                 ; Ending Zero :)
+   ret
+
+     SMCP_NoBootable:
+   pop     bx
+   mov     dl, 080h                      ; "No Bootable"
+   mov     ds:[bx], dl                   ; set that one
+   mov     si, offset TXT_SETUP_MAGIC_NoBootable
+   push    cs
+   pop     es
+   add     di, LocMENU_ItemPack
+   call    SETUPMAGIC_InternalCopyTillNUL
+   ret
+SETUPMAGIC_ChangeDefaultSelection EndP
+
+; [Linux support removed since v1.02]
+;SETUPMAGIC_ChangeLinuxKernelPart Proc Near   Uses ax cx dx si es di
+;   mov     di, si
+;   mov     dl, ds:[bx]                   ; Cur Partition No.
+;   push    bx
+;      jc      SMCLKP_DoNotModify
+;     SMCLKP_NowGoOn:
+;      mov     dh, CFG_Partitions         ; CFG_Partitions is Base==1
+;      inc     dl                         ; +1 -> 00h instead FFh -> Disabled
+;     SMCLKP_RejectPartition:
+;      call    SETUPMAGIC_InternalCheckUp ; CheckUp DL (max. CFG_Partitions)
+;     SMCLKP_DoNotModify:
+;      or      dl, dl
+;      jz      SMCLKP_FunctionDisabled
+;      ; Get Partition-Pointer (SI) to Partition-To-Boot (DL)
+;      dec     dl
+;      call    PART_GetPartitionPointer
+;      inc     dl
+;      cmp     bptr ds:[si+LocIPT_SystemID], 06h ; FAT-16 required
+;      jne     SMCLKP_RejectPartition
+;   pop     bx
+;   add     si, LocIPT_Name               ; Location of Name
+;   push    cs
+;   pop     es
+;   add     di, LocMENU_ItemPack          ; DI points to ItemPack
+;   mov     cx, 11
+;   rep     movsb                         ; Copy cur PartitionName to ItemPack
+;   xor     al, al
+;   stosb                                 ; Ending Zero
+;  SMCLKP_WriteNewValue:
+;   dec     dl
+;   mov     ds:[bx], dl                   ; Set new partition number
+;   ret
+;
+;     SMCLKP_FunctionDisabled:
+;   pop     bx
+;   mov     si, offset TXT_SETUP_MAGIC_Disabled
+;   push    cs
+;   pop     es
+;   add     di, LocMENU_ItemPack          ; DI points to ItemPack...
+;   call    SETUPMAGIC_InternalCopyTillNUL
+;   jmp     SMCLKP_WriteNewValue
+;SETUPMAGIC_ChangeLinuxKernelPart EndP
+
+; [Linux support removed since v1.02]
+;SETUPMAGIC_ChangeLinuxRootPart  Proc Near   Uses ax cx dx si es di
+;   mov     di, si
+;   pushf                                 ; lame, but it's not working other ways
+;      test    ds:[GotLinux], 1
+;      jnz     SMCLRP_GotLinux
+;   popf
+;   add     di, LocMENU_ItemPack          ; DI points to ItemPack
+;   mov     si, offset TXT_SETUP_MAGIC_NoLinux
+;   push    cs
+;   pop     es
+;   call    SETUPMAGIC_InternalCopyTillNUL
+;   ret
+;     SMCLRP_GotLinux:
+;      mov     dl, ds:[bx]                ; Cur Partition No.
+;      mov     dh, CFG_Partitions
+;      dec     dh
+;   popf
+;   push    bx
+;      jc      SMCLRP_DoNotModify         ; Thou shall not modify :)
+;     SMCLRP_RejectPartition:
+;      call    SETUPMAGIC_InternalCheckUp ; CheckUp DL (max. CFG_Partitions-1)
+;     SMCLRP_DoNotModify:
+;      ; Get Partition-Pointer (SI) to Partition-To-Boot (DL)
+;      call    PART_GetPartitionPointer
+;      cmp     bptr ds:[si+LocIPT_SystemID], 083h
+;      jne     SMCLRP_RejectPartition
+;   pop     bx
+;   mov     ds:[bx], dl
+;   push    cs
+;   pop     es
+;   add     di, LocMENU_ItemPack          ; DI points to ItemPack...
+;   push    di
+;      mov     cx, 12
+;      xor     al, al
+;      rep     stosb                      ; Fill with NULs
+;   pop     di
+;   call    LINUX_TranslateToDEV          ; now translate thingie (DL)
+;   ret
+;SETUPMAGIC_ChangeLinuxRootPart  EndP
+
+; [Linux support removed since v1.02]
+; CH-ItemNo, CL-Add/Sub, BX-PtrToVariable, SI-ItemPack
+;SETUPMAGIC_ChangeLinuxDefaultKernel Proc Near   Uses ax cx dx si es di
+;   mov     di, si
+;   jc      SMCLDK_DoNotEdit
+;
+;   ; --- Edit Linux Default Kernel Name ---
+;   mov     cl, 29                        ; Left side: 29
+;   test    ch, 1000b
+;   jz      SMCLDK_NoRightSide
+;   and     ch, 111b
+;   mov     cl, 68                        ; Right side: 68
+;  SMCLDK_NoRightSide:
+;   add     ch, 6                         ; Koordinate umberechnen
+;   push    cx
+;      call    VideoIO_Locate
+;      mov     cx, 0E01h
+;      call    VideoIO_Color              ; Yellow on Blue
+;      mov     cl, 12
+;      mov     si, offset CFG_LinuxDefaultKernel
+;      call    VideoIO_FixedPrint         ; Print out [SI] (Length = CL)
+;   pop     cx
+;   call    VideoIO_Locate
+;   mov     cl, 11
+;   mov     si, offset CFG_LinuxDefaultKernel
+;   call    VideoIO_LetUserEditString
+;
+;   ; Final-Process string (which means upper-case it)
+;   mov     cl, 11
+;  SMCLDK_FinalProcessLoop:
+;      mov     al, bptr ds:[si]
+;      cmp     al, 'a'
+;      jb      SMCLDK_FinalProcessSkip
+;      cmp     al, 'z'
+;      ja      SMCLDK_FinalProcessSkip
+;      sub     al, 20h
+;     SMCLDK_FinalProcessSkip:
+;      mov     bptr ds:[si], al
+;      inc     si
+;   dec     cl
+;   jnz     SMCLDK_FinalProcessLoop
+;   ; --- End of Edit Linux Default Kernel Name ---
+;
+;  SMCLDK_DoNotEdit:
+;   push    cs
+;   pop     es
+;   add     di, LocMENU_ItemPack          ; DI points to ItemPack...
+;   mov     si, offset CFG_LinuxDefaultKernel
+;   mov     cx, 6                         ; Copy from CFG-Space to ItemPack
+;   rep     movsw
+;   ret
+;SETUPMAGIC_ChangeLinuxDefaultKernel EndP
+
+SETUPMAGIC_ChangeTimedKeyHandling Proc Near   Uses ax cx dx ds si es di
+   mov     di, si
+   mov     dl, ds:[bx]                   ; Cur Timed-Key-Handling
+   jc      SMCTKH_DoNotModify
+   mov     dh, 02h
+   call    SETUPMAGIC_InternalCheckUp    ; CheckUp DL (max. 2)
+  SMCTKH_DoNotModify:
+   mov     ds:[bx], dl
+   cmp     dl, 1
+   jb      SMCTKH_Is0
+   je      SMCTKH_Is1
+   ; ist 2 vermutlich ;)
+   mov     si, offset TXT_SETUP_MAGIC_StopTime
+   jmp     SMCTKH_CopyThiz
+  SMCTKH_Is0:
+   mov     si, offset TXT_SETUP_MAGIC_DoNothing
+   jmp     SMCTKH_CopyThiz
+  SMCTKH_Is1:
+   mov     si, offset TXT_SETUP_MAGIC_ResetTime
+  SMCTKH_CopyThiz:
+   add     di, LocMENU_ItemPack          ; DI points to ItemPack...
+   push    cs
+   pop     es
+   call    SETUPMAGIC_InternalCopyTillNUL
+   ret
+SETUPMAGIC_ChangeTimedKeyHandling EndP
+
+SETUPMAGIC_ChangeBootMenu       Proc Near   Uses ax cx dx ds si es di
+   mov     di, si
+   mov     dl, ds:[bx]                   ; Cur Boot-Menu state
+   jc      SMCBM_DoNotModify
+   mov     dh, 02h
+   call    SETUPMAGIC_InternalCheckUp    ; CheckUp DL (max. 2)
+  SMCBM_DoNotModify:
+   mov     ds:[bx], dl
+   cmp     dl, 1
+   jb      SMCBM_Is0
+   je      SMCBM_Is1
+   ; ist 2 vermutlich ;)
+   mov     si, offset TXT_SETUP_MAGIC_Detailed
+   jmp     SMCBM_CopyThiz
+  SMCBM_Is0:
+   mov     si, offset TXT_SETUP_MAGIC_Disabled
+   jmp     SMCBM_CopyThiz
+  SMCBM_Is1:
+   mov     si, offset TXT_SETUP_MAGIC_Enabled
+  SMCBM_CopyThiz:
+   add     di, LocMENU_ItemPack          ; DI points to ItemPack...
+   push    cs
+   pop     es
+   call    SETUPMAGIC_InternalCopyTillNUL
+   ret
+SETUPMAGIC_ChangeBootMenu       EndP
+
+SETUPMAGIC_ChangeFloppyDisplay  Proc Near   Uses cx dx si es di
+   call    SETUPMAGIC_EnableDisable      ; forward call
+   cmp     byte ptr [CFG_PartDefault], 0FFh         ; Default-Selection is us?
+   jne     SMCFD_Done
+   xor     ch, ch
+   mov     CFG_PartDefault, ch           ; Reset Default-Selection to 1st part
+   ; We need to fill up Item 0 (Default-Selection)...
+   call    SETUP_FillUpItemPack_Now
+   ; ...and display it on screen (so the user thinks that we are not dumb)
+   ; This is hardcoded, but there is no other way.
+   xor     dl, dl
+   call    SETUP_DrawDeSelectItem        ; Redraw Item 0
+  SMCFD_Done:
+   ret
+SETUPMAGIC_ChangeFloppyDisplay  EndP
+
+SETUPMAGIC_ChangeBIOSbootSeq    Proc Near   Uses ax bx cx dx si di
+;!
+;! DEBUG_PROBE
+;!
+IFDEF   AUX_DEBUGx
+    push    1237h
+    call    DEBUG_Probe
+    call    DEBUG_DumpRegisters
+ENDIF
+
+   mov     di, si
+   mov     dl, ds:[bx]                   ; Cur Timed-Key-Handling
+   jc      SMCBBS_DoNotModify
+   mov     dh, 3
+   call    SETUPMAGIC_InternalCheckUp    ; CheckUp DL (max. 3)
+  SMCBBS_DoNotModify:
+   mov     ds:[bx], dl
+   ; DL - Current value
+   or      dl, dl
+   jnz     SMCBBS_Enabled
+   mov     si, offset TXT_SETUP_MAGIC_Disabled
+   cmp     byte ptr [CFG_PartDefault], 0FEh         ; Default-Selection is us?
+   jne     SMCBBS_CopyThiz
+   mov     CFG_PartDefault, dl           ; Reset Default-Selection to 1st part
+   jmp     SMCBBS_CopyThiz
+  SMCBBS_Enabled:
+   dec     dl
+
+   ;movzx   bx, dl
+   mov   bl,dl
+   mov   bh,0
+
+   shl     bx, 1
+   mov     si, word ptr [ContinueBIOSbootTable+bx]
+  SMCBBS_CopyThiz:
+   add     di, LocMENU_ItemPack          ; DI points to ItemPack...
+   push    cs
+   pop     es
+   call    SETUPMAGIC_InternalCopyTillNUL
+   ; Copy device-name to the ContBIOSbootSeq-IPT entry
+   call    PART_UpdateResumeBIOSName
+   ret
+SETUPMAGIC_ChangeBIOSbootSeq    EndP
Index: trunk/bootcode/setup/menus.asm
===================================================================
--- trunk/bootcode/setup/menus.asm	(revision 57)
+++ trunk/bootcode/setup/menus.asm	(revision 57)
@@ -0,0 +1,263 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                           AiR-BOOT SETUP / MENU STRUCTURE
+;---------------------------------------------------------------------------
+
+; Format of a Menu Item:
+; =======================
+;    RoutinePtr            :WORD      - Points to Modification/Exec-Routine
+;                                        if 0, item is empty and will get skiped
+;    VariablePtr           :WORD      - Points to actual Item-Data
+;                                        if 0, no ItemPack. Is used for e.g.
+;                                        main menu items and will exec only
+;    ItemNamePtr           :WORD      - Points to Item-Name
+;    ItemHelpPtr           :WORD      - Points to Item-Help Text
+;    If VariablePtr>0:
+;       ItemPack           :BYTE*12   - Spaceholder for displaying
+;
+;
+; Example:
+;  dw offset MBRS_Magic_ChangePartition, offset CFG_PartDefault
+;  dw offset TXT_SETUP_DefaultPart, offset TXT_SETUPHELP_DefaultPart
+;  dw 6 dup (0)
+;
+; Will be a normal item-entry (not a menu-entry).
+; If modified MBRS_Magic_ChangePartition will get called and CFG_PartDefault
+;  will get modified according to the users key press.
+; The name of the item will be taken from TXT_SETUP_DefaultPart and if help is
+;  requested TXT_SETUPHELP_DefaultPart will get shown.
+;
+;
+; Further Example:
+;  dw offset MBRS_Routines_EnterMenu_PartitionSetup, 0
+;  dw offset TXT_SETUP_PartitionSetup, offset TXT_SETUPHELP_PartitionSetup
+;
+; Will be a menu-entry (due VariablePtr==0)
+; If enter is pressed MBRS_Routines_EnterMenu_PartitionSetup will get called
+; The name of the menu-entry will be taken from TXT_SETUP_PartitionSetup and
+;  if help is requested TXT_SETUPHELP_PartitionSetup will get shown.
+;
+
+IFDEF   MODULE_NAMES
+DB 'MENUS',0
+ENDIF
+
+LocMENU_LenOfMenuPtrBlock    equ          8
+LocMENU_LenOfItemPack        equ         12
+LocMENU_RoutinePtr           equ          0
+LocMENU_VariablePtr          equ          2
+LocMENU_ItemNamePtr          equ          4
+LocMENU_ItemHelpPtr          equ          6
+LocMENU_ItemPack             equ          8 ; only if VariablePtr>0
+
+SETUP_MainMenu:
+                db      0                ; Where Current Item will get saved
+                dw      offset TXT_SETUPHELP_Main ; Pointer to help information
+                ; The Menu-Items start here...
+                dw      offset SETUP_EnterMenu_PartitionSetup, 0
+                dw      offset TXT_SETUP_PartitionSetup, offset TXT_SETUPHELP_PartitionSetup
+                dw      0, 0
+                dw      0, 0
+                dw      offset SETUP_EnterMenu_BasicOptions, 0
+                dw      offset TXT_SETUP_BasicOptions, offset TXT_SETUPHELP_BasicOptions
+                dw      0, 0
+                dw      0, 0
+                dw      offset SETUP_EnterMenu_AdvancedOptions, 0
+                dw      offset TXT_SETUP_AdvOptions, offset TXT_SETUPHELP_AdvOptions
+                dw      0, 0
+                dw      0, 0
+                dw      offset SETUP_EnterMenu_ExtendedOptions, 0
+                dw      offset TXT_SETUP_ExtOptions, offset TXT_SETUPHELP_ExtOptions
+
+                ; The Menu-Items of the right side start here...
+                dw      offset SETUP_EnterMenu_DefineMasterPassword, 0
+                dw      offset TXT_SETUP_DefMasterPwd, offset TXT_SETUPHELP_DefMasterPwd
+                dw      0, 0
+                dw      0, 0
+                dw      offset SETUP_EnterMenu_DefineBootPassword, 0
+                dw      offset TXT_SETUP_DefBootPwd, offset TXT_SETUPHELP_DefBootPwd
+                dw      0, 0
+                dw      0, 0
+                dw      offset SETUP_EnterMenu_SaveAndExitSetup, 0
+                dw      offset TXT_SETUP_SaveAndExit, offset TXT_SETUPHELP_SaveAndExit
+                dw      0, 0
+                dw      0, 0
+                dw      offset SETUP_EnterMenu_ExitWithoutSaving, 0
+                dw      offset TXT_SETUP_JustExit, offset TXT_SETUPHELP_JustExit
+
+SETUP_BasicOptions:
+                db      0                ; Where Current Item will get saved
+                dw      offset TXT_SETUPHELP_SubMenu ; Pointer to help info
+                ; The Menu-Items start here...
+                dw      offset SETUPMAGIC_ChangeDefaultSelection, offset CFG_PartDefault
+                dw      offset TXT_SETUP_DefaultSelection, offset TXT_SETUPHELP_DefaultSelection
+                dw      6 dup (0)
+                ; ATTENTION: ChangeDefaultSelection is redrawn hardcoded in
+                ;             SETUPMAGIC_ChangeFloppyDisplay.
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_TimedBoot
+                dw      offset TXT_SETUP_TimedBoot, offset TXT_SETUPHELP_TimedBoot
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_ChangeBootDelay, offset CFG_TimedSecs
+                dw      offset TXT_SETUP_TimedBootDelay, offset TXT_SETUPHELP_TimedBootDelay
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_ChangeTimedKeyHandling, offset CFG_TimedKeyHandling
+                dw      offset TXT_SETUP_TimedKeyHandling, offset TXT_SETUPHELP_TimedKeyHandling
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_TimedBootLast
+                dw      offset TXT_SETUP_BootLastIfTimed, offset TXT_SETUPHELP_BootLastIfTimed
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_RememberBoot
+                dw      offset TXT_SETUP_RememberLastBoot, offset TXT_SETUPHELP_RememberLastBoot
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_RememberTimed
+                dw      offset TXT_SETUP_RememberTimedBoot, offset TXT_SETUPHELP_RememberTimeBoot
+                dw      6 dup (0)
+                ; The Menu-Items of the right side start here...
+                dw      offset SETUPMAGIC_ChangeFloppyDisplay, offset CFG_IncludeFloppy
+                dw      offset TXT_SETUP_IncludeFloppy, offset TXT_SETUPHELP_IncludeFloppy
+                dw      6 dup (0)
+
+                ; Show LVM Drive Letters or not
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_MiscFlags
+                dw      offset TXT_SETUP_ShowLVMDriveLetters, offset TXT_SETUPHELP_ShowLVMDriveLetters
+                dw      6 dup (0)
+
+                ;~ dw      0, 0
+                ;~ dw      0, 0
+
+
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_ProtectMBR
+                dw      offset TXT_SETUP_MbrProtection, offset TXT_SETUPHELP_MbrProtection
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_IgnoreWriteToMBR
+                dw      offset TXT_SETUP_IgnoreMbrWrites, offset TXT_SETUPHELP_IgnoreMbrWrites
+                dw      6 dup (0)
+                dw      0, 0
+                dw      0, 0
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_MakeSound
+                dw      offset TXT_SETUP_MakeSounds, offset TXT_SETUPHELP_MakeSounds
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_CooperBars
+                dw      offset TXT_SETUP_CooperBars, offset TXT_SETUPHELP_CooperBars
+                dw      6 dup (0)
+
+SETUP_AdvancedOptions:
+                db      0                ; Where Current Item will get saved
+                dw      offset TXT_SETUPHELP_SubMenu ; Pointer to help info
+                ; The Menu-Items start here...
+                dw      offset SETUPMAGIC_ChangeBootMenu, offset CFG_BootMenuActive
+                dw      offset TXT_SETUP_BootMenu, offset TXT_SETUPHELP_BootMenu
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_PartitionsDetect
+                dw      offset TXT_SETUP_PartAutoDetect, offset TXT_SETUPHELP_PartAutoDetect
+                dw      6 dup (0)
+                dw      0, 0
+                dw      0, 0
+                ; Separator Line
+                dw      0, 0
+                dw      offset TXT_SETUP_SecurityOptions, 0
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_PasswordSetup
+                dw      offset TXT_SETUP_PasswordedSetup, offset TXT_SETUPHELP_PasswordedSetup
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_PasswordSystem
+                dw      offset TXT_SETUP_PasswordedSystem, offset TXT_SETUPHELP_PasswordedSystem
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_PasswordChangeBoot
+                dw      offset TXT_SETUP_PasswordedChangeBoot, offset TXT_SETUPHELP_PasswordedBoot
+                dw      6 dup (0)
+                ; The Menu-Items of the right side start here...
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_FloppyBootGetName
+                dw      offset TXT_SETUP_GetFloppyName, offset TXT_SETUPHELP_GetFloppyName
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_FloppyBootGetTimer
+                dw      offset TXT_SETUP_GetFloppyName2Sec, offset TXT_SETUPHELP_GetFloppyName2Sec
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_DetectVirus
+                dw      offset TXT_SETUP_VirusDetect, offset TXT_SETUPHELP_VirusDetect
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_DetectStealth
+                dw      offset TXT_SETUP_StealthDetect, offset TXT_SETUPHELP_StealthDetect
+                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_DetectVIBR
+                dw      offset TXT_SETUP_VIBRdetect, offset TXT_SETUPHELP_VIBRdetect
+                dw      6 dup (0)
+                dw      0, 0
+                dw      0, 0
+                dw      offset SETUPMAGIC_ChangeBIOSbootSeq, offset CFG_ResumeBIOSbootSeq
+                dw      offset TXT_SETUP_ContinueBIOSboot, offset TXT_SETUPHELP_ContinueBIOSboot
+                dw      6 dup (0)
+
+
+SETUP_ExtendedBootOptions:
+                db      0                ; Where Current Item will get saved
+                dw      offset TXT_SETUPHELP_SubMenu ; Pointer to help information
+                ; The Menu-Items start here...
+; [Linux support removed since v1.02]
+;                dw      offset SETUPMAGIC_ChangeLinuxKernelPart, offset CFG_LinuxKrnlPartition
+;                dw      offset TXT_SETUP_LinuxKernelPart, offset TXT_SETUPHELP_LinuxKernelPart
+;                dw      6 dup (0)
+;                dw      offset SETUPMAGIC_ChangeLinuxDefaultKernel, offset CFG_LinuxDefaultKernel
+;                dw      offset TXT_SETUP_LinuxDefaultKernel, offset TXT_SETUPHELP_LinuxDefaultKrnl
+;                dw      6 dup (0)
+;                dw      offset SETUPMAGIC_ChangeLinuxRootPart, offset CFG_LinuxRootPartition
+;                dw      offset TXT_SETUP_LinuxRootPart, offset TXT_SETUPHELP_LinuxRootPart
+;                dw      6 dup (0)
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_IgnoreLVM
+                dw      offset TXT_SETUP_IgnoreLVM, offset TXT_SETUPHELP_IgnoreLVM
+                dw      6 dup (0)
+
+                ;~ dw      offset SETUPMAGIC_EnableDisable, offset CFG_ForceLBAUsage
+                ;~ dw      offset TXT_SETUP_ForceLBAUsage, offset TXT_SETUPHELP_ForceLBAUsage
+                ;~ dw      6 dup (0)
+
+                dw      0, 0    ; added for removal of force-lba
+                dw      0, 0    ; added for removal of force-lba
+
+                dw      offset SETUPMAGIC_EnableDisable, offset CFG_ExtPartitionMShack
+                dw      offset TXT_SETUP_ExtPartMShack, offset TXT_SETUPHELP_ExtPartMShack
+                dw      6 dup (0)
+
+
+
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                ; The Menu-Items of the right side start here...
+                dw      0, 0
+                dw      0, 0
+; [Linux support removed since v1.02]
+                dw      0, 0
+                dw      0, 0
+;                dw      offset SETUP_EnterMenu_LinuxCommandLine, 0
+;                dw      offset TXT_SETUP_DefLinuxCmd, offset TXT_SETUPHELP_DefLinuxCmd
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
+                dw      0, 0
Index: trunk/bootcode/setup/part_set.asm
===================================================================
--- trunk/bootcode/setup/part_set.asm	(revision 57)
+++ trunk/bootcode/setup/part_set.asm	(revision 57)
@@ -0,0 +1,1746 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                          AiR-BOOT SETUP / PARTITION SETUP
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'PART_SET',0
+ENDIF
+
+; This here is called from Menu in AIR-BSET.asm
+PARTSETUP_Main                  Proc Near
+   ; Build Fixed Content...
+   call    PARTSETUP_DrawMenuBase
+   ; Build Dynamic Content...
+   mov     dl, PartSetup_ActivePart
+   mov     dh, dl                        ; DL - Current Active, DH - New Active
+   call    PARTSETUP_RefreshPartitions
+   ; Show Choice-Bar at DH...
+   call    PARTSETUP_BuildChoiceBar
+
+   ; Now we got everything on-the-screen
+  PSM_MainLoop:
+      push    dx
+         mov     ah, 0
+         int     16h
+      pop     dx
+
+        ;
+        ; INSERT DEBUG KEYHANDLER HERE ?
+        ;
+
+      cmp     ah, Keys_Up
+      je      PSM_KeyUp
+      cmp     ah, Keys_Down
+      je      PSM_KeyDown
+      cmp     ah, Keys_Left
+      je      PSM_KeyLeft
+      cmp     ah, Keys_Right
+      je      PSM_KeyRight
+      cmp     ah, Keys_ESC
+      je      PSM_KeyESC
+      cmp     ah, Keys_F1
+      je      PSM_KeyF1
+      cmp     ah, Keys_ENTER
+      je      PSM_KeyENTER
+      ; Flags-Change
+      and     al, 0DFh                    ; Upper-Case Input
+      cmp     al, TXT_SETUP_FlagLetterBootable
+      je      PSM_KeyBootAble
+      cmp     al, TXT_SETUP_FlagLetterVIBR
+      je      PSM_KeyVIBRdetection
+      cmp     al, TXT_SETUP_FlagLetterHide
+
+      jne   skip_x
+      jmp      PSM_KeyHiddenSetup
+   skip_x:
+      cmp     al, TXT_SETUP_FlagLetterDrvLetter
+
+      jne   skip_y
+      jmp      PSM_KeyDriveLetterForceSetup
+   skip_y:
+
+      cmp     al, TXT_SETUP_FlagLetterExtMShack
+      jne   skip_z
+      jmp      PSM_KeyDriveLetterExtMShack
+   skip_z:
+      jmp     PSM_MainLoop
+
+  PSM_KeyESC:
+   ; Simpy exit this menu...
+   mov     PartSetup_ActivePart, dl
+   ret
+
+  PSM_KeyUp:
+   cmp     dh, 1
+   jbe     PSM_MainLoop
+   sub     dh, 2
+   call    PARTSETUP_BuildChoiceBar
+   jmp     PSM_MainLoop
+
+  PSM_KeyDown:
+   add     dh, 2
+   call    PARTSETUP_BuildChoiceBar
+   jmp     PSM_MainLoop
+
+  PSM_KeyLeft:
+   xor     dh, 1
+   call    PARTSETUP_BuildChoiceBar
+   jmp     PSM_MainLoop
+
+  PSM_KeyRight:
+   xor     dh, 1
+   call    PARTSETUP_BuildChoiceBar
+   jmp     PSM_MainLoop
+
+  PSM_KeyF1:
+   mov     bx, offset TXT_SETUPHELP_InPartitionSetup
+   call    SETUP_ShowHelp                ; Shows help
+   jmp     PSM_MainLoop
+
+    ; Disabling editing for type 0x35 is currently implemented
+    ; in PARTSETUP_ChangePartitionName.
+  PSM_KeyENTER:
+   call    PARTSETUP_ChangePartitionName
+   ; Rebuild Menu...
+   call    PARTSETUP_DrawMenuBase
+   call    PARTSETUP_RefreshPartitions
+   call    PARTSETUP_BuildChoiceBar
+   jmp     PSM_MainLoop
+
+  PSM_KeyBootAble:
+   call    PART_GetPartitionPointer      ; Gets Partition (DL) Pointer -> SI
+   ; See if this is an eCS LVM Volume.
+   ; In that case, we don't allow it to be made bootable.
+   ; We also show a popup to inform the user.
+   call    PARTSETUP_IsType35
+   je      PSM_KeyBootAble_istype35
+
+  PSM_KeyBootAble_notype35:
+   mov     al, [si+LocIPT_Flags]
+   xor     al, Flags_Bootable
+   mov     [si+LocIPT_Flags], al
+   call    PARTSETUP_DrawPartitionInfo
+   call    PARTSETUP_BuildChoiceBar
+  PSM_KeyBootAble_istype35:
+   jmp     PSM_MainLoop
+
+  PSM_KeyVIBRdetection:
+   call    PART_GetPartitionPointer      ; Gets Partition (DL) Pointer -> SI
+   mov     al, [si+LocIPT_Flags]
+   xor     al, Flags_VIBR_Detection
+   mov     [si+LocIPT_Flags], al
+   xor     ax, ax
+   mov     word ptr [si+LocIPT_BootRecordCRC], ax
+   call    PARTSETUP_DrawPartitionInfo
+   call    PARTSETUP_BuildChoiceBar
+   jmp     PSM_MainLoop
+
+  PSM_KeyHiddenSetup:
+   call    PARTHIDESETUP_Main
+   ; Rebuild Menu...
+   call    PARTSETUP_DrawMenuBase
+   call    PARTSETUP_RefreshPartitions
+   call    PARTSETUP_BuildChoiceBar
+   jmp     PSM_MainLoop
+
+  PSM_KeyDriveLetterForceSetup:
+   call    PARTSETUP_DriveLetterSetup
+   ; Rebuild Menu...
+   call    PARTSETUP_DrawMenuBase
+   call    PARTSETUP_RefreshPartitions
+   call    PARTSETUP_BuildChoiceBar
+   jmp     PSM_MainLoop
+
+  PSM_KeyDriveLetterExtMShack:
+   call    PART_GetPartitionPointer      ; Gets Partition (DL) Pointer -> SI
+   mov     al, [si+LocIPT_Flags]
+   xor     al, Flags_ExtPartMShack
+   mov     [si+LocIPT_Flags], al
+   call    PARTSETUP_DrawPartitionInfo
+   call    PARTSETUP_BuildChoiceBar
+   jmp     PSM_MainLoop
+PARTSETUP_Main                  EndP
+
+
+; See if this is a partition of type 0x35 and display error
+; when user tries to set it as bootable.
+; IN:   SI = Pointer to partition
+; OUT:  ZF = Set if 0x35, clear otherwise
+PARTSETUP_IsType35      Proc    Near
+   mov     al, [si+LocIPT_SystemID]
+   cmp     al, 35h
+   jne     PARTSETUP_IsType35_end
+   pushf
+   pusha
+   ; Cannot boot LVM-Data partitions
+   mov     cx, 0C04h
+   mov     si, offset TXT_SETUP_NoBootType35
+   call    SETUP_ShowErrorBox
+   popa
+   call    PARTSETUP_DrawMenuBase
+   call    PARTSETUP_RefreshPartitions
+   call    PARTSETUP_BuildChoiceBar
+   popf
+  PARTSETUP_IsType35_end:
+   ret
+PARTSETUP_IsType35      EndP
+
+
+; Draw all standard-things for Partition Setup, dynamic content not included.
+PARTSETUP_DrawMenuBase          Proc Near   Uses dx
+   call    SETUP_DrawMenuWindow          ; Standard Windows
+
+   ; 1st No Hd [09] Name [15] Flags [1D] Type
+   ; 2nd No Hd [31] Name [3D] Flags [45] Type
+
+   mov     cx, 0508h
+   call    VideoIO_Locate
+   inc     TextPosX
+   mov     al, TextChar_WinLineDown
+   mov     cl, 9
+   call    VideoIO_Internal_MakeWinDown  ; Line between 1st No Hd and Name
+   mov     cx, 0515h
+   call    VideoIO_Locate
+   mov     al, TextChar_WinLineDown
+   mov     cl, 9
+   call    VideoIO_Internal_MakeWinDown  ; Line between 1st Name and Flags
+   mov     cx, 051Dh
+   call    VideoIO_Locate
+   mov     al, TextChar_WinLineDown
+   mov     cl, 9
+   call    VideoIO_Internal_MakeWinDown  ; Line between 1st Flags and Type
+
+   mov     cx, 0531h                     ; Line between 2nd No Hd and Name
+   call    VideoIO_Locate
+   mov     al, TextChar_WinLineDown
+   mov     cl, 9
+   call    VideoIO_Internal_MakeWinDown
+   mov     cx, 053Dh                     ; Line between 2nd Name and Flags
+   call    VideoIO_Locate
+   mov     al, TextChar_WinLineDown
+   mov     cl, 9
+   call    VideoIO_Internal_MakeWinDown
+   mov     cx, 0545h                     ; Line between 2nd Flags and Type
+   call    VideoIO_Locate
+   mov     al, TextChar_WinLineDown
+   mov     cl, 9
+   call    VideoIO_Internal_MakeWinDown
+
+   mov     cx, 0B01h
+   call    VideoIO_Color
+
+   ; ------------------------------------- 1st Part
+   mov     cx, 0503h
+   call    VideoIO_Locate
+   mov     si, offset TXT_TopInfos_No    ; "No Hd"
+   mov     cl, 5
+   call    VideoIO_FixedPrint
+   mov     cx, 050Bh
+   call    VideoIO_Locate
+   mov     si, offset TXT_TopInfos_Label ; "Label"
+   mov     cl, 5
+   call    VideoIO_FixedPrint
+   mov     cx, 0517h
+   call    VideoIO_Locate
+   mov     si, offset TXT_TopInfos_Flags ; "Flags"
+   mov     cl, 5
+   call    VideoIO_FixedPrint
+   mov     cx, 051Fh
+   call    VideoIO_Locate
+   mov     si, offset TXT_TopInfos_Type  ; "Type"
+   mov     cl, 4
+   call    VideoIO_FixedPrint
+
+   ; ------------------------------------- 2nd Part
+   mov     cx, 052Bh
+   call    VideoIO_Locate
+   mov     si, offset TXT_TopInfos_No    ; "No Hd"
+   mov     cl, 5
+   call    VideoIO_FixedPrint
+   mov     cx, 0533h
+   call    VideoIO_Locate
+   mov     si, offset TXT_TopInfos_Label ; "Label"
+   mov     cl, 5
+   call    VideoIO_FixedPrint
+   mov     cx, 053Fh
+   call    VideoIO_Locate
+   mov     si, offset TXT_TopInfos_Flags ; "Flags"
+   mov     cl, 5
+   call    VideoIO_FixedPrint
+   mov     cx, 0547h
+   call    VideoIO_Locate
+   mov     si, offset TXT_TopInfos_Type  ; "Type"
+   mov     cl, 4
+   call    VideoIO_FixedPrint
+
+   mov     si, offset TXT_SETUPHELP_PartSetup
+   call    SETUP_DrawMenuHelp
+   ret
+PARTSETUP_DrawMenuBase          EndP
+
+; Displays all partitions into Partition Setup Menu
+;  aka displays dynamic content.
+PARTSETUP_RefreshPartitions     Proc Near   Uses cx dx
+   mov     dl, PartSetup_UpperPart
+   mov     dh, 12
+  PSRP_Loop:
+      call    PARTSETUP_DrawPartitionInfo
+      inc     dl
+   dec     dh
+   jnz     PSRP_Loop
+   ; At last calculate Scroll-Markers
+   mov     cx, 0901h
+   call    VideoIO_Color
+   mov     cx, 0603h                     ; 6, 3
+   mov     dl, PartSetup_UpperPart
+   call    PARTSETUP_UpperScrollMarker
+   mov     cl, 37                        ; 6, 37
+   call    PARTSETUP_UpperScrollMarker
+   mov     cl, 43                        ; 6, 43
+   call    PARTSETUP_UpperScrollMarker
+   mov     cl, 76                        ; 6, 76
+   call    PARTSETUP_UpperScrollMarker
+   mov     cx, 0D03h                     ; 13, 3
+   add     dl, 12                        ; add 12 -> points to last partition
+   mov     dh, CFG_Partitions            ; Limit
+   call    PARTSETUP_LowerScrollMarker
+   mov     cl, 37                        ; 6, 37
+   call    PARTSETUP_LowerScrollMarker
+   inc     dl                            ; add 1 -> cool way ;-)
+   mov     cl, 43                        ; 6, 43
+   call    PARTSETUP_LowerScrollMarker
+   mov     cl, 76                        ; 6, 76
+   call    PARTSETUP_LowerScrollMarker
+   ret
+PARTSETUP_RefreshPartitions     EndP
+
+; Writes Partition-Information to Screen (Partition-Setup)
+;        In: DL - Number of Partition (Base=0)
+; Destroyed: None
+PARTSETUP_DrawPartitionInfo     Proc Near   Uses ax bx cx dx si
+   local NoOfPart :byte
+   mov     ch, dl
+   sub     ch, PartSetup_UpperPart
+   mov     cl, 3                         ; 3 - first Position
+   shr     ch, 1
+   jnc     PSDPI_LeftPos
+   mov     cl, 43                        ; 43 - second Position
+  PSDPI_LeftPos:
+   add     ch, 7                         ; CH - Line Location for PartInfo
+   ; We got location
+   mov     NoOfPart, dl
+   call    VideoIO_Locate
+
+   cmp     dl, CFG_Partitions
+   jb      PSDPI_GotPartitionData
+   push    cx
+      mov     al, ' '
+      mov     cl, 5
+      call    VideoIO_PrintSingleMultiChar
+   pop     cx
+   add     cl, 7
+   call    VideoIO_Locate
+   push    cx
+      mov     al, ' '
+      mov     cl, 11
+      call    VideoIO_PrintSingleMultiChar
+   pop     cx
+   add     cl, 13
+   call    VideoIO_Locate
+   push    cx
+      mov     al, ' '
+      mov     cl, 5
+      call    VideoIO_PrintSingleMultiChar
+   pop     cx
+   add     cl, 7
+   call    VideoIO_Locate
+   push    cx
+      mov     al, ' '
+      mov     cl, 8
+      call    VideoIO_PrintSingleMultiChar
+   pop     cx
+   ret
+
+  PSDPI_GotPartitionData:
+   call    PART_GetPartitionPointer      ; Gets Pointer to Partition (DL) -> SI
+   mov     al, NoOfPart
+   inc     al
+   call    VideoIO_PrintByteNumber
+
+   ; Display "No Hd" field aka "01/01"
+   call    VideoIO_Locate
+   push    cx
+      mov     cx, 0F01h
+      call    VideoIO_Color              ; Bright White, Blue
+   pop     cx
+   mov     al, NoOfPart
+   inc     al
+   call    VideoIO_PrintByteNumber
+   mov     al, '/'
+   call    VideoIO_PrintSingleChar
+   mov     al, [si+LocIPT_Drive]
+   sub     al, 7Fh
+   call    VideoIO_PrintByteNumber
+
+   ; Display "Label" field e.g. "OS2        " (fixed 11 bytes)
+   add     cl, 7
+   call    VideoIO_Locate
+   push    cx
+      mov     cx, 0E01h
+      call    VideoIO_Color              ; Yellow, Blue
+      push    si
+         add     si, LocIPT_Name
+         mov     cl, 11
+         call    VideoIO_FixedPrint
+   pop     si
+   pop     cx
+
+   ; Display "Flags" field aka "BVHL"
+   add     cl, 13
+   call    VideoIO_Locate
+   ; This is using a sub-routine for each flag. Is better that way.
+   mov     bl, [si+LocIPT_Flags]
+   mov     bh, bl
+   mov     al, TXT_SETUP_FlagLetterBootable
+   and     bl, Flags_Bootable
+   call    PARTSETUP_DrawOneFlag
+   mov     bl, bh
+   mov     al, TXT_SETUP_FlagLetterVIBR
+   and     bl, Flags_VIBR_Detection
+   call    PARTSETUP_DrawOneFlag
+   mov     bl, bh
+   mov     al, TXT_SETUP_FlagLetterHide
+   and     bl, Flags_HideFeature
+   call    PARTSETUP_DrawOneFlag
+   mov     bl, bh
+   mov     al, TXT_SETUP_FlagLetterDrvLetter
+   and     bl, Flags_DriveLetter
+   call    PARTSETUP_DrawOneFlag
+   mov     bl, bh
+   mov     al, TXT_SETUP_FlagLetterExtMShack
+   and     bl, Flags_ExtPartMShack
+   call    PARTSETUP_DrawOneFlag
+
+   ; Display "Type" field aka "FAT16Big"
+   add     cl, 7
+   call    VideoIO_Locate
+   push    cx
+      mov     cx, 0C01h
+      call    VideoIO_Color              ; Bright Red, Blue
+   pop     cx
+   mov     al, [si+LocIPT_SystemID]
+   call    PART_SearchFileSysName
+   mov     cl, 8
+   call    VideoIO_FixedPrint
+   ret
+PARTSETUP_DrawPartitionInfo     EndP
+
+;        In: AL - Flag-Letter
+;            BL - ==0 -> Flag not set, =!0 -> Flag set
+; Destroyed: None
+PARTSETUP_DrawOneFlag           Proc Near   Uses cx
+   mov     cx, 0A01h                     ; Bright Green
+   or      bl, bl
+   jnz     PSDOF_FlagSet
+   mov     ch, 09h                       ; Bright Blue
+  PSDOF_FlagSet:
+   call    VideoIO_Color
+   call    VideoIO_PrintSingleChar
+   ret
+PARTSETUP_DrawOneFlag           EndP
+
+;        In: DL - Current Active (to be inactivated)
+;            DH - New Active (to be activated)
+; Destroyed: None
+PARTSETUP_BuildChoiceBar        Proc Near
+   cmp     dl, dh
+   je      PSBCB_SkipRetrace
+   call    VideoIO_WaitRetrace
+  PSBCB_SkipRetrace:
+
+   ; Deactivate current active bar
+   mov     cl, 10h
+   call    PARTSETUP_ReColorPart
+
+   ; Running Fixing
+   cmp     dh, 0FFh
+   jne     PSBCB_NoUnderflow
+   xor     dh, dh
+  PSBCB_NoUnderflow:
+   cmp     dh, CFG_Partitions
+   jb      PSBCB_NoOverflow
+   mov     dh, CFG_Partitions
+   dec     dh
+  PSBCB_NoOverflow:
+   mov     dl, dh
+
+   ; Do we need to scroll ?
+   mov     al, PartSetup_UpperPart
+   cmp     dl, al
+   jb      PSBCB_YesScrolling
+   add     al, 12
+   cmp     dl, al
+   jb      PSBCB_NoScrolling
+   mov     al, dl
+   and     al, 0FEh                      ; UpperPart is never 1/3/5/7/etc.
+   sub     al, 10
+   mov     PartSetup_UpperPart, al
+   call    PARTSETUP_RefreshPartitions
+   jmp     PSBCB_NoScrolling
+  PSBCB_YesScrolling:
+   mov     al, dl
+   and     al, 0FEh                      ; UpperPart is never 1/3/5/7/etc.
+   mov     PartSetup_UpperPart, al
+   call    PARTSETUP_RefreshPartitions
+  PSBCB_NoScrolling:
+
+   ; Activate fresh active bar
+   mov     cl, 40h
+   call    PARTSETUP_ReColorPart
+   ; Now DL==DH
+   ret
+PARTSETUP_BuildChoiceBar        EndP
+
+;        In: CL - Color, DL - Partition
+; Destroyed: None, but Locate-Pointer
+PARTSETUP_ReColorPart           Proc Near   Uses bx cx es di
+   mov     bh, cl     ; Color to BH
+   ; First calculate location of bar
+   cmp     dl, PartSetup_UpperPart
+   jb      PSRCP_NotInWindowView
+   mov     ch, dl
+   sub     ch, PartSetup_UpperPart       ; CH - Position relative to UpperPart
+   cmp     ch, 12                        ; 12 - Maximum Total in Window
+   jae     PSRCP_NotInWindowView
+   mov     cl, 2                         ; 2 - first Position
+   mov     bl, 39                        ; Length of Bar is 39
+   shr     ch, 1
+   jnc     PSRCP_LeftPos
+   mov     cl, 42                        ; 42 - second Position
+   dec     bl                            ; Length of Bar is 38
+  PSRCP_LeftPos:
+   add     ch, 7      ; Y-Position add-on fixed 7
+   call    VideoIO_Locate                ; geht zu CX
+   call    VideoIO_Internal_SetRegs
+   inc     di         ; DI - Destination+1 -> Color-Byte
+   mov     cl, bl     ; Length of Bar is always 39
+  PSRCP_ClearLoop:
+      mov     al, es:[di]
+      and     al, 0Fh
+      or      al, bh     ; setzt den Hintergrund (BH)
+      mov     es:[di], al
+      add     di, 2
+   dec     cl
+   jnz     PSRCP_ClearLoop
+  PSRCP_NotInWindowView:
+   ret
+PARTSETUP_ReColorPart           EndP
+
+;        In: CX - Location, DL - UpperPartNo
+; Destroyed: None, but Locate-Pointer
+PARTSETUP_UpperScrollMarker     Proc Near   Uses ax cx
+   call    VideoIO_Locate
+   mov     al, ' '
+   or      dl, dl
+   jz      PSUSM_NoMarker
+   mov     al, 1Eh
+  PSUSM_NoMarker:
+   mov     cl, 3
+   call    VideoIO_PrintSingleMultiChar
+   ret
+PARTSETUP_UpperScrollMarker     EndP
+
+;        In: CX - Location, DL - UpperPartNo, DH - Limit
+; Destroyed: None, cx dx
+PARTSETUP_LowerScrollMarker     Proc Near   Uses ax cx
+   call    VideoIO_Locate
+   mov     al, ' '
+   cmp     dl, dh
+   jae     PSLSM_NoMarker
+   mov     al, 1Fh
+  PSLSM_NoMarker:
+   mov     cl, 3
+   call    VideoIO_PrintSingleMultiChar
+   ret
+PARTSETUP_LowerScrollMarker     EndP
+
+; =============================================================================
+
+; This is called from MBRS_Routines_PartitionSetup
+;        In: DL - Partition to ChangeName
+; Destroyed: ax bx cx
+PARTSETUP_ChangePartitionName   Proc Near   Uses dx ds si di
+   push    ds
+   pop     es                            ; we need DS==ES in here for MOVSB etc.
+   call    PART_GetPartitionPointer      ; Gets the PartitionPointer for DL in SI
+
+   ; First deactivate current active bar
+   mov     cl, 10h
+   call    PARTSETUP_ReColorPart
+
+   ; Calculate where the Partition-Name is located...
+   mov     ch, dl
+   sub     ch, PartSetup_UpperPart ; CH - Position relative to UpperPart
+   mov     cl, 10                        ; 10 - first Position
+   shr     ch, 1
+   jnc     PSCPN_LeftPos
+   mov     cl, 50                        ; 50 - second Position
+  PSCPN_LeftPos:
+   add     ch, 7      ; Y-Position add-on fixed 7
+   call    VideoIO_Locate                ; Goes to CX
+
+   mov     byte ptr [ChangePartNameSave], 0         ; Don't save to BR / LVM Sector
+
+   ; We compare, if our IPT contains the same partition name as in BR or LVM
+   ;  This is done for security purposes, because if they match, we will update
+   ;  the name in both - IPT and BR/LVM.
+
+   ;movzx   bx, dl
+   mov   bl,dl
+   mov   bh,0
+
+   cmp     byte ptr [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM
+   je      PSCPN_NotLVMSupported
+
+    ;
+    ; BOOKMARK: LVM Label Manipulations
+    ;
+    
+    ; ------------------------------------------------------------[LVM CHECK]---
+    ; Load LVM-Sector here and seek to PartitionName
+    ; Set CurPartition_Location information of destination partition
+    mov     ax, [si+LocIPT_AbsolutePartTable]
+    mov     [CurPartition_Location+0], ax
+    mov     ax, [si+LocIPT_AbsolutePartTable+2]
+    mov     [CurPartition_Location+2], ax
+    mov     ah, byte ptr [si+LocIPT_LocationPartTable+0]
+    mov     al, byte ptr [si+LocIPT_Drive]
+    mov     [CurPartition_Location+4], ax
+    mov     ax, [si+LocIPT_LocationPartTable+1]
+    mov     [CurPartition_Location+6], ax
+    mov     di, si                        ; Put SI into DI
+    call    DriveIO_LoadLVMSector
+    jnc     PSCPN_LVMGotError             ; Security again, if problem -> halt
+    push    dx
+      mov     ax, [di+LocIPT_AbsoluteBegin]
+      mov     dx, [di+LocIPT_AbsoluteBegin+2]
+      call    LVM_SearchForPartition
+    pop     dx
+    jnc     PSCPN_LVMGotError             ; Not Found? -> display error and halt
+
+
+    ; Point to LVM VolumeName
+    add     si, LocLVM_VolumeName
+
+
+    xchg    si, di                        ; SI-IPTEntry, DI-LVM PartName
+    jmp     PSCPN_CheckPartName           ; Check, if match...
+
+
+
+    PSCPN_LVMGotError:
+    jmp     MBR_LoadError
+
+
+
+    ;   mov     si, di                        ; Restore SI and bootrecord fall-back
+    PSCPN_NotLVMSupported:
+    ; ----------------------------------------------------[BOOT-RECORD CHECK]---
+    ; Load Boot-Record...
+    ; BOOKMARK: Load Boot Record
+    push    dx
+      mov     ax, [si+LocIPT_AbsoluteBegin+0]
+      mov     bx, [si+LocIPT_AbsoluteBegin+2]
+      mov     cx, [si+LocIPT_LocationBegin+1]
+      mov     dh, [si+LocIPT_LocationBegin+0]
+      mov     dl, [si+LocIPT_Drive]
+      call    DriveIO_LoadPartition
+    pop     dx
+
+    ; We seek to Partition Label within boot-record here
+    mov     di, offset PartitionSector
+
+    push    si
+      mov     al, [si+LocIPT_SystemID]
+      call    PART_SearchFileSysName
+      ; Replies AH - FileSysFlags, AL - UnhiddenID, SI - FileSysNamePtr
+    pop     si
+
+    test    ah, FileSysFlags_NoName       ; If NoName by FileSysFlag
+    jnz     PSCPN_LetUserEditPartName     ;  -> don't put it into BR at anytime
+    test    ah, FileSysFlags_FAT32        ; FAT32 specific name getting
+    jz      PSCPN_ResumeNormal
+    add     di, 1Ch                       ; Fix for FAT 32, shit
+    PSCPN_ResumeNormal:
+    add     di, 2Bh                       ; ES:DI - Name of Partition
+
+
+
+
+
+    ; This code is used for BR and LVM checking
+    ; Rousseau: Because AiR-BOOT v1.0.8+ uses the LVM_VolumeName, which is copied
+    ; to the IPT, this compare fails when the LVM_PartitionName is not
+    ; the same as the LVM_VolumeName. In that case, only the LVM_VolumeName
+    ; is updated. If they are the same, both are upated so they are the same
+    ; again after the edit.
+
+    PSCPN_CheckPartName:
+
+    ; Do no synchronization initially.
+    mov     byte ptr [SyncLvmLabels],0
+
+    ; SI = IPT_Enty, DI points to LVM VolumeName.
+
+        ; If the partition is an LVM partition then disable editing completely.
+        cmp     byte ptr [si+LocIPT_SystemID], 035h
+        jnz     no_type_35h
+
+    ; Cannot boot LVM-Data partitions
+    pusha
+    mov     cx, 0C04h
+    mov     si, offset TXT_SETUP_NoEditType35
+    call    SETUP_ShowErrorBox
+    popa
+
+
+        jmp     PSCPN_AllDone
+
+    ; SI = IPT_Enty, DI points to LVM VolumeName.
+    no_type_35h:
+
+        ;
+        ; Compare LVM VolumeName and PartitionName and
+        ; set flag if they are the same and need to be synced after user edit.
+        ;
+        push    si
+        push    di
+        mov     si,di               ; Pointer to LVM V-name in SI
+        add     di,LocLVM_LabelLen  ; Pointer to LVM P-name in DI
+        mov     cx,LocLVM_LabelLen  ; Length of LVM label
+        cld
+        repe    cmpsb               ; Compare V and P labels
+        jnz     LVM_Labels_not_equal
+        mov     byte ptr [SyncLvmLabels],1   ; Same so set flag for later
+    LVM_Labels_not_equal:
+        pop     di
+        pop     si
+
+
+    mov     cx, 11                        ; Partition-Name-Length = 11 Bytes
+    push    si
+    push    di
+      add     si, LocIPT_Name            ; DS:SI -> Partition-Name
+      repz    cmpsb
+    pop     di
+    pop     si
+    jne     PSCPN_LetUserEditPartName     ; -> No BR/LVM Changing/Saving
+
+    mov     byte ptr [ChangePartNameSave], 1         ; Remember, so we will save to BR
+
+    ; SI = IPT_Enty, DI points to LVM PartitionName.
+    PSCPN_LetUserEditPartName:
+    ; User will now edit the volume label...
+    mov     cx, 11
+    add     si, LocIPT_Name               ; DS:SI -> Partition-Name
+    call    VideoIO_LetUserEditString     ; -> does actual editing
+    jnc     PSCPN_AllDone                 ; Did user abort ?
+
+    test    byte ptr [ChangePartNameSave], 1
+    jz      PSCPN_AllDone                 ; Actually we just skip BR/LVM-Save
+
+    ; Check, where to save 2nd destination to...
+
+    ;movzx   bx, dl
+    mov   bl,dl
+    mov   bh,0
+
+    cmp     byte ptr [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM
+    je      PSCPN_SaveBootRecord
+
+
+    ; Make DI point to LVM VolumeName in LVM-entry
+    ;~ sub     di,20
+
+        ; Points to LVM VolumeName.
+        push    di
+
+        ; -------------------------------------------------[LVM SAVE VOLUME NAME]---
+        ; Copy 11 bytes from IPT into LVM VolumeName, back-padd with zero's
+        mov     cx, 11
+        push    si
+        rep     movsb
+        pop     si
+
+        ; Padd with zero's, but the editor still might have left spaces
+        ; at the end of the 11-byte part. We correct that below.
+        xor     al, al
+        mov     cx, 9
+        rep     stosb
+
+
+        ;
+        ; The AiR-BOOT Label Editor inserts spaces when a label is edited
+        ; and characters are backspaced.
+        ; This is fine for filesystem labels, which are space padded,
+        ; but the LVM VolumeName and PartitionName need to be zero padded.
+        ; So, below we replace all trailing spaces with zero's.
+        ;
+        ; Correct LVM VolumeName
+        ;
+        mov     cx,20
+    vn_padd_next:
+        jcxz    vn_padded
+        dec     di
+        dec     cx
+        mov     al,[di]
+        test    al,al
+        jz      vn_padd_next
+        cmp     al,' '
+        jnz     vn_padded
+        mov     byte ptr [di],0
+        jmp     vn_padd_next
+    vn_padded:
+
+        ; Points to LVM VolumeName
+        pop     di
+
+        ; See if LVM-labels need to be synced.
+        test    byte ptr [SyncLvmLabels],1
+        jz      LVM_no_sync_labels
+
+        ; Sync LVM-labels.
+        mov     si,di
+        add     di,LocLVM_LabelLen
+        mov     cx,LocLVM_LabelLen
+        cld
+        rep     movsb
+
+
+    LVM_no_sync_labels:
+        ; Update LVM-CRC now...
+        mov     si, offset LVMSector
+        call    LVM_UpdateSectorCRC
+        IFDEF ReleaseCode
+          call    DriveIO_SaveLVMSector      ; Save sector
+        ENDIF
+        jmp     PSCPN_AllDone
+
+    ; -----------------------------------------------------[BOOT-RECORD SAVE]---
+    ; BOOKMARK: Save Boot Record (After change from Setup Menu)
+    PSCPN_SaveBootRecord:
+        ; Copy 11 bytes from IPT to Boot-Record
+        mov     cx, 11
+        push    si
+          rep     movsb                      ; Copy IPT-name to Boot-Record
+        pop     si
+        IFDEF ReleaseCode
+          call    DriveIO_SavePartition      ; Saves Boot-Record
+        ENDIF
+
+    ; And reset VIBR-CRC, otherwise virus-warning and system-halt
+    ; BOOKMARK: Update CRC on Partition Sector
+    sub     si, LocIPT_Name               ; Now pointer points to base again...
+    mov     bx, offset [PartitionSector]
+    call    PART_UpdateBootRecordCRC
+
+    PSCPN_AllDone:
+        ; This here is done for safety, because we misused CurPartition_Location
+        xor     ax, ax
+        mov     di, offset CurPartition_Location
+        mov     cx, 4
+        rep     stosw                         ; NUL out CurPartition_Location
+    ret
+PARTSETUP_ChangePartitionName   EndP
+
+; =============================================================================
+; This is called from MBRS_Routines_PartitionSetup
+;        In: DL - Partition to HiddenSetup
+; Destroyed: ax
+PARTHIDESETUP_Main              Proc Near   Uses dx
+   ; Spread Special-Marker from Hide-Config
+   call    PARTHIDESETUP_GetHideConfigAndSpread
+   ; Calculate Position of Window.
+   ; If Partition Selected Left-Side -> go Right-Sided Window
+   ;                                     otherwise Left-Sided.
+   mov     [PartSetup_ActivePart], dl
+   mov     ax, 0102h
+   and     dl, 1
+   jnz     PHSM_FirstStep
+   mov     ax, 002Ah
+  PHSM_FirstStep:
+   mov     [PartSetup_HiddenX], al
+   mov     [PartSetup_HiddenAdd], ah
+
+   ; Draw Menu...
+   xor     dx, dx
+   mov     [PartSetup_HiddenUpper], dl
+   call    PARTHIDESETUP_DrawMenuBase
+   call    PARTHIDESETUP_RefreshPartitions
+   ; Show Choice-Bar at DH...
+   call    PARTHIDESETUP_BuildChoiceBar
+
+   ; Now we got everything on-the-screen
+  PHSM_MainLoop:
+      mov     ah, 0
+      int     16h
+      cmp     ah, Keys_Up
+      je      PHSM_KeyUp
+      cmp     ah, Keys_Down
+      je      PHSM_KeyDown
+      cmp     ah, Keys_ESC
+      je      PHSM_KeyESC
+      cmp     ah, Keys_F1
+      je      PHSM_KeyF1
+      cmp     ah, Keys_ENTER
+      je      PHSM_KeyToogle
+      cmp     ah, Keys_Plus
+      je      PHSM_KeyToogle
+      cmp     ah, Keys_Minus
+      je      PHSM_KeyToogle
+      cmp     ah, Keys_GrayPlus
+      je      PHSM_KeyToogle
+      cmp     ah, Keys_GrayMinus
+      je      PHSM_KeyToogle
+      cmp     ah, Keys_PageDown
+      je      PHSM_KeyToogle
+      cmp     ah, Keys_PageUp
+      je      PHSM_KeyToogle
+      ; ASCII values...
+      cmp     al, Keys_Space
+      je      PHSM_KeyToogle
+      jmp     PHSM_MainLoop
+
+  PHSM_KeyESC:
+   ; Collect Hide-Partition-Config and put it into Hide-Table
+   mov     dl, [PartSetup_ActivePart]
+
+IFDEF   AUX_DEBUG
+        ;~ pusha
+        ;~ mov     al,dl   ; Partition the hiding is set for.
+        ;~ call    AuxIO_TeletypeHexByte
+        ;~ call    AuxIO_TeletypeNL
+        ;~ popa
+ENDIF
+
+   call    PARTHIDESETUP_CollectHideConfigAndPutToTable
+   ; Simply return to Partition Setup
+   ret
+
+  PHSM_KeyUp:
+   dec     dh
+   call    PARTHIDESETUP_BuildChoiceBar
+   jmp     PHSM_MainLoop
+
+  PHSM_KeyDown:
+   inc     dh
+   call    PARTHIDESETUP_BuildChoiceBar
+   jmp     PHSM_MainLoop
+
+  PHSM_KeyToogle:
+
+IFDEF   AUX_DEBUG
+        ;~ pusha
+        ;~ mov     al,dl   ; Index of partition to set Special Marker on.
+        ;~ call    AuxIO_TeletypeHexByte
+        ;~ call    AuxIO_TeletypeNL
+        ;~ popa
+ENDIF
+
+   call    PART_GetPartitionPointer      ; Holt den Pointer der Partition (DL) nach SI
+   mov     al, [si+LocIPT_Flags]
+   xor     al, Flags_SpecialMarker
+   mov     [si+LocIPT_Flags], al
+   call    PARTHIDESETUP_DrawPartitionInfo
+   call    PARTHIDESETUP_BuildChoiceBar
+   jmp     PHSM_MainLoop
+
+  PHSM_KeyF1:
+   mov     bx, offset TXT_SETUPHELP_HideSetup
+   call    SETUP_ShowHelp        ; Shows help
+   jmp     PHSM_MainLoop
+PARTHIDESETUP_Main              EndP
+
+; Draw all standard-things for HiddenSetup, dynamic content not included.
+PARTHIDESETUP_DrawMenuBase      Proc Near   Uses dx
+   ; PartSetup_HiddenX1
+
+CLR_PART_HIDE_WINDOW_BASE_CLASSIC   = 0d05h
+CLR_PART_HIDE_WINDOW_BASE_BM   = 0a02h
+
+   mov     cx, CLR_PART_HIDE_WINDOW_BASE_BM                    ; Lila on lila
+   call    VideoIO_Color
+   mov     bh, 05h
+   mov     bl, [PartSetup_HiddenX]
+   mov     dh, 10h
+   mov     dl, bl
+   add     dl, 25h
+   add     dl, [PartSetup_HiddenAdd]
+   push    bx
+      call    VideoIO_MakeWindow
+   pop     bx
+   ; --- Make Window-Header - "Hide Feature" at top frame-line
+   inc     bl
+   mov     cx, bx
+   call    VideoIO_Locate
+   mov     al, 'µ'
+   call    VideoIO_PrintSingleChar
+
+CLR_PART_HIDE_WINDOW_LABEL_CLASSIC = 0e05h
+CLR_PART_HIDE_WINDOW_LABEL_BM = 0e02h
+
+   mov     cx, CLR_PART_HIDE_WINDOW_LABEL_BM                     ; Yellow on Lila
+   call    VideoIO_Color
+   mov     si, offset TXT_SETUP_HideFeature
+   call    VideoIO_Print
+
+CLR_PART_HIDE_WINDOW_BORDER_CLASSIC = 0d05h
+CLR_PART_HIDE_WINDOW_BORDER_BM = 0d02h
+
+
+   mov     cx, CLR_PART_HIDE_WINDOW_BORDER_BM                     ; Lila on lila
+   call    VideoIO_Color
+   mov     al, 'Æ'
+   call    VideoIO_PrintSingleChar
+   ; --- Make Window-Footer - "State when booting..." at bottom right frame-line
+   mov     dh, 10h
+   mov     dl, [PartSetup_HiddenX]
+   add     dl, 25h
+   add     dl, [PartSetup_HiddenAdd]       ; Location 16, HiddenX->right aligned
+   mov     si, offset TXT_SETUP_HideFeature2
+   call    GetLenOfString                ; CX - Length of HideFeature2
+   sub     dl, cl                        ; Adjust Position
+   push    dx
+      mov     dl, [PartSetup_ActivePart]
+      call    PART_GetPartitionPointer   ; Holt den Pointer der Partition (DL) nach SI
+   pop     dx
+   ; Display "Label" field without ending NULs/Spaces
+   add     si, LocIPT_Name
+   mov     cx, 11
+   call    GetLenOfName
+   sub     dl, cl                        ; Adjust position
+   sub     dl, 2
+   push    cx
+   push    si                         ; SI == Label Field
+      mov     cx, dx
+      call    VideoIO_Locate
+      mov     al, '<'
+      call    VideoIO_PrintSingleChar
+      mov     si, offset TXT_SETUP_HideFeature2
+      call    VideoIO_Print
+   pop     si
+   pop     cx
+   call    VideoIO_FixedPrint
+   mov     al, '>'
+   call    VideoIO_PrintSingleChar
+
+;   inc     cl
+;   call    MBR_Locate                    ; Location 16, HiddenX
+;   mov     al, 'µ'
+;   call    MBR_PrintSingleChar
+;   mov     cx, 0E05h                     ; Yellow on Lila
+;   call    MBR_Color
+;   mov     si, offset TXT_SETUP_HideFeature2
+;   call    MBR_Print
+;   mov     dl, PartSetup_ActivePart
+;   call    MBR_Part_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI
+;  ; Display "Label" field without ending NULs/Spaces
+;   add     si, LocIPT_Name
+;   mov     cx, 11
+;   call    MBR_GetLenOfName
+;   call    MBR_FixedPrint
+;   mov     cx, 0D05h                     ; Lila on lila
+;   call    MBR_Color
+;   mov     al, 'Æ'
+;   call    MBR_PrintSingleChar
+
+   ; --- Make ':' Line down
+
+CLR_PART_HIDE_MENU_BASE_CLASSIC  = 0f05h
+CLR_PART_HIDE_MENU_BASE_BM  = 0f02h
+
+   mov     cx, CLR_PART_HIDE_MENU_BASE_BM                     ; Yellow on Lila
+   call    VideoIO_Color
+   mov     ch, 07h
+   mov     cl, PartSetup_HiddenX
+   add     cl, 24
+   add     cl, PartSetup_HiddenAdd
+   call    VideoIO_Locate
+   mov     al, ':'
+   mov     cl, 8
+   call    VideoIO_Internal_MakeWinDown
+   ret
+PARTHIDESETUP_DrawMenuBase      EndP
+
+; Draw all partitions to Hidden-Setup aka Dynamic Content-Draw
+PARTHIDESETUP_RefreshPartitions Proc Near   Uses dx
+   mov     dl, [PartSetup_HiddenUpper]
+   mov     dh, 8
+  PHSRP_Loop:
+      call    PARTHIDESETUP_DrawPartitionInfo
+      inc     dl
+   dec     dh
+   jnz     PHSRP_Loop
+
+CLR_PART_HIDE_MENU_MARKERS_CLASSIC = 0d05h
+CLR_PART_HIDE_MENU_MARKERS_BM = 0a02h
+
+   ; At last calculate Scroll-Markers
+   mov     cx, CLR_PART_HIDE_MENU_MARKERS_BM                     ; Lila on lila                          ; Hide Feature Markers
+   call    VideoIO_Color
+   mov     cx, 0603h                     ; 6, +3
+   add     cl, [PartSetup_HiddenX]
+   mov     dl, [PartSetup_HiddenUpper]
+   call    PARTSETUP_UpperScrollMarker
+   add     cl, 29
+   add     cl, [PartSetup_HiddenAdd]       ; 6, +29
+   call    PARTSETUP_UpperScrollMarker
+   mov     cx, 0F03h                     ; 15, +3
+   add     cl, [PartSetup_HiddenX]
+   add     dl, 8                         ; add 8 -> points to last partition
+   mov     dh, [CFG_Partitions]            ; Limit
+   call    PARTSETUP_LowerScrollMarker
+   add     cl, 29
+   add     cl, [PartSetup_HiddenAdd]       ; 6, +29
+   call    PARTSETUP_LowerScrollMarker
+   ret
+PARTHIDESETUP_RefreshPartitions EndP
+
+PARTHIDESETUP_DrawPartitionInfo Proc Near   Uses dx
+   local NoOfPart :byte
+   mov     ch, dl
+   sub     ch, [PartSetup_HiddenUpper]
+   add     ch, 7
+   mov     cl, 2
+   add     cl, [PartSetup_HiddenX]
+   ; We got location
+   mov     NoOfPart, dl
+   call    VideoIO_Locate
+
+   ; Clean data-area...
+   push    cx
+      mov     al, ' '
+      mov     cl, 22
+      call    VideoIO_PrintSingleMultiChar
+   pop     cx
+
+   cmp     dl, [CFG_Partitions]
+   jae     PHSDPI_NoData
+
+   call    PART_GetPartitionPointer      ; Holt den Pointer der Partition (DL) nach SI
+   call    VideoIO_Locate
+   push    cx
+      ; Display "Label" field aka "OS2" without ending NULs/Spaces
+
+CLR_PART_HIDE_LABEL_CLASSIC   = 0f05h
+CLR_PART_HIDE_LABEL_BM = 0f02h
+
+      mov     cx, CLR_PART_HIDE_LABEL_BM
+      call    VideoIO_Color              ; Bright White on Lila
+      push    si
+         add     si, LocIPT_Name
+         mov     cx, 11
+         call    GetLenOfName
+         call    VideoIO_FixedPrint
+      pop     si
+
+CLR_PART_HIDE_WINDOW_FS_CLASSIC   = 0d05h
+CLR_PART_HIDE_WINDOW_FS_BM = 0a02h
+
+      mov     cx, CLR_PART_HIDE_WINDOW_FS_BM
+      call    VideoIO_Color              ; Bright Lila on Lila
+      mov     al, ' '
+      call    VideoIO_PrintSingleChar
+      mov     al, '['
+      call    VideoIO_PrintSingleChar
+      ; Display "Type" field aka "HPFS" without ending NULs/Spaces
+      push    si
+         mov     al, [si+LocIPT_SystemID]
+         call    PART_SearchFileSysName
+         mov     cx, 8
+         call    GetLenOfName
+         call    VideoIO_FixedPrint
+      pop     si
+      mov     al, ']'
+      call    VideoIO_PrintSingleChar
+   pop     cx
+   add     cl, 24
+   add     cl, PartSetup_HiddenAdd
+   call    VideoIO_Locate
+   push    cx
+
+CLR_PART_HIDE_WINDOW_CHOISES_CLASSIC   = 0e05h
+CLR_PART_HIDE_WINDOW_CHOISES_BM   = 0e02h
+
+      mov     cx, CLR_PART_HIDE_WINDOW_CHOISES_BM
+      call    VideoIO_Color              ; Yellow on Lila
+      mov     al, ' '
+      mov     cl, 10
+      call    VideoIO_PrintSingleMultiChar ; Fill up area with spaces
+      ; Finally draw Hidden/Unhidden
+      mov     bl, [si+LocIPT_Flags]
+      mov     si, offset TXT_SETUP_MAGIC_Unhidden
+      and     bl, Flags_SpecialMarker
+      jz      PHSDPI_IsNotHidden
+      mov     si, offset TXT_SETUP_MAGIC_Hidden
+     PHSDPI_IsNotHidden:
+      call    GetLenOfString
+      mov     dx, cx
+   pop     cx
+   add     cx, 10
+   sub     cx, dx
+   call    VideoIO_Locate
+   call    VideoIO_Print
+  PHSDPI_NoData:
+   ret
+PARTHIDESETUP_DrawPartitionInfo EndP
+
+;        In: DL - Current Active (to be inactivated)
+;            DH - New Active (to be activated)
+; Destroyed: None
+PARTHIDESETUP_BuildChoiceBar    Proc Near
+   cmp     dl, dh
+   je      PHSBCB_SkipRetrace
+   call    VideoIO_WaitRetrace
+  PHSBCB_SkipRetrace:
+
+CLR_PART_HIDE_WINDOW_MENU_BAR_CLASSIC  = 5eh
+CLR_PART_HIDE_WINDOW_MENU_BAR_BM = 2eh
+
+   ; Deactivate current active bar
+   mov     cl, CLR_PART_HIDE_WINDOW_MENU_BAR_BM                       ; Yellow on Lila
+   call    PARTHIDESETUP_ReColorPart
+
+   ; Running Fixing
+   cmp     dh, 0FFh
+   jne     PHSBCB_NoUnderflow
+   xor     dh, dh
+  PHSBCB_NoUnderflow:
+   cmp     dh, [CFG_Partitions]
+   jb      PHSBCB_NoOverflow
+   mov     dh, [CFG_Partitions]
+   dec     dh
+  PHSBCB_NoOverflow:
+   mov     dl, dh
+
+   ; Do we need to scroll ?
+   mov     al, [PartSetup_HiddenUpper]
+   cmp     dl, al
+   jb      PHSBCB_YesScrolling
+   add     al, 8
+   cmp     dl, al
+   jb      PHSBCB_NoScrolling
+   mov     al, dl
+   sub     al, 7
+   mov     [PartSetup_HiddenUpper], al
+   call    PARTHIDESETUP_RefreshPartitions
+   jmp     PHSBCB_NoScrolling
+  PHSBCB_YesScrolling:
+   mov     al, dl
+   mov     [PartSetup_HiddenUpper], al
+   call    PARTHIDESETUP_RefreshPartitions
+  PHSBCB_NoScrolling:
+
+   ; Activate fresh active bar
+
+CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_CLASSIC = 1fh
+CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_BM   = 1fh
+
+   mov     cl, CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_BM                       ; Bright White on Blue
+   call    PARTHIDESETUP_ReColorPart
+   ; Now DL==DH
+   ret
+PARTHIDESETUP_BuildChoiceBar    EndP
+
+;        In: CL - Color, DL - Partition
+; Destroyed: None, but Locate-Pointer
+PARTHIDESETUP_ReColorPart       Proc Near   Uses bx cx es di
+   mov     bh, cl     ; Color to BH
+   ; First calculate location of bar
+   cmp     dl, [PartSetup_HiddenUpper]
+   jb      PHSRCP_NotInWindowView
+   mov     ch, dl
+   sub     ch, [PartSetup_HiddenUpper]     ; CH - Position relative to HiddenUpper
+   cmp     ch, 8                         ; 8 - Maximum Total in Window
+   jae     PHSRCP_NotInWindowView
+   add     ch, 7
+   mov     cl, 26
+   add     cl, [PartSetup_HiddenX]
+   add     cl, [PartSetup_HiddenAdd]
+
+   mov     bl, 10                        ; Length of Bar is 10
+   call    VideoIO_Locate                ; geht zu CX
+   call    VideoIO_Internal_SetRegs
+   inc     di         ; DI - Destination+1 -> Color-Byte
+   mov     cl, bl     ; Length of Bar is always 39
+  PHSRCP_ClearLoop:
+      mov     es:[di], bh
+      add     di, 2
+   dec     cl
+   jnz     PHSRCP_ClearLoop
+  PHSRCP_NotInWindowView:
+   ret
+PARTHIDESETUP_ReColorPart       EndP
+
+; =============================================================================
+
+
+;
+; Rousseau: Adjusted for packed hidden-part-table !
+;           Needs to be re-written.
+;
+; This is called by MBRS_PS_HiddenSetup
+;        In: DL - Partition, where to save Hide-Config
+; Destroyed: None, but Locate-Pointer
+PARTHIDESETUP_GetHideConfigAndSpread Proc Near Uses ax bx dx si di
+        ; First check HideFeature-Flag on selected partition.
+        ;  if it's not set, don't do anything...
+        call    PART_GetPartitionPointer      ; Holt den Pointer der Partition (DL) nach SI
+        mov     al, [si+LocIPT_Flags]
+        test    al, Flags_HideFeature
+        jz      PHSGHCAS_EndOfEntries
+    PHSGHCAS_SomethingHidden:
+        ; Calculate, where to get Hide-Config
+        mov     ax, LocHPT_LenOfHPT     ; Size of a hidden-part-table entry.
+        mul     dl      ; Multiply by partition-index.
+        mov     di, offset HidePartitionTable
+        add     di, ax                        ; We got the pointer
+
+        ; So process Hide-Config. Read out Bitfield-Entries,
+        ; each points to a partition.
+        ; 3Fh is end-marker / maximum entries = CFG_Partitions
+        mov     cl, [CFG_Partitions]
+        mov     bx,di   ; Pointer to hidden-parts entry for this partition.
+        mov     ch,0    ; Start index in hidden-parts entry for this partition.
+        mov     dh,6    ; Bitfields are 6 bits wide.
+    PHSGHCAS_SpreadLoop:
+        mov     dl,ch   ; Load bitfield index from CH.
+        call    CONV_GetBitfieldValue   ; Get value of bitfield.
+        mov     dl,al   ; Partition index in DL.
+        ;~ mov     dl, [di]
+        ;~ inc     di
+        ;~ cmp     dl, 0FFh
+        cmp     dl,3fh  ; Max value for 6-bits field.
+        je      PHSGHCAS_EndOfEntries
+        call    PART_GetPartitionPointer   ; Pointer for partition DL to SI
+        mov     al, [si+LocIPT_Flags]
+        or      al, Flags_SpecialMarker    ; Set marker
+        mov     [si+LocIPT_Flags], al
+        inc     ch      ; Next bitfield.
+        dec     cl
+        jnz     PHSGHCAS_SpreadLoop
+    PHSGHCAS_EndOfEntries:
+        ret
+PARTHIDESETUP_GetHideConfigAndSpread EndP
+
+
+;
+; Rousseau: Adjusted for packed hidden-part-table !
+;           Needs to be re-written.
+;
+; This is called by MBRS_PS_HiddenSetup
+;        In: DL - Partition, where to save Hide-Config
+; Destroyed: None, but Locate-Pointer
+PARTHIDESETUP_CollectHideConfigAndPutToTable Proc Near Uses ax si es di
+        ; First calculate, where to put Hide-Config
+        ;~ mov     ax, LocIPT_MaxPartitions
+        mov     ax, LocHPT_LenOfHPT             ; Length of an HPT-entry.
+        mul     dl                              ; Partition to store info for.
+        push    cs
+        pop     es
+        mov     di, offset HidePartitionTable   ; Packed hideparttable.
+        add     di, ax                          ; We got the pointer in DI.
+
+        ;~ push    di
+
+        ; Fill hide-part-table entry with 'unused' marker.
+        ; Note that the entry is actually an array of 45 6-bit bitfields.
+        ; Below fills 34 bytes = 45 6-bit bitfields.
+        push    di
+        mov     cx, LocHPT_LenOfHPT
+        mov     al, 0FFh
+        rep     stosb                           ; Fill up with FFh
+        pop     di
+
+        ;~ mov     bp,di
+
+        ; Now walk through the IPT collecting all SpecialMarkers.
+        ; For each do a bitfield-entry containing the number of the partition.
+        mov     si, offset PartitionTable
+        xor     ch, ch                          ; Partition index
+        mov     cl, [CFG_Partitions]            ; Nr. of partitions in IPT
+        mov     ah,0                            ; Next hide-index to write.
+
+    ;
+    ; Collect all partitions that have the special marker set.
+    ; This marker was set by toggling the hide/unhide option in the setup menu.
+    ;
+    PHSCHCAPTT_CollectLoop:
+
+        ; Get marker and test it.
+        mov     bl, [si+LocIPT_Flags]
+        test    bl, Flags_SpecialMarker
+
+        ; No marker.
+        jz      PHSCHCAPTT_NoMarker
+
+        ; Setup stuff for bitfield operation.
+        push    dx          ; Save partition pointer.
+        push    bx          ; Save marker.
+        mov     bx,di       ; Get pointer to HPT-entry.
+        mov     dl,ah       ; Index in entry.
+        mov     dh,6        ; Bitfield width.
+        push    ax          ; Save index.
+        mov     al,ch       ; Partition index to store.
+
+
+    IFDEF   AUX_DEBUG
+        ;~ pushf
+        ;~ pusha
+        ;~ push    ax
+        ;~ mov     al,dl
+        ;~ call    AuxIO_TeletypeHexByte
+        ;~ mov     al,':'
+        ;~ call    AuxIO_Teletype
+        ;~ mov     ax,bx
+        ;~ call    AuxIO_TeletypeHexWord
+        ;~ mov     al,':'
+        ;~ call    AuxIO_Teletype
+        ;~ mov     ax,bp
+        ;~ call    AuxIO_TeletypeHexWord
+        ;~ mov     al,':'
+        ;~ call    AuxIO_Teletype
+        ;~ mov     ax,sp
+        ;~ call    AuxIO_TeletypeHexWord
+        ;~ mov     al,':'
+        ;~ call    AuxIO_Teletype
+        ;~ pop     ax
+        ;~ call    AuxIO_TeletypeHexByte
+        ;~ call    AuxIO_TeletypeNL
+        ;~ popa
+        ;~ popf
+    ENDIF
+
+        call    CONV_SetBitfieldValue   ; Store bitfield.
+        pop     ax          ; Restore index.
+        pop     bx          ; Restore marker.
+        pop     dx          ; Restore partition pointer.
+
+        inc     ah          ; Advance to next index.
+
+        ;~ mov     ds:[di], ch             ; Write byte-Entry
+        ;~ inc     di
+        xor     bl, Flags_SpecialMarker     ; Reset Flag
+        mov     [si+LocIPT_Flags], bl       ; Store it in IPT
+
+
+    PHSCHCAPTT_NoMarker:
+        add     si, LocIPT_LenOfIPT         ; Advance to next partition in IPT.
+        inc     ch                          ; Next partition-index.
+        dec     cl                          ; Decrement partitions to process.
+        jnz     PHSCHCAPTT_CollectLoop      ; Are we done yet ?
+
+        ;~ pop     si                        ; Original Hide-Config Pointer -> SI
+        ; Now check, if we have written anything
+        ;~ cmp     si, di
+        test    ah,ah                       ; See if we had to store anything.
+        jne     PHSCHCAPTT_SomethingToHide  ; Yep, go to write end-marker.
+
+        ; Nothing to hide...so UNSET the Hidden-Feature Flag
+        call    PART_GetPartitionPointer    ; Use DL to get part-pointer in SI.
+        mov     al, [si+LocIPT_Flags]       ; Get flags.
+        mov     ah, Flags_HideFeature       ; Hide mask.
+        not     ah                          ; Complement.
+        and     al, ah                      ; Clear hide-flag.
+        mov     [si+LocIPT_Flags], al       ; Store it.
+        ;~ pop     bp
+        ret                                 ; Return to caller.
+
+    PHSCHCAPTT_SomethingToHide:
+        cmp     ah, LocIPT_MaxPartitions    ; See if index is at end.
+        jae     PHSCHCAPTT_AllUsed          ; Yep, no need to store end-marker.
+
+        ; Write end-marker.
+        push    dx                          ; Save partition pointer.
+        mov     al,3fh                      ; End marker (6-bit)
+        mov     dl,ah                       ; Index in HPT-entry.
+        mov     dh,6                        ; Bitfield width.
+        mov     bx,di                       ; Get pointer to HPT-entry.
+        call    CONV_SetBitfieldValue       ; Store end-marker.
+        pop     dx                          ; Restore partition pointer.
+
+        ;~ mov     ax, si
+        ;~ add     ax, LocIPT_MaxPartitions
+        ;~ cmp     di, ax
+        ;~ jae     PHSCHCAPTT_AllUsed
+        ; Set END-marker
+        ;~ mov     al, 0FFh
+        ;~ stosb                                 ; Write byte-Entry
+    PHSCHCAPTT_AllUsed:
+
+        ; Something to hide...so SET the Hidden-Feature Flag
+        call    PART_GetPartitionPointer    ; Use DL to get part-pointer in SI.
+        mov     al, [si+LocIPT_Flags]       ; Get flags.
+        or      al, Flags_HideFeature       ; Set hide-flag.
+        mov     [si+LocIPT_Flags], al       ; Store it.
+        ;~ pop     bp
+        ret                                 ; Return to caller.
+PARTHIDESETUP_CollectHideConfigAndPutToTable EndP
+
+; =============================================================================
+
+; This is called from MBRS_Routines_PartitionSetup
+;        In: DL - Partition to LogicalDriveLetter-Setup
+; Destroyed: ax
+PARTSETUP_DriveLetterSetup      Proc Near  Uses dx si es di
+   call    PART_GetPartitionPointer      ; Gets the PartitionPointer for DL in SI
+   ; SystemID must support DriveLetter feature (FAT16, HPFS, JFS)
+   mov     al, bptr [si+LocIPT_SystemID]
+   push    si
+      call    PART_SearchFileSysName
+   pop     si
+   test    ah, FileSysFlags_DriveLetter
+   jnz     PSDLS_GotLDLP
+
+   ; Drive-Letter feature only possible on HPFS/FAT16 (OS/2) systems
+   mov     cx, 0C04h
+   mov     si, offset TXT_SETUP_NoLDLpartition
+   call    SETUP_ShowErrorBox
+   ret
+
+  PSDLS_GotLDLP:
+   ; First build up menu and display current setting...
+   call    PARTSETUPDL_DrawMenuBase      ; DL - partition-no
+
+   ; Now get the Logical-Drive-Letter for that partition...
+   ;movzx   bx, dl
+   mov   bl,dl
+   mov   bh,0
+
+   mov     dl, byte ptr [DriveLetters+bx]
+
+   push    bx
+      ; DS:SI - IPT Entry of Partition, DL - LogicalDriveLetter
+      call    PARTSETUPDL_DrawDriveLetter
+
+      ; Now we got everything on-the-screen
+     PSDLS_MainLoop:
+         mov     ah, 0
+         int     16h
+         cmp     ah, Keys_Backspace
+         je      PSDLS_BackSpace
+         cmp     ah, Keys_Up
+         je      PSDLS_KeyUp
+         cmp     ah, Keys_Down
+         je      PSDLS_KeyDown
+         cmp     ah, Keys_ESC
+         je      PSDLS_KeyDONE
+         cmp     ah, Keys_ENTER
+         je      PSDLS_KeyDONE
+         ; Direct-Letter-Input
+         or      al, 20h                 ; Lower-Case Input
+         cmp     al, 'c'
+         jb      PSDLS_MainLoop
+         cmp     al, 'z'
+         ja      PSDLS_MainLoop
+         mov     dl, al
+         add     dl, 1Dh                 ; -> Convert to used logic
+         call    PARTSETUPDL_DrawDriveLetter
+         jmp     PSDLS_MainLoop
+
+
+   ; Clear drive-letter with backspace
+   PSDLS_BackSpace:
+      xor   dl,dl
+      call  PARTSETUPDL_DrawDriveLetter
+      jmp   PSDLS_MainLoop
+
+     PSDLS_KeyUp:
+      dec     dl
+      cmp     dl, 7Fh
+      jne     PSDLS_KeyUpFix1
+      xor     dl, dl
+     PSDLS_KeyUpFix1:
+      cmp     dl, 97h
+      jbe     PSDLS_KeyUpFix2
+      mov     dl, 97h
+     PSDLS_KeyUpFix2:
+      call    PARTSETUPDL_DrawDriveLetter
+      jmp     PSDLS_MainLoop
+
+     PSDLS_KeyDown:
+      inc     dl
+      cmp     dl, 97h
+      jbe     PSDLS_KeyDownFix1
+      xor     dl, dl
+     PSDLS_KeyDownFix1:
+      cmp     dl, 01h
+      jne     PSDLS_KeyDownFix2
+      mov     dl, 80h
+     PSDLS_KeyDownFix2:
+      call    PARTSETUPDL_DrawDriveLetter
+      jmp     PSDLS_MainLoop
+
+
+  PSDLS_KeyDONE:
+   ; Write Drive-Letter into DriveLetter-Table
+   pop     bx
+   mov     bptr [DriveLetters+bx], dl
+   mov     al, ds:[si+LocIPT_Flags]
+   mov     ah, Flags_DriveLetter
+   not     ah
+   and     al, ah
+   or      dl, dl
+   jz      PSDLS_NoFlag
+   or      al, Flags_DriveLetter
+  PSDLS_NoFlag:
+   mov     ds:[si+LocIPT_Flags], al
+   ret
+PARTSETUP_DriveLetterSetup      EndP
+
+; Draw all standard-things for DriveLetterSetup, dynamic content not included.
+PARTSETUPDL_DrawMenuBase        Proc Near   Uses dx si
+   ; Calculate Position of Window.
+   ; If Partition Selected Left-Side -> go Right-Sided Window
+   ;                                     otherwise Left-Sided.
+   mov     PartSetup_ActivePart, dl
+   mov     al, 8                         ; X-Pos =  8
+   and     dl, 1
+   jnz     PSDLDMB_FirstStep
+   mov     al, 30h                       ; X-Pos = 48
+  PSDLDMB_FirstStep:
+   mov     PartSetup_HiddenX, al
+
+   ; Draw base-window
+
+CLR_PART_DL_XX_CLASSIC = 0d05h
+CLR_PART_DL_XX_BM = 0a02h
+
+   mov     cx, CLR_PART_DL_XX_BM                     ; Lila on lila
+   call    VideoIO_Color
+   mov     bh, 06h
+   mov     bl, [PartSetup_HiddenX]
+   mov     dh, 0Ah
+   mov     dl, bl
+   add     dl, 16h
+   push    bx
+      call    VideoIO_MakeWindow
+   pop     bx
+   ; Make Window-Header
+   inc     bl
+   push    bx
+      mov     cx, bx
+      call    VideoIO_Locate
+      mov     al, 'µ'
+      call    VideoIO_PrintSingleChar
+
+CLR_PART_DL_WINDOW_TITLE_CLASSIC  = 0e05h
+CLR_PART_DL_WINDOW_TITLE_BM  = 0e02h
+
+      mov     cx, CLR_PART_DL_WINDOW_TITLE_BM                  ; Yellow on Lila
+      call    VideoIO_Color
+      mov     si, offset TXT_SETUP_DriveLetter
+      call    VideoIO_Print
+
+CLR_PART_DL_WINDOW_BORDER2_CLASSIC  = 0d05h
+CLR_PART_DL_WINDOW_BORDER2_BM  = 0a02h
+
+      mov     cx, CLR_PART_DL_WINDOW_BORDER2_BM                 ; Lila on lila
+      call    VideoIO_Color
+      mov     al, 'Æ'
+      call    VideoIO_PrintSingleChar
+   pop     bx
+   ; Display help-information
+   mov     si, offset TXT_SETUPHELP_DriveLetter
+
+CLR_PART_DL_SETUP_HELP_CLASSIC = 0d05h
+CLR_PART_DL_SETUP_HELP_BM = 0a02h
+
+
+   mov     cx, CLR_PART_DL_SETUP_HELP_BM                     ; Lila on lila
+   call    VideoIO_Color
+
+   call    GetLenOfString                ; CX - Len of string
+   mov     dx, cx
+   mov     cx, bx
+   add     cx, 0413h
+   sub     cl, dl
+   call    VideoIO_Locate
+   mov     al, '<'
+   call    VideoIO_PrintSingleChar
+   call    VideoIO_Print
+   mov     al, '>'
+   call    VideoIO_PrintSingleChar
+   ;
+   mov     cx, 0F01h                     ; Bright White on Blue
+   call    VideoIO_Color
+   mov     cx, 0805h                     ; Position 8, 5
+   add     cl, PartSetup_HiddenX
+   call    VideoIO_Locate
+   mov     al, ' '
+   mov     cl, 12
+   call    VideoIO_PrintSingleMultiChar
+   ret
+PARTSETUPDL_DrawMenuBase        EndP
+
+; Writes Logical Drive-Letter to Screen (Logical-Drive-Letter-Setup)
+;        In: DL - Logical Drive-Letter Byte
+; Destroyed: None
+PARTSETUPDL_DrawDriveLetter     Proc Near   Uses si
+   ; 00h -> standard drive letter
+   ; 80h -> use C: as drive letter
+   ; 97h -> use Z: as drive letter
+   push    dx
+      mov     cx, 0805h                  ; Position 8, 5
+      add     cl, [PartSetup_HiddenX]
+      call    VideoIO_Locate
+      add     cl, 6                      ; Everything centered (12/2)
+      push    cx
+         mov     al, ' '
+         mov     cl, 12
+         call    VideoIO_PrintSingleMultiChar ; Fill up area with spaces
+
+         or      dl, dl
+         jnz     PSDLDDL_Letter
+         mov     si, offset TXT_SETUP_MAGIC_Disabled
+         call    GetLenOfString
+         mov     dx, cx
+      pop     cx
+      call    VideoIO_LocateToCenter     ; LocateToCenter using TotalLen
+      call    VideoIO_Print
+   pop     dx
+   ret
+
+        PSDLDDL_Letter:
+         mov     si, offset TXT_SETUP_MAGIC_Set
+         call    GetLenOfString
+         mov     dx, cx
+         add     dx, 2
+      pop     cx
+      call    VideoIO_LocateToCenter     ; LocateToCenter using TotalLen
+      call    VideoIO_Print
+   pop     dx
+   mov     al, dl
+   sub     al, 3Dh
+   call    VideoIO_PrintSingleChar
+   mov     al, ':'
+   call    VideoIO_PrintSingleChar
+   ret
+PARTSETUPDL_DrawDriveLetter     EndP
Index: trunk/bootcode/special/apm.asm
===================================================================
--- trunk/bootcode/special/apm.asm	(revision 57)
+++ trunk/bootcode/special/apm.asm	(revision 57)
@@ -0,0 +1,41 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                    AiR-BOOT / APM SUPPORT
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'APM',0
+ENDIF
+
+; Here is APM Code to turn off the computer
+
+APM_TurnOffComputer            Proc Near  Uses ax bx cx
+   mov     ax, 5301h
+   xor     bx, bx
+   int     15h
+   mov     ax, 530Eh
+   xor     bx, bx
+   mov     cx, 102h
+   int     15h
+   mov     ax, 5307h
+   mov     bx, 1
+   mov     cx, 3
+   int     15h
+   ret                                   ; We should never return here <g>
+APM_TurnOffComputer            EndP
Index: trunk/bootcode/special/charset.asm
===================================================================
--- trunk/bootcode/special/charset.asm	(revision 57)
+++ trunk/bootcode/special/charset.asm	(revision 57)
@@ -0,0 +1,79 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                AiR-BOOT / CHARSET SUPPORT
+;---------------------------------------------------------------------------
+
+; This file is only included, when compiling versions that are meant to
+;  contain special characters that are not included in the Video ROM charset.
+
+; May destroy all-purpose registers (AX,BX,CX,DX), will preserve all others
+CHARSET_IncludeCyrillic        Proc Near  Uses si di bp
+   ; First we get the ROM charset from BIOS...
+   mov    ax, 1130h
+   mov    bh, 6                          ; Get ROM VGA 25x80 charset
+   int    10h                            ; VIDEO BIOS: Get charset table pointer
+   mov    bx, ds                         ; ES:BP point to charset (in Video-ROM)
+   mov    ax, es
+   mov    es, bx
+   mov    ds, ax
+   mov    si, bp                         ; DS:SI - ROM Font 25x80 and ES==CS
+   mov    di, offset CharsetTempBuffer
+   mov    cx, 2048
+   rep    movsw                          ; Copy ROM-charset to Temp-Buffer
+   mov    ds, bx                         ; DS==CS
+   mov    si, offset CHARSET_Cyrillic
+   mov    di, offset CharsetTempBuffer+2048
+
+   mov    dl, 64                         ; Decode 64 character bitmaps
+   xor    al, al
+   xor    ch, ch
+  DecodeLoop:                            ; This is an uncompressing-loop
+      mov    ah, ds:[si]
+      inc    si
+      mov    cl, ah
+      and    cl, 0Fh
+      rep    stosb                       ; Write NULs, count: lower 4 bits
+      mov    cl, ah
+      shr    cl, 4
+      or     cl, cl
+      jz     EndOfStream
+      rep    movsb
+      jmp    DecodeLoop
+     EndOfStream:
+      cmp    di, offset CharsetTempBuffer+3840
+      jae    DecodeDone
+      add    di, 768                     ; Skip 3x16 char blocks
+      jmp    DecodeLoop
+  DecodeDone:
+    IFDEF   FX_ENABLED
+        call   FX_WaitRetrace                 ; Wait for retrace to reduce flickering
+    ENDIF
+   mov    ax, 1110h
+   mov    bh, 16
+   xor    bl, bl
+   mov    cx, 0FFh
+   xor    dx, dx
+   mov    bp, offset CharsetTempBuffer ; ES:BP - New charset
+   int    10h                            ; VIDEO BIOS: Set new charset table
+   mov    ah, 12h
+   mov    bl, 30h
+   mov    al, 2                          ; 400 ScanLines
+   int    10h                            ; VIDEO BIOS: Set Scanlines
+   ret
+CHARSET_IncludeCyrillic        EndP
Index: trunk/bootcode/special/f00k/billsuxx.asm
===================================================================
--- trunk/bootcode/special/f00k/billsuxx.asm	(revision 57)
+++ trunk/bootcode/special/f00k/billsuxx.asm	(revision 57)
@@ -0,0 +1,90 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                AiR-BOOT / EXTENDED PARTITION - M$ HACK-IN
+;---------------------------------------------------------------------------
+
+; AiR-BOOT is compatible to the pseudo standard that's is used by an OS on a
+;  32-bit processor, being actually a 16-bit extension that is outperformed
+;  by any 8-bit software running on a 4-bit microprocessor, written by a 2-bit
+;  company that can't stand 1-bit of competition.
+
+; Here is code to change Extended Partition to Type 05h or 0Fh depending
+;  on the partition's P-flag including the overall M$hack-Enable Flag.
+
+IFDEF   MODULE_NAMES
+DB 'BILLSUXX',0
+ENDIF
+
+MSHACK_ProcessPartTables        Proc Near  Uses ax dx di
+   ; Check Overall M$-Hack Enable
+   test    byte ptr [CFG_ExtPartitionMShack], 1
+   jz      MSHPPT_NoMShack
+
+   ; Now check Boot-Entry's flags...
+   mov     ax, 050Fh
+   test    bptr [si+LocIPT_Flags], Flags_ExtPartMShack
+   jz      MSHPPT_ChangeToStandard
+   mov     ax, 0F05h
+  MSHPPT_ChangeToStandard:
+
+   ; Now process every Primary Partition Table (PPT) for Extended Partition
+   ;  Search for ID *AL* and replace with ID *AH*
+   mov     dl, 80h
+   mov     dh, [TotalHarddiscs]
+   or      dh, dh
+   jz      MSHPPT_NoMShack
+  MSHPPT_HarddriveLoop:
+      push    ax
+      push    bx
+      push    cx
+      push    dx
+         xor     ax, ax
+         xor     bx, bx     ; Location Absolute Sector 0
+         mov     cx, 0001h
+         xor     dh, dh     ; Location Cylinder 0, Head 0, Sector 1 MBR/PPT
+         call    DriveIO_LoadPartition
+      pop     dx
+      pop     cx
+      pop     bx
+      pop     ax
+      jc      MSHPPT_Failure
+
+      ; Search for ID in AL and exchange with ID in AH
+      mov     di, offset PartitionSector+446 ; ES:DI - 1st partition entry
+     MSHPPT_ScanLoop:
+         cmp     al, bptr es:[di+4]
+         je      MSHPPT_GotHit
+         add     di, LocBRPT_LenOfEntry  ; 16 Bytes per Partition-Entry
+      cmp     di, 500+offset PartitionSector
+      jb      MSHPPT_ScanLoop
+      jmp     MSHPPT_Failure
+
+     MSHPPT_GotHit:
+      mov     bptr es:[di+4], ah
+      IFDEF ReleaseCode
+         call    DriveIO_SavePartition
+      ENDIF
+     MSHPPT_Failure:
+   inc     dl
+   dec     dh
+   jnz     MSHPPT_HarddriveLoop
+
+  MSHPPT_NoMShack:
+   ret
+MSHACK_ProcessPartTables        EndP
Index: trunk/bootcode/special/fat16.asm
===================================================================
--- trunk/bootcode/special/fat16.asm	(revision 57)
+++ trunk/bootcode/special/fat16.asm	(revision 57)
@@ -0,0 +1,320 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                 AiR-BOOT / FAT-16 SUPPORT
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'FAT16',0
+ENDIF
+
+; Here is access code for accessing FAT-16 partitions. It's not a complete
+;  File-API and only for simple readonly-access.
+; It's currently only used by SPECIAL\LINUX.ASM for Linux Kernel Loading.
+;
+; Note: This code will ONLY WORK on computers with INT 13h Extension.
+;        I did not want to code silly cylinder stuff here. I have also used
+;        i386 code in here, because Linux requires so as well. Please note that
+;        I don't use i386 code anywhere (!) else in AiR-BOOT.                    ; Rousseau: yes you did, movezx is 386-only :-)
+;                                                                                ; Replaced by 286 instructions.
+; Initialize FAT-16 access on specified partition (required for following xs)
+;        In: DS:SI - IPT-Entry that contains a FAT-16 partition
+;       Out: None
+; Destroyed: None
+FAT16_InitAccess                Proc Near  Uses eax bx edx
+   mov    al, bptr ds:[si+LocIPT_Drive]
+   mov    FAT16_Drive, al
+   mov    edx, dptr ds:[si+LocIPT_AbsoluteBegin]
+   mov    FAT16_AbsPartitionBegin, edx
+   mov    DriveIO_DAP_Absolute, edx      ; Read in Boot-Record of partition
+   mov    DriveIO_DAP_NumBlocks, 1       ; 1 Sector to load
+   mov    FAT16_FATCacheSector, 255      ; Sector 255 - So nothing cached
+   mov    ax, ds
+   shl    eax, 16
+   mov    ax, offset FAT16_FATCache
+   mov    DriveIO_DAP_Transfer, eax      ; Transfer to FAT-Cache Area
+   call   FAT16_LoadSectors
+   mov    al, bptr [FAT16_FATCache+13]
+   mov    FAT16_SecsPerCluster, al
+   movzx  eax, wptr [FAT16_FATCache+14]  ; +14 -> ReservedSectors
+   add    edx, eax                       ; EDX = AbsPartitionPos+ReservedSectors
+   mov    FAT16_AbsFATBegin, edx         ; Is Absolute-FAT-Begin
+   movzx  ax, bptr [FAT16_FATCache+16]   ; +16 -> FAT-Copies Count
+   mov    bx, wptr [FAT16_FATCache+22]   ; +22 -> Sectors Per FAT
+   mov    FAT16_SecsPerFAT, bx
+   push   dx
+      mul    bx
+   pop    dx
+   movzx  eax, ax
+   add    edx, eax
+   mov    FAT16_AbsRootBegin, edx        ; Is Absolute-Root-Begin
+   movzx  eax, wptr [FAT16_FATCache+17]  ; +17 -> Number of Root Entries
+   mov    FAT16_NumOfRootEntries, ax
+   shr    eax, 4                         ; NumOfRootEntries/16
+   add    edx, eax
+   mov    FAT16_AbsClusterBegin, edx     ; Is Absolute-Cluster-Begin
+   ret
+FAT16_InitAccess                EndP
+
+; Reads Root-Entries to 9000:0 for further processing...
+;        In: None
+;       Out: None
+; Destroyed: None
+FAT16_ReadRoot                  Proc Near  Uses eax
+   mov    ax, 9000h
+   shl    eax, 16                        ; 9000:0 -> Space for Root
+   mov    DriveIO_DAP_Transfer, eax      ; Transfer to that segment
+   mov    eax, FAT16_AbsRootBegin
+   mov    DriveIO_DAP_Absolute, eax      ; Read in Root-Entries...
+   mov    ax, FAT16_NumOfRootEntries
+   shr    ax, 4                          ; NumOfRootEntries/16
+   mov    DriveIO_DAP_NumBlocks, ax      ;  -> Sectors of Root-Entries
+   call   FAT16_LoadSectors              ; DONE.
+   ret
+FAT16_ReadRoot                  EndP
+
+; Searches a FAT16-File-Entry in specified memory block
+;        In: CX - Total Count of File-Entries to search
+;            SI - Offset, what to search for Segment CS (11-Byte block)
+;       Out: DX - Cluster, where the data starts...
+; Destroyed: None
+FAT16_SearchEntry               Proc Near  Uses ax bx es di
+   xor    dx, dx                         ; No Result as default
+   or     cx, cx
+   jz     FAT16SE_NoEntries
+   mov    bx, cx
+   mov    ax, 9000h
+   mov    es, ax
+   xor    di, di
+  FAT16SE_SearchLoop:
+      push   si
+      push   di
+         mov    cx, 11
+         repe   cmpsb                    ; Compare total 11-bytes
+      pop    di
+      pop    si
+      je     FAT16SE_EntryFound
+      add    di, 32                      ; Skip 1 FAT16-Entry now :)
+   dec    bx
+   jnz    FAT16SE_SearchLoop
+  FAT16SE_NoEntries:
+   ret
+
+  FAT16SE_EntryFound:
+   mov    dx, wptr es:[di+26]            ; Starting Cluster of Entry
+   ret
+FAT16_SearchEntry               EndP
+
+; Reads a Cluster and gets Next-Cluster as well...
+;        In: DX - Cluster-Number to load, DAP_Transfer-Offset filled out
+;            ES - Segment, where to read Cluster to
+;            DI - Offset, where to read Cluster to
+;       Out: DX - Cluster that follows this one, es:[DI] filled out
+;            DI - Offset, adjusted
+; Destroyed: None
+FAT16_ReadCluster               Proc Near  Uses eax bx
+   push   dx
+      ; First read Cluster into buffer...
+      mov    ax, es
+      shl    eax, 16
+      mov    ax, di
+      mov    DriveIO_DAP_Transfer, eax   ; Read to 9000:DI
+      mov    ax, dx
+      sub    ax, 2                       ; Everything starts at Cluster 2
+      ;movzx  bx, FAT16_SecsPerCluster
+      mov   bl,FAT16_SecsPerCluster
+      mov   bh,0
+
+      mul    bx
+      shl    edx, 16
+      mov    dx, ax                      ; EDX - Relative to Cluster-Start
+      add    edx, FAT16_AbsClusterBegin  ; EDX - Absolute Sector Count
+      mov    DriveIO_DAP_Absolute, edx
+      mov    DriveIO_DAP_NumBlocks, bx   ; Get a whole cluster
+      call   FAT16_LoadSectors           ; DONE.
+   pop    dx
+   ; Update DI to next position...
+   mov    al, FAT16_SecsPerCluster
+   shl    ax, 9
+   add    di, ax
+   ; Finally, look for next Cluster following to this one...
+   ;movzx  bx, dl
+   mov   bl,dl
+   mov   bh,0
+
+   shl    bx, 1                          ; BX - Offset within FAT-Table
+   shr    dx, 8                          ; DX - FAT-Sector
+   cmp    dl, FAT16_FATCacheSector
+   je     FAT16RC_GotFATsectorAlready
+   ; Load FAT-Sector, because the required one is not in Cache
+   mov    FAT16_FATCacheSector, dl
+   mov    ax, cs
+   shl    eax, 16
+   mov    ax, offset FAT16_FATCache
+   mov    DriveIO_DAP_Transfer, eax      ; Transfer to FAT-Cache Area
+   movzx  edx, dx
+   mov    eax, FAT16_AbsFATBegin
+   add    eax, edx
+   mov    DriveIO_DAP_Absolute, eax      ; Read in Boot-Record of partition
+   mov    DriveIO_DAP_NumBlocks, 1       ; 1 Sector to load
+   call   FAT16_LoadSectors              ; DONE.
+  FAT16RC_GotFATsectorAlready:
+   mov    dx, wptr cs:[FAT16_FATCache+bx] ; Get Next-Cluster Pointer
+   ret
+FAT16_ReadCluster               EndP
+
+; Preserves all registers, help routine for LoadKernel
+; supports more than 1 sector read (unlike MBR_IO_LoadSector)
+FAT16_LoadSectors               Proc Near  Uses eax dx ds si
+   push   cs
+   pop    ds
+   mov    si, offset DriveIO_DAP
+   mov    dl, ds:[FAT16_Drive]
+   mov    ah, 42h                        ; Extended Read
+   int    13h
+   jnc    FAT16LS_Success
+   call   MBR_LoadError
+
+  FAT16LS_Success:
+   movzx  eax, wptr ds:[DriveIO_DAP_NumBlocks]
+   add    dptr ds:[DriveIO_DAP_Absolute+0], eax ; Adjust Absolute Offset
+   ret
+FAT16_LoadSectors               EndP
+
+; Will Pre-Process Directory loaded to 9000:0, remove directory and VFAT
+;  entries for display purpose in window
+;        In: DI - Ending-Offset of Directory
+;            ES == CS
+;       Out: None
+; Destroyed: None
+FAT16_ProcessKrnlDirectory      Proc Near  Uses ds si es di
+   mov    dx, di                         ; DX - Ending-Offset of Directory
+   mov    ax, 9000h
+   mov    ds, ax                         ; DS == 9000h
+   xor    si, si                         ; SI - Current Pos in Directory
+   mov    di, offset LINUX_KernelEntries ; DI - Array of Kernel-Entries
+   mov    cs:[LINUX_KernelNo], 0
+  FAT16PPD_DirectoryLoop:
+      mov    al, ds:[si]                 ; +0  -> First char of Basename
+      or     al, al
+      jz     FAT16PPD_IgnoreEntry        ; == 0, empty
+      cmp    al, 0E5h
+      je     FAT16PPD_IgnoreEntry        ; == E5, deleted
+      mov    al, ds:[si+11]              ; +11 -> Flags of Entry
+      cmp    al, 0Fh                     ; 0F as flags -> VFAT Entry
+      je     FAT16PPD_IgnoreEntry
+      test   al, 18h                     ; Bit 4 -> Directory
+      jnz    FAT16PPD_IgnoreEntry        ; Bit 3 -> Volume
+
+      ; Set Size-Entry in KernelSizeTable
+      push   ds
+      push   si
+      push   di
+         mov    bx, ds:[si+30]
+         mov    ax, ds:[si+28]           ; BX:AX - Size of file in Bytes
+
+         mov    dx, bx
+         and    dx, 511                  ; My crazy way of dividing a 32-bit
+         shr    ax, 9                    ; value through 512 using 16-bit
+         shr    bx, 9                    ; instructions... :)
+         shl    dx, 7                    ; (dont ever ever use a DIV)
+         or     ax, dx                   ; BX:AX - Size of file in 512-blocks
+
+         push   cs
+         pop    ds                       ; DS==CS for GetSizeElementPtr
+         push   ax
+            mov    ax, di
+            call   PART_GetSizeElementPointer ; SI - Pointer to Size Element
+         pop    ax
+         mov    di, si
+         call   PART_FillOutSizeElement  ; BX:AX -> ES:DI (Size Element)
+      pop    di
+      pop    si
+      pop    ds
+
+      ; Copy entry and make append extension to basename
+      ; "TEST    TMP" -> "TESTTMP    "
+      mov    bx, 7
+     FAT16PPD_GetLenOfBasename:
+         cmp    bptr ds:[si+bx], ' '
+         jne    FAT16PPD_EndOfBasename
+      dec    bx
+      jnz    FAT16PPD_GetLenOfBasename
+     FAT16PPD_EndOfBasename:
+      mov    ah, bl
+      inc    ah                          ; AH - Count of Basename Chars (max 8)
+      mov    bx, 10
+     FAT16PPD_GetLenOfExtension:
+         cmp    bptr ds:[si+bx], ' '
+         jne    FAT16PPD_EndOfExtension
+         dec    bl
+      cmp    bl, 7
+      ja     FAT16PPD_GetLenOfExtension
+     FAT16PPD_EndOfExtension:
+      sub    bl, 7                       ; BL - Count of Extension Chars (max 3)
+      ; Now we will copy&fill out 11 characters (Basename&Extension)
+      push   dx
+         push      ax
+            xor    eax, eax
+            stosd                        ; +0 [DWORD] Empty Serial
+         pop       ax
+         mov    dx, si
+         ;movzx  cx, ah
+         mov   cl,ah
+         mov   ch,0
+
+         rep    movsb
+         mov    si, dx                   ; Restore SI
+         add    si, 8
+         or     bl, bl
+         jz     FAT16PPD_NoExtensionCopy
+         mov    cl, bl
+         rep    movsb
+        FAT16PPD_NoExtensionCopy:
+         add    ah, bl                   ; AH - Total Bytes of BaseName
+         mov    cl, 11
+         mov    al, ' '
+         sub    cl, ah
+         jz     FAT16PPD_NoFillUpName
+         rep    stosb                    ; +4 [STR*11] Label
+        FAT16PPD_NoFillUpName:
+         mov    si, dx                   ; Restore SI
+
+         mov    al, FAT16_Drive
+         mov    ah, 0FDh
+         stosw                           ; +15 [BYTE/BYTE] Drive, SystemID
+         xor    ax, ax
+         stosb                           ; +17 [BYTE] Flags
+         stosw                           ; +18 [WORD] CRC
+         mov    ax, wptr ds:[si+26]      ; Starting Cluster of File
+         stosw
+         xor    ax, ax
+         stosb                           ; +20 [BYTE/BYTE/BYTE] Location Begin
+         stosw
+         stosb                           ; +23 [BYTE/BYTE/BYTE] Location Part
+         mov    cx, 4
+         rep    stosw                    ; +26 [DWORD/DWORD] Abs Locations
+      pop    dx
+      inc    cs:[LINUX_KernelNo]
+     FAT16PPD_IgnoreEntry:
+   add    si, 32
+   cmp    si, dx                         ; We are at Ending-Offset ?
+   jb     FAT16PPD_DirectoryLoop
+   ; Done, now we got a maximum of 20 kernels in LINUX_KernelEntries-Array.
+   ret
+FAT16_ProcessKrnlDirectory      EndP
Index: trunk/bootcode/special/fatread.bas
===================================================================
--- trunk/bootcode/special/fatread.bas	(revision 57)
+++ trunk/bootcode/special/fatread.bas	(revision 57)
@@ -0,0 +1,132 @@
+$COMPILE EXE
+
+Type LINUXIMG_13EXT_ControlType
+   SizePaket       as WORD
+   NumBlocks       as WORD
+   Transfer        as DWORD
+   Absolut         as DWORD
+   Absolut2        as DWORD
+End Type
+
+Dim LINUXIMG_13EXT_Control             as shared LINUXIMG_13EXT_ControlType
+Dim LINUXIMG_13EXT_ControlPtr          as shared DWORD
+LINUXIMG_13EXT_ControlPtr = VarPtr32(LINUXIMG_13EXT_Control)
+LINUXIMG_13EXT_Control.SizePaket = &h10
+
+! mov   ah, &h41
+! mov   bx, &h55AA
+! mov   dl, &h80
+! int   &h13
+! cmp   bx, &h0AA55
+! je    LINUXIMG_13EXT_Found
+LINUXIMG_13EXT_NotFound:
+print "þ INT 13h Extensions not found, you won't need this tool"
+end
+
+LINUXIMG_13EXT_Found:
+! and   cx, 1
+! jz    LINUXIMG_13EXT_NotFound
+print "þ INT 13h Extensions found"
+
+AbsPartitionBegin??? = 2618595
+'AbsPartitionBegin??? = 16065+63
+BootRecord$        = LINUXIMG_13EXT_ReadSector (&h80, AbsPartitionBegin???)
+SectorsPerCluster? = CvByt(BootRecord$,14)
+ReservedSectors??  = CvWrd(BootRecord$,15)
+FATcopies?         = CvByt(BootRecord$,17)
+NumOfRootEntries?? = CvWrd(BootRecord$,18)
+SectorsPerFAT??    = CvWrd(BootRecord$,23)
+print ReservedSectors??, FATcopies?, NumOfRootEntries??, SectorsPerFAT??, SectorsPerCluster?
+
+FATstart???        = AbsPartitionBegin???+ReservedSectors??
+RootStart???       = FATstart???+(FATcopies?*SectorsPerFAT??)
+ClusterStart???    = RootStart???+NumOfRootEntries??/16
+
+CurEntry?? = 0: RootSector?? = 0
+Do
+   RootTable$         = LINUXIMG_13EXT_ReadSector (&h80, RootStart???+RootSector??)
+   LocalEntry?? = 0
+   Do
+      If Mid$(RootTable$,LocalEntry??*32+1,11) = "KERNELS    " Then
+         KernelDirFound% = -1
+        else
+         Incr LocalEntry??
+      End If
+   Loop Until KernelDirFound% or LocalEntry??=>16
+   Incr RootSector??: Incr CurEntry??, 16
+   if inkey$<>"" Then End
+Loop Until KernelDirFound% or CurEntry??=NumOfRootEntries??
+
+If KernelDirFound% Then
+   DirFlags? = CvByt(RootTable$,LocalEntry??*32+12)
+   If DirFlags?=&h10 Then print "Valid Directory!"
+   ClusterStart?? = CvWrd(RootTable$,LocalEntry??*32+27)
+   print "Cluster start: ";ClusterStart??
+   print "Next Cluster: ";GetNextCluster(FATstart???, ClusterStart??)
+
+   DirCluster$ = GetClusterData (ClusterStart???, SectorsPerCluster?, ClusterStart??)
+   ClusterStart?? = CvWrd(DirCluster$,2*32+27)
+   print GetClusterData (ClusterStart???, SectorsPerCluster?, ClusterStart??)
+End If
+end
+
+Function GetClusterData (byval ClusterStart???, byval SectorsPerCluster?, byval ClusterNo??) as STRING
+   ClusterPos??? = (ClusterNo??-2)*SectorsPerCluster?
+
+   ClusterData$      = LINUXIMG_13EXT_ReadSector (&h80, ClusterStart???+ClusterPos???)
+   FUNCTION = ClusterData$
+End Function
+
+Function GetNextCluster (byval FATstart???, byval CurCluster??) as WORD
+   FATpos??    = (CurCluster?? mod 256)
+   FATsector?? = (CurCluster??-FATpos??)/256
+   FATpos??    = FATpos??*2
+
+   FATtable$         = LINUXIMG_13EXT_ReadSector (&h80, FATstart???+FATsector??)
+   NextCluster??     = CvWrd(FATtable$, FATpos??+1)
+
+   FUNCTION = NextCluster??
+End Function
+
+Function LINUXIMG_13EXT_ReadSector (byval Harddrive??, byval BlockNo???) as STRING
+   local MyBlock$
+   MyBlock$ = String$(512,0)
+   LINUXIMG_13EXT_Control.NumBlocks   = 1
+   LINUXIMG_13EXT_Control.Transfer    = StrPtr32(MyBlock$)
+   LINUXIMG_13EXT_Control.Absolut     = BlockNo???
+   ! push  ds
+   ! mov   dl, Harddrive??
+   ! lds   si, LINUXIMG_13EXT_ControlPtr
+   ! mov   ah, &h42
+   ! int   &h13
+   ! pop   ds
+   ! jc    LINUXIMG_13EXT_Error
+   FUNCTION = MyBlock$
+   Exit Function
+
+  LINUXIMG_13EXT_Error:
+   print "Error in partition-table/Bad sector on harddisc."
+   end
+End Function
+
+Sub LINUXIMG_13EXT_WriteSectors (byval Harddrive??, byval BlockNo???, byval DataBlock$)
+   local MyBlock$
+   If len(DataBlock$)<5120 Then
+      DataBlock$ = DataBlock$ + String$(5120-len(DataBlock$),0)
+   End If
+   LINUXIMG_13EXT_Control.NumBlocks   = 10
+   LINUXIMG_13EXT_Control.Transfer    = StrPtr32(DataBlock$)
+   LINUXIMG_13EXT_Control.Absolut     = BlockNo???
+   ! push  ds
+   ! mov   dl, Harddrive??
+   ! lds   si, LINUXIMG_13EXT_ControlPtr
+   ! mov   ah, &h43                   ; Write !
+   ! int   &h13
+   ! pop   ds
+   ! jc    LINUXIMG_13EXT_ErrorWrite
+   Exit Sub
+
+  LINUXIMG_13EXT_ErrorWrite:
+   print "Error, while writing to disc."
+   end
+End Sub
Index: trunk/bootcode/special/fx.asm
===================================================================
--- trunk/bootcode/special/fx.asm	(revision 57)
+++ trunk/bootcode/special/fx.asm	(revision 57)
@@ -0,0 +1,584 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                            AiR-BOOT / F/X
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'FX',0
+ENDIF
+
+; There you go. Some nice old-school demo coder effects :)
+;  If you rip this code, I will ./ your ass. =]
+
+Include SPECIAL/FXTABLES.ASM
+
+FX_MaxScanLine                equ 384
+FX_TotalCooperBars            equ   7
+
+FX_CalculateTables              Proc Near
+   ; Calculate the Cooper-Bar Color-Table -> FX_CooperColors
+   mov    di, offset FX_CooperColors
+   mov    ax, 000Fh                      ; Red
+   call   FX_MakeCooperBarColors
+   mov    ax, 0FF0h                      ; Pink
+   call   FX_MakeCooperBarColors
+   mov    ax, 0F0Fh                      ; Bright Blue
+   call   FX_MakeCooperBarColors
+   mov    ax, 0F00h                      ; Blue
+   call   FX_MakeCooperBarColors
+   mov    ax, 00FFh                      ; Yellow
+   call   FX_MakeCooperBarColors
+   mov    ax, 00F0h                      ; Green
+   call   FX_MakeCooperBarColors
+   mov    ax, 0FFFh                      ; White
+   call   FX_MakeCooperBarColors
+   ret
+FX_CalculateTables              EndP
+
+; This routine will dump a color-table to ES:es:[DI]. Total of 96 bytes.
+;        In: AX - Color-Separator (RGB, per value 4 bit)
+;            DI - Pointer to Buffer for Color-Table
+;       Out: *none*
+; Destroyed: DI - updated, +96
+FX_MakeCooperBarColors          Proc Near
+   mov    bh, ah
+   shl    bh, 4
+   or     bh, ah                         ; BH - Blue-Value, now 00h or FFh
+   mov    dh, al
+   mov    bl, al
+   shr    dh, 4
+   and    bl, 0F0h
+   or     dh, bl                         ; DH - Green-Value, now 00h or FFh
+   mov    dl, al
+   and    al, 00Fh
+   shl    dl, 4
+   or     dl, al                         ; DL - Red-Value, now 00h or FFh
+   mov    ax, 1111h
+   mov    bl, 11h                        ; Start-Values
+   mov    cx, 15
+  FX_MCBC_BuildColorLoop1:
+      add    ax, 0303h
+      add    bl, 03h
+      and    ax, dx
+      and    bl, bh
+      mov    es:[di], ax
+      mov    es:[di+2], bl
+      add    di, 3
+   loop   FX_MCBC_BuildColorLoop1
+   push   ax
+   push   bx
+      add    ax, 0101h
+      add    bl, 01h
+      and    ax, dx
+      and    bl, bh
+      mov    es:[di], ax
+      mov    es:[di+2], bl
+      mov    es:[di+3], ax
+      mov    es:[di+5], bl
+      add    di, 6
+   pop    bx
+   pop    ax
+   mov    cx, 15
+  FX_MCBC_BuildColorLoop2:
+      and    ax, dx
+      and    bl, bh
+      mov    es:[di], ax
+      mov    es:[di+2], bl
+      add    di, 3
+      sub    ax, 0303h
+      sub    bl, 03h
+   loop   FX_MCBC_BuildColorLoop2
+   ret
+FX_MakeCooperBarColors          EndP
+
+; This is called just before a new screen is generated
+;  If FX is active, we will modify the base segment for videoio to page 2,
+;  so the screen will be generated there instead of the current page.
+FX_StartScreen                  Proc Near
+   test    byte ptr [CFG_CooperBars], 1
+   jz      FXSS_NoFX
+   mov     word ptr [VideoIO_Segment], VideoIO_Page2
+  FXSS_NoFX:
+   ret
+FX_StartScreen                  EndP
+
+; This is called, when a new screen was done
+;  If FX is active, we will copy the new screen to scroll area, do the FX,
+;  copy the new screen to Page 0 and activate it.
+FX_EndScreenLeft                Proc Near
+   test    byte ptr [CFG_CooperBars], 1
+   jnz     FXESL_Go
+   ret
+  FXESL_Go:
+   pusha
+      mov     ax, VideoIO_Page2
+      mov     bx, VideoIO_Page0
+      mov     dx, 160
+      xor     di, di
+      call    FX_InterleaveCopy
+      call    FX_ScrollScreenLeft
+
+      mov     ax, VideoIO_Page2
+      call    VideoIO_RestoreFrom
+      mov     word ptr [VideoIO_Segment], VideoIO_Page0
+      call    FX_EndScreenInternalCleanUp
+   popa
+   ret
+FX_EndScreenLeft                EndP
+
+FX_ScrollScreenLeft             Proc Near
+   mov     word ptr [FX_WideScrollerCurPos], 640
+   mov     byte ptr [FX_WideScrollerDirection], 0
+   mov     byte ptr [FX_WideScrollerAbsDirection], 0
+   call    FX_EndScreenInternalGo
+   ret
+FX_ScrollScreenLeft             EndP
+
+FX_EndScreenRight               Proc Near
+   test    byte ptr [CFG_CooperBars], 1
+   jnz     FXESR_Go
+   ret
+  FXESR_Go:
+   pusha
+      mov     ax, VideoIO_Page0
+      mov     bx, VideoIO_Page2
+      mov     dx, 160
+      xor     di, di
+      call    FX_InterleaveCopy
+      call    FX_ScrollScreenRight
+
+      mov     ax, VideoIO_Page2
+      call    VideoIO_RestoreFrom
+      mov     word ptr [VideoIO_Segment], VideoIO_Page0
+      call    FX_EndScreenInternalCleanUp
+   popa
+   ret
+FX_EndScreenRight               EndP
+
+FX_ScrollScreenRight            Proc Near
+   mov     word ptr [FX_WideScrollerCurPos], 0
+   mov     byte ptr [FX_WideScrollerDirection], 1
+   mov     byte ptr [FX_WideScrollerAbsDirection], 1
+   call    FX_EndScreenInternalGo
+   ret
+FX_ScrollScreenRight            EndP
+
+FX_EndScreenInternalGo          Proc Near
+   mov     byte ptr [FX_WideScrollerSpeed], 1
+   mov     byte ptr [FX_WideScrollerSpeedState], 1
+   mov     byte ptr [FX_WideScrollerBounceSpeed], 25
+   ; Check, if this is 1st time call...
+   inc     word ptr [FX_UseCount]
+   cmp     word ptr [FX_UseCount], 1
+   jne     FX_ES_NotFirstTime
+   mov     word ptr [FX_OverallTimer], 220
+   mov     word ptr [FX_WideScrollerTimer], 93
+   mov     word ptr [FX_CooperBarsTimer], 1
+   jmp     FX_ES_NowGoMagic
+  FX_ES_NotFirstTime:
+   mov     word ptr [FX_OverallTimer], 127
+   mov     word ptr [FX_WideScrollerTimer], 1
+   mov     word ptr [FX_CooperBarsTimer], -1  ; Disable coopers on further goes
+  FX_ES_NowGoMagic:
+   call    FX_MakeMagicalStuff
+   ret
+FX_EndScreenInternalGo          EndP
+
+FX_EndScreenInternalCleanUp     Proc Near
+   mov     ax, -1
+   call    FX_SetVideoStart
+   call    FX_WaitRetrace
+   mov     ax, 80
+   call    FX_SetWideLength
+   ret
+FX_EndScreenInternalCleanUp     EndP
+
+;        In: AX - 1st Page Segment
+;            BX - 2nd Page Segment
+;            DX - Space to interleave
+;            DI - Destination offset for Page 4
+;       Out: Both pages interleaved to Page 4
+; Destroyed: AX, CX, SI, DI
+FX_InterleaveCopy               Proc Near
+   push    di
+      call    FX_InterleaveCopyPage
+   pop     di
+   add     di, dx
+   mov     ax, bx
+   call    FX_InterleaveCopyPage
+   ret
+FX_InterleaveCopy               EndP
+
+FX_InterleaveCopyPage           Proc Near   Uses ds es
+   mov     ds, ax
+   mov     ax, VideoIO_Page4
+   mov     es, ax
+   xor     si, si
+  FXIC_CopyLoop:
+      mov     cx, 80
+      rep     movsw
+      add     di, dx
+   cmp     si, 1000h
+   jb      FXIC_CopyLoop
+   ret
+FX_InterleaveCopyPage           EndP
+
+FX_MakeMagicalStuff             Proc Near   Uses es
+   ; Initiate Cooper-Variables...
+   push    ds
+   pop     es
+   mov     di, offset FX_CooperState
+   mov     cx, 7
+   xor     al, al
+   rep     stosb                         ; Initiates FX_CooperState
+   mov     cx, 7
+   dec     al                            ; AX = 255
+   rep     stosb                         ; Initiates FX_SinusPos
+   mov     si, offset FX_StartCooperPos
+   mov     cx, 7
+   rep     movsw                         ; Initiates FX_CooperPos
+
+   call   FX_WaitRetrace
+  FX_MMS_RetraceLoop:
+      mov     dx, 3C8h
+      xor     al, al
+      out     dx, al
+      inc     dx
+      out     dx, al
+      out     dx, al
+      call    FX_WaitRetrace
+      mov     dx, 3C9h
+      xor     al, al
+      out     dx, al                     ; Really set background color now
+
+      xor     di, di                     ; DI - Cur Scan-Line Counter
+     FX_MCS_VerticalLoop:
+         call    FX_ColorUpVLine
+      inc     di
+      cmp     di, FX_MaxScanLine
+      jb      FX_MCS_VerticalLoop
+
+      mov     ax, [FX_CooperBarsTimer]
+      dec     ax
+      jnz     FX_MMS_CooperBarsPending
+         ; Here we need to calculate the movements of the Coopers...at last
+         call    FX_CalculateCoopers
+      mov     ax, 1
+     FX_MMS_CooperBarsPending:
+      mov     [FX_CooperBarsTimer], ax
+
+      mov     ax, [FX_WideScrollerTimer]
+      dec     ax
+      jnz     FX_MMS_WideScrollerPending
+         call    FX_CalculateWideScroller
+      mov     ax, 1
+     FX_MMS_WideScrollerPending:
+      mov     [FX_WideScrollerTimer], ax
+
+   dec     word ptr [FX_OverallTimer]
+   jnz     FX_MMS_RetraceLoop
+   ret
+FX_MakeMagicalStuff             EndP
+
+; This routine is called per VRetrace, it will look for a CooperBar to display
+; and color the Vertical Screen Line in the specified color
+;        In: DI - Vertical Line Counter
+;       Out: *none*
+; Destroyed: all, but DI
+FX_ColorUpVLine                 Proc Near   Uses di
+   add    di, 256                        ; Real-Scanlines begin at 256 here
+   mov    si, offset FX_CooperPos
+   xor    cx, cx
+  FX_CUVL_SearchCooperLoop:
+      lodsw
+      mov    dx, ax                      ; AX - First VRLine used by Cooper
+      add    dx, 32                      ; DX - Last VRLine used by Cooper
+      cmp    di, ax
+      jb     FX_CUVL_CooperNoHit
+      cmp    di, dx
+      jb     FX_CUVL_CooperGotHit
+     FX_CUVL_CooperNoHit:
+   inc    cx
+   cmp    cx, FX_TotalCooperBars
+   jb     FX_CUVL_SearchCooperLoop
+  FX_CUVL_CooperNotVisible:
+   xor    bx, bx
+   xor    cl, cl                         ; No Cooper -> So use Color [0/0/0]
+   jmp    FX_CUVL_ColorLine
+
+   ; Okay, we got a cooper...now calculate color and done...
+  FX_CUVL_CooperGotHit:
+   mov    dx, di
+   sub    dx, ax                         ; DX - Relative Pos within cooper
+   mov    bx, cx
+   shl    bx, 5                          ; * 32
+   mov    ax, bx
+   add    bx, bx
+   add    bx, ax                         ; BX = CurCooper*96
+   add    bx, dx
+   add    bx, dx
+   add    bx, dx                         ; Plus RelativePos * 3
+   mov    cl, bptr ds:[FX_CooperColors+bx+2]
+   mov    bx, wptr ds:[FX_CooperColors+bx]
+
+  FX_CUVL_ColorLine:
+   mov    dx, 3C8h
+   xor    al, al
+   out    dx, al
+   inc    dx
+   mov    al, bl
+   out    dx, al
+   mov    al, bh
+   out    dx, al
+   call   FX_WaitVRetrace
+   mov    dx, 3C9h
+   mov    al, cl
+   out    dx, al                         ; Colord on VRetrace...
+   ret
+FX_ColorUpVLine                 EndP
+
+; This routine is called to move the cooper bars on screen... It's called on
+;  every Retrace.
+;        In: *none*
+;       Out: *none*
+; Destroyed: all
+FX_CalculateCoopers             Proc Near
+   ; Logic: When Intro-State: Increase CooperPos by 1 till 256 -> then active
+   ;             Active-State: Use SinusTable, till SinusPos=7Fh -> then Extro
+   ;             Extro-State: Decrease CooperPos by 1 till 0
+
+   xor     si, si
+  FX_CC_CalcLoop:
+      cmp     bptr ds:[FX_CooperState+si], 1
+      jb      FX_CC_IntroState
+      je      FX_CC_ActiveState
+      ja      FX_CC_ExtroState
+      jmp     FX_CC_CalcLoopEnd
+     FX_CC_IntroState:
+      mov     bx, si
+      shl     bx, 1
+      mov     ax, wptr ds:[FX_CooperPos+bx]
+      inc     ax
+      mov     wptr ds:[FX_CooperPos+bx], ax
+      cmp     ax, 256                       ; Got into Active-State ?
+      jb      FX_CC_CalcLoopEnd
+      inc     bptr ds:[FX_CooperState+si]
+      jmp     FX_CC_CalcLoopEnd
+     FX_CC_ExtroState:
+      mov     bx, si
+      shl     bx, 1
+      mov     ax, wptr ds:[FX_CooperPos+bx]
+      dec     ax
+      jz      FX_CC_CalcLoopEnd
+      mov     wptr ds:[FX_CooperPos+bx], ax
+      jmp     FX_CC_CalcLoopEnd
+
+     FX_CC_ActiveState:
+      ; increment SinusPos by 1
+      ;movzx   bx, bptr ds:[FX_SinusPos+si]
+      mov   bl,bptr ds:[FX_SinusPos+si]
+      mov   bh,0
+
+      inc     bx
+      mov     bptr ds:[FX_SinusPos+si], bl
+      cmp     bl, 7Fh
+      jne     FX_CC_ActiveNoStateChange
+      inc     bptr ds:[FX_CooperState+si]
+     FX_CC_ActiveNoStateChange:
+      ; Get SinusTab-Value for [BX] and put it to CooperPos-Table for easy xs
+      and     bx, 7Fh
+      shl     bx, 1
+      mov     ax, wptr es:[FX_SinusTab+bx]
+      mov     bx, si
+      shl     bx, 1
+      mov     wptr ds:[FX_CooperPos+bx], ax
+  FX_CC_CalcLoopEnd:
+   inc     si
+   cmp     si, FX_TotalCooperBars
+   jb      FX_CC_CalcLoop
+   ret
+FX_CalculateCoopers             EndP
+
+FX_CalculateWideScroller        Proc Near
+   mov     bx, [FX_WideScrollerCurPos]
+   ;movzx   cx, FX_WideScrollerSpeed
+   mov   cl, [FX_WideScrollerSpeed]
+   mov   ch,0
+
+   test    byte ptr [FX_WideScrollerAbsDirection], 1
+   jnz     FXCWS_RIGHT
+   jmp     FXCWS_LEFT
+
+   ; ================================================== WideScroll: LEFT CALC
+  FXCWS_LEFT:
+   test    byte ptr [FX_WideScrollerSpeedState], 1
+   jz      FXCWS_LEFT_Bouncing
+   or      bx, bx
+   jz      FXCWS_LEFT_BounceNOW
+   jmp     FXCWS_DoSpeedThing
+
+  FXCWS_LEFT_Bouncing:
+   or      cx, cx
+   jnz     FXCWS_DoSpeedThing
+   mov     byte ptr [FX_WideScrollerSpeedState], 1
+   mov     byte ptr [FX_WideScrollerDirection], 0
+   mov     dl, [FX_WideScrollerBounceSpeed]
+   shr     dl,1
+   mov     [FX_WideScrollerBounceSpeed], dl
+   jmp     FXCWS_DoSpeedThing
+
+  FXCWS_LEFT_BounceNOW:
+   mov     cl, [FX_WideScrollerBounceSpeed]
+   mov     byte ptr [FX_WideScrollerSpeedState], 0
+   mov     byte ptr [FX_WideScrollerDirection], 1
+   jmp     FXCWS_DoSpeedThing
+
+   ; ================================================= WideScroll: RIGHT CALC
+  FXCWS_RIGHT:
+   test    byte ptr [FX_WideScrollerSpeedState], 1
+   jz      FXCWS_RIGHT_Bouncing
+   cmp     bx, 640 ; 1280
+   jae     FXCWS_RIGHT_BounceNOW
+   jmp     FXCWS_DoSpeedThing
+
+  FXCWS_RIGHT_Bouncing:
+   or      cl, cl
+   jnz     FXCWS_DoSpeedThing
+   mov     byte ptr [FX_WideScrollerSpeedState], 1
+   mov     byte ptr [FX_WideScrollerDirection], 1
+   mov     dl, [FX_WideScrollerBounceSpeed]
+   shr     dl, 1
+   mov     [FX_WideScrollerBounceSpeed], dl
+   jmp     FXCWS_DoSpeedThing
+
+  FXCWS_RIGHT_BounceNOW:
+   mov     cl, [FX_WideScrollerBounceSpeed]
+   mov     byte ptr [FX_WideScrollerSpeedState], 0
+   mov     byte ptr [FX_WideScrollerDirection], 0
+   jmp     FXCWS_DoSpeedThing
+
+   ; ================================================= WideScroll: SPEED CALC
+  FXCWS_DoSpeedThing:
+   test    byte ptr [FX_WideScrollerSpeedState], 1
+   jnz     FXCWS_SpeedUp
+  FXCWS_SpeedDown:
+   or      cl, cl
+   jz      FXCWS_WideScrollNOW
+   dec     cl
+   jmp     FXCWS_WideScrollNOW
+
+  FXCWS_SpeedUp:
+   cmp     cl, 25
+   jge     FXCWS_WideScrollNOW
+   inc     cl
+   jmp     FXCWS_WideScrollNOW
+
+   ; ================================================== WideScroll: DO SCROLL
+  FXCWS_WideScrollNOW:
+   xor     ch, ch
+   test    byte ptr [FX_WideScrollerDirection], 1
+   jnz     FXCWS_ScrollRIGHT
+   sub     bx, cx
+   jmp     FXCWS_Continue
+  FXCWS_ScrollRIGHT:
+   add     bx, cx
+  FXCWS_Continue:
+   cmp     bx, 5555h  ; Zu gross <g>
+   jb      FXCWS_NotToSmall
+   mov     bx, 0
+  FXCWS_NotToSmall:
+   cmp     bx, 640 ; 1280
+   jb      FXCWS_NotToBig
+   mov     bx, 640 ; 1280
+  FXCWS_NotToBig:
+   mov     [FX_WideScrollerCurPos], bx
+   mov     [FX_WideScrollerSpeed], cl
+   mov     ax, 160
+   call    FX_SetWideLength
+   mov     ax, bx
+   call    FX_SetVideoStart
+   ret
+FX_CalculateWideScroller        EndP
+
+FX_WaitRetrace                  Proc Near
+   mov    dx, 3DAh
+  FX_WR1:
+   in     al,dx
+   test   al,8
+   jnz    FX_WR1
+  FX_WR2:
+   in     al,dx
+   test   al,8
+   jz     FX_WR2
+   ret
+FX_WaitRetrace                  EndP
+
+FX_WaitVRetrace                 Proc Near
+   mov    dx, 3DAh
+  FX_WVR1:
+   in     al,dx
+   test   al,1
+   jnz    FX_WVR1
+  FX_WVR2:
+   in     al,dx
+   test   al,1
+   jz     FX_WVR2
+   ret
+FX_WaitVRetrace                 EndP
+
+FX_SetVideoStart                Proc Near   Uses bx cx dx
+   cmp     ax, -1
+   je      FXSVS_Reset
+   mov     bx, ax
+   mov     cl, al
+   shr     bx, 3
+   and     cl, 7
+   add     bx, 2000h                     ; Start at BC00h (Offset 4000h)
+   or      cl, cl
+   jnz     FXSVS_SetValues
+   mov     cl, 31                        ; BX - StartAddr, CL - ShiftReg
+   jmp     FXSVS_SetValues
+  FXSVS_Reset:
+   xor     bx, bx                        ; StartAddr==0, ShiftReg==31
+   mov     cl, 31
+  FXSVS_SetValues:
+   mov     dx, 3D4h
+   mov     al, 0Ch
+   mov     ah, bh
+   out     dx, ax                        ; Set Start-Address
+   inc     al
+   mov     ah, bl
+   out     dx, ax
+
+   mov     dx, 3C0h
+   mov     al, 33h
+   out     dx, al
+   mov     al, cl
+   out     dx, al                        ; Set Shift-Register
+   ret
+FX_SetVideoStart                EndP
+
+FX_SetWideLength                Proc Near   Uses dx
+   shr     ax, 1                         ; Divide by 2
+   mov     ah, al
+   mov     dx, 3D4h
+   mov     al, 13h
+   out     dx, ax
+   ret
+FX_SetWideLength                EndP
Index: trunk/bootcode/special/fxtables.asm
===================================================================
--- trunk/bootcode/special/fxtables.asm	(revision 57)
+++ trunk/bootcode/special/fxtables.asm	(revision 57)
@@ -0,0 +1,45 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                     AiR-BOOT / F/X TABLES
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'FXTABLES',0
+ENDIF
+
+; Sinus-Table - 128xWORD = 256 Bytes
+FX_SinusTab dw 00101h, 00102h, 00103h, 00105h, 00107h, 0010Ah, 0010Dh, 00111h
+    dw 00115h, 00119h, 0011Dh, 00122h, 00127h, 0012Dh, 00133h, 00139h, 00140h
+    dw 00146h, 0014Dh, 00155h, 0015Ch, 00164h, 0016Bh, 00173h, 0017Bh, 00184h
+    dw 0018Ch, 00194h, 0019Dh, 001A5h, 001AEh, 001B7h, 001BFh, 001C8h, 001D0h
+    dw 001D8h, 001E1h, 001E9h, 001F1h, 001F8h, 00200h, 00207h, 0020Fh, 00216h
+    dw 0021Ch, 00223h, 00229h, 0022Fh, 00235h, 0023Ah, 0023Fh, 00243h, 00247h
+    dw 0024Bh, 0024Fh, 00252h, 00255h, 00257h, 00259h, 0025Ah, 0025Bh, 0025Ch
+    dw 0025Ch, 0025Ch, 0025Bh, 0025Ah, 00259h, 00257h, 00255h, 00252h, 0024Fh
+    dw 0024Bh, 00247h, 00243h, 0023Fh, 0023Ah, 00235h, 0022Fh, 00229h, 00223h
+    dw 0021Ch, 00216h, 0020Fh, 00207h, 00200h, 001F8h, 001F1h, 001E9h, 001E1h
+    dw 001D8h, 001D0h, 001C8h, 001BFh, 001B7h, 001AEh, 001A5h, 0019Dh, 00194h
+    dw 0018Ch, 00184h, 0017Ch, 00173h, 0016Bh, 00164h, 0015Ch, 00155h, 0014Dh
+    dw 00146h, 00140h, 00139h, 00133h, 0012Dh, 00128h, 00122h, 0011Dh, 00119h
+    dw 00115h, 00111h, 0010Dh, 0010Ah, 00107h, 00105h, 00103h, 00102h, 00101h
+    dw 00100h, 00100h, 00100h
+
+; Top-VLine-Position of all Cooper-Bars on startup
+FX_StartCooperPos:
+    dw 224, 221, 218, 215, 212, 209, 206
Index: trunk/bootcode/special/linux.asm
===================================================================
--- trunk/bootcode/special/linux.asm	(revision 57)
+++ trunk/bootcode/special/linux.asm	(revision 57)
@@ -0,0 +1,489 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                  AiR-BOOT / LINUX SUPPORT
+;---------------------------------------------------------------------------
+
+; Here is the startup-code for Linux-Kernels. I'm sure this won't work on
+; all of them, but on the latest.
+
+; Note: This code will ONLY WORK on computers with INT 13h Extension.
+;       I did not want to code silly cylinder stuff here and if you don't
+;       have INT 13h Extensions, you will not need this. LINUXIMG won't work
+;       without them.
+;
+; And another note: *F**k* Linux usenet-users. Really. I mean *f**k them*.
+;  I asked in an OS/2 newsgroup for testers -> Got 8 volunteers within some
+;  days. I asked in 2 Linux newsgroups. What did happen? Some idiots discussed
+;  the whole sh*t with me, knew nothing about INT13h CHS/LBA mode, BIOS,
+;  boot-managers in general, assembly coding and other stuff and wanted to tell
+;  me that 95k GRUB is well-coded and its good to have it placed all over your
+;  harddrive and that file-support and all those lousy features would waste
+;  sooo much space. ROFLMAO.
+;
+; I could implement some more file-systems into AiR-BOOT, but instead I did
+;  some nice menus, setup, text, cyrillic support, demo-coder effects, easy
+;  handling, help, auto-detection and plenty of other stuff INTO AROUND 25k.
+;
+; Oh, why is this code here? Because of 2 friends of mine. Otherwise I wouldnt
+;  have done it as well as fat16.asm.
+
+IFDEF   MODULE_NAMES
+DB 'LINUX',0
+ENDIF
+
+Linux_TranslateBase     db '/dev/hd'
+Linux_KernelDirectory   db 'KERNELS    '
+
+; Translates partition-number to Linux-device name (e.g. /dev/hda3)
+;        In: DL - partition number, ES:DI - destination 9-byte buffer
+;       Out: (buffer filled)
+; Destroyed: None
+LINUX_TranslateToDEV            Proc Near  Uses eax ebx cx dx ds si
+   ; Damn Linux. Our logic is as follows: first get the drive letter.
+   ;             that's easy. Now search our partition-table for new
+   ;             extended partitions and fix them up. Stupid logic.
+   push    cs
+   pop     ds                 ; CS == DS
+   mov     si, offset Linux_TranslateBase
+   mov     cx, 7
+   rep     movsb                         ; First write base-name (/dev/hd)...
+   ; First get our partition-table
+   call    PART_GetPartitionPointer      ; Partition (DL) -> CS:SI
+   mov     dl, ds:[si+LocIPT_Drive]
+   mov     al, dl
+   sub     al, 1Fh                       ; Generate letter from drive (80h -> 61h)
+   stosb                                 ; write letter
+
+   ; Now get the linux local partition number
+   ; 1. Search for partition, where TranslateDrive (DL) got used first
+   mov     cx, si          ; CX - Searched partition offset
+   mov     si, offset PartitionTable ; begin here
+  LTTD_SearchDriveLoop:
+   cmp     ds:[si+LocIPT_Drive], dl
+   je      LTTD_SearchDrive_Found
+   add     si, LocIPT_LenOfIPT
+   jmp     LTTD_SearchDriveLoop
+  LTTD_SearchDrive_Found:
+   ; Now count all partitions to hit. After root partition set counter to
+   ; 4 and count further.
+   xor     dh, dh          ; Linux Partition Counter (Base 0)
+  LTTD_SearchPart_Loop:
+      inc     dh           ; Increase Linux Local Partition Number
+      mov     ax, wptr ds:[si+LocIPT_AbsolutePartTable+2]
+      shr     eax, 16
+      mov     ax, wptr ds:[si+LocIPT_AbsolutePartTable+0] ; -> EAX
+      cmp     dh, 4                      ; over root partition yet ?
+      ja      LTTD_ContinueLoop ; yes, continue loop
+      cmp     eax, 0                     ; not in root partition anymore?
+      je      LTTD_ContinueLoop
+      mov     dh, 5                      ; nope, so adjust counter
+     LTTD_ContinueLoop:
+   cmp     si, cx
+   je      LTTD_SearchPart_Found
+   add     si, LocIPT_LenOfIPT           ; Next Partition
+   jmp     LTTD_SearchPart_Loop
+
+  LTTD_SearchPart_Found:
+   or      eax, eax
+   jnz     LTTD_SearchPart_NotRootPartition
+   ; Bullshit, it's in the MBR, so we have to look for the
+   ; partition number directly (because EXTEND, EXT2: EXT2 would be
+   ; partition 1, in fact it would be partition 2)
+   ; All we do here is to load the MBR to memory (suck) and look in it
+   ; manually. Pervertly this could be crazy, when user
+   ; is in setup and changing 'Linux Root'.
+   mov     ax, wptr ds:[si+LocIPT_AbsoluteBegin+2]
+   shr     eax, 16
+   mov     ax, wptr ds:[si+LocIPT_AbsoluteBegin+0] ; -> EAX
+   push    eax
+      xor     ax, ax
+      xor     bx, bx
+      mov     cx,  1
+      xor     dh, dh
+      mov     si, offset TmpSector
+      call    DriveIO_LoadSector         ; Load fucking MBR
+   pop     eax
+   xor     dh, dh                        ; Reset again to zero
+   add     si, 446
+  LTTD_SearchRoot_Loop:
+      cmp     bptr ds:[si+4], 0
+      je      LTTD_SearchRoot_NoPart     ; if partition...
+      inc     dh                                   ;  add one
+     LTTD_SearchRoot_NoPart:
+      mov     bx, wptr ds:[si+10]
+      shr     ebx, 16
+      mov     bx, wptr ds:[si+08]                  ; -> EBX (Start Sector)
+      add     si, 16
+      cmp     eax, ebx
+      jne     LTTD_SearchRoot_Loop
+
+  LTTD_SearchPart_NotRootPartition:
+   mov     al, dh
+   ; Now convert that crap (AL) to ascii and write it
+   cmp     al, 10
+   jb      LTTD_Smaller10
+   xor     ah, ah
+   mov     dl, 10
+   div     dl
+   add     al, 30h         ; Generate number from value 00h -> 30h)
+   stosb
+   mov     al, ah
+  LTTD_Smaller10:
+   add     al, 30h         ; Generate number from value
+   stosb
+   ret
+LINUX_TranslateToDEV            EndP
+
+LINUX_InitFAT16access           Proc Near  Uses es
+   mov     dl, ds:[CFG_LinuxKrnlPartition]
+   call    PART_GetPartitionPointer      ; Partition DL -> SI
+   call    FAT16_InitAccess
+
+   call    FAT16_ReadRoot
+
+   mov     cx, FAT16_NumOfRootEntries
+   mov     si, offset Linux_KernelDirectory
+   call    FAT16_SearchEntry            ; Fills up DX as Cluster-No
+   or      dx, dx
+   jz      LIFAT16A_NoDirectory
+
+      mov    ax, 9000h
+      mov    es, ax
+      xor    di, di                      ; Read Cluster DX to 9000:0 (ES:DI)
+      call   FAT16_ReadCluster
+      mov    ax, cs
+      mov    es, ax                      ; DS == ES == CS
+      call   FAT16_ProcessKrnlDirectory
+
+  LIFAT16A_NoDirectory:
+   ret
+LINUX_InitFAT16access           EndP
+
+; Initialize FAT-16 access on specified partition (required for following xs)
+;        In: DS:SI - 11-Byte Kernel Name to search
+;       Out: DL    - FFh - if not found, otherwise the entry no is replied
+; Destroyed: None
+LINUX_SearchKernelName          Proc Near  Uses cx di
+   mov     dl, 0FFh                      ; Nothing found is default...
+   mov     cl, LINUX_KernelNo
+   or      cl, cl
+   jz      LSKN_NotFound
+   mov     di, offset LINUX_KernelEntries
+   add     di, LocIPT_Name
+  LSKN_SearchLoop:
+      push    cx
+      push    si
+      push    di
+         mov     cx, 11
+         repe    cmpsb                   ; Compare total 11-bytes
+      pop     di
+      pop     si
+      pop     cx
+      je      LSKN_Found
+      add     di, LocIPT_LenOfIPT
+   dec     cl
+   jnz     LSKN_SearchLoop
+   jmp     LSKN_NotFound
+
+  LSKN_Found:
+   mov     si, di
+   sub     si, LocIPT_Name               ; Back to Base-Pointer
+   call    PART_GetPartitionNumber       ; Get Number of Entry at [SI]
+  LSKN_NotFound:
+   ret
+LINUX_SearchKernelName          EndP
+
+Linux_FuzzyString       db 'Linux Boot - Alpha', 13, 10, 0
+Linux_GotBadKernel      db ' - Bad Kernel/Bad FAT-16 partition', 0
+Linux_INT15error        db ' - INT 15 error', 0
+Linux_RootDefine        db 'root='
+
+LINUX_LoadKernel                Proc Near  Uses ; Direct Jump, No Preserves
+   ; TranslateToDev needs UNFILTERED Partition Pointers...
+   call    PART_CalculateStraightPartPointers
+   push    si
+      mov     si, offset Linux_FuzzyString
+      call    MBR_Teletype
+   pop     si
+   ; DX - Starting-Cluster of Linux Kernel File
+   mov     dx, ds:[si+LocIPT_LocationBegin]
+   ; from now on, we don't need si anymore
+
+   ; Linux has 1 'BR' (which is crap) and some setup sectors
+   ; we load them at 9000:0, what a luck, we are at 8000:0 :-))
+   push    ds
+   push    es
+      mov     ax, 9000h
+      mov     es, ax
+      xor     di, di
+      call    FAT16_ReadCluster          ; Load First Cluster (DX) to 9000:0
+      mov     cl, bptr es:[01F1h]        ; Setup sectors to load
+      inc     cl                         ; Total sectors to load to 9000:0
+      jmp     LLL_CheckLeft
+
+     LLL_LoadSetupCodeLoop:
+      call    FAT16_ReadCluster
+     LLL_CheckLeft:
+      sub     cl, FAT16_SecsPerCluster
+      jz      LLL_GotAllClusterDone
+      jc      LLL_GotAllClusterNotEmpty
+      jmp     LLL_LoadSetupCodeLoop
+
+     LLL_GotAllClusterDone:
+      xor     cx, cx
+      jmp     LLL_GotAll
+     LLL_GotAllClusterNotEmpty:
+      ; Damn, Cluster didn't got empty. So we have to copy the rest out...
+      xor     ch, ch
+      not     cl
+      inc     cl                         ; 0FFh -> 1 sector to get...
+      ; Now copy rest to 6000:0 location for later processing...
+      ; ES:DI - Ending location of Setup Code
+      mov     ax, 9000h
+      mov     ds, ax
+      mov     ax, 6000h
+      mov     es, ax
+      ; Push Kernel-Entry-Pointer
+      push    cx
+      push    si
+         mov     si, di
+         shl     cx, 9                   ; Sectors to Byte Count
+         sub     si, cx                  ; DS:SI - Begin of Kernel Data
+         xor     di, di
+         shr     cx, 1
+         rep     movsw                   ; Copy Data...
+      ; Get Kernel-Entry-Pointer back
+      pop     si
+      pop     cx
+     LLL_GotAll:
+   pop     es
+   pop     ds
+
+   ; Push Missing-Sectors, StartCluster
+   push    cx
+   push    dx
+      mov     ax, 9000h
+      mov     ds, ax
+
+      ; Check Signatures for security...
+      cmp     wptr ds:[1FEh], 0AA55h
+      jne     LLL_BadKernel
+      cmp     wptr ds:[202h], 'dH'
+      jne     LLL_BadKernel
+      cmp     wptr ds:[204h], 'Sr'
+      je      LLL_GoodKernel
+     LLL_BadKernel:
+      push    es
+      pop     ds
+      mov     si, offset Linux_GotBadKernel
+      call    MBR_Teletype
+      jmp     MBR_HaltSystem
+     LLL_GoodKernel:
+
+      ; Now we have at least some of the required sectors loaded
+      mov     ax, 9000h
+      mov     dx, ax
+      mov     al, bptr ds:[01F1h]         ; Setup Sectors to load
+      ;   -> to 9020:0
+
+      ; Just append parameters to end of Linux boot-block...
+      xor     ah, ah
+      mov     bl, 20h
+      mul     bl           ; AX * 20
+      add     dx, ax       ; add to segment    -> Segment of Parameters
+
+      mov     wptr ds:[0020h], 0A33Fh
+      mov     ax, dx
+      and     ax, 0FFFh                   ; 9100h -> 0100h
+      shl     ax, 4                       ; 0100h -> 1000h
+      mov     wptr ds:[0022h], ax         ; offset of parameter relative 9000:0
+
+      ; fill out Linux-Loader byte, so SETUP will do its job
+      mov     bptr ds:[0210h], 0A0h       ; AiR-BOOT (unknown ID for Linux btw)
+      mov     cx, wptr ds:[01F4h]         ; Linux Kernel Length in 16-byte blocks
+      shr     cx, 5
+      inc     cx                          ; Convert to Sector-Count
+      push    cx
+         push    cs
+         pop     ds                       ; CS == DS
+         mov     es, dx                   ; ES = Segment for parameters
+         xor     di, di                   ; ES:0 - Parameter Ptr
+         mov     dl, cs:[CFG_LinuxRootPartition]
+         cmp     dl, 0FFh
+         je      LLL_NoRootPartitionFound
+         mov     cx, 5
+         mov     si, offset Linux_RootDefine
+         rep     movsb                    ; root=
+         call    LINUX_TranslateToDEV     ; Writes DEV (dl) at ES:DI (/dev/hda9)
+
+        LLL_NoRootPartitionFound:
+         ; Root-Define complete, now for the user Kernel Command-Line...
+         mov     si, offset CFG_LinuxCommandLine
+         mov     al, ds:[si]
+         or      al, al
+         jz      LLL_CommandLineLoop
+         mov     al, ' '
+         stosb                            ; If any command-line, insert space
+        LLL_CommandLineLoop:
+            lodsb
+            stosb                         ; Copy string till and including NUL
+         or      al, al
+         jnz     LLL_CommandLineLoop
+         stosb                            ; Write another NUL
+      pop     cx
+   ; Pop StartCluster, Missing-Sectors
+   pop     dx
+   pop     bx
+   ; CX - Sector-Count of Kernel Image, DX - Starting Cluster of Kernel Image
+   ; BX - Sector-Count left over in 6000:0 area from Setup Code loading
+   ; DS == CS
+
+   ; Now comes some tricky part. Hopefully we have a tiny kernel.
+   ; If we have a big kernel, we have to 'upload' it to PM-memory space.
+   test    bptr ds:[0211h], 01h
+   jz      LLL_LoadNormalKernel
+   jmp     LLL_LoadBigKernel
+
+  LLL_LoadNormalKernel:
+   ; NORMAL KERNEL
+
+   ; Still UNSUPPORTED. This suxxs
+
+  LLL_LoadBigKernel:
+   ; BIG KERNEL - Oh no, we have to load all data to extended memory...
+   mov     ax, 6000h
+   mov     es, ax
+   shr     ax, 4
+   ; Set Source to 06:0000
+   mov     bptr cs:[MBR_Linux_GDT_Src+0], al
+   mov     wptr cs:[MBR_Linux_GDT_Src+1], ax
+   xor     si, si
+   or      bx, bx                        ; No unfinished Cluster ?
+   jz      LLL_LoadBigKernelLoop
+   push    cx
+      mov     cx, bx
+      shl     cx, 8                      ; Sectors to WORD Count
+      call    LINUX_MoveKernelPart       ; Copy Data to Extended Memory
+   pop     cx
+  LLL_LoadBigKernelLoop:
+   push    cx
+      ; DX - Current Cluster
+      ; CX - Total WORDs that need to be loaded
+      ; ES - Segment
+      mov     cx, 8000h
+      call    LINUX_LoadDataToMemory
+      ; CX - Total WORDs that were loaded...
+      ; Got 6000:0 filled...
+      call    LINUX_MoveKernelPart
+      shr     cx, 8                      ; WORDs to SEGMENTs
+      add     si, cx
+   pop     cx
+   cmp     si, cx
+   jb      LLL_LoadBigKernelLoop
+
+  LLL_FinishedLoadKernel:
+   ; either way, we give execution to setup at 9020:0
+   mov     ax, 09020h
+   mov     ss, ax
+   mov     sp, 4000h-12h   ; Linux wants it this way...
+   mov     ds, ax
+   mov     es, ax
+   db      0EAh
+   dw      0
+   dw      09020h
+LINUX_LoadKernel                EndP
+
+; Loads Data from Cluster(s) to memory...
+;        In: DX - First cluster to read from...
+;            CX - Total WORDs that need to be loaded at least
+;            ES - Segment, where to load to (Starting Offset is zero)
+;       Out: CX - Total WORDs that got loaded
+;            DX - Cluster following last loaded cluster
+;            (buffer filled)
+; Destroyed: None
+; MUST BE USING CS for addressing Code Segment, DS =! CS
+LINUX_LoadDataToMemory          Proc Near  Uses di
+   shl     cx, 1                         ; Convert WORDs to BYTEs
+   dec     cx                            ; 0000h -> FFFFh
+   xor     di, di
+  LLDTM_LoadLoop:
+      call    FAT16_ReadCluster          ; Load Cluster DX to ES:DI
+      ; DX and DI were updated by ReadCluster, so don't modify them...
+   or      di, di
+   jz      LLDTM_Overflow
+   cmp     di, cx
+   jbe     LLDTM_LoadLoop
+   mov     cx, di
+   shr     cx, 1
+   inc     cx                            ; 3FFFh -> 4000h
+   ret
+  LLDTM_Overflow:
+   mov     cx, 08000h
+   ret
+LINUX_LoadDataToMemory          EndP
+
+; Copies Extended-Memory (clobbered from Linux setup)
+;        In: CX    - Total WORDs to copy
+;       Out: (buffer copied)
+; Destroyed: None
+; MUST BE USING CS for addressing Code Segment, DS =! CS
+LINUX_MoveKernelPart            Proc Near  Uses ax cx es si
+   mov     ax, cs
+   mov     es, ax
+   mov     si, offset MBR_Linux_GDT
+   push    cx
+      mov     ax, 08700h
+;      IFDEF ReleaseCode
+         int     15h
+         jc      LMKP_Error
+;      ENDIF
+   pop     cx
+   ; now adjust Destination by copied word-count
+   add     wptr cs:[MBR_Linux_GDT_Dst], cx
+   adc     bptr cs:[MBR_Linux_GDT_Dst+2], 0
+   add     wptr cs:[MBR_Linux_GDT_Dst], cx
+   adc     bptr cs:[MBR_Linux_GDT_Dst+2], 0
+   ret
+  LMKP_Error:
+   mov     ax, cs
+   mov     ds, ax
+   mov     si, offset Linux_INT15error
+   call    MBR_Teletype
+   jmp     MBR_HaltSystem
+LINUX_MoveKernelPart            EndP
+
+MBR_Linux_GDT:          dw          0, 0, 0, 0
+                        dw          0, 0, 0, 0
+                        dw          0FFFFh
+MBR_Linux_GDT_Src       db          0, 0, 06h    ; Source is 6000:0
+                        db          093h
+                        dw          0
+                        dw          0FFFFh
+MBR_Linux_GDT_Dst       db          0, 0, 10h    ; Dest is "10000:0"
+                        db          093h
+                        dw          0
+                        dw          0, 0, 0, 0
+                        dw          0, 0, 0, 0
+                        dw          0
+
+;
+; Example of boot setup command under lilo prompt:
+;
+; lilo: linux root=/dev/sda2 sym53c8xx=tags:4,sync:10,debug:0x200
+;
Index: trunk/bootcode/special/lvm.asm
===================================================================
--- trunk/bootcode/special/lvm.asm	(revision 57)
+++ trunk/bootcode/special/lvm.asm	(revision 57)
@@ -0,0 +1,562 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                            AiR-BOOT / LVM
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'LVM',0
+ENDIF
+
+LVM_InitCRCTable                Proc Near
+        ; Initializes our LVM-CRC-Table
+        xor     cl, cl
+        mov     di, offset [LVM_CRCTable]
+    LVM_ICRCT_Loop:
+        ;movzx  ax, cl
+        mov     al,cl
+        mov     ah,0
+        xor     dx, dx                      ; DX:AX - CRC-Value
+        mov     ch, 8
+    LVM_ICRCT_Loop2:
+        shr     dx, 1
+        rcr     ax, 1                    ; Shift value 1 to the right
+        jnc     LVM_ICRCT_NoXOR
+        xor     dx, 0EDB8h
+        xor     ax, 8320h
+    LVM_ICRCT_NoXOR:
+        dec     ch
+        jnz     LVM_ICRCT_Loop2
+        mov     wptr [di+0], ax
+        mov     wptr [di+2], dx
+        add     di, 4
+        add     cl, 1
+        jnc     LVM_ICRCT_Loop
+        ret
+LVM_InitCRCTable                EndP
+
+; Calculates an LVM-Sector CRC of a given sector
+;        In: DS:SI - Points to Sector...
+;       Out: DX:AX - LVM CRC
+; Destroyed: None
+LVM_GetSectorCRC                Proc Near   Uses bx cx
+        push    word ptr [si+LocLVM_CRC+00]
+        push    word ptr [si+LocLVM_CRC+02]
+        push    si
+        mov     word ptr [si+LocLVM_CRC], 0
+        mov     word ptr [si+LocLVM_CRC+2], 0
+        mov     ax, -1
+        mov     dx, -1
+        mov     cx, 512
+    LVM_GSCRC_Loop:
+        xor     bh, bh
+        mov     bl, al                      ; Save last byte to BL
+        mov     al, ah
+        mov     ah, dl
+        mov     dl, dh
+        xor     dh, dh                      ; SHR DX:AX, 8
+        xor     bl, [si]
+        inc     si                          ; XOR last byte with [data]
+        shl     bx, 1
+        shl     bx, 1
+        xor     ax, word ptr [LVM_CRCTable+bx+0]
+        xor     dx, word ptr [LVM_CRCTable+bx+2] ; XOR with CRC-Table
+        loop    LVM_GSCRC_Loop
+        pop     si
+        pop     word ptr [si+LocLVM_CRC+2]
+        pop     word ptr [si+LocLVM_CRC]
+        ret
+LVM_GetSectorCRC                EndP
+
+; Checks ds:[SI], if a valid LVM Signature is found (sets carry in that case)
+;  This does not check for valid LVM CRC (which also needs to be done)
+;        In: DS:SI - Sector that needs to get checked...
+;       Out: Carry set, if valid LVM signature found
+; Destroyed: None
+LVM_CheckSectorSignature        Proc Near
+        test    byte ptr [CFG_IgnoreLVM], 1 ; We are supposed to ignore LVM, so
+        jnz     LVMCSS_InvalidSignature     ;  any sector is bad!
+        cmp     word ptr [si+LocLVM_SignatureStart], 5202h
+        jne     LVMCSS_InvalidSignature
+        cmp     word ptr [si+LocLVM_SignatureStart+2], 'BM'
+        jne     LVMCSS_InvalidSignature
+        cmp     word ptr [si+LocLVM_SignatureStart+4], 'MP'
+        jne     LVMCSS_InvalidSignature
+        cmp     word ptr [si+LocLVM_SignatureStart+6], 'DF'
+        jne     LVMCSS_InvalidSignature
+        stc
+        ret
+    LVMCSS_InvalidSignature:
+        clc
+        ret
+LVM_CheckSectorSignature        EndP
+
+; Checks Sector for a valid LVM CRC is encountered
+;  First one should check for a valid signature and call this later.
+;        In: DS:SI - Sector that needs to get checked...
+;       Out: Carry set, if LVM CRC valid
+; Destroyed: None
+LVM_CheckSectorCRC              Proc Near   Uses ax dx
+        call    LVM_GetSectorCRC
+        cmp     ax, word ptr [si+LocLVM_CRC]
+        jne     LVMCSCRC_BadCRC
+        cmp     dx, word ptr [si+LocLVM_CRC+2]
+        jne     LVMCSCRC_BadCRC
+        stc
+        ret
+    LVMCSCRC_BadCRC:
+        clc
+        ret
+LVM_CheckSectorCRC              EndP
+
+; Updates Sector with valid LVM CRC
+;  This one doesn't check, if it's really an LVM sector, so check before!
+;        In: DS:SI - Sector that needs to get checked...
+;       Out: None, CRC updated
+; Destroyed: None
+LVM_UpdateSectorCRC            Proc Near   Uses ax dx
+        call    LVM_GetSectorCRC
+        mov     word ptr [si+LocLVM_CRC], ax
+        mov     word ptr [si+LocLVM_CRC+2], dx
+        ret
+LVM_UpdateSectorCRC            EndP
+
+; Searches for a partition in LVM Information Sector and sets SI to point to
+;  the LVM-entry. It will also set CARRY then.
+;        In: DX:AX - LBA starting sector of partition to be searched
+;            DS:SI - Valid (previously checked) LVM-Information-Sector
+;       Out: Carry set, if partition found
+;            DS:SI - points to LVM information entry
+; Destroyed: None
+LVM_SearchForPartition          Proc Near   Uses cx
+        cmp     byte ptr [si+LocLVM_SignatureStart], LocLVM_SignatureByte0
+        jne     LVMSFP_NotFound               ; Quick Check, if LVM sector there
+        add     si, LocLVM_StartOfEntries
+        mov     cl, LocLVM_MaxEntries
+    LVMSFP_Loop:
+        cmp     ax, [si+LocLVM_PartitionStart]
+        jne     LVMSFP_NextEntry
+        cmp     dx, [si+LocLVM_PartitionStart+2]
+        je      LVMSFP_FoundIt
+    LVMSFP_NextEntry:
+        add     si, LocLVM_LenOfEntry
+        dec     cl
+        jnz     LVMSFP_Loop
+    LVMSFP_NotFound:
+        clc
+        ret
+    LVMSFP_FoundIt:
+        stc
+        ret
+LVM_SearchForPartition          EndP
+
+
+; Gets a drive-letter from the LVM-info of a partition. (if it exists)
+;        In: BX:CX - LBA starting sector of partition to be searched
+;            DL = Physical Disk in BIOS notation. (80h+)
+;       Out: CY=1 if LVM-info found, 0 if no LVM-info.
+;            AL - drive-letter from LVM-info or zero if no drive-letter
+;            assigned or no LVM-info.
+LVM_GetDriveLetter      Proc Near   Uses bx cx dx si di ds es
+        ; For primary partitions this information is stored in the last
+        ; sector of track0; for all four partition entries in case they
+        ; they are all primary ones.
+        ;
+        ; LVM DLAT info for logical partitions is stored in the sector
+        ; preceding the start of the partition.
+        ;
+        ; Because the LVM info of a logical partition is the easiest to find,
+        ; we do that first. The LVM info for primary partitions is located
+        ; dependent on the geometry in use, so we use a special locater
+        ; call for that. Also, since the LVM info for primaries contains
+        ; info on all 4 entries, we need the partition index to obtain the
+        ; correct drive-letter.
+        ;
+
+        ; See if this is a primary partition
+        ; CY will be set if it is and AL will contain the 0-based
+        ; index in the P-table.
+        ; If it's a logical partition, CY will be clear and AL
+        ; will be set to 0ffh indicating an invalid index.
+        call    PART_IsPrimaryPartition
+        mov     al,0
+        rcl     al,1        ; CY if primary
+        mov     dh,al       ; Save PRI or LOG
+
+        ; Save PRI/LOG indicator for later use
+        push    dx
+
+        ; Load *possible* LVM sector
+        ; This load is only valid if the partition is logical, in which case
+        ; the LVM sector is below the start of the partition.
+        ; If primary, the LVM sector is at a location that
+        ; DriveIO_LoadMasterLVMSector will find out.
+
+        ; Push LBA address
+        push    bx
+        push    cx
+
+        ; Adjust for logical LVM-sector
+        sub     cx,1
+        sbb     bx,0
+
+        ; Load the LVM sector
+        push    si
+        push    di
+        mov     si,offset [LVMSector]
+        mov     di,ds
+        call    DriveIO_LoadSectorLBA                                           ; Change this to normal IO-routine !!!!!!
+        pop     di
+        pop     si
+
+        ; Restore LBA address
+        pop     cx
+        pop     bx
+
+        ; Restore PRI/LOG partition indicator in DH
+        pop     dx
+
+        ; Test PRI or not
+        test    dh,dh
+        ; It's not a PRI so we can use the previously loaded LVM sector
+        jz      LVM_GetDriveLetter_is_not_pri
+
+        ;
+        ; It's a PRI so we use the special locator function.
+        ; This locator takes care of extended eCS geometry should that be used
+        ;
+        call    DriveIO_LoadMasterLVMSector
+
+    LVM_GetDriveLetter_is_not_pri:
+
+
+        ;
+        ; At this stage the LVM-info sector has been loaded at [LVMSector].
+        ; From here we look for an LVM entry for the partition.
+        ; If one is found, based on it's LBA-start, it's driveletter is used
+        ; in case byte 25h in the BPB is zero.
+        ;
+
+
+        ; Search for the partition in the LVM info.
+        ; If found, CY is set and SI points to LVM entry.
+        push    si
+        mov     ax,cx
+        mov     dx,bx
+        mov     si,offset [LVMSector]
+        call    LVM_SearchForPartition
+        mov     bx,si   ; BX now points to LVM entry
+        mov     dx,0
+        pop     si
+
+        mov     al,0    ; Setup null driveletter
+        ; Oops, no valid LVM record was used so we have a null driveletter.
+        jnc     LVM_GetDriveLetter_null_lvm_dl
+
+        ;
+        ; At this point BX points to the LVM-entry related to the
+        ; partition, whether it was a logical or a primary one.
+        ;
+        mov     al,[bx+LocLVM_VolumeLetter]
+        ; Test for zero dtive-letter.
+        test    al,al
+        ; Preset CY in case drive-letter is zero.
+        clc
+        jz      LVM_GetDriveLetter_null_lvm_dl
+
+        ; We have a non-zero drive-letter, so set CY.
+        stc
+
+    LVM_GetDriveLetter_null_lvm_dl:
+        ret
+LVM_GetDriveLetter      EndP
+
+
+
+; Sets a drive-letter in the LVM-info of a partition. (if it exists)
+;        In: BX:CX - LBA starting sector of partition to be searched
+;            DL = Physical Disk in BIOS notation. (80h+)
+;            AL = DriveLetter to set (can be zero to hide partition from LVM)
+;       Out: CY=1 if LVM-info found, 0 if no LVM-info.
+LVM_SetDriveLetter      Proc Near   Uses bx cx dx si di ds es
+        local   disk:byte
+        local   drive_letter:byte
+        local   pri_ind:byte
+        local   lvm_log_high:word
+        local   lvm_log_low:word
+        ; For primary partitions this information is stored in the last
+        ; sector of track0; for all four partition entries in case they
+        ; they are all primary ones.
+        ;
+        ; LVM DLAT info for logical partitions is stored in the sector
+        ; preceding the start of the partition.
+        ;
+        ; Because the LVM info of a logical partition is the easiest to find,
+        ; we do that first. The LVM info for primary partitions is located
+        ; dependent on the geometry in use, so we use a special locater
+        ; call for that. Also, since the LVM info for primaries contains
+        ; info on all 4 entries, we need the partition index to obtain the
+        ; correct drive-letter.
+        ;
+
+        mov     [disk], dl
+
+        ; Store the drive-letter for later use
+        mov     [drive_letter], al
+
+
+        ; See if this is a primary partition
+        ; CY will be set if it is and AL will contain the 0-based
+        ; index in the P-table.
+        ; If it's a logical partition, CY will be clear and AL
+        ; will be set to 0ffh indicating an invalid index.
+        call    PART_IsPrimaryPartition
+        mov     al,0
+        rcl     al,1        ; CY if primary
+        mov     dh,al       ; Save PRI or LOG
+        mov     [pri_ind],al
+
+        ; Save PRI/LOG indicator for later use
+        push    dx
+
+        ; Load *possible* LVM sector
+        ; This load is only valid if the partition is logical, in which case
+        ; the LVM sector is below the start of the partition.
+        ; If primary, the LVM sector is at a location that
+        ; DriveIO_LoadMasterLVMSector will find out.
+
+        ; Push LBA address
+        push    bx
+        push    cx
+
+        ; Adjust for logical LVM-sector
+        sub     cx,1
+        sbb     bx,0
+
+        ; Store LBA address of LVM-sector
+        mov     [lvm_log_low],cx
+        mov     [lvm_log_high],bx
+
+        ; Load the LVM sector
+        push    si
+        push    di
+        mov     si,offset [LVMSector]
+        mov     di,ds
+        call    DriveIO_LoadSectorLBA                                           ; Change this to normal IO-routine !!!!!!
+        pop     di
+        pop     si
+
+        ; Restore LBA address
+        pop     cx
+        pop     bx
+
+        ; Restore PRI/LOG partition indicator in DH
+        pop     dx
+
+        ; Test PRI or not
+        test    dh,dh
+        ; It's not a PRI so we can use the previously loaded LVM sector
+        jz      LVM_SetDriveLetter_is_not_pri
+
+        ;
+        ; It's a PRI so we use the special locator function.
+        ; This locator takes care of extended eCS geometry should that be used
+        ;
+        call    DriveIO_LoadMasterLVMSector
+        jnc     LVM_SetDriveLetter_null_lvm_dl
+
+        mov     ax, word ptr [MasterLVMLBA]                                         ; ARRAY VAN MAKEN !
+        mov     [lvm_log_low], ax
+        mov     [lvm_log_high], 0
+
+    LVM_SetDriveLetter_is_not_pri:
+
+        ;
+        ; At this stage the LVM-info sector has been loaded at [LVMSector].
+        ; From here we look for an LVM entry for the partition.
+        ; If one is found, based on it's LBA-start, it's driveletter is used
+        ; in case byte 25h in the BPB is zero.
+        ;
+
+        ; Search for the partition in the LVM info.
+        ; If found, CY is set and SI points to LVM entry.
+        push    si
+        mov     ax,cx
+        mov     dx,bx
+        mov     si,offset [LVMSector]
+        call    LVM_SearchForPartition
+        mov     bx,si   ; BX now points to LVM entry
+        pop     si
+
+        mov     al,0    ; Setup null driveletter
+        ; Oops, no valid LVM record was used so we have a null driveletter.
+        jnc     LVM_SetDriveLetter_null_lvm_dl
+
+        ;
+        ; At this point BX points to the LVM-entry related to the
+        ; partition, whether it was a logical or a primary one.
+        ;
+        mov     al, [drive_letter]
+        mov     [bx+LocLVM_VolumeLetter],al
+
+        mov     si, offset [LVMSector]
+        call    LVM_UpdateSectorCRC
+
+        mov     dl, [disk]
+        mov     bx, [lvm_log_high]
+        mov     ax, [lvm_log_low]
+
+        call    DriveIO_SaveSector
+
+    LVM_SetDriveLetter_null_lvm_dl:
+        ret
+LVM_SetDriveLetter      EndP
+
+
+
+; Removes a given drive-letter from the whole LVM information sector
+;        In: CH    - drive-letter (ascii)
+;            DS:SI - LVM-Information-Sector
+;       Out: LVM-Information-Sector updated (including LVM CRC)
+; Destroyed: None
+LVM_RemoveVolLetterFromSector   Proc Near   Uses cx
+        cmp     bptr [si+LocLVM_SignatureStart], LocLVM_SignatureByte0
+        jne     LVMRVLFS_Done                 ; Quick Check, if LVM sector there
+        push    si
+        add     si, LocLVM_StartOfEntries
+        mov     cl, LocLVM_MaxEntries
+    LVMRVLFS_Loop:
+        cmp     ch, [si+LocLVM_VolumeLetter]
+        jne     LVMRVLFS_NextEntry
+        ; Reset drive-letter, if matched
+        mov     bptr [si+LocLVM_VolumeLetter], 0          ; ASSIGN NEXT FREE HERE...  (DOET DUBBEL ALS ZELFDE DL ALS SYS)
+    LVMRVLFS_NextEntry:
+        add     si, LocLVM_LenOfEntry
+        dec     cl
+        jnz     LVMRVLFS_Loop
+        pop     si
+        call    LVM_UpdateSectorCRC
+    LVMRVLFS_Done:
+        ret
+LVM_RemoveVolLetterFromSector   EndP
+
+; Reassigns LVM volume driveletter
+;  Will remove the drive-letter from any volume that got it currently
+;   and finally change the drive-letter of the given partition
+;        In: AL    - drive-letter
+;            DS:SI - points to partition, that needs that driveletter
+;       Out: None
+; Destroyed: AX
+
+LVM_DoLetterReassignment        Proc Near   Uses bx cx dx si di
+
+    IFDEF   AUX_DEBUG
+        pusha
+        mov     si, offset dlra
+        call    AuxIO_Print
+        call    AuxIO_Teletype
+        call    AuxIO_TeletypeNL
+        popa
+    ENDIF
+
+        mov     di, si              ; Save SI in DI (Partition-pointer)
+        mov     ch, al              ; and AL in CH (drive-letter)
+        xor     bx, bx
+        mov     cl, CFG_Partitions
+        or      cl, cl
+        jz      LVMDLR_SkipRemove
+
+    LVMDLR_RemoveLoop:
+        cmp     bptr [PartitionVolumeLetters+bx], ch
+        jne     LVMDLR_NextPartition
+        ; One volume that has our wanted drive-letter, so remove it!
+        mov     dl, bl
+        call    PART_GetPartitionPointer   ; DL - partition -> SI
+        ; Now set CurPartition_Location for the DriveIO-functions to work
+        mov     ax, wptr [si+LocIPT_AbsolutePartTable]
+        mov     wptr [CurPartition_Location+0], ax
+        mov     ax, wptr [si+LocIPT_AbsolutePartTable+2]
+        mov     wptr [CurPartition_Location+2], ax
+        mov     ax, wptr [si+LocIPT_LocationPartTable+1]
+        mov     wptr [CurPartition_Location+6], ax
+        mov     ah, bptr [si+LocIPT_LocationPartTable+0]
+        mov     al, [si+LocIPT_Drive]
+        mov     wptr [CurPartition_Location+4], ax
+        call    DriveIO_LoadLVMSector      ; SI points now to LVM-Sector
+        call    LVM_RemoveVolLetterFromSector
+
+    IFDEF ReleaseCode
+        call    DriveIO_SaveLVMSector   ; Save sector
+    ENDIF
+    LVMDLR_NextPartition:
+        inc     bx
+        dec     cl
+        jnz     LVMDLR_RemoveLoop
+
+    LVMDLR_SkipRemove:
+        ; Set CurPartition_Location information of destination partition
+        mov     ax, wptr [di+LocIPT_AbsolutePartTable]
+        mov     wptr [CurPartition_Location+0], ax
+        mov     ax, wptr [di+LocIPT_AbsolutePartTable+2]
+        mov     wptr [CurPartition_Location+2], ax
+        mov     ah, bptr [di+LocIPT_LocationPartTable+0]
+        mov     al, [di+LocIPT_Drive]
+        mov     wptr [CurPartition_Location+4], ax
+        mov     ax, wptr [di+LocIPT_LocationPartTable+1]
+        mov     wptr [CurPartition_Location+6], ax
+        call    DriveIO_LoadLVMSector         ; SI points now to LVM-Sector
+        mov     ax, wptr [di+LocIPT_AbsoluteBegin]
+        mov     dx, wptr [di+LocIPT_AbsoluteBegin+2]
+        mov     di, si                        ; Save SI in DI
+        call    LVM_SearchForPartition
+        jnc     LVMDLR_DestPartNotFound
+        ; Set new volume letter
+        mov     bptr [si+LocLVM_VolumeLetter], ch
+        mov     si, di                        ; SI - LVM Sector again
+        call    LVM_UpdateSectorCRC           ; Update LVM-CRC now
+
+    IFDEF ReleaseCode
+        call    DriveIO_SaveLVMSector      ; Save sector
+    ENDIF
+
+    LVMDLR_DestPartNotFound:
+        ; This here is done for safety, because we misuse CurPartition_Location
+        xor     ax, ax
+        mov     di, offset CurPartition_Location
+        mov     cx, 4
+        rep     stosw                         ; NUL out CurPartition_Location
+        ret
+LVM_DoLetterReassignment        EndP
+
+
+; This walks the IPT and for each partition it obtains the LVM drive-letter
+; if available. This drive-letter is then marked as in-use in the Map.
+; The FreeDriveletterMap is used by the drive-letter reassignment function
+; to assign a new drive to a data-partition when a system-partition is booted
+; with the same drive-letter. The original drive-letter for the data-partition
+; is saved so it can be restored later when a system is booted that does not
+; use the drive-letter. Note that there can be multiple system-partitions
+; using the same drive-letter and data-partitions can become system-partition
+; by making them bootable. (and vice versa)
+LVM_ComposeFreeDriveletterMap   Proc
+
+; get nr of partitions in IPT
+; for each partition get LVM drive-letter and reset bit in map.
+
+LVM_ComposeFreeDriveletterMap   EndP
+
Index: trunk/bootcode/special/sound.asm
===================================================================
--- trunk/bootcode/special/sound.asm	(revision 57)
+++ trunk/bootcode/special/sound.asm	(revision 57)
@@ -0,0 +1,131 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                  AiR-BOOT / SOUND SUPPORT
+;---------------------------------------------------------------------------
+
+IFDEF   MODULE_NAMES
+DB 'SOUND',0
+ENDIF
+
+; Here is some sound code. Requested by Hex1753.
+
+SOUND_PreBootMenu              Proc Near  Uses ax
+   test    byte ptr [CFG_MakeSound], 1
+   jz      SOUND_PreBootMenu_SkipSound
+   test    byte ptr [StartSoundPlayed], 1
+   jnz     SOUND_PreBootMenu_SkipSound
+   mov     ax, 1500
+   call    SOUND_MakeSound
+   mov     ax, 100
+   call    SOUND_WaitToSilence
+   mov     ax, 2000
+   call    SOUND_MakeSound
+   mov     ax, 200
+   call    SOUND_WaitToSilence
+   mov     byte ptr [StartSoundPlayed], 1
+  SOUND_PreBootMenu_SkipSound:
+   ret
+SOUND_PreBootMenu              EndP
+
+SOUND_ExecuteBoot              Proc Near  Uses ax
+   test    byte ptr [CFG_MakeSound], 1
+   jz      SOUND_ExecuteBoot_SkipSound
+   mov     ax, 2000
+   call    SOUND_MakeSound
+   mov     ax, 10
+   call    SOUND_WaitToSilence
+   mov     ax, 1000
+   call    SOUND_MakeSound
+   mov     ax, 20
+   call    SOUND_WaitToSilence
+   mov     ax, 1500
+   call    SOUND_MakeSound
+   mov     ax, 10
+   call    SOUND_WaitToSilence
+   mov     ax, 1900
+   call    SOUND_MakeSound
+   mov     ax, 20
+   call    SOUND_WaitToSilence
+   mov     ax, 1000
+   call    SOUND_MakeSound
+   mov     ax, 10
+   call    SOUND_WaitToSilence
+   mov     ax, 1500
+   call    SOUND_MakeSound
+   mov     ax, 30
+   call    SOUND_WaitToSilence
+  SOUND_ExecuteBoot_SkipSound:
+   ret
+SOUND_ExecuteBoot              EndP
+
+SOUND_MakeSound                Proc Near  Uses bx dx
+   mov    bx, ax
+   mov    ax, 34DDh
+   mov    dx, 0012h
+   cmp    dx, bx                         ; Too small frequency
+   jnb    SOUND_MakeSound_J1
+   div    bx
+   mov    bx, ax
+   in     al, 61h
+   test   al, 03h                        ; Already playing (?)
+   jnz    SOUND_MakeSound_J2
+   or     al, 03h
+   out    61h, al
+   mov    al, -4Ah
+   out    43h, al
+  SOUND_MakeSound_J2:
+   mov    al, bl
+   out    42h, al
+   mov    al, bh
+   out    42h, al
+  SOUND_MakeSound_J1:
+   ret
+SOUND_MakeSound                EndP
+
+SOUND_WaitToSilence            Proc Near  Uses bx cx dx
+   ; AX = MilliSeconds
+   mov    bx, 03E8h
+   mul    bx
+   mov    cx, dx
+   mov    dx, ax
+   mov    ax, 8600h
+   int    15h
+   in     al, 61h
+   and    al, 0FCh
+   out    61h, al
+   ret
+SOUND_WaitToSilence            EndP
+
+
+
+; Rousseau: added
+SOUND_Beep                     PROC Near
+   pushf
+   pusha
+
+   mov      al, 7
+   mov      bh, 0
+   mov      bl, 7
+   mov      ah, 0eh
+   int      10h
+
+   popa
+   popf
+   ret
+SOUND_Beep                     ENDP
Index: trunk/bootcode/special/virus.asm
===================================================================
--- trunk/bootcode/special/virus.asm	(revision 57)
+++ trunk/bootcode/special/virus.asm	(revision 57)
@@ -0,0 +1,228 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                                AiR-BOOT / VIRUS DETECTION
+;---------------------------------------------------------------------------
+
+; Checks system for stealth-virus...if any is found, MBR will get restored and
+; system will get halted. On Non-Real-Mode this will only save Interrupt Vectors.
+; Segment Registers preserved
+
+IFDEF   MODULE_NAMES
+DB 'VIRUS',0
+ENDIF
+
+VIRUS_CheckForStealth      Proc Near  Uses ds si es di
+   xor     al, al
+   mov     cx, 4
+   mov     di, offset CFG_VIR_INT08
+   push    di
+      repe     scasb
+   pop     di
+   jne     VCFS_AlreadyInitiated
+
+  VCFS_InitNow:
+   xor     ax, ax
+   mov     ds, ax
+   mov     ax, cs
+   mov     es, ax
+   mov     cx, 2
+   mov     si, 08h*4
+   rep     movsw                         ; INT 08 Ptr
+   mov     cl, 2
+   mov     si, 13h*4
+   rep     movsw                         ; INT 13 Ptr
+   mov     cl, 2
+   mov     si, 1Ch*4
+   rep     movsw                         ; INT 1C Ptr
+   IFDEF ReleaseCode
+      call    DriveIO_SaveConfiguration
+   ENDIF
+   jmp     VCFS_Finished
+
+  VCFS_AlreadyInitiated:
+   xor     ax, ax
+   mov     es, ax
+   xor     si, si
+   mov     ax, word ptr es:[si+08h*4]
+   mov     dx, word ptr es:[si+08h*4+2]
+   cmp     ax, word ptr ds:[di+0]
+   jne     VCFS_Found
+   cmp     dx, word ptr ds:[di+2]
+   jne     VCFS_Found
+   mov     ax, word ptr es:[si+13h*4]
+   mov     dx, word ptr es:[si+13h*4+2]
+   cmp     ax, word ptr ds:[di+4]
+   jne     VCFS_Found
+   cmp     dx, word ptr ds:[di+6]
+   jne     VCFS_Found
+   mov     ax, word ptr es:[si+1Ch*4]
+   mov     dx, word ptr es:[si+1Ch*4+2]
+   cmp     ax, word ptr ds:[di+8]
+   jne     VCFS_Found
+   cmp     dx, word ptr ds:[di+10]
+   jne     VCFS_Found
+
+  VCFS_Finished:
+   ret
+
+  VCFS_Found:
+   ; New ROM-Proof Logic:
+   ;  Mismatching vector found, so try to write to that location. If it doesn't
+   ;  succeed, ROM will be assumed (so valid change), a message will get
+   ;  displayed and new vectors will be saved. Otherwise Virus found.
+   mov     es, dx
+   mov     bx, ax
+   mov     al, bptr es:[bx]              ; Get Byte from Interrupt Vector
+   mov     ah, al
+   xor     al, 0FFh
+   mov     bptr es:[bx], al              ; Try to write there...
+   mov     al, bptr es:[bx]              ; Get back...
+   mov     bptr es:[bx], ah              ; And restore to original byte...
+   cmp     al, ah
+   jne     VCFS_WhewThisIsOne            ; Mismatch ? -> Virus found
+   mov     si, offset TXT_BIOSchanged
+   call    MBR_Teletype
+   xor     ah, ah
+   int     16h                           ; Waits for any keystroke
+   jmp     VCFS_InitNow
+
+  VCFS_WhewThisIsOne:
+   call    VIRUS_TryRestore
+
+   ; Code should no reach this since we halt the system in VIRUS_TryRestore.
+   ret
+VIRUS_CheckForStealth           EndP
+
+;
+; This procedure is created to avoid jumping to labels that are local to
+; procedures. JWasm does not allow that.
+; Should be fixed better later.
+;
+VIRUS_TryRestore    Proc Near
+        mov     si, offset TXT_VirusFoundMain
+        call    MBR_Teletype
+        ; Now check BackUp MBR for validation (AiRBOOT signature), do this
+        ; using direct-calls to original bios handler.
+        call    ANTIVIR_RestoreMBR
+        jnc     VIRUS_TryRestore_ValidRestore
+
+        mov     si, offset TXT_VirusFound1damn
+        call    MBR_Teletype
+        call    MBR_Teletype                  ; VirusFound1any
+        mov     si, offset TXT_VirusFoundEnd
+        call    MBR_Teletype
+        jmp     MBR_HaltSystem
+
+    VIRUS_TryRestore_ValidRestore:
+        mov     si, offset TXT_VirusFound1ok
+        call    MBR_Teletype
+        mov     si, offset TXT_VirusFound1any
+        call    MBR_Teletype
+        mov     si, offset TXT_VirusFoundEnd
+        call    MBR_Teletype
+        jmp     MBR_HaltSystem
+
+        ; Code should not reach this since we halt the system.
+VIRUS_TryRestore    Endp
+
+
+; Checks system for normal-MBR-virus... (done by comparing current MBR with
+; memory image). Note: We will only compare the first 446 bytes.
+; if one is found, MBR will get restored and system will get halted.
+; Segment Registers preserved
+VIRUS_CheckForVirus             Proc Near  Uses ds si es di
+   push    cs
+   push    cs
+   pop     ds
+   pop     es
+   mov     bx, offset TmpSector
+   mov     dx, 0080h
+   mov     cx, 0001h  ; Harddisc 0, Sector 1
+   mov     ax, 0201h
+   int     13h
+   jnc     VCFV_MBRloaded
+   ret
+ VCFV_MBRloaded:
+   mov     si, BootBasePtr
+   mov     di, offset TmpSector
+   mov     cx, 223                       ; Compare 446 bytes
+   repz    cmpsw                         ; if fail: Cross call to Stealth-Virus
+   ;jne     VCFS_WhewThisIsOne
+   je      VIRUS_CheckForVirus_end
+   call    VIRUS_TryRestore
+  VIRUS_CheckForVirus_end:
+   ret
+VIRUS_CheckForVirus             EndP
+
+; ============================================================================
+;      ANTI-VIRUS-CODE
+; ============================================================================
+
+; Saves a backup of the current MBR to harddisc (used before booting)
+ANTIVIR_SaveBackUpMBR           Proc Near  Uses ax bx cx dx es
+   push    cs
+   pop     es
+   mov     bx, BootBasePtr
+   mov     dx, 0080h
+   ;mov     cx, 003Ch                     ; First Harddrive, Sector 60
+   mov     cx, image_size / sector_size  ; Harddisc 0, Sector 60 (or 62 for extended version)
+   mov     ax, 0301h                     ; Write 1 Sector
+   int     13h
+   ret
+ANTIVIR_SaveBackUpMBR           EndP
+
+; Will report Carry-Clear, if BackUp MBR is valid (supposingly)
+ANTIVIR_CheckBackUpMBR          Proc Near
+   push    cs
+   push    cs
+   pop     es
+   pop     ds
+   mov     bx, offset TmpSector
+   mov     dx, 0080h
+   ;mov     cx, 003Ch                     ; Harddisc 0, Sector 60
+   mov     cx, image_size / sector_size  ; Harddisc 0, Sector 60 (or 62 for extended version)
+   mov     ax, 0201h                     ; Load 1 Sector
+   pushf
+   call    dword ptr cs:[CFG_VIR_INT13]  ; Get Sector 60 directly (w/o INT 13h)
+   jc      ACBUMBR_Failed
+   mov     cx, 7
+   mov     di, offset TmpSector
+   add     di, 2                         ; Position for "AiRBOOT" normally
+   mov     si, offset CheckID_MBR
+   repz    cmpsb
+   stc
+   jne     ACBUMBR_Failed
+   clc
+  ACBUMBR_Failed:
+   ret
+ANTIVIR_CheckBackUpMBR          EndP
+
+ANTIVIR_RestoreMBR              Proc Near
+   call    ANTIVIR_CheckBackUpMBR
+   jnc     ARMBR_DoIt
+   ret
+  ARMBR_DoIt:
+   mov     bx, offset TmpSector
+   mov     dx, 0080h
+   mov     cx, 0001h                     ; Harddisc 0, Sector 1
+   mov     ax, 0301h                     ; Write 1 Sector
+   pushf
+   call    dword ptr cs:[CFG_VIR_INT13]  ; Writes to Sector 1 directly
+   ret
+ANTIVIR_RestoreMBR              EndP
Index: trunk/bootcode/text/charset.asm
===================================================================
--- trunk/bootcode/text/charset.asm	(revision 57)
+++ trunk/bootcode/text/charset.asm	(revision 57)
@@ -0,0 +1,62 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                               AiR-BOOT / CYRILLIC CHARSET
+;---------------------------------------------------------------------------
+
+ifdef TXT_IncludeCyrillic
+   ; Compressed Cyrillic 866 16x9 charset (1 counter-byte, followed by data)
+  CHARSET_Cyrillic:
+   dw 010A2h, 06C38h, 0C6C6h, 0C6FEh, 0C6C6h, 0A6C6h, 0C4FCh, 0C0C0h, 0C6FCh
+   dw 0C6C6h, 0FCC6h, 0FCA6h, 0C6C6h, 0F8CCh, 0C6CCh, 0C6C6h, 0A6FCh, 0C2FEh
+   dw 0C0C0h, 0C0C0h, 0C0C0h, 0C0C0h, 03EB6h, 03636h, 03636h, 06636h, 06666h
+   dw 0C3FFh, 0FEA5h, 0C0C2h, 0F8C0h, 0C0C0h, 0C2C0h, 0A6FEh, 0D6D6h, 05454h
+   dw 0547Ch, 05454h, 0D6D6h, 07CA6h, 086C6h, 03C06h, 00606h, 0C686h, 0A67Ch
+   dw 0CEC6h, 0FEDEh, 0E6F6h, 0C6C6h, 0C6C6h, 06CC4h, 0C638h, 0DECEh, 0F6FEh
+   dw 0C6E6h, 0C6C6h, 0A6C6h, 0C6C6h, 0D8CCh, 0F0F0h, 0CCD8h, 0C6C6h, 07EA6h
+   dw 06666h, 06666h, 06666h, 0C666h, 0A6C6h, 0EEC6h, 0FEFEh, 0C6D6h, 0C6C6h
+   dw 0C6C6h, 0C6A6h, 0C6C6h, 0FEC6h, 0C6C6h, 0C6C6h, 0A6C6h, 0C67Ch, 0C6C6h
+   dw 0C6C6h, 0C6C6h, 07CC6h, 0FEA6h, 0C6C6h, 0C6C6h, 0C6C6h, 0C6C6h, 0A6C6h
+   dw 0C6FCh, 0C6C6h, 0FCC6h, 0C0C0h, 0C0C0h, 03CA6h, 0C266h, 0C0C0h, 0C0C0h
+   dw 066C2h, 0A63Ch, 05A7Eh, 01818h, 01818h, 01818h, 01818h, 0C6A6h, 0C6C6h
+   dw 06EC6h, 0383Ch, 0E070h, 0A6C0h, 01038h, 0D67Ch, 09292h, 07CD6h, 03810h
+   dw 0C6A6h, 06CC6h, 0387Ch, 07C38h, 0C66Ch, 0C6C6h, 0CCCCh, 0CCCCh, 0CCCCh
+   dw 0CCCCh, 0FCCCh, 00606h, 0C6A4h, 0C6C6h, 0C6C6h, 006FEh, 00606h, 0A606h
+   dw 0D6D6h, 0D6D6h, 0D6D6h, 0D6D6h, 0FED6h, 0D6C6h, 0D6D6h, 0D6D6h, 0D6D6h
+   dw 0D6D6h, 006FEh, 0A406h, 0B0F0h, 03CB0h, 0333Eh, 03333h, 03C3Eh, 0C3A6h
+   dw 0C3C3h, 0FBF3h, 0CBCBh, 0FBCBh, 0A6F3h, 06060h, 07860h, 0667Ch, 06666h
+   dw 0787Ch, 078A6h, 086CCh, 03E06h, 00606h, 0CC86h, 0A678h, 0DFCEh, 0DBDBh
+   dw 0FBFBh, 0DBDBh, 0CEDFh, 03EA6h, 0C666h, 03E66h, 06636h, 0C666h, 079C6h
+   dw 0063Ch, 0663Eh, 06666h, 0A63Ah, 07C04h, 0F8C0h, 0CCCCh, 0CCCCh, 078CCh
+   dw 07C79h, 06666h, 0667Ch, 07C66h, 07E79h, 06062h, 06060h, 06060h, 03C89h
+   dw 02C2Ch, 04C6Ch, 07C4Ch, 078C6h, 0663Ch, 07E66h, 06660h, 0793Ch, 054D6h
+   dw 0387Ch, 0547Ch, 079D6h, 0C67Ch, 03C06h, 0C606h, 0797Ch, 0CEC6h, 0F6DEh
+   dw 0C6E6h, 0A6C6h, 03828h, 0C610h, 0DECEh, 0E6F6h, 0C6C6h, 06679h, 0786Ch
+   dw 06C78h, 06666h, 03E79h, 03636h, 03636h, 06676h, 0C679h, 0FEEEh, 0C6D6h
+   dw 0C6C6h, 06679h, 06666h, 0667Eh, 06666h, 03C79h, 06666h, 06666h, 03C66h
+   dw 07E79h, 06666h, 06666h, 06666h, 09504h
+   db 07Ch
+   dw 06666h, 06666h, 0607Ch, 06060h, 03E77h, 06062h, 06060h, 03E62h, 07E79h
+   dw 01818h, 01818h, 01818h, 06699h, 06666h, 03E66h, 0181Ch, 06070h, 03886h
+   dw 07C10h, 0D6D6h, 0107Ch, 07938h, 06CC6h, 03838h, 06C38h, 099C6h, 0CCCCh
+   dw 0CCCCh, 0CCCCh, 006FEh, 07706h, 0C6C6h, 0C6C6h, 006FEh, 07906h, 0D6D6h
+   dw 0D6D6h, 0D6D6h, 099FEh, 0D6D6h, 0D6D6h, 0D6D6h, 006FEh, 07706h, 0B0F0h
+   dw 03CB0h, 03636h, 0793Ch, 0C6C6h, 0F6C6h, 0D6D6h, 079F6h, 06060h, 07860h
+   dw 06C6Ch, 07978h, 0663Ch, 00E06h, 06606h, 0793Ch, 0D6CCh, 0F6D6h, 0D6D6h
+   dw 079CCh, 0663Eh, 03E66h, 06636h, 00466h
+endif
Index: trunk/bootcode/text/de/mbr.asm
===================================================================
--- trunk/bootcode/text/de/mbr.asm	(revision 57)
+++ trunk/bootcode/text/de/mbr.asm	(revision 57)
@@ -0,0 +1,32 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                          AiR-BOOT / MBR-TEXT
+; v001 - German - by Martin Kiewitz
+;------------------------------------------------------------------------------
+
+TXT_LanguageID                equ 'G'
+
+; Those strings are saved within MBR.
+; Total Length maximum 165 chars (include 13,10 (CRs), excluding ending Zeros)
+
+TXT_ERROR_Attention            db 'AiR-BOOT: !ACHTUNG!', 13, 10, 0
+TXT_ERROR_CheckCode            db ' - AiR-BOOT''s Code', 0
+TXT_ERROR_CheckFailed          db ' ist nicht mehr intakt.', 13, 10
+                               db '   Booten Sie via AiR-BOOT Diskette.', 13, 10
+                               db '   System angehalten. Bitte drcken Sie RESET.', 0
Index: trunk/bootcode/text/de/menus.asm
===================================================================
--- trunk/bootcode/text/de/menus.asm	(revision 57)
+++ trunk/bootcode/text/de/menus.asm	(revision 57)
@@ -0,0 +1,368 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                          AiR-BOOT SETUP / ALL SETUP MENUS
+; v001 - German - by Martin Kiewitz
+;---------------------------------------------------------------------------
+
+; Main Setup - Items - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUP_PartitionSetup       db 'PARTITIONS SETUP', 0
+TXT_SETUP_BasicOptions         db 'STANDARD OPTIONEN', 0
+TXT_SETUP_AdvOptions           db 'ERWEITERTE OPTIONEN', 0
+TXT_SETUP_ExtOptions           db 'SPEZIAL OPTIONEN', 0
+TXT_SETUP_DefMasterPwd         db 'HAUPT PASSWORT DEFINIEREN', 0
+TXT_SETUP_DefBootPwd           db 'BOOT PASSWORT DEFINIEREN', 0
+TXT_SETUP_SaveAndExit          db 'SPEICHERN & VERLASSEN', 0
+TXT_SETUP_JustExit             db 'VERLASSEN OHNE ZU SPEICHERN', 0
+
+; The Letters for all flags in Partition Setup
+TXT_SETUP_FlagLetterBootable   equ 'B'
+TXT_SETUP_FlagLetterVIBR       equ 'V'
+TXT_SETUP_FlagLetterHide       equ 'H'
+TXT_SETUP_FlagLetterDrvLetter  equ 'L'
+TXT_SETUP_FlagLetterExtMShack  equ 'P'
+
+TXT_SETUP_LetterYes            equ 'J'
+TXT_SETUP_LetterYes2           equ 'J'
+TXT_SETUP_LetterNo             equ 'N'
+
+; Basic Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_DefaultSelection     db 'Standard Selektion', 0
+TXT_SETUP_TimedBoot            db 'Zeitgesteuerter Boot', 0
+TXT_SETUP_TimedBootDelay       db '-> Anzahl Sekunden', 0
+TXT_SETUP_TimedKeyHandling     db '-> Tastenaktion', 0
+TXT_SETUP_BootLastIfTimed      db '-> Letzten wiederholen', 0
+TXT_SETUP_RememberLastBoot     db 'Boot-Partition merken', 0
+TXT_SETUP_RememberTimedBoot    db 'Zeit-Boot-Part. merken', 0
+TXT_SETUP_IncludeFloppy        db 'Disk-LW hinzufgen', 0
+TXT_SETUP_ShowLVMDriveLetters  db 'Show LVM Drive Letters',0
+TXT_SETUP_MbrProtection        db 'MBR Schutz', 0
+TXT_SETUP_IgnoreMbrWrites      db '-> Ignoriere Schreiben', 0
+TXT_SETUP_MakeSounds           db 'Gerusche machen', 0
+TXT_SETUP_CooperBars           db 'Cooper Bars', 0
+
+; Advanced Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_BootMenu             db 'Boot Men', 0
+TXT_SETUP_PartAutoDetect       db 'Partition Autodetect', 0
+TXT_SETUP_SecurityOptions      db '-> Sicherheit <-', 0
+TXT_SETUP_PasswordedSetup      db 'Setup Passwort', 0
+TXT_SETUP_PasswordedSystem     db 'System Passwort', 0
+TXT_SETUP_PasswordedChangeBoot db 'Boot Passwort', 0
+TXT_SETUP_GetFloppyName        db 'Lese Diskettennamen', 0
+TXT_SETUP_GetFloppyName2Sec    db '-> ...alle 2 Sekunden', 0
+TXT_SETUP_VirusDetect          db 'Virus Erkennung', 0
+TXT_SETUP_StealthDetect        db 'Stealth Erkennung', 0
+TXT_SETUP_VIBRdetect           db 'VIBR Erkennung', 0
+TXT_SETUP_ContinueBIOSboot     db 'BIOS Boot fortsetzen', 0
+
+; Extended Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+; [Linux support removed since v1.02]
+;TXT_SETUP_LinuxKernelPart      db 'Linux Kernel Partition', 0
+;TXT_SETUP_LinuxDefaultKernel   db 'Linux Default Kernel', 0
+;TXT_SETUP_LinuxRootPart        db 'Linux Root Partition', 0
+; This here may be larger than 23 chars...
+;TXT_SETUP_DefLinuxCmd          db 'DEFINIERE LINUX KOMMANDOZEILE', 0
+TXT_SETUP_IgnoreLVM            db 'Ignoriere LVM Daten', 0
+;~ TXT_SETUP_ForceLBAUsage        db 'Erzwinge BIOS-LBA', 0
+TXT_SETUP_ExtPartMShack        db 'Erw-Part MS Workaround', 0
+
+; DYNAMIC LENGTH, maximum 11 chars excluding ending zero
+;----------------------------------|---------|------------------------------
+TXT_SETUP_MAGIC_Enabled        db 'Aktiv', 0
+TXT_SETUP_MAGIC_Disabled       db 'Inaktiv', 0
+TXT_SETUP_MAGIC_Detailed       db 'Detailiert', 0
+TXT_SETUP_MAGIC_NoBootable     db 'Nix Bootbar', 0
+; [Linux support removed since v1.02]
+;TXT_SETUP_MAGIC_NoLinux        db 'Kein Linux', 0
+TXT_SETUP_MAGIC_DoNothing      db 'Nichts', 0
+TXT_SETUP_MAGIC_ResetTime      db 'Zeit Reset', 0
+TXT_SETUP_MAGIC_StopTime       db 'Zeit Stop', 0
+TXT_SETUP_MAGIC_CDROM          db 'CD-ROM', 0
+TXT_SETUP_MAGIC_Network        db 'Netzwerk', 0
+TXT_SETUP_MAGIC_ZIPLS          db 'ZIP/LS120', 0
+; Max Length: 10 (used in Hide-Configuration as well)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Hidden         db 'Versteckt', 0
+TXT_SETUP_MAGIC_Unhidden       db 'Sichtbar', 0
+; Max Length: 10 ("C:" will be appended afterwards)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Set            db 'setze ', 0
+
+; Setup Control Help - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUPHELP_Main             db 24,32,25,32,26,32,27,' : Aktion Auswhlen', 0
+                               db               'Enter   : Aktion Besttigen', 0
+                               db               'F10 : Speichern&Beenden', 0
+                               db               'Esc : Beenden', 0
+
+TXT_SETUPHELP_SubMenu          db 24,32,25,32,26,32,27,' : Option Auswhlen', 0
+                               db               'Bild ',24,25,' : Option ndern', 0
+                               db               'F1  : Zeige Hilfe ber Option', 0
+                               db               'Esc : Zurck ins Hauptmen', 0
+
+TXT_SETUPHELP_PartSetup        db 24,32,25,32,26,32,27,' : Partition Auswhlen', 0
+                               db               'Enter   : Label editieren', 0
+                               db               'F1  : Optionen', 0
+                               db               'Esc : Zurck ins Hauptmen', 0
+
+; HELP FOR EVERY MENU-ITEM, Maximum Length = 22 chars PER line. Maximum 5 lines
+
+                                  ;1234567890123456789012
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_PartitionSetup   db 'Partionen als Bootbar', 0
+                               db 'definieren, Namen', 0
+                               db 'ndern und einiges', 0
+                               db 'mehr.', 0
+                               db 0
+TXT_SETUPHELP_BasicOptions     db 'Diese Optionen sind', 0
+                               db 'fr unerfahrene User.', 0
+                               db 0
+TXT_SETUPHELP_AdvOptions       db 'Diese Optionen sind', 0
+                               db 'fr erfahrene User.', 0
+                               db 'Verndern Sie nichts,', 0
+                               db 'falls Sie nicht wissen', 0
+                               db 'was es bedeutet.', 0
+                               db 0
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_ExtOptions       db 'Spezial Optionen fr', 0
+                               db 'bestimmte Betriebs-', 0
+                               db 'system.', 0
+                               db 0
+TXT_SETUPHELP_DefMasterPwd     db 'Definiert ein Passwort', 0
+                               db 'fr Setup und System.', 0
+                               db 0
+TXT_SETUPHELP_DefBootPwd       db 'Definiert ein Passwort', 0
+                               db 'frs Booten.', 0
+                               db 0
+TXT_SETUPHELP_SaveAndExit      db 'Mit dem Boot-Prozess', 0
+                               db 'fortfahren und die', 0
+                               db 'Optionen speichern.', 0
+                               db 0
+TXT_SETUPHELP_JustExit         db 'Mit dem Boot-Prozess', 0
+                               db 'fortfahren und die', 0
+                               db 'nderungen verwerfen.', 0
+                               db 0
+
+TXT_SETUPHELP_InPartitionSetup db 'B - Bootbar', 0
+                               db 'V - VIBR-Detection', 0
+                               db 'H - Hide Support', 0
+                               db 'L - Laufwerksbuchstabe', 0
+                               db 'P - Erw-Part MS invent', 0
+                               db 0
+
+TXT_SETUPHELP_HideSetup        db 'Status whlen, indem', 0
+                               db 'sich die Partitionen', 0
+                               db 'befinden sollen, wenn', 0
+                               db 'die ausgewhlte', 0
+                               db 'Partition geladen wird', 0
+                               db 0
+
+; Basic Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_DefaultSelection db 'ndert die Standard', 0
+                               db 'Selektion. Wird u.a.', 0
+                               db 'beim zeitgesteuerten', 0
+                               db 'Boot verwendet.', 0
+                               db 0
+TXT_SETUPHELP_TimedBoot        db 'Automatisiertes Booten', 0
+                               db 'nach einer bestimmten', 0
+                               db 'Verzgerung.', 0
+                               db 0
+TXT_SETUPHELP_TimedBootDelay   db 'Die Verzgerungsdauer.', 0
+                               db 0
+TXT_SETUPHELP_TimedKeyHandling db 'Was soll mit der Zeit', 0
+                               db 'passieren, sobald eine', 0
+                               db 'Taste im Bootmen', 0
+                               db 'gedrckt wird ?', 0
+                               db 0
+TXT_SETUPHELP_BootLastIfTimed  db 'Soll automatisiertes', 0
+                               db 'Booten den letzten', 0
+                               db 'Boot wiederholen oder', 0
+                               db 'die Default Partition', 0
+                               db 'laden ?', 0
+                               db 0
+TXT_SETUPHELP_RememberLastBoot db 'Soll sich AiR-BOOT den', 0
+                               db 'letzten manuellen', 0
+                               db 'Boot merken ?', 0
+                               db 0
+TXT_SETUPHELP_RememberTimeBoot db 'Soll sich AiR-BOOT den', 0
+                               db 'letzten automatischen', 0
+                               db 'Boot merken ?', 0
+                               db 0
+TXT_SETUPHELP_IncludeFloppy    db 'AiR-BOOT erlaubt das', 0
+                               db 'Booten von Laufwerk A:', 0
+                               db 0
+TXT_SETUPHELP_ShowLVMDriveLetters   db 'AiR-BOOT will show', 0
+                                    db 'LVM Drive Letters', 0
+                                    db 'in the menu.', 0
+                                    db 0
+TXT_SETUPHELP_MbrProtection    db 'Beschtzt Ihren MBR', 0
+                               db 'durch residenten Code.', 0
+                               db 'Bentigt 1 KByte.', 0
+                               db 'Kann inkompatibel zu', 0
+                               db 'manchen OSen sein.', 0
+                               db 0
+TXT_SETUPHELP_IgnoreMbrWrites  db 'MBR Schutz ignoriert', 0
+                               db 'hiermit alle Schreib-', 0
+                               db 'Befehle und hlt das', 0
+                               db 'System nicht an.', 0
+                               db 0
+TXT_SETUPHELP_MakeSounds       db 'Hiermit macht AiR-BOOT', 0
+                               db 'Gerusche mit dem', 0
+                               db 'internen Lautsprecher.', 0
+                               db 0
+TXT_SETUPHELP_CooperBars       db 'Hiermit wird ein GFX', 0
+                               db 'Effekt beim Booten', 0
+                               db 'angezeigt.', 0
+                               db 0
+
+; Advanced Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_BootMenu         db 'Ohne Bootmen wird', 0
+                               db 'direkt die Default', 0
+                               db 'Partition gebootet.', 0
+                               db 0
+TXT_SETUPHELP_PartAutoDetect   db 'Neue Partitionen', 0
+                               db 'werden hiermit als', 0
+                               db 'bootbar markiert.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSetup  db 'Das Setup wird hiermit', 0
+                               db 'passwortgeschtzt.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSystem db 'Das ganze System wird', 0
+                               db 'hiermit passwort-', 0
+                               db 'geschtzt.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedBoot   db 'Manuelles Booten wird', 0
+                               db 'hiermit passwort-', 0
+                               db 'geschtzt.', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName    db 'AiR-BOOT wird hiermit', 0
+                               db 'den Disketten-Namen', 0
+                               db 'einmal auslesen und', 0
+                               db 'anzeigen.', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName2Sec db 'Zustzlich wird der', 0
+                               db 'Disketten-Name alle', 0
+                               db '2 Sekunden ausgelesen.', 0
+                               db 0
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_VirusDetect      db 'Findet normale MBR-', 0
+                               db 'Viren.', 0
+                               db 0
+TXT_SETUPHELP_StealthDetect    db 'Findet Stealth MBR-', 0
+                               db 'Viren.', 0
+                               db 0
+TXT_SETUPHELP_VIBRdetect       db 'Findet VIBR-Viren.', 0
+                               db 'VIBR steht fr', 0
+                               db 'Virus-In-Boot-Record.', 0
+                               db 0
+TXT_SETUPHELP_ContinueBIOSboot db 'Zustzlicher Eintrag', 0
+                               db 'um via BIOS bestimmte', 0
+                               db 'weitere Medien zu', 0
+                               db 'booten.', 0
+                               db 0
+
+; Extended Options - Help
+;----------------------------------|--------------------|-------------------
+; [Linux support removed since v1.02]
+;TXT_SETUPHELP_LinuxKernelPart  db 'Definiert die FAT-16', 0
+;                               db 'Partition, die Linux', 0
+;                               db 'Kernels beinhaltet.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxDefaultKrnl db 'Definiert den Default', 0
+;                               db 'Kernel Namen.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxRootPart    db 'Definiert die Linux', 0
+;                               db 'Root Partition.', 0
+;                               db 0
+;TXT_SETUPHELP_DefLinuxCmd:     db 'Definiert die Linux', 0
+;                               db 'Kommandozeile.', 0
+;                               db 0
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_IgnoreLVM        db 'AiR-BOOT sucht in', 0
+                               db 'diesem Fall nicht nach', 0
+                               db 'LVM Informationen.', 0
+                               db 0
+;~ TXT_SETUPHELP_ForceLBAUsage    db 'Erzwingt Bentzung der', 0
+                               ;~ db 'BIOS LBA APIs anstatt', 0
+                               ;~ db 'gemischter Verwendung', 0
+                               ;~ db 'von CHS und LBA.', 0
+                               ;~ db 0
+TXT_SETUPHELP_ExtPartMShack    db 'Aktiviert dynamisches', 0
+                               db 'ndern des erweiterten', 0
+                               db 'Partitionstyp durch', 0
+                               db 'das P-Flag in Standard', 0
+                               db 'oder MS-Erfindung.', 0
+                               db 0
+
+; Maximum 26 chars (should not be reached)
+;----------------------------------|------------------------|---------------
+TXT_SETUPHELP_Base             db ' HILFE ', 0
+TXT_SETUPHELP_Enter            db '<ENTER>', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_PasswordOld          db 'Altes Passwort:', 0
+TXT_SETUP_PasswordDefine       db 'Definiere Passwort:', 0
+TXT_SETUP_PasswordVerify       db 'berprfe Passwort:', 0
+TXT_SETUP_PasswordIncorrect    db 'Altes Passwort inkorrekt, Sorry', 0
+TXT_SETUP_PasswordMismatch     db 'Nicht gleich, altes Passwort beibehalten', 0
+TXT_SETUP_PasswordDisabled     db 'Kein Passwort -> Schutz Deaktiviert', 0
+TXT_SETUP_PasswordMatched      db '** Neues Passwort Gesetzt **', 0
+
+; Maximum 60 chars (should not be reached anyway)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_SaveAndExitNow       db 'SPEICHERN & VERLASSEN', 0
+TXT_SETUP_QuitWithoutSaveNow   db 'VERLASSEN OHNE SPEICHERN', 0
+; Must be shorter than SaveAndExitNow / QuitWithoutSaveNow
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_AreYouSure1          db 'SIND SIE SICHER?', 0
+TXT_SETUP_AreYouSure2          db '(J/N)', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+; [Linux support removed since v1.02]
+;TXT_SETUP_EnterLinuxCmdLine    db 'Bitte geben Sie ihre Linux Kommandozeile ein:', 0
+;TXT_SETUP_NoLinuxInstalled     db 'Sie haben kein Linux installiert', 0
+TXT_SETUP_NoLDLpartition       db 'Diese Partition ist weder vom Typ HPFS/FAT16/JFS', 0
+
+; Maximum 34 chars (should not be reached)
+;----------------------------------|--------------------------------|-------
+TXT_SETUP_HideFeature          db 'Hide Funktion', 0
+;----------------------------------|---------------------|------------------
+TXT_SETUP_HideFeature2         db 'Status frs Booten von ', 0
+
+; Drive-Letter Menu Header - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUP_DriveLetter          db 'Laufwerksbuchstabe', 0
+
+; Drive-Letter Keys - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUPHELP_DriveLetter      db 'C-Z drcken', 0
+
+; Colors for special words hard-coded. Keep all 0s.
+;TXT_SETUP_LowerMessage         db 'Dieses Programm ist ',0,'kostenlos',0,' fr nicht-kommerzielle Bentzung.',0
+;                               db 'Sie drfen AiR-BOOT ',0,'NICHT',0,' in ',0,'-IRGENDEINER-',0,' Form vertreiben/bentzen,',0
+;                               db 'falls Sie Geld fr das jeweilige Produkt oder die Installation erhalten.',0
+;                               db 'Sofern Sie AiR-BOOT in ',0,'anderen Bereichen',0,' benutzen oder',0,0,0
+;                               db 'vorinstallieren',0,' mchten, kontaktieren Sie mich via: ',0,'kiewitz@netlabs.org',0,' !',0
Index: trunk/bootcode/text/de/other.asm
===================================================================
--- trunk/bootcode/text/de/other.asm	(revision 57)
+++ trunk/bootcode/text/de/other.asm	(revision 57)
@@ -0,0 +1,107 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                        AiR-BOOT / OTHER TEXT
+; v001 - German - by Martin Kiewitz
+;------------------------------------------------------------------------------
+
+TXT_TranslationBy              db 'German by Martin Kiewitz', 0
+
+; TopInfosX variables are used for Boot-Menu and Partition Setup
+
+; Maximum 2/10/11/6 chars
+;----------------------------------||---------------------------------------
+TXT_TopInfos_No                db 'Nr', 0
+TXT_TopInfos_Hd                db 'Hd', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_HdSize            db 'Hd/Gráe:', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_Label             db 'Name:', 0
+;----------------------------------|---------|------------------------------
+TXT_TopInfos_Type              db 'Typ:', 0
+;----------------------------------|----|-----------------------------------
+TXT_TopInfos_Flags             db 'Flags:', 0      ; <-- for Partition Setup
+
+; Will be added together to one line, maximum 76 chars
+TXT_TimedBootLine              db 'Zeitgesteuerter Boot aktiviert. System ldt '''
+TXT_TimedBootEntryName         db 12 dup (0) ; Space for Default-Entry-Name
+TXT_TimedBootLine2             db      ''' in ', 0
+TXT_TimedBootSeconds           db ' Sekunden. ', 0
+TXT_TimedBootSecond            db ' Sekunde. ', 0 ; if only one is left, ELiTE :]
+; Maximum 76 chars
+;----------------------------------|--------------------------------------------------------------------------|
+TXT_TimedBootDisabled          db 'Zeitgesteuerter Boot deaktiviert.', 0
+TXT_BootMenuHelpText1          db '[Esc] um Automatischen Boot an/auszuschalten, [Enter] um Auswahl zu booten', 0
+TXT_BootMenuHelpText2          db 'Mit den Pfeiltasten auswhlen oder [TAB] fr den BIOS POST Bildschirm.', 0
+; Maximum 30 chars
+;----------------------------------|----------------------------|
+TXT_BootMenuEnterSetup         db 'F10 um ins Setup zu gelangen', 0
+
+; Dynamic Length (till 80 chars)
+TXT_BrokenPartitionTable       db 13, 10, ' - Mindestens einer Ihrer Partitionseintrge ist ungltig oder Ihre Festplatte'
+                               db 13, 10, '   beinhaltet defekte Sektoren. System angehalten.', 0
+TXT_TooManyPartitions          db 13, 10, ' - Zuviele Partitionen gefunden. AiR-BOOT untersttzt maximal 45.', 0
+TXT_NoBootAble                 db 13, 10, ' - Keine bootbare Partition definiert. System angehalten.', 0
+TXT_BIOSchanged                db 13, 10, ' - BIOS HAT SICH VERNDERT. berprfen Sie ihr System auf Viren.'
+                               db 13, 10, '   Drcken Sie eine Taste um fortzufahren...', 0
+
+TXT_VirusFoundMain             db 13, 10, ' - !ACHTUNG! -> EIN VIRUS WURDE GEFUNDEN <- !ACHTUNG!', 13, 10, 0
+TXT_VirusFound1ok              db '    Er wurde zerstrt, es kann allerdings sein, daá Ihr System nicht mehr', 13, 10
+                               db '    hochfhrt. In diesem Fall booten Sie bitte von der AiR-BOOT Install-Disk.', 13, 10, 0
+TXT_VirusFound1damn            db '    Leider hat er das BackUp von AiR-BOOT zerstrt. Sie mssen mit der AiR-BOOT', 13, 10
+                               db '    Install-Diskette booten.', 13, 10, 0
+TXT_VirusFound1any             db '    Sicherheitshalber sollten Sie Ihre Festplatte auf Viren untersuchen.', 13, 10, 0
+TXT_VirusFound2                db '    Er ist im Boot-Record der Partition, die Sie gerade booten wollten.', 13, 10
+                               db '    Bentzen Sie einen Viren-Scanner. Es knnte sich auch um einen falschen', 13, 10
+                               db '    Alarm handeln. Sie knnen diese Fehlermeldung unterbinden, indem Sie ins', 13, 10
+                               db '    ''PARTITIONS SETUP'' gehen und VIBR-Erkennung aus und wieder anschalten.', 13, 10
+                               db '    Falls diese Meldung dann wieder erscheint, sollten Sie VIBR fr diese', 13, 10
+                               db '    Partition ausschaltet lassen.', 13, 10, 0
+TXT_VirusFoundEnd              db '    System angehalten. Bitte drcken Sie RESET.', 0
+TXT_HowEnterSetup              db 13, 10, ' - Drcken und halten Sie Strg/Ctrl oder Alt um ins AiR-BOOT SETUP zu gelangen.', 0
+
+TXT_BootingNow1                db 'Booten des Systems durch ', 0
+; DO NOT MODIFY HERE
+TXT_BootingNow2                db '''', 0
+TXT_BootingNowPartName         db 12 dup (0) ; Space for BootThisPart-Name
+; DO NOT MODIFY TILL HERE
+TXT_BootingNowPartition        db ' Partition', 0
+TXT_BootingNowKernel           db ' Kernel', 0
+TXT_BootingNow3                db '''', 0
+TXT_BootingHide                db '; Hide aktiv', 0
+TXT_BootingWait                db '; Bitte warten...', 13, 10, 13, 10, 0
+
+; FIXED LENGTH - 11 chars each string
+;----------------------------------|---------|------------------------------
+TXT_Floppy_NoName              db 'kein Name  '
+TXT_Floppy_Drive               db 'Floppy-Disk'
+TXT_Floppy_NoDisc              db 'Keine Disk '
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_PleaseEnterPassword        db 'Bitte geben Sie Passwort ein:', 0
+; the following 3 strings have to equal or *longer* than PleaseEnterPassword
+TXT_ProtectedSystem            db '** PASSWORT GESCHTZTES SYSTEM **', 0
+TXT_ProtectedSetup             db '** PASSWORT GESCHTZTES SETUP **', 0
+TXT_ProtectedBootUp            db '** PASSWORT GESCHTZTER BOOT-UP **', 0
+
+; will get completed using TXT_ERROR_CheckFailed from MBR.asm
+TXT_ERROR_CheckConfig          db 13, 10, ' - Die Konfiguration', 0
+
+;----------------------------------|----------------------------------------------------------|
+TXT_TooManyTries               db 'Zuviele Versuche, System Angehalten', 0
Index: trunk/bootcode/text/en/mbr.asm
===================================================================
--- trunk/bootcode/text/en/mbr.asm	(revision 57)
+++ trunk/bootcode/text/en/mbr.asm	(revision 57)
@@ -0,0 +1,32 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                          AiR-BOOT / MBR-TEXT
+; v001 - English - by Martin Kiewitz
+;------------------------------------------------------------------------------
+
+TXT_LanguageID                equ 'E'
+
+; Those strings are saved within MBR.
+; Total Length maximum 165 chars (include 13,10 (CRs), excluding ending Zeros)
+
+TXT_ERROR_Attention            db 'AiR-BOOT: !ATTENTION!', 13, 10, 0
+TXT_ERROR_CheckCode            db ' - The code', 0
+TXT_ERROR_CheckFailed          db ' of AiR-BOOT is not intact anymore.', 13, 10
+                               db '   Please boot via AiR-BOOT disc to restore AiR-BOOT.', 13, 10
+                               db '   System halted. Please press RESET.', 0
Index: trunk/bootcode/text/en/menus.asm
===================================================================
--- trunk/bootcode/text/en/menus.asm	(revision 57)
+++ trunk/bootcode/text/en/menus.asm	(revision 57)
@@ -0,0 +1,372 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                          AiR-BOOT SETUP / ALL SETUP MENUS
+; v001 - English - by Martin Kiewitz
+;---------------------------------------------------------------------------
+
+; Main Setup - Items - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUP_PartitionSetup       db 'PARTITION SETUP', 0
+TXT_SETUP_BasicOptions         db 'BASIC OPTIONS', 0
+TXT_SETUP_AdvOptions           db 'ADVANCED OPTIONS', 0
+TXT_SETUP_ExtOptions           db 'EXTENDED BOOT OPTIONS', 0
+TXT_SETUP_DefMasterPwd         db 'DEFINE MASTER PASSWORD', 0
+TXT_SETUP_DefBootPwd           db 'DEFINE BOOT PASSWORD', 0
+TXT_SETUP_SaveAndExit          db 'SAVE & EXIT SETUP', 0
+TXT_SETUP_JustExit             db 'EXIT WITHOUT SAVING', 0
+
+; The Letters for all flags in Partition Setup
+TXT_SETUP_FlagLetterBootable   equ 'B'
+TXT_SETUP_FlagLetterVIBR       equ 'V'
+TXT_SETUP_FlagLetterHide       equ 'H'
+TXT_SETUP_FlagLetterDrvLetter  equ 'L'
+TXT_SETUP_FlagLetterExtMShack  equ 'P'
+
+TXT_SETUP_LetterYes            equ 'Y'
+TXT_SETUP_LetterYes2           equ 'Z'
+TXT_SETUP_LetterNo             equ 'N'
+
+; Basic Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_DefaultSelection     db 'Default Selection', 0
+TXT_SETUP_TimedBoot            db 'Timed Boot', 0
+TXT_SETUP_TimedBootDelay       db 'Timed Boot Delay (sec)', 0
+TXT_SETUP_TimedKeyHandling     db 'Timed Key Handling', 0
+TXT_SETUP_BootLastIfTimed      db 'Boot From Last If Timed', 0
+TXT_SETUP_RememberLastBoot     db 'Remember Last Boot', 0
+TXT_SETUP_RememberTimedBoot    db 'Remember Timed Boot', 0
+TXT_SETUP_IncludeFloppy        db 'Include Floppy Drive', 0
+TXT_SETUP_ShowLVMDriveLetters  db 'Show LVM Drive Letters',0
+TXT_SETUP_MbrProtection        db 'MBR Protection', 0
+TXT_SETUP_IgnoreMbrWrites      db '-> Ignore MBR Writes', 0
+TXT_SETUP_MakeSounds           db 'Make Sounds', 0
+TXT_SETUP_CooperBars           db 'Cooper Bars', 0
+
+; Advanced Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_BootMenu             db 'Boot Menu', 0
+TXT_SETUP_PartAutoDetect       db 'Partitions Autodetect', 0
+TXT_SETUP_SecurityOptions      db '-> Security Options <-', 0
+TXT_SETUP_PasswordedSetup      db 'Passworded Setup', 0
+TXT_SETUP_PasswordedSystem     db 'Passworded System', 0
+TXT_SETUP_PasswordedChangeBoot db 'Passworded Change Boot', 0
+TXT_SETUP_GetFloppyName        db 'Get Floppy Name', 0
+TXT_SETUP_GetFloppyName2Sec    db '-> Get Every 2 Seconds', 0
+TXT_SETUP_VirusDetect          db 'Virus Detection', 0
+TXT_SETUP_StealthDetect        db 'Stealth Detection', 0
+TXT_SETUP_VIBRdetect           db 'VIBR Detection', 0
+TXT_SETUP_ContinueBIOSboot     db 'Continue BIOS Boot Seq', 0
+
+; Extended Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+; [Linux support removed since v1.02]
+;TXT_SETUP_LinuxKernelPart      db 'Linux Kernel Partition', 0
+;TXT_SETUP_LinuxDefaultKernel   db 'Linux Default Kernel', 0
+;TXT_SETUP_LinuxRootPart        db 'Linux Root Partition', 0
+; This here may be larger than 23 chars...
+;TXT_SETUP_DefLinuxCmd          db 'DEFINE COMMAND LINE FOR LINUX', 0
+TXT_SETUP_IgnoreLVM            db 'Ignore LVM information', 0
+;~ TXT_SETUP_ForceLBAUsage        db 'Force BIOS-LBA Usage', 0
+TXT_SETUP_ExtPartMShack        db 'Ext-Part MS Workaround', 0
+
+; DYNAMIC LENGTH, maximum 11 chars excluding ending zero
+;----------------------------------|---------|------------------------------
+TXT_SETUP_MAGIC_Enabled        db 'Enabled', 0
+TXT_SETUP_MAGIC_Disabled       db 'Disabled', 0
+TXT_SETUP_MAGIC_Detailed       db 'Detailed', 0
+TXT_SETUP_MAGIC_NoBootable     db 'No Bootable', 0
+; [Linux support removed since v1.02]
+;TXT_SETUP_MAGIC_NoLinux        db 'No Linux', 0
+TXT_SETUP_MAGIC_DoNothing      db 'Do Nothing', 0
+TXT_SETUP_MAGIC_ResetTime      db 'Reset Time', 0
+TXT_SETUP_MAGIC_StopTime       db 'Stop Time', 0
+TXT_SETUP_MAGIC_CDROM          db 'CD-ROM', 0
+TXT_SETUP_MAGIC_Network        db 'Network', 0
+TXT_SETUP_MAGIC_ZIPLS          db 'ZIP/LS120', 0
+; Max Length: 10 (used in Hide-Configuration as well)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Hidden         db 'Hidden', 0
+TXT_SETUP_MAGIC_Unhidden       db 'Unhidden', 0
+; Max Length: 10 ("C:" will be appended afterwards)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Set            db 'set ', 0
+
+; Setup Control Help - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUPHELP_Main             db 24,32,25,32,26,32,27,' : Choose Action', 0
+                               db               'Enter   : Select Action', 0
+                               db               'F10 : Save&Exit Setup', 0
+                               db               'Esc : Quit Setup', 0
+
+TXT_SETUPHELP_SubMenu          db 24,32,25,32,26,32,27,' : Choose Item', 0
+                               db               'PgUp/Dn : Change Item', 0
+                               db               'F1  : Show help for Item', 0
+                               db               'Esc : Return to main-menu', 0
+
+TXT_SETUPHELP_PartSetup        db 24,32,25,32,26,32,27,' : Choose partition', 0
+                               db               'Enter   : Edit label', 0
+                               db               'F1  : Flags (press key to toogle)', 0
+                               db               'Esc : Return to main-menu', 0
+
+; HELP FOR EVERY MENU-ITEM, Maximum Length = 22 chars PER line. Maximum 5 lines
+
+                                  ;1234567890123456789012
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_PartitionSetup   db 'Make your partitions', 0
+                               db 'bootable, change their', 0
+                               db 'name, define hiding', 0
+                               db 'and much more.', 0
+                               db 0
+TXT_SETUPHELP_BasicOptions     db 'These options are for', 0
+                               db 'non-experienced users.', 0
+                               db 0
+TXT_SETUPHELP_AdvOptions       db 'These are for advanced', 0
+                               db 'users. If you do not', 0
+                               db 'what they do, leave', 0
+                               db 'them like they are.', 0
+                               db 0
+TXT_SETUPHELP_ExtOptions       db 'Extended options for', 0
+                               db 'specific OSes.', 0
+                               db 0
+TXT_SETUPHELP_DefMasterPwd     db 'Define a password for', 0
+                               db 'access to setup and', 0
+                               db 'system.', 0
+                               db 0
+TXT_SETUPHELP_DefBootPwd       db 'Define a password for', 0
+                               db 'access to system.', 0
+                               db 0
+TXT_SETUPHELP_SaveAndExit      db 'Will continue boot-', 0
+                               db 'process and save the', 0
+                               db 'current options.', 0
+                               db 0
+TXT_SETUPHELP_JustExit         db 'Will continue, but', 0
+                               db 'discard any changes', 0
+                               db 'done to options.', 0
+                               db 0
+
+TXT_SETUPHELP_InPartitionSetup db 'B - Bootable', 0
+                               db 'V - VIBR-Detection', 0
+                               db 'H - Hidden Support', 0
+                               db 'L - Partition Letter', 0
+                               db 'P - Ext-Part MS invent', 0
+                               db 0
+
+TXT_SETUPHELP_HideSetup        db 'Select the state at', 0
+                               db 'which the partitions', 0
+                               db 'shall be, when the', 0
+                               db 'currently selected', 0
+                               db 'partition is booted.', 0
+                               db 0
+
+; Basic Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_DefaultSelection db 'Changes your default', 0
+                               db 'selection. It can be', 0
+                               db 'used on Timed Boot.', 0
+                               db 0
+TXT_SETUPHELP_TimedBoot        db 'AiR-BOOT will proceed', 0
+                               db 'automatically after a', 0
+                               db 'specified delay.', 0
+                               db 0
+TXT_SETUPHELP_TimedBootDelay   db 'The mentioned delay', 0
+                               db 'for Timed Boot.', 0
+                               db 0
+TXT_SETUPHELP_TimedKeyHandling db 'If you press a key in', 0
+                               db 'Boot Menu, when using', 0
+                               db 'TimedBoot, what shall', 0
+                               db 'AiR-BOOT do ?', 0
+                               db 0
+TXT_SETUPHELP_BootLastIfTimed  db 'AiR-BOOT will use the', 0
+                               db 'last-booted partition', 0
+                               db 'when timed booting.', 0
+                               db 'Otherwise it will use', 0
+                               db 'the default one.', 0
+                               db 0
+TXT_SETUPHELP_RememberLastBoot db 'AiR-BOOT will put', 0
+                               db 'the menu-bar on the', 0
+                               db 'last booted partition', 0
+                               db 'at startup.', 0
+                               db 0
+TXT_SETUPHELP_RememberTimeBoot db 'Like the last option,', 0
+                               db 'AiR-BOOT will save', 0
+                               db 'the bar on timed', 0
+                               db 'boots, too.', 0
+                               db 0
+TXT_SETUPHELP_IncludeFloppy    db 'AiR-BOOT will allow', 0
+                               db 'booting from A: via', 0
+                               db 'menu.', 0
+                               db 0
+TXT_SETUPHELP_ShowLVMDriveLetters   db 'AiR-BOOT will show', 0
+                                    db 'LVM Drive Letters', 0
+                                    db 'in the menu.', 0
+                                    db 0
+TXT_SETUPHELP_MbrProtection    db 'Protects your MBR via', 0
+                               db 'resident code. Needs', 0
+                               db '1 KByte of base-memory', 0
+                               db 'May be incompatible', 0
+                               db 'with some OS.', 0
+                               db 0
+TXT_SETUPHELP_IgnoreMbrWrites  db 'If this is enabled,', 0
+                               db 'all writes will get', 0
+                               db 'ignored, otherwise', 0
+                               db 'system will "crash".', 0
+                               db 0
+TXT_SETUPHELP_MakeSounds       db 'AiR-BOOT is able to', 0
+                               db 'make sounds using your', 0
+                               db 'internal speaker.', 0
+                               db 0
+TXT_SETUPHELP_CooperBars       db 'Will make some fancy', 0
+                               db 'effect during bootup.', 0
+                               db 0
+
+; Advanced Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_BootMenu         db 'Disabled will not show', 0
+                               db 'menu and directly boot', 0
+                               db 'default partition.', 0
+                               db 'Detailed will show', 0
+                               db 'more information.', 0
+                               db 0
+TXT_SETUPHELP_PartAutoDetect   db 'If AiR-BOOT finds new', 0
+                               db 'partitions, it will', 0
+                               db 'make them boot-able.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSetup  db 'When entering this', 0
+                               db 'setup, you will be', 0
+                               db 'asked for a password.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSystem db 'When booting your', 0
+                               db 'computer, you will', 0
+                               db 'be asked for it.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedBoot   db 'When not Timed Booting', 0
+                               db 'you will get asked.', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName    db 'When showing floppy', 0
+                               db 'disc in boot-menu,', 0
+                               db 'AiR-BOOT will get the', 0
+                               db 'floppy name.', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName2Sec db 'Additionally it will', 0
+                               db 'update the floppy name', 0
+                               db 'every 2 seconds.', 0
+                               db 0
+TXT_SETUPHELP_VirusDetect      db 'Will detect normal', 0
+                               db 'virus (lame ones).', 0
+                               db 0
+TXT_SETUPHELP_StealthDetect    db 'Will detect Stealth', 0
+                               db 'virus.', 0
+                               db 0
+TXT_SETUPHELP_VIBRdetect       db 'Will detect VIBR.', 0
+                               db 'VIBR stands for', 0
+                               db 'Virus-In-Boot-Record.', 0
+                               db 0
+TXT_SETUPHELP_ContinueBIOSboot db 'If activated, this', 0
+                               db 'option will return', 0
+                               db 'control to BIOS for', 0
+                               db 'the specified device.', 0
+                               db 0
+
+; Extended Options - Help
+;----------------------------------|--------------------|-------------------
+; [Linux support removed since v1.02]
+;TXT_SETUPHELP_LinuxKernelPart  db 'Defines the FAT-16', 0
+;                               db 'partition that holds', 0
+;                               db 'your Linux kernels.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxDefaultKrnl db 'Defines your default', 0
+;                               db 'kernel filename.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxRootPart    db 'Changes your Linux', 0
+;                               db 'root partition.', 0
+;                               db 0
+;TXT_SETUPHELP_DefLinuxCmd:     db 'Defines the command', 0
+;                               db 'line for Linux, if', 0
+;                               db 'available.', 0
+;                               db 0
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_IgnoreLVM        db 'If activated, AiR-BOOT', 0
+                               db 'won''t even look for', 0
+                               db 'LVM information.', 0
+                               db 0
+;~ TXT_SETUPHELP_ForceLBAUsage    db 'Forces the usage of', 0
+                               ;~ db 'BIOS LBA APIs instead', 0
+                               ;~ db 'of mixed usage of CHS', 0
+                               ;~ db 'and LBA.', 0
+                               ;~ db 0
+TXT_SETUPHELP_ExtPartMShack    db 'Enables dynamic change', 0
+                               db 'of the ext. partition', 0
+                               db 'type id to standard or', 0
+                               db 'MS-invention.', 0
+                               db '(defined by P-flag)', 0
+                               db 0
+
+; Maximum 26 chars (should not be reached)
+;----------------------------------|------------------------|---------------
+TXT_SETUPHELP_Base             db ' HELP ', 0
+TXT_SETUPHELP_Enter            db '<ENTER>', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_PasswordOld          db 'Old Password:', 0
+TXT_SETUP_PasswordDefine       db 'Define Password:', 0
+TXT_SETUP_PasswordVerify       db 'Verify Password:', 0
+TXT_SETUP_PasswordIncorrect    db 'Old Password Incorrect, Sorry', 0
+TXT_SETUP_PasswordMismatch     db 'Mismatched, Old Password Retained', 0
+TXT_SETUP_PasswordDisabled     db 'No Password -> Protection Disabled', 0
+TXT_SETUP_PasswordMatched      db '** Matched, New Password Set **', 0
+
+; Maximum 60 chars (should not be reached anyway)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_SaveAndExitNow       db 'SAVE & EXIT NOW', 0
+TXT_SETUP_QuitWithoutSaveNow   db 'QUIT WITHOUT SAVE', 0
+; Must be shorter than SaveAndExitNow / QuitWithoutSaveNow
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_AreYouSure1          db 'ARE YOU SURE?', 0
+TXT_SETUP_AreYouSure2          db '(Y/N)', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+; [Linux support removed since v1.02]
+;TXT_SETUP_EnterLinuxCmdLine    db 'Please enter/modify your Linux command-line:', 0
+;TXT_SETUP_NoLinuxInstalled     db 'You do not have Linux installed', 0
+TXT_SETUP_NoLDLpartition       db 'The selected partition is not HPFS/FAT16/JFS', 0
+
+;;;;;;;;;
+
+; Maximum 34 chars (should not be reached)
+;----------------------------------|--------------------------------|-------
+TXT_SETUP_HideFeature          db 'Hide Feature', 0
+;----------------------------------|---------------------|------------------
+TXT_SETUP_HideFeature2         db 'State when booting ', 0
+
+; Drive-Letter Menu Header - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUP_DriveLetter          db 'Partition Letter', 0
+
+; Drive-Letter Keys - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUPHELP_DriveLetter      db 'Press C-Z', 0
+
+; Colors for special words hard-coded. Keep all 0s.
+;TXT_SETUP_LowerMessage      db 0,'Free',0,' private usage, but NOT for people that are/were working for US government',0
+;                            db 'This software is released under ', 0, 'GPLv3+.', 0
+;                            db 'For more information and source, please visit', 0
+;                            db 'http://AiR-BOOT.sourceforge.net', 0
+;                            db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0
Index: trunk/bootcode/text/en/other.asm
===================================================================
--- trunk/bootcode/text/en/other.asm	(revision 57)
+++ trunk/bootcode/text/en/other.asm	(revision 57)
@@ -0,0 +1,106 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                        AiR-BOOT / OTHER TEXT
+; v001 - English - by Martin Kiewitz
+;------------------------------------------------------------------------------
+
+TXT_TranslationBy              db 0
+
+; TopInfosX variables are used for Boot-Menu and Partition Setup
+
+; Maximum 2/10/11/6 chars
+;----------------------------------||---------------------------------------
+TXT_TopInfos_No                db 'No', 0
+TXT_TopInfos_Hd                db 'Hd', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_HdSize            db 'Hd/Size:', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_Label             db 'Label:', 0
+;----------------------------------|---------|------------------------------
+TXT_TopInfos_Type              db 'Type:', 0
+;----------------------------------|----|-----------------------------------
+TXT_TopInfos_Flags             db 'Flags:', 0      ; <-- for Partition Setup
+
+; Will be added together to one line, maximum 76 chars
+TXT_TimedBootLine              db 'Timed boot enabled. System will boot '''
+TXT_TimedBootEntryName         db 12 dup (0) ; Space for Default-Entry-Name
+TXT_TimedBootLine2             db      ''' in ', 0
+TXT_TimedBootSeconds           db ' seconds. ', 0
+TXT_TimedBootSecond            db ' second. ', 0 ; if only one is left, ELiTE :]
+; Maximum 76 chars
+;----------------------------------|--------------------------------------------------------------------------|
+TXT_TimedBootDisabled          db 'Timed boot disabled; no timeout will occur.', 0
+TXT_BootMenuHelpText1          db 'Press [Esc] to toggle timed boot, [Enter] to accept current selection.', 0
+TXT_BootMenuHelpText2          db 'Select another with the arrow keys, or press [TAB] to see BIOS POST message.', 0
+; Maximum 30 chars
+;----------------------------------|----------------------------|
+TXT_BootMenuEnterSetup         db 'F10 to enter Setup', 0
+;TXT_BootMenuEnterBootLog       db 'TAB to enter Boot Log', 0
+
+; Dynamic Length (till 80 chars)
+TXT_BrokenPartitionTable       db 13, 10, ' - Your system has at least one broken partition table entry or your harddrive'
+                               db 13, 10, '   contains bad sectors. System halted.', 0
+TXT_TooManyPartitions          db 13, 10, ' - Too many partitions found. AiR-BOOT is supporting up to 45.', 0
+TXT_NoBootAble                 db 13, 10, ' - No bootable partition defined. System halted.', 0
+TXT_BIOSchanged                db 13, 10, ' - BIOS CHANGED, please check your system for any virus, just to be sure.'
+                               db 13, 10, '   Press any key to continue...', 0
+
+TXT_VirusFoundMain             db 13, 10, ' - !ATTENTION! -> A V1RU5 WAS FOUND <- !ATTENTION!', 13, 10, 0
+TXT_VirusFound1ok              db '    It got squashed, but the system may not reboot correctly. If this happens,', 13, 10
+                               db '    use your AiR-BOOT system disc.', 13, 10, 0
+TXT_VirusFound1damn            db '    Unfortunately it destroyed AiR-BOOTs backup. You have to reboot using your', 13, 10
+                               db '    AiR-BOOT system disc.', 13, 10, 0
+TXT_VirusFound1any             db '    For security, you should check your harddisc against remaining virus parts.', 13, 10, 0
+TXT_VirusFound2                db '    It is located in the boot-record of the partition, you wanted to boot.', 13, 10
+                               db '    Use a virus-checking program. It could be false alarm either.', 13, 10
+                               db '    After removal, you have to reinit the detection variables, go into ', 13, 10
+                               db '    ''PARTITION SETUP'' and switch VIBR-detection two times (off/on).', 13, 10
+                               db '    If this was just a false alarm, leave it in off-state.', 13, 10, 0
+TXT_VirusFoundEnd              db '    System halted. Please press RESET.', 0
+TXT_HowEnterSetup              db 13, 10, ' - Press and hold Strg/Ctrl or Alt to enter AiR-BOOT Setup.', 0
+
+TXT_BootingNow1                db 'Booting the system using ', 0
+; DO NOT MODIFY HERE
+TXT_BootingNow2                db '''', 0
+TXT_BootingNowPartName         db 12 dup (0) ; Space for BootThisPart-Name
+; DO NOT MODIFY TILL HERE
+TXT_BootingNowPartition        db ' partition', 0
+TXT_BootingNowKernel           db ' kernel', 0
+TXT_BootingHide                db '; hide active', 0
+TXT_BootingWait                db '; please wait...', 13, 10, 13, 10, 0
+
+; FIXED LENGTH - 11 chars each string
+;----------------------------------|---------|------------------------------
+TXT_Floppy_NoName              db 'No Name    '
+TXT_Floppy_Drive               db 'FloppyDrive'
+TXT_Floppy_NoDisc              db 'No Disc    '
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_PleaseEnterPassword        db ' Please Enter Password:', 0
+; the following 3 strings have to equal or *longer* than PleaseEnterPassword
+TXT_ProtectedSystem            db '** PASSWORD PROTECTED SYSTEM **', 0
+TXT_ProtectedSetup             db '** PASSWORD PROTECTED SETUP! **', 0
+TXT_ProtectedBootUp            db '** PASSWORD PROTECTED BOOTUP **', 0
+
+; will get completed using TXT_ERROR_CheckFailed from MBR.asm
+TXT_ERROR_CheckConfig          db 13, 10, ' - The configuration', 0
+
+;----------------------------------|----------------------------------------------------------|
+TXT_TooManyTries               db 'Too Many Tries, System Halted', 0
Index: trunk/bootcode/text/fr/mbr.asm
===================================================================
--- trunk/bootcode/text/fr/mbr.asm	(revision 57)
+++ trunk/bootcode/text/fr/mbr.asm	(revision 57)
@@ -0,0 +1,37 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                          AiR-BOOT / MBR-TEXT
+; v001 - French - by Michel Goyette
+;------------------------------------------------------------------------------
+
+TXT_LanguageID                equ 'F'
+
+; Those strings are saved within MBR.
+; Total Length maximum 165 chars (include 13,10 (CRs), excluding ending Zeros)
+
+TXT_ERROR_Attention            db 'AiR-BOOT: !ATTENTION!', 13, 10, 0
+TXT_ERROR_CheckCode            db ' - Le code', 0
+TXT_ERROR_CheckFailed          db ' de AiR-BOOT a t altr.', 13, 10
+                               ;~ db '   Veuillez redmarrer avec la disquette AiR-BOOT afin de le restaurer.', 13, 10
+                               ;~ db '   Systme arrt. Veuillez appuyez sur RESET.', 0
+
+                                ; Had to shorten this to prevent overlap with double 'I13X' signature in MBR.
+                                ; Hope it still makes sense...
+                                db '   Veuillez redmarrer avec la disq AiR-BOOT pour restaurer.', 13, 10
+                                db '   Systme arrt. Veuillez appuyez RESET.', 0
Index: trunk/bootcode/text/fr/menus.asm
===================================================================
--- trunk/bootcode/text/fr/menus.asm	(revision 57)
+++ trunk/bootcode/text/fr/menus.asm	(revision 57)
@@ -0,0 +1,380 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                          AiR-BOOT SETUP / ALL SETUP MENUS
+; v001 - French - by Michel Goyette
+;---------------------------------------------------------------------------
+
+; Main Setup - Items - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUP_PartitionSetup       db 'CONFIGURER LES PARTITION(S)', 0
+TXT_SETUP_BasicOptions         db 'OPTIONS DE BASE', 0
+TXT_SETUP_AdvOptions           db 'OPTIONS AVANCES', 0
+TXT_SETUP_ExtOptions           db 'OPTIONS TENDUES D''AMORAGE', 0
+TXT_SETUP_DefMasterPwd         db 'DFINIR MOT DE PASSE MATRE', 0
+TXT_SETUP_DefBootPwd           db 'DFINIR MOT DE PASSE DMARRAGE', 0
+TXT_SETUP_SaveAndExit          db 'SAUVER & SORTIR', 0
+TXT_SETUP_JustExit             db 'SORTIR SANS SAUVER', 0
+
+; The Letters for all flags in Partition Setup
+TXT_SETUP_FlagLetterBootable   equ 'A'
+TXT_SETUP_FlagLetterVIBR       equ 'V'
+TXT_SETUP_FlagLetterHide       equ 'C'
+TXT_SETUP_FlagLetterDrvLetter  equ 'L'
+TXT_SETUP_FlagLetterExtMShack  equ 'P'
+
+TXT_SETUP_LetterYes            equ 'O'
+TXT_SETUP_LetterYes2           equ 'O'
+TXT_SETUP_LetterNo             equ 'N'
+
+; Basic Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_DefaultSelection     db 'Slection Par Dfaut', 0
+TXT_SETUP_TimedBoot            db 'Amorage Temporis', 0
+TXT_SETUP_TimedBootDelay       db 'Dlai d''amorage (sec)', 0
+TXT_SETUP_TimedKeyHandling     db 'Gestion Touche Tempo.', 0
+TXT_SETUP_BootLastIfTimed      db 'Amorce Dern. si Tempo.', 0
+TXT_SETUP_RememberLastBoot     db 'Mmoriser Dern. Amorce', 0
+TXT_SETUP_RememberTimedBoot    db 'Mmoriser Amorce Tempo.', 0
+TXT_SETUP_IncludeFloppy        db 'Incl. Lecteur Disquette', 0
+TXT_SETUP_ShowLVMDriveLetters  db 'Show LVM Drive Letters',0
+TXT_SETUP_MbrProtection        db 'Protection MBR', 0
+TXT_SETUP_IgnoreMbrWrites      db '-> Ignorer criture MBR', 0
+TXT_SETUP_MakeSounds           db 'Activer Sons', 0
+TXT_SETUP_CooperBars           db 'Barres Cooper', 0
+
+; Advanced Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_BootMenu             db 'Menu d''Amorage', 0
+TXT_SETUP_PartAutoDetect       db 'Dtect. Auto Partitions', 0
+TXT_SETUP_SecurityOptions      db '-> Options Scurit <-', 0
+TXT_SETUP_PasswordedSetup      db 'Paramtrage Scuris', 0
+TXT_SETUP_PasswordedSystem     db 'Systme Scuris', 0
+TXT_SETUP_PasswordedChangeBoot db 'Chg. Amorage Scuris', 0
+TXT_SETUP_GetFloppyName        db 'Nom disquette', 0
+TXT_SETUP_GetFloppyName2Sec    db '-> Lire au 2 Secondes', 0
+TXT_SETUP_VirusDetect          db 'Dtection Virus', 0
+TXT_SETUP_StealthDetect        db 'Dtection Furtif', 0
+TXT_SETUP_VIBRdetect           db 'Dtection VIBR', 0
+TXT_SETUP_ContinueBIOSboot     db 'Cont. Sq Amorce BIOS', 0
+
+; Extended Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+; [Linux support removed since v1.02]
+;TXT_SETUP_LinuxKernelPart      db 'Partition Noyau Linux', 0
+;TXT_SETUP_LinuxDefaultKernel   db 'Noyau Linux par Dfaut', 0
+;TXT_SETUP_LinuxRootPart        db 'Partition Racine Linux', 0
+; This here may be larger than 23 chars...
+;TXT_SETUP_DefLinuxCmd          db 'DFINIR LIGNE DE COMMANDE LINUX', 0
+TXT_SETUP_IgnoreLVM            db 'Ignorer Information LVM', 0
+;~ TXT_SETUP_ForceLBAUsage        db 'Force usage du BIOS-LBA', 0
+TXT_SETUP_ExtPartMShack        db 't-Part MS Workaround', 0
+
+; DYNAMIC LENGTH, maximum 11 chars excluding ending zero
+;----------------------------------|---------|------------------------------
+TXT_SETUP_MAGIC_Enabled        db 'Activ', 0
+TXT_SETUP_MAGIC_Disabled       db 'Dsactiv', 0
+TXT_SETUP_MAGIC_Detailed       db 'Dtaill', 0
+TXT_SETUP_MAGIC_NoBootable     db 'Pas Amorce', 0
+; [Linux support removed since v1.02]
+;TXT_SETUP_MAGIC_NoLinux        db 'Pas Linux', 0
+TXT_SETUP_MAGIC_DoNothing      db 'Rien faire', 0
+TXT_SETUP_MAGIC_ResetTime      db 'R
+Z Temps', 0
+TXT_SETUP_MAGIC_StopTime       db 'Temps Arrt', 0
+TXT_SETUP_MAGIC_CDROM          db 'CD-ROM', 0
+TXT_SETUP_MAGIC_Network        db 'Rseau', 0
+TXT_SETUP_MAGIC_ZIPLS          db 'ZIP/LS120', 0
+; Max Length: 10 (used in Hide-Configuration as well)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Hidden         db 'Cache', 0
+TXT_SETUP_MAGIC_Unhidden       db 'Visible', 0
+; Max Length: 10 ("C:" will be appended afterwards)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Set            db 'choisir ', 0
+
+; Setup Control Help - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUPHELP_Main             db 24,32,25,32,26,32,27,' : Choisir Action', 0
+                               db 'Enter   : Slectionner Action', 0
+                               db 'F10 : Sauver & Sortir', 0
+                               db 'Esc : Quitter', 0
+
+TXT_SETUPHELP_SubMenu          db 24,32,25,32,26,32,27,' : Choisir Item', 0
+                               db 'PgUp/Dn : Changer Item', 0
+                               db 'F1  : Afficher Aide', 0
+                               db 'Esc : Retour au menu principal', 0
+
+TXT_SETUPHELP_PartSetup        db 24,32,25,32,26,32,27,' : Choisir partition', 0
+                               db 'Enter   : Editer tiquette', 0
+                               db 'F1  : Drapeaux (lettre=bascule)', 0
+                               db 'Esc : Retour au menu principal', 0
+
+; HELP FOR EVERY MENU-ITEM, Maximum Length = 22 chars PER line. Maximum 5 lines
+
+                                  ;1234567890123456789012
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_PartitionSetup   db 'Mettre vos partitions', 0
+                               db 'amorables, changer', 0
+                               db 'les noms, dfinir', 0
+                               db 'cach et plus encore.', 0
+                               db 0
+TXT_SETUPHELP_BasicOptions     db 'Ces options sont pour', 0
+                               db 'les usagers dbutants.', 0
+                               db 0
+TXT_SETUPHELP_AdvOptions       db 'Pour usagers avancs.', 0
+                               db 'Si vous ignorez leurs', 0
+                               db 'fonctions, ne les', 0
+                               db 'modifiez pas.', 0
+                               db 0
+TXT_SETUPHELP_ExtOptions       db 'Options tendues pour', 0
+                               db 'S.E. spcifiques.', 0
+                               db 0
+TXT_SETUPHELP_DefMasterPwd     db 'Dfinir mot de passe', 0
+                               db 'pour accs au', 0
+                               db 'paramtrage et au', 0
+                               db 'systme.', 0
+                               db 0
+TXT_SETUPHELP_DefBootPwd       db 'Dfinir mot de passe', 0
+                               db 'pour accs au systme.', 0
+                               db 0
+TXT_SETUPHELP_SaveAndExit      db 'Continuera amorage-', 0
+                               db 'traite et sauve les', 0
+                               db 'options courantes.', 0
+                               db 0
+TXT_SETUPHELP_JustExit         db 'Continuera, mais', 0
+                               db 'annulera tout', 0
+                               db 'changement aux', 0
+                               db 'options.', 0
+                               db 0
+
+TXT_SETUPHELP_InPartitionSetup db 'A - Amorable', 0
+                               db 'V - Dtection VIBR', 0
+                               db 'C - Support Cach', 0
+                               db 'L - Lettre Partition', 0
+                               db 'P - t-Part MS invent.', 0
+                               db 0
+
+TXT_SETUPHELP_HideSetup        db 'Choisir l''tat des', 0
+                               db 'partitions lorsque', 0
+                               db 'la partition prsen-', 0
+                               db 'tement slectionne', 0
+                               db 'sera amore.', 0
+                               db 0
+
+; Basic Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_DefaultSelection db 'Modifier votre', 0
+                               db 'slection par dfaut.', 0
+                               db 0
+TXT_SETUPHELP_TimedBoot        db 'AiR-BOOT procdera', 0
+                               db 'automatiquement aprs', 0
+                               db 'un dlai spcifi.', 0
+                               db 0
+TXT_SETUPHELP_TimedBootDelay   db 'Dlai spcifi pour', 0
+                               db 'Amorage Temporis.', 0
+                               db 0
+TXT_SETUPHELP_TimedKeyHandling db 'Que fait AiR-BOOT si', 0
+                               db 'vous appuyez sur une', 0
+                               db 'touche dans le menu', 0
+                               db 'd''amorage en mode', 0
+                               db 'amorage temporis?', 0
+                               db 0
+TXT_SETUPHELP_BootLastIfTimed  db 'AiR-BOOT utilisera la', 0
+                               db 'dernire partition', 0
+                               db 'dmarre en amorage', 0
+                               db 'temporis. Sinon, ce', 0
+                               db 'sera celle par dfaut.', 0
+                               db 0
+TXT_SETUPHELP_RememberLastBoot db 'Au lancement, AiR-BOOT', 0
+                               db 'placera la barre de', 0
+                               db 'menu sur la dernire', 0
+                               db 'partition amorce.', 0
+                               db 0
+TXT_SETUPHELP_RememberTimeBoot db 'Tout comme la dernire', 0
+                               db 'option, AiR-BOOT', 0
+                               db 'conservera aussi la', 0
+                               db 'barre sur les', 0
+                               db 'amorages temporiss.', 0
+                               db 0
+TXT_SETUPHELP_IncludeFloppy    db 'AiR-BOOT permettra un', 0
+                               db 'amorage de A: par', 0
+                               db 'menu.', 0
+                               db 0
+TXT_SETUPHELP_ShowLVMDriveLetters   db 'AiR-BOOT will show', 0
+                                    db 'LVM Drive Letters', 0
+                                    db 'in the menu.', 0
+                                    db 0
+TXT_SETUPHELP_MbrProtection    db 'Protge MBR par code', 0
+                               db 'rsidant. Ncessite', 0
+                               db '1 Ko de mmoire.', 0
+                               db 'Peut tre incompatible', 0
+                               db 'avec certains OS.', 0
+                               db 0
+TXT_SETUPHELP_IgnoreMbrWrites  db 'Si active, toute', 0
+                               db 'criture sera ignore.', 0
+                               db 'Si dsactive, le', 0
+                               db 'systme sera arrt.', 0
+                               db 0
+TXT_SETUPHELP_MakeSounds       db 'AiR-BOOT peut produire', 0
+                               db 'des sons en utilisant', 0
+                               db 'votre haut-parleur', 0
+                               db 'interne.', 0
+                               db 0
+TXT_SETUPHELP_CooperBars       db 'Produira des effets', 0
+                               db 'spciaux 
+ l''amorage.', 0
+                               db 0
+
+; Advanced Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_BootMenu         db 'Sans ceci, AiR-BOOT', 0
+                               db 'amorera la partition', 0
+                               db 'par dfaut sans menu.', 0
+                               db 'Dtaill affichera un', 0
+                               db 'surplus d''information', 0
+                               db 0
+TXT_SETUPHELP_PartAutoDetect   db 'Si AiR-BOOT trouve de', 0
+                               db 'nouvelles partitions,', 0
+                               db 'les rendre amorables.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSetup  db 'Un mot de passe vous', 0
+                               db 'sera demand en', 0
+                               db 'accdant 
+ ce menu.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSystem db 'En dmarrant votre', 0
+                               db 'ordinateur, il vous', 0
+                               db 'sera demand.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedBoot   db 'Si vous n''tes pas en', 0
+                               db 'Amorage Temporis,', 0
+                               db 'il vous sera demand.', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName    db 'Si le lecteur de', 0
+                               db 'disquette est affich', 0
+                               db 'dans le menu amorage,', 0
+                               db 'AiR-BOOT lira son nom.', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName2Sec db 'De plus, actualisera', 0
+                               db 'le nom de disquette', 0
+                               db 'au 2 secondes.', 0
+                               db 0
+TXT_SETUPHELP_VirusDetect      db 'Dtectera un virus', 0
+                               db 'normal.', 0
+                               db 0
+TXT_SETUPHELP_StealthDetect    db 'Dtectera un virus', 0
+                               db 'furtif.', 0
+                               db 0
+TXT_SETUPHELP_VIBRdetect       db 'Dtectera VIBR.', 0
+                               db 'VIBR est acronyme de', 0
+                               db 'Virus-In-Boot-Record.', 0
+                               db 0
+TXT_SETUPHELP_ContinueBIOSboot db 'Si active, cette', 0
+                               db 'option retournera', 0
+                               db 'le contrle au BIOS', 0
+                               db 'pour le priphrique', 0
+                               db 'spcifi.', 0
+                               db 0
+
+; Extended Options - Help
+;----------------------------------|--------------------|-------------------
+; [Linux support removed since v1.02]
+;TXT_SETUPHELP_LinuxKernelPart  db 'Dfinir la partition', 0
+;                               db 'FAT-16 contenant vos', 0
+;                               db 'noyaux Linux.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxDefaultKrnl db 'Dfinir le nom du', 0
+;                               db 'noyau par dfaut.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxRootPart    db 'Modifier votre', 0
+;                               db 'partition racine', 0
+;                               db 'Linux.', 0
+;                               db 0
+;TXT_SETUPHELP_DefLinuxCmd:     db 'Dfinir la ligne de', 0
+;                               db 'commande pour Linux,', 0
+;                               db 'si disponible.', 0
+;                               db 0
+TXT_SETUPHELP_IgnoreLVM        db 'Si activ, AiR-BOOT', 0
+                               db 'ignorera l''information', 0
+                               db 'LVM.', 0
+                               db 0
+;~ TXT_SETUPHELP_ForceLBAUsage    db 'Forcer l''usage de', 0
+                               ;~ db 'l''API BIOS LBA au lieu', 0
+                               ;~ db 'd''un amalgame de', 0
+                               ;~ db 'CHS et LBA.', 0
+                               ;~ db 0
+TXT_SETUPHELP_ExtPartMShack    db 'Changement dynamique', 0
+                               db 'du type id (standard', 0
+                               db 'ou MS-invention) de la', 0
+                               db 'partition tendue.', 0
+                               db '(dfini par drapeau P)', 0
+                               db 0
+
+; Maximum 26 chars (should not be reached)
+;----------------------------------|------------------------|---------------
+TXT_SETUPHELP_Base             db ' AIDE ', 0
+TXT_SETUPHELP_Enter            db '<ENTER>', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_PasswordOld          db 'Ancien Mot de Passe:', 0
+TXT_SETUP_PasswordDefine       db 'Dfinir Mot de Passe:', 0
+TXT_SETUP_PasswordVerify       db 'Vrifier Mot de Passe:', 0
+TXT_SETUP_PasswordIncorrect    db 'Ancien Mot de Passe Incorrect, Dsol', 0
+TXT_SETUP_PasswordMismatch     db 'Diffrents!!! Ancient Mot de passe Conserv', 0
+TXT_SETUP_PasswordDisabled     db 'Pas de Mot de Passe -> Protection Dsactiv', 0
+TXT_SETUP_PasswordMatched      db '** Identiques, Nouveau Mot de Passe Activ **', 0
+
+; Maximum 60 chars (should not be reached anyway)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_SaveAndExitNow       db 'SAUVER & QUITTER MAINTENANT', 0
+TXT_SETUP_QuitWithoutSaveNow   db 'QUITTER SANS SAUVER', 0
+; Must be shorter than SaveAndExitNow / QuitWithoutSaveNow
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_AreYouSure1          db 'TES-VOUS CERTAIN?', 0
+TXT_SETUP_AreYouSure2          db '(O/N)', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+; [Linux support removed since v1.02]
+;TXT_SETUP_EnterLinuxCmdLine    db 'Veuillez entrer/modifier votre ligne de commande Linux:', 0
+;TXT_SETUP_NoLinuxInstalled     db 'Linux non install', 0
+TXT_SETUP_NoLDLpartition       db 'La partition slectionne n''est pas du type HPFS/FAT16/JFS', 0
+
+; Maximum 34 chars (should not be reached)
+;----------------------------------|--------------------------------|-------
+TXT_SETUP_HideFeature          db 'Cacher Fonction', 0
+;----------------------------------|---------------------|------------------
+TXT_SETUP_HideFeature2         db 'tat 
+ l''amorage de ', 0
+
+; Drive-Letter Menu Header - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUP_DriveLetter          db 'Lettre Partition', 0
+
+; Drive-Letter Keys - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUPHELP_DriveLetter      db 'Appuyez C-Z', 0
+
+; Colors for special words hard-coded. Keep all 0s.
+;TXT_SETUP_LowerMessage         db 'Ce programme est ',0,'gratuit',0,' pour une utilisation prive non-commerciale.',0
+;                               db 'Vous ne devez ',0,'PAS',0,' distribuer/utiliser AiR-BOOT sous ',0,'-TOUTE-',0,' forme,',0
+;                               db 'si vous tes pay pour la distribution du produit ou du service.',0
+;                               db 'Pour utiliser AiR-BOOT dans des ',0,'conditions diffrentes',0,', ',0,'pr-installer',0,' ou',0
+;                               db 'le distribuer',0,', svp veuillez me contacter par courriel: ',0,'kiewitz@netlabs.org',0,' !',0
Index: trunk/bootcode/text/fr/other.asm
===================================================================
--- trunk/bootcode/text/fr/other.asm	(revision 57)
+++ trunk/bootcode/text/fr/other.asm	(revision 57)
@@ -0,0 +1,105 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                        AiR-BOOT / OTHER TEXT
+; v001 - French - by Michel Goyette
+;------------------------------------------------------------------------------
+
+TXT_TranslationBy              db 'French by Michel Goyette & Aymeric Peyret', 0
+
+; TopInfosX variables are used for Boot-Menu and Partition Setup
+
+; Maximum 2/10/11/6 chars
+;----------------------------------||---------------------------------------
+TXT_TopInfos_No                db 'No', 0
+TXT_TopInfos_Hd                db 'Dd', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_HdSize            db 'Dd/Cap.:', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_Label             db 'tiq.:', 0
+;----------------------------------|---------|------------------------------
+TXT_TopInfos_Type              db 'Type:', 0
+;----------------------------------|----|-----------------------------------
+TXT_TopInfos_Flags             db 'Drap.:', 0      ; <-- for Partition Setup
+
+; Will be added together to one line, maximum 76 chars
+TXT_TimedBootLine              db 'Amorage temporis actif. Dmarrage de '''
+TXT_TimedBootEntryName         db 12 dup (0) ; Space for Default-Entry-Name
+TXT_TimedBootLine2             db      ''' dans ', 0
+TXT_TimedBootSeconds           db ' secondes. ', 0
+TXT_TimedBootSecond            db ' seconde. ', 0 ; if only one is left, ELiTE :]
+; Maximum 76 chars
+;----------------------------------|--------------------------------------------------------------------------|
+TXT_TimedBootDisabled          db 'Amorage temporis dsactiv; aucune temporisation n''arrivera.', 0
+TXT_BootMenuHelpText1          db '[Esc] bascule l''amorage temporis, [Enter] accepte la slection courante.', 0
+TXT_BootMenuHelpText2          db 'Flches pour choisir une autre, ou [TAB] pour voir les messages POST BIOS.', 0
+; Maximum 30 chars
+;----------------------------------|----------------------------|
+TXT_BootMenuEnterSetup         db 'F10 pour Configurer', 0
+
+; Dynamic Length (till 80 chars)
+TXT_BrokenPartitionTable       db 13, 10, ' - Votre systme a au moins d''une entre mauvaise de table de partition, ou'
+                               db 13, 10, '   la disque dr a des casse secteurs. Systme arrt.', 0
+TXT_TooManyPartitions          db 13, 10, ' - Trop de partitions trouves. AiR-BOOT supporte un maximum de 45.', 0
+TXT_NoBootAble                 db 13, 10, ' - Aucune partition amorable dfinie. Systme arrt.', 0
+TXT_BIOSchanged                db 13, 10, ' - BIOS CHANG! Veuillez vrifier votre systme contre un virus.'
+                               db 13, 10, '   Appuyez sur une touche pour continuer...', 0
+
+TXT_VirusFoundMain             db 13, 10, ' - !ATTENTION! -> UN VIRUS A T TROUV <- !ATTENTION!', 13, 10, 0
+TXT_VirusFound1ok              db '    Il est radiqu, mais le systme peut ne pas redmarrer correctement.', 13, 10
+                               db '    Si c''est le cas, utiliser votre disquette systme AiR-BOOT.', 13, 10, 0
+TXT_VirusFound1damn            db '    Malheureusement, il a dtruit la copie de sauvgarde de AiR-BOOT. Vous', 13, 10
+                               db '    devez redmarrer en utilisant votre disquette systme AiR-BOOT.', 13, 10, 0
+TXT_VirusFound1any             db '    Pour plus de sret, vrifiez votre disque contre des rsidus du virus.', 13, 10, 0
+TXT_VirusFound2                db '    Il est localis dans le secteur d amorage de la partition dsire.', 13, 10
+                               db '    Utilisez un logiciel antivirus. Ce peut tre aussi une fausse alerte.', 13, 10
+                               db '    Aprs radiquation, rinitialiser les variables de dtection. Allez dans', 13, 10
+                               db '    ''PARAMTRAGE PARTITION'' et basculez Dtection-VIBR deux fois (off/on).', 13, 10
+                               db '    Si c''tait une fausse alerte, laissez-le dsactiv.', 13, 10, 0
+TXT_VirusFoundEnd              db '    Systme arrt. Veuillez appuyez sur RESET.', 0
+TXT_HowEnterSetup              db 13, 10, ' - Appuyez et tenez Strg/Ctrl ou Alt pour configurer AiR-BOOT.', 0
+
+TXT_BootingNow1                db 'Amorage du systme avec ', 0
+; DO NOT MODIFY HERE
+TXT_BootingNow2                db '''', 0
+TXT_BootingNowPartName         db 12 dup (0) ; Space for BootThisPart-Name
+; DO NOT MODIFY TILL HERE
+TXT_BootingNowPartition        db '''', 0
+TXT_BootingNowKernel           db '''', 0
+TXT_BootingHide                db '; cach actif', 0
+TXT_BootingWait                db '; veuillez patienter...', 13, 10, 13, 10, 0
+
+; FIXED LENGTH - 11 chars each string
+;----------------------------------|---------|------------------------------
+TXT_Floppy_NoName              db 'Sans nom   '
+TXT_Floppy_Drive               db 'Disquette  '
+TXT_Floppy_NoDisc              db 'Sans Disq. '
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_PleaseEnterPassword        db ' Veuillez entrez le mot de passe:', 0
+; the following 3 strings have to equal or *longer* than PleaseEnterPassword
+TXT_ProtectedSystem            db '** SYSTME SCURIS PAR MOT DE PASSE **', 0
+TXT_ProtectedSetup             db '** PARAMTRAGE SCURIS PAR MOT DE PASSE! **', 0
+TXT_ProtectedBootUp            db '** AMORAGE SCURIS PAR MOT DE PASSE **', 0
+
+; will get completed using TXT_ERROR_CheckFailed from MBR.asm
+TXT_ERROR_CheckConfig          db 13, 10, ' - La configuration', 0
+
+;----------------------------------|----------------------------------------------------------|
+TXT_TooManyTries               db 'Trop de Tentatives, Systme Arrt', 0
Index: trunk/bootcode/text/it/mbr.asm
===================================================================
--- trunk/bootcode/text/it/mbr.asm	(revision 57)
+++ trunk/bootcode/text/it/mbr.asm	(revision 57)
@@ -0,0 +1,32 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                          AiR-BOOT / MBR-TEXT
+; v001 - Italiano - by Stefano Gualtieri
+;------------------------------------------------------------------------------
+
+TXT_LanguageID                equ 'I'
+
+; Those strings are saved within MBR.
+; Total Length maximum 165 chars (include 13,10 (CRs), excluding ending Zeros)
+
+TXT_ERROR_Attention            db 'AiR-BOOT: !ATTENZIONE!', 13, 10, 0
+TXT_ERROR_CheckCode            db ' - Il codice', 0
+TXT_ERROR_CheckFailed          db ' di AiR-BOOT e'' danneggiato.', 13, 10
+                               db '   Riavviare con il floppy di AiR-BOOT per ripristinarlo.', 13, 10
+                               db '   Sistema bloccato. Premere RESET.', 0
Index: trunk/bootcode/text/it/menus.asm
===================================================================
--- trunk/bootcode/text/it/menus.asm	(revision 57)
+++ trunk/bootcode/text/it/menus.asm	(revision 57)
@@ -0,0 +1,383 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                          AiR-BOOT SETUP / ALL SETUP MENUS
+; v001 - Italiano - di Stefano Gualtieri
+;---------------------------------------------------------------------------
+
+; Main Setup - Items - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUP_PartitionSetup       db 'CONFIGURA PARTIZIONI', 0
+TXT_SETUP_BasicOptions         db 'OPZIONI PRINCIPALI', 0
+TXT_SETUP_AdvOptions           db 'OPZIONI AVANZATE', 0
+TXT_SETUP_ExtOptions           db 'OPZIONI SPECIALI', 0
+TXT_SETUP_DefMasterPwd         db 'DEFINIRE PASSWORD PRINCIPALE', 0
+TXT_SETUP_DefBootPwd           db 'DEFINIRE PASSWORD DI AVVIO', 0
+TXT_SETUP_SaveAndExit          db 'SALVA IMPOSTAZIONI & ESCI', 0
+TXT_SETUP_JustExit             db 'ABBANDONA SENZA SALVARE', 0
+
+; The Letters for all flags in Partition Setup
+TXT_SETUP_FlagLetterBootable   equ 'A'
+TXT_SETUP_FlagLetterVIBR       equ 'V'
+TXT_SETUP_FlagLetterHide       equ 'N'
+TXT_SETUP_FlagLetterDrvLetter  equ 'D'
+TXT_SETUP_FlagLetterExtMShack  equ 'P'
+
+TXT_SETUP_LetterYes            equ 'S'
+TXT_SETUP_LetterYes2           equ 'Z'
+TXT_SETUP_LetterNo             equ 'N'
+
+; Basic Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_DefaultSelection     db 'Selezione Standard', 0
+TXT_SETUP_DefaultPart          db 'Partizione Predefinita', 0
+TXT_SETUP_TimedBoot            db 'Avvio Temporizzato', 0
+TXT_SETUP_TimedBootDelay       db 'Tempo Avvio Temp. (sec)', 0
+TXT_SETUP_TimedKeyHandling     db 'Tasti e Temporizzazione', 0
+TXT_SETUP_BootLastIfTimed      db 'Avvio Ultimo SO Tempor.', 0
+TXT_SETUP_RememberLastBoot     db 'Ricorda Ultimo Avvio', 0
+TXT_SETUP_RememberTimedBoot    db 'Ricorda Avvio Temporiz.', 0
+TXT_SETUP_IncludeFloppy        db 'Includi Avvio da Floppy', 0
+TXT_SETUP_ShowLVMDriveLetters  db 'Show LVM Drive Letters',0
+TXT_SETUP_MbrProtection        db 'Proteggi MBR', 0
+TXT_SETUP_IgnoreMbrWrites      db '->Ignora modifiche MBR', 0
+TXT_SETUP_MakeSounds           db 'Suoni di Sistema', 0
+TXT_SETUP_CooperBars           db 'Barre colorate', 0
+
+; Advanced Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_BootMenu             db 'Menu di Avvio', 0
+TXT_SETUP_PartAutoDetect       db 'Rileva Partiz. Autom.', 0
+TXT_SETUP_SecurityOptions      db '->Opzioni Sicurezza<-', 0
+TXT_SETUP_PasswordedSetup      db 'Config. con Password', 0
+TXT_SETUP_PasswordedSystem     db 'Sistema con Password', 0
+TXT_SETUP_PasswordedChangeBoot db 'Cambio Avvio + Password', 0
+TXT_SETUP_GetFloppyName        db 'Leggi Etichetta Floppy', 0
+TXT_SETUP_GetFloppyName2Sec    db '-> Leggi Ogni 2 Secondi', 0
+TXT_SETUP_VirusDetect          db 'Rilevaz. Virus', 0
+TXT_SETUP_StealthDetect        db 'Rilevaz. Virus Stealth', 0
+TXT_SETUP_VIBRdetect           db 'Rilevaz. VIBR', 0
+TXT_SETUP_ContinueBIOSboot     db 'Continua Avvio dal BIOS', 0
+
+; Extended Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+; [Linux support removed since v1.02]
+;TXT_SETUP_LinuxKernelPart      db 'Partiz. kernel Linux', 0
+;TXT_SETUP_LinuxDefaultKernel   db 'Kernel Linux predef.', 0
+;TXT_SETUP_LinuxRootPart        db 'Partizione Root Linux', 0
+; This here may be larger than 23 chars...
+;TXT_SETUP_DefLinuxCmd          db 'DEFINIRE LINEA DI COMANDO LINUX', 0
+TXT_SETUP_IgnoreLVM            db 'Ignorare LVM info.', 0
+;~ TXT_SETUP_ForceLBAUsage        db 'Forza uso LBA del BIOS', 0
+TXT_SETUP_ExtPartMShack        db 'Est-Part MS Workaround', 0
+
+; DYNAMIC LENGTH, maximum 11 chars excluding ending zero
+;----------------------------------|---------|------------------------------
+TXT_SETUP_MAGIC_Enabled        db 'Attivato', 0
+TXT_SETUP_MAGIC_Disabled       db 'Disattivato', 0
+TXT_SETUP_MAGIC_Detailed       db 'Dettagli', 0
+TXT_SETUP_MAGIC_NoBootable     db 'No Avviab.', 0
+; [Linux support removed since v1.02]
+;TXT_SETUP_MAGIC_NoLinux        db 'No Linux', 0
+TXT_SETUP_MAGIC_DoNothing      db 'Nessuna Az.', 0
+TXT_SETUP_MAGIC_ResetTime      db 'Reset Timer', 0
+TXT_SETUP_MAGIC_StopTime       db 'Ferma Timer', 0
+TXT_SETUP_MAGIC_CDROM          db 'CD-ROM', 0
+TXT_SETUP_MAGIC_Network        db 'Rete', 0
+TXT_SETUP_MAGIC_ZIPLS          db 'ZIP/LS120', 0
+; Max Length: 10 (used in Hide-Configuration as well)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Hidden         db 'Nascosta', 0
+TXT_SETUP_MAGIC_Unhidden       db 'Visibile', 0
+; Max Length: 10 ("C:" will be appended afterwards)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Set            db 'Forza a ', 0
+
+; Setup Control Help - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUPHELP_Main             db 24,32,25,32,26,32,27,' : Scelta Azione', 0
+                               db               'Enter   : Conferma Azione', 0
+                               db               'F10 : Salva Config. & Esci', 0
+                               db               'Esc : Abbandona Config.', 0
+
+TXT_SETUPHELP_SubMenu          db 24,32,25,32,26,32,27,' : Scelta Opzione', 0
+                               db               'PgUp/Dn : Cambio Opzione', 0
+                               db               'F1  : Mostra Aiuto Opzione', 0
+                               db               'Esc : Ritorna al Menu Principale', 0
+
+TXT_SETUPHELP_PartSetup        db 24,32,25,32,26,32,27,' : Scelta Partizione', 0
+                               db               'Enter   : Modifica Etichetta', 0
+                               db               'F1  : Opz. (premi tasto x camb.)', 0
+                               db               'Esc : Ritorna al Menu Principale', 0
+
+; HELP FOR EVERY MENU-ITEM, Maximum Length = 22 chars PER line. Maximum 5 lines
+
+                                  ;1234567890123456789012
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_PartitionSetup   db 'Rende le partizioni ', 0
+                               db 'avviabili, cambia il', 0
+                               db 'loro nome, le nasconde', 0
+                               db 'etc.', 0
+                               db 0
+TXT_SETUPHELP_BasicOptions     db 'Opzioni disponibili', 0
+                               db 'per utenti anche non', 0
+                               db 'esperti', 0
+                               db 0
+TXT_SETUPHELP_AdvOptions       db 'Opzioni solo per', 0
+                               db 'utenti esperti. Se si', 0
+                               db 'ignora come agiscono', 0
+                               db 'non utilizzarle', 0
+                               db 0
+TXT_SETUPHELP_ExtOptions       db 'Opzioni speciali per', 0
+                               db 'specifici sistemi', 0
+                               db 'operativi', 0
+                               db 0
+TXT_SETUPHELP_DefMasterPwd     db 'Definisce la password', 0
+                               db 'per accedere alla', 0
+                               db 'configurazione del', 0
+                               db 'sistema', 0
+                               db 0
+TXT_SETUPHELP_DefBootPwd       db 'Definisce la password', 0
+                               db 'per accedere al', 0
+                               db 'sistema', 0
+                               db 0
+TXT_SETUPHELP_SaveAndExit      db 'Continua l''avvio e', 0
+                               db 'salva le impostazioni', 0
+                               db 'correnti', 0
+                               db 0
+TXT_SETUPHELP_JustExit         db 'Continua l''avvio, ', 0
+                               db 'ma non salva', 0
+                               db 'le impostazioni', 0
+                               db 0
+
+TXT_SETUPHELP_InPartitionSetup db 'A -Avviabile (boot)', 0
+                               db 'V -Rilevazione VIBR', 0
+                               db 'N -Supporto Nascoste', 0
+                               db 'L -Lettera Partizione', 0
+                               db 'P -Est-Part MS inventi', 0
+                               db 0
+
+TXT_SETUPHELP_HideSetup        db 'Definisce lo stato', 0
+                               db 'delle altre partizioni', 0
+                               db 'quando la partizione', 0
+                               db 'selezionata viene', 0
+                               db 'avviata', 0
+                               db 0
+
+; Basic Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_DefaultSelection db 'Cambia la selezione', 0
+                               db 'standard', 0
+                               db 0
+TXT_SETUPHELP_TimedBoot        db 'AiR-BOOT procede', 0
+                               db 'automaticamente dopo', 0
+                               db 'il tempo indicato', 0
+                               db 0
+TXT_SETUPHELP_TimedBootDelay   db 'Tempo di ritardo per', 0
+                               db 'Avvio Temporizzato', 0
+                               db 0
+TXT_SETUPHELP_TimedKeyHandling db 'Funzione eseguita in', 0
+                               db 'caso di pressione di ', 0
+                               db 'un tasto durante', 0
+                               db 'l''Avvio Temporizzato', 0
+                               db 0
+TXT_SETUPHELP_BootLastIfTimed  db 'AiR-BOOT usa', 0
+                               db 'l''ultima partizione', 0
+                               db 'avviata in Avvio', 0
+                               db 'Temporizzato. Oppure', 0
+                               db 'usa la predefinita', 0
+                               db 0
+TXT_SETUPHELP_RememberLastBoot db 'AiR-BOOT posiziona', 0
+                               db 'la barra del menu di', 0
+                               db 'selezione partizione', 0
+                               db 'sull''ultima avviata', 0
+                               db 0
+TXT_SETUPHELP_RememberTimeBoot db 'Come la precedente,', 0
+                               db 'AiR-BOOT posiziona la', 0
+                               db 'barra del menu anche', 0
+                               db 'in caso di Avvio', 0
+                               db 'Temporizzato', 0
+                               db 0
+TXT_SETUPHELP_IncludeFloppy    db 'AiR-BOOT permette di', 0
+                               db 'avviare dal floppy A:', 0
+                               db 'tramite il menu', 0
+                               db 0
+TXT_SETUPHELP_ShowLVMDriveLetters   db 'AiR-BOOT will show', 0
+                                    db 'LVM Drive Letters', 0
+                                    db 'in the menu.', 0
+                                    db 0
+TXT_SETUPHELP_MbrProtection    db 'Protegge il MBR con un', 0
+                               db 'programma residente.', 0
+                               db 'Richiede 1 KByte di', 0
+                               db 'memoria convenzionale.', 0
+                               db 'Problemi con certi OS', 0
+                               db 0
+TXT_SETUPHELP_IgnoreMbrWrites  db 'Ignora le modifiche al', 0
+                               db 'MBR, altrimenti blocca', 0
+                               db 'il sistema', 0
+                               db 0
+TXT_SETUPHELP_MakeSounds       db 'Effetti sonori in', 0
+                               db 'avvio tramite lo', 0
+                               db 'speaker interno', 0
+                               db 0
+TXT_SETUPHELP_CooperBars       db 'Crea barre colorate', 0
+                               db 'all''avvio del sistema', 0
+                               db 0
+
+; Advanced Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_BootMenu         db 'Disabilita: AiR-BOOT', 0
+                               db 'avvia la partizione', 0
+                               db 'predefinita (no menu)', 0
+                               db 'Dettagli: mostra', 0
+                               db 'altre informazioni', 0
+                               db 0
+TXT_SETUPHELP_PartAutoDetect   db 'Se AiR-BOOT trova ', 0
+                               db 'nuove partizioni, le', 0
+                               db 'rende automaticamente', 0
+                               db 'avviabili', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSetup  db 'AiR-BOOT chiede una', 0
+                               db 'password per accedere', 0
+                               db 'alla configurazione', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSystem db 'AiR-BOOT chiede una', 0
+                               db 'password per avviare', 0
+                               db 'il sistema', 0
+                               db 0
+TXT_SETUPHELP_PasswordedBoot   db 'AiR-BOOT chiede una', 0
+                               db 'password per cambiare', 0
+                               db 'la partizione di avvio', 0
+                               db 'se non si usa Avvio', 0
+                               db 'Temporizzato', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName    db 'In caso il floppy sia', 0
+                               db 'avviabile da menu,', 0
+                               db 'AiR-BOOT mostra la', 0
+                               db 'etichetta del floppy', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName2Sec db 'In aggiunta alla ', 0
+                               db 'precedente, rilegge', 0
+                               db 'l''etichetta del', 0
+                               db 'floppy ogni 2 secondi', 0
+                               db 0
+TXT_SETUPHELP_VirusDetect      db 'Rileva virus normali', 0
+                               db '(virus non troppo', 0
+                               db 'aggressivi)', 0
+                               db 0
+TXT_SETUPHELP_StealthDetect    db 'Rileva virus tipo', 0
+                               db 'Stealth (tunnell', 0
+                               db 'virus)', 0
+                               db 0
+TXT_SETUPHELP_VIBRdetect       db 'Rileva virus tipo', 0
+                               db 'VIBR, ovvero', 0
+                               db 'Virus-In-Boot-Record', 0
+                               db '(Virus da settore di', 0
+                               db 'avvio)', 0
+                               db 0
+TXT_SETUPHELP_ContinueBIOSboot db 'Restituisce il', 0
+                               db 'controllo al BIOS per', 0
+                               db 'la gestione del', 0
+                               db 'dispositivo di avvio', 0
+                               db 0
+
+; Extended Options - Help
+;----------------------------------|--------------------|-------------------
+; [Linux support removed since v1.02]
+;TXT_SETUPHELP_LinuxKernelPart  db 'Partizione FAT-16', 0
+;                               db 'contenente i vari', 0
+;                               db 'kernels di Linux', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxDefaultKrnl db 'Definisce il nome del', 0
+;                               db 'kernel predefinito', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxRootPart    db 'Cambia la partizione', 0
+;                               db 'root di Linux', 0
+;                               db 0
+;TXT_SETUPHELP_DefLinuxCmd      db 'Definisce la linea di', 0
+;                               db 'comando per Linux, se', 0
+;                               db 'disponibile', 0
+;                               db 0
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_IgnoreLVM        db 'Se attivato AiR-BOOT', 0
+                               db 'non cerca neanche LVM', 0
+                               db 'informazione.', 0
+                               db 0
+;~ TXT_SETUPHELP_ForceLBAUsage    db 'Forza l''uso delle API', 0
+                               ;~ db 'LBA del BIOS invece', 0
+                               ;~ db 'dell''uso misto di CHS', 0
+                               ;~ db 'ed LBA.', 0
+                               ;~ db 0
+TXT_SETUPHELP_ExtPartMShack    db 'Abilita il cambiamento', 0
+                               db 'dinamico della partiz.', 0
+                               db 'estesa, da "type id"', 0
+                               db 'standard a tipo MS', 0
+                               db '(definito dal P-flag)', 0
+                               db 0
+
+; Maximum 26 chars (should not be reached)
+;----------------------------------|------------------------|---------------
+TXT_SETUPHELP_Base             db ' AIUTO ', 0
+TXT_SETUPHELP_Enter            db '<INVIO>', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_PasswordOld          db 'Password Precedente:', 0
+TXT_SETUP_PasswordDefine       db 'Definire Password:', 0
+TXT_SETUP_PasswordVerify       db 'Verifica Password:', 0
+TXT_SETUP_PasswordIncorrect    db 'Password Precedente Errata, Spiacente.', 0
+TXT_SETUP_PasswordMismatch     db 'Incorretta, Mantenuta la Password Precedente.', 0
+TXT_SETUP_PasswordDisabled     db 'Nessuna Password -> Protezione Disabilitata.', 0
+TXT_SETUP_PasswordMatched      db '** Corretta, Nuova Password Attivata **', 0
+
+; Maximum 60 chars (should not be reached anyway)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_SaveAndExitNow       db 'SALVA IMPOSTAZ. & ESCI', 0
+TXT_SETUP_QuitWithoutSaveNow   db 'ESCI SENZA SALVARE', 0
+; Must be shorter than SaveAndExitNow / QuitWithoutSaveNow
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_AreYouSure1          db 'SEI SICURO?', 0
+TXT_SETUP_AreYouSure2          db '(S/N)', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+; [Linux support removed since v1.02]
+;TXT_SETUP_EnterLinuxCmdLine    db 'Inserire/modificare la linea di comando per Linux:', 0
+;TXT_SETUP_NoLinuxInstalled     db 'Linux non installato nel sistema', 0
+TXT_SETUP_NoLDLpartition       db 'Partizione selezionata non HPFS/FAT16/JFS', 0
+
+; Maximum 34 chars (should not be reached)
+;----------------------------------|--------------------------------|-------
+TXT_SETUP_HideFeature          db 'Nascondi Partizioni', 0
+;----------------------------------|---------------------|------------------
+TXT_SETUP_HideFeature2         db 'Stato all''avvio ', 0
+
+; Drive-Letter Menu Header - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUP_DriveLetter          db 'Lettera Partizione', 0
+
+; Drive-Letter Keys - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUPHELP_DriveLetter      db 'Premere C a Z', 0
+
+; Colors for special words hard-coded. Keep all 0s.
+;TXT_SETUP_LowerMessage         db 'Programma ',0,'gratuito',0,' per uso privato non commerciale.',0
+;                               db 'Proibita ',0,'ASSOLUTAMENTE',0,' distribuzione o uso di AiR-BOOT in ',0,'-OGNI-',0,' modo,',0
+;                               db 'in caso di pagamento del prodotto o del servizio fornito con esso.',0
+;                               db 'Se si vuole usare AiR-BOOT secondo ',0,'altre condizioni',0,', ',0,'preinstallarlo',0,' o ',0
+;                               db 'distribuirlo',0,' , contattatemi via e-mail: ',0,'kiewitz@netlabs.org',0,' !',0
Index: trunk/bootcode/text/it/other.asm
===================================================================
--- trunk/bootcode/text/it/other.asm	(revision 57)
+++ trunk/bootcode/text/it/other.asm	(revision 57)
@@ -0,0 +1,105 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                        AiR-BOOT / OTHER TEXT
+; v001 - Italiano - by Stefano Gualtieri
+;------------------------------------------------------------------------------
+
+TXT_TranslationBy              db 'Italian by Stefano Gualtieri', 0
+
+; TopInfosX variables are used for Boot-Menu and Partition Setup
+
+; Maximum 2/10/11/6 chars
+;----------------------------------||---------------------------------------
+TXT_TopInfos_No                db 'Nr', 0
+TXT_TopInfos_Hd                db 'Hd', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_HdSize            db 'Hd/Size:', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_Label             db 'Etichetta:', 0
+;----------------------------------|---------|------------------------------
+TXT_TopInfos_Type              db 'Tipo:', 0
+;----------------------------------|----|-----------------------------------
+TXT_TopInfos_Flags             db 'Flags:', 0      ; <-- for Partition Setup
+
+; Will be added together to one line, maximum 76 chars
+TXT_TimedBootLine              db 'Timer di Avvio Attivato. Avvio con '''
+TXT_TimedBootEntryName         db 12 dup (0) ; Space for Default-Partition-Name
+TXT_TimedBootLine2             db      ''' tra ', 0
+TXT_TimedBootSeconds           db ' secondi. ', 0
+TXT_TimedBootSecond            db ' secondo. ', 0 ; if only one is left, ELiTE :]
+; Maximum 76 chars
+;----------------------------------|--------------------------------------------------------------------------|
+TXT_TimedBootDisabled          db 'Avvio Temporizzato Disabilitato. Pausa.', 0
+TXT_BootMenuHelpText1          db 'Premere [Esc] per resettare il timer, [Invio] per accettare la selezione.', 0
+TXT_BootMenuHelpText2          db 'Selezionare con i tasti freccia, oppure [TAB] per i messaggi POST del BIOS.', 0
+; Maximum 30 chars
+;----------------------------------|----------------------------|
+TXT_BootMenuEnterSetup         db 'F10 Impostazioni', 0
+
+; Dynamic Length (till 80 chars)
+TXT_BrokenPartitionTable       db 13, 10, ' - Il sistema ha almeno una partizione corrotta nel tuo hard-disk contiene'
+                               db 13, 10, '   settori danneggiati. Sistema bloccato.', 0
+TXT_TooManyPartitions          db 13, 10, ' - Trovate troppe partizioni. AiR-BOOT ne supporta fino a 45.', 0
+TXT_NoBootAble                 db 13, 10, ' - Nessuna partizione avviabile definita. Sistema bloccato.', 0
+TXT_BIOSchanged                db 13, 10, ' - BIOS MODIFICATO! Controllare il sistema contro eventuali virus.'
+                               db 13, 10, '   Premere un tasto per continuare...', 0
+
+TXT_VirusFoundMain             db 13, 10, ' - !ATTENZIONE! -> RILEVATO UN VIRUS <- !ATTENZIONE!', 13, 10, 0
+TXT_VirusFound1ok              db '    Ora sara'' sovrascritto, ma il sistema potrebbe non riavviarsi', 13, 10
+                               db '    correttamente. In tal caso utilizzare il dischetto di AiR-BOOT.', 13, 10, 0
+TXT_VirusFound1damn            db '    Purtroppo il backup di AiR-BOOT non funziona. Riavviare con il', 13, 10
+                               db '    dischetto di AiR-BOOT.', 13, 10, 0
+TXT_VirusFound1any             db '    Per sicurezza, controllare i dischi in caso di altre tracce virali. ', 13, 10, 0
+TXT_VirusFound2                db '    Il virus risiede nel boot-record della partizione in avvio.', 13, 10
+                               db '    Usare un programma antivirus. Potrebbe anche essere un falso allarme.', 13, 10
+                               db '    Dopo la rimozione occorre reinizializzare il rilevamento virus. Andare', 13, 10
+                               db '    in ''CONFIGURAZIONE PARTIZIONI'' e modificare due volte Rilevamento VIBR', 13, 10
+                               db '     (off/on). Se si tratta di falso allarme, lasciarlo disinserito (off).', 13, 10, 0
+TXT_VirusFoundEnd              db '    Sistema bloccato. Premere RESET.', 0
+TXT_HowEnterSetup              db 13, 10, ' - Premere e tenere premuto Ctrl o Alt per configurare AiR-BOOT.', 0
+
+TXT_BootingNow1                db 'Avvio del sistema con ', 0
+; DO NOT MODIFY HERE
+TXT_BootingNow2                db ''''
+TXT_BootingNowPartName         db 12 dup (0) ; Space for BootThisPart-Name
+; DO NOT MODIFY TILL HERE
+TXT_BootingNowPartition        db '''', 0
+TXT_BootingNowKernel           db ' kernel', 0
+TXT_BootingHide                db '; part. attiva nascosta', 0
+TXT_BootingWait                db '; attendere, prego...', 13, 10, 13, 10, 0
+
+; FIXED LENGTH - 11 chars each string
+;----------------------------------|---------|------------------------------
+TXT_Floppy_NoName              db 'Nessun Nome'
+TXT_Floppy_Drive               db 'FloppyDrive'
+TXT_Floppy_NoDisc              db 'No Disco   '
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_PleaseEnterPassword        db ' Inserire la Password:', 0
+; the following 3 strings have to equal or *longer* than PleaseEnterPassword
+TXT_ProtectedSystem            db '** SISTEMA PROTETTO DA PASSWORD **', 0
+TXT_ProtectedSetup             db '** CONFIGURAZIONE PROTETTA DA PASSWORD **', 0
+TXT_ProtectedBootUp            db '** AVVIO PROTETTO DA PASSWORD **', 0
+
+; will get completed using TXT_ERROR_CheckFailed from MBR.asm
+TXT_ERROR_CheckConfig          db 13, 10, ' - La configurazione', 0
+
+;----------------------------------|----------------------------------------------------------|
+TXT_TooManyTries               db 'Troppi tentativi, Sistema Bloccato.', 0
Index: trunk/bootcode/text/nl/mbr.asm
===================================================================
--- trunk/bootcode/text/nl/mbr.asm	(revision 57)
+++ trunk/bootcode/text/nl/mbr.asm	(revision 57)
@@ -0,0 +1,32 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                          AiR-BOOT / MBR-TEXT
+; v001 - Dutch - by Kris Steenhaut
+;------------------------------------------------------------------------------
+
+TXT_LanguageID                equ 'N'
+
+; Those strings are saved within MBR.
+; Total Length maximum 165 chars (include 13,10 (CRs), excluding ending Zeros)
+
+TXT_ERROR_Attention            db 'AiR-BOOT: !OPGELET!', 13, 10, 0
+TXT_ERROR_CheckCode            db ' - AiR-BOOT', 0
+TXT_ERROR_CheckFailed          db ' is niet goed meer genstalleerd!', 13, 10
+                               db '   Start opnieuw op vanaf de Airboot diskette.', 13, 10
+                               db '   Afgebroken! Tik op de RESET knop .', 0
Index: trunk/bootcode/text/nl/menus.asm
===================================================================
--- trunk/bootcode/text/nl/menus.asm	(revision 57)
+++ trunk/bootcode/text/nl/menus.asm	(revision 57)
@@ -0,0 +1,388 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                          AiR-BOOT SETUP / ALL SETUP MENUS
+; v001 - Dutch - by Kris Steenhaut
+;---------------------------------------------------------------------------
+
+; Main Setup - Items - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUP_PartitionSetup       db 'PARTITIE-INDELING', 0
+TXT_SETUP_BasicOptions         db 'ALGEMENE OPTIES', 0
+TXT_SETUP_AdvOptions           db 'GEAVANCEERDE OPTIES', 0
+TXT_SETUP_ExtOptions           db 'NOG MEER OPSTARTOPTIES', 0
+TXT_SETUP_DefMasterPwd         db 'ALGEMEEN WACHTWOORD INSTELLEN', 0
+TXT_SETUP_DefBootPwd           db 'WACHTWOORD VOOR HET OPSTARTEN', 0
+TXT_SETUP_SaveAndExit          db 'OPSLAAN EN AFSLUITEN', 0
+TXT_SETUP_JustExit             db 'AFSLUITEN ZONDER OPSLAAN', 0
+
+; The Letters for all flags in Partition Setup
+TXT_SETUP_FlagLetterBootable   equ 'O'
+TXT_SETUP_FlagLetterVIBR       equ 'D'
+TXT_SETUP_FlagLetterHide       equ 'V'
+TXT_SETUP_FlagLetterDrvLetter  equ 'L'
+TXT_SETUP_FlagLetterExtMShack  equ 'P'
+
+TXT_SETUP_LetterYes            equ 'J'
+TXT_SETUP_LetterYes2           equ 'J'
+TXT_SETUP_LetterNo             equ 'N'
+
+; Basic Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_DefaultSelection     db 'Standaardkeuze', 0
+TXT_SETUP_TimedBoot            db 'Opstart met wachttijd', 0
+TXT_SETUP_TimedBootDelay       db 'Wachttijd: aantal sec', 0
+TXT_SETUP_TimedKeyHandling     db 'Toetsuitvoer regelen', 0
+TXT_SETUP_BootLastIfTimed      db 'Met wachttijd: ', 0
+TXT_SETUP_RememberLastBoot     db 'Vorige keuze', 0
+TXT_SETUP_RememberTimedBoot    db 'Vorige keuze/wachttijd', 0
+TXT_SETUP_IncludeFloppy        db 'Inclusief station A:', 0
+TXT_SETUP_ShowLVMDriveLetters  db 'Toon LVM Drive Letters',0
+TXT_SETUP_MbrProtection        db 'MBR beveiligen', 0
+TXT_SETUP_IgnoreMbrWrites      db '-> MBR niet beveiligen', 0
+TXT_SETUP_MakeSounds           db 'Geluidje laten horen', 0
+TXT_SETUP_CooperBars           db 'Coopers lichtspel', 0
+
+; Advanced Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_BootMenu             db 'Opstartmenu', 0
+TXT_SETUP_PartAutoDetect       db 'Autodetectie partities', 0
+TXT_SETUP_SecurityOptions      db '-> Beveiliging <-', 0
+TXT_SETUP_PasswordedSetup      db 'Setup versleuteld', 0
+TXT_SETUP_PasswordedSystem     db 'Systeem versleuteld', 0
+TXT_SETUP_PasswordedChangeBoot db 'Opstarten versleuteld', 0
+TXT_SETUP_GetFloppyName        db 'Zoek het diskettelabel', 0
+TXT_SETUP_GetFloppyName2Sec    db '-> Elke 2 seconden', 0
+TXT_SETUP_VirusDetect          db 'Virussen opzoeken', 0
+TXT_SETUP_StealthDetect        db 'Stealth viri opzoeken', 0
+TXT_SETUP_VIBRdetect           db 'VIBR opzoeken', 0
+TXT_SETUP_ContinueBIOSboot     db 'Opstarten van :', 0
+
+; Extended Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+; [Linux support removed since v1.02]
+;TXT_SETUP_LinuxKernelPart      db 'Linux Kernel Partitie', 0
+;TXT_SETUP_LinuxDefaultKernel   db 'Linux Standaard Kernel', 0
+;TXT_SETUP_LinuxRootPart        db 'Linux hoofdafdeling', 0
+; This here may be larger than 23 chars...
+;TXT_SETUP_DefLinuxCmd          db 'Opdrachtenreeks voor Linux', 0
+TXT_SETUP_IgnoreLVM            db 'LVM-gegevens negeren', 0
+;~ TXT_SETUP_ForceLBAUsage        db 'Enkel BIOS-LBA', 0
+TXT_SETUP_ExtPartMShack        db 'Ext-Part MS Workaround', 0
+;----------------------------------|---------------------|------------------
+
+; DYNAMIC LENGTH, maximum 11 chars excluding ending zero
+;----------------------------------|---------|------------------------------
+TXT_SETUP_MAGIC_Enabled        db 'Actief', 0
+TXT_SETUP_MAGIC_Disabled       db 'Niet actief', 0
+TXT_SETUP_MAGIC_Detailed       db 'Alles', 0
+TXT_SETUP_MAGIC_NoBootable     db 'Geen opstbr', 0
+; [Linux support removed since v1.02]
+;TXT_SETUP_MAGIC_NoLinux        db 'Geen Linux', 0
+TXT_SETUP_MAGIC_DoNothing      db 'Negeren', 0
+TXT_SETUP_MAGIC_ResetTime      db 'Tijd op nul', 0
+TXT_SETUP_MAGIC_StopTime       db 'Onderbreken', 0
+TXT_SETUP_MAGIC_CDROM          db 'CD-ROM', 0
+TXT_SETUP_MAGIC_Network        db 'Netwerk', 0
+TXT_SETUP_MAGIC_ZIPLS          db 'ZIP/LS120', 0
+; Max Length: 10 (used in Hide-Configuration as well)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Hidden         db 'Verbergen', 0
+TXT_SETUP_MAGIC_Unhidden       db 'Zichtbaar', 0
+; Max Length: 10 ("C:" will be appended afterwards)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Set            db 'kies ', 0
+
+; Setup Control Help - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUPHELP_Main             db 24,32,25,32,26,32,27,' : Maak uw keuze', 0
+                               db 'Enter   : Keuze bevestigen', 0
+                               db 'F10 : Opslaan en afsluiten', 0
+                               db 'Esc : Setup afsluiten', 0
+
+TXT_SETUPHELP_SubMenu          db 24,32,25,32,26,32,27,' : Item kiezen', 0
+                               db 'PgUp/Dn : Onderdelen van het item', 0
+                               db 'F1  : Hulp voor dit item', 0
+                               db 'Esc : Terug naar het hoofdmenu', 0
+
+TXT_SETUPHELP_PartSetup        db 24,32,25,32,26,32,27,' : Partitie kiezen', 0
+                               db 'Enter   : Label bewerken', 0
+                               db 'F1  : Uitleg bij de toetsen', 0
+                               db 'Esc : Terug naar het hoofdmenu', 0
+
+; HELP FOR EVERY MENU-ITEM, Maximum Length = 22 chars PER line. Maximum 5 lines
+
+                                  ;1234567890123456789012
+;----------------------------------|--------------------|--------------------
+TXT_SETUPHELP_PartitionSetup   db 'Partities opstartbaar', 0
+                               db 'maken, label wijzigen,', 0
+                               db 'partities verbergen of', 0
+                               db 'toegankelijk maken', 0
+                               db 'en nog veel meer.', 0
+                               db 0
+TXT_SETUPHELP_BasicOptions     db 'Opties voor minder', 0
+                               db 'ervaren gebruikers.', 0
+                               db 0
+TXT_SETUPHELP_AdvOptions       db 'Opties voor ervaren', 0
+                               db 'gebruikers. Stel hier', 0
+                               db 'niets in tenzij u goed', 0
+                               db 'weet waarover het gaat.', 0
+                               db 0
+TXT_SETUPHELP_ExtOptions       db 'Opties enkel bedoeld', 0
+                               db 'voor een bepaald sy-', 0
+                               db 'steem.', 0
+                               db 0
+TXT_SETUPHELP_DefMasterPwd     db 'Wachtwoord instellen', 0
+                               db 'voor de setup en voor', 0
+                               db 'het systeem.', 0
+                               db 0
+TXT_SETUPHELP_DefBootPwd       db 'Wachtwoord instellen', 0
+                               db 'voor de toegang', 0
+                               db 'tot het systeeem.', 0
+                               db 0
+TXT_SETUPHELP_SaveAndExit      db 'Het opstarten wordt nu', 0
+                               db 'verder gezet terwijl', 0
+                               db 'de nieuwe instellingen' , 0
+                               db 'bewaard worden.', 0
+                               db 0
+TXT_SETUPHELP_JustExit         db 'Het opstarten wordt nu', 0
+                               db 'verder gezet terwijl', 0
+                               db 'de nieuwe instellingen' , 0
+                               db 'NIET bewaard worden.', 0
+                               db 0
+TXT_SETUPHELP_InPartitionSetup db 'O - Opstartbaar', 0
+                               db 'D - Detectie van VIBR', 0
+                               db 'V - Verbergen', 0
+                               db 'L - Partitie letter', 0
+                               db 'P - Ext-Part MS invent', 0
+                               db 0
+
+TXT_SETUPHELP_HideSetup        db 'Bepaal hoe de andere', 0
+                               db 'partities moeten wor-', 0
+                               db 'den getoond wanneer', 0
+                               db 'van de nu gekozen par-', 0
+                               db 'titie wordt opgestart.', 0
+                               db 0
+
+; Basic Options - Help
+;----------------------------------|--------------------|--------------------
+TXT_SETUPHELP_DefaultSelection db 'Wijzigt de standaard-', 0
+                               db 'selectie. Ook als er', 0
+                               db 'een wachttijd werd', 0
+                               db 'ingesteld.' ,0
+                               db 0
+TXT_SETUPHELP_TimedBoot        db 'AiR-BOOT zal automa-', 0
+                               db 'tisch verder gaan na', 0
+                               db 'een bepaald interval.', 0
+                               db 0
+TXT_SETUPHELP_TimedBootDelay   db 'De afteltijd', 0
+                               db '(in seconden).', 0
+                               db 0
+TXT_SETUPHELP_TimedKeyHandling db 'Wat dient er te gebeu-', 0
+                               db 'ren indien tijdens het', 0
+                               db 'opstarten met wacht-', 0
+                               db 'tijd een toets', 0
+                               db 'wordt ingedrukt?', 0
+                               db 0
+TXT_SETUPHELP_BootLastIfTimed  db 'AiR-BOOT zal van de', 0
+                               db 'vorig gekozen partitie', 0
+                               db 'opstarten.', 0
+                               db 'Ofwel de standaard-', 0
+                               db 'partitie kiezen.', 0
+                               db 0
+TXT_SETUPHELP_RememberLastBoot db 'AiR-BOOT stelt de', 0
+                               db 'menubalk in op de par-', 0
+                               db 'titie die geselecteerd', 0
+                               db 'werd tijdens de vorige' ,0
+                               db 'opstart.', 0
+                               db 0
+TXT_SETUPHELP_RememberTimeBoot db 'Zoals hiervoor wordt', 0
+                               db 'de menubalk ingesteld', 0
+                               db 'gesteld op de partitie', 0
+                               db 'die bij het vorige op-', 0
+                               db 'starten werd gekozen.' ,0
+                               db 0
+TXT_SETUPHELP_IncludeFloppy    db 'U kunt van A: opstarten', 0
+                               db 'via het AiR-BOOTmenu.', 0
+                               db 0
+TXT_SETUPHELP_ShowLVMDriveLetters   db 'AiR-BOOT will show', 0
+                                    db 'LVM Drive Letters', 0
+                                    db 'in the menu.', 0
+                                    db 0
+TXT_SETUPHELP_MbrProtection    db 'Beveiligt het MBR via', 0
+                               db 'een residente code.', 0
+                               db '1 Kb geheugen vereist.', 0
+                               db 'Kan problemen geven', 0
+                               db 'op bepaalde systemen.',0
+                               db 0
+TXT_SETUPHELP_IgnoreMbrWrites  db 'Indien dit werd inge-,', 0
+                               db 'schakeld wordt elke', 0
+                               db 'schrijfactie naar de', 0
+                               db 'schijf genegeerd. An-', 0
+                               db 'ders volgt een "crash".', 0
+                               db 0
+TXT_SETUPHELP_MakeSounds       db 'Geluidjes laten horen', 0
+                               db 'via de interne', 0
+                               db 'PC luidspreker.', 0
+                               db 0
+TXT_SETUPHELP_CooperBars       db 'Laat enkele leuke', 0
+                               db 'dingetjes zien tijdens', 0
+                               db 'het opstarten.', 0
+                               db 0
+
+; Advanced Options - Help
+;----------------------------------|--------------------|--------------------
+TXT_SETUPHELP_BootMenu         db '"Uitgeschakeld": geen', 0
+                               db 'menu maar direct naar', 0
+                               db 'de standaardpartitie.', 0
+                               db '"Alles": laat details', 0
+                               db 'en meer info zien.', 0
+                               db 0
+TXT_SETUPHELP_PartAutoDetect   db 'Worden nieuwe parti-', 0
+                               db 'ties aangetrofen, dan', 0
+                               db 'worden deze', 0
+                               db 'opstartbaar gemaakt.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSetup  db 'Bij deze setup zal', 0
+                               db 'u naar een wachtwoord', 0
+                               db 'worden gevraagd.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSystem db 'Bij het opstarten', 0
+                               db 'wordt u dan naar het', 0
+                               db 'wachtwoord gevraagd.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedBoot   db 'Wordt zonder wachttijd', 0
+                               db 'opgestart, dan wordt u', 0
+                               db 'naar het wachtwoord', 0
+                               db 'gebraagd.', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName    db 'AiR-BOOT toont ook het', 0
+                               db 'diskettelabel in het,', 0
+                               db 'opstartmenu.', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName2Sec db 'Bovendien wordt het', 0
+                               db 'diskettelabel elke 2', 0
+                               db 'sec gecontroleerd.', 0
+                               db 0
+TXT_SETUPHELP_VirusDetect      db '"Doodgewone" virussen', 0
+                               db 'worden opgezocht.', 0
+                               db 0
+TXT_SETUPHELP_StealthDetect    db 'Opzoeken Stealth', 0
+                               db 'virussen.', 0
+                               db 0
+TXT_SETUPHELP_VIBRdetect       db 'Opzoeken VIBR.', 0
+                               db 'VIBR betekent:', 0
+                               db 'Virus-In-Boot-Record.', 0
+                               db 0
+
+;----------------------------------|--------------------|--------------------
+TXT_SETUPHELP_ContinueBIOSboot db 'Terug naar BIOS om op', 0
+                               db 'te starten van het', 0
+                               db 'VOLGENDE apparaat zo-', 0
+                               db 'als LS-120, Zipschijf,', 0
+                               db 'netwerk, CD-Rom, ...', 0
+                               db 0
+
+; Extended Options - Help
+;----------------------------------|--------------------|-------------------
+; [Linux support removed since v1.02]
+;TXT_SETUPHELP_LinuxKernelPart  db 'Bepaald de FAT-16', 0
+;                               db 'partitie voor uw Li-', 0
+;                               db 'nux kernelbestanden.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxDefaultKrnl db 'Specifieert de Linux', 0
+;                               db 'standaard kernel be-', 0
+;                               db 'standsnaam.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxRootPart    db 'Linux opstart-', 0
+;                               db 'partitie wijzigen.', 0
+;                               db 0
+;TXT_SETUPHELP_DefLinuxCmd:     db 'Opdrachten voor Linux', 0
+;                               db 'instellen, indien', 0
+;                               db 'Linux beschikbaar.', 0
+;                               db 0
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_IgnoreLVM        db 'Werd deze optie', 0
+                               db 'geactiveerd,dan worden', 0
+                               db 'LVM-gegevens als', 0
+                               db 'onbestaande beschouwd.', 0
+                               db 0
+;~ TXT_SETUPHELP_ForceLBAUsage    db 'Uitschakelen van de', 0
+                               ;~ db 'combinatie van LBA', 0
+                               ;~ db 'en CHS. Er wordt dan', 0
+                               ;~ db 'ENKEL gebruik gemaakt', 0
+                               ;~ db 'van de BIOS LBA API''s.', 0
+                               ;~ db 0
+TXT_SETUPHELP_ExtPartMShack    db 'Schakelt dynamische', 0
+                               db 'wijziging van ext.', 0
+                               db 'part. type id naar', 0
+                               db 'standaard of MS-Invent', 0
+                               db '(gedef. door P optie)', 0
+                               db 0
+
+; Maximum 26 chars (should not be reached)
+;----------------------------------|------------------------|---------------
+TXT_SETUPHELP_Base             db ' Hulp ', 0
+TXT_SETUPHELP_Enter            db '<ENTER>', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_PasswordOld          db 'Vorig wachtwoord:', 0
+TXT_SETUP_PasswordDefine       db 'Wachtwoord instellen:', 0
+TXT_SETUP_PasswordVerify       db 'Wachtwoord controleren:', 0
+TXT_SETUP_PasswordIncorrect    db 'Vorig wachtwoord niet juist. Jammer!', 0
+TXT_SETUP_PasswordMismatch     db 'Klopt niet! Het vorig wachtwoord wordt opnieuw ingesteld', 0
+TXT_SETUP_PasswordDisabled     db 'Er werd geen wachtwoord ingesteld -> Beveiliging uitgeschakeld', 0
+TXT_SETUP_PasswordMatched      db '** Klopt! Het nieuwe wachtwoord werd ingesteld **', 0
+
+; Maximum 60 chars (should not be reached anyway)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_SaveAndExitNow       db 'Opslaan en afsluiten.', 0
+TXT_SETUP_QuitWithoutSaveNow   db 'Afsluiten zonder op te slaan.', 0
+; Must be shorter than SaveAndExitNow / QuitWithoutSaveNow
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_AreYouSure1          db 'Zeker weten?', 0
+TXT_SETUP_AreYouSure2          db '(J/N)', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+; [Linux support removed since v1.02]
+;TXT_SETUP_EnterLinuxCmdLine    db 'U kan nu Linux opdrachten invoeren of wijzigen:', 0
+;TXT_SETUP_NoLinuxInstalled     db 'Linux niet aanwezig op uw systeem!', 0
+TXT_SETUP_NoLDLpartition       db 'Deze partitie werd noch FAT16/HPFS/JFS geformatteerd!', 0
+
+; Maximum 34 chars (should not be reached)
+;----------------------------------|--------------------------------|-------
+TXT_SETUP_HideFeature          db 'Verdwijntrucje', 0
+;----------------------------------|---------------------|------------------
+TXT_SETUP_HideFeature2         db 'Tonen bij opstart. ', 0
+
+; Drive-Letter Menu Header - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUP_DriveLetter          db 'Partitie letter', 0
+
+; Drive-Letter Keys - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUPHELP_DriveLetter      db 'Kies uit C @ Z', 0
+
+; Colors for special words hard-coded. Keep all 0s.
+;TXT_SETUP_LowerMessage:        db 'U mag dit programma ',0,'vrijelijk',0,' gebruiken ten privaten titel.',0
+;                               db 'U mag in ',0,'GEEN GEVAL',0,' AiR-BOOT gebruiken/verdelen indien dit op ',0,'-ENIGERLEI-',0,0
+;                               db 'manier, gepaard gaat met een geldelijke vergoeding.',0
+;                               db 'Wilt u AiR-BOOT gebruiken ',0,'in andere omstandigheden',0,', ',0,'zoals voorgenstalleerd',0,' of',0
+;                               db 'afzonderlijk verdeeld',0,', vraag het dan via email aan: ',0,'kiewitz@netlabs.org',0,' !',0
Index: trunk/bootcode/text/nl/other.asm
===================================================================
--- trunk/bootcode/text/nl/other.asm	(revision 57)
+++ trunk/bootcode/text/nl/other.asm	(revision 57)
@@ -0,0 +1,105 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                        AiR-BOOT / OTHER TEXT
+; v001 - Dutch - by Kris Steenhaut
+;------------------------------------------------------------------------------
+
+TXT_TranslationBy              db 'Dutch by Kris Steenhaut', 0
+
+; TopInfosX variables are used for Boot-Menu and Partition Setup
+
+; Maximum 2/10/11/6 chars
+;----------------------------------||---------------------------------------
+TXT_TopInfos_No                db 'Nr', 0
+TXT_TopInfos_Hd                db 'Hd', 0
+;----------------------------------|----------|-----------------------------
+TXT_TopInfos_HdSize            db 'Hd/Grootte:', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_Label             db 'Benamimg:', 0
+;----------------------------------|---------|------------------------------
+TXT_TopInfos_Type              db 'Type:', 0
+;----------------------------------|----|-----------------------------------
+TXT_TopInfos_Flags             db 'Flags:', 0      ; <-- for Partition Setup
+
+; Will be added together to one line, maximum 76 chars
+TXT_TimedBootLine              db 'Tijd over: er wordt opgestart van '''
+TXT_TimedBootEntryName         db 12 dup (0) ; Space for Default-Entry-Name
+TXT_TimedBootLine2             db      ''' de partitie na ', 0
+TXT_TimedBootSeconds           db ' seconden. ', 0
+TXT_TimedBootSecond            db ' second. ', 0 ; if only one is left, ELiTE :]
+; Maximum 76 chars
+;----------------------------------|--------------------------------------------------------------------------|
+TXT_TimedBootDisabled          db 'Het opstarten werd onderbroken. Tik op [Esc] om verder te gaan.', 0
+TXT_BootMenuHelpText1          db '[Esc] om te onderbreken/vervolgen.[Enter] om de keuze te starten.', 0
+TXT_BootMenuHelpText2          db 'Andere keuze met de pijltjestoetsen, tik [TAB] om de bios uitvoer te zien.', 0
+; Maximum 30 chars
+;----------------------------------|----------------------------|
+TXT_BootMenuEnterSetup         db 'Druk F10 voor setup', 0
+
+; Dynamic Length (till 80 chars)
+TXT_BrokenPartitionTable       db 13, 10, ' - U hard disk bevat minstens 1 beschadigde paritietabel element of u hard disk'
+                               db 13, 10, '   bevat bad sector. Systeem is gestopt.', 0
+TXT_TooManyPartitions          db 13, 10, ' - Er zijn teveel partities aanwezig. Het maximum is 45.', 0
+TXT_NoBootAble                 db 13, 10, ' - Geen opstartpartitie beschikbaar. Systeem is gestopt.', 0
+TXT_BIOSchanged                db 13, 10, ' - Het BIOS werd gewijzigd! Controleer eerst op virussen.'
+                               db 13, 10, '   Tik op een toets om verder te gaan...', 0
+;----------------------------------|--------------------------------------------------------------------------|
+TXT_VirusFoundMain             db 13, 10, ' - !OPGELET! -> Virusje gevonden! <- !OPGELET!', 13, 10, 0
+TXT_VirusFound1ok              db '    verwijderd, maar er kan misschien niet meer juist worden opgestart. Is,', 13, 10
+                               db '    dit het geval, herstart vanaf de AiR-BOOT systeem diskette.', 13, 10, 0
+TXT_VirusFound1damn            db '    Ook uw AiR-BOOT backup werd vernietigd. U moet dus terug opstarten', 13, 10
+                               db '    vanaf uw AiR-BOOT systeem diskette.', 13, 10, 0
+TXT_VirusFound1any             db '    U doet er best aan eerst te controleren virus achterblijvertjes.', 13, 10, 0
+TXT_VirusFound2                db '    Deze bevinden zich in het MBR van de partitie die u wou opstarten.', 13, 10
+                               db '    Gebruik hiervoor een anti-virusprogramma. Mogelijks slechts alarm.', 13, 10
+                               db '    Na de vewijdering moet u een en ander opnieuw instellen. Ga naar', 13, 10
+                               db '    ''Partities instellen'' en schakel VIBR-detectie tweemaal (aan/uit).', 13, 10
+                               db '    Indien slechts vals alarm, "uit" laten staan.', 13, 10, 0
+TXT_VirusFoundEnd              db '    Afgebroken! Tik op de RESET knop.', 0
+TXT_HowEnterSetup              db 13, 10, ' - Shift/Ctrl of Alt ingeduwd houden voor de AiR-BOOT Setup.', 0
+
+TXT_BootingNow1                db 'Er wordt nu opgestart van de ', 0
+; DO NOT MODIFY HERE
+TXT_BootingNow2                db '''', 0
+TXT_BootingNowPartName         db 12 dup (0) ; Space for BootThisPart-Name
+; DO NOT MODIFY TILL HERE
+TXT_BootingNowPartition        db ' partitie', 0
+TXT_BootingNowKernel           db ' kernel', 0
+TXT_BootingHide                db '; actieve verbergen', 0
+TXT_BootingWait                db '; Wachten graag...', 13, 10, 13, 10, 0
+
+; FIXED LENGTH - 11 chars each string
+;----------------------------------|---------|------------------------------
+TXT_Floppy_NoName              db 'Geen label '
+TXT_Floppy_Drive               db 'Station A: '
+TXT_Floppy_NoDisc              db 'Geen media '
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_PleaseEnterPassword        db 'Wachtwoord intikken:', 0
+; the following 3 strings have to equal or *longer* than PleaseEnterPassword
+TXT_ProtectedSystem            db '** SYSTEEM VERSLEUTELD! **', 0
+TXT_ProtectedSetup             db '** SETUP VERSLEUTELD! **', 0
+TXT_ProtectedBootUp            db '** OPSTARTEN VERSLEUTELD! **', 0
+
+; will get completed using TXT_ERROR_CheckFailed from MBR.asm
+TXT_ERROR_CheckConfig          db 13, 10, ' - De configuratie', 0
+
+;----------------------------------|----------------------------------------------------------|
+TXT_TooManyTries               db 'En keer teveel! Afgebroken!', 0
Index: trunk/bootcode/text/ru/mbr.asm
===================================================================
--- trunk/bootcode/text/ru/mbr.asm	(revision 57)
+++ trunk/bootcode/text/ru/mbr.asm	(revision 57)
@@ -0,0 +1,33 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                          AiR-BOOT / MBR-TEXT
+; v001 - Russian - by Denis Tazetdinov
+;------------------------------------------------------------------------------
+
+TXT_LanguageID                equ 'R'
+TXT_IncludeCyrillic           equ ON
+
+; Those strings are saved within MBR.
+; Total Length maximum 165 chars (include 13,10 (CRs), excluding ending Zeros)
+
+TXT_ERROR_Attention            db 'AiR-BOOT: !ATTENTION!', 13, 10, 0
+TXT_ERROR_CheckCode            db ' - The code', 0
+TXT_ERROR_CheckFailed          db ' of AiR-BOOT is not intact anymore.', 13, 10
+                               db '   Please boot via AiR-BOOT disc to restore AiR-BOOT.', 13, 10
+                               db '   System halted. Please press RESET.', 0
Index: trunk/bootcode/text/ru/menus.asm
===================================================================
--- trunk/bootcode/text/ru/menus.asm	(revision 57)
+++ trunk/bootcode/text/ru/menus.asm	(revision 57)
@@ -0,0 +1,384 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                          AiR-BOOT SETUP / ALL SETUP MENUS
+; v001 - English - by Martin Kiewitz
+;---------------------------------------------------------------------------
+
+; Main Setup - Items - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUP_PartitionSetup       db ' 
+', 0
+TXT_SETUP_BasicOptions         db '
+ ', 0
+TXT_SETUP_AdvOptions           db '
+
+ ', 0
+TXT_SETUP_ExtOptions           db ' 
+ ', 0
+TXT_SETUP_DefMasterPwd         db '  ', 0
+TXT_SETUP_DefBootPwd           db '   ', 0
+TXT_SETUP_SaveAndExit          db '  ', 0
+TXT_SETUP_JustExit             db ' 
+ 
+', 0
+
+; The Letters for all flags in Partition Setup
+TXT_SETUP_FlagLetterBootable   equ 'B'
+TXT_SETUP_FlagLetterVIBR       equ 'V'
+TXT_SETUP_FlagLetterHide       equ 'H'
+TXT_SETUP_FlagLetterDrvLetter  equ 'L'
+TXT_SETUP_FlagLetterExtMShack  equ 'P'
+
+TXT_SETUP_LetterYes            equ 'Y'
+TXT_SETUP_LetterYes2           equ 'Z'
+TXT_SETUP_LetterNo             equ 'N'
+
+; Basic Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_DefaultSelection     db 'ë¡®à ¯®-ã¬®«ç ­šî', 0
+TXT_SETUP_TimedBoot            db '¢â®¬ âšç¥áª ï § £àã§ª ', 0
+TXT_SETUP_TimedBootDelay       db 'à¥¬ï  ¢â®§ £àã§ªš (á)', 0
+TXT_SETUP_TimedKeyHandling     db '« ¢šèš ¢  ¢â®§ £àã§ª¥', 0
+TXT_SETUP_BootLastIfTimed      db 'àã§šâì ¯®á«¥€­îî ášáâ.', 0
+TXT_SETUP_RememberLastBoot     db '®¬­šâì ¯®á«¥€­îî ášáâ.', 0
+TXT_SETUP_RememberTimedBoot    db '®¬­šâì ¢  ¢â®§ £àã§ª¥', 0
+TXT_SETUP_IncludeFloppy        db '®¡ ¢šâì €šáª®¢®€', 0
+TXT_SETUP_ShowLVMDriveLetters  db 'Show LVM Drive Letters',0
+TXT_SETUP_MbrProtection        db ' éšâ  MBR', 0
+TXT_SETUP_IgnoreMbrWrites      db '-> ¥ ¬¥­ïâì MBR', 0
+TXT_SETUP_MakeSounds           db ' §à¥èšâì §¢ãªš', 0
+TXT_SETUP_CooperBars           db 'à áš¢ ï § £àãª ', 0
+
+; Advanced Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_BootMenu             db '¥­î ¯àš § £àã§ª¥', 0
+TXT_SETUP_PartAutoDetect       db '¢â®¯®šáª à §€¥«®¢', 0
+TXT_SETUP_SecurityOptions      db '-> ¥§®¯ á­®áâì <-', 0
+TXT_SETUP_PasswordedSetup      db ' áâà®©ªš ¯® ¯ à®«î', 0
+TXT_SETUP_PasswordedSystem     db 'šáâ¥¬  ¯® ¯ à®«î', 0
+TXT_SETUP_PasswordedChangeBoot db '¬¥­  ášáâ¥¬ë ¯® ¯ à®«î', 0
+TXT_SETUP_GetFloppyName        db '®«ãç âì ¬¥âªã €šáª¥âë', 0
+TXT_SETUP_GetFloppyName2Sec    db '->  Š€ë¥ 2 á¥ªã­€ë', 0
+TXT_SETUP_VirusDetect          db '®šáª ¢šàãá®¢', 0
+TXT_SETUP_StealthDetect        db '®šáª áâ¥«á-¢šàãá®¢', 0
+TXT_SETUP_VIBRdetect           db '®šáª MBR-¢šàãá®¢', 0
+TXT_SETUP_ContinueBIOSboot     db ' £àã§ª  ç¥à¥§ BIOS', 0
+
+; Extended Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+; [Linux support removed since v1.02]
+;TXT_SETUP_LinuxKernelPart      db ' §€¥« ï€à  Linux', 0
+;TXT_SETUP_LinuxDefaultKernel   db '€à® Linux ¯® ã¬®«ç ­šî', 0
+;TXT_SETUP_LinuxRootPart        db ' §€¥« ª®à­ï Linux', 0
+; This here may be larger than 23 chars...
+;TXT_SETUP_DefLinuxCmd          db '
+    LINUX', 0
+TXT_SETUP_IgnoreLVM            db '£­®àšà®¢ âì € ­­ë¥ LVM', 0
+;~ TXT_SETUP_ForceLBAUsage        db 'á¯®«ì§®¢ âì BIOS-LBA', 0
+TXT_SETUP_ExtPartMShack        db ' §€¥«ë €«ï MS-ášáâ¥¬', 0
+
+; DYNAMIC LENGTH, maximum 11 chars excluding ending zero
+;----------------------------------|---------|------------------------------
+TXT_SETUP_MAGIC_Enabled        db 'ª«îç¥­®', 0
+TXT_SETUP_MAGIC_Disabled       db 'ëª«îç¥­®', 0
+TXT_SETUP_MAGIC_Detailed       db '¥â «ì­®', 0
+TXT_SETUP_MAGIC_NoBootable     db '¥ § £àãŠ.', 0
+; [Linux support removed since v1.02]
+;TXT_SETUP_MAGIC_NoLinux        db '¥ Linux', 0
+TXT_SETUP_MAGIC_DoNothing      db '¥§€¥©áâ¢.', 0
+TXT_SETUP_MAGIC_ResetTime      db '­ ç « ', 0
+TXT_SETUP_MAGIC_StopTime       db 'â®¯ ¢à¥¬ï', 0
+TXT_SETUP_MAGIC_CDROM          db 'CD-ROM', 0
+TXT_SETUP_MAGIC_Network        db '¥âì', 0
+TXT_SETUP_MAGIC_ZIPLS          db 'ZIP/LS120', 0
+; Max Length: 10 (used in Hide-Configuration as well)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Hidden         db '¯àïâ ­', 0
+TXT_SETUP_MAGIC_Unhidden       db 'âªàëâ', 0
+; Max Length: 10 ("C:" will be appended afterwards)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Set            db '§ € âì ', 0
+
+; Setup Control Help - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUPHELP_Main             db 24,32,25,32,26,32,27,' : ë¡®à €¥©áâ¢šï', 0
+                               db               'Enter   : ®€â¢¥àŠ€¥­š¥', 0
+                               db               'F10 : ®åà ­šâì š ¢ë©âš', 0
+                               db               'Esc : ë©âš', 0
+
+TXT_SETUPHELP_SubMenu          db 24,32,25,32,26,32,27,' : ë¡®à ¯ã­ªâ', 0
+                               db               'PgUp/Dn : ¬¥­  ¯ã­ªâ ', 0
+                               db               'F1  : ®ª § âì ¯®¬®éì', 0
+                               db               'Esc : « ¢­®¥ ¬¥­î', 0
+
+TXT_SETUPHELP_PartSetup        db 24,32,25,32,26,32,27,' : ë¡®à à §€¥« ', 0
+                               db               'Enter   : ¬¥­  ¬¥âªš', 0
+                               db               'F1  : « £š (ª«îçš)', 0
+                               db               'Esc : « ¢­®¥ ¬¥­î', 0
+
+; HELP FOR EVERY MENU-ITEM, Maximum Length = 22 chars PER line. Maximum 5 lines
+
+                                  ;1234567890123456789012
+;----------------------------------|--------------------|-------------------
+
+TXT_SETUPHELP_PartitionSetup   db '®Š¥â¥ § € âì à §€¥«ë', 0
+                               db '§ £àãŠ ¥¬ë¬š, á¬¥­šâì', 0
+                               db 'šå ­ §¢ ­š¥, á¯àïâ âì', 0
+                               db 'š ¬­®£®¥ €àã£®¥.', 0
+                               db 0
+TXT_SETUPHELP_BasicOptions     db 'â® ­ áâà®©ªš €«ï', 0
+                               db '­ çš­ îéšå ¯®«ì§®-.', 0
+                               db '¢ â¥«¥©.', 0
+                               db 0
+TXT_SETUPHELP_AdvOptions       db 'âš ­ áâà®©ªš €«ï', 0
+                               db '®¯ëâ­ëå ¯®«ì§®¢ â¥«¥©.', 0
+                               db '
+á«š ë ­¥ §­ ¥â¥, çâ®', 0
+                               db '®­š §­ ç â, ­¥', 0
+                               db '¬¥­ï©â¥.', 0
+                               db 0
+TXT_SETUPHELP_ExtOptions       db ' áèšà¥­­ë¥ ®¯æšš €«ï', 0
+                               db 'à §­ëå ášáâ¥¬.', 0
+                               db 0
+TXT_SETUPHELP_DefMasterPwd     db ' € ­š¥ ¯ à®«ï €«ï', 0
+                               db '€®áâã¯  ª ­ áâà®©ª ¬', 0
+                               db 'š ášáâ¥¬¥.', 0
+                               db 0
+TXT_SETUPHELP_DefBootPwd       db ' € ­š¥ ¯ à®«ï €«ï', 0
+                               db '€®áâã¯  ª ášáâ¥¬¥.', 0
+                               db 0
+TXT_SETUPHELP_SaveAndExit      db 'à®€®«Ššâì § £àã§ªã š', 0
+                               db 'á®å­ ­šâì â¥ªãéš¥', 0
+                               db '­ áâà®©ªš.', 0
+                               db 0
+TXT_SETUPHELP_JustExit         db 'à®€®«Ššâì § £àã§ªã,', 0
+                               db '­® ®â¬¥­šâì ¢á¥', 0
+                               db 'š§¬¥­¥­šï ­ áâà®¥ª.', 0
+                               db 0
+
+TXT_SETUPHELP_InPartitionSetup db 'B -  £àãŠ ¥¬ë©', 0
+                               db 'V - ®šáª MBR-¢šàãá®¢', 0
+                               db 'H - ®€€¥àŠª  ¯àïâ ­šï', 0
+                               db 'L - ãª¢  à §€¥« ', 0
+                               db 'P -  áè.  §€. MS- ª', 0
+                               db 0
+
+TXT_SETUPHELP_HideSetup        db 'ë¡¥àšâ¥ á®áâ®ï­š¥,', 0
+                               db '¢ ª®â®à®¬ à §€¥«', 0
+                               db '€®«Š¥­ ¡ëâì, ª®£€ ', 0
+                               db '¢ë¡à ­­ë© à §€¥«', 0
+                               db '§ £àãŠ ¥âáï.', 0
+                               db 0
+
+; Basic Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_DefaultSelection db '¬¥­šâì  è ¢ë¡®à', 0
+                               db '¯®-ã¬®«ç ­šî.', 0
+                               db 0
+TXT_SETUPHELP_TimedBoot        db 'AiR-BOOT ¯à®€®«Ššâ', 0
+                               db '§ £àã§ªã ¯®á«¥ ãª -', 0
+                               db '§ ­­®£® ¢à¥¬¥­š.', 0
+                               db 0
+TXT_SETUPHELP_TimedBootDelay   db 'à¥¬ï €® ­ ç « ', 0
+                               db ' ¢â®§ £àã§ªš.', 0
+                               db 0
+TXT_SETUPHELP_TimedKeyHandling db '¥©áâ¢šâ¥ ¯àš ­ Š âšš', 0
+                               db 'ª« ¢šèš ¢ ¬¥­î § £àã§-', 0
+                               db 'ªš ¯àš ¢ª«îç¥­­®©', 0
+                               db ' ¢â®§ £àã§ª¥.', 0
+                               db 0
+TXT_SETUPHELP_BootLastIfTimed  db 'AiR-BOOT ¡ã€¥â £àã§šâì', 0
+                               db '¯®á«¥€­š© § £àãŠ¥­­ë©', 0
+                               db 'à §€¥« ¯àš  ¢â®§ £àã§-', 0
+                               db 'ª¥. ­ ç¥ - à §€¥« ¯®', 0
+                               db 'ã¬®«ç ­šî.', 0
+                               db 0
+TXT_SETUPHELP_RememberLastBoot db 'AiR-BOOT ¯¥à¥¬¥­áâšâ', 0
+                               db 'ãª § â¥«ì ¬¥­î ­  ¯®á-', 0
+                               db '«¥€­š© § £àãŠ¥­­ë©', 0
+                               db 'à §€¥« ¯àš áâ àâ¥.', 0
+                               db 0
+TXT_SETUPHELP_RememberTimeBoot db '­ «®£šç­® ¯à¥€ãé¥¬ã,', 0
+                               db 'AiR-BOOT § ¯®¬­šâ š', 0
+                               db '¯àš  ¢â®§ £àã§ª¥.', 0
+                               db 0
+TXT_SETUPHELP_IncludeFloppy    db 'AiR-BOOT à §à¥èšâ', 0
+                               db '§ £àã§ªã á €šáª  A:', 0
+                               db 'ç¥à¥§ ¬¥­î.', 0
+                               db 0
+TXT_SETUPHELP_ShowLVMDriveLetters   db 'AiR-BOOT will show', 0
+                                    db 'LVM Drive Letters', 0
+                                    db 'in the menu.', 0
+                                    db 0
+TXT_SETUPHELP_MbrProtection    db ' éšé ¥â MBR ç¥à¥§', 0
+                               db 'à¥§š€¥­â­ë© ª®€. ãŠ­®', 0
+                               db '1ª¡ ¡ §®¢®© ¯ ¬ïâš.', 0
+                               db '®Š¥â ¡ëâì ­¥ à ¡®â âì', 0
+                               db 'á ­¥ª®â®àë¬š .', 0
+                               db 0
+TXT_SETUPHELP_IgnoreMbrWrites  db '£­®àšà®¢ ­š¥ «î¡®©', 0
+                               db '§ ¯šáš ¢ MBR, š­ ç¥', 0
+                               db 'ášáâ¥¬  ¡ã€¥â', 0
+                               db '®áâ ­®¢«¥­ .', 0
+                               db 0
+TXT_SETUPHELP_MakeSounds       db 'AiR-BOOT ¡ã€¥â š£à âì', 0
+                               db '§¢ãªš ç¥à¥§ ¢áâà®¥­­ë©', 0
+                               db '€š­ ¬šª.', 0
+                               db 0
+TXT_SETUPHELP_CooperBars       db '€¥« ¥â § £àã§ªã ¡®«¥¥', 0
+                               db 'ªà áš¢®©.', 0
+                               db 0
+
+; Advanced Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_BootMenu         db 'ëª«îç¥­® - ã¡šà¥â', 0
+                               db '¬¥­î š £àã§šâ à §€¥«', 0
+                               db '¯® ã¬®«ç ­šî.', 0
+                               db '¥â «ì­® - ¯®ª Š¥â', 0
+                               db '¡®«ìè¥ š­ä®à¬ æšš.', 0
+                               db 0
+TXT_SETUPHELP_PartAutoDetect   db '
+á«š AiR-BOOT ­ ©€¥â', 0
+                               db '­®¢ë¥ à §€¥«ë, ®­ ', 0
+                               db 'á€¥« ¥â šå', 0
+                               db '§ £àãŠ ¥¬ë¬š.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSetup  db 'àš § å®€¥ ¢ ­ áâà©ªš', 0
+                               db 'ã  á á¯à®áïâ ¯ à®«ì.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSystem db 'àš áâ àâ¥ ª®¬¯ìîâ¥à ', 0
+                               db 'ã  á á¯à®áïâ ¯ à®«ì.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedBoot   db 'àš § £àã§ª¥ ¡¥§', 0
+                               db ' ¢â®§ £àã§ªš ã  á', 0
+                               db 'á¯à®áïâ ¯ à®«ì.', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName    db 'àš ¢ë¡®à¥ €šáª¥âë ¢', 0
+                               db '¬¥­î § £àã§ªš,', 0
+                               db 'AiR-BOOT ¯®ª Š¥â', 0
+                               db '¥¥ ¬¥âªã €šáª .', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName2Sec db '®¯®«­šâ¥«ì­® ¡ã€¥â', 0
+                               db '®¡­®¢«ïâì íâã ¬¥ªâã', 0
+                               db 'ª Š€ë¥ 2 á¥ªã­€ë.', 0
+                               db 0
+TXT_SETUPHELP_VirusDetect      db '®šáª ®¡ëç­ëå ¢šàãá®¢', 0
+                               db '(¯à®áâ¥©èšå).', 0
+                               db 0
+TXT_SETUPHELP_StealthDetect    db '®šáª áâ¥«á-¢šáãá®¢.', 0
+                               db 0
+TXT_SETUPHELP_VIBRdetect       db '®šáª ¢šàãá®¢ ¢ MBR.', 0
+                               db 0
+TXT_SETUPHELP_ContinueBIOSboot db 'â  ®¯æšï ¯®§¢®«šâ', 0
+                               db '¯à®€®«Ššâì § £àã§ªã', 0
+                               db 'ášáâ¥¬ë ç¥à¥§ áà¥€áâ¢ ', 0
+                               db 'BIOS.', 0
+                               db 0
+
+; Extended Options - Help
+;----------------------------------|--------------------|-------------------
+; [Linux support removed since v1.02]
+;TXT_SETUPHELP_LinuxKernelPart  db ' §€¥« FAT-16, ­ ', 0
+;                               db 'ª®â®à®¬ à á¯®«®Š¥­ë', 0
+;                               db ' èš ï€à  Linux.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxDefaultKrnl db '¬ï ä ©«  €«ï ï€à ', 0
+;                               db '¯® ã¬®«ç ­šî.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxRootPart    db ' §€¥« á ª®à­¥¢ë¬', 0
+;                               db 'ª â «®£®¬ Linux.', 0
+;                               db 0
+;TXT_SETUPHELP_DefLinuxCmd:     db '®¬ ­€­ ï áâà®ª  €«ï', 0
+;                               db '§ £àã§ªš Linux, ¥á«š', 0
+;                               db '­¥®¡å®€š¬®.', 0
+;                               db 0
+TXT_SETUPHELP_IgnoreLVM        db 'àš ¢ª«îç¥­šš íâ®©', 0
+                               db '®¯æšš AiR-BOOT ­¥', 0
+                               db '¡ã€¥â šáª âì', 0
+                               db 'š­ä®à¬ æšî LVM', 0
+                               db 0
+;~ TXT_SETUPHELP_ForceLBAUsage    db 'à¥¡ã€¥â šá¯®«ì§®¢ ­š¥', 0
+                               ;~ db 'BIOS LBA API ¢¬¥áâ®', 0
+                               ;~ db 'ª®¬¡š­šà®¢ ­­®£® - CHS', 0
+                               ;~ db 'š LBA.', 0
+                               ;~ db 0
+TXT_SETUPHELP_ExtPartMShack    db 'ª«îç ¥â €š­ ¬šç¥áªãî', 0
+                               db 'á¬¥­ã âš¯  à áèšà¥­­ëå', 0
+                               db 'à §€¥«®¢ ¢ áâ ­€ àâ­ë©', 0
+                               db 'š«š MS.', 0
+                               db '(ãª § âì ç¥à¥§ P-ä« £)', 0
+                               db 0
+
+; Maximum 26 chars (should not be reached)
+;----------------------------------|------------------------|---------------
+TXT_SETUPHELP_Base             db '  ', 0
+TXT_SETUPHELP_Enter            db '<ENTER>', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_PasswordOld          db 'â àë© ¯ à®«ì:', 0
+TXT_SETUP_PasswordDefine       db 'ª Ššâ¥ ¯ à®«ì:', 0
+TXT_SETUP_PasswordVerify       db '®¢â®àšâ¥ ¯ à®«ì:', 0
+TXT_SETUP_PasswordIncorrect    db 'â àë© ¯ à®«ì ­¥¢¥à¥­', 0
+TXT_SETUP_PasswordMismatch     db '¥á®¢¯ €¥­š¥! ®ááâ ­®¢«¥­ áâ àë© ¯ à®«ì', 0
+TXT_SETUP_PasswordDisabled     db '¥â ¯ à®«ï -> § éšâ  ®âª«îç¥­ ', 0
+TXT_SETUP_PasswordMatched      db '** ®€â¢¥àŠ€¥­®!  € ­ ­®¢ë© ¯ à®«ì **', 0
+
+; Maximum 60 chars (should not be reached anyway)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_SaveAndExitNow       db '  ', 0
+TXT_SETUP_QuitWithoutSaveNow   db ' 
+ 
+', 0
+; Must be shorter than SaveAndExitNow / QuitWithoutSaveNow
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_AreYouSure1          db ' 
+
+?', 0
+TXT_SETUP_AreYouSure2          db '(Y/N)', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+; [Linux support removed since v1.02]
+;TXT_SETUP_EnterLinuxCmdLine    db '¢¥€šâ¥ š«š šá¯à ¢ìâ¥ ª®¬ ­€­ãî áâà®ªã:', 0
+;TXT_SETUP_NoLinuxInstalled     db '  á ­¥ ãáâ ­®¢«¥­ Linux', 0
+TXT_SETUP_NoLDLpartition       db 'ë¡à ­­ë© à §€¥« ­¥ ï¢«ï¥âáï HPFS/FAT16/JFS', 0
+
+; Maximum 34 chars (should not be reached)
+;----------------------------------|--------------------------------|-------
+TXT_SETUP_HideFeature          db '®€€¥àŠª  áªàëâšï', 0
+;----------------------------------|---------------------|------------------
+TXT_SETUP_HideFeature2         db '®áâ®ï­š¥ ¯àš § £àã§ª¥ ', 0
+
+; Drive-Letter Menu Header - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUP_DriveLetter          db 'ãª¢  à §€¥« ', 0
+
+; Drive-Letter Keys - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUPHELP_DriveLetter      db ' Š¬šâ¥ C-Z', 0
+
+; Colors for special words hard-coded. Keep all 0s.
+;TXT_SETUP_LowerMessage         db 'â  ¯à®£à ¬¬  ',0,'¡¥á¯« â­ ',0,' €«ï ­¥ª®¬¬¥àç¥áª®£® šá¯®«ì§®¢ ­šï.',0
+;                               db 'ë ',0,'
+',0,' ¬®Š¥â¥ à á¯à®áâà ­ïâì/šá¯®«ì§®¢ âì AiR-BOOT ¢ ',0,'--',0,' ä®à¬¥,',0
+;                               db '¥á«š ë ¯®«ãç ¥â¥ §  íâ® €¥­ì£š.',0
+;                               db '
+á«š ë å®âšâ¥ šá¯®«ì§®¢ âì AiR-BOOT ¢ ',0,'¢ €àã£šå ášáâ¥¬ å',0,', ',0,'¯à¥€ãáâ ­ ¢«š¢ âì',0,' š«š',0
+;                               db 'à á¯à®áâà ­ïâì',0,' á¢ïŠšâ¥áì á® ¬­®© ¯® e-mail: ',0,'kiewitz@netlabs.org',0,' !',0
Index: trunk/bootcode/text/ru/other.asm
===================================================================
--- trunk/bootcode/text/ru/other.asm	(revision 57)
+++ trunk/bootcode/text/ru/other.asm	(revision 57)
@@ -0,0 +1,121 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                        AiR-BOOT / OTHER TEXT
+; v001 - English - by Martin Kiewitz
+;------------------------------------------------------------------------------
+
+TXT_TranslationBy              db 'Russian by Denis Tazetdinov', 0
+
+; TopInfosX variables are used for Boot-Menu and Partition Setup
+
+; Maximum 2/10/11/6 chars
+;----------------------------------||---------------------------------------
+TXT_TopInfos_No                db 'No', 0
+TXT_TopInfos_Hd                db 'Hd', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_HdSize            db 'Hd/ §¬¥à:', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_Label             db '¬ï:', 0
+;----------------------------------|---------|------------------------------
+TXT_TopInfos_Type              db 'š¯:', 0
+;----------------------------------|----|-----------------------------------
+TXT_TopInfos_Flags             db '« £š:', 0      ; <-- for Partition Setup
+
+; Will be added together to one line, maximum 76 chars
+TXT_TimedBootLine              db '¢â®§ £àã§ª  ¢ª«çî¥­ . ã€¥â § £àãŠ¥­  '''
+TXT_TimedBootEntryName         db 12 dup (0) ; Space for Default-Entry-Name
+TXT_TimedBootLine2             db      ''' ç¥à¥§ ', 0
+TXT_TimedBootSeconds           db ' á¥ªã­€. ', 0
+TXT_TimedBootSecond            db ' á¥ªã­€ã. ', 0 ; if only one is left, ELiTE :]
+; Maximum 76 chars
+;----------------------------------|--------------------------------------------------------------------------|
+TXT_TimedBootDisabled          db '¢â®§ £àã§ª  ®âª«îç¥­ , â ©¬¥à ®âª«îç¥­.', 0
+TXT_BootMenuHelpText1          db ' Š¬šâ¥ [Esc] €«ï ¯¥à¥ª«îç¥­šï  ¢â®§ £àã§ªš, [Enter] €«ï ¢ë¡®à  à §€¥« .', 0
+TXT_BootMenuHelpText2          db 'ë¡¥àšâ¥ à §€¥« š«š ­ Š¬šâ¥ [TAB], çâ®¡ë ã¢š€¥âì á®®¡é¥­šï BIOS POST.', 0
+; Maximum 30 chars
+;----------------------------------|----------------------------|
+TXT_BootMenuEnterSetup         db 'F10 €«ï á¬¥­ë ­ áâà®¥ª.', 0
+
+; Dynamic Length (till 80 chars)
+TXT_BrokenPartitionTable       db 13, 10, ' - ¡­ àãŠ¥­ ¬š­š¬ã¬ ®€š­ šá¯®àç¥­­ë© à §€¥«, «š¡® â ¡«šæ  à §€¥«®¢ á®€¥àŠšâ'
+                               db 13, 10, '   á¡®©­ë¥ ¡«®ªš. šáâ¥¬  ®áâ ­®¢«¥­ .', 0
+TXT_TooManyPartitions          db 13, 10, ' - «šèª®¬ ¬­®£® à §€¥«®¢ ­ ©€¥­®. AiR-BOOT ¯®€€¥àŠš¢ ¥â €® 45.', 0
+TXT_NoBootAble                 db 13, 10, ' - ¥ ­ ©€¥­® § £àãŠ ¥¬ëå à §€¥«®¢. šáâ¥¬  ®áâ ­®¢«¥­ .', 0
+TXT_BIOSchanged                db 13, 10, ' - BIOS 
+, ¯à®¢¥àìâ¥ á¢®î ášáâ¥¬ã ­  ¯à¥€¬¥â ¢šàãá®¢.'
+                               db 13, 10, '    Š¬šâ¥ «î¡ãî ª« ¢šèã €«ï ¯à®€®«Š¥­šï...', 0
+
+TXT_VirusFoundMain             db 13, 10, ' - !
+! -> 
+  <- !
+!', 13, 10, 0
+TXT_VirusFound1ok              db '    ­ ¡ë« ã­âšçâ®Š¥­, ­® ášáâ¥¬  ¬®Š¥â ­¥ § £àã§šâìáï ¯à ¢š«ì­®. 
+á«š íâ®', 13, 10
+                               db '    íâ® ¯à®š§®©€¥â, šá¯®«ì§ã©â¥  è €šáª AiR-BOOT.', 13, 10, 0
+TXT_VirusFound1damn            db '     á®Š «¥­šî, ®­ áâ¥à ­ áâà®©ªš AiR-BOOT. ë €®«Š­ë § £àã§šâìáï, šá¯®«ì§ãï', 13, 10
+                               db '     è €šáª AiR-BOOT.', 13, 10, 0
+TXT_VirusFound1any             db '    «ï ¡¥§®¯ á­®áâš,  ¬ á«¥€ã¥â ¯à®¢¥àšâì  èš Š¥áâªš¥ €šáªš ­  ¢šàãáë.', 13, 10, 0
+TXT_VirusFound2                db '    šàãá ­ å®€šâáï ¢ MBR à §€¥« , ª®â®àë© ë å®âšâ¥ § £àã§šâì.', 13, 10
+                               db '    á¯®«ì§ã©â¥ ¯à®£à ¬¬ë ¯®šáª  ¢šàãá®¢.  ªŠ¥ íâ® ¬®Š¥â ¡ëâì ®èš¡®ç­ë¬', 13, 10
+                               db '    ¯à¥€ã¯à¥Š€¥­š¥¬. ®á«¥ ã€ «¥­šï ¢šàãá , ë €®«Š­ë ¯¥à¥§ € âì ¯¥à¥¬¥­­ë¥', 13, 10
+                               db '    ¯®šáª  ¢šàãá®¢ ¢ ''
+ 
+'' š ¯¥à¥ª«îçšâì ¯®šáª MBR-¢šàãá®¢ €¢ .', 13, 10
+                               db '    à §  (¢ëª«/¢ª«). 
+á«š íâ® ¡ë«® ®èš¡®ç­®¥ ¯à¥€ã¯à¥Š€¥­š¥', 13, 10
+                               db '    ®áâ ¢ìâ¥ ¥£® ¢ "¢ëª«".', 13, 10, 0
+TXT_VirusFoundEnd              db '    šáâ¥¬  ®áâ ­®¢«¥­ . ®Š «ã©áâ , ­ Š¬šâ¥ RESET.', 0
+TXT_HowEnterSetup              db 13, 10, ' -  Š¬šâ¥ š €¥àŠšâ¥ Ctrl š«š Alt €«ï ¢å®€  ¢ ­ áâà®©ªš AiR-BOOT.', 0
+
+TXT_BootingNow1                db ' £àã§ª  ášáâ¥¬ë, šá¯®«ì§ãï ', 0
+; DO NOT MODIFY HERE
+TXT_BootingNow2                db '''', 0
+TXT_BootingNowPartName         db 12 dup (0) ; Space for BootThisPart-Name
+; DO NOT MODIFY TILL HERE
+TXT_BootingNowPartition        db ' à §€¥«', 0
+TXT_BootingNowKernel           db ' ï€à®', 0
+TXT_BootingHide                db '; á®ªàëâš¥  ªâš¢­®', 0
+TXT_BootingWait                db '; ¯®Š «ã©áâ , ¯®€®Š€šâ¥...', 13, 10, 13, 10, 0
+
+; FIXED LENGTH - 11 chars each string
+;----------------------------------|---------|------------------------------
+TXT_Floppy_NoName              db '¥§ š¬¥­š  '
+TXT_Floppy_Drive               db 'šáª®¢®€   '
+TXT_Floppy_NoDisc              db '¥â €šáª   '
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_PleaseEnterPassword        db ' ®Š «ã©áâ , ¢¢¥€šâ¥ ¯ à®«ì:', 0
+; the following 3 strings have to equal or *longer* than PleaseEnterPassword
+TXT_ProtectedSystem            db '**  
+ 
+ 
+  **', 0
+TXT_ProtectedSetup             db '**  
+ 
+ **', 0
+TXT_ProtectedBootUp            db '**  
+ 
+! **', 0
+
+; will get completed using TXT_ERROR_CheckFailed from MBR.asm
+TXT_ERROR_CheckConfig          db 13, 10, ' - ®­äš£ãà æšï', 0
+
+;----------------------------------|----------------------------------------------------------|
+TXT_TooManyTries               db '«šèª®¬ ¬­®£® ¯®¯ëâ®ª, ášáâ¥¬  ®áâ ­®¢«¥­ ', 0
Index: trunk/bootcode/text/sw/mbr.asm
===================================================================
--- trunk/bootcode/text/sw/mbr.asm	(revision 57)
+++ trunk/bootcode/text/sw/mbr.asm	(revision 57)
@@ -0,0 +1,32 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                          AiR-BOOT / MBR-TEXT
+; v046 - Swedish - by Bjrn Sderstrm
+;------------------------------------------------------------------------------
+
+TXT_LanguageID                equ 'S'
+
+; Those strings are saved within MBR.
+; Total Length maximum 165 chars (include 13,10 (CRs), excluding ending Zeros)
+
+TXT_ERROR_Attention            db 'AiR-BOOT: !VARNING!', 13, 10, 0
+TXT_ERROR_CheckCode            db ' - Kod', 0
+TXT_ERROR_CheckFailed          db ' hos AiR-BOOT inte intakt lngre.', 13, 10
+                               db '   Boota via AiR-BOOTs disk fr att terskapa AiR-BOOT.', 13, 10
+                               db '   System haltat. Tryck RESET.', 0
Index: trunk/bootcode/text/sw/menus.asm
===================================================================
--- trunk/bootcode/text/sw/menus.asm	(revision 57)
+++ trunk/bootcode/text/sw/menus.asm	(revision 57)
@@ -0,0 +1,394 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;---------------------------------------------------------------------------
+;                                          AiR-BOOT SETUP / ALL SETUP MENUS
+; v046 - Swedish - by Bjrn Sderstrm
+;---------------------------------------------------------------------------
+
+; Main Setup - Items - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUP_PartitionSetup       db 'SETUP AV PARTITIONER', 0
+TXT_SETUP_BasicOptions         db 'GRUNDLGGANDE OPTIONER', 0
+TXT_SETUP_AdvOptions           db 'AVANCERADE OPTIONER', 0
+TXT_SETUP_ExtOptions           db 'UTKADE BOOTNINGSOPTIONER', 0
+TXT_SETUP_DefMasterPwd         db 'DEFINIERA MASTER LSENORD', 0
+TXT_SETUP_DefBootPwd           db 'DEFINIERA BOOT LSENORD', 0
+TXT_SETUP_SaveAndExit          db 'SPARA & AVSLUTA SETUP', 0
+TXT_SETUP_JustExit             db 'AVSLUTA UTAN ATT SPARA', 0
+
+; The Letters for all flags in Partition Setup
+TXT_SETUP_FlagLetterBootable   equ 'B'
+TXT_SETUP_FlagLetterVIBR       equ 'V'
+TXT_SETUP_FlagLetterHide       equ 'H'
+TXT_SETUP_FlagLetterDrvLetter  equ 'L'
+TXT_SETUP_FlagLetterExtMShack  equ 'P'
+
+TXT_SETUP_LetterYes            equ 'J'
+TXT_SETUP_LetterYes2           equ 'Z'
+TXT_SETUP_LetterNo             equ 'N'
+
+; Basic Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_DefaultSelection     db 'Standard Partition', 0
+TXT_SETUP_TimedBoot            db 'Tidstyrd Bootning', 0
+TXT_SETUP_TimedBootDelay       db 'TidsBoot Frdrj (sek)', 0
+TXT_SETUP_TimedKeyHandling     db 'Tids Tangenthantering', 0
+TXT_SETUP_BootLastIfTimed      db 'Boota fr.Senast Om Tids', 0
+TXT_SETUP_RememberLastBoot     db 'Kom Ihg Senaste Boot', 0
+TXT_SETUP_RememberTimedBoot    db 'Kom Ihg Tids Boot', 0
+TXT_SETUP_IncludeFloppy        db 'Inkludera Diskettenhet', 0
+TXT_SETUP_ShowLVMDriveLetters  db 'Show LVM Drive Letters',0
+TXT_SETUP_MbrProtection        db 'MBR Skydd', 0
+TXT_SETUP_IgnoreMbrWrites      db '-> Ignorera MBR Skriv', 0
+TXT_SETUP_MakeSounds           db 'Anvnd Ljud', 0
+TXT_SETUP_CooperBars           db 'Cooper Bars', 0
+
+; Advanced Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+TXT_SETUP_BootMenu             db 'Bootning Meny', 0
+TXT_SETUP_PartAutoDetect       db 'Partition Autoupptck', 0
+TXT_SETUP_SecurityOptions      db '-> Skerhet Opt. <-', 0
+TXT_SETUP_PasswordedSetup      db 'Lsenskyddad Setup', 0
+TXT_SETUP_PasswordedSystem     db 'Lsenskyddat System', 0
+TXT_SETUP_PasswordedChangeBoot db 'Lsenskyddad Bootndr.', 0
+TXT_SETUP_GetFloppyName        db 'Hmta Diskettnamn', 0
+TXT_SETUP_GetFloppyName2Sec    db '-> Hmta Var 2 Sekund', 0
+TXT_SETUP_VirusDetect          db 'Virus Upptckt', 0
+TXT_SETUP_StealthDetect        db 'Stealth Upptckt', 0
+TXT_SETUP_VIBRdetect           db 'VIBR Upptckt', 0
+TXT_SETUP_ContinueBIOSboot     db 'Fortstt BIOS Boot Sekv', 0
+
+; Extended Options - Items - Max Length: 23
+;----------------------------------|---------------------|------------------
+; [Linux support removed since v1.02]
+;TXT_SETUP_LinuxKernelPart      db 'Linux Kernel Partition', 0
+;TXT_SETUP_LinuxDefaultKernel   db 'Linux Standard Krna', 0
+;TXT_SETUP_LinuxRootPart        db 'Linux Root Partition', 0
+; This here may be larger than 23 chars...
+;TXT_SETUP_DefLinuxCmd          db 'DEFINIERA KOMMANDORAD FR LINUX', 0
+TXT_SETUP_IgnoreLVM            db 'Ignore LVM information', 0
+; ###
+;~ TXT_SETUP_ForceLBAUsage        db 'Forc BIOS-LBA Anvndn.', 0
+TXT_SETUP_ExtPartMShack        db 'Ext-Part MS Workaround', 0
+
+; DYNAMIC LENGTH, maximum 11 chars excluding ending zero
+;----------------------------------|---------|------------------------------
+TXT_SETUP_MAGIC_Enabled        db 'Aktiverad', 0
+TXT_SETUP_MAGIC_Disabled       db 'Avaktiverad', 0
+TXT_SETUP_MAGIC_Detailed       db 'Detaljerad', 0
+TXT_SETUP_MAGIC_NoBootable     db 'Ej Bootbar', 0
+; [Linux support removed since v1.02]
+;TXT_SETUP_MAGIC_NoLinux        db 'Ej Linux', 0
+TXT_SETUP_MAGIC_DoNothing      db 'Gr Inget', 0
+TXT_SETUP_MAGIC_ResetTime      db 'terst. Tid', 0
+TXT_SETUP_MAGIC_StopTime       db 'Stopp Tid', 0
+TXT_SETUP_MAGIC_CDROM          db 'CD-ROM', 0
+TXT_SETUP_MAGIC_Network        db 'Ntverk', 0
+TXT_SETUP_MAGIC_ZIPLS          db 'ZIP/LS120', 0
+; Max Length: 10 (used in Hide-Configuration as well)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Hidden         db 'Dold', 0
+TXT_SETUP_MAGIC_Unhidden       db 'Ej Dold', 0
+; Max Length: 10 ("C:" will be appended afterwards)
+;----------------------------------|--------|-------------------------------
+TXT_SETUP_MAGIC_Set            db 'stt ', 0
+
+; Setup Control Help - Max Length: 33
+;----------------------------------|-------------------------------|--------
+TXT_SETUPHELP_Main             db 24,32,25,32,26,32,27,' : Vlj Aktion', 0
+                               db               'Enter   : Vlj Aktion', 0
+                               db               'F10 : Spara&Avsluta Setup', 0
+                               db               'Esc : Lmna Setup', 0
+
+TXT_SETUPHELP_SubMenu          db 24,32,25,32,26,32,27,' : Vlj Post', 0
+                               db               'PgUp/Dn : ndra Post', 0
+                               db               'F1  : Visa hjlp fr post', 0
+                               db               'Esc : tervnd till huvud-menyn', 0
+
+TXT_SETUPHELP_PartSetup        db 24,32,25,32,26,32,27,' : Vlj partition', 0
+                               db               'Enter   : Editera etikett', 0
+                               db               'F1  : Flagga (tryck tg fr vxl)', 0
+                               db               'Esc : tervnd till huvud-menyn', 0
+
+; HELP FOR EVERY MENU-ITEM, Maximum Length = 22 chars PER line. Maximum 5 lines
+
+                                  ;1234567890123456789012
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_PartitionSetup   db 'Gr dina partitioner', 0
+                               db 'bootningsbara, ndra', 0
+                               db 'deras namn, definiera', 0
+                               db 'gmma och mycket', 0
+                               db 'annat.', 0
+                               db 0
+TXT_SETUPHELP_BasicOptions     db 'Dessa optioner r fr', 0
+                               db 'oerfarna anvndare.', 0
+TXT_SETUPHELP_AdvOptions       db 'Dessa r fr', 0
+                               db 'avancerade anvndare.', 0
+                               db 'Om du inte vet vad de', 0
+                               db 'gr, lmna som de r.', 0
+                               db 0
+TXT_SETUPHELP_ExtOptions       db 'Utkade optioner fr', 0
+                               db 'specifika OS.', 0
+                               db 0
+TXT_SETUPHELP_DefMasterPwd     db 'Definiera ett', 0
+                               db 'lsenord fr access', 0
+                               db 'till setup och', 0
+                               db 'system.', 0
+                               db 0
+TXT_SETUPHELP_DefBootPwd       db 'Definiera ett', 0
+                               db 'lsenord fr access', 0
+                               db 'till system.',0
+                               db 0
+TXT_SETUPHELP_SaveAndExit      db 'Kommer att forstta', 0
+                               db 'bootprocessen och', 0
+                               db 'spara de aktuella', 0
+                               db 'optionerna.',0
+                               db 0
+TXT_SETUPHELP_JustExit         db 'Kommer att forstta', 0
+                               db 'men ignorerar alla', 0
+                               db 'ndringar som gjorts', 0
+                               db 'till optionerna.',0
+                               db 0
+
+TXT_SETUPHELP_InPartitionSetup db 'B - Bootningbar', 0
+                               db 'V - VIBR-Upptckt', 0
+                               db 'H - Dolt Std', 0
+                               db 'L - Partition Bokstav', 0
+                               db 'P - Ext-Part MS invent', 0
+                               db 0
+
+TXT_SETUPHELP_HideSetup        db 'Vlj status fr', 0
+                               db 'vilka partitioner', 0
+                               db 'som skall dljas,', 0
+                               db 'nr den aktuellt valda', 0
+                               db 'partitionen bootas.', 0
+                               db 0
+
+; Basic Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_DefaultSelection db 'Changes your default', 0
+                               db 'selection. It can be', 0
+                               db 'used on Timed Boot.', 0
+                               db 0
+; ####
+TXT_SETUPHELP_DefaultPart      db 'ndrar din standard', 0
+                               db 'partition. Den kan', 0
+                               db 'anvndas vid Tidstyrd', 0
+                               db 'Bootning.', 0
+                               db 0
+TXT_SETUPHELP_TimedBoot        db 'AiR-BOOT kommer att', 0
+                               db 'fortstta automatiskt', 0
+                               db 'efter en specificerad', 0
+                               db 'frdrjning.', 0
+                               db 0
+TXT_SETUPHELP_TimedBootDelay   db 'Den omnmnda', 0
+                               db 'frdrjningen fr.', 0
+                               db 'Tidsstyrd Bootning.', 0
+                               db 0
+TXT_SETUPHELP_TimedKeyHandling db 'Om du trycker en', 0
+                               db 'tangent i Bootmenyn', 0
+                               db 'nr du anvnder Tids', 0
+                               db 'Boot, vad skall', 0
+                               db 'AiR-BOOT gra?',0
+                               db 0
+TXT_SETUPHELP_BootLastIfTimed  db 'AiR-BOOT kommer att', 0
+                               db 'anvnda sist-bootade', 0
+                               db 'part. med TidsBoot.', 0
+                               db 'Annars kommer den', 0
+                               db 'att anvnda standard', 0
+			                   db 0
+TXT_SETUPHELP_RememberLastBoot db 'AiR-BOOT kommer att', 0
+                               db 'hlla meny-raden p', 0
+                               db 'sist bootade', 0
+                               db 'partionen vid start.', 0
+                               db 0
+TXT_SETUPHELP_RememberTimeBoot db 'Liksom den senaste', 0
+                               db 'optionen, kommer', 0
+                               db 'AiR-BOOT att hlla', 0
+                               db 'raden ocks fr', 0
+                               db 'Tidsstyrd Bootning.', 0
+			                   db 0
+TXT_SETUPHELP_IncludeFloppy    db 'AiR-BOOT kommer att', 0
+                               db 'tillta booting', 0
+                               db 'frn A: via menyn.', 0
+                               db 0
+TXT_SETUPHELP_ShowLVMDriveLetters   db 'AiR-BOOT will show', 0
+                                    db 'LVM Drive Letters', 0
+                                    db 'in the menu.', 0
+                                    db 0
+TXT_SETUPHELP_MbrProtection    db 'Skydda din MBR via', 0
+                               db 'resident kod. Behver', 0
+                               db '1 KByte av bas-minne', 0
+                               db 'Kan vara inkompatibelt', 0
+                               db 'med vissa OS.', 0
+			                   db 0
+TXT_SETUPHELP_IgnoreMbrWrites  db 'Om det r aktiverat,', 0
+                               db 'kommer all skrivning', 0
+                               db 'att ignoreras, annars', 0
+                               db 'kommer systemet att', 0
+                               db '"krascha".', 0
+                               db 0
+TXT_SETUPHELP_MakeSounds       db 'AiR-BOOT kan fs att', 0
+                               db 'utfra ljud med din', 0
+                               db 'interna hgtalare.', 0
+                               db 0
+TXT_SETUPHELP_CooperBars       db 'Kommer att utfra', 0
+                               db 'snygga effekter', 0
+                               db 'under bootning.', 0
+                               db 0
+
+; Advanced Options - Help
+;----------------------------------|--------------------|-------------------
+TXT_SETUPHELP_BootMenu         db 'Avaktiverad visar den', 0
+                               db 'inte menyn och bootar', 0
+                               db 'standard partion', 0
+                               db 'direkt. Detaljerad', 0
+                               db 'visar mer information.', 0
+                               db 0
+TXT_SETUPHELP_PartAutoDetect   db 'Om AiR-BOOT hittar nya', 0
+                               db 'partitioner, kommer', 0
+                               db 'den att gra dom', 0
+                               db 'bootningsbara.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSetup  db 'Nr du kommer till den', 0
+                               db 'hr setupen, kommer du', 0
+                               db 'att bli tillfrgad om', 0
+                               db 'ett lsenord.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedSystem db 'Nr du bootar din', 0
+                               db 'dator, kommer du att', 0
+                               db 'bli tillfrgad om det.', 0
+                               db 0
+TXT_SETUPHELP_PasswordedBoot   db 'Nr Tidstyrd Bootning', 0
+                               db 'inte anvnds kommer du', 0
+                               db 'att bli tillfrgad.', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName    db 'Nr du visar diskett', 0
+                               db 'i boot-menyn, kommer', 0
+                               db 'AiR-BOOT att hmta', 0
+                               db 'diskettnamnet.', 0
+                               db 0
+TXT_SETUPHELP_GetFloppyName2Sec db 'Som tillgg kommer', 0
+                               db 'den att uppdatera', 0
+                               db 'diskettnamnet', 0
+                               db 'varannan sekund.', 0
+                               db 0
+TXT_SETUPHELP_VirusDetect      db 'Kommer att upptcka', 0
+                               db 'normala virus (enkla).', 0
+                               db 0
+TXT_SETUPHELP_StealthDetect    db 'Kommer att upptcka', 0
+                               db 'Stealth virus.', 0
+                               db 0
+TXT_SETUPHELP_VIBRdetect       db 'Kommer att upptcka', 0
+                               db 'VIBR. VIBR str fr', 0
+                               db 'Virus-In-Boot-Record.', 0
+                               db 0
+TXT_SETUPHELP_ContinueBIOSboot db 'Om aktiverad, kommer', 0
+                               db 'den hr optionen att', 0
+                               db 'returnera kontrollen', 0
+                               db 'till BIOS fr det.', 0
+                               db 'spec. devicet.', 0
+                               db 0
+
+; Extended Options - Help
+;----------------------------------|--------------------|-------------------
+; [Linux support removed since v1.02]
+;TXT_SETUPHELP_LinuxKernelPart  db 'Definierar FAT-16', 0
+;                               db 'partition som', 0
+;                               db 'innehller dina', 0
+;                               db 'Linux krnor.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxDefaultKrnl db 'Definiera din', 0
+;                               db 'standardkrnas', 0
+;                               db 'filnamn.', 0
+;                               db 0
+;TXT_SETUPHELP_LinuxRootPart    db 'ndrar din Linux', 0
+;                               db 'root partition.', 0
+;                               db 0
+;TXT_SETUPHELP_DefLinuxCmd:     db 'Definierar kommando', 0
+;                               db 'rad fr Linux, om', 0
+;                               db 'tillgngligt.', 0
+;                               db 0
+TXT_SETUPHELP_IgnoreLVM        db 'If activated, AiR-BOOT', 0
+                               db 'won''t even look for', 0
+                               db 'LVM information.', 0
+                               db 0
+; ###
+;~ TXT_SETUPHELP_ForceLBAUsage    db 'Forc. anvndning av', 0
+                               ;~ db 'BIOS LBA APIs', 0
+                               ;~ db 'istllet fr mixad anv.', 0
+                               ;~ db 'av CHS och LBA.', 0
+                               ;~ db 0
+TXT_SETUPHELP_ExtPartMShack    db 'Aktiverar dyn. ndring', 0
+                               db 'av den utkade part.,', 0
+                               db 'skriv id fr standard', 0
+                               db 'eller MS-uppfinnade.', 0
+                               db '(definierad av P-flag)', 0
+                               db 0
+
+; Maximum 26 chars (should not be reached)
+;----------------------------------|------------------------|---------------
+TXT_SETUPHELP_Base             db ' HJLP ', 0
+TXT_SETUPHELP_Enter            db '<ENTER>', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_PasswordOld          db 'Gammalt Lsenord:', 0
+TXT_SETUP_PasswordDefine       db 'Definiera Lsenord:', 0
+TXT_SETUP_PasswordVerify       db 'Verifiera Lsenord:', 0
+TXT_SETUP_PasswordIncorrect    db 'Gammalt Lsenord Inte Korrekt, Ledsen', 0
+TXT_SETUP_PasswordMismatch     db 'Matchar Inte, Gammalt Lsenord Behlls', 0
+TXT_SETUP_PasswordDisabled     db 'Inget Lsenord -> Skydd Avaktiverat', 0
+TXT_SETUP_PasswordMatched      db '** Matchar, Nytt Lsenord Satt **', 0
+
+; Maximum 60 chars (should not be reached anyway)
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_SaveAndExitNow       db 'SPARA & AVSLUTA NU', 0
+TXT_SETUP_QuitWithoutSaveNow   db 'AVSLUTA UTAN ATT SPARA', 0
+; Must be shorter than SaveAndExitNow / QuitWithoutSaveNow
+;----------------------------------|----------------------------------------------------------|
+TXT_SETUP_AreYouSure1          db 'R DU SKER?', 0
+TXT_SETUP_AreYouSure2          db '(J/N)', 0
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+; [Linux support removed since v1.02]
+;TXT_SETUP_EnterLinuxCmdLine    db 'Var vnlig ange/modifiera din Linux kommando-rad:', 0
+;TXT_SETUP_NoLinuxInstalled     db 'Du har inte Linux installerat', 0
+TXT_SETUP_NoLDLpartition       db 'Den valda partitionen r inte varken HPFS/FAT16/JFS', 0
+
+; Maximum 34 chars (should not be reached)
+;----------------------------------|--------------------------------|-------
+TXT_SETUP_HideFeature          db 'Dlj Funktion', 0
+;----------------------------------|---------------------|------------------
+TXT_SETUP_HideFeature2         db 'Status vid bootning ', 0
+
+; Drive-Letter Menu Header - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUP_DriveLetter          db 'Partition Bokstav', 0
+
+; Drive-Letter Keys - Max Length: 19 chars
+;----------------------------------|-----------------|----------------------
+TXT_SETUPHELP_DriveLetter      db 'Tryck C-Z', 0
+
+; Colors for special words hard-coded. Keep all 0s.
+;TXT_SETUP_LowerMessage         db 'Detta program r ',0,'fritt',0,' fr icke-kommersiell privat anvndning.',0
+;                               db 'Du fr ',0,'INTE',0,' distribuera/anvnda AiR-BOOT i ',0,'-NGON-',0,' form,',0
+;                               db 'om du erhller pengar fr den distribuerade produkten eller servicen.',0
+;                               db 'Om du vill anvnda AiR-BOOT i ',0,'andra sammanhang',0,', ',0,'frinstallera',0,' eller',0
+;                               db 'distribuera',0,' den, var vnlig och kontakta mig via e-mail: ',0,'kiewitz@netlabs.org',0,' !',0
Index: trunk/bootcode/text/sw/other.asm
===================================================================
--- trunk/bootcode/text/sw/other.asm	(revision 57)
+++ trunk/bootcode/text/sw/other.asm	(revision 57)
@@ -0,0 +1,105 @@
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+;------------------------------------------------------------------------------
+;                                                        AiR-BOOT / OTHER TEXT
+; v046 - Swedish - by Bjrn Sderstrm
+;------------------------------------------------------------------------------
+
+TXT_TranslationBy              db 'Swedish by Bjrn Sderstrm', 0
+
+; TopInfosX variables are used for Boot-Menu and Partition Setup
+
+; Maximum 2/10/11/6 chars
+;----------------------------------||---------------------------------------
+TXT_TopInfos_No                db 'No', 0
+TXT_TopInfos_Hd                db 'Hd', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_HdSize            db 'Hd/Storl:', 0
+;----------------------------------|--------|-------------------------------
+TXT_TopInfos_Label             db 'Etikett:', 0
+;----------------------------------|---------|------------------------------
+TXT_TopInfos_Type              db 'Typ:', 0
+;----------------------------------|----|-----------------------------------
+TXT_TopInfos_Flags             db 'Flag:', 0      ; <-- for Partition Setup
+
+; Will be added together to one line, maximum 76 chars
+TXT_TimedBootLine              db 'Tidsbootning aktiverad. Systemet kommer att boota '''
+TXT_TimedBootEntryName         db 12 dup (0)
+TXT_TimedBootLine2             db      ''' om ', 0
+TXT_TimedBootSeconds           db ' sekunder. ', 0
+TXT_TimedBootSecond            db ' sekund. ', 0
+; Maximum 76 chars
+;----------------------------------|--------------------------------------------------------------------------|
+TXT_TimedBootDisabled          db 'Tidstyrd bootning avaktiverad; ingen tidsgrns kommer att upptrda.', 0
+TXT_BootMenuHelpText1          db 'Tryck [Esc] fr att vxla tidsboot, [Enter] fr att acceptera aktuellt val.', 0
+TXT_BootMenuHelpText2          db 'Vlj annan med pilarna, eller tryck [TAB] fr att se BIOS POST meddelande.', 0
+; Maximum 30 chars
+;----------------------------------|----------------------------|
+TXT_BootMenuEnterSetup         db 'F10 fr att kommma till Setup', 0
+
+; Dynamic Length (till 80 chars)
+TXT_BrokenPartitionTable       db 13, 10, ' - Ditt system har minst en bruten partitionstabellspost eller har din hrddisk'
+                               db 13, 10, '   trasiga sektorer. Systemet haltat.', 0
+TXT_TooManyPartitions          db 13, 10, ' - Fr mnga partitioner hittades. AiR-BOOT stder endast upp till 45.', 0
+TXT_NoBootAble                 db 13, 10, ' - Ingen bootningsbar partition definierad. Systemet haltat.', 0
+TXT_BIOSchanged                db 13, 10, ' - BIOS NDRAT, var vnlig kontrollera ditt system efter virus, fr att vara sker.'
+                               db 13, 10, '   Tryck ngon tangent fr att fortstta...', 0
+
+TXT_VirusFoundMain             db 13, 10, ' - !VARNING! -> ETT VIRUS HITTADES <- !VARNING!', 13, 10, 0
+TXT_VirusFound1ok              db '    Det frstrdes, men systemet kanske inte bootas om korrekt. Om det intrffar,', 13, 10
+                               db '    anvnd din AiR-BOOT systemdisk.', 13, 10, 0
+TXT_VirusFound1damn            db '    Olyckligtvis frstrdes AiR-BOOTs backup. Du mste boota om genom att anvnda din', 13, 10
+                               db '    AiR-BOOT systemdisk.', 13, 10, 0
+TXT_VirusFound1any             db '    Fr skerhets skull, br du kontrollera din hrddisk mot ytterligare virus.', 13, 10, 0
+TXT_VirusFound2                db '    Det finns i boot-sektorn hos den partition, som du ville boota.', 13, 10
+                               db '    Anvnd ett antivirus program. Det kan vara falskt alarm eller.', 13, 10
+                               db '    Efter avlgsnande, mste du initiera om upptcktsvariablerna, g till ', 13, 10
+                               db '    ''PARTITION SETUP'' och vxla VIBR-upptckt tv gnger (av/p).', 13, 10
+                               db '    Om det bara var ett falskt alarm, lmna det i av-lge.', 13, 10, 0
+TXT_VirusFoundEnd              db '    Systemet haltat. Var vnlig tryck RESET.', 0
+TXT_HowEnterSetup              db 13, 10, ' - Tryck och hll Ctrl eller Alt fr att komma till AiR-BOOT Setup.', 0
+
+TXT_BootingNow1                db 'Bootar systemet anvndande ', 0
+; DO NOT MODIFY HERE
+TXT_BootingNow2                db '''', 0
+TXT_BootingNowPartName         db 12 dup (0) ; Space for BootThisPart-Name
+; DO NOT MODIFY TILL HERE
+TXT_BootingNowPartition        db ' partition', 0
+TXT_BootingNowKernel           db ' krna', 0
+TXT_BootingHide                db '; dlj aktiv', 0
+TXT_BootingWait                db '; var vnlig vnta...', 13, 10, 13, 10, 0
+
+; FIXED LENGTH - 11 chars each string
+;----------------------------------|---------|------------------------------
+TXT_Floppy_NoName              db 'Inget Namn '
+TXT_Floppy_Drive               db 'Diskett    '
+TXT_Floppy_NoDisc              db 'Ingen Disk '
+
+; Maximum 60 chars (should not be reached)
+;----------------------------------|----------------------------------------------------------|
+TXT_PleaseEnterPassword        db ' Var vnlig Ange Lsenord:', 0
+; the following 3 strings have to equal or *longer* than PleaseEnterPassword
+TXT_ProtectedSystem            db '** LSENORDSKYDDAT SYSTEM **', 0
+TXT_ProtectedSetup             db '** LSENORDSKYDDAD SETUP! **', 0
+TXT_ProtectedBootUp            db '** LSENORDSKYDDAD BOOTUP **', 0
+
+; will get completed using TXT_ERROR_CheckFailed from MBR.asm
+TXT_ERROR_CheckConfig          db 13, 10, ' - Konfigurationen', 0
+
+;----------------------------------|----------------------------------------------------------|
+TXT_TooManyTries               db 'Fr Mnga Frsk, Systemet Haltat', 0
Index: trunk/bootcode/text/txtmbr.asm
===================================================================
--- trunk/bootcode/text/txtmbr.asm	(revision 57)
+++ trunk/bootcode/text/txtmbr.asm	(revision 57)
@@ -0,0 +1,1 @@
+Include TEXT/EN/MBR.ASM 		
Index: trunk/bootcode/text/txtmenus.asm
===================================================================
--- trunk/bootcode/text/txtmenus.asm	(revision 57)
+++ trunk/bootcode/text/txtmenus.asm	(revision 57)
@@ -0,0 +1,1 @@
+Include TEXT/EN/MENUS.ASM		
Index: trunk/bootcode/text/txtother.asm
===================================================================
--- trunk/bootcode/text/txtother.asm	(revision 57)
+++ trunk/bootcode/text/txtother.asm	(revision 57)
@@ -0,0 +1,1 @@
+Include TEXT/EN/OTHER.ASM 		
Index: trunk/bootcode/version.inc
===================================================================
--- trunk/bootcode/version.inc	(revision 57)
+++ trunk/bootcode/version.inc	(revision 57)
@@ -0,0 +1,69 @@
+;
+; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
+;
+; This file is part of AiR-BOOT
+;
+; AiR-BOOT is free software: you can redistribute it and/or modify it under
+;  the terms of the GNU General Public License as published by the Free
+;  Software Foundation, either version 3 of the License, or (at your option)
+;  any later version.
+;
+; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
+;  WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
+;  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;  details.
+;
+; You should have received a copy of the GNU General Public License along with
+;  AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
+;
+
+
+;
+; AiR-BOOT Version Information.
+;
+
+;
+; First we define the numeric (BCD) AiR-BOOT version information.
+; This is used to derive ASCII and other representations.
+;
+
+; AiR-BOOT version conform WarpIN format with implicit 0 as fourth number.
+; Note that the config-version is managed manually.
+AB_MAJOR_VERSION    EQU     1
+AB_MIDDLE_VERSION   EQU     1
+AB_MINOR_VERSION    EQU     0
+
+; The Year, Month and Day in BCD so we can easily extract nibbles.
+AB_YEAR             EQU     2013h
+AB_MONTH            EQU     04h
+AB_DAY              EQU     05h
+
+; The Hours, Minutes and Seconds, again in BCD for easy manipulation.
+AB_HOURS            EQU     01h
+AB_MINUTES          EQU     01h
+AB_SECONDS          EQU     00h
+
+; The AiR-BOOT signature uses big-endian so we shuffle some bits around.
+AB_SIG_VERSION      EQU     (((AB_MIDDLE_VERSION SHL 4) OR AB_MINOR_VERSION) SHL 8) OR AB_MAJOR_VERSION
+AB_SIG_YEAR         EQU     ((AB_YEAR SHR 8) OR (AB_YEAR SHL 8) AND 0FFFFh)
+AB_SIG_DATE         EQU     (AB_MONTH SHL 8) OR AB_DAY
+
+;
+; This macro inserts the AiR-BOOT signature at the place where it is invoked.
+;
+InsertAirbootSignature  MACRO   lang
+    db      'AiRBOOT'
+    dw      AB_SIG_DATE
+    dw      AB_SIG_YEAR
+    dw      AB_SIG_VERSION
+    ; Wasm can only process the reference to 'lang' in pass 2 because it comes
+    ; from an included file which it has not processed yet at pass 1.
+    IFDEF   WASM
+        IF2
+            db      lang
+        ENDIF
+    ; The other assemblers process 'lang' correctly in pass 1.
+    ELSE
+        db      lang
+    ENDIF
+ENDM
