Changeset 32 for trunk


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

Fixed Win7 boot from FAT32 and HPFS zero-drive ussue [2011-11-20]

Fixes

o Fixed booting Windows 7 from FAT32

Booting Windows (NT/2K/XP/Vista/7) from FAT32 when the actual system
resides on an NTFS partition actually chainload the Windows
boot-loader in the FAT32 partition.
A bug in the handling of such a FAT32 partition with the Windows
boot-loader caused it not to find NTLDR is some cases.

o Fixed HPFS zero-drive issue

The BPB contains a field that indicates the boot-drive to the
OS2BOOT and OS2LDR programs. When creating an HPFS partition and
then restoring a system from archive (i.e. a zip-file) of course
does not set this field, since only files are restored.
This causes the boot process to halt with "...cannot operate..."
or even boot another HPFS partition. This field is now derived from
the LVM drive-letter if it contains an incorrect value.

o Corrected CRC calculations on AiR-BOOT configuration

V1.07 expanded the number of partitions from 30 to 45.
However, this was not done correctly and the configuration CRC was
still caclulated over 5 sectors. Initial v1.0.8 code corrected this
but this results in the v1.07 installer and setaboot programs
breaking on v1.0.8 code. So, for the time being the CRC caclucation
is reverted back to 5 sectors for the sake of v1.07 compatibility.
Save and restore of the configuration use 7 sectors of course.

o Corrected contact information

V1.07 shipped with the wrong contact information, causing issues
to be reported on sourceforge instead of netlabs.

Changes

o Renamed original README.TXT to README.MKW
o Added 1README.TXT
o Added COPYING (GNU License)

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:
2 added
17 edited
1 moved

Legend:

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

    r31 r32  
    2525; - Fixed driveletter feature which was broken in v1.07.
    2626; - 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.
     27; - Fixes booting older eCS installations on HPFS
     28; - Fixes booting Windows when installed in logical partition
     29;   with loader on FAT32.
    3030; - Corrected contact links.
    31 ; -
     31; NOTE:
     32;   AB v1.07 had a bug with saving and loading the correct size of the
     33;   configuration. Therefore the CRC over the config was also calculated
     34;   wrongly.
     35;   While AB v1.0.8 fixes this, it has to use the v1.07 way of CRC calculation.
     36;   Otherwise SET(A)BOOT from the eCS v2.1 would break and reboot after phase1
     37;   would show the boot-menu instead of automatically booting the system
     38;   being installed. (SET(A)BOOT would see a corrupted AB config)
     39;   This means that the CRC over the AB config is calculated over 5 sectors
     40;   instead of 7, just like in v1.07.
     41;   This will be corrected with a future release of eComStation.
     42;   Note that after such a correction, an installation from a v2.1 eCS CD
     43;   with a version of AiR-BOOT >v1.07 active will not automatically
     44;   boot-through after phase1.
    3245;
    3346; v1.07
     
    106119; If defined then include DEBUG.ASM and output debug-info to serial-port.
    107120;
    108 AuxDebug                   equ      1
     121;AuxDebug                   equ      1
    109122
    110123; Com-port for debugging, 0 is disabled
     
    216229                                             ; (relative to entry)
    217230
    218 ; Rousseau: added (index in LVM-sector)
     231; Rousseau: added (index in extpart LVM-sector)
    219232LocLVM_Secs                 equ         20h  ; Sectors per Track (OS/2 ext-geo)
    220233LocLVM_Heads                equ         1ch  ; Number of heads
    221 LocLVM_VolumeLetter2        equ         78   ; is BYTE (Letter C-Z or 0)             ; FOUT !! niet entry relative !
    222 LocLVM_Startable            equ         77   ; is startable (newly installed system) ; FOUT !! niet entry relative !
    223 LocLVM_OnBootMenu           equ         76   ; is on bootmenu                        ; FOUT !! niet entry relative !
     234LocLVM_VolumeLetter2        equ         78   ; is BYTE (Letter C-Z or 0)
     235LocLVM_Startable            equ         77   ; is startable (newly installed system)
     236LocLVM_OnBootMenu           equ         76   ; is on bootmenu
    224237
    225238; Truncated to 11 chars when  displayed in menu
     
    625638; in this function. That's done around line 500.
    626639; Putting this few bytes here creates just enough room.
    627 ; The size of this function should grow.
    628640MBR_LoadConfig                Proc Near
    629               ; Changed from conditional assembler to calculated
     641              ; Changed from conditional assembler to calculated value
    630642              ; 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
     643              ; Size of the ab-configuration in 512 byte sectors
     644              mov     al, (MBR_BackUpMBR - Configuration) / 200h
    637645              mov     ah,02h
    638 
    639646              int     13h
    640647      ret
     
    934941               ; COM-PORT DEBUG
    935942               ;
    936                call     AuxIO_TeletypeNL
     943;               call     AuxIO_TeletypeNL
    937944               mov      si, offset PartitionTable
    938                call     AuxIO_DumpSector
    939                call     AuxIO_TeletypeNL
     945;               call     AuxIO_DumpSector
     946;               call     AuxIO_TeletypeNL
    940947
    941948
     
    11301137IFDEF AuxDebug
    11311138b_debug:
    1132    Include REGULAR\DEBUG.ASM     ; Various debugging routines,
     1139;   Include REGULAR\DEBUG.ASM     ; Various debugging routines,
    11331140                                 ; uses AUXIO and CONV
    11341141size_debug = $-b_debug
     
    11361143
    11371144b_auxio:
    1138 Include REGULAR\AUXIO.ASM        ; Com-port support for debugging
     1145;Include REGULAR\AUXIO.ASM        ; Com-port support for debugging
    11391146size_auxio = $-b_auxio
    11401147
  • trunk/BOOTCODE/MAKE.BAT

    r31 r32  
    1212goto ExitMe
    1313
     14rem -- We do English last so an English version can be copied
     15rem -- to this directory, using it's normal basename instead
     16rem -- of the language suffixed one.
    1417:BuildAll
    1518call make.bat DE
     
    5457echo Errorlevel not 0, make failed
    5558:ExitMe
     59
     60echo.
     61echo Gonna build the installer and setaboot now...
     62echo.
     63
    5664rem @pause
  • trunk/BOOTCODE/REGULAR/DRIVEIO.ASM

    r31 r32  
    6262   xor     bx, bx
    6363
    64    ; Changed from 5 to calculated
     64   ; Changed from 5 to calculated value (not here, see compat. issue below)
    6565   ; 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
     66   ; Size of the ab-configuration in 512 byte sectors
     67   ;mov     cx, (MBR_BackUpMBR - Configuration) / 200h
     68
     69   ; AB v1.07 stores a 5 sector configuration with a 5 sector checksum.
     70   ; AB v1.0.8 *should* stores a 7 sector configuration with a
     71   ; 7 sector checksum.
     72   ; Because 5 was hardcoded here, SET(A)BOOT v1.07 will see see an AB v1.0.8
     73   ; config as corrupted, while this is not the case.
     74   ; So, for compatibility reasons, in v1.0.8, the checksum stored is over
     75   ; 5 sectors, to be compatible with v1.07.
     76   ; This may change (be corrected) in future versions !
     77   mov     cx,5
    7278
    7379   mov     dx, [CFG_CheckConfig]
     
    8389   mov     cx, 0037h
    8490
    85    ; Changed from 5 to calculated
     91   ; Changed from 5 to calculated value
    8692   ; 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   ; Size of the ab-configuration in 512 byte sectors
     94   mov     al, (MBR_BackUpMBR - Configuration) / 200h
    9395   mov     ah,03h
    9496
     
    250252         ; Dump drive
    251253         mov      si,offset drive
    252          call     AuxIO_Print
     254;         call     AuxIO_Print
    253255         xchg     al,dl
    254          call     AuxIO_TeletypeHexByte
    255          call     AuxIO_TeletypeNL
     256;         call     AuxIO_TeletypeHexByte
     257;         call     AuxIO_TeletypeNL
    256258         xchg     dl,al
    257259
    258260         ; Dump SPT
    259261         mov      si,offset spt_used
    260          call     AuxIO_Print
     262;         call     AuxIO_Print
    261263         push     dx
    262264         push     bx
     
    271273            ;mov      [ts],ax
    272274
    273             call     AuxIO_TeletypeHexWord
    274             call     AuxIO_TeletypeNL
     275;            call     AuxIO_TeletypeHexWord
     276;            call     AuxIO_TeletypeNL
    275277         pop      bx
    276278         pop      dx
     
    281283               mov      dx,word ptr [ExtendedAbsPos+02]
    282284               mov      ax,word ptr [ExtendedAbsPos+00]
    283                call     AuxIO_TeletypeHexDWord
    284                call     AuxIO_TeletypeNL
     285;               call     AuxIO_TeletypeHexDWord
     286;               call     AuxIO_TeletypeNL
    285287            pop      dx
    286288
     
    293295
    294296            mov      ax, word ptr[bx]
    295             call     AuxIO_TeletypeHexWord
    296             call     AuxIO_TeletypeNL
     297;            call     AuxIO_TeletypeHexWord
     298;            call     AuxIO_TeletypeNL
    297299            mov      al,[ExtendedAbsPosSet]           ; if true -> 1st sector of extpart (EBR), not logpart(BPB)
    298             call     AuxIO_TeletypeHexByte
    299             call     AuxIO_TeletypeNL
     300;            call     AuxIO_TeletypeHexByte
     301;            call     AuxIO_TeletypeNL
    300302      ;      mov      si,offset PartitionSector
    301303      ;      call     AuxIO_DumpSector
     
    304306         ; LBA
    305307         mov      si,offset before_lvm_adjust
    306          call     AuxIO_Print
     308;         call     AuxIO_Print
    307309
    308310         xchg     dx,bx
    309          call     AuxIO_TeletypeHexDWord
    310          call     AuxIO_TeletypeNL
     311;         call     AuxIO_TeletypeHexDWord
     312;         call     AuxIO_TeletypeNL
    311313         xchg     bx,dx
    312314      popa
     
    322324      pusha
    323325         mov      si,offset before_lvm_adjust_log
    324          call     AuxIO_Print
     326;         call     AuxIO_Print
    325327         ; LBA
    326328         xchg     dx,bx
    327          call     AuxIO_TeletypeHexDWord
    328          call     AuxIO_TeletypeNL
     329;         call     AuxIO_TeletypeHexDWord
     330;         call     AuxIO_TeletypeNL
    329331         xchg     bx,dx
    330332      popa
     
    349351      pusha
    350352         mov      si,offset after_lvm_adjust_log
    351          call     AuxIO_Print
     353;         call     AuxIO_Print
    352354         ; LBA
    353355         xchg     dx,bx
    354          call     AuxIO_TeletypeHexDWord
    355          call     AuxIO_TeletypeNL
     356;         call     AuxIO_TeletypeHexDWord
     357;         call     AuxIO_TeletypeNL
    356358         xchg     bx,dx
    357359      popa
     
    432434      pusha
    433435         mov      si,offset after_lvm_adjust
    434          call     AuxIO_Print
     436;         call     AuxIO_Print
    435437         ; LBA
    436438         xchg     dx,bx
    437          call     AuxIO_TeletypeHexDWord
    438          call     AuxIO_TeletypeNL
     439;         call     AuxIO_TeletypeHexDWord
     440;         call     AuxIO_TeletypeNL
    439441         xchg     bx,dx
    440442      popa
     
    583585   pushf
    584586   pusha
    585       call     AuxIO_TeletypeNL
     587;      call     AuxIO_TeletypeNL
    586588      mov      si,offset db_curlvmsec
    587       call     AuxIO_Print
     589;      call     AuxIO_Print
    588590      mov      dx,bx
    589       call     AuxIO_TeletypeHexDWord
    590       call     AuxIO_TeletypeNL
     591;      call     AuxIO_TeletypeHexDWord
     592;      call     AuxIO_TeletypeNL
    591593      mov      si,offset LVMSector
    592       call     AuxIO_DumpSector
    593       call     AuxIO_TeletypeNL
     594;      call     AuxIO_DumpSector
     595;      call     AuxIO_TeletypeNL
    594596   popa
    595597   popf
     
    733735DriveIO_LoadSector              EndP
    734736
     737
     738
     739;
     740; ############################################################
     741; # Load a specified sector from a disk using LBA addressing #
     742; ############################################################
     743;
     744; In
     745; --
     746; DL     = Physical Disk
     747; BX:CX  = LBA sector
     748; DI:SI  = Target buffer
     749;
     750; Out
     751; ---
     752; AX     = Error code
     753;
     754DriveIO_LoadSectorLBA           Proc Near  Uses bx cx dx si di ds es
     755      ; Get one sector
     756      mov     cs:[DriveIO_DAP_NumBlocks], 1
     757
     758      ; Setup buffer address
     759      mov     wptr cs:[DriveIO_DAP_Transfer+0], si
     760      mov     wptr cs:[DriveIO_DAP_Transfer+2], di
     761
     762      ; Setup LBA address of requested sector
     763      mov     wptr cs:[DriveIO_DAP_Absolute+0], cx
     764      mov     wptr cs:[DriveIO_DAP_Absolute+2], bx
     765      mov     wptr cs:[DriveIO_DAP_Absolute+4], 0
     766      mov     wptr cs:[DriveIO_DAP_Absolute+6], 0
     767
     768      ; Address of packet
     769      mov     si, offset DriveIO_DAP
     770
     771      ; Do the extended read
     772      mov     ah, 42h
     773      int     13h
     774
     775      ; Looking goot so far
     776      jnc     DriveIO_LoadSectorLBA_succes1
     777
     778      ; AH should not be zero, if it is then set to undefined and set carry
     779      test    ah,ah
     780      jnz     DriveIO_LoadSectorLBA_error1
     781      mov     ah, 0bbh        ; Undefined error
     782   DriveIO_LoadSectorLBA_error1:
     783      stc
     784      jmp     DriveIO_LoadSectorLBA_exit
     785
     786      ; AL should be zero, if not then set to undefined and set carry
     787   DriveIO_LoadSectorLBA_succes1:
     788      test    ah,ah
     789      jz      DriveIO_LoadSectorLBA_exit
     790      stc
     791      jmp     DriveIO_LoadSectorLBA_exit
     792
     793      ; Return to caller
     794   DriveIO_LoadSectorLBA_exit:
     795      ret
     796DriveIO_LoadSectorLBA           EndP
     797
     798
     799
     800
    735801; #########################################################################
    736802; Routine: Writes DS:SI to a specified sector
     
    796862; See if a LVM-sector is valid.
    797863; In  : si, pointer to sector
    798 ; Out : ZF=true, not valid; ZF=false, valid
     864; Out : CY if valid LVM sector, NC if not
    799865DriveIO_LVMSectorValid           Proc  Near
    800       pusha
    801 
    802       call     LVM_CheckSectorSignature
    803       mov      al,0
    804       rcl      al,1                          ; Move CY to AL.0
    805       call     AuxIO_TeletypeHexByte
    806       call     AuxIO_TeletypeNL
    807       or       al,al                         ; Zero if not a valid sector
    808       jz       DriveIO_LVMSectorValid_End    ; Not a valid sector
    809 
    810       call     LVM_CheckSectorCRC
    811       stc
    812       mov      al,0
    813       rcl      al,1                          ; Move CY to AL.0
    814       call     AuxIO_TeletypeHexByte
    815       call     AuxIO_TeletypeNL
    816       or       al,al                         ; Zero if not a valid sector
    817 
    818    DriveIO_LVMSectorValid_End:
    819 
    820       popa
    821       ret
     866        pusha
     867
     868        call     LVM_CheckSectorSignature
     869        ; NC if no signature found
     870        jnc       DriveIO_LVMSectorValid_End
     871
     872        call     LVM_CheckSectorCRC
     873        ; Force valid !!!
     874        stc
     875
     876    DriveIO_LVMSectorValid_End:
     877        popa
     878        ret
    822879DriveIO_LVMSectorValid           EndP
    823880
     
    838895; This is also the case when no valid master LVM-sector can be found.
    839896;
    840 ; Return ZF=true if not found, ZF=false when valid master LVM-sector found.
     897; Return CF when valid master LVM sector found, NC if not.
     898; Loads sector at [LVMSector] !
    841899DriveIO_LoadMasterLVMSector      Proc  Near
    842       pusha
    843 
    844       mov      si,offset db_lmlvm
    845       ;call     AuxIO_Print
    846 
    847       mov      al,dl
    848       ;call     AuxIO_TeletypeHexByte
    849       ;call     AuxIO_TeletypeNL
    850 
    851 
    852       ; Loop over the sector-translation table,
    853       ; process the first three values from high (255) to low (bios spt, most likely 63)
    854       mov      cx,3
    855 DriveIO_LoadMasterLVMSector_NextTry:
    856       mov      bx,offset secs_per_track_table         ; sector translation table that corresponds with IsHugeDrive
    857       mov      si, offset LVMSector                   ; space to load the master LVM-sector
    858       mov      [DriveIO_DAP_NumBlocks],1              ; number of sectors to read
    859       mov      wptr [DriveIO_DAP_Transfer+0],si       ; low part of transfer address
    860       mov      ax, ds
    861       mov      wptr [DriveIO_DAP_Transfer+2],ax       ; high part of transfer address
    862       mov      ax,cx                                  ; use the counter...
    863       dec      ax                                     ; as an index into the table
    864       xlatb                                           ; translate to number of sectors
    865       dec      al                                     ; LBA is zero-based, so adjust
     900        pusha
     901
     902        mov      si,offset db_lmlvm
     903        ;call     AuxIO_Print
     904
     905        ; Physical disk
     906;        mov     al,'<'
     907;        call    VideoIO_PrintSingleChar
     908;        mov     al,dl
     909;        call    VideoIO_PrintHexByte
     910;        mov     al,'>'
     911;        call    VideoIO_PrintSingleChar
     912
     913        ;call     AuxIO_TeletypeHexByte
     914        ;call     AuxIO_TeletypeNL
     915
     916
     917        ; Loop over the sector-translation table,
     918        ; process the first three values from high (255) to low (bios spt, most likely 63)
     919        mov      cx,3
     920    DriveIO_LoadMasterLVMSector_NextTry:
     921        ; Number of sectors to read
     922        mov     [DriveIO_DAP_NumBlocks],1
     923
     924        ; Setup destination address
     925        mov     si, offset LVMSector
     926        mov     wptr [DriveIO_DAP_Transfer+0],si
     927        mov     ax, ds
     928        mov     wptr [DriveIO_DAP_Transfer+2],ax
     929
     930        ; Get the sector-number of the next possible LVM sector (255,127,63)
     931        ; using the translation table and the counter as the index
     932        mov     bx,offset secs_per_track_table
     933        mov     ax,cx
     934        dec     ax
     935        xlatb
     936        dec     al
     937
     938        ;
     939        ; AX now contains the LBA address of the sector
     940        ; that could be an LVM sector.
     941        ; This is all in track0 so the address will not exceed 64kiB sectors.
     942        ;
     943
     944;        push    ax
     945;        push    ax
     946;        mov     al,'$'
     947;        call    VideoIO_PrintSingleChar
     948;        pop     ax
     949;        call    VideoIO_PrintHexByte
     950;        mov     al,'$'
     951;        call    VideoIO_PrintSingleChar
     952;        pop     ax
    866953
    867954IFDEF AuxDebug
     
    871958ENDIF
    872959
    873       mov      wptr [DriveIO_DAP_Absolute+0],ax       ; LBA low      ;
    874       mov      wptr [DriveIO_DAP_Absolute+2],00h      ; LBA high
    875       mov      si, offset DriveIO_DAP                 ; address request packet
    876       mov      ah, 42h
    877       int      13h                                    ; do the i/o
    878       jc       DriveIO_LoadMasterLVMSector_NotFound   ; oops, there was an error
    879 
    880 IFDEF AuxDebug
    881       ; Dump title
    882       mov      si,offset db_masterlvm
    883       ;call     AuxIO_Print
    884 
    885       ; Dum sector
    886       mov      si, offset LVMSector
    887       ;call     AuxIO_DumpSector
    888       ;call     AuxIO_TeletypeNL
    889 ENDIF
    890       ; See is this is a valid LVM-sector
    891       call     DriveIO_LVMSectorValid
    892 
    893 IFDEF AuxDebug
    894       pushf
    895       ;call     AuxIO_TeletypeNL
    896       popf
    897 ENDIF
    898       ; Yep, we found the master LVM-sector
    899       jnz      DriveIO_LoadMasterLVMSector_Found
    900       ; Try next location
    901       loop     DriveIO_LoadMasterLVMSector_NextTry
    902 
    903    ; No master LVM-sector found, set ZF=true
    904    DriveIO_LoadMasterLVMSector_NotFound:
    905       xor      ax,ax
    906 
    907    ; Jump here with ZF=false if found
    908    DriveIO_LoadMasterLVMSector_Found:
    909 
    910       popa
    911       ret
     960        ; Setup the requested LBA sector number
     961        mov     wptr [DriveIO_DAP_Absolute+0],ax       ; LBA low
     962        mov     wptr [DriveIO_DAP_Absolute+2],00h      ; LBA high
     963        mov     si, offset DriveIO_DAP                 ; address request packet
     964        mov     ah, 42h
     965        int     13h                                    ; do the i/o
     966        cmc     ; Complement carry so we can exit imm. on error
     967        jnc     DriveIO_LoadMasterLVMSector_End  ; oops, return with NC
     968
     969
     970        mov     si,offset LVMSector
     971
     972        ; See if this is a valid LVM-sector
     973        call     DriveIO_LVMSectorValid
     974
     975;        pushf
     976;        mov     ah,0
     977;        rcl     ah,1
     978;        mov     al,'|'
     979;        call    VideoIO_PrintSingleChar
     980;        mov     al,ah
     981;        call    VideoIO_PrintHexByte
     982;        mov     al,'|'
     983;        call    VideoIO_PrintSingleChar
     984;        popf
     985
     986
     987        ; Yep, we found the master LVM-sector
     988        jc      DriveIO_LoadMasterLVMSector_Found
     989        ; Try next location
     990        loop     DriveIO_LoadMasterLVMSector_NextTry
     991
     992        ; No master LVM-sector found, set CF=false
     993        clc
     994
     995    DriveIO_LoadMasterLVMSector_Found:
     996    DriveIO_LoadMasterLVMSector_End:
     997        popa
     998        ret
    912999DriveIO_LoadMasterLVMSector     Endp
    9131000
  • trunk/BOOTCODE/REGULAR/OTHER.ASM

    r31 r32  
    126126
    127127               ; Initialize the com-port for debugging
    128                call     AuxIO_Init
     128;               call     AuxIO_Init
    129129
    130130               xor     si,si
     
    143143               mov      [bx], al
    144144
    145                call     DriveIO_LoadMasterLVMSector         ; returns ZF=1 if no valid LVM record found
     145               call     DriveIO_LoadMasterLVMSector         ; returns NC if no valid LVM record found
    146146
    147147               pushf
     148
     149;                mov     al,'#'
     150;                pushf
     151;                call    VideoIO_PrintSingleChar
     152;                popf
     153;                mov     al,0
     154;                rcl     al,1
     155;                call    VideoIO_PrintHexByte
     156;                mov     al,'#'
     157;                call    VideoIO_PrintSingleChar
     158
    148159               mov      bx, offset TrueSecs
    149160               add      bx,cx
     
    155166               ; bx now contains pointer to truesecs for this drive
    156167
    157                jz       NoValidMasterLVM
    158 
     168               jnc      NoValidMasterLVM
     169
     170                ; ?? 3f bij disk 80h maar 0 bij disk 81h
    159171               mov      si,offset LVMSector
    160172               mov      ax,[si+LocLVM_Secs]
     173
     174;                pusha
     175;                mov     dx,ax
     176;                mov     al,'%'
     177;                call    VideoIO_PrintSingleChar
     178;                mov     ax,dx
     179;                call    VideoIO_PrintHexWord
     180;                mov     al,'%'
     181;                call    VideoIO_PrintSingleChar
     182;                popa
     183
    161184               mov      word ptr [bx],ax
    162185               jmp      SkipUseBiosSecs
     
    200223               ;mov      word ptr [LOG_Secs],63
    201224
    202                mov      al,[HugeDisk]           ;; fout, moet nog index bij
    203                call     AuxIO_TeletypeHexByte
    204                call     AuxIO_TeletypeNL
    205 
    206                mov      ax,word ptr [TrueSecs]  ;; fout, moet nog index bij
    207                call     AuxIO_TeletypeHexWord
    208                call     AuxIO_TeletypeNL
     225;               mov      al,[HugeDisk]           ;; fout, moet nog index bij
     226;               call     AuxIO_TeletypeHexByte
     227;               call     AuxIO_TeletypeNL
     228
     229;               mov      ax,word ptr [TrueSecs]  ;; fout, moet nog index bij
     230;               call     AuxIO_TeletypeHexWord
     231;               call     AuxIO_TeletypeNL
    209232
    210233
     
    243266                 call    MBR_TeleType
    244267                 xor     si,si
    245                  call    MBR_TeletypeNL                                          ; ALP barks undefined symbol; must use prototypes ?
     268                 call    MBR_TeletypeNL
    246269
    247270
     
    364387   xor     bx, bx
    365388
    366    ; Changed from 5 to calculated
     389   ; Changed from 5 to calculated value (not here, see compat. issue below)
    367390   ; 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
     391   ; Size of the ab-configuration in 512 byte sectors
     392   ;mov     cx, (MBR_BackUpMBR - Configuration) / 200h
     393
     394   ; AB v1.07 stores a 5 sector configuration with a 5 sector checksum.
     395   ; AB v1.0.8 *should* stores a 7 sector configuration with a
     396   ; 7 sector checksum.
     397   ; Because 5 was hardcoded here, SET(A)BOOT v1.07 will see see an AB v1.0.8
     398   ; config as corrupted, while this is not the case.
     399   ; So, for compatibility reasons, in v1.0.8, the checksum stored is over
     400   ; 5 sectors, to be compatible with v1.07.
     401   ; This may change (be corrected) in future versions !
     402   mov      cx,5
    374403
    375404   mov     dx, CFG_CheckConfig
  • trunk/BOOTCODE/REGULAR/PARTMAIN.ASM

    r31 r32  
    694694   PART_IsInstallVolume_skip2:
    695695      xchg     si,di                         ; Reexchange pointers
    696       call     AuxIO_Teletype
     696;      call     AuxIO_Teletype
    697697      call     CONV_ToUpper
    698       call     AuxIO_Teletype
     698;      call     AuxIO_Teletype
    699699      xchg     al,ah
    700       call     AuxIO_Teletype
     700;      call     AuxIO_Teletype
    701701      call     CONV_ToUpper
    702       call     AuxIO_Teletype
    703       call     AuxIO_TeletypeNL
     702;      call     AuxIO_Teletype
     703;      call     AuxIO_TeletypeNL
    704704
    705705      ; Are both of them zero ?
     
    735735      mov      al,dl
    736736      add      al,'0'
    737       call     AuxIO_TeletypeHexByte
    738       call     AuxIO_TeletypeNL
     737;      call     AuxIO_TeletypeHexByte
     738;      call     AuxIO_TeletypeNL
    739739      rcr      dl,1                          ; Put found-flag in CY
    740740      ret
    741741PART_IsInstallVolume            EndP
     742
     743
    742744
    743745
     
    11011103   pop     si ds                         ; Restore DS:SI
    11021104
     1105
     1106
     1107
     1108
     1109
     1110
     1111    PSP_NoMBRprotect:
     1112
     1113        ; Display volume-name in bold
     1114        ; Just before booting the selected partition
     1115        pushf
     1116        pusha
     1117        push    si
     1118        add     si, LocIPT_Name
     1119        call    MBR_TeletypeVolName
     1120        xor     si,si
     1121        call    MBR_TeletypeNL
     1122        pop     si
     1123        popa
     1124        popf
     1125
     1126
     1127
    11031128   ; ------------------------------------------------ SPECIAL PARTITION SUPPORT
    11041129   ; needed by OS/2 Warp / eComStation
    1105   PSP_NoMBRprotect:
    1106    cmp     bptr [si+LocIPT_SystemID], 08 ; I hate Microsuck NTFS check
    1107 
    1108    ;je      PSP_NoSpecialSupport
    1109 
    1110       mov     di, offset PartitionSector ; ES:DI - Actual Boot-Record
    1111       ; Special Support Detection
    1112       mov     ax, wptr es:[di+24]
    1113       cmp     ax, 003Fh                  ; Physical Layout-Sectors... Safety check
    1114 
    1115 
    1116       ; Rousseau: # Boot Logical Partitions)
    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.
    1123       ; Offset van start-of-disk bij PCD7 niet meer dan 2GiB maken.
    1124       ; Special is needed to boot ECS-CXXVAC (log-part) on Douwskie Box with 40G disk.
    1125       ; FreeDOS 20G PRI SOD op 400G start niet met special.
    1126       ; Heeft drive-id op 26h (36d) van 0dh !
    1127       ; WinXP werkt met special en not-special op 400G normal geo.
    1128       ; eCS op PRI op 2G met os2 ext geo werkt ook met beide.
    1129       ; eCS LOG werkt niet zonder special op 400G.
    1130       ; (hidden secs op 3F en moet 3F00 zijn; BM staat ervoor, 3F00=255*63+63)
    1131       ; Laatste 63 is MBR.
    1132       ;
    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)
    1137 
    1138       ; FreeDOS zet 63 in SPT in BPB op 255/255 geo !!!!
    1139 
    1140       ; PC-DOS7 wil vaak niet starten als er meerdere pri's actief zijn.
    1141       ; Logo verschijnt wel maar start niet door.
    1142 
    1143 
    1144       ; Display volume-name
    1145       ; Just before booting the selected partition
    1146       pushf
    1147       pusha
    1148       push     si
    1149       add      si, LocIPT_Name
    1150       call     MBR_TeletypeVolName
    1151       xor      si,si
    1152       call     MBR_TeletypeNL
    1153       pop      si
    1154       popa
    1155       popf
    1156 
    1157 
    1158 
    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
    1171 
    1172 
    1173       mov     ax, wptr es:[di+26]
    1174       cmp     ax, 00FFh                  ; Physical Layout-Heads... Safety check
    1175       ja      PSP_NoSpecialSupport
    1176       mov     al, bptr es:[di+36]
    1177       cmp     al, 80h                    ; Drive Letter (ID)
    1178       jne     PSP_NoSpecialSupport
    1179 
    1180       ; Special Support needed
    1181 special:
    1182       ; Write actual drive-letter to partition boot-record in memory.
    1183       mov     al, bptr [si+LocIPT_Drive]
    1184 
    1185       ; Also an influence with FreeDOS !
    1186       ; Generates JFS ERROR when not set correctly !!!
    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
    1218 
    1219       ; This could be incorrect when a partition is moved,
    1220       ; or the system installer puts the wrong value here.
    1221       ; FreeDOS (log-part) i.e. puts 03fH (63d) here, eventhough it is not
    1222       ; at the start of the disk.
    1223       ; This fixing is done by OS/2 BM as well, according to Martin.
    1224       mov     ax, [si+LocIPT_AbsoluteBegin]
    1225       mov     wptr es:[di+28], ax               ; low word of hidden sectors
    1226       mov     ax, [si+LocIPT_AbsoluteBegin+2]
    1227       mov     wptr es:[di+30], ax               ; high word of hidden sectors
    1228 
    1229    ; ------------------------------------------------ LOGICAL PARTITION SUPPORT
    1230   PSP_NoSpecialSupport:
    1231 
    1232 ;jmp   PSP_NoLogicalSupport
    1233 
    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    ;
    1243    test    byte ptr [si+LocIPT_Flags], Flags_DriveLetter
    1244    jz      PSP_NoLogicalSupport
    1245 
    1246       ;movzx   bx, BootPartNo             ; EntryNumber is straight view
    1247       mov   bl,BootPartNo             ; EntryNumber is straight view
    1248       mov   bh,0
    1249 
    1250       mov     al, bptr [DriveLetters+bx]
    1251       mov     bptr es:[di+37], al        ; Write Drive Letter (OS/2 only)
    1252 
    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 
    1260    ; -------------------------------------------- COPY BOOT-RECORD TO STARTBASE
    1261   PSP_NoLogicalSupport:
    1262 
    1263 
    1264       mov      al,'-'
    1265       call     VideoIO_PrintSingleChar
    1266       mov      al,[ExtendedAbsPosSet]
    1267       call     VideoIO_PrintHexByte
    1268 
    1269 
    1270    push    si
    1271       mov     ax, StartBaseSeg
    1272       mov     es, ax
    1273       mov     cx, 256
    1274       mov     si, offset PartitionSector
    1275       mov     di, StartBasePtr
    1276       rep     movsw
    1277    pop     si
    1278    ; ---------------------------------------------------- NOW START BOOT-RECORD
     1130
     1131
     1132        cmp     byte ptr [si+LocIPT_SystemID],08    ; I hate Microsuck NTFS check
     1133        mov     di, offset PartitionSector ; ES:DI - Actual Boot-Record
     1134
     1135        ; Special Support Detection
     1136        mov     ax, word ptr es:[di+18h]
     1137        cmp     ax, 003Fh                  ; Physical Layout-Sectors... Safety check
     1138
     1139
     1140        ; Rousseau: # Boot Logical Partitions)
     1141        ; FreeDOS and eCS on extpart on non-huge needs special support.
     1142        ; (old ja jump)
     1143        ; PC-DOS7 on huge pri fat16 2G works with both (XP too) when at start of disk.
     1144        ; (also when offset at 20MiB)
     1145        ; PCD7 bonkt vast als in 2GiB log at start of space.
     1146        ; "Starting PC DOS..." verschijnt. PCD Loader probleem.
     1147        ; Offset van start-of-disk bij PCD7 niet meer dan 2GiB maken.
     1148        ; Special is needed to boot ECS-CXXVAC (log-part) on Douwskie Box with 40G disk.
     1149        ; FreeDOS 20G PRI SOD op 400G start niet met special.
     1150        ; Heeft drive-id op 26h (36d) van 0dh !
     1151        ; WinXP werkt met special en not-special op 400G normal geo.
     1152        ; eCS op PRI op 2G met os2 ext geo werkt ook met beide.
     1153        ; eCS LOG werkt niet zonder special op 400G.
     1154        ; (hidden secs op 3F en moet 3F00 zijn; BM staat ervoor, 3F00=255*63+63)
     1155        ; Laatste 63 is MBR.
     1156        ;
     1157
     1158
     1159
     1160
     1161        ;
     1162        ; When the phys-disk byte (80h) is put in this BPB in RAM,
     1163        ; Windows will not find it's loader if Windows itself
     1164        ; is installed in a logical partition but the loader is on FAT
     1165        ; in a primary.
     1166        ; This goes for all NT-based versions ?
     1167        ;
     1168        ; Get saved value of phys drive from BPB on disk.
     1169        ; See if it's high nibble is above 9, which would indicate
     1170        ; FreeDOS or WinBMGR/Loader on FAT32. (0FBh)
     1171        ; In that case we don't write the phys-disk number to the BPB.
     1172        ;
     1173
     1174
     1175        ; Locate cursor for output of debug-info
     1176        pusha
     1177        mov     ch,7
     1178        mov     cl,0
     1179        call    VideoIO_Color
     1180        mov     ch,6
     1181        mov     cl,1
     1182        call    VideoIO_Locate
     1183        popa
     1184
     1185
     1186        ; Physical disk for partition
     1187        mov     al,'<'
     1188        call    VideoIO_PrintSingleChar
     1189        mov     ah,byte ptr [si+LocIPT_Drive]
     1190        mov     al,ah
     1191        call    VideoIO_PrintHexByte
     1192        mov     al,'>'
     1193        call    VideoIO_PrintSingleChar
     1194
     1195
     1196        mov     al,'-'
     1197        call    VideoIO_PrintSingleChar
     1198        ; Get BPB physical disk number
     1199        mov     ah, es:[di+24h]                     ; boot disk from BPB
     1200        mov     al,ah
     1201        call    VideoIO_PrintHexByte
     1202
     1203        ; We need to allways correct if this byte is zero.
     1204        test    ah,ah
     1205        jz      adjust_bpb_phys_drive
     1206
     1207        ; Don't adjust if below 80h (FreeDOS)
     1208        cmp     ah,80h
     1209        jb      no_adjust_bpb_phys_drive
     1210
     1211        ; Don't adjust if it's above 9fh (Windows FAT32)
     1212        cmp     ah,9fh
     1213        ja      no_adjust_bpb_phys_drive
     1214
     1215
     1216    adjust_bpb_phys_drive:
     1217        ; We must be booting a system that uses field 24h in the BPB
     1218        ; as the physical disk number. Such systems are OS/2, eCS but also
     1219        ; PC-DOS7. Adjust the physical drive in the BPB to allow booting from
     1220        ; secundary disk.
     1221        mov     ah, [si+LocIPT_Drive]       ; Physical disk in BIOS notation
     1222        mov     es:[di+24h], ah             ; Write to BPB in memory
     1223
     1224
     1225    no_adjust_bpb_phys_drive:
     1226        mov     al,':'
     1227        call    VideoIO_PrintSingleChar
     1228        mov     al,ah
     1229        call    VideoIO_PrintHexByte        ; print corrected value
     1230
     1231
     1232
     1233        ;
     1234        ; Legacy systems do not put the correct values in the "hidden sectors"
     1235        ; field. Also, this field will be incorrect if a partition is moved on
     1236        ; disk by a disktool not accounting for this field.
     1237        ; Linux does not have a BPB at all, and does not use this field.
     1238        ; So we set the correct value here obtained by the partition scanner.
     1239        ; This fixing is done by OS/2 BM as well, according to Martin.
     1240        ;
     1241
     1242        mov     al,'-'
     1243        call    VideoIO_PrintSingleChar
     1244
     1245
     1246        ; Low word of 32-bits "hidden sectors"
     1247        mov     cx,[di+1ch]
     1248        mov     ax,[si+LocIPT_AbsoluteBegin]
     1249        mov     es:[di+1ch], ax
     1250        ; High word of 32-bits "hidden sectors"
     1251        mov     bx,[di+1eh]
     1252        mov     dx,[si+LocIPT_AbsoluteBegin+2]
     1253        mov     es:[di+1eh], dx
     1254
     1255        push    dx
     1256        push    ax
     1257        mov     ax,cx
     1258        mov     dx,bx
     1259        call    VideoIO_PrintHexDWord       ; print on-disk value
     1260        mov     al,':'
     1261        call    VideoIO_PrintSingleChar
     1262        pop     ax
     1263        pop     dx
     1264        call    VideoIO_PrintHexDWord       ; print corrected value
     1265
     1266
     1267    ; ----------------------------------------------- LOGICAL PARTITION SUPPORT
     1268
     1269
     1270        ;
     1271        ; OS/2 uses this field to indicate the boot-drive for the system.
     1272        ; It is in BIOS notation where 80h='C', 81h='D' ... 97h='Z'.
     1273        ; This is the field that get's forced to a specific value when the
     1274        ; drive-letter feature of AiR-BOOT is used.
     1275        ; Also, this field is the culprit of AiR-BOOT v1.07 not handling it
     1276        ; correctly when the system uses HPFS and this byte is zero.
     1277        ; This mostly involved booting older eCS versions on HPFS.
     1278        ; See issues #3067 and #3119 on http://bugs.ecomstation.nl
     1279        ;
     1280        ; AiR-BOOT now works around it by using the LVM-info (DLAT) of
     1281        ; the partiton if present.
     1282        ; Note however that if the drive-letter feature is active,
     1283        ; this will override AB's automatic fixing.
     1284        ;
     1285        ; Test if the drive-letter feature is active for this partition.
     1286        ; If so, then the drive that the user defined will be placed at
     1287        ; byte 25h (37d) of the in-ram PartitionSector (BPB).
     1288        ; (BIOS 80h notation: 80h=C, 81h=D, etc.)
     1289        ; This is a remedy for when the corresponding field (25h) in the BPB on
     1290        ; disk is zero.
     1291        ;
     1292
     1293        ; See if the drive-letter feature is active
     1294        test    byte ptr [si+LocIPT_Flags], Flags_DriveLetter
     1295        ; Nope, it's not so we don't force the boot-drive using field 25h
     1296        jz      PSP_NoLogicalSupport
     1297
     1298        ; Pointer to the user specified boot-drive
     1299        mov     bl,BootPartNo               ; EntryNumber is straight view
     1300        mov     bh,0
     1301
     1302        ; Get it and store it in the in-ram BPB
     1303        mov     al, bptr [DriveLetters+bx]
     1304        mov     bptr es:[di+25h], al        ; Write Drive Letter (OS/2 only)
     1305
     1306
     1307        ; ------------------------------------------- COPY BOOT-RECORD TO STARTBASE
     1308        PSP_NoLogicalSupport:
     1309
     1310
     1311
     1312        ;
     1313        ; At this point it's possible that a system is being booted from
     1314        ; HPFS with the boot-drive field (25h) set to zero.
     1315        ; This will result in OS/2 - eCS being unable to boot the system.
     1316        ; So we're gonna check this byte here and if it's zero we will
     1317        ; replace it with information found in LVM DLAT info.
     1318        ;
     1319        ; For primary partitions this information is stored in the last
     1320        ; sector of track0; for all four partition entries should they
     1321        ; all be primary ones.
     1322        ;
     1323        ; LVM DLAT info for logical partitions is stored in the sector
     1324        ; preceding the start of the partition.
     1325        ;
     1326        ; Because the LVM info of a logical partition is the easiest to find,
     1327        ; we do that first. The LVM info for primary partitions is located
     1328        ; dependent on the geometry in use, so we use a special locater
     1329        ; call for that. Also, since the LVM info for primaries contains
     1330        ; info on all 4 entries, we need the partition index to obtain the
     1331        ; correct drive-letter.
     1332        ;
     1333
     1334        ; See if this is a primary partition
     1335        ; CY will be set if it is and AL will contain the 0-based
     1336        ; index in the P-table.
     1337        ; If it's a logical partition, CY will be clear and AL
     1338        ; will be set to 0ffh indicating an invalid index.
     1339        mov     dl,byte ptr [si+LocIPT_Drive]
     1340        mov     cx,[si+LocIPT_AbsoluteBegin+00h]
     1341        mov     bx,[si+LocIPT_AbsoluteBegin+02h]
     1342        call    PART_IsPrimaryPartition
     1343
     1344        ; Save the index in DL and whether it's PRI or LOG in DH
     1345        mov     dl,al       ; Save PTE-index
     1346        mov     al,0
     1347        rcl     al,1        ; CY if primary
     1348        mov     dh,al       ; Save PRI or LOG
     1349
     1350        ; Save for later use
     1351        push    dx
     1352
     1353        ; Load *possible* LVM sector
     1354        ; This load is only valid if the partition is logical, in which case
     1355        ; the LVM sector is below the start of the partition.
     1356        ; If primary, the LVM sector is at a location that
     1357        ; DriveIO_LoadMasterLVMSector will find out.
     1358
     1359        ; Physical disk and absolute start of partition
     1360        mov     dl,bptr [si+LocIPT_Drive]
     1361        mov     cx,[si+LocIPT_AbsoluteBegin+00h]
     1362        mov     bx,[si+LocIPT_AbsoluteBegin+02h]
     1363
     1364        ; Adjust for logical LVM-sector
     1365        sub     cx,1
     1366        sbb     bx,0
     1367
     1368        ; Load the LVM sector
     1369        push    si
     1370        push    di
     1371        mov     si,offset [LVMSector]
     1372        mov     di,ds
     1373        call    DriveIO_LoadSectorLBA
     1374        pop     di
     1375        pop     si
     1376
     1377        ; Point BX to LVM 1st drive-letter
     1378        mov     bx,offset [LVMSector]
     1379        add     bx,LocLVM_VolumeLetter2
     1380
     1381
     1382        ; Restore PRI/LOG partition indicator and index
     1383        pop     dx
     1384
     1385        ; Test PRI or not
     1386        test    dh,dh
     1387        ; It's not a PRI so we can use the previously loaded LVM sector
     1388        jz      is_not_pri
     1389
     1390        ; It's a PRI so we use the special locator function.
     1391        ; This locator takes care of extended eCS geometry should that be used
     1392        pusha
     1393        mov     dl,byte ptr [si+LocIPT_Drive]
     1394        call    DriveIO_LoadMasterLVMSector
     1395        popa
     1396
     1397        ; Calculate index for driveletter of PRI partition
     1398        mov     ax,03ch     ; Length of LVM record ?
     1399        mul     dl          ; Multiply by index
     1400        add     bx,ax       ; Point to LVM-driveletter
     1401
     1402
     1403    is_not_pri:
     1404
     1405        ;
     1406        ; At this point BX points to the drive-letter related to the
     1407        ; partition, whether it was a logical or a primary one.
     1408        ; We convert it ('C'=80h etc) and put it in DH for later use.
     1409        mov     dh,[bx]
     1410        ; Don't convert if zero
     1411        test    dh,dh
     1412        jz      null_lvm_dl
     1413        add     dh,3dh
     1414    null_lvm_dl:
     1415
     1416
     1417        ; Check for HPFS partition
     1418        mov     dl,bptr [si+LocIPT_Drive]
     1419        mov     cx,[si+LocIPT_AbsoluteBegin+00h]
     1420        mov     bx,[si+LocIPT_AbsoluteBegin+02h]
     1421        call    PART_IsHPFS
     1422
     1423        ; Save HPFS indicator
     1424        mov     ah,al
     1425        push    ax
     1426
     1427        mov     al,'-'
     1428        call    VideoIO_PrintSingleChar
     1429        mov     al,ah
     1430        call    VideoIO_PrintHexByte
     1431        mov     al,'/'
     1432        call    VideoIO_PrintSingleChar
     1433
     1434        ; JFS
     1435        call    PART_IsJFS
     1436        call    VideoIO_PrintHexByte
     1437        mov     al,'/'
     1438        call    VideoIO_PrintSingleChar
     1439
     1440        ; BOOTMGR
     1441        call    PART_IsWinBMGR
     1442        call    VideoIO_PrintHexByte
     1443        mov     al,'/'
     1444        call    VideoIO_PrintSingleChar
     1445
     1446        ; FAT32
     1447        call    PART_IsFAT32
     1448        call    VideoIO_PrintHexByte
     1449        mov     al,'-'
     1450        call    VideoIO_PrintSingleChar
     1451
     1452        mov     al,es:[di+25h]
     1453        call    VideoIO_PrintHexByte
     1454
     1455        ; Restore and test HPFS indicator
     1456        pop     ax
     1457        test    ah,ah
     1458        jz      no_hpfs
     1459
     1460
     1461        ; See if HPFS BPB needs fixing, which is the case when it's zero.
     1462        mov     al,es:[di+25h]
     1463        test    al,al
     1464        jnz     hpfs_no_fix_needed
     1465
     1466        ; Oops we have a zero-byte where the drive-letter should
     1467        ; be in BIOS notation.
     1468        ; Lets use the LVM value which is still stored in DH.
     1469        ; Note that this fix is in-ram only, it does not correct the BPB
     1470        ; on disk. That's the user's responsibility by using SYSINSTX.
     1471        mov     es:[di+25h], dh     ; Put value from LVM in the BPB in memory.
     1472
     1473
     1474    hpfs_no_fix_needed:
     1475    no_hpfs:
     1476
     1477        mov     al,':'
     1478        call    VideoIO_PrintSingleChar
     1479        mov     al,es:[di+25h]
     1480        call    VideoIO_PrintHexByte        ; print possibly corrected 25h
     1481
     1482        mov     al,'-'
     1483        call    VideoIO_PrintSingleChar
     1484        mov     al,dh
     1485        test    al,al
     1486        jnz     dl_not_null
     1487        mov     al,'*'+3dh
     1488    dl_not_null:
     1489        sub     al,3dh
     1490        call    VideoIO_PrintSingleChar     ; print drive-letter
     1491
     1492
     1493        ;
     1494        ; Here we copy the prepared partition boot-record to 7C00h
     1495        ; to give it control later on.
     1496        push    si
     1497        mov     ax, StartBaseSeg
     1498        mov     es, ax
     1499        mov     cx, 256
     1500        mov     si, offset PartitionSector
     1501        mov     di, StartBasePtr
     1502        rep     movsw
     1503        pop     si
     1504
     1505    ; --------------------------------------------------- NOW START BOOT-RECORD
    12791506
    12801507
     
    12921519;
    12931520
    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
     1521        ;
     1522        ; Wait for keypress
     1523        ;
     1524        xor     ax, ax
     1525        int     16h
     1526
     1527        ; Is escape-key ?
     1528        cmp     al, 1bh
     1529
     1530        ; Nope, Go activate PBR loader
     1531        jne      start_pbr
     1532
     1533        ; Yep, Reenter bootmenu
     1534        jmp      MBR_Main_ReEnterBootMenuPre
    13081535
    13091536
     
    13141541start_pbr:
    13151542
    1316    ;
    1317    ; BYE BYE
    1318    ;
    1319    xor     ax, ax
    1320    xor     bx, bx
    1321    xor     cx, cx
    1322    mov     ds, ax
    1323    mov     es, ax                        ; DS == ES == 0
    1324    xor     dh, dh                        ; Drive supported by BIOS
    1325    mov     dl, cs:[si+LocIPT_Drive]      ; Drive Physical No
    1326 
    1327    ;
    1328    ; JUMP TO PBR loader
    1329    ;
    1330    IFDEF ReleaseCode
    1331       db      0EAh
    1332       dw      StartBasePtr
    1333       dw      StartBaseSeg
    1334    ENDIF
     1543        ;
     1544        ; BYE BYE
     1545        ;
     1546        xor     ax, ax
     1547        xor     bx, bx
     1548        xor     cx, cx
     1549        mov     ds, ax
     1550        mov     es, ax                        ; DS == ES == 0
     1551        xor     dh, dh                        ; Drive supported by BIOS
     1552        mov     dl, cs:[si+LocIPT_Drive]      ; Drive Physical No
     1553
     1554        ;
     1555        ; JUMP TO PBR loader
     1556        ;
     1557        IFDEF ReleaseCode
     1558            db      0EAh
     1559            dw      StartBasePtr
     1560            dw      StartBaseSeg
     1561        ENDIF
    13351562
    13361563
     
    13381565
    13391566
     1567;
     1568; ######################################
     1569; # Is this a primary partition or not #
     1570; ######################################
     1571;
     1572; In
     1573; --
     1574; DL    = Physical Disk
     1575; BX:CX = LBA sector
     1576;
     1577; Out
     1578; ---
     1579; AX    = Index in PT if found, otherwise -1
     1580; CY    = Set if Primary, clear if not
     1581;
     1582PART_IsPrimaryPartition Proc Near  Uses bx cx dx si di ds es
     1583        ; Push LBA address of partition
     1584        push     bx
     1585        push     cx
     1586
     1587        ; Load LBA sector 0 from the disk specified in DL
     1588        xor      bx,bx
     1589        xor      cx,cx
     1590        mov      di,ds
     1591        mov      si,offset [TmpSector]
     1592        call     DriveIO_LoadSectorLBA
     1593
     1594        ; Restore partitions LBA address to DI:SI
     1595        pop      si
     1596        pop      di
     1597
     1598        ; Return with index -1 and CY clear if there was an
     1599        ; error loading the sector.
     1600        mov      ax,-1
     1601        cmc
     1602        jnc      PART_IsPrimaryPartition_exit
     1603
     1604        ; Compare the partition address with each entry in the P-table
     1605        mov      cx,4                    ; Nr. of PT-entries
     1606        mov      dx,offset [TmpSector]
     1607        add      dx,01beh+08h            ; Point DX to 1st partition address
     1608
     1609    next_pe:
     1610        ; Computer pointer to PE
     1611        mov      bx,dx          ; Point BX to 1st partition address
     1612        mov      ax,cx          ; Get PE-index
     1613        dec      ax             ; Index is zero based so adjust it
     1614        shl      ax,4           ; PE's are 16 bytes in size
     1615        add      bx,ax          ; Make BX point to the PE
     1616
     1617        ; Compare LBA address
     1618        push     si
     1619        push     di
     1620        xor      si,[bx+00h]    ; Will put 0 in SI if the same
     1621        xor      di,[bx+02h]    ; Will put 0 in DI if the same
     1622        or       si,di          ; Wil set ZF if both zero
     1623        pop      di
     1624        pop      si
     1625        loopnz   next_pe        ; Try next entry if non-zero
     1626
     1627        ; Partition found or counter exhausted
     1628        mov      ax,-1
     1629        clc
     1630        ; Not found, so exit with NC and invalid index
     1631        jnz      PART_IsPrimaryPartition_exit
     1632
     1633        ; Partition is Primary, set CY and return index
     1634        mov      ax,cx
     1635        stc
     1636
     1637    PART_IsPrimaryPartition_exit:
     1638        ret
     1639PART_IsPrimaryPartition Endp
     1640
     1641
     1642
     1643;
     1644; #############################
     1645; # Is this an HPFS partition #
     1646; #############################
     1647;
     1648; In
     1649; --
     1650; DL    = Physical Disk
     1651; BX:CX = LBA sector
     1652;
     1653; Out
     1654; ---
     1655; AX    = 0 if not, 1 if it is HPFS
     1656; CY    = Set if HPFS, clear if not
     1657;
     1658PART_IsHPFS     Proc Near  Uses bx cx dx si di ds es
     1659        ; Load specified LBA sector (BX:CX) from the disk in DL
     1660        mov     di,ds
     1661        mov     si,offset [TmpSector]
     1662        call    DriveIO_LoadSectorLBA
     1663
     1664        ; Check for 'HPFS' string as offset 36h in BPB
     1665        mov     ax, word ptr [si+36h]  ; 'HP'
     1666        mov     dx, word ptr [si+38h]  ; 'FS'
     1667        xor     ax, 'PH'    ; Leaves zero in AX if 'HP'
     1668        xor     dx, 'SF'    ; Leaves zero in DX if 'FS'
     1669        or      ax,dx       ; Leaves zero in AX if partition is HPFS
     1670
     1671        ; Assume not HPFS, so clear AX,CY (ZF is set above)
     1672        mov     ax,0
     1673        clc
     1674        jnz     PART_IsHPFS_exit
     1675
     1676        ; Is HPFS, so indicate in AX, and set CY (ZF is set above)
     1677        mov     ax,1
     1678        stc
     1679
     1680    PART_IsHPFS_exit:
     1681        ret
     1682PART_IsHPFS     Endp
     1683
     1684
     1685;
     1686; #############################
     1687; # Is this a JFS partition #
     1688; #############################
     1689;
     1690; In
     1691; --
     1692; DL    = Physical Disk
     1693; BX:CX = LBA sector
     1694;
     1695; Out
     1696; ---
     1697; AX    = 0 if not, 1 if JFS partition
     1698; CY    = Set if JFS partition, clear if not
     1699;
     1700PART_IsJFS      Proc Near  Uses bx cx dx si di ds es
     1701
     1702        ; Load specified LBA sector (BX:CX) from the disk in DL
     1703        mov     di,ds
     1704        mov     si,offset [TmpSector]
     1705        call    DriveIO_LoadSectorLBA
     1706
     1707        ; Point to location of 'FAT32' identifier.
     1708        add     si,36h
     1709
     1710        ; DL holds equality status
     1711        xor     dl,dl
     1712        cld
     1713
     1714        ; Load letter into AL, xor with letter will result 0 if the same.
     1715        ; Then or to DL.
     1716        ; If at the end of the sequence DL is zero, the signature is present.
     1717        lodsb
     1718        xor     al,'J'
     1719        or      dl,al
     1720        lodsb
     1721        xor     al,'F'
     1722        or      dl,al
     1723        lodsb
     1724        xor     al,'S'
     1725        or      dl,al
     1726
     1727        ; Assume not present
     1728        mov     ax,0
     1729        clc
     1730        jnz     PART_IsJFS_exit
     1731
     1732        ; JFS signature found
     1733        mov     ax,1
     1734        stc
     1735
     1736    PART_IsJFS_exit:
     1737        ret
     1738PART_IsJFS      Endp
     1739
     1740;
     1741; #############################
     1742; # Is this a FAT32 partition #
     1743; #############################
     1744;
     1745; In
     1746; --
     1747; DL    = Physical Disk
     1748; BX:CX = LBA sector
     1749;
     1750; Out
     1751; ---
     1752; AX    = 0 if not, 1 if FAT32 partition
     1753; CY    = Set if FAT32 partition, clear if not
     1754;
     1755PART_IsFAT32    Proc Near  Uses bx cx dx si di ds es
     1756
     1757        ; Load specified LBA sector (BX:CX) from the disk in DL
     1758        mov     di,ds
     1759        mov     si,offset [TmpSector]
     1760        call    DriveIO_LoadSectorLBA
     1761
     1762        ; Point to location of 'FAT32' identifier.
     1763        add     si,52h
     1764
     1765        ; DL holds equality status
     1766        xor     dl,dl
     1767        cld
     1768
     1769        ; Load letter into AL, xor with letter will result 0 if the same.
     1770        ; Then or to DL.
     1771        ; If at the end of the sequence DL is zero, the signature is present.
     1772        lodsb
     1773        xor     al,'F'
     1774        or      dl,al
     1775        lodsb
     1776        xor     al,'A'
     1777        or      dl,al
     1778        lodsb
     1779        xor     al,'T'
     1780        or      dl,al
     1781        lodsb
     1782        xor     al,'3'
     1783        or      dl,al
     1784        lodsb
     1785        xor     al,'2'
     1786        or      dl,al
     1787
     1788        ; Assume not present
     1789        mov     ax,0
     1790        clc
     1791        jnz     PART_IsFAT32_exit
     1792
     1793        ; FAT32 signature found
     1794        mov     ax,1
     1795        stc
     1796
     1797    PART_IsFAT32_exit:
     1798        ret
     1799PART_IsFAT32    Endp
     1800
     1801
     1802
     1803;
     1804; ##############################################################
     1805; # Does this partition have the Windows BootManager installed #
     1806; ##############################################################
     1807;
     1808; In
     1809; --
     1810; DL    = Physical Disk
     1811; BX:CX = LBA sector
     1812;
     1813; Out
     1814; ---
     1815; AX    = 0 if not, 1 if BOOTMGR signature found
     1816; CY    = Set if BOOTMGR found, clear if not
     1817;
     1818PART_IsWinBMGR  Proc Near  Uses bx cx dx si di ds es
     1819
     1820        ; Load specified LBA sector (BX:CX) from the disk in DL
     1821        mov     di,ds
     1822        mov     si,offset [TmpSector]
     1823        call    DriveIO_LoadSectorLBA
     1824
     1825        ; Point to location of 'BOOTMGR' signature.
     1826        add     si,169h
     1827
     1828        ; DL holds equality status
     1829        xor     dl,dl
     1830        cld
     1831
     1832        ; Load letter into AL, xor with letter will result 0 if the same.
     1833        ; Then or to DL.
     1834        ; If at the end of the sequence DL is zero, the signature is present.
     1835        lodsb
     1836        xor     al,'B'
     1837        or      dl,al
     1838        lodsb
     1839        xor     al,'O'
     1840        or      dl,al
     1841        lodsb
     1842        xor     al,'O'
     1843        or      dl,al
     1844        lodsb
     1845        xor     al,'T'
     1846        or      dl,al
     1847        lodsb
     1848        xor     al,'M'
     1849        or      dl,al
     1850        lodsb
     1851        xor     al,'G'
     1852        or      dl,al
     1853        lodsb
     1854        xor     al,'R'
     1855        or      dl,al
     1856
     1857        ; Assume not present
     1858        mov     ax,0
     1859        clc
     1860        jnz     PART_IsWinBMGR_exit
     1861
     1862        ; BOOTMGR signature found
     1863        mov     ax,1
     1864        stc
     1865
     1866    PART_IsWinBMGR_exit:
     1867        ret
     1868PART_IsWinBMGR  Endp
  • trunk/BOOTCODE/REGULAR/PARTSCAN.ASM

    r30 r32  
    130130  PSSDFP_LoadThisPartition:
    131131
    132    call    DriveIO_LoadPartition                                                 ; Rousseau: load a partition record
     132   call    DriveIO_LoadPartition                ; Load a partition record
    133133
    134134   jc      PSSDFP_InvalidPartition
    135135
    136136   ; LVM Support - Reads LVM Information Sector
    137    call    DriveIO_LoadLVMSector                                                 ; Rousseau: load LVM sector
     137   call    DriveIO_LoadLVMSector                ; Load LVM sector
    138138
    139139   call    PARTSCAN_ScanPartition
     
    806806
    807807ibm_bm_name:   db 'IBM BootMan',0
     808;win_bm_name:   db 'BOOTMGR',0
  • trunk/BOOTCODE/REGULAR/STD_TEXT.ASM

    r31 r32  
    3636;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc5-b35)', 0
    3737;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
    38 Copyright             db ' AiR-BOOT v1.08 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
    39 
     38;Copyright             db ' AiR-BOOT v1.0.8 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
     39Copyright             db ' AiR-BOOT v1.0.8-internal-beta - ** !! NOT FOR DISTRIBUTION !! **', 0
    4040; Rousseau: switch around
    41 BootEndMsg           db 'This is GPLv3+ software. Please visit http://svn.netlabs.org/air-boot', 0
    42 BootEndMsg2          db 'http://www.gnu.org/licenses/gpl.txt', 0
     41BootEndMsg           db 'This is GPLv3+ software. Please visit: http://www.gnu.org/licenses/gpl.txt', 0
     42BootEndMsg2          db 'http://svn.netlabs.org/air-boot', 0
    4343
    4444AuxInitMsg           db 'Initializing Serial Communications on COM',0
  • trunk/BOOTCODE/REGULAR/VIDEOIO.ASM

    r30 r32  
    143143;        In: SI - String to Print (EOS is 0)
    144144; Destroyed: SI
    145 VideoIO_PrintLikeLenOfName      Proc Near   Uses es di
     145VideoIO_PrintLikeLenOfName      Proc Near   Uses cx es di
    146146   push    si
    147147      xor     cx, cx
     
    190190;        In: AL - Single Char to Print
    191191; Destroyed: None
    192 VideoIO_PrintSingleChar         Proc Near   Uses ax es di
    193    mov     bl, al
    194    call    VideoIO_Internal_SetRegs
    195    mov     es:[di], bl
    196    mov     es:[di+1], ah
    197    inc     TextPosX
    198    ret
     192VideoIO_PrintSingleChar         Proc Near   Uses ax bx es di
     193    mov     bl, al
     194    call    VideoIO_Internal_SetRegs
     195    mov     es:[di], bl
     196    mov     es:[di+1], ah
     197    inc     TextPosX
     198    ret
    199199VideoIO_PrintSingleChar         EndP
    200200
     
    266266;            CL - Times to print it
    267267; Destroyed: None
    268 VideoIO_PrintSingleMultiChar    Proc Near   Uses ax cx es di
     268VideoIO_PrintSingleMultiChar    Proc Near   Uses ax bx cx es di
    269269   or      cl, cl
    270270   jz      VIOPSMC_NoChars
     
    637637
    638638;
    639 ; Rousseau: added
    640 ; Set poosition to teletype cursor
     639; Set position to teletype cursor
    641640;
    642641VideoIO_SyncPos                 Proc Near   Uses ax bx cx dx
     
    687686; Dump the disk-info.
    688687; Disk number is in DL.
    689 VideoIO_DumpDiskInfo    Proc Near
     688VideoIO_DumpDiskInfo    Proc Near uses ax bx cx dx
    690689
    691690   VideoIO_DumpDiskInfo_next_disk:
     
    725724      call     VideoIO_PrintSingleMultiChar
    726725
    727       inc      [TextPosY]
    728       mov      [TextPosX],dh
    729       mov      si, offset BiosCyls
    730       call     VideoIO_Print
    731 
    732       push     dx
    733       mov      bx,offset BIOS_Cyls
    734       xor      dh,dh
    735       and      dl,01111111b
    736       shl      dx,1
    737       shl      dx,1
    738       add      bx,dx
    739       mov      ax,[bx]
    740       mov      dx,[bx+02]
    741       call     VideoIO_PrintHexDWord
    742       pop      dx
     726;      inc      [TextPosY]
     727;      mov      [TextPosX],dh
     728;      mov      si, offset BiosCyls
     729;      call     VideoIO_Print
     730
     731;      push     dx
     732;      mov      bx,offset BIOS_Cyls
     733;      xor      dh,dh
     734;      and      dl,01111111b
     735;      shl      dx,1
     736;      shl      dx,1
     737;      add      bx,dx
     738;      mov      ax,[bx]
     739;      mov      dx,[bx+02]
     740;      call     VideoIO_PrintHexDWord
     741;      pop      dx
    743742
    744743      inc      [TextPosY]
     
    782781
    783782      push     dx
     783      ; Offset of array containing LVM SPT values for each disk found
    784784      mov      bx,offset TrueSecs
     785      ; DX to index
    785786      xor      dh,dh
    786787      and      dl,01111111b
     
    788789      shl      dx,1
    789790      add      bx,dx
     791      ; Get LVM SPT
    790792      mov      ax,[bx]
    791793      mov      dx,[bx+02]
  • trunk/BOOTCODE/_build.cmd

    r31 r32  
    44
    55/*
     6The language to build is passed by the master Makefile.
    67Supported languages are: EN,DE,FR,SW,IT,NL,RU.
    78Change lang to 'ALL' to build all language versions.
    89*/
    9 lang = 'EN';
     10parse arg lang
     11
     12if (lang='') then do
     13        lang='EN';
     14end
     15
    1016
    1117/* Generate BUILD_DATE.ASM  */
     
    2228Say '';
    2329'rem @pause';
     30
  • trunk/BOOTCODE/_clean.cmd

    r30 r32  
    66'@if exist air-boot.map del air-boot.map';
    77'@if exist airboot.bin del airboot.bin';
    8 'rem @if exist blddate.asm del blddate.asm';  /* keep the builddate of the v1.07 eCS v2.1 release */
     8'@if exist blddate.asm del blddate.asm';
     9
     10'@if exist mbr-prot\*.obj del mbr-prot\*.obj';
     11'@if exist mbr-prot\*.lst del mbr-prot\*.lst';
     12'@if exist mbr-prot\*.com del mbr-prot\*.com';
     13'@if exist mbr-prot\*.exe del mbr-prot\*.exe';
    914
    1015'@if exist ..\RELEASE\BOOTCODE\AIRBT-*.BIN del ..\RELEASE\BOOTCODE\AIRBT-*.BIN';
    1116
    1217'@if exist ..\RELEASE\DOS\AIRBOOT.BIN del ..\RELEASE\DOS\AIRBOOT.BIN';
     18'@if exist ..\RELEASE\DOS\*.COM del ..\RELEASE\DOS\*.COM';
     19
     20'@if exist ..\TOOLS\DOS\INITHDD\*.LST del ..\TOOLS\DOS\INITHDD\*.LST';
     21
     22'@if exist ..\INSTALL\DOS\*.LST del ..\INSTALL\DOS\*.LST';
     23
     24'@if exist ..\INSTALL\FLOPPY\*.LST del ..\INSTALL\FLOPPY\*.LST';
     25
     26'@if exist ..\TOOLS\INTERNAL\*.LST del ..\TOOLS\INTERNAL\*.LST';
     27'@if exist ..\TOOLS\INTERNAL\*.COM del ..\TOOLS\INTERNAL\*.COM';
     28
    1329'@if exist ..\RELEASE\OS2\AIRBOOT.BIN del ..\RELEASE\OS2\AIRBOOT.BIN';
    1430'@if exist ..\RELEASE\WINNT\AIRBOOT.BIN del ..\RELEASE\WINNT\AIRBOOT.BIN';
  • trunk/BUILD.NFO

    r30 r32  
    1 =====================================================
    2  BUILD.NFO -- Information on building AiR-BOOT v1.07
    3 =====================================================
     1======================================================
     2 BUILD.NFO -- Information on building AiR-BOOT v1.0.8
     3======================================================
    44
    5 Building AiR-BOOT v1.07 requires the following tools:
     5Building AiR-BOOT v1.0.8 requires the following tools:
    66- Borland Turbo Assembler v4.1 for DOS
    77  (TASM.EXE 136.018 bytes)
     
    1313  (Used to build the installer and setaboot etc.)
    1414
    15 Putting these executables in ?:\OS2\MDOS will enable them to be found
    16 when running the build scripts.
     15Put these DOS executables (not Open Watcom) in a directory
     16and append that directory to the PATH as defined in ?:\AUTOEXEC.BAT.
     17This will enable DOS sessions to find them when called
     18by the Rexx build scripts from an OS2 CMD session.
    1719
    1820Note that only the loader, installer and setaboot targets are built.
  • trunk/INSTALL/C/INSTALL.C

    r31 r32  
    408408
    409409      /*
    410       // Rousseau:
    411       // Calculate chechsum over 5 sectors starting at the config-sector at 55.
    412       // 55,56,57,58,59 (60 is MBR backup in normal version)
    413       // SHOULD ADJUST THIS FOR EXTENDED VERSION !                               // !!!!!!!!!!!
     410      // Rousseau: # Keep compatible with v1.07 CRC #
     411      // AB v1.07 had bugs in writing the wrong number of AB config sectors.
     412      // This is fixed in v1.0.8 but the CRC has to be calculated the "v1.07 way"
     413      // otherwise v1.07 SET(A)BOOT and INSTALL2.EXE will think the AB config
     414      // is corrupted.
     415      // So the CRC is calculated over 5 sectors instead of 7.
    414416      */
    415 
    416       SectorCount = 7;
     417      SectorCount = 5;
    417418
    418419      while (SectorCount>0) {
     
    499500BOOL Virus_CheckThisMBR (PCHAR MBRptr) {                                         // Rousseau: adjusted this function
    500501   USHORT PartitionNo;
    501    ULONG  CHSStart, CHSEnd;
     502   ////ULONG  CHSStart, CHSEnd;
    502503
    503504   //printf("DEBUG: Virus_CheckThisMBR\n");
     
    532533         //printf("DEBUG: Virus_CheckThisMBR - Partition: %d\n", PartitionNo);
    533534         // Partition-type defined, analyse partition data
    534          CHSStart = (*(MBRptr+3) | ((*(MBRptr+2) >> 6) << 8)) << 16;             // Cylinder
    535          CHSStart |= (*(MBRptr+2) & 0x3F) | ((*(MBRptr+1) << 8));                // Sector / Head
     535         ////CHSStart = (*(MBRptr+3) | ((*(MBRptr+2) >> 6) << 8)) << 16;             // Cylinder
     536         ////CHSStart |= (*(MBRptr+2) & 0x3F) | ((*(MBRptr+1) << 8));                // Sector / Head
    536537         //printf("DEBUG: Virus_CheckThisMBR - CHSStart: %d\n", CHSStart);                               // 3F MASK CHECKEN !!
    537538
    538          CHSEnd = (*(MBRptr+7) | ((*(MBRptr+6) >> 6) << 8)) << 16;               // Cylinder
    539          CHSEnd |= (*(MBRptr+6) & 0x3F) | ((*(MBRptr+5) << 8));                  // Sector / Head
     539         ////CHSEnd = (*(MBRptr+7) | ((*(MBRptr+6) >> 6) << 8)) << 16;               // Cylinder
     540         ////CHSEnd |= (*(MBRptr+6) & 0x3F) | ((*(MBRptr+5) << 8));                  // Sector / Head
    540541         //printf("DEBUG: Virus_CheckThisMBR - CHSEnd: %d\n", CHSEnd);
    541542
     
    550551         */
    551552         /*if (CHSStart<CHSEnd) {*/
    552          if (CHSStart<=CHSEnd) {
    553             if (*(PULONG)(MBRptr+12)!=0) // Absolute length > 0?
    554                return TRUE;
    555           }
     553         ////if (CHSStart<=CHSEnd) {
     554         ////   if (*(PULONG)(MBRptr+12)!=0) // Absolute length > 0?
     555         ////      return TRUE;
     556          ////}
    556557       }
    557558      // Go to next partition
     
    616617    case STATUS_INSTALLEDMGU:
    617618       if (!Option_CID) {
    618          printf("intact (v%x.%02x)", Version>>8, Version & 0x0FF);
     619         printf("intact (v%x.%1d.%1d)", Version>>8, (Version & 0x0F0)>>4, Version & 0x0F);
     620
    619621       }
    620622       if (Status==STATUS_INSTALLEDMGU)
     
    637639   switch (LanguageID) {
    638640     case 'E': printf("english"); break;
    639      case 'D': printf("dutch"); break;
     641     case 'N': printf("dutch"); break;       // Changed from 'D' to 'N'
    640642     case 'G': printf("german"); break;
    641643     case 'F': printf("french"); break;
     
    690692   SectorPtr = &Bootcode[54 * BYTES_PER_SECTOR];                                 // Start at sector 55
    691693
    692    SectorCount = 7;
     694   /*
     695   // Rousseau: # Keep compatible with v1.07 CRC #
     696   // AB v1.07 had bugs in writing the wrong number of AB config sectors.
     697   // This is fixed in v1.0.8 but the CRC has to be calculated the "v1.07 way"
     698   // otherwise v1.07 SET(A)BOOT and INSTALL2.EXE will think the AB config
     699   // is corrupted.
     700   // So the CRC is calculated over 5 sectors instead of 7.
     701   */
     702   SectorCount = 5;
    693703
    694704   while (SectorCount>0) {
     
    912922       else if (Status_Code==STATUS_NOTINSTALLED) printf(" <A> - Add AiR-BOOT ");
    913923       else printf(" <U> - Update/Change AiR-BOOT to ");
    914       printf("'v%x.%02x/", Bootcode_Version>>8, Bootcode_Version & 0x0FF);
     924      printf("'v%x.%1d.%1d/", Bootcode_Version>>8, (Bootcode_Version & 0x0F0)>>4, Bootcode_Version & 0x0F);
    915925      Language_PrintF(Bootcode_LanguageID);
    916926      printf("' on current system\n");
  • trunk/INSTALL/C/_build.cmd

    r30 r32  
    66/* OS2 version */
    77'ide2make '||debug||' -p OS2.WPJ';
    8 'wmake -f OS2.MK';
     8'wmake -h -f OS2.MK';
    99
    1010/* WIN32 version */
    1111'ide2make '||debug||' -p WIN32.WPJ';
    12 'wmake -f WIN32.MK';
     12'wmake -h -f WIN32.MK';
    1313
  • trunk/INSTALL/INST_X86/INSTALL.INC

    r30 r32  
    332332   mov     wptr ds:[si+20], 0            ; delete current CheckSum
    333333   xor     bx, bx
    334    mov     cx, 5
     334
     335   mov     cx, 7     ; Rousseau: changed to 7 for v1.0.7+
     336
    335337  IC_CalcConfigLoop:
    336338      call    GetCheckOfImageSector
     
    502504   je      ISL_Done
    503505   cmp     al, 'D'
    504    mov     si, offset TXT_Language_DT
     506   mov     si, offset TXT_Language_NL
    505507   je      ISL_Done
    506508   cmp     al, 'G'
     
    647649   mov     wptr es:[si+20], 0            ; Kills current Checksum
    648650   xor     bx, bx
    649    mov     cx, 5                         ; Total of 5 Sectors
     651
     652   mov     cx, 7                         ; Total of 7 Sectors
     653                                         ; Rousseau: changed above to 7
     654
    650655  IVC_CheckSumLoop2:
    651656      call    GetCheckOfHDDSector
     
    907912
    908913TXT_Language_EN                db 'english', 0
    909 TXT_Language_DT                db 'dutch', 0
     914TXT_Language_NL                db 'dutch', 0
    910915TXT_Language_DE                db 'german', 0
    911916TXT_Language_FR                db 'french', 0
     
    10081013
    10091014; Space for bootcode-image
    1010 BootImage       db 30720 dup (?)
     1015BootImage       db 31744 dup (?)
  • trunk/MAKEFILE

    r31 r32  
    22# MAKEFILE -- Wrapper around the DOS .BAT files.
    33#
     4
     5LANGUAGE=EN
    46
    57#
     
    2527        cd BOOTCODE
    2628        call _clean.cmd
    27         call _build.cmd
     29        call _build.cmd $(LANGUAGE)
    2830        @cd ..
    29         @echo.
    30         @echo Gonna build the installer and setaboot now...
    31         @echo.
    32         rem @pause
    3331
    3432# OS2 and WIN32 installer
  • trunk/TOOLS/OS2/SETABOOT/SETABOOT.C

    r30 r32  
    143143#define AiRBOOTIPENTRY_Flags_BootAble       0x01
    144144
    145 CHAR            Track0[60*512];      // Space for Track-0
     145CHAR            Track0[62*512];      // Space for Track-0
    146146PAiRBOOTCODESIG AiRBOOT_CodeSig = 0;
    147147PAiRBOOTCONFIG  AiRBOOT_Config = 0;
     
    189189   BOOL Track0Load (void) {
    190190      USHORT      IOCTLHandle;
    191       ULONG       TrackLayoutLen  = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(60-1);
     191      ULONG       TrackLayoutLen  = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(62-1);
    192192      TRACKLAYOUT *TrackLayoutPtr = malloc(TrackLayoutLen);
    193193      ULONG       cbParms = sizeof(TrackLayoutPtr);
     
    202202      TrackLayoutPtr->usCylinder    = 0;
    203203      TrackLayoutPtr->usFirstSector = 0;
    204       TrackLayoutPtr->cSectors      = 60;
    205 
    206       for (i=0; i<60; i++) {
     204      TrackLayoutPtr->cSectors      = 62;
     205
     206      for (i=0; i<62; i++) {
    207207         TrackLayoutPtr->TrackTable[i].usSectorNumber = i+1;
    208208         TrackLayoutPtr->TrackTable[i].usSectorSize   = 512;
     
    219219   BOOL Track0Write (void) {
    220220      USHORT      IOCTLHandle;
    221       ULONG       TrackLayoutLen  = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(60-1);
     221      ULONG       TrackLayoutLen  = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(62-1);
    222222      TRACKLAYOUT *TrackLayoutPtr = malloc(TrackLayoutLen);
    223223      ULONG       cbParms = sizeof(TrackLayoutPtr);
     
    233233      TrackLayoutPtr->usCylinder    = 0;
    234234      TrackLayoutPtr->usFirstSector = 0;
    235       TrackLayoutPtr->cSectors      = 60;
    236 
    237       for (i=0; i<60; i++) {
     235      TrackLayoutPtr->cSectors      = 62;
     236
     237      for (i=0; i<62; i++) {
    238238         TrackLayoutPtr->TrackTable[i].usSectorNumber = i+1;
    239239         TrackLayoutPtr->TrackTable[i].usSectorSize   = 512;
     
    311311// If AiR-BOOT is not installed, the user probably meant to control OS/2 BM with this utility.
    312312// Since the functionality of this utility is for AiR-BOOT only, we will pass the request to
    313 // the OS/2 BM SETBOOT utility which is called SETBM.EXE as of eCS 2.01.
     313// the OS/2 BM SETBOOT utility which is called SETBM.EXE as of eCS 2.1.
    314314// Since the objective here is to supply OS/2 BM SETBOOT compatibility, if SETBM.EXE is not found,
    315315// some other system locations are searched for the OS/2 version of SETBOOT.EXE.
     
    321321   APIRET      rc             = -1;
    322322   RESULTCODES  crc                        = {-1,-1};
    323    PTIB        ptib           = NULL;
    324    PPIB        ppib           = NULL;
     323//   PTIB        ptib           = NULL;
     324//   PPIB        ppib           = NULL;
    325325   char        buffer[256]    = "\0";
    326326   char        cmdline[256]   = "\0";
     
    453453   BOOL            XWPEntryFound    = FALSE;
    454454   BOOL            CDBoot           = FALSE;                                     // TRUE if booted from CD; New System will be added when using /4:"LABEL"
    455    BOOL            Track0Loaded     = FALSE;                                     // Assume track0 did not load correctly.
     455//   BOOL            Track0Loaded     = FALSE;                                     // Assume track0 did not load correctly.
    456456   BOOL            AiRBOOTBad       = FALSE;
    457457
     
    472472   */
    473473   //puts ("SETABOOT - AiR-BOOT Configuration Utility (OS/2) - (c) 2004-2009 by M. Kiewitz");
    474    puts ("SETABOOT v1.07 - AiR-BOOT Configuration Utility - (c) 2004-2011 by M. Kiewitz");
     474   puts ("SETABOOT v1.07a - AiR-BOOT Configuration Utility - (c) 2004-2011 by M. Kiewitz");
    475475
    476476
     
    942942   // Calculate CheckSum...
    943943   ResultCheck = 0; CurSectorNo = 55;
    944    while (CurSectorNo<60) {
     944   while (CurSectorNo<62) {
    945945      ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo);
    946946      CurSectorNo++;
     
    965965   // Calculate CheckSum...
    966966   ResultCheck = 0; CurSectorNo = 55;
     967
     968   /*
     969   // Rousseau: # Keep compatible with v1.07 CRC #
     970   // AB v1.07 had bugs in writing the wrong number of AB config sectors.
     971   // This is fixed in v1.0.8 but the CRC has to be calculated the "v1.07 way"
     972   // otherwise v1.07 SET(A)BOOT and INSTALL2.EXE will think the AB config
     973   // is corrupted.
     974   // So the CRC is calculated over 5 sectors instead of 7.
     975   */
    967976   while (CurSectorNo<60) {
    968977      ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo);
  • trunk/TOOLS/OS2/SETABOOT/_build.cmd

    r30 r32  
    55
    66'ide2make '||debug||' -p SETABOOT.WPJ';
    7 'wmake -f SETABOOT.MK';
     7'wmake -h -f SETABOOT.MK';
Note: See TracChangeset for help on using the changeset viewer.