Ignore:
Timestamp:
May 6, 2011, 4:25:19 AM (14 years ago)
Author:
Ben Rietbroek
Message:

AiR-BOOT v1.07 -- As released with eCS v2.1. [2011-05-06]
Signature-date: 2006-03-13. (incorrect)
Trunk contains buildable v1.07 version as distributed with eCS v2.1.
Directory 'tags' contains v1.06 & v1.07 reference versions
built for all languages. Note that language ID for 'Dutch' changed
from 'DT' to 'NL' in v1.07 and that the v1.06 reference version also
uses 'NL' for 'Dutch'.
Also note that helper programs like the installer and setaboot are
are only modified for the OS/2 versions in v1.07.
The signature-date for v1.07 incorrectly states the same
date as for v1.06. The signature-version is correct.
Removed other binaries. (cd-rom images, old releases, etc.)
The tags serve as reference versions:

  • v1.06: rebuilt from source. (tags/v1.06r)
  • v1.07: built as released with eCS v2.1. (tags/v1.07r)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BOOTCODE/AIR-BOOT.ASM

    r29 r30  
    1717;
    1818
     19; -------------------
     20; Rousseau: # Fixes #
     21; -------------------
     22; # Huge Drives and LVM #
     23; When using disks >512GB under eComStation, the drive geometry changes to
     24; 127 or 255 sectors per track. Since LVM-info is written at the last sector
     25; of a track, and AiR-BOOT uses the geometry of the MBR, it cannot find the
     26; LVM-info and the eCS partition / volume bootsector.
     27; This has been fixed.
     28; Now, when an eCS-partition is discovered and the drive is >512GB, AiR-BOOT
     29; will use the eCS geometry to locate the LVM-info and the bootsector.
     30;
     31; # Special loader handling #
     32; The special handling of partition boot-loaders has been enhanced to
     33; enable booting of legacy sysems on huge drives with or without OS/2
     34; extended geometry.
     35;
     36; # eComStation boot-through after phase 1 #
     37; A special functionality is implemented to directly boot the newly
     38; installed system ; when installing eCS without showing the Boot Menu,
     39; independant of user settings.
     40; This works in conjuntion with the OS/2 specific SETABOOT.EXE program,
     41; also part of this AiR-BOOT package.
     42;
     43; # Math, Debug, Conv and Aux modules #
     44; These are used for 32-bit arithmatic on 16-bit code,
     45; debug the booting process, converting between data-types
     46; and outputting log-data to the com-port.
     47
     48
     49
    1950;---------------------------------------------------------------------------
    2051;                                                      AiR-BOOT / MAIN-CODE
    2152;---------------------------------------------------------------------------
    22 ;
    23 
     53;
     54
     55
     56; ----------------------------
     57; Rousseau: # JUMPS disabled #
     58; ----------------------------
     59; We actually don't want to use this directive because it generates extra
     60; NOP instructions that we can do without.
     61; Relative conditional jumps that are out-of-range are manually reworked by
     62; skipping an unconditional jump to the target on base of complementary
     63; condition logic and temporary labels.
     64; TASM also has a bug in that when the .ERR2 directive is used when the .386 directive
     65; is in effect, the JUMPS directive is also active and cannot be turned off.
     66; NOJUMPS seems to have no effect in this situation.
     67; In this case 4 NOP instructions are generated after forward referencing jump
     68; instructions, to allow for automatic recoding by TASM.
     69; This seems to be a TASM bug. (v2,v3,v4, dunno v5)
     70;
     71;JUMPS
     72;
     73
     74;
     75; If defined then each module is prefixed with it's name.
     76; This is used for debugging purposes.
     77; It should be off in release code.
     78;
     79;ModuleNames                equ      1
     80
     81
     82
     83;
     84; The first harddisk is BIOS coded 80h.
     85; This makes a total of 128 disk could be supported using this coding.
     86; This value is used to store disk-information and this info is allocated
     87; in the BSS.
     88;
     89MaxDisks                   equ      16
     90
     91;
     92; If defined then include DEBUG.ASM and output debug-info to serial-port.
     93;
     94AuxDebug                   equ      1
     95
     96
     97BiosComPort                equ      0                                            ; Com-port for debugging, 0 is disabled
     98
     99                           ; bits 7-5 = datarate   (000=110,001=150,010=300,011=600,100=1200,101=2400,110=4800,111=9600 bps)
     100                           ; bits 4-3 = parity     (00 or 10 = none, 01 = odd, 11 = even)
     101                           ; bit  2   = stop-bits  (set = 2 stop-bits, clear = 1 stop-bit)
     102                           ; bits 1-0 = data-bits  (00 = 5, 01 = 6, 10 = 7, 11 = 8)
     103AuxInitParms               equ      11100011b                                    ; 9600 bps, no parity, 1 stop-bit, 8 bits per char
     104
     105BIOS_AuxParmsDefault       equ      (AuxInitParms SHL 8) OR BiosComPort          ; Default word value for offset 77FEh (BIOS_AuxParms)
     106;
    24107; If ReleaseCode is not defined, it will produce debug-able code...
    25 ReleaseCode                 equ    -1
    26 
    27 JUMPS
    28 
     108;
     109ReleaseCode                equ      -1                                           ; Rousseau: this should be replaced
     110                                                                                 ; by the complementary debug logic some day.
     111                                                                                 ; Then instead of being on or off it would be
     112                                                                                 ; more handy to use positive integers with each
     113                                                                                 ; higher number increasing the debug functionality.
     114
     115;
    29116; All Special Equs for this project
    30 
     117;
     118
     119; Use different addresses depending on whether in pre-boot or debug environment.
    31120IFDEF ReleaseCode
    32    StartBaseSeg             equ     00000h
    33    StartBasePtr             equ     07C00h ; BIOS starts our MBR at 0:7C00
     121   StartBaseSeg             equ     00000h   ; Pre-boot, so we are in low memory
     122   StartBasePtr             equ     07C00h   ; BIOS starts our MBR at 0:7C00
    34123  ELSE
    35    StartBaseSeg             equ     03A98h ; Adjust to DOS segment
    36    StartBasePtr             equ     00100h
     124   StartBaseSeg             equ     03A98h   ; Adjust to DOS segment             ; Rousseau: where does this value come from ? (should be CS; rectified in actual code by ignoring this value)
     125   StartBasePtr             equ     00100h   ; We are a .com file, some DOS is active
    37126ENDIF
    38 BootBaseSeg                 equ      8000h
    39 BootBasePtr                 equ         0h ; We put our MBR to this location
    40 BootBaseExec                equ BootBasePtr+offset MBR_RealStart
    41 StackSeg                    equ      7000h
    42 
     127
     128; Address labels after code-move
     129BootBaseSeg                 equ      8000h   ; Pre-boot, somewhere in the low 640K
     130BootBasePtr                 equ         0h   ; We put our MBR to this location
     131BootBaseExec                equ  BootBasePtr+offset MBR_RealStart
     132StackSeg                    equ      7000h   ; Put the stack below the code
     133
     134; Video pages, no INT 10h is used for menu-drawing etc.
    43135VideoIO_Page0               equ     0B800h
    44136VideoIO_Page1               equ     0B900h
     
    47139VideoIO_FXSegment           equ     0A000h
    48140
     141; Include
    49142Include ..\INCLUDE\asm.inc
    50 ;Include ..\INCLUDE\DOS\airboot.inc
    51 
     143;Include ..\INCLUDE\DOS\airboot.inc    ; does not exist anymore
     144
     145; Special line-drawing characters
    52146TextChar_WinLineRight       equ       0C4h ; 'Ä'
    53147TextChar_WinLineDown        equ       0B3h ; '³'
     
    60154
    61155; Offsets for Partition-Entries in MBR/EPRs
    62 LocBRPT_LenOfEntry          equ         16
    63 LocBRPT_Flags               equ          0
    64 LocBRPT_BeginCHS            equ          1
    65 LocBRPT_BeginHead           equ          1
    66 LocBRPT_BeginSector         equ          2
    67 LocBRPT_BeginCylinder       equ          3
    68 LocBRPT_SystemID            equ          4
    69 LocBRPT_EndCHS              equ          5
     156LocBRPT_LenOfEntry          equ         16                                       ; Length of a standard MBR or EPR entry
     157LocBRPT_Flags               equ          0                                       ; Bootable, Hidden, etc.
     158LocBRPT_BeginCHS            equ          1                                       ; Combined 10-bits cyl with 6 bits
     159LocBRPT_BeginHead           equ          1                                       ; Start head      (0<=H<255)    255 is invalid !
     160LocBRPT_BeginSector         equ          2                                       ; Start sector    (1<=S<=255)
     161LocBRPT_BeginCylinder       equ          3                                       ; Start cylinder  (0<=C<[1024,16384,65536,n])
     162LocBRPT_SystemID            equ          4                                       ; Type of system using the partition
     163LocBRPT_EndCHS              equ          5                                       ; Same for end of partition
    70164LocBRPT_EndHead             equ          5
    71165LocBRPT_EndSector           equ          6
    72166LocBRPT_EndCylinder         equ          7
    73 LocBRPT_RelativeBegin       equ          8
    74 LocBRPT_AbsoluteLength      equ         12
    75 
    76 LocBR_Magic                 equ        510
     167LocBRPT_RelativeBegin       equ          8                                       ; Where the ...
     168LocBRPT_AbsoluteLength      equ         12                                       ; ?
     169
     170LocBR_Magic                 equ        510                                       ; ?
    77171
    78172; Offsets for LVM Information Sector
    79 LocLVM_SignatureStart       equ          0
    80 LocLVM_SignatureByte0       equ          2
    81 LocLVM_CRC                  equ          8  ; CRC is a DWORD
    82 LocLVM_MaxEntries           equ          4
    83 LocLVM_StartOfEntries       equ         60  ; (contains maximum of 4 entries)
    84 LocLVM_LenOfEntry           equ         60
    85 LocLVM_VolumeID             equ          0  ; is DWORD
    86 LocLVM_PartitionID          equ          4  ; is DWORD
    87 LocLVM_PartitionSize        equ          8  ; is DWORD
    88 LocLVM_PartitionStart       equ         12  ; is DWORD
    89 LocLVM_VolumeLetter         equ         18  ; is BYTE (Letter C-Z or 0)
    90 LocLVM_VolumeName           equ         20  ; 20 bytes
    91 LocLVM_PartitionName        equ         40  ; 20 bytes
     173LocLVM_SignatureStart       equ          0   ;
     174LocLVM_SignatureByte0       equ          2   ;
     175LocLVM_CRC                  equ          8   ; CRC is a DWORD
     176LocLVM_MaxEntries           equ          4   ; Max entries in the track0 LVM-sector
     177LocLVM_StartOfEntries       equ         60   ; (contains maximum of 4 entries)
     178LocLVM_LenOfEntry           equ         60   ; ?
     179LocLVM_VolumeID             equ          0   ; is DWORD
     180LocLVM_PartitionID          equ          4   ; is DWORD
     181LocLVM_PartitionSize        equ          8   ; is DWORD
     182LocLVM_PartitionStart       equ         12   ; is DWORD
     183LocLVM_VolumeLetter         equ         18   ; is BYTE (Letter C-Z or 0) (relative to entry)
     184
     185; Rousseau: added (index in LVM-sector)
     186LocLVM_Secs                 equ         20h  ; Sectors per Track                     ; Rousseau: this one is used for the OS/2 extended geometry
     187LocLVM_Heads                equ         1ch  ; Number of heads
     188LocLVM_VolumeLetter2        equ         78   ; is BYTE (Letter C-Z or 0)             ; FOUT !! niet entry relative !
     189LocLVM_Startable            equ         77   ; is startable (newly installed system) ; FOUT !! niet entry relative !
     190LocLVM_OnBootMenu           equ         76   ; is on bootmenu                        ; FOUT !! niet entry relative !
     191
     192LocLVM_VolumeName           equ         20   ; 20 bytes
     193LocLVM_PartitionName        equ         40   ; 20 bytes
     194
     195
     196
    92197
    93198; Offsets for IPT (Internal Partition Table)
    94 LocIPT_MaxPartitions        equ         30  ; Maximum LocIPT_MaxPartitions
    95 LocIPT_LenOfSizeElement     equ          6  ; Size of one Size-Element
    96 LocIPT_LenOfIPT             equ         34
    97 LocIPT_Serial               equ          0
    98 LocIPT_Name                 equ          4
    99 LocIPT_Drive                equ         15  ; Drive-ID
    100 LocIPT_SystemID             equ         16  ; Partition-Type
    101 LocIPT_Flags                equ         17  ; AiR-BOOT Flags for partition
    102 LocIPT_BootRecordCRC        equ         18  ; CRC of Boot-Record
    103 LocIPT_LocationBegin        equ         20  ; Begin of Partition
    104 LocIPT_LocationPartTable    equ         23  ; PartitionTable of Partition
    105 LocIPT_AbsoluteBegin        equ         26  ; Absolute Sector of Begin
    106 LocIPT_AbsolutePartTable    equ         30  ; Absolute Sector of PartTable
    107 
    108 LocIPT_DefaultFlags         equ   00000011b ; Don't know if boot-able :)
    109 LocIPT_DefaultNonBootFlags  equ   00000010b ; ...VIBR Detection is always on
     199LocIPT_MaxPartitions        equ         partition_count   ; Maximum LocIPT_MaxPartitions
     200LocIPT_LenOfSizeElement     equ          6   ; Size of one Size-Element
     201LocIPT_LenOfIPT             equ         34   ; Length of an IPT-entry
     202LocIPT_Serial               equ          0   ; Serial from MBR ?
     203LocIPT_Name                 equ          4   ; Name from FS or LVM   (part/vol)
     204LocIPT_Drive                equ         15   ; Drive-ID              (80h,81h etc. sub 7fh to get 1-based disk-number)
     205LocIPT_SystemID             equ         16   ; Partition-Type        (06,07,etc)
     206LocIPT_Flags                equ         17   ; AiR-BOOT Flags for partition (see below)
     207LocIPT_BootRecordCRC        equ         18   ; CRC of Boot-Record
     208LocIPT_LocationBegin        equ         20   ; Begin of Partition
     209LocIPT_LocationPartTable    equ         23   ; PartitionTable of Partition
     210LocIPT_AbsoluteBegin        equ         26   ; Absolute Sector of Begin
     211LocIPT_AbsolutePartTable    equ         30   ; Absolute Sector of PartTable
     212
     213; AiR-BOOT IPT-Flags
     214LocIPT_DefaultFlags         equ   00000011b  ; Don't know if boot-able :)
     215LocIPT_DefaultNonBootFlags  equ   00000010b  ; ...VIBR Detection is always on
    110216
    111217Flags_BootAble              equ   00000001b
    112218Flags_VIBR_Detection        equ   00000010b
    113219Flags_HideFeature           equ   00000100b
    114 Flags_DriveLetter           equ   00001000b ; OS/2 FAT16/HPFS only
    115 Flags_ExtPartMShack         equ   00010000b ; Extended Partition M$-Hack req ?
     220Flags_DriveLetter           equ   00001000b  ; OS/2 FAT16/HPFS only
     221Flags_ExtPartMShack         equ   00010000b  ; Extended Partition M$-Hack req ?
    116222Flags_NoPartName            equ   01000000b
    117 Flags_NowFound              equ   10000000b ; temp only in OldPartTable
    118 Flags_SpecialMarker         equ   10000000b ; temp only for HiddenSetup
    119 
    120 FileSysFlags_BootAble       equ   00000001b ; Is this Partition boot-able ?
    121 FileSysFlags_FAT32          equ   00010000b ; FAT 32 specific name getting
    122 FileSysFlags_NoName         equ   00100000b ; No Name - use PartitionName
    123 FileSysFlags_DriveLetter    equ   01000000b ; DriveLetter Feature possible
    124 
     223Flags_NowFound              equ   10000000b  ; temp only in OldPartTable
     224Flags_SpecialMarker         equ   10000000b  ; temp only for HiddenSetup
     225
     226FileSysFlags_BootAble       equ   00000001b  ; Is this Partition boot-able ?
     227FileSysFlags_FAT32          equ   00010000b  ; FAT 32 specific name getting
     228FileSysFlags_NoName         equ   00100000b  ; No Name - use PartitionName
     229FileSysFlags_DriveLetter    equ   01000000b  ; DriveLetter Feature possible
     230
     231; Navigation keys
    125232Keys_Up                     equ         48h
    126233Keys_Down                   equ         50h
     
    148255Keys_Flags_EnterSetup       equ       1100b ; Strg+Alt (AL)
    149256
    150                 .386p
    151                 model large, basic
    152 
     257
     258      ; ------------------------------------------
     259      ; Rousseau: # Changed this from .386 to .286
     260      ; ------------------------------------------
     261      ; Because of the TASM-bug the processor had to be changed to turn JUMPS
     262      ; off. Existing movzx instructions were replaced with 286 equivalent code.
     263      ; Out of range relative jumps have been recoded.
     264      ; AiR-BOOT can now run on a 286 processor :-)
     265                .286
     266
     267               ; This influences the uses directive and other stuff,
     268               ; like calling-style.
     269               ; The model itself,large, has no effect because we generate
     270               ; a binairy image and not a segmented executable.
     271               .model large, basic
     272
     273; Our code-segment starts here.
     274; We are running in 16-bit and we like it
    153275code_seg        segment public use16
    154276                assume  cs:code_seg, ds:code_seg, es:nothing, ss:nothing
    155277
    156                             org 00000h                          ; Sector 1
     278
     279
     280;===============================================================================
     281                                                                  ; Sector 1
     282
     283
     284                           ; We are not a .com file at 100h but a binary image
     285                           ; of which only the 1st sector gets loaded at 07c00h.
     286                           org 00000h                          ; Sector 1
     287
     288; Start of sector 1
     289; This is the MBR, note the AiRBOOT signature, it's date (2006), version and
     290; language.
     291; Version 1.07 was intruduced in 2011.
     292; It fixes issues with huge drives and lvm and more.
     293
     294sos1:
     295
     296; ---------------------------------------------
     297; Rousseau: # Combined letter and jump offset #
     298; ---------------------------------------------
     299; My guess is Martin had a short jump followed by the AiRBOOT signature at first.
     300; Then he encountered strange behaviour by some M$ operating-systems if the
     301; the first insruction was not a CLI.
     302; But there was no room to insert the CLI and of course he did not want to
     303; change the location of the AiRBOOT signature.
     304; He solved this by inserting the M$ needed CLI at offset 0 followed by a short
     305; jump that uses the 'A' of the AiRBOOT signature as the jump displacement.
     306
     307
    157308;---------------------------------------------------------------------------
    158 AiR_BOOT:     cli                        ; Some M$ operating systems need a CLI
    159                                          ;  here otherwise they will go beserk
    160                                          ;  and will do funny things during
    161                                          ;  boot phase, it's laughable!
    162               db      0EBh               ; JMP-Short -> MBR_Start
    163               db      'AiRBOOT', 13h, 03h, 20h, 06h, 01h, 06h, TXT_LanguageID
     309AiR_BOOT:     cli                         ; Some M$ operating systems need a CLI
     310                                          ;  here otherwise they will go beserk  ; Rousseau: M$ osses are beserk by definition.
     311                                          ;  and will do funny things during
     312                                          ;  boot phase, it's laughable!
     313              db      0EBh                ; JMP-Short -> MBR_Start               ; Rousseau: uses the 'A' as the displacement !
     314              db      'AiRBOOT', 13h, 03h, 20h, 06h, 01h, 07h, TXT_LanguageID    ; Rousseau: version adjusted to v1.07
     315
    164316              ; ID String, Date and Version Number, U for US version
    165               db      1                  ; Total Sectors Count,
    166                                          ;  Will get overwritten by FIXBSET.exe
    167 MBR_CheckCode dw      0                  ; Check-Sum for Code
    168 
    169 MBR_Start:    sti                        ;    This opcode is dedicated to:
    170               cld                        ;    =MICROSOFT JUMP DEPARTMENT=
    171               mov     ax, StartBaseSeg
    172               mov     ds, ax
    173               mov     si, StartBasePtr
    174               mov     ax, BootBaseSeg
     317              db      1                   ; Total Sectors Count,
     318                                          ;  Will get overwritten by FIXBSET.exe
     319MBR_CheckCode dw      0                   ; Check-Sum for Code
     320
     321;
     322; This label is jumped to from the jump after 'eCSRocks'.
     323; No single instruction below should be changed, added or removed in the code
     324; below as this will cause the jump-link to go haywire.
     325MBR_Start:    sti                         ;    This opcode is dedicated to:
     326              cld                         ;    =MICROSOFT JUMP DEPARTMENT=
     327
     328              ; Setup some base stuff
     329              ; AX got loaded wrongly for debug, changed the instructions
     330              ; without modifying the number of bytes.
     331              ; Don't comment-out the redundant instruction below because this *will*
     332              ; change the number of bytes and break the jump-chain.
     333              mov     ax, StartBaseSeg    ; The segment we are moving ourself from (NOT USED)
     334              ;mov     ds, ax
     335              push   cs
     336              pop    ds
     337              mov     si, StartBasePtr    ; The offset we are moving ourself from
     338              mov     ax, BootBaseSeg     ; The target segment we are moving ourself to
    175339              mov     es, ax
    176               mov     di, BootBasePtr
     340              mov     di, BootBasePtr     ; The target offset we are moving ourself to
     341
     342              ; Depending on pre-boot or debug,
     343              ; only move first 512 bytes or the whole she-bang++ (65400 bytes)
    177344              IFDEF ReleaseCode
    178                  mov     cx, 256
     345                 mov     cx, 256          ; Pre-boot environment
    179346                ELSE
    180                  mov     cx, 32700
     347                 mov     cx, 32700        ; Debug environment                    ; Rousseau: where does 32700 come from ? (30720)
    181348              ENDIF
     349
     350              ;
     351              ; LET's MOVE OURSELVES !
     352              ;
    182353              rep     movsw
     354
     355              ; Code a jump to the
    183356              db      0EAh
    184               dw      BootBaseExec
    185               dw      BootBaseSeg
     357              dw      BootBaseExec        ; This is MBR_RealStart + BootBasePtr
     358              dw      BootBaseSeg         ; This is 08000h
    186359              ; jmp     far ptr BootBaseSeg:BootBaseExec
    187360
     361
     362;
     363; Some MBR-functions to provide absolute minimum functionality.
     364;
     365
     366;
     367; Entry-point for halting the system.
     368;
    188369MBR_HaltSystem:
    189370              mov     ax, 8600h
     
    194375              jmp     MBR_HaltSys
    195376
    196               db      'FUCKMS:>'
     377;
     378; Never let this part change it's offset,
     379; or the first MBR jump will go haywire.
     380;
     381
     382;              db      'FUCKMS:>'        ; Sorry Martin, we had to change this.
     383              db      'eCSRocks'         ; Hope you like this one too :-)
    197384              jmp     MBR_Start          ; We jump here, because I needed to
    198385                                         ;  insert a CLI on start and did not
    199386                                         ;  want to change AiR-BOOT detection
    200387                                         ;  because of Microsoft inventions...
    201 
     388;
     389; Entry-point when loading fails.
     390;
    202391              db      'LOAD ERROR!', 0
    203 MBR_LoadError                   Proc Near  Uses
    204    mov     si, offset $-12
    205    push    cs
    206    pop     ds
    207    call    MBR_Teletype
    208   MBRLE_Halt:
    209    jmp     MBRLE_Halt
    210 MBR_LoadError                   EndP
    211 
     392MBR_LoadError                 Proc Near
     393      mov      si, offset $-12
     394      push     cs
     395      pop      ds
     396      call     MBR_Teletype
     397   MBRLE_Halt:
     398      jmp      MBRLE_Halt
     399MBR_LoadError                 EndP
     400
     401
     402;
     403; Entry-point when saving fails.
     404;
    212405              db      'SAVE ERROR!', 0
    213 MBR_SaveError                   Proc Near  Uses
    214    mov     si, offset $-12
    215    push    cs
    216    pop     ds
    217    call    MBR_Teletype
    218   MBRSE_Halt:
    219    jmp     MBRSE_Halt
    220 MBR_SaveError                   EndP
    221 
     406MBR_SaveError                 Proc Near
     407      mov      si, offset $-12
     408      push     cs
     409      pop      ds
     410      call     MBR_Teletype
     411   MBRSE_Halt:
     412      jmp      MBRSE_Halt
     413MBR_SaveError                 EndP
     414
     415
     416; Put text on the screen using the BIOS tele-type function.
     417; No attributes like color are supported.
    222418;        In: SI - Pointer to begin of string (EOS is 0)
    223419; Destroyed: SI
    224420MBR_Teletype                    Proc Near   Uses ax bx cx
    225    mov     ah, 0Eh
    226    mov     bx, 7
    227   MBRT_Loop:
    228    lodsb
    229    or      al, al
    230    jz      MBRT_End
    231    int     10h
    232    jmp     MBRT_Loop
    233   MBRT_End:
    234    ret
     421      mov      ah, 0Eh
     422      mov      bx, 7
     423   MBRT_Loop:
     424      lodsb
     425      or       al, al
     426      jz       MBRT_End
     427      int      10h
     428      jmp      MBRT_Loop
     429   MBRT_End:
     430      ret
    235431MBR_Teletype                    EndP
     432
     433;
     434; Rousseau: DO NOT ADD CODE TO THIS SECTION !
     435;
    236436
    237437;        In: BX - Base Check, DS:SI - Pointer to 512-byte-area to be included
     
    252452MBR_GetCheckOfSector            EndP
    253453
     454
     455
     456
     457
     458
     459;
     460; This is where the rest of AiR-BOOT gets loaded.
     461;
     462
    254463;---------------------------------------------------------------------------
    255464MBR_RealStart:
    256               mov     ax, StackSeg
     465              mov     ax, StackSeg        ; 07000h, below the moved code
    257466              mov     ss, ax
    258               mov     sp, 7FFFh
    259               mov     ax, es
    260               mov     ds, ax             ; Set DS==ES to Code Segment
     467              ;mov     sp, 7FFFh           ; Odd stack-pointer ??
     468              mov     sp, 7FFEh           ; Safe value, could also be 8000h because SP is decremented by 2 before push
     469              mov     ax, es              ; ES holds segment where we moved ourself to.
     470              mov     ds, ax              ; Set DS==ES to Code Segment
     471
     472              ; If we are in debug-mode, all code is moved already,
     473              ; so we can directly jump to it.
     474              ; One difference is that in debug-mode, the whole .com image is loaded by dos while
     475              ; when air-boot is active from the MBR it does the loading itself.
     476              ; When active from the MBR air-boot does not load all sectors !
     477              ; This means that i.e. a value stored at 77E0h is present in the debug-version because the whole
     478              ; image is loaded, but is not present in running-mode because this sector is not loaded.
    261479              IFNDEF ReleaseCode
    262480                 jmp     AiR_BOOT_Start
    263481              ENDIF
     482
     483
    264484              ; Load missing parts from harddrive...
    265               mov     ax, cs
    266               mov     es, ax
     485              mov     ax, cs              ; actually obsolete
     486              mov     es, ax              ; actually obsolete
     487
     488              ; Load the configuration-sectors from disk.
    267489              mov     bx, offset Configuration
    268               mov     dx, 0080h          ; First harddrive, Sector 55
    269               mov     cx, 0037h
    270               mov     ax, 0205h          ; Read 5 sectors
     490              mov     dx, 0080h           ; First harddrive, Sector 55
     491              mov     cx, 0037h           ; Is 55d is config-sector
     492
     493
     494
     495IF image_size EQ image_size_60secs
     496              mov     ax, 0205h           ; Read 5 sectors (55 - 59)
     497ELSE
     498              mov     ax, 0207h           ; Read 7 sectors (55 - 61)
     499ENDIF
     500
    271501              int     13h
    272502              jnc     MBR_ConfigCopy_NoError
     503
     504              ; Some error occured
    273505             MBR_ConfigCopy_LoadError:
    274               call    MBR_LoadError      ; Will Abort BootUp
     506              call    MBR_LoadError       ; Will Abort BootUp
     507
     508              ; Load the code sectors
    275509             MBR_ConfigCopy_NoError:
    276510              mov     bx, offset FurtherMoreLoad
    277               mov     dx, 0080h          ; First harddrive, Sector 2
    278               mov     cx, 0002h
     511              mov     dx, 0080h           ; First harddrive
     512              mov     cx, 0002h           ; Second sector
    279513              mov     ah, 02h
    280               mov     al, ds:[10h]
     514
     515              mov     al, ds:[10h]        ; 34h = 52d sectors (35h in extended version)
    281516              int     13h
    282517              jnc     MBR_RealStart_NoError
     
    288523              ; Now Check Code with CheckSum
    289524              mov     si, offset FurtherMoreLoad
    290               movzx   cx, bptr ds:[10h]
     525
     526              ;movzx   cx, bptr ds:[10h]
     527              mov    cl, ds:[10h]
     528              mov    ch,0
     529
    291530              xor     bx, bx
    292531             MBR_RealStart_CheckCodeLoop:
     
    305544              jmp     AiR_BOOT_Start
    306545
     546
     547
     548
    307549;---------------------------------------------------------------------------
    308550   Include TEXT\TXTMBR.asm               ; All translateable Text in MBR
    309551;---------------------------------------------------------------------------
    310                             org 00200h                          ; Sector 2
     552
     553
     554
     555                           ; Comport settings
     556                           ; DO NOT MOVE THIS VARIABLE !!
     557                           ; It cannot be in the config-area (sector 55) because that area
     558                           ; is crc-protected.
     559                           org 001B0h
     560BIOS_AuxParms              dw     BIOS_AuxParmsDefault                           ; Initialized at start when developing
     561
     562                           org   00200h
     563; End of sector 1
     564eos1:
     565
     566; Check for overlap
     567slack01 = sos2 - eos1
     568IF slack01 LT 0
     569   .ERR2 "Location Overlap slack01 !"
     570ENDIF
     571
     572
     573;===============================================================================
     574                                                                  ; Sector 2
     575
     576                           ;
     577                           ; Here starts the second sector, sector 2
     578                           ;
     579                            org 00200h
     580; Start of sector 2.
     581sos2:
     582
     583
    311584; Everything beyond this point is loaded on startup and is NOT existant at first
    312585FurtherMoreLoad:
     586
     587;
     588; Filesystem table correlating id with name.
     589;
     590
    313591                        ; first Normal-Partition-ID, Hidden-Partition-ID
    314592                        ;  and Default-Partition-Flags.
     
    344622                         ; -> 44 Partition-Types
    345623
    346 ;---------------------------------------------------------------------------
    347                             org 00400h                          ; Sector 3
    348 AiR_BOOT_Start:  mov     ax, VideoIO_Page1
    349                  call    VideoIO_BackUpTo   ; Copy BIOS POST to Second Page
    350                  mov     si, offset Copyright
    351                  call    MBR_Teletype
     624; End of sector 2.
     625eos2:
     626
     627
     628
     629; Check for overlap
     630slack02 = sos3 - eos2
     631IF slack02 LT 0
     632   .ERR2 "Location Overlap slack02 !"
     633ENDIF
     634
     635
     636
     637
     638
     639;===============================================================================
     640                                                                  ; Sector 3
     641                            org 00400h
     642; Start of sector 3.
     643sos3:
     644
     645
     646
     647
     648
     649
     650
     651
     652
     653
     654
     655
     656
     657
     658
     659                  ; ##############################################
     660                  ; ## ENTRY-POINT AFTER ALL THE INITIAL HASSLE ##
     661                  ; ##############################################
     662
     663
     664
     665AiR_BOOT_Start:  nop
     666
     667               ;jmp skip
     668
     669               ; Rousseau:
     670               ; I should cleanup my garbage here...
     671
    352672                 ; Initialize Variable-Tables, Detections, etc.
    353673                 call    PRECRAP_Main
     674
     675                 ; Number of harddisks is now known
     676
    354677                 call    PARTSCAN_ScanForPartitions
    355                 MBR_Main_ReEnterSetup:
     678
     679
     680                  ; Number of disks found
     681                 mov     si, offset DisksFound
     682                 call    MBR_Teletype
     683
     684                 mov     al, [TotalHarddiscs]
     685                 call    VideoIO_SyncPos
     686                 call    VideoIO_PrintByteDynamicNumber
     687                 xor     si,si
     688                 call    MBR_TeletypeNL
     689
     690                  ; Number of bootable systems indicator
     691                 mov     si, offset PartitionsFound
     692                 call    MBR_Teletype
     693
     694                 mov     al, [CFG_Partitions]
     695                 call    VideoIO_SyncPos
     696                 call    VideoIO_PrintByteDynamicNumber
     697
     698                  xor     si,si
     699                  call  MBR_TeletypeNL
     700                  call  MBR_TeletypeNL
     701
     702                  call  VideoIO_SyncPos
     703
     704                  mov   dl,80h
     705                  call  VideoIO_DumpDiskInfo
     706
     707                 ;
     708                 ; Enumberate Bootable Systemen by name
     709                 ; And prepare Phase 1 if active
     710                 ;
     711                 mov     si, offset PartitionTable
     712                 xor     cx,cx
     713                 mov     cl,[CFG_Partitions]
     714               MBR_Parts:
     715                 add     si, 4
     716                 push    si
     717                 push    si
     718                 ;call    MBR_TeletypeVolName
     719                 pop     si
     720                 call    PART_IsInstallVolume
     721                 jnc     MBR_Parts_NI
     722
     723                 ; install volume
     724                 mov     al,' '
     725                 mov     bl,7
     726                 mov     ah, 0eh
     727                 int     10h
     728
     729                 mov     al,'('
     730                 mov     bl,7
     731                 mov     ah, 0eh
     732                 int     10h
     733
     734                 mov     al,[CFG_Partitions]
     735                 sub     al,cl
     736                 ;inc     al
     737                 ;mov     [Menu_EntryAutomatic],al
     738                 mov     [CFG_PartAutomatic],al                                  ; Rousseau: setup entry for install-volume
     739                 mov     [CFG_PartLast],al
     740                 mov     ah, [eCS_InstallVolume]      ; 1st byte is 0 if no phase 1 active
     741                 test    ah,ah                        ; test the byte, ZF is 0 if phase 1 active
     742                 lahf                                 ; flags in ah
     743                 xor     ah, 40h                      ; complement ZF
     744                 and     ah, 40h                      ; mask ZF
     745                 shr     ah, 6                        ; move ZF to LSB
     746                 mov     [CFG_AutomaticBoot], ah      ; automatic boot if phase 1 is active
     747                 mov     [eCS_InstallVolume], 0       ; disable phase 1 for next boot
     748
     749                 add     al,'1'
     750                 mov     bl,7
     751                 mov     ah, 0eh
     752                 int     10h
     753
     754                  mov     al,')'
     755                 mov     bl,7
     756                 mov     ah, 0eh
     757                 int     10h
     758
     759                 mov     bx,cx
     760
     761               MBR_Parts_NI:
     762                 xor     si,si
     763                 ;call    MBR_TeletypeNL
     764                 pop     si
     765                 add     si, 30
     766                 loop    MBR_Parts
     767
     768
     769
     770
     771                  ; Index of automatic start partition
     772;                 mov     si, offset AutoStartPart
     773                 ;call    MBR_Teletype
     774
     775                 mov     al, [CFG_PartAutomatic]
     776                 add     al, 31h
     777                 mov     ah, 09h
     778                 mov     bx, 15
     779                 mov     cx, 1
     780                 ;int     10h
     781
     782                 mov     al, [CFG_PartAutomatic]
     783                 add     al, 31h
     784                 mov     ah, 0eh
     785                 mov     bx, 15
     786                 mov     cx, 1
     787                 ;int     10h
     788
     789                 xor     si,si
     790                 call    MBR_TeletypeNL
     791                 xor     si,si
     792                 call    MBR_TeletypeNL
     793
     794                 mov    ax,[BIOS_AuxParms]
     795                 ;call   VideoIO_SyncPos
     796                 push   ax
     797                 add    al,'0'
     798                 mov     bl,7
     799                 mov     ah, 0eh
     800                 ;int     10h
     801                 pop    ax
     802                 xchg   al,ah
     803                 sub    al,0a2h
     804                 mov     bl,7
     805                 mov     ah, 0eh
     806                 ;int     10h
     807
     808
     809                 call      MBR_TeletypeSyncPos
     810
     811                  xor      si,si
     812                  call     MBR_TeletypeNL
     813                  call     MBR_TeletypeNL
     814
     815
     816
     817                 mov       si, offset ShowMenu
     818                 call      MBR_TeletypeBold
     819
     820
     821skip:
     822
     823
     824
     825               ;
     826               ; ########################### WAIT FOR KEY ################################
     827               ;
     828
     829
     830               ; Rousseau:
     831               ; Wait for key so we can see debug log if ab-menu hangs.
     832               ;;xor     ax, ax
     833               ;;int     16h
     834
     835               ;call     SOUND_Beep
     836
     837                  ; Rousseau: delayed save of video-page
     838
     839                 mov     ax, VideoIO_Page1
     840                 call    VideoIO_BackUpTo   ; Copy BIOS POST to Second Page
     841
     842               ;call     SOUND_Beep
     843
     844
     845               ;
     846               ; COM-PORT DEBUG
     847               ;
     848               call     AuxIO_TeletypeNL
     849               mov      si, offset PartitionTable
     850               call     AuxIO_DumpSector
     851               call     AuxIO_TeletypeNL
     852
     853               ;
     854               ; RE-ENTER SETUP
     855               ;
     856                MBR_Main_ReEnterSetup:                                           ; Rousseau: SETUP re-enters here !
    356857                 call    SETUP_CheckEnterSETUP
    357                  call    AFTERCRAP_Main
     858
     859               ;call     SOUND_Beep
     860
     861
     862
     863
     864                 ; Rousseau: Prematurely save configuration
     865                 call    DriveIO_SaveConfiguration                               ; Rousseau: added SAVE CONFIG
     866
     867
     868                 call    AFTERCRAP_Main                                          ; Rousseau: Every time I see "AfterCrap" I have to laugh :-)
    358869
    359870; [Linux support removed since v1.02]
     
    364875;                MBR_Main_NoLinuxKrnlPartition:
    365876
     877
     878MBR_Main_ReEnterBootMenuPre:
     879
    366880                 ; SetUp PartitionPointers for BootMenu (filter non-bootable)
    367881                 call    PART_CalculateMenuPartPointers
     
    373887                 call    MBR_Teletype
    374888                 jmp     MBR_HaltSystem
    375                
     889
    376890                MBR_Main_SomethingBootAble:
    377891                 ; FixUp Values, define Timed Setup booting, etc.
    378892                 call    PART_FixUpDefaultPartitionValues
     893
     894
    379895
    380896                 ; -------------------------------------------------- BOOT-MENU
     
    389905                 call    PASSWORD_AskSystemPwd
    390906                 mov     al, Menu_EntryAutomatic
     907
     908                 ;mov     al, 2                                                   ; Rousseau: 0-based
     909
    391910                 mov     Menu_EntrySelected, al
    392                  jmp     MBR_Main_NoBootMenu
     911                 jmp     MBR_Main_NoBootMenu                                      ; Rousseau: NO-BOOT-MENU
    393912
    394913                MBR_Main_NoAutomaticBooting:
     914
     915                 ;call   SOUND_Beep
     916
    395917                 test    CFG_BootMenuActive, 0FFh
    396918                 jnz     MBR_Main_GotBootMenu
     
    398920                 ; Select default partition and boot system...
    399921                 call    PASSWORD_AskSystemPwd
     922
     923                 ;call    VideoIO_DBG_WriteString2                                ; Rousseau
     924
    400925                 mov     al, Menu_EntryDefault
     926                 ;mov al,0                                                        ; Rousseau: 0-based
    401927                 mov     Menu_EntrySelected, al
    402928                 jmp     MBR_Main_NoBootMenu
     
    405931                 ; ------------------------------------------ BOOT-MENU VISUALS
    406932                 call    FX_StartScreen
     933
     934                 ;call   SOUND_Beep
     935
    407936                 call    BOOTMENU_BuildBackground
    408937                 call    BOOTMENU_BuildMain
     
    410939                 call    PASSWORD_AskSystemPwd
    411940                 call    BOOTMENU_ResetTimedBoot
     941
     942                 ;call   SOUND_Beep
     943
    412944                 call    BOOTMENU_Execute
     945
     946                 ;call   SOUND_Beep
     947
    413948                 jc      MBR_Main_ReEnterSetup
    414949                 call    BOOTMENU_SetVarsAfterMenu
     950
     951                 ;call   SOUND_Beep
     952
    415953                 ; ------------------------------------------------- BOOTING...
    416954                MBR_Main_NoBootMenu:
     
    432970                 call    ANTIVIR_SaveBackUpMBR
    433971                 mov     dl, Menu_EntrySelected
    434                  call    PART_StartPartition
    435 
     972                 call    PART_StartPartition                                     ; Rousseau: START PARTITION
     973
     974
     975
     976;
     977; Include other code-modules here.
     978; Because TASM is a multiple pass assembler, forward references
     979; are possible.
     980;
     981b_std_txt:
    436982Include REGULAR\STD_TEXT.asm             ; Standard (non-translateable text)
     983size_std_txt = $-b_std_txt
     984
     985b_driveio:
    437986Include REGULAR\DRIVEIO.asm              ; Drive I/O, Config Load/Save
     987size_driveio = $-b_driveio
     988
     989b_videoio:
    438990Include REGULAR\ViDEOIO.asm              ; Video I/O
     991size_videoio = $-b_videoio
     992
     993b_timer:
    439994Include REGULAR\TIMER.asm                ; Timer
     995size_timer = $-b_timer
     996
     997b_partmain:
    440998Include REGULAR\PARTMAIN.asm             ; Regular Partition Routines
     999size_partmain = $-b_partmain
     1000
     1001b_partscan:
    4411002Include REGULAR\PARTSCAN.asm             ; Partition Scanning
     1003size_partscan = $-b_partscan
     1004
     1005b_bootmenu:
    4421006Include REGULAR\BOOTMENU.asm             ; Boot-Menu
     1007size_bootmenu = $-b_bootmenu
     1008
     1009b_password:
    4431010Include REGULAR\PASSWORD.asm             ; Password related
     1011size_password = $-b_password
     1012
     1013b_other:
    4441014Include REGULAR\OTHER.asm                ; Other Routines
    445 
     1015size_other = $-b_other
     1016
     1017; Rousseau: Special modules moved upwards.
     1018b_main:
    4461019Include SETUP\MAiN.ASM                   ; The whole AiR-BOOT SETUP
     1020size_main = $-b_main
     1021
     1022
     1023IFDEF TXT_IncludeCyrillic
     1024b_ccharset:
     1025   Include SPECiAL\CHARSET.asm           ; Charset Support (e.g. Cyrillic)
     1026size_ccharset = $-b_ccharset
     1027ENDIF
     1028
     1029b_math:
     1030Include REGULAR\MATH.ASM                  ; Math functions (like 32-bit multiply)
     1031size_math = $-b_math
     1032
     1033b_conv:
     1034Include REGULAR\CONV.ASM                  ; Various conversion routines
     1035size_conv = $-b_conv
     1036
     1037IFDEF AuxDebug
     1038b_debug:
     1039   Include REGULAR\DEBUG.ASM                 ; Various debugging routines, uses AUXIO and CONV
     1040size_debug = $-b_debug
     1041ENDIF
     1042
     1043b_auxio:
     1044Include REGULAR\AUXIO.ASM                 ; Com-port support for debugging
     1045size_auxio = $-b_auxio
     1046
     1047; Rousseau: moved upwards
     1048;IFDEF TXT_IncludeCyrillic
     1049;   Include SPECiAL\CHARSET.asm           ; Charset Support (e.g. Cyrillic)
     1050;ENDIF
     1051
     1052; End of sector 3.
     1053eos3:
     1054
     1055
     1056; Check for overlap
     1057slack03 = sos36 - eos3
     1058IF slack03 LT 0
     1059   .ERR2 "Location Overlap slack03 !"
     1060ENDIF
     1061
     1062
     1063;===============================================================================
     1064
     1065                           ;
     1066                           ; This is the AiR-BOOT MBR-Protection Image.
     1067                           ; 04600 / 200h = 23h = 35d sectors are before this point.
     1068                           ; The stuff generated here gets overwritten when the MBR_PROT.ASM
     1069                           ; module, which is assembled separately, gets merged.
     1070                           ; So you won't find the string below in the generated binary.
     1071                           ;
     1072                            org 04600h                          ; Sector 36-37
     1073
     1074; Start of sector 36.
     1075sos36:
     1076
     1077MBR_Protection:              db 'AiR-BOOT MBR-Protection Image'
     1078; Hardcoded to 1k (1024 bytes)
     1079   db 1024-($-MBR_Protection)  dup('X')
     1080
     1081; End of sector 37, yes this section is 2 sectors long.
     1082eos37:
     1083
     1084
     1085
     1086; Check for overlap
     1087slack04 = sos38 - eos37
     1088IF slack04 LT 0
     1089   .ERR2 "Location Overlap slack04 !"
     1090ENDIF
     1091
     1092
     1093
     1094
     1095;===============================================================================
     1096                                                                  ; Sector 38-x
     1097                           ;
     1098                           ; This section contains translatable texts.
     1099                           ;
     1100                           org 04A00h
     1101
     1102; Start of sector 28.
     1103sos38:
     1104
     1105b_txtother:
     1106Include TEXT\TXTOTHER.asm                ; All translateable Text-Strings
     1107size_txtother = $-b_txtother
     1108
     1109b_txtmenus:
     1110Include TEXT\TXTMENUS.asm                ; All translateable Menu-text
     1111size_txtmenus = $-b_txtmenus
     1112
     1113b_charset:
     1114Include TEXT\CHARSET.asm                 ; Special Video Charsets (if needed)
     1115size_charset = $-b_charset
     1116
     1117
     1118;
     1119; Here is room for more code.
     1120; Let's move the special modules here...
     1121; The come from the previous section.
     1122;
     1123b_virus:
    4471124Include SPECiAL\ViRUS.asm                ; Virus Detection / Anti-Virus
     1125size_virus = $-b_virus
    4481126; [Linux support removed since v1.02]
    4491127;Include SPECiAL\FAT16.asm                ; FAT-16 Support
    4501128;Include SPECiAL\LINUX.asm                ; Linux Kernel Support
     1129b_billsuxx:
    4511130Include SPECiAL\F00K\BILLSUXX.asm        ; Extended Partition - Microsoft-Hack
     1131size_billsuxx = $-b_billsuxx
     1132
     1133b_sound:
    4521134Include SPECiAL\SOUND.asm                ; Sound
     1135size_sound = $-b_sound
     1136
     1137b_apm:
    4531138Include SPECiAL\APM.asm                  ; Power Managment Support
     1139size_apm = $-b_apm
     1140
     1141b_fx:
    4541142Include SPECiAL\FX.asm                   ; l33t Cooper-Bars/Scrolling <bg>
     1143size_fx = $-b_fx
     1144
     1145b_lvm:
    4551146Include SPECiAL\LVM.asm                  ; LVM-specific code
    456 IFDEF TXT_IncludeCyrillic
    457    Include SPECiAL\CHARSET.asm           ; Charset Support (e.g. Cyrillic)
     1147size_lvm = $-b_lvm
     1148
     1149
     1150
     1151
     1152
     1153;
     1154; Let's make this always the last module in this section.
     1155;
     1156Include BLDDATE.asm                      ; Build Date generated by _build.cmd
     1157
     1158; End of sector x depending on size of translatable texts.
     1159eosx:
     1160
     1161                           org 06A00h - 4
     1162                           ;db    'BABE'
     1163
     1164                           org 06A00h
     1165                          ; db    'FACE'
     1166
     1167; Check for overlap
     1168slack05 = sos55 - eosx
     1169IF slack05 LT 0
     1170   .ERR2 "Location Overlap slack05 !"
    4581171ENDIF
    4591172
    460 ;---------------------------------------------------------------------------
    461                             org 04600h                          ; Sector 36-37
    462 MBR_Protection:              db 'AiR-BOOT MBR-Protection Image'
    463 ; Hardcoded to 1k (1024 bytes)
    464 
    465 ;---------------------------------------------------------------------------
    466                             org 04A00h                          ; Sector 38-x
    467 Include TEXT\TXTOTHER.asm                ; All translateable Text-Strings
    468 Include TEXT\TXTMENUS.asm                ; All translateable Menu-text
    469 Include TEXT\CHARSET.asm                 ; Special Video Charsets (if needed)
    470 
    471 ;---------------------------------------------------------------------------
    472                             org 06C00h                          ; Sector 55
     1173
     1174
     1175;===============================================================================
     1176                                                                  ; Sector 55
     1177
     1178                           ;
     1179                           ; This section contains the AiR-BOOT configuration.
     1180                           ; Note that it has a version that should be updated
     1181                           ; when stuff is added.
     1182                           ; Also add stuff to the end so that offsets of other
     1183                           ; variables remain vaild.
     1184                           ;
     1185                           org 06C00h
     1186sos55:
     1187
     1188
    4731189Configuration:
    474                              db 'AiRCFG-TABLE­'
    475                              db 01h, 02h, 'U' ; "Compressed" ID String
    476                              ; This is still version 1.02, because nothing got
    477                              ;  changed...
     1190                             db 'AiRCFG-TABLE­'                                  ; Rousseau: THERE IS AN INVISIBLE CHAR HERE !!
     1191                             db 01h, 07h, 'U' ; "Compressed" ID String
     1192                             ; This is now version 1.07 to have it in sync with the new code version for eCS.
     1193                             ; Version 1.02 was for code 1.06, 1.03 was internal and 1.04,1.05 and 1.06 do not exist.
     1194                             ; It is not required for the config to have the same version as the code, so in the future
     1195                             ; the code version might be higher than the config version if there are no changes to the latter.
    4781196
    4791197CFG_LastTimeEditLow          dw     0    ; Last Time Edited Stamp (will incr every setup)
     
    4901208CFG_TimedSecs                db    15    ; Timed Boot - How Many Seconds Till Boot
    4911209CFG_TimedDelay               dw   123    ; Timed Boot - Delay
    492 CFG_TimedBootLast            db     0    ; Timed Boot - Boot From Last Drive Booted From
     1210CFG_TimedBootLast            db     1    ; Timed Boot - Boot From Last Drive Booted From
    4931211CFG_RememberBoot             db     1    ; Remember Manual Boot Choice
    4941212CFG_RememberTimed            db     0    ; Remember if Timed Boot (if both disabled: Boot Default)
    495 CFG_IncludeFloppy            db     1    ; Include Floppy Drives in Boot-Menu
     1213CFG_IncludeFloppy            db     0    ; Include Floppy Drives in Boot-Menu
    4961214CFG_BootMenuActive           db     1    ; Display Boot-Menu (if Disabled: Boot Default)
    4971215                                         ; v0.29+ -> 2 - Detailed Bootmenu
     
    5031221CFG_IgnoreWriteToMBR         db     0    ; Just ignore writes to MBR, otherwise crash
    5041222CFG_FloppyBootGetName        db     0    ; Gets floppy name for display purposes
    505 CFG_DetectVirus              db     1    ; Detect Virus ?
    506 CFG_DetectStealth            db     1    ; Detect Stealth-Virus ?
    507 CFG_DetectVIBR               db     1    ; Detect BootRecord-Virus ?
    508 CFG_AutoEnterSetup           db     1    ; Automatic Enter Setup (first install!)
     1223CFG_DetectVirus              db     0    ; Detect Virus ?                                             // Rousseau: disabled
     1224CFG_DetectStealth            db     0    ; Detect Stealth-Virus ?                                     // Rousseau: disabled
     1225CFG_DetectVIBR               db     0    ; Detect BootRecord-Virus ?                                  // Rousseau: disabled
     1226CFG_AutoEnterSetup           db     0    ; Automatic Enter Setup (first install!)                     // Rousseau: disabled
    5091227CFG_MasterPassword           dw 0101Fh   ; Encoded Password (this is just CR)
    5101228                             dw 07A53h
     
    5371255CFG_AutomaticBoot            db     0    ; Automatic Booting (only one bootup)
    5381256CFG_PartAutomatic            db     0    ; Partition-No for automatic booting
    539 CFG_ForceLBAUsage            db     0    ; LBA-BIOS-API forced on any HDD I/O
     1257CFG_ForceLBAUsage            db     1    ; LBA-BIOS-API forced on any HDD I/O                         // Rousseau: enabled config (LBA)
    5401258CFG_IgnoreLVM                db     0    ; Ignores any LVM-Information
     1259
     1260
     1261;
     1262; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES
     1263;
     1264
     1265
     1266eoc:
     1267
     1268; Check for overlap
     1269slack05a = soiv - eoc
     1270IF slack05a LT 0
     1271   .ERR2 "Location Overlap slack05a !"
     1272ENDIF
     1273
     1274                              ; Allways have the name of the installation volume
     1275                              ; at this offset.
     1276                              ; So future config changes will not break auto-install.
     1277                              org   06D00h
     1278
     1279soiv:
     1280
     1281; Rousseau: added
     1282;eCS_InstallVolume            db     12 dup (0)                                   ; Rousseau: new install-volume
     1283;eCS_InstallVolume            db     'HIGHLOG' ,0                                ; Rousseau: new install-volume
     1284eCS_InstallVolume            db     0,'NOPHASEONE' ,0                            ; Rousseau: new install-volume
     1285;eCS_InstallVolume            db     'ECS-MIDDLE',0,0                         ; Rousseau: new install-volume
     1286;eCS_InstallVolume            db     'ECS-HIGH',0,0,0,0                         ; Rousseau: new install-volume
     1287;eCS_InstallVolume            db     'ECS-HIGH',0,'NO',0                         ; Rousseau: new install-volume
     1288
     1289
     1290
     1291; End of sector 55.
     1292eos55:
     1293
     1294
     1295
     1296; Check for overlap
     1297slack06 = sosvs - eos55
     1298IF slack06 LT 0
     1299   .ERR2 "Location Overlap slack06 !"
     1300ENDIF
     1301
     1302
    5411303
    5421304; VIR variables are for the AiR-BOOT Anti Virus Code
     
    5441306; stealth virus is on-line, we can intercept its call.
    5451307; Normal (non stealth) virus are trapped simply by rereading the MBR sector.
    546 ; If a virus is found, we will restore MBR from Sektor 60 and stop the system
     1308; If a virus is found, we will restore MBR from Sektor 60/62 and stop the system
    5471309; from working, so the user has to press reset. That's saver than a Reboot.
    5481310;
     
    5541316; off or just reset it by switching 'VIBR Detection'.
    5551317
     1318
     1319                           ;
     1320                           ; 06DABh - 06C00h = 01ABh = 427 bytes.
     1321                           ;
    5561322                            org 06DABh                          ; 427 Boundry
     1323
     1324sosvs:
     1325
    5571326AutoDrvLetter                db     0
    5581327AutoDrvLetterSerial          dd     0
    5591328
     1329; This entry is also 34 bytes long
    5601330BIOScontIPTentry:
    5611331                             db     0, 0, 0, 0, '           '
     
    5711341CFG_VIR_INT1C                dd     0    ; pointer to saved 1Ch entry point
    5721342
    573                                                                 ; 478 Boundry
     1343; 478 Boundry
     1344; This entry is also 34 bytes long
    5741345FloppyIPTentry:              db     0, 0, 0, 0, 'FloppyDrive'
    5751346                             db     0, 0FFh, Flags_BootAble
     
    5791350                             dd     0, 0
    5801351;---------------------------------------------------------------------------
    581                             org 06E00h                          ; Sector 56-57
     1352
     1353eosvs:
     1354
     1355; Check for overlap
     1356slack07 = sos56 - eosvs
     1357IF slack07 LT 0
     1358   .ERR2 "Location Overlap slack07 !"
     1359ENDIF
     1360
     1361
     1362                            ;org 06E00h                          ; Sector 56-57
     1363                            org image_size - 0a00h - (image_size - image_size_60secs)
     1364sos56:
     1365
     1366
     1367
     1368; Rousseau: This is the start of the AiR-BOOT IPT
     1369
    5821370PartitionTable: ; no-partitions detected... :]
    5831371;                             db    1, 0, 0, 0, 'Harddisc  1'
     
    6001388                ; AbsoluteBegin   * 4 (where the partition begins, in absolute sectors)
    6011389                ; AbsolutePartTab * 4 (where the partition table is, in absolute sectors)
    602                 ; --------------------> 34 Bytes (total maximum = 30)
    603 
    604                             org 071F6h
     1390                ; --------------------> 34 Bytes (total maximum partition-entries = 30)
     1391
     1392   db (partition_count * 34) dup ('P')
     1393
     1394eos56:
     1395
     1396; Check for overlap
     1397slack08 = eoiptsig - eos56
     1398IF slack08 LT 0
     1399   .ERR2 "Location Overlap slack08 !"
     1400ENDIF
     1401
     1402
     1403                            ;org 071F6h
     1404                            org image_size - 600h - (image_size - image_size_60secs) / 2 - 0ah
     1405soiptsig:
    6051406                             db 'AiRBOOTPAR' ; 1K internal partition table
     1407
     1408
     1409
     1410eoiptsig:
     1411
     1412; Check for overlap
     1413slack09 = soipt - eoiptsig
     1414IF slack09 LT 0
     1415   .ERR2 "Location Overlap slack09 !"
     1416ENDIF
     1417
    6061418;---------------------------------------------------------------------------
    607                             org 07200h                          ; Sector 58
    608 HidePartitionTable:          db   900 dup (0FFh)
     1419                            ;org 07200h                          ; Sector 58
     1420                            org image_size - 600h - (image_size - image_size_60secs) / 2                ; Sector 58
     1421soipt:
     1422sos58:
     1423
     1424HidePartitionTable:          db   (partition_count * 30) dup (0FFh)
    6091425                                         ; Format is:
    6101426                                         ;============
     
    6121428                                         ; --------------------> 30 Bytes * 30
    6131429
    614 DriveLetters:                db    30 dup (0)
     1430DriveLetters:                db    partition_count dup (0)
    6151431                                         ; Format is:
    6161432                                         ;============
    6171433                                         ; Drive-Letter : BYTE (80h-C:, 81h-D:)
    6181434                                         ; --------------------> 1 Byte * 30
    619 
    620                             org 075F6h
     1435eos58:
     1436eoipt:
     1437
     1438; Check foroverlap
     1439slack10 = sohidsig - eoipt
     1440IF slack10 LT 0
     1441   .ERR2 "Location Overlap slack10 !"
     1442ENDIF
     1443
     1444
     1445
     1446                            ;org 075F6h
     1447                            org image_size - 200h -0ah
     1448
     1449sohidsig:
    6211450                             db 'AiRBOOTHID' ; 1K internal Hide-partition table
     1451
     1452eohidsig:
     1453
     1454; Check for overlap
     1455slack11 = sohid - eohidsig
     1456IF slack11 LT 0
     1457   .ERR2 "Location Overlap slack11 !"
     1458ENDIF
     1459
     1460
     1461
     1462
    6221463;---------------------------------------------------------------------------
    623                             org 07600h                          ; Sector 60
    624 MBR_BackUpMBR                db 'AiR-BOOT MBR-BackUp - Just to fill this sector with something'
    625 
    626                             org 077FFh
    627                              db     0
     1464                            ;org 07600h                          ; Sector 60
     1465                            org image_size - 200h                ; Sector 60
     1466sohid:
     1467sos60:
     1468MBR_BackUpMBR                db 'AiR-BOOT MBR-BackUp - Just to fill this sector with something',0
     1469AirBootRocks                 db     'AiR-BOOT Rocks!',0
     1470
     1471eos60:
     1472eohid:
     1473
     1474; Check for overlap
     1475slack12 = eoab - eohid
     1476IF slack12 LT 0
     1477   .ERR2 "Location Overlap slack12 !"
     1478ENDIF
     1479
     1480
     1481                           ;org 077FEh
     1482                           org image_size - 2
     1483                           dw     0BABEh
     1484                           ;dw 0
     1485;BIOS_AuxParms              dw     BIOS_AuxParmsDefault                           ; Initialized at start when developing
     1486
     1487eoab:
     1488
     1489;
     1490; Rousseau:
     1491; End of AiR-BOOT code and data.
     1492;
     1493
     1494
     1495;
     1496; Rousseau:
     1497; Below functions like a BSS segment, thus uninitialized data.
     1498;
     1499sobss:
    6281500;---------------------------------------------------------------------------
    6291501                            org 0A000h                          ; Uninitialized
     
    6331505LVMSector:                   db   512 dup (?) ; Temporary Sector for LVM
    6341506TmpSector:                   db   512 dup (?) ; Temporary Sector
    635 TmpSector2:
     1507
    6361508; Everything used to build a new IPT and reference it to the old one
    637 NewPartTable:                db  1024 dup (?) ; New Partition Table
    638 NewHidePartTable:            db   900 dup (?) ; New Hide-Partition Table
    639 NewDriveLetters:             db    30 dup (?) ; Logical Drive-Letters
    640 
    641 PartitionSizeTable:          db   180 dup (?) ; Size-Table (6 bytes per partition)
     1509NewPartTable:                db  1536 dup (?) ; New Partition Table
     1510NewHidePartTable:            db   partition_count * 30 dup (?) ; New Hide-Partition Table
     1511NewDriveLetters:             db    partition_count dup (?) ; Logical Drive-Letters
     1512
     1513PartitionSizeTable:          db   partition_count * 6 dup (?) ; Size-Table (6 bytes per partition)
    6421514PartitionPointers            dw    52 dup (?) ; Maximum is 52 entries till now
    6431515PartitionPointerCount        db     ?         ; Count of total Partition Pointers
    644 PartitionXref                db    30 dup (?) ; X-Reference Table
    645 PartitionVolumeLetters       db    30 dup (?) ; Volume-Letters
     1516PartitionXref                db    partition_count dup (?) ; X-Reference Table
     1517PartitionVolumeLetters       db    partition_count dup (?) ; Volume-Letters
    6461518                                              ;  0 - no LVM support
    6471519                                              ;  1 - LVM support, but no letter
     
    6501522TotalHarddiscs               db     ?         ; Total harddrives (by POST)
    6511523LBASwitchTable               db   128 dup (?) ; Bit 25-18 for CHS/LBA Switching
    652 NewPartitions                db     ?         ; Freshly found partitions
     1524NewPartitions                db     ?         ; Freshly found partitions         ; Independent of SaveConfiguration
    6531525
    6541526VideoIO_Segment              dw     ?    ; Segment for Video I/O
     
    7231595;LINUX_KernelNo               db     ?         ; Total of Kernels in KernelEntries
    7241596;LINUX_KernelSizeTable        db   120 dup (?) ; Size-Table (6 bytes per kernel)
    725 EndOfVariables:
     1597;EndOfVariables:
    7261598
    7271599; Dynamically Generated Tables - do not need to get initialized with NUL
     
    7331605LVM_CRCTable:                dd   256 dup (?) ; LVM-CRC (->SPECiAL\LVM.asm)
    7341606
     1607
     1608
     1609;
     1610; Rousseau: added some stuff.
     1611;
     1612
     1613
     1614                              ;EVEN
     1615HugeDisk                      db    MaxDisks  dup(?)
     1616TrueSecs                      dd    MaxDisks  dup(?)
     1617
     1618; BIOS geometry of the boot-drive
     1619; Note that heads cannot be 256 due to legacy DOS/BIOS bug
     1620; If Int13X is supported those values are used, otherwise the legacy values.
     1621BIOS_Cyls                     dd    MaxDisks  dup(?)
     1622BIOS_Heads                    dd    MaxDisks  dup(?)
     1623BIOS_Secs                     dd    MaxDisks  dup(?)
     1624BIOS_Bytes                    dw    MaxDisks  dup(?)
     1625BIOS_TotalSecs                dq    MaxDisks  dup(?)
     1626
     1627; LBA geometry of the boot-drive
     1628; Note that these values are taken from the BPB of a partition boot-record
     1629LVM_Cyls                      dd    MaxDisks  dup(?)
     1630LVM_Heads                     dd    MaxDisks  dup(?)
     1631LVM_Secs                      dd    MaxDisks  dup(?)
     1632LVM_Bytes                     dw    MaxDisks  dup(?)
     1633LVM_TotalSecs                 dq    MaxDisks  dup(?)
     1634
     1635; OS/2 geometry of the boot-drive
     1636; Note that these values are taken from the BPB of a partition boot-record
     1637LOG_Cyls                      dd    MaxDisks  dup(?)
     1638LOG_Heads                     dd    MaxDisks  dup(?)
     1639LOG_Secs                      dd    MaxDisks  dup(?)
     1640LOG_Bytes                     dw    MaxDisks  dup(?)
     1641LOG_TotalSecs                 dq    MaxDisks  dup(?)
     1642
     1643; Rousseau: moved here
     1644EndOfVariables:
     1645
     1646; Temporary buffer for 48h INT13X bios call
     1647; Word aligned
     1648           ;even
     1649           ;align 2
     1650
     1651           ;db     1  dup(?)
     1652
     1653i13xbuf    dw     1  dup (?)                       ; Size of the buffer; this param *must* be present. Code inserts it.
     1654           db     126 dup(?)                       ; The buffer itself.
     1655           i13xbuf_size = $-offset i13xbuf-2       ; Size of buffer (excluding the size word at the start).
     1656
     1657eobss:
     1658
     1659
    7351660code_seg        ends
    7361661                end     air_boot
Note: See TracChangeset for help on using the changeset viewer.