Changeset 31


Ignore:
Timestamp:
Jan 13, 2013, 8:15:35 AM (13 years ago)
Author:
Ben Rietbroek
Message:

Bumped code-version to v1.0.8 [2011-11-11]

Fixes

o Fixed the drive-letter feature that was broken in v1.07
o Corrected release date in signature which was not updated with v1.07

Changes

o Bumped code-version in signature to v1.0.8

The extra dot is cosmetic only, the version in the signature
is BCD-coded and did not change format.

o Reworked MBR code to contain two I13X signatures

These signatures are actually MOV EAX,'X31I' in the original eCS
LVM MBR-code. However, they are at different offsets in the v1.x
and v2.x versions of the LVM MBR-code. (v1.x->0d5h -- v2.x->0d0h)
Other code might depend on their existence so we put both in
the AiR-BOOT MBR. (See eCS bugtracker issue #3002)

Note

This commit and all following commits upto and including the RC3
commit [2012-09-09] are delayed commits from a local repository.
Also, the RC (Release Candidate) naming of the corresponding commits
is a bit misleading. One would label a revision with RC when near to
a final release. Since many things have changed between RC1,RC2 & RC3,
these RC's should be interpreted as mile-stones.

WARNING!!

All commits upto and including the commit of [2012-05-13] contain
a severe bug!! Building from these sources and then disabling
the 'force LBA' feature while also using the drive-letter feature or
editing the label can destroy the MBR on all attached disks!!
DO NOT DISABLE 'FORCE LBA USAGE' WHEN BUILT FROM THE ABOVE COMMITS!!

Location:
trunk
Files:
1 added
14 edited

Legend:

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

    r30 r31  
    2020; Rousseau: # Fixes #
    2121; -------------------
     22;
     23; v1.08
     24; -----
     25; - Fixed driveletter feature which was broken in v1.07.
     26; - Reworked MBR-code to provide two I13X signatures.
     27; - Esc from SETUP would save to disk.
     28;   It now retains the changes only for this boot and
     29;   does not write them to disk.
     30; - Corrected contact links.
     31; -
     32;
     33; v1.07
     34; -----
    2235; # Huge Drives and LVM #
    2336; When using disks >512GB under eComStation, the drive geometry changes to
     
    4861
    4962
    50 ;---------------------------------------------------------------------------
    51 ;                                                      AiR-BOOT / MAIN-CODE
    52 ;---------------------------------------------------------------------------
     63;------------------------------------------------------------------------------
     64;                                                         AiR-BOOT / MAIN-CODE
     65;------------------------------------------------------------------------------
    5366;
    5467
     
    6275; skipping an unconditional jump to the target on base of complementary
    6376; 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.
     77; TASM also has a bug in that when the .ERR2 directive is used when
     78; the .386 directive is in effect, the JUMPS directive is also active
     79; and cannot be turned off.
    6680; NOJUMPS seems to have no effect in this situation.
    6781; In this case 4 NOP instructions are generated after forward referencing jump
     
    87101; in the BSS.
    88102;
    89 MaxDisks                   equ      16
     103MaxDisks                   equ      64
    90104
    91105;
     
    94108AuxDebug                   equ      1
    95109
    96 
    97 BiosComPort                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)
    103 AuxInitParms               equ      11100011b                                    ; 9600 bps, no parity, 1 stop-bit, 8 bits per char
    104 
    105 BIOS_AuxParmsDefault       equ      (AuxInitParms SHL 8) OR BiosComPort          ; Default word value for offset 77FEh (BIOS_AuxParms)
     110; Com-port for debugging, 0 is disabled
     111BiosComPort                equ      0
     112
     113
     114;
     115; bits 7-5 = datarate
     116;  (000=110,001=150,010=300,011=600,100=1200,101=2400,110=4800,111=9600 bps)
     117; bits 4-3 = parity
     118;  (00 or 10 = none, 01 = odd, 11 = even)
     119; bit  2   = stop-bits
     120;  (set = 2 stop-bits, clear = 1 stop-bit)
     121; bits 1-0 = data-bits
     122;  (00 = 5, 01 = 6, 10 = 7, 11 = 8)
     123;
     124
     125; 9600 bps, no parity, 1 stop-bit, 8 bits per char
     126AuxInitParms               equ      11100011b
     127
     128; Default word value for BIOS_AuxParms variable
     129; Note that is has moved since v1.07
     130BIOS_AuxParmsDefault       equ      (AuxInitParms SHL 8) OR BiosComPort
     131
    106132;
    107133; If ReleaseCode is not defined, it will produce debug-able code...
    108134;
    109 ReleaseCode                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.
     135ReleaseCode                equ      -1
     136
     137
     138
     139
    114140
    115141;
     
    117143;
    118144
    119 ; Use different addresses depending on whether in pre-boot or debug environment.
     145; Use different addresses depending on whether in pre-boot
     146; or debug environment.
    120147IFDEF ReleaseCode
    121    StartBaseSeg             equ     00000h   ; Pre-boot, so we are in low memory
     148   StartBaseSeg             equ     00000h   ; Pre-boot, we are in low memory
    122149   StartBasePtr             equ     07C00h   ; BIOS starts our MBR at 0:7C00
    123150  ELSE
    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
     151   StartBaseSeg             equ     03A98h   ; Adjust to DOS segment
     152                                             ; Rousseau: where does this value
     153                                             ; come from ?
     154                                             ; Should be CS;
     155                                             ; Rectified in actual code by
     156                                             ; ignoring this value.
     157   StartBasePtr             equ     00100h   ; We are a .com file,DOS is active
    126158ENDIF
    127159
    128160; Address labels after code-move
    129 BootBaseSeg                 equ      8000h   ; Pre-boot, somewhere in the low 640K
     161BootBaseSeg                 equ     08000h   ; Pre-boot, in the low 640K
    130162BootBasePtr                 equ         0h   ; We put our MBR to this location
    131 BootBaseExec                equ  BootBasePtr+offset MBR_RealStart
    132 StackSeg                    equ      7000h   ; Put the stack below the code
     163BootBaseExec                equ     BootBasePtr+offset MBR_RealStart
     164StackSeg                    equ     07000h   ; Put the stack below the code
    133165
    134166; Video pages, no INT 10h is used for menu-drawing etc.
     
    154186
    155187; Offsets for Partition-Entries in MBR/EPRs
    156 LocBRPT_LenOfEntry          equ         16                                       ; Length of a standard MBR or EPR entry
    157 LocBRPT_Flags               equ          0                                       ; Bootable, Hidden, etc.
    158 LocBRPT_BeginCHS            equ          1                                       ; Combined 10-bits cyl with 6 bits
    159 LocBRPT_BeginHead           equ          1                                       ; Start head      (0<=H<255)    255 is invalid !
    160 LocBRPT_BeginSector         equ          2                                       ; Start sector    (1<=S<=255)
    161 LocBRPT_BeginCylinder       equ          3                                       ; Start cylinder  (0<=C<[1024,16384,65536,n])
    162 LocBRPT_SystemID            equ          4                                       ; Type of system using the partition
    163 LocBRPT_EndCHS              equ          5                                       ; Same for end of partition
     188LocBRPT_LenOfEntry          equ         16   ; Length of a standard MBR or EPR entry
     189LocBRPT_Flags               equ          0   ; Bootable, Hidden, etc.
     190LocBRPT_BeginCHS            equ          1   ; Combined 10-bits cyl with 6 bits
     191LocBRPT_BeginHead           equ          1   ; Start head      (0<=H<255)    255 is invalid !
     192LocBRPT_BeginSector         equ          2   ; Start sector    (1<=S<=255)
     193LocBRPT_BeginCylinder       equ          3   ; Start cylinder  (0<=C<[1024,16384,65536,n])
     194LocBRPT_SystemID            equ          4   ; Type of system using the partition
     195LocBRPT_EndCHS              equ          5   ; Same for end of partition
    164196LocBRPT_EndHead             equ          5
    165197LocBRPT_EndSector           equ          6
    166198LocBRPT_EndCylinder         equ          7
    167 LocBRPT_RelativeBegin       equ          8                                       ; Where the ...
    168 LocBRPT_AbsoluteLength      equ         12                                       ; ?
    169 
    170 LocBR_Magic                 equ        510                                       ; ?
     199LocBRPT_RelativeBegin       equ          8
     200LocBRPT_AbsoluteLength      equ         12
     201
     202LocBR_Magic                 equ        510
    171203
    172204; Offsets for LVM Information Sector
     
    181213LocLVM_PartitionSize        equ          8   ; is DWORD
    182214LocLVM_PartitionStart       equ         12   ; is DWORD
    183 LocLVM_VolumeLetter         equ         18   ; is BYTE (Letter C-Z or 0) (relative to entry)
     215LocLVM_VolumeLetter         equ         18   ; is BYTE (Letter C-Z or 0)
     216                                             ; (relative to entry)
    184217
    185218; Rousseau: added (index in LVM-sector)
    186 LocLVM_Secs                 equ         20h  ; Sectors per Track                     ; Rousseau: this one is used for the OS/2 extended geometry
     219LocLVM_Secs                 equ         20h  ; Sectors per Track (OS/2 ext-geo)
    187220LocLVM_Heads                equ         1ch  ; Number of heads
    188221LocLVM_VolumeLetter2        equ         78   ; is BYTE (Letter C-Z or 0)             ; FOUT !! niet entry relative !
     
    190223LocLVM_OnBootMenu           equ         76   ; is on bootmenu                        ; FOUT !! niet entry relative !
    191224
     225; Truncated to 11 chars when  displayed in menu
    192226LocLVM_VolumeName           equ         20   ; 20 bytes
    193 LocLVM_PartitionName        equ         40   ; 20 bytes
     227LocLVM_PartitionName        equ         40   ; 20 bytes (Used in menu)
    194228
    195229
     
    197231
    198232; Offsets for IPT (Internal Partition Table)
    199 LocIPT_MaxPartitions        equ         partition_count   ; Maximum LocIPT_MaxPartitions
     233LocIPT_MaxPartitions        equ         partition_count   ; 45 in v1.07
    200234LocIPT_LenOfSizeElement     equ          6   ; Size of one Size-Element
    201235LocIPT_LenOfIPT             equ         34   ; Length of an IPT-entry
    202236LocIPT_Serial               equ          0   ; Serial from MBR ?
    203 LocIPT_Name                 equ          4   ; Name from FS or LVM   (part/vol)
    204 LocIPT_Drive                equ         15   ; Drive-ID              (80h,81h etc. sub 7fh to get 1-based disk-number)
    205 LocIPT_SystemID             equ         16   ; Partition-Type        (06,07,etc)
     237LocIPT_Name                 equ          4   ; Name from FS or LVM  (part/vol)
     238LocIPT_Drive                equ         15   ; Drive-ID             (80h,81h)
     239LocIPT_SystemID             equ         16   ; Partition-Type       (06,07,etc)
    206240LocIPT_Flags                equ         17   ; AiR-BOOT Flags for partition (see below)
    207241LocIPT_BootRecordCRC        equ         18   ; CRC of Boot-Record
     
    278312
    279313
    280 ;===============================================================================
    281                                                                   ; Sector 1
     314;==============================================================================
     315                                                                    ; Sector 1
    282316
    283317
     
    306340
    307341
    308 ;---------------------------------------------------------------------------
     342;------------------------------------------------------------------------------
    309343AiR_BOOT:     cli                         ; Some M$ operating systems need a CLI
    310                                           ;  here otherwise they will go beserk  ; Rousseau: M$ osses are beserk by definition.
     344                                          ;  here otherwise they will go beserk
    311345                                          ;  and will do funny things during
    312346                                          ;  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
     347              db      0EBh                ; JMP-Short -> MBR_Start
     348              ; Uses the 'A' as the displacement !
     349              db      'AiRBOOT', 07h, 11h, 20h, 11h, 01h, 08h, TXT_LanguageID
    315350
    316351              ; ID String, Date and Version Number, U for US version
    317352              db      1                   ; Total Sectors Count,
    318                                           ;  Will get overwritten by FIXBSET.exe
     353                                          ; Will get overwritten by FIXBSET.exe
    319354MBR_CheckCode dw      0                   ; Check-Sum for Code
    320355
    321356;
    322 ; This label is jumped to from the jump after 'eCSRocks'.
    323357; No single instruction below should be changed, added or removed in the code
    324358; below as this will cause the jump-link to go haywire.
     359;
    325360MBR_Start:    sti                         ;    This opcode is dedicated to:
    326361              cld                         ;    =MICROSOFT JUMP DEPARTMENT=
     
    329364              ; AX got loaded wrongly for debug, changed the instructions
    330365              ; 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.
     366              ; Don't comment-out the redundant instruction below because this
     367              ; *will* change the number of bytes and break the jump-chain.
    333368              mov     ax, StartBaseSeg    ; The segment we are moving ourself from (NOT USED)
    334369              ;mov     ds, ax
     
    345380                 mov     cx, 256          ; Pre-boot environment
    346381                ELSE
    347                  mov     cx, 32700        ; Debug environment                    ; Rousseau: where does 32700 come from ? (30720)
     382                 mov     cx, 32700        ; Debug environment (move ~64kB)
    348383              ENDIF
    349384
     
    353388              rep     movsw
    354389
    355               ; Code a jump to the
     390              ; Code an intersegment jump to the new location
    356391              db      0EAh
    357392              dw      BootBaseExec        ; This is MBR_RealStart + BootBasePtr
     
    375410              jmp     MBR_HaltSys
    376411
    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 :-)
    384               jmp     MBR_Start          ; We jump here, because I needed to
    385                                          ;  insert a CLI on start and did not
    386                                          ;  want to change AiR-BOOT detection
    387                                          ;  because of Microsoft inventions...
     412
     413
     414                     ; Comport settings
     415                     ; It had to be moved to create room for the double I13X
     416                     ; signature.
     417                     ; It cannot be in the config-area (sector 55)
     418                     ; because that area
     419                     ; is crc-protected.
     420BIOS_AuxParms        dw     BIOS_AuxParmsDefault
     421
     422;
     423; Reserved space
     424; Should check overflow here, later...
     425;
     426reserved       db     6 dup(0)
     427
     428
     429               ;
     430               ; We jump here after the first instructions of the
     431               ; AiR-BOOT signature.
     432               ; So we ensure the jump is always at this offset.
     433               org      044h
     434               jmp      MBR_Start      ; We jump here, because I needed to
     435                                       ; insert a CLI on start and did not
     436                                       ; want to change AiR-BOOT detection
     437                                       ; because of Microsoft inventions...
    388438;
    389439; Entry-point when loading fails.
     
    461511;
    462512
    463 ;---------------------------------------------------------------------------
     513;------------------------------------------------------------------------------
    464514MBR_RealStart:
    465515              mov     ax, StackSeg        ; 07000h, below the moved code
    466516              mov     ss, ax
    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.
     517              ;mov     sp, 7FFFh          ; Odd stack-pointer ??
     518              mov     sp, 7FFEh           ; Even is better
     519              mov     ax, es              ; ES holds segment where we moved to
    470520              mov     ds, ax              ; Set DS==ES to Code Segment
    471521
    472522              ; If we are in debug-mode, all code is moved already,
    473523              ; 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.
     524              ; One difference is that in debug-mode, the whole .com image is
     525              ; loaded by dos while when air-boot is active from the MBR it
     526              ; does the loading itself.
    479527              IFNDEF ReleaseCode
    480528                 jmp     AiR_BOOT_Start
     
    483531
    484532              ; Load missing parts from harddrive...
    485               mov     ax, cs              ; actually obsolete
    486               mov     es, ax              ; actually obsolete
     533;              mov     ax, cs              ; actually obsolete
     534;              mov     es, ax              ; actually obsolete
    487535
    488536              ; Load the configuration-sectors from disk.
     
    491539              mov     cx, 0037h           ; Is 55d is config-sector
    492540
    493 
    494 
    495 IF image_size EQ image_size_60secs
    496               mov     ax, 0205h           ; Read 5 sectors (55 - 59)
    497 ELSE
    498               mov     ax, 0207h           ; Read 7 sectors (55 - 61)
    499 ENDIF
    500 
    501               int     13h
     541              ; Call the i/o-part
     542              call MBR_LoadConfig
     543
    502544              jnc     MBR_ConfigCopy_NoError
    503545
     
    513555              mov     ah, 02h
    514556
    515               mov     al, ds:[10h]        ; 34h = 52d sectors (35h in extended version)
     557              mov     al, ds:[10h]        ; Number of code sectors
    516558              int     13h
    517559              jnc     MBR_RealStart_NoError
    518560              jmp     MBR_ConfigCopy_LoadError
     561
     562
     563
    519564              ; [v1.05+]
    520565              ; Signature for IBM's LVM to detect our "powerful" features ;)
    521               db      'I13X'
     566              ; [v1.08+]
     567              ; Reworked MBR code to be able to create a double 'I13X' signature.
     568              ; MBR's created with LVM eCS v1.x have the signature at 0d5h
     569              ; MBR's created with LVM eCS v2.x have the signature at 0d0h
     570              ; See eCS bugtracker issue #3002
     571              db      0,'I13X',0,'I13X'
     572
     573
    522574             MBR_RealStart_NoError:
    523575              ; Now Check Code with CheckSum
     
    532584                 call    MBR_GetCheckOfSector
    533585              loop    MBR_RealStart_CheckCodeLoop
     586
     587
    534588              cmp     MBR_CheckCode, bx
    535589              je      MBR_RealStart_CheckSuccess
     590
    536591              mov     si, offset TXT_ERROR_Attention
    537592              call    MBR_Teletype
     
    547602
    548603
    549 ;---------------------------------------------------------------------------
    550    Include TEXT\TXTMBR.asm               ; All translateable Text in MBR
    551 ;---------------------------------------------------------------------------
    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
    560 BIOS_AuxParms              dw     BIOS_AuxParmsDefault                           ; Initialized at start when developing
     604
     605;------------------------------------------------------------------------------
     606   Include TEXT\TXTMBR.asm                     ; All translateable Text in MBR
     607;------------------------------------------------------------------------------
     608
     609eot:
     610
     611; Check for overlap
     612slack00 = eos1 - eot
     613IF slack00 LT 0
     614   .ERR2 "Location Overlap slack00 !"
     615ENDIF
     616
     617
     618; bios aux
     619
     620eos1:
     621
     622; This is an ugly kludge function to create space for the
     623; double 'I13X' signature.
     624; It loads the configuration sectors, but bx,cx and dx are not initialized
     625; in this function. That's done around line 500.
     626; Putting this few bytes here creates just enough room.
     627; The size of this function should grow.
     628MBR_LoadConfig                Proc Near
     629              ; Changed from conditional assembler to calculated
     630              ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"
     631              mov     ax, (MBR_BackUpMBR - Configuration) / 2  ; sizeof(ab-configuration) to write
     632            ; TASM does not evaluate expression above corrrectly.
     633            ; Listing shows correct opcode but generated opcode has imm. word byteswapped.
     634            ; Casting to byte also does not work (overflow).
     635            ; So we swap back here -- must be removed in JWasm version !!
     636               xchg    ah,al
     637              mov     ah,02h
     638
     639              int     13h
     640      ret
     641MBR_LoadConfig                EndP
     642
     643                           org   001B8h
     644                           db    'DSIG'
     645
     646                           dw    '$$'
    561647
    562648                           org   00200h
    563649; End of sector 1
    564 eos1:
     650eos1a:
    565651
    566652; Check for overlap
    567 slack01 = sos2 - eos1
     653slack01 = sos2 - eos1a
    568654IF slack01 LT 0
    569655   .ERR2 "Location Overlap slack01 !"
     
    571657
    572658
    573 ;===============================================================================
    574                                                                   ; Sector 2
     659;==============================================================================
     660                                                                    ; Sector 2
    575661
    576662                           ;
     
    581667sos2:
    582668
    583 
    584 ; Everything beyond this point is loaded on startup and is NOT existant at first
     669;
     670; Everything beyond this point is loaded on startup
     671; and is NOT existant at first
     672;
    585673FurtherMoreLoad:
    586674
     
    637725
    638726
    639 ;===============================================================================
    640                                                                   ; Sector 3
     727;==============================================================================
     728                                                                    ; Sector 3
    641729                            org 00400h
    642730; Start of sector 3.
     
    736824                 ;inc     al
    737825                 ;mov     [Menu_EntryAutomatic],al
    738                  mov     [CFG_PartAutomatic],al                                  ; Rousseau: setup entry for install-volume
     826                 mov     [CFG_PartAutomatic],al       ; Setup entry for install-volume
    739827                 mov     [CFG_PartLast],al
    740828                 mov     ah, [eCS_InstallVolume]      ; 1st byte is 0 if no phase 1 active
     
    824912
    825913               ;
    826                ; ########################### WAIT FOR KEY ################################
     914               ; ####################### WAIT FOR KEY #########################
    827915               ;
    828916
     
    851939               call     AuxIO_TeletypeNL
    852940
     941
     942                 ; Save configuration so phase1 boot-through is disabled
     943                 ; on next boot.
     944                 ; Moved here to fix that Esc out of SETUP would also save.
     945                 ; So moved above the MBR_Main_ReEnterSetup label.
     946                 call    DriveIO_SaveConfiguration
     947
     948
     949
    853950               ;
    854951               ; RE-ENTER SETUP
    855952               ;
    856                 MBR_Main_ReEnterSetup:                                           ; Rousseau: SETUP re-enters here !
     953                MBR_Main_ReEnterSetup:
    857954                 call    SETUP_CheckEnterSETUP
    858955
    859956               ;call     SOUND_Beep
    860957
    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 :-)
     958                 ; Rousseau: Every time I see "AfterCrap" I have to laugh :-)
     959                 call    AFTERCRAP_Main
    869960
    870961; [Linux support removed since v1.02]
     
    906997                 mov     al, Menu_EntryAutomatic
    907998
    908                  ;mov     al, 2                                                   ; Rousseau: 0-based
    909 
    910                  mov     Menu_EntrySelected, al
    911                  jmp     MBR_Main_NoBootMenu                                      ; Rousseau: NO-BOOT-MENU
     999                 ;mov     al, 2
     1000
     1001                 mov     Menu_EntrySelected, al    ; zero based
     1002                 jmp     MBR_Main_NoBootMenu
    9121003
    9131004                MBR_Main_NoAutomaticBooting:
     
    9211012                 call    PASSWORD_AskSystemPwd
    9221013
    923                  ;call    VideoIO_DBG_WriteString2                                ; Rousseau
     1014                 ;call    VideoIO_DBG_WriteString2
    9241015
    9251016                 mov     al, Menu_EntryDefault
    926                  ;mov al,0                                                        ; Rousseau: 0-based
     1017                 ;mov al,0                         ; zero based
    9271018                 mov     Menu_EntrySelected, al
    9281019                 jmp     MBR_Main_NoBootMenu
     
    9511042                 ;call   SOUND_Beep
    9521043
    953                  ; ------------------------------------------------- BOOTING...
     1044                 ; ---------------------------------------------------- BOOTING
    9541045                MBR_Main_NoBootMenu:
    9551046                 call    FX_StartScreen
     
    9701061                 call    ANTIVIR_SaveBackUpMBR
    9711062                 mov     dl, Menu_EntrySelected
    972                  call    PART_StartPartition                                     ; Rousseau: START PARTITION
     1063
     1064                 ; -------------------------------------------- START PARTITION
     1065                 call    PART_StartPartition
    9731066
    9741067
     
    9801073;
    9811074b_std_txt:
    982 Include REGULAR\STD_TEXT.asm             ; Standard (non-translateable text)
     1075Include REGULAR\STD_TEXT.asm     ; Standard (non-translateable text)
    9831076size_std_txt = $-b_std_txt
    9841077
    9851078b_driveio:
    986 Include REGULAR\DRIVEIO.asm              ; Drive I/O, Config Load/Save
     1079Include REGULAR\DRIVEIO.asm      ; Drive I/O, Config Load/Save
    9871080size_driveio = $-b_driveio
    9881081
    9891082b_videoio:
    990 Include REGULAR\ViDEOIO.asm              ; Video I/O
     1083Include REGULAR\ViDEOIO.asm      ; Video I/O
    9911084size_videoio = $-b_videoio
    9921085
    9931086b_timer:
    994 Include REGULAR\TIMER.asm                ; Timer
     1087Include REGULAR\TIMER.asm        ; Timer
    9951088size_timer = $-b_timer
    9961089
    9971090b_partmain:
    998 Include REGULAR\PARTMAIN.asm             ; Regular Partition Routines
     1091Include REGULAR\PARTMAIN.asm     ; Regular Partition Routines
    9991092size_partmain = $-b_partmain
    10001093
    10011094b_partscan:
    1002 Include REGULAR\PARTSCAN.asm             ; Partition Scanning
     1095Include REGULAR\PARTSCAN.asm     ; Partition Scanning
    10031096size_partscan = $-b_partscan
    10041097
    10051098b_bootmenu:
    1006 Include REGULAR\BOOTMENU.asm             ; Boot-Menu
     1099Include REGULAR\BOOTMENU.asm     ; Boot-Menu
    10071100size_bootmenu = $-b_bootmenu
    10081101
    10091102b_password:
    1010 Include REGULAR\PASSWORD.asm             ; Password related
     1103Include REGULAR\PASSWORD.asm     ; Password related
    10111104size_password = $-b_password
    10121105
    10131106b_other:
    1014 Include REGULAR\OTHER.asm                ; Other Routines
     1107Include REGULAR\OTHER.asm        ; Other Routines
    10151108size_other = $-b_other
    10161109
    10171110; Rousseau: Special modules moved upwards.
    10181111b_main:
    1019 Include SETUP\MAiN.ASM                   ; The whole AiR-BOOT SETUP
     1112Include SETUP\MAiN.ASM           ; The whole AiR-BOOT SETUP
    10201113size_main = $-b_main
    10211114
     
    10231116IFDEF TXT_IncludeCyrillic
    10241117b_ccharset:
    1025    Include SPECiAL\CHARSET.asm           ; Charset Support (e.g. Cyrillic)
     1118   Include SPECiAL\CHARSET.asm   ; Charset Support (e.g. Cyrillic)
    10261119size_ccharset = $-b_ccharset
    10271120ENDIF
    10281121
    10291122b_math:
    1030 Include REGULAR\MATH.ASM                  ; Math functions (like 32-bit multiply)
     1123Include REGULAR\MATH.ASM         ; Math functions (like 32-bit multiply)
    10311124size_math = $-b_math
    10321125
    10331126b_conv:
    1034 Include REGULAR\CONV.ASM                  ; Various conversion routines
     1127Include REGULAR\CONV.ASM         ; Various conversion routines
    10351128size_conv = $-b_conv
    10361129
    10371130IFDEF AuxDebug
    10381131b_debug:
    1039    Include REGULAR\DEBUG.ASM                 ; Various debugging routines, uses AUXIO and CONV
     1132   Include REGULAR\DEBUG.ASM     ; Various debugging routines,
     1133                                 ; uses AUXIO and CONV
    10401134size_debug = $-b_debug
    10411135ENDIF
    10421136
    10431137b_auxio:
    1044 Include REGULAR\AUXIO.ASM                 ; Com-port support for debugging
     1138Include REGULAR\AUXIO.ASM        ; Com-port support for debugging
    10451139size_auxio = $-b_auxio
    10461140
     
    10611155
    10621156
    1063 ;===============================================================================
     1157;==============================================================================
    10641158
    10651159                           ;
     
    10931187
    10941188
    1095 ;===============================================================================
    1096                                                                   ; Sector 38-x
     1189;==============================================================================
     1190                                                                 ; Sector 38-x
    10971191                           ;
    10981192                           ; This section contains translatable texts.
     
    11731267
    11741268
    1175 ;===============================================================================
    1176                                                                   ; Sector 55
     1269;==============================================================================
     1270                                                                   ; Sector 55
    11771271
    11781272                           ;
     
    11871281
    11881282
    1189 Configuration:
    1190                              db 'AiRCFG-TABLE­'                                  ; Rousseau: THERE IS AN INVISIBLE CHAR HERE !!
     1283Configuration:               ; THERE IS AN INVISIBLE CHAR HERE !!
     1284                             db 'AiRCFG-TABLE­'
    11911285                             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.
     1286                             ; This is now version 1.07 to have it in sync with
     1287                             ; the new code version for eCS.
     1288                             ; Version 1.02 was for code 1.06, 1.03 was internal
     1289                             ; and 1.04,1.05 and 1.06 do not exist.
     1290                             ; It is not required for the config to have the
     1291                             ; same version as the code, so in the future
     1292                             ; the code version might be higher than the
     1293                             ; config version if there are no changes to the latter.
    11961294
    11971295CFG_LastTimeEditLow          dw     0    ; Last Time Edited Stamp (will incr every setup)
     
    12051303
    12061304CFG_PartLast                 db     0    ; Which Partition was booted last time ? (Base=0)
    1207 CFG_TimedBoot                db     1    ; Timed Boot Enable (for REAL Enable look TimedBootEnable)
     1305CFG_TimedBoot                db     0    ; Timed Boot Enable (for REAL Enable look TimedBootEnable)
    12081306CFG_TimedSecs                db    15    ; Timed Boot - How Many Seconds Till Boot
    12091307CFG_TimedDelay               dw   123    ; Timed Boot - Delay
     
    12211319CFG_IgnoreWriteToMBR         db     0    ; Just ignore writes to MBR, otherwise crash
    12221320CFG_FloppyBootGetName        db     0    ; Gets floppy name for display purposes
    1223 CFG_DetectVirus              db     0    ; Detect Virus ?                                             // Rousseau: disabled
    1224 CFG_DetectStealth            db     0    ; Detect Stealth-Virus ?                                     // Rousseau: disabled
    1225 CFG_DetectVIBR               db     0    ; Detect BootRecord-Virus ?                                  // Rousseau: disabled
    1226 CFG_AutoEnterSetup           db     0    ; Automatic Enter Setup (first install!)                     // Rousseau: disabled
     1321CFG_DetectVirus              db     0    ; Detect Virus ?
     1322CFG_DetectStealth            db     0    ; Detect Stealth-Virus ?
     1323CFG_DetectVIBR               db     0    ; Detect BootRecord-Virus ?
     1324CFG_AutoEnterSetup           db     0    ; Automatic Enter Setup (first install!)
    12271325CFG_MasterPassword           dw 0101Fh   ; Encoded Password (this is just CR)
    12281326                             dw 07A53h
     
    12551353CFG_AutomaticBoot            db     0    ; Automatic Booting (only one bootup)
    12561354CFG_PartAutomatic            db     0    ; Partition-No for automatic booting
    1257 CFG_ForceLBAUsage            db     1    ; LBA-BIOS-API forced on any HDD I/O                         // Rousseau: enabled config (LBA)
     1355CFG_ForceLBAUsage            db     1    ; LBA-BIOS-API forced on any HDD I/O
    12581356CFG_IgnoreLVM                db     0    ; Ignores any LVM-Information
    12591357
     
    12791377soiv:
    12801378
    1281 ; Rousseau: added
    1282 ;eCS_InstallVolume            db     12 dup (0)                                   ; Rousseau: new install-volume
    1283 ;eCS_InstallVolume            db     'HIGHLOG' ,0                                ; Rousseau: new install-volume
    1284 eCS_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
     1379; SET(A)BOOT stores the volume name of the eCS system being installed here.
     1380; It is truncated to 11 chars because AiR-BOOT currently does not support
     1381; longer labelnames. The name is also capitalized.
     1382;eCS_InstallVolume            db     12 dup (0)
     1383;eCS_InstallVolume            db     'HIGHLOG' ,0
     1384eCS_InstallVolume            db     0,'NOPHASEONE' ,0
     1385;eCS_InstallVolume            db     'ECS-MIDDLE',0,0
     1386;eCS_InstallVolume            db     'ECS-HIGH',0,0,0,0
     1387;eCS_InstallVolume            db     'ECS-HIGH',0,'NO',0
    12881388
    12891389
     
    13491449                             db     0, 1, 0 ; Location of Partition/Boot Record
    13501450                             dd     0, 0
    1351 ;---------------------------------------------------------------------------
     1451;------------------------------------------------------------------------------
    13521452
    13531453eosvs:
     
    13601460
    13611461
    1362                             ;org 06E00h                          ; Sector 56-57
     1462                            ;org 06E00h                         ; Sector 56-57
    13631463                            org image_size - 0a00h - (image_size - image_size_60secs)
    13641464sos56:
     
    14161516ENDIF
    14171517
    1418 ;---------------------------------------------------------------------------
    1419                             ;org 07200h                          ; Sector 58
    1420                             org image_size - 600h - (image_size - image_size_60secs) / 2                ; Sector 58
     1518;------------------------------------------------------------------------------
     1519                            ;org 07200h                            ; Sector 58
     1520                            org image_size - 600h - (image_size - image_size_60secs) / 2
    14211521soipt:
    14221522sos58:
     
    14611561
    14621562
    1463 ;---------------------------------------------------------------------------
    1464                             ;org 07600h                          ; Sector 60
    1465                             org image_size - 200h                ; Sector 60
     1563;------------------------------------------------------------------------------
     1564                            ;org 07600h                            ; Sector 60
     1565                            org image_size - 200h                  ; Sector 60
    14661566sohid:
    14671567sos60:
     1568
    14681569MBR_BackUpMBR                db 'AiR-BOOT MBR-BackUp - Just to fill this sector with something',0
    14691570AirBootRocks                 db     'AiR-BOOT Rocks!',0
     
    14821583                           org image_size - 2
    14831584                           dw     0BABEh
    1484                            ;dw 0
    1485 ;BIOS_AuxParms              dw     BIOS_AuxParmsDefault                           ; Initialized at start when developing
    14861585
    14871586eoab:
    14881587
    14891588;
    1490 ; Rousseau:
    14911589; End of AiR-BOOT code and data.
    14921590;
     
    14941592
    14951593;
    1496 ; Rousseau:
    14971594; Below functions like a BSS segment, thus uninitialized data.
    14981595;
    14991596sobss:
    1500 ;---------------------------------------------------------------------------
    1501                             org 0A000h                          ; Uninitialized
     1597;------------------------------------------------------------------------------
     1598                            org 0A000h                         ; Uninitialized
    15021599; This space actually gets initialized in PreCrap to NUL (till EndOfVariables)
    15031600BeginOfVariables:
     
    15071604
    15081605; Everything used to build a new IPT and reference it to the old one
    1509 NewPartTable:                db  1536 dup (?) ; New Partition Table
     1606NewPartTable:                db  1536 dup (?)                  ; New Partition Table
    15101607NewHidePartTable:            db   partition_count * 30 dup (?) ; New Hide-Partition Table
    1511 NewDriveLetters:             db    partition_count dup (?) ; Logical Drive-Letters
     1608NewDriveLetters:             db    partition_count dup (?)     ; Logical Drive-Letters
    15121609
    15131610PartitionSizeTable:          db   partition_count * 6 dup (?) ; Size-Table (6 bytes per partition)
    1514 PartitionPointers            dw    52 dup (?) ; Maximum is 52 entries till now
    1515 PartitionPointerCount        db     ?         ; Count of total Partition Pointers
     1611PartitionPointers            dw    52 dup (?)   ; Maximum is 52 entries till now
     1612PartitionPointerCount        db     ?           ; Count of total Partition Pointers
    15161613PartitionXref                db    partition_count dup (?) ; X-Reference Table
    15171614PartitionVolumeLetters       db    partition_count dup (?) ; Volume-Letters
    1518                                               ;  0 - no LVM support
    1519                                               ;  1 - LVM support, but no letter
    1520                                               ;  'C'-'Z' - assigned drive letter
    1521 
    1522 TotalHarddiscs               db     ?         ; Total harddrives (by POST)
    1523 LBASwitchTable               db   128 dup (?) ; Bit 25-18 for CHS/LBA Switching
    1524 NewPartitions                db     ?         ; Freshly found partitions         ; Independent of SaveConfiguration
    1525 
    1526 VideoIO_Segment              dw     ?    ; Segment for Video I/O
    1527 
    1528 ExtendedAbsPos               dd     ?    ; Extended Partition Absolute Position
    1529 ExtendedAbsPosSet            db     ?    ; If Absolute Position set
    1530 
    1531 CurPartition_Location        dw     4 dup (?)  ; Where did current partition came from?
    1532 CurIO_UseExtension           db     ?    ; 1-Use INT 13h EXTENSIONS
    1533                                          ;    (filled out by PreCrap)
    1534 CurIO_Scanning               db     ?    ; 1-AiR-BOOT is scanning partitions
    1535                                          ;    (for detailed error message)
     1615                                                ;  0 - no LVM support
     1616                                                ;  1 - LVM support, but no letter
     1617                                                ;  'C'-'Z' - assigned drive letter
     1618
     1619TotalHarddiscs               db     ?           ; Total harddrives (by POST)
     1620LBASwitchTable               db   128 dup (?)   ; Bit 25-18 for CHS/LBA Switching
     1621NewPartitions                db     ?           ; Freshly found partitions
     1622                                                ; Independent of SaveConfiguration
     1623
     1624VideoIO_Segment              dw     ?           ; Segment for Video I/O
     1625
     1626ExtendedAbsPos               dd     ?           ; Extended Partition Absolute Position
     1627ExtendedAbsPosSet            db     ?           ; If Absolute Position set
     1628
     1629CurPartition_Location        dw     4 dup (?)   ; Where did current partition came from?
     1630CurIO_UseExtension           db     ?           ; 1-Use INT 13h EXTENSIONS
     1631                                                ; (filled out by PreCrap)
     1632CurIO_Scanning               db     ?           ; 1-AiR-BOOT is scanning partitions
     1633                                                ; (for detailed error message)
    15361634
    15371635; [Linux support removed since v1.02]
     
    16511749           ;db     1  dup(?)
    16521750
    1653 i13xbuf    dw     1  dup (?)                       ; Size of the buffer; this param *must* be present. Code inserts it.
     1751i13xbuf    dw     1  dup (?)                       ; Size of the buffer;
     1752                                                   ; this param *must* be present.
     1753                                                   ; Code inserts it.
    16541754           db     126 dup(?)                       ; The buffer itself.
    1655            i13xbuf_size = $-offset i13xbuf-2       ; Size of buffer (excluding the size word at the start).
     1755           i13xbuf_size = $-offset i13xbuf-2       ; Size of buffer
     1756                                                   ; (excluding the size word at the start).
    16561757
    16571758eobss:
  • trunk/BOOTCODE/MAKE.BAT

    r30 r31  
    3838%exe2bin% air-boot.exe air-boot.com >nul
    3939if errorlevel 1 goto Failed
     40
    4041..\tools\internal\fixcode.com
     42
    4143copy AIR-BOOT.com ..\RELEASE\BOOTCODE\AIRBT-%1.bin
    4244
  • trunk/BOOTCODE/MAKEALL.BAT

    r30 r31  
    77@CALL MAKE.BAT
    88@CD ..
    9 @pause
     9rem @pause
    1010
    1111@cls
     
    1717@CALL MAKE.BAT
    1818@CD ..\..\BOOTCODE
    19 @pause
     19rem @pause
    2020
    2121@cls
     
    2727@CALL MAKE.BAT
    2828@CD ..\..\..\BOOTCODE
    29 @pause
     29rem @pause
    3030
    3131@cls
     
    3737@CALL MAKE.BAT
    3838@CD ..\..\BOOTCODE
    39 @pause
     39rem @pause
    4040
    4141@cls
  • trunk/BOOTCODE/REGULAR/AUXIO.ASM

    r30 r31  
    2525; -----------------------
    2626; Output some stuff to the serial port.
    27 ; Word at 1B0h in MBR must be initialized for this.
     27; The aux parameters in the MBR must be initialized for this.
    2828; Lower byte is com-port, 0=disabled, 1=com1, etc.
    2929; High byte is initialization; see below. (0e3h)
  • trunk/BOOTCODE/REGULAR/BOOTMENU.ASM

    r30 r31  
    190190   mov     cx, CLR_INFO_WINDOW_BM
    191191   ;mov     cx, 0C06h ; brown, main background
    192    call    VideoIO_Color                                                         ; Rousseau: color info window
     192   call    VideoIO_Color                                                         ; Ccolor info window
    193193
    194194   mov     bx, 1401h
     
    211211
    212212   mov     cx, CLR_INFO_TEXT_BM                   ; Info text
    213    call    VideoIO_Color                                                         ; Rousseau: color info text
     213   call    VideoIO_Color                                                         ; Color info text
    214214
    215215   mov     si, offset TXT_BootMenuHelpText1
  • trunk/BOOTCODE/REGULAR/DRIVEIO.ASM

    r30 r31  
    6161   mov     si, offset Configuration      ; Calculate new checksum
    6262   xor     bx, bx
    63    mov     cx, 5                         ; Total of 5 Config-Sectors
     63
     64   ; Changed from 5 to calculated
     65   ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"
     66   mov     cx, (MBR_BackUpMBR - Configuration) / 2   ; Size of the ab-configuration
     67   ; TASM does not evaluate expression above corrrectly.
     68   ; Listing shows correct opcode but generated opcode has imm. word byteswapped.
     69   ; Casting to byte also does not work (overflow).
     70   ; So we swap back here -- must be removed in JWasm version !!
     71      xchg  ch,cl
     72
    6473   mov     dx, [CFG_CheckConfig]
    6574   mov     [CFG_CheckConfig], bx
     
    7382   mov     dx, 0080h                     ; First harddrive, Sector 55...
    7483   mov     cx, 0037h
    75    mov     ax, 0305h                     ; Function 03, 5 sectors to write
     84
     85   ; Changed from 5 to calculated
     86   ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"
     87   mov     ax, (MBR_BackUpMBR - Configuration) / 2  ; sizeof(ab-configuration) to write
     88   ; TASM does not evaluate expression above corrrectly.
     89   ; Listing shows correct opcode but generated opcode has imm. word byteswapped.
     90   ; Casting to byte also does not work (overflow).
     91   ; So we swap back here -- must be removed in JWasm version !!
     92      xchg  ah,al
     93   mov     ah,03h
     94
    7695   int     13h
    7796   jnc     DIOSC_NoError
     
    147166;  This is calculated by Sector*Heads. Comparing will get done with Bit 25-10
    148167;  on LBA sectors, so we actually divide sector number by 1024.
    149 DriveIO_InitLBASwitchTable      Proc Near   Uses es di                           ; Rousseau: LBA !
     168DriveIO_InitLBASwitchTable      Proc Near   Uses es di
    150169   mov     di, offset LBASwitchTable
    151170   mov     dh, TotalHarddiscs
     
    166185         mov   ah,0
    167186
    168          mov     bl, dh         ; DH -> head count                               ; Rousseau: nope, it's max head number !
     187         mov     bl, dh         ; DH -> max head number
    169188         mul     bl             ; AX = Sectors*Heads
    170189         shl     ah, 1
     
    188207; Rousseau: Enhanced to handle sector-numbers 127 and 255 besides 63 for LVM-info sectors.
    189208;           Ugly, need to cleanup.
    190 DriveIO_LVMAdjustToInfoSector   Proc Near   Uses                                 ; Rousseau: LVM stuff !
     209DriveIO_LVMAdjustToInfoSector   Proc Near   Uses
    191210
    192211
     
    555574   mov     cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location
    556575
    557    call    DriveIO_LVMAdjustToInfoSector                                         ; Rousseau: LVM stuff !
     576   call    DriveIO_LVMAdjustToInfoSector
    558577
    559578   mov     si, offset LVMSector
     
    593612   ;popf
    594613
    595    call    LVM_CheckSectorSignature                                              ; Rousseau: LVM stuff !
     614   call    LVM_CheckSectorSignature
    596615   jnc     DIOLLVMS_NoLVMSector
    597    call    LVM_CheckSectorCRC                                                    ; Rousseau: LVM stuff !
     616   call    LVM_CheckSectorCRC
    598617   jnc     DIOLLVMS_NoLVMSector
    599618   ret
     
    662681; Preserve: all registers
    663682; #########################################################################
    664 DriveIO_LoadSector              Proc Near  Uses ax bx ds si es di                ; Rousseau: Disk IO
     683DriveIO_LoadSector              Proc Near  Uses ax bx ds si es di
    665684   test     cs:[CurIO_UseExtension], 1
    666685   jz       DIOLS_UseNormal
    667    ; Are we forced do use LBA via Setting?
    668    test     cs:[CFG_ForceLBAUsage], 1                                            ; Rousseau: LBA
     686   ; Are we forced do use LBA via Setting? ; Rousseau: LBA
    669687   jnz      DIOLS_UseExtension
    670688   ; Is the drive not a harddrive?
     
    685703         pop      es
    686704         mov      bx, si                     ; ES:BX - Destination
    687          mov      ax, 0201h                  ; Function 2 - Load Sector          ; Rousseau: Disk IO -- legacy BIOS call
     705         mov      ax, 0201h                  ; Function 2 - Load Sector
    688706         int      13h
    689707         jnc      DIOLS_Success
     
    704722      pop     ds
    705723      mov     si, offset DriveIO_DAP
    706       mov     ah, 42h                        ; Extended Read                     ; Rousseau: Disk IO -- extended BIOS call
     724      mov     ah, 42h                        ; Extended Read
    707725      int     13h
    708726   pop     cx
     
    728746   jz       DIOSS_UseNormal
    729747   ; Are we forced do use LBA via Setting?
    730    test     cs:[CFG_ForceLBAUsage], 1                                            ; Rousseau: LBA
     748   test     cs:[CFG_ForceLBAUsage], 1
    731749   jnz      DIOSS_UseExtension
    732750   ; Is the drive not a harddrive?
  • trunk/BOOTCODE/REGULAR/OTHER.ASM

    r30 r31  
    363363   mov     si, offset Configuration
    364364   xor     bx, bx
    365    mov     cx, 5                   ; Total of 5 Sectors
     365
     366   ; Changed from 5 to calculated
     367   ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"
     368   mov     cx, (MBR_BackUpMBR - Configuration) / 2   ; Size of the ab-configuration
     369   ; TASM does not evaluate expression above corrrectly.
     370   ; Listing shows correct opcode but generated opcode has imm. word byteswapped.
     371   ; Casting to byte also does not work (overflow).
     372   ; So we swap back here -- must be removed in JWasm version !!
     373      xchg  ch,cl
     374
    366375   mov     dx, CFG_CheckConfig
    367376   mov     CFG_CheckConfig, bx
  • trunk/BOOTCODE/REGULAR/PARTMAIN.ASM

    r30 r31  
    435435   ret
    436436PART_FillOutSizeElement         EndP
     437
     438
     439
     440
     441
     442
     443
     444
     445
     446
     447
     448; This routine is called to hide a partition
     449;        In: DL - Partition to hide
     450; Destroyed: None
     451PART_HidePartition              Proc Near   Uses ax bx cx dx si di
     452   call    PART_GetPartitionPointer      ; Pointer to partition (DL) -> SI
     453
     454   ; First load the partition table of that partition...
     455   mov     ax, wptr [si+LocIPT_AbsolutePartTable+0]
     456   mov     bx, wptr [si+LocIPT_AbsolutePartTable+2]
     457   mov     cx, wptr [si+LocIPT_LocationPartTable+1]
     458   mov     dh, bptr [si+LocIPT_LocationPartTable+0]
     459   mov     dl, [si+LocIPT_Drive]
     460   call    DriveIO_LoadPartition
     461   ; Partition-Table now LOADED
     462   mov     di, offset PartitionSector+446 ; ES:DI - 1st partitionentry...
     463
     464   ; Put our partition's location into registers...
     465   mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
     466   mov     bx, wptr [si+LocIPT_AbsoluteBegin+2]
     467   sub     ax, wptr [si+LocIPT_AbsolutePartTable+0]
     468   sbb     bx, wptr [si+LocIPT_AbsolutePartTable+2]
     469   ; BX:AX - absolute position of partition relative to partition table
     470   ; ...and search for it...
     471  PHP_SearchLoop:
     472      cmp     ax, wptr es:[di+LocBRPT_RelativeBegin]
     473      jne     PHP_SearchMismatch
     474      cmp     bx, wptr es:[di+LocBRPT_RelativeBegin+2]
     475      jne     PHP_SearchMismatch
     476      jmp     PHP_SearchMatch
     477     PHP_SearchMismatch:
     478      add     di, LocBRPT_LenOfEntry     ; 16 Bytes per partition entry
     479   cmp     di, 500+offset PartitionSector
     480   jb      PHP_SearchLoop
     481   jmp     MBR_HaltSystem                ; not found, something is wrong here
     482
     483   ; Found entry...
     484  PHP_SearchMatch:
     485   mov     al, bptr es:[di+LocBRPT_SystemID] ; Partition-ID into AL
     486   call    PART_SearchFileSysHiddenID    ; Put on =STEALTH=
     487   mov     bptr es:[di+LocBRPT_SystemID], al
     488   IFDEF ReleaseCode
     489      call    DriveIO_SavePartition      ; Saves Partition-Table
     490   ENDIF
     491   ret
     492PART_HidePartition              EndP
     493
     494; This here is for marking the first "good" non-hidden partition as being
     495;  active. It requires the partition table at EXECBASE.
     496;  Some BIOSes have problems with no primary marked active. Actually this is
     497;  a buggy implementation, because the MBR-code should normally check,
     498;  *not* the BIOS. This one *could* cause havoc to some systems, but I can't
     499;  do anything else.
     500PART_MarkFirstGoodPrimary       Proc Near   Uses ax si di
     501   mov     di, offset PartitionSector+446 ; DS:SI - 1st partitionentry
     502   ; First action to do: Remove the active flag from every partition
     503   push    di
     504      mov     cl, 4
     505     PMPP_RemoveActiveFlagLoop:
     506         and     bptr es:[di+LocBRPT_Flags], 7Fh
     507         add     di, LocBRPT_LenOfEntry
     508      dec     cl
     509      jnz     PMPP_RemoveActiveFlagLoop
     510   pop     di
     511   ; First Search, will hit on any PartitionID that is:
     512   ; a) not 0
     513   ; b) not hidden
     514   ; c) not extended partition (05h or 0Fh)
     515  PMPP_Search1Loop:
     516      mov     al, bptr es:[di+LocBRPT_SystemID]
     517      or      al, al
     518      jz      PMPP_Search1NoHit
     519      cmp     al, 05h
     520      je      PMPP_Search1NoHit
     521      cmp     al, 0Fh
     522      je      PMPP_Search1NoHit
     523      mov     bl, al                     ; BL == AL == PartitionID
     524      push    si
     525         call    PART_SearchFileSysName
     526      pop     si                         ; AL == UnhiddenPartitionID
     527      cmp     al, bl                     ; if ID is unhidden...
     528      je      PMPP_SearchHit
     529     PMPP_Search1NoHit:
     530      add     di, LocBRPT_LenOfEntry     ; 16 Bytes per Partition-Entry
     531   cmp     di, 500+offset PartitionSector
     532   jb      PMPP_Search1Loop
     533
     534   mov     di, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry
     535   ; Second Search, hit on anything that is not an extended partition
     536   ;  (05 or 0Fh)
     537  PMPP_Search2Loop:
     538      mov     al, bptr es:[di+LocBRPT_SystemID]
     539      or      al, al
     540      jz      PMPP_Search2NoHit
     541      cmp     al, 05h
     542      je      PMPP_Search2NoHit
     543      cmp     al, 0Fh
     544      jne     PMPP_SearchHit
     545     PMPP_Search2NoHit:
     546      add     di, LocBRPT_LenOfEntry     ; 16 Bytes per Partition-Entry
     547   cmp     di, 500+offset PartitionSector
     548   jb      PMPP_Search2Loop
     549   jmp     PMPP_SearchFailed
     550
     551  PMPP_SearchHit:
     552   or      bptr es:[di], 80h             ; SET ACTIVE PARTITION
     553  PMPP_SearchFailed:
     554   ret
     555PART_MarkFirstGoodPrimary       EndP
     556
     557; Searches the Name and Flags to a FileSysID (PartitionID)
     558;        In: AL - FileSysID
     559;       Out: AL - Unhidden File-System-ID, AH - Flags for this File-System
     560;            SI - Pointer to Name (8char)
     561; Destroyed: *none*
     562PART_SearchFileSysName          Proc Near  Uses bx dx
     563   ;movzx   bx, al
     564   mov   bl,al
     565   mov   bh,0
     566
     567   mov     si, offset FileSysIDs
     568  PSFSN_SearchLoop:
     569      lodsw                              ; AL - NormalID, AH-HiddenID
     570      mov     dl, ds:[si]                ; DL - File-System-Flags
     571      inc     si
     572      cmp     al, bl                     ; Check, if Unhidden-ID matches...
     573      je      PSFSN_Match
     574      cmp     ah, bl                     ; Check, if Hidden-ID matches...
     575      je      PSFSN_Match
     576      mov     al, bl                     ; So Unhidden-ID will be Original-ID
     577      cmp     ah, 0                      ; Unknown (last ID in table)
     578      je      PSFSN_Match
     579      inc     bh
     580      jmp     PSFSN_SearchLoop
     581
     582  PSFSN_Match:
     583   ; AL is already Unhidden-ID
     584   mov     ah, dl
     585   ; AH is now the FileSystem-Flag
     586   ;movzx   bx, bh
     587   mov   bl,bh
     588   mov   bh,0
     589
     590   shl     bx, 3   ; Offsets * 8
     591   mov     si, offset FileSysNames
     592   add     si, bx
     593   ret
     594PART_SearchFileSysName          EndP
     595
     596; Searches the Hidden ID corresponding to a FileSysID (PartitionID)
     597;        In: AL - FileSysID
     598;       Out: AL - Hidden File-System-ID
     599PART_SearchFileSysHiddenID      Proc Near  Uses bx
     600   ;movzx   bx, al
     601   mov   bl,al
     602   mov   bh,0
     603
     604   mov     si, offset FileSysIDs
     605  PSFSHI_SearchLoop:
     606      lodsw                              ; AL - NormalID, AH-HiddenID
     607      inc     si
     608      cmp     al, bl                     ; Check, if Unhidden-ID matches...
     609      je      PSFSHI_Match
     610      cmp     ah, bl                     ; Check, if Hidden-ID matches...
     611      je      PSFSHI_Match
     612      mov     ah, bl                     ; So Unhidden-ID will get replied...
     613      cmp     ah, 0                      ; Unknown (last ID in table)
     614      je      PSFSHI_Match
     615      inc     bh
     616      jmp     PSFSHI_SearchLoop
     617
     618  PSFSHI_Match:
     619   mov     al, ah                        ; AL = Hidden ID
     620   ret
     621PART_SearchFileSysHiddenID      EndP
     622
     623;        In: DS:SI - Partition-Name, CX - Maximum/Total Length
     624;       Out: Carry-Flag set, if valid Partition-Name
     625; Destroyed: None
     626PART_CheckForValidPartName      Proc Near   Uses ax cx dx si
     627   ; Our logic is as follows:
     628   ;  If all chars are U -> Invalid (due reformated signature)
     629   ;  If anything below 32, but 0 -> Invalid (due invalid chars)
     630   ;  If anything above 165 -> Invalid (due invalid chars)
     631   ;  If anything between 123-128 -> Invalid (due invalid chars)
     632   ;  DX - holds count of 'U's
     633   push    cx
     634      or      cx, cx
     635      jz      PCFVPN_InvalidName
     636      xor     dx, dx
     637     PCFVPN_CheckLoop:
     638         lodsb
     639         cmp     al, 0
     640         je      PCFVPN_ValidChar
     641         cmp     al, 32
     642         jb      PCFVPN_InvalidName
     643         cmp     al, 165
     644         ja      PCFVPN_InvalidName
     645         cmp     al, 123
     646         jb      PCFVPN_ValidChar
     647         cmp     al, 128
     648         jbe     PCFVPN_InvalidName
     649        PCFVPN_ValidChar:
     650         cmp     al, 'U'
     651         jne     PCFVPN_NoMagic
     652         inc     dx
     653        PCFVPN_NoMagic:
     654      dec     cx
     655      jnz     PCFVPN_CheckLoop
     656   pop     cx
     657   cmp     cx, dx
     658   clc
     659   je      PCFVPN_WasMagic
     660   stc
     661  PCFVPN_WasMagic:
     662   ret
     663  PCFVPN_InvalidName:
     664   pop     cx
     665   clc
     666   ret
     667PART_CheckForValidPartName      EndP
     668
     669
     670; Rousseau: added
     671; Compare a volume-label in the IPT to the install-volume
     672; SI holds pointer to entry in IPT
     673; CY set if this entry is also the install-volume
     674PART_IsInstallVolume            Proc Near   Uses ax cx dx si di
     675      cld                                    ; Advance upwards with lodsb
     676      mov   di, offset eCS_InstallVolume     ; Address of install-volume label (max. 11 chars)
     677
     678      mov   cx, 11                           ; Maximum length of label
     679      xor   dl, dl                           ; Not found yet
     680
     681    ; Compare next character
     682    PART_IsInstallVolumeNext:
     683      lodsb                                  ; Load byte from SI (IPT-entry)
     684      ;cmp      al,' '                        ; If space then use zero
     685      ;jne      PART_IsInstallVolume_skip1
     686      ;xor      al,al
     687   PART_IsInstallVolume_skip1:
     688      xchg     ah,al                         ; Save char to AH
     689      xchg     si,di                         ; Exchange pointers
     690      lodsb                                  ; Load byte from SI (install-volume label)
     691      ;cmp      al,' '                        ; If space then use zero
     692      ;jne      PART_IsInstallVolume_skip2
     693      ;xor      al,al
     694   PART_IsInstallVolume_skip2:
     695      xchg     si,di                         ; Reexchange pointers
     696      call     AuxIO_Teletype
     697      call     CONV_ToUpper
     698      call     AuxIO_Teletype
     699      xchg     al,ah
     700      call     AuxIO_Teletype
     701      call     CONV_ToUpper
     702      call     AuxIO_Teletype
     703      call     AuxIO_TeletypeNL
     704
     705      ; Are both of them zero ?
     706      ; Then the names could be the same, but cx must not equal 11
     707      ; because that would indicate a null-string.
     708      mov      dh,al
     709      or       dh,ah
     710      jz       PART_IsInstallVolumeFound
     711
     712      cmp      ah,al                         ; Are the the same ?
     713      jnz      PART_IsInstallVolumeNotFound  ; Nope, compare ended
     714      loop     PART_IsInstallVolumeNext      ; Yep, Compare next character
     715
     716   PART_IsInstallVolumeFound:
     717      ; If CX is still 11 this was a zero string
     718      ; and thus not a valid volume-name.
     719      ; This should not occur as this function is only called when the first
     720      ; byte is non-zero.
     721      cmp      cx,11
     722      je       PART_IsInstallVolumeNotFound
     723      ; Found !
     724      mov      dl,1                          ; Found
     725      jmp      PART_IsInstallVolumeEnd
     726
     727
     728   PART_IsInstallVolumeNotFound:
     729      mov      dl,0
     730      jmp      PART_IsInstallVolumeEnd
     731
     732
     733   PART_IsInstallVolumeEnd:
     734      ; Set the status in CY
     735      mov      al,dl
     736      add      al,'0'
     737      call     AuxIO_TeletypeHexByte
     738      call     AuxIO_TeletypeNL
     739      rcr      dl,1                          ; Put found-flag in CY
     740      ret
     741PART_IsInstallVolume            EndP
    437742
    438743
     
    525830   mov     dh, bptr [si+LocIPT_LocationPartTable+0]
    526831   mov     dl, [si+LocIPT_Drive]
    527    call    DriveIO_LoadPartition         ; Load Table...                         ; Rousseau: LOAD PARTITION !
     832
     833   call    DriveIO_LoadPartition         ; Load Table...                [LOAD]
     834
    528835   ; --------------------------------------------------- MODIFY PARTITION TABLE
    529836   push    cs
     
    565872   or      byte ptr es:[di+LocBRPT_Flags], 80h ; set ACTIVE partition
    566873   IFDEF ReleaseCode
    567       call    DriveIO_SavePartition      ; Saves the Partition-Table             ; Rousseau: SAVE PARTITION !
     874      call    DriveIO_SavePartition      ; Saves the Partition-Table    [SAVE]
    568875   ENDIF
    569876
     
    578885   ; BX:AX -> Absolute End-Position of Partition
    579886
    580    test    CFG_ForceLBAUsage, 1                                                  ; Rousseau: LBA
     887   test    CFG_ForceLBAUsage, 1
    581888   jnz     PSP_ForceI13X
    582889   ; LBA-boundary at 16450560 (FB0400h) (16320x16x63)
     
    641948      mov     cx, 0001h                  ; Cylinder 0, Sector 1
    642949      mov     dx, 0080h                  ; First HD, Head 0
    643       call    DriveIO_LoadPartition      ; Load Primary Partition Table          ; Rousseau: LOAD MBR !
     950                                                                     ; Load MBR
     951      call    DriveIO_LoadPartition      ; Load Primary Partition Table
    644952      call    PART_MarkFirstGoodPrimary
    645953      IFDEF ReleaseCode
    646          call    DriveIO_SavePartition   ; Saves the Partition-Table             ; Rousseau: SAVE MBR !
     954                                                                     ; Save MBR
     955         call    DriveIO_SavePartition   ; Saves the Partition-Table
    647956      ENDIF
    648957     PSP_NoHideAdjustPrimaryMark:
     
    7161025   mov     dh, [si+LocIPT_LocationBegin+0]
    7171026   mov     dl, [si+LocIPT_Drive]
    718    call    DriveIO_LoadPartition         ; Loads boot-sector...                  ; Rousseau: LOAD PART BOOT-SECTOR !!
     1027   call    DriveIO_LoadPartition         ; Loads boot-sector...   [PARTBOOTSEC]
    7191028
    7201029   test    CFG_DetectVIBR, 1
     
    8061115
    8071116      ; Rousseau: # Boot Logical Partitions)
    808       ; FreeDOS and eCS on extpart on non-huge needs special support. (old ja jump)
    809       ; PC-DOS7 on huge pri fat16 2G works with both (XP too) when at start of disk. (also when offset at 20MiB)
    810       ; PCD7 bonkt vast als in 2GiB log at start of space. "Starting PC DOS..." verschijnt. PCD Loader probleem.
     1117      ; FreeDOS and eCS on extpart on non-huge needs special support.
     1118      ; (old ja jump)
     1119      ; PC-DOS7 on huge pri fat16 2G works with both (XP too) when at start of disk.
     1120      ; (also when offset at 20MiB)
     1121      ; PCD7 bonkt vast als in 2GiB log at start of space.
     1122      ; "Starting PC DOS..." verschijnt. PCD Loader probleem.
    8111123      ; Offset van start-of-disk bij PCD7 niet meer dan 2GiB maken.
    8121124      ; Special is needed to boot ECS-CXXVAC (log-part) on Douwskie Box with 40G disk.
     
    8191131      ; Laatste 63 is MBR.
    8201132      ;
    821       ; It seems PRI's already get special treatment in that they get their hidden secs updated.
    822       ; (100MB HD, moved 50MB PRI-DOS part UP, DFSee complains about wrong hidden, but AiR-BOOT corrects it before booting)
     1133      ; It seems PRI's already get special treatment in that they get their
     1134      ; hidden secs updated.
     1135      ; (100MB HD, moved 50MB PRI-DOS part UP, DFSee complains about wrong hidden,
     1136      ; but AiR-BOOT corrects it before booting)
    8231137
    8241138      ; FreeDOS zet 63 in SPT in BPB op 255/255 geo !!!!
     
    8291143
    8301144      ; Display volume-name
     1145      ; Just before booting the selected partition
    8311146      pushf
     1147      pusha
    8321148      push     si
    8331149      add      si, LocIPT_Name
    8341150      call     MBR_TeletypeVolName
    8351151      xor      si,si
    836       call     MBR_TeletypeNL                                                    ; Rousseau: Just before booting the selected partition
     1152      call     MBR_TeletypeNL
    8371153      pop      si
     1154      popa
    8381155      popf
    8391156
    8401157
    8411158
    842       jmp     special                                                            ; Rousseau: GOT IT !!! (LOG-BOOT) (alleen op huge disks !)
    843       ;jmp      PSP_NoSpecialSupport
    844       ;ja      PSP_NoSpecialSupport                                              ; Rousseau: original M. Kiewitz...
    845       ;jbe     PSP_NoSpecialSupport                                               ;   had to change to opposite !
     1159
     1160
     1161
     1162      ;
     1163      ; This section will be sanitized in the JWasm version.
     1164      ;
     1165
     1166      jmp     special
     1167      ;jmp     PSP_NoSpecialSupport
     1168
     1169      ;ja      PSP_NoSpecialSupport
     1170      ;jbe     PSP_NoSpecialSupport
    8461171
    8471172
     
    8551180      ; Special Support needed
    8561181special:
    857       ; Write actual drive-letter to partition boot-record.
    858       ; This is according to BPB.
     1182      ; Write actual drive-letter to partition boot-record in memory.
    8591183      mov     al, bptr [si+LocIPT_Drive]
     1184
    8601185      ; Also an influence with FreeDOS !
    8611186      ; Generates JFS ERROR when not set correctly !!!
    862       mov     bptr es:[di+36], al               ; Write Actual Drive-Letter (80h id first drive)        !!!!!!!!!!!!!!!!!!!!!!!
     1187      mov     bptr es:[di+36], al              ; Write Actual Drive-Letter to
     1188                                                ; PBR in RAM. (BIOS notation)
     1189
     1190      ;
     1191      ; Display drive info (debug)
     1192      ;
     1193      push     ax
     1194      mov      al,' '
     1195      call     VideoIO_PrintSingleChar
     1196      pop      ax
     1197      call     VideoIO_PrintHexByte
     1198      mov      al,'-'
     1199      call     VideoIO_PrintSingleChar
     1200
     1201      ;
     1202      ; Absolute offset of volume
     1203      ;
     1204      mov      ax, [si+LocIPT_AbsoluteBegin+2]
     1205      call     VideoIO_PrintHexWord
     1206      mov      ax, [si+LocIPT_AbsoluteBegin]
     1207      call     VideoIO_PrintHexWord
     1208      mov      al,'-'
     1209      call     VideoIO_PrintSingleChar
     1210
     1211      ;
     1212      ; Relative offset (3fh/63 with logicals)
     1213      ;
     1214      mov      ax,es:[di+30]
     1215      call     VideoIO_PrintHexWord
     1216      mov      ax,es:[di+28]
     1217      call     VideoIO_PrintHexWord
    8631218
    8641219      ; This could be incorrect when a partition is moved,
    8651220      ; or the system installer puts the wrong value here.
    866       ; FreeDOS (log-part) i.e. puts 03fH (63d) here, eventhough it is not a the start of the disk.
     1221      ; FreeDOS (log-part) i.e. puts 03fH (63d) here, eventhough it is not
     1222      ; at the start of the disk.
    8671223      ; This fixing is done by OS/2 BM as well, according to Martin.
    8681224      mov     ax, [si+LocIPT_AbsoluteBegin]
     
    8761232;jmp   PSP_NoLogicalSupport
    8771233
     1234
     1235   ;
     1236   ; Test if the drive-letter feature is active for this partition.
     1237   ; If so, then the drive that the user defined will be placed at
     1238   ; byte 25h (37d) of the in-ram PartitionSector (BPB).
     1239   ; (BIOS 80h notation: 80h=C, 81h=D, etc.)
     1240   ; This is a remedy for when the corresponding field (25h) in the BPB on
     1241   ; disk is zero.
     1242   ;
    8781243   test    byte ptr [si+LocIPT_Flags], Flags_DriveLetter
    8791244   jz      PSP_NoLogicalSupport
     
    8861251      mov     bptr es:[di+37], al        ; Write Drive Letter (OS/2 only)
    8871252
     1253      ; Display dl-feature drive if active
     1254      push     ax
     1255      mov      al,'-'
     1256      call     VideoIO_PrintSingleChar
     1257      pop      ax
     1258      call     VideoIO_PrintHexByte
     1259
    8881260   ; -------------------------------------------- COPY BOOT-RECORD TO STARTBASE
    8891261  PSP_NoLogicalSupport:
     1262
     1263
     1264      mov      al,'-'
     1265      call     VideoIO_PrintSingleChar
     1266      mov      al,[ExtendedAbsPosSet]
     1267      call     VideoIO_PrintHexByte
     1268
     1269
    8901270   push    si
    8911271      mov     ax, StartBaseSeg
     
    8961276      rep     movsw
    8971277   pop     si
    898    ; ---------------------------------------------------- NOW START BOOT-RECORD  ; Rousseau: START PARTITION BOOT-RECORD !!
     1278   ; ---------------------------------------------------- NOW START BOOT-RECORD
     1279
     1280
    8991281
    9001282
     
    9031285ENDIF
    9041286
    905                ;
    906                ; ########################### WAIT FOR KEY ################################
    907                ;
    908 
    909    ; Rousseau:
    910    ; Wait for key so we can see which volume is going to be started.
    911    ;xor     ax, ax
    912    ;int     16h
    913    ;cmp     al, 1bh                        ; is escape-key ?
    914    ;jne   skip_reenter
    915 
    916    ;jmp      MBR_Main_ReEnterBootMenuPre   ; yep, re-enter boot-menu
    917 
    918 skip_reenter:
    919 
    920 
    921 
    922 
    923 
    924 
    925 
     1287
     1288
     1289
     1290;
     1291; ################################## BYE BYE ##################################
     1292;
     1293
     1294   ;
     1295   ; Wait for keypress
     1296   ;
     1297   xor     ax, ax
     1298   int     16h
     1299
     1300   ; Is escape-key ?
     1301   cmp     al, 1bh
     1302
     1303   ; Nope, Go activate PBR loader
     1304   jne      start_pbr
     1305
     1306   ; Yep, Reenter bootmenu
     1307   jmp      MBR_Main_ReEnterBootMenuPre
     1308
     1309
     1310
     1311;
     1312; Transfer control to the PBR
     1313;
     1314start_pbr:
    9261315
    9271316   ;
     
    9361325   mov     dl, cs:[si+LocIPT_Drive]      ; Drive Physical No
    9371326
     1327   ;
     1328   ; JUMP TO PBR loader
     1329   ;
    9381330   IFDEF ReleaseCode
    939       db      0EAh                       ; JUMP TO Entry Point...Bye Bye
     1331      db      0EAh
    9401332      dw      StartBasePtr
    9411333      dw      StartBaseSeg
    9421334   ENDIF
     1335
     1336
    9431337PART_StartPartition             EndP
    9441338
    9451339
    946 
    947 
    948 
    949 
    950 
    951 
    952 
    953 
    954 
    955 ; This routine is called to hide a partition
    956 ;        In: DL - Partition to hide
    957 ; Destroyed: None
    958 PART_HidePartition              Proc Near   Uses ax bx cx dx si di
    959    call    PART_GetPartitionPointer      ; Pointer to partition (DL) -> SI
    960 
    961    ; First load the partition table of that partition...
    962    mov     ax, wptr [si+LocIPT_AbsolutePartTable+0]
    963    mov     bx, wptr [si+LocIPT_AbsolutePartTable+2]
    964    mov     cx, wptr [si+LocIPT_LocationPartTable+1]
    965    mov     dh, bptr [si+LocIPT_LocationPartTable+0]
    966    mov     dl, [si+LocIPT_Drive]
    967    call    DriveIO_LoadPartition
    968    ; Partition-Table now LOADED
    969    mov     di, offset PartitionSector+446 ; ES:DI - 1st partitionentry...
    970 
    971    ; Put our partition's location into registers...
    972    mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
    973    mov     bx, wptr [si+LocIPT_AbsoluteBegin+2]
    974    sub     ax, wptr [si+LocIPT_AbsolutePartTable+0]
    975    sbb     bx, wptr [si+LocIPT_AbsolutePartTable+2]
    976    ; BX:AX - absolute position of partition relative to partition table
    977    ; ...and search for it...
    978   PHP_SearchLoop:
    979       cmp     ax, wptr es:[di+LocBRPT_RelativeBegin]
    980       jne     PHP_SearchMismatch
    981       cmp     bx, wptr es:[di+LocBRPT_RelativeBegin+2]
    982       jne     PHP_SearchMismatch
    983       jmp     PHP_SearchMatch
    984      PHP_SearchMismatch:
    985       add     di, LocBRPT_LenOfEntry     ; 16 Bytes per partition entry
    986    cmp     di, 500+offset PartitionSector
    987    jb      PHP_SearchLoop
    988    jmp     MBR_HaltSystem                ; not found, something is wrong here
    989 
    990    ; Found entry...
    991   PHP_SearchMatch:
    992    mov     al, bptr es:[di+LocBRPT_SystemID] ; Partition-ID into AL
    993    call    PART_SearchFileSysHiddenID    ; Put on =STEALTH=
    994    mov     bptr es:[di+LocBRPT_SystemID], al
    995    IFDEF ReleaseCode
    996       call    DriveIO_SavePartition      ; Saves Partition-Table
    997    ENDIF
    998    ret
    999 PART_HidePartition              EndP
    1000 
    1001 ; This here is for marking the first "good" non-hidden partition as being
    1002 ;  active. It requires the partition table at EXECBASE.
    1003 ;  Some BIOSes have problems with no primary marked active. Actually this is
    1004 ;  a buggy implementation, because the MBR-code should normally check,
    1005 ;  *not* the BIOS. This one *could* cause havoc to some systems, but I can't
    1006 ;  do anything else.
    1007 PART_MarkFirstGoodPrimary       Proc Near   Uses ax si di
    1008    mov     di, offset PartitionSector+446 ; DS:SI - 1st partitionentry
    1009    ; First action to do: Remove the active flag from every partition
    1010    push    di
    1011       mov     cl, 4
    1012      PMPP_RemoveActiveFlagLoop:
    1013          and     bptr es:[di+LocBRPT_Flags], 7Fh
    1014          add     di, LocBRPT_LenOfEntry
    1015       dec     cl
    1016       jnz     PMPP_RemoveActiveFlagLoop
    1017    pop     di
    1018    ; First Search, will hit on any PartitionID that is:
    1019    ; a) not 0
    1020    ; b) not hidden
    1021    ; c) not extended partition (05h or 0Fh)
    1022   PMPP_Search1Loop:
    1023       mov     al, bptr es:[di+LocBRPT_SystemID]
    1024       or      al, al
    1025       jz      PMPP_Search1NoHit
    1026       cmp     al, 05h
    1027       je      PMPP_Search1NoHit
    1028       cmp     al, 0Fh
    1029       je      PMPP_Search1NoHit
    1030       mov     bl, al                     ; BL == AL == PartitionID
    1031       push    si
    1032          call    PART_SearchFileSysName
    1033       pop     si                         ; AL == UnhiddenPartitionID
    1034       cmp     al, bl                     ; if ID is unhidden...
    1035       je      PMPP_SearchHit
    1036      PMPP_Search1NoHit:
    1037       add     di, LocBRPT_LenOfEntry     ; 16 Bytes per Partition-Entry
    1038    cmp     di, 500+offset PartitionSector
    1039    jb      PMPP_Search1Loop
    1040 
    1041    mov     di, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry
    1042    ; Second Search, hit on anything that is not an extended partition
    1043    ;  (05 or 0Fh)
    1044   PMPP_Search2Loop:
    1045       mov     al, bptr es:[di+LocBRPT_SystemID]
    1046       or      al, al
    1047       jz      PMPP_Search2NoHit
    1048       cmp     al, 05h
    1049       je      PMPP_Search2NoHit
    1050       cmp     al, 0Fh
    1051       jne     PMPP_SearchHit
    1052      PMPP_Search2NoHit:
    1053       add     di, LocBRPT_LenOfEntry     ; 16 Bytes per Partition-Entry
    1054    cmp     di, 500+offset PartitionSector
    1055    jb      PMPP_Search2Loop
    1056    jmp     PMPP_SearchFailed
    1057 
    1058   PMPP_SearchHit:
    1059    or      bptr es:[di], 80h             ; SET ACTIVE PARTITION
    1060   PMPP_SearchFailed:
    1061    ret
    1062 PART_MarkFirstGoodPrimary       EndP
    1063 
    1064 ; Searches the Name and Flags to a FileSysID (PartitionID)
    1065 ;        In: AL - FileSysID
    1066 ;       Out: AL - Unhidden File-System-ID, AH - Flags for this File-System
    1067 ;            SI - Pointer to Name (8char)
    1068 ; Destroyed: *none*
    1069 PART_SearchFileSysName          Proc Near  Uses bx dx
    1070    ;movzx   bx, al
    1071    mov   bl,al
    1072    mov   bh,0
    1073 
    1074    mov     si, offset FileSysIDs
    1075   PSFSN_SearchLoop:
    1076       lodsw                              ; AL - NormalID, AH-HiddenID
    1077       mov     dl, ds:[si]                ; DL - File-System-Flags
    1078       inc     si
    1079       cmp     al, bl                     ; Check, if Unhidden-ID matches...
    1080       je      PSFSN_Match
    1081       cmp     ah, bl                     ; Check, if Hidden-ID matches...
    1082       je      PSFSN_Match
    1083       mov     al, bl                     ; So Unhidden-ID will be Original-ID
    1084       cmp     ah, 0                      ; Unknown (last ID in table)
    1085       je      PSFSN_Match
    1086       inc     bh
    1087       jmp     PSFSN_SearchLoop
    1088 
    1089   PSFSN_Match:
    1090    ; AL is already Unhidden-ID
    1091    mov     ah, dl
    1092    ; AH is now the FileSystem-Flag
    1093    ;movzx   bx, bh
    1094    mov   bl,bh
    1095    mov   bh,0
    1096 
    1097    shl     bx, 3   ; Offsets * 8
    1098    mov     si, offset FileSysNames
    1099    add     si, bx
    1100    ret
    1101 PART_SearchFileSysName          EndP
    1102 
    1103 ; Searches the Hidden ID corresponding to a FileSysID (PartitionID)
    1104 ;        In: AL - FileSysID
    1105 ;       Out: AL - Hidden File-System-ID
    1106 PART_SearchFileSysHiddenID      Proc Near  Uses bx
    1107    ;movzx   bx, al
    1108    mov   bl,al
    1109    mov   bh,0
    1110 
    1111    mov     si, offset FileSysIDs
    1112   PSFSHI_SearchLoop:
    1113       lodsw                              ; AL - NormalID, AH-HiddenID
    1114       inc     si
    1115       cmp     al, bl                     ; Check, if Unhidden-ID matches...
    1116       je      PSFSHI_Match
    1117       cmp     ah, bl                     ; Check, if Hidden-ID matches...
    1118       je      PSFSHI_Match
    1119       mov     ah, bl                     ; So Unhidden-ID will get replied...
    1120       cmp     ah, 0                      ; Unknown (last ID in table)
    1121       je      PSFSHI_Match
    1122       inc     bh
    1123       jmp     PSFSHI_SearchLoop
    1124 
    1125   PSFSHI_Match:
    1126    mov     al, ah                        ; AL = Hidden ID
    1127    ret
    1128 PART_SearchFileSysHiddenID      EndP
    1129 
    1130 ;        In: DS:SI - Partition-Name, CX - Maximum/Total Length
    1131 ;       Out: Carry-Flag set, if valid Partition-Name
    1132 ; Destroyed: None
    1133 PART_CheckForValidPartName      Proc Near   Uses ax cx dx si
    1134    ; Our logic is as follows:
    1135    ;  If all chars are U -> Invalid (due reformated signature)
    1136    ;  If anything below 32, but 0 -> Invalid (due invalid chars)
    1137    ;  If anything above 165 -> Invalid (due invalid chars)
    1138    ;  If anything between 123-128 -> Invalid (due invalid chars)
    1139    ;  DX - holds count of 'U's
    1140    push    cx
    1141       or      cx, cx
    1142       jz      PCFVPN_InvalidName
    1143       xor     dx, dx
    1144      PCFVPN_CheckLoop:
    1145          lodsb
    1146          cmp     al, 0
    1147          je      PCFVPN_ValidChar
    1148          cmp     al, 32
    1149          jb      PCFVPN_InvalidName
    1150          cmp     al, 165
    1151          ja      PCFVPN_InvalidName
    1152          cmp     al, 123
    1153          jb      PCFVPN_ValidChar
    1154          cmp     al, 128
    1155          jbe     PCFVPN_InvalidName
    1156         PCFVPN_ValidChar:
    1157          cmp     al, 'U'
    1158          jne     PCFVPN_NoMagic
    1159          inc     dx
    1160         PCFVPN_NoMagic:
    1161       dec     cx
    1162       jnz     PCFVPN_CheckLoop
    1163    pop     cx
    1164    cmp     cx, dx
    1165    clc
    1166    je      PCFVPN_WasMagic
    1167    stc
    1168   PCFVPN_WasMagic:
    1169    ret
    1170   PCFVPN_InvalidName:
    1171    pop     cx
    1172    clc
    1173    ret
    1174 PART_CheckForValidPartName      EndP
    1175 
    1176 
    1177 ; Rousseau: added
    1178 ; Compare a volume-label in the IPT to the install-volume
    1179 ; SI holds pointer to entry in IPT
    1180 ; CY set if this entry is also the install-volume
    1181 PART_IsInstallVolume            Proc Near   Uses ax cx dx si di
    1182       cld                                    ; Advance upwards with lodsb
    1183       mov   di, offset eCS_InstallVolume     ; Address of install-volume label (max. 11 chars)
    1184 
    1185       mov   cx, 11                           ; Maximum length of label
    1186       xor   dl, dl                           ; Not found yet
    1187 
    1188     ; Compare next character
    1189     PART_IsInstallVolumeNext:
    1190       lodsb                                  ; Load byte from SI (IPT-entry)
    1191       ;cmp      al,' '                        ; If space then use zero
    1192       ;jne      PART_IsInstallVolume_skip1
    1193       ;xor      al,al
    1194    PART_IsInstallVolume_skip1:
    1195       xchg     ah,al                         ; Save char to AH
    1196       xchg     si,di                         ; Exchange pointers
    1197       lodsb                                  ; Load byte from SI (install-volume label)
    1198       ;cmp      al,' '                        ; If space then use zero
    1199       ;jne      PART_IsInstallVolume_skip2
    1200       ;xor      al,al
    1201    PART_IsInstallVolume_skip2:
    1202       xchg     si,di                         ; Reexchange pointers
    1203       call     AuxIO_Teletype
    1204       call     CONV_ToUpper
    1205       call     AuxIO_Teletype
    1206       xchg     al,ah
    1207       call     AuxIO_Teletype
    1208       call     CONV_ToUpper
    1209       call     AuxIO_Teletype
    1210       call     AuxIO_TeletypeNL
    1211 
    1212       ; Are both of them zero ?
    1213       ; Then the names could be the same, but cx must not equal 11
    1214       ; because that would indicate a null-string.
    1215       mov      dh,al
    1216       or       dh,ah
    1217       jz       PART_IsInstallVolumeFound
    1218 
    1219       cmp      ah,al                         ; Are the the same ?
    1220       jnz      PART_IsInstallVolumeNotFound  ; Nope, compare ended
    1221       loop     PART_IsInstallVolumeNext      ; Yep, Compare next character
    1222 
    1223    PART_IsInstallVolumeFound:
    1224       ; If CX is still 11 this was a zero string
    1225       ; and thus not a valid volume-name.
    1226       ; This should not occur as this function is only called when the first
    1227       ; byte is non-zero.
    1228       cmp      cx,11
    1229       je       PART_IsInstallVolumeNotFound
    1230       ; Found !
    1231       mov      dl,1                          ; Found
    1232       jmp      PART_IsInstallVolumeEnd
    1233 
    1234 
    1235    PART_IsInstallVolumeNotFound:
    1236       mov      dl,0
    1237       jmp      PART_IsInstallVolumeEnd
    1238 
    1239 
    1240    PART_IsInstallVolumeEnd:
    1241       ; Set the status in CY
    1242       mov      al,dl
    1243       add      al,'0'
    1244       call     AuxIO_TeletypeHexByte
    1245       call     AuxIO_TeletypeNL
    1246       rcr      dl,1                          ; Put found-flag in CY
    1247       ret
    1248 PART_IsInstallVolume            EndP
  • trunk/BOOTCODE/REGULAR/STD_TEXT.ASM

    r30 r31  
    2929CopyrightVersionLen   equ   6
    3030;Copyright             db ' AiR-BOOT v1.06 - (c) 1998-2009 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
    31 Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
    3231;Copyright             db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Rousseau test-version >502G (build: #24)', 0
    3332;Copyright             db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz   -  Release Candidate 1  -  (build: #25)', 0
     
    3635;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc4-b33)', 0
    3736;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc5-b35)', 0
    38 
    39 ;BootEndMsg            db 'Free usage allowed, as long as you dont or have not worked for US government', 0
     37;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
     38Copyright             db ' AiR-BOOT v1.08 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
    4039
    4140; Rousseau: switch around
    42 BootEndMsg           db 'This is GPLv3+ software. Please visit http://AiR-BOOT.sourceforge.net', 0
    43 BootEndMsg2            db 'http://www.gnu.org/licenses/gpl.txt', 0
     41BootEndMsg           db 'This is GPLv3+ software. Please visit http://svn.netlabs.org/air-boot', 0
     42BootEndMsg2          db 'http://www.gnu.org/licenses/gpl.txt', 0
    4443
    4544AuxInitMsg           db 'Initializing Serial Communications on COM',0
    4645
    47 CheckID_MBR           db 'AiRBOOT'
    48 BrokenHDD             db ' (HDDx)', 0
     46CheckID_MBR          db 'AiRBOOT'
     47BrokenHDD            db ' (HDDx)', 0
    4948
    5049; Colors for special words hard-coded. Keep all 0s.
    5150TXT_SETUP_LowerMessage      db 'This software is released under ', 0, 'GPLv3+.', 0
    52 ;                            db 'It may not be used by US government', 0
    5351                            db 'http://www.gnu.org/licenses/gpl.txt', 0
    5452                            db 'For more information and source, please visit', 0
    55                             db 'http://AiR-BOOT.sourceforge.net', 0
    56 ;                            db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0
     53                            db 'http://svn.netlabs.org/air-boot', 0
    5754                            db 'Contact via e-mail: ', 0, 'airboot@ecomstation.com', 0
    5855
  • trunk/BOOTCODE/SETUP/PART_SET.ASM

    r30 r31  
    12531253         mov     ah, 0
    12541254         int     16h
     1255         cmp     ah, Keys_Backspace
     1256         je      PSDLS_BackSpace
    12551257         cmp     ah, Keys_Up
    12561258         je      PSDLS_KeyUp
     
    12721274         jmp     PSDLS_MainLoop
    12731275
     1276
     1277   ; Clear drive-letter with backspace
     1278   PSDLS_BackSpace:
     1279      xor   dl,dl
     1280      call  PARTSETUPDL_DrawDriveLetter
     1281      jmp   PSDLS_MainLoop
     1282
    12741283     PSDLS_KeyUp:
    12751284      dec     dl
     
    12971306      call    PARTSETUPDL_DrawDriveLetter
    12981307      jmp     PSDLS_MainLoop
     1308
    12991309
    13001310  PSDLS_KeyDONE:
  • trunk/BOOTCODE/_build.cmd

    r30 r31  
    2121Say '#';
    2222Say '';
    23 '@pause';
     23'rem @pause';
  • trunk/INSTALL/C/INSTALL.C

    r30 r31  
    413413      // SHOULD ADJUST THIS FOR EXTENDED VERSION !                               // !!!!!!!!!!!
    414414      */
    415       SectorCount = 5;
     415
     416      SectorCount = 7;
     417
    416418      while (SectorCount>0) {
    417419         Checksum = GetChecksumOfSector(Checksum, SectorPtr);
     
    687689
    688690   SectorPtr = &Bootcode[54 * BYTES_PER_SECTOR];                                 // Start at sector 55
    689    SectorCount = 5;
     691
     692   SectorCount = 7;
     693
    690694   while (SectorCount>0) {
    691695      Checksum = GetChecksumOfSector(Checksum, SectorPtr);
     
    988992                  printf("Now rebooting system...\n");
    989993               }
    990                //RebootSystem();
     994               RebootSystem();
    991995            }
    992996            ExitOnly = TRUE;
  • trunk/MAKEFILE

    r30 r31  
    3030        @echo Gonna build the installer and setaboot now...
    3131        @echo.
    32         @pause
     32        rem @pause
    3333
    3434# OS2 and WIN32 installer
  • trunk/TOOLS/INTERNAL/FIXCODE.ASM

    r30 r31  
    167167                mov     di, offset MBRProtectionSignature
    168168                mov     cx, MBRProtectionSignatureLen
    169                 mov     dx, 54 ; 54 sectors where signature may be
     169                mov     dx, 54 ; 54 sectors where signature may be (all sectors preceding config sector)
    170170COM_SignatureLoop:
    171171                push    cx si di
Note: See TracChangeset for help on using the changeset viewer.