Changeset 29 for trunk/BOOTCODE/REGULAR


Ignore:
Timestamp:
May 5, 2011, 2:00:00 PM (15 years ago)
Author:
Ben Rietbroek
Message:

AiR-BOOT v1.06 -- Complete sourceforge mirror. (r56) [2010-02-19]
Signature-date: 2006-03-13.
Also contains binairy releases from v1.01 to v1.06, cd-rom images, etc.
If you want the whole pre v1.07 shebang, checkout this revision's trunk.
The v1.06 reference version is in 'tags/v1.06r'.
Note that this reference version uses 'NL' for 'Dutch'.

Location:
trunk/BOOTCODE/REGULAR
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/BOOTCODE/REGULAR/BOOTMENU.ASM

    r23 r29  
    1 
    2 ; Disclaimer:
    3 ;=============
    4 ; The sourcecode is released via www.netlabs.org CVS *ONLY*.
    5 ;  You MUST NOT upload it to other servers nor republish it in any way.
    6 The sourcecode is still COPYRIGHTED and NOT RELEASED UNDER GPL.
    7 It's (c) Copyright 1998-2003 by Martin Kiewitz.
    8 You may recompile the source and do *PRIVATE* modifications, but please keep
    9 ;  in mind that modifying this code needs at least *some* assembly skill. If
    10 ;  you mess up your system, because you needed to hack your way through, don't
    11 blame me. Releasing a customized version of AiR-BOOT, selling it in any form
    12 or reusing parts of this source is *PROHIBITED*. Ask me, if you have some
    13 idea about new functionality *before* developing the code, otherwise I will
    14 ;  definitely reject it. Also please accept, that I have some basic design
    15 ;  rules on AiR-BOOT and I will maintain them at all costs, so this won't get
    16 another GRUB.
    17 
     1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
     2;
     3; This file is part of AiR-BOOT
     4;
     5; AiR-BOOT is free software: you can redistribute it and/or modify it under
     6the terms of the GNU General Public License as published by the Free
     7Software Foundation, either version 3 of the License, or (at your option)
     8any later version.
     9;
     10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
     12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     13details.
     14;
     15; You should have received a copy of the GNU General Public License along with
     16AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
     17;
    1818;---------------------------------------------------------------------------
    1919;                                                      AiR-BOOT / BOOT-MENU
     
    185185   call    VideoIO_Color
    186186
    187    IFDEF ReleaseCommercial
    188       mov     si, offset RegisteredTo
    189       call    GetLenOfString
    190       mov     dx, 144Eh
    191       sub     dl, cl
    192       mov     cx, dx
    193       call    VideoIO_Locate
    194       mov     al, TextChar_WinRep4
    195       call    VideoIO_PrintSingleChar
    196       call    VideoIO_Print
    197       mov     al, TextChar_WinRep5
    198       call    VideoIO_PrintSingleChar
    199    ENDIF
    200 
    201187   ; Additional message how to enter setup
    202188   mov     si, offset TXT_BootMenuEnterSetup
     
    226212   call    VideoIO_Color
    227213   mov     bx, 0101h
    228    mov     dx, 0450h
     214   mov     dx, 0550h
    229215   call    VideoIO_MakeWindow            ; Information-Window
    230216   xor     di, di
     
    271257   mov     cx, 0303h
    272258   call    VideoIO_Locate
    273    IFDEF ReleaseCommercial
    274       mov     si, offset RegisteredTo
    275      ELSE
    276       mov     si, offset BootEndMsg         ; Print End-Message...
    277    ENDIF
     259   mov     si, offset BootEndMsg         ; Print End-Message...
     260   call    VideoIO_Print
     261   mov     cx, 0403h
     262   call    VideoIO_Locate
     263   mov     si, offset BootEndMsg2        ; Print GPL-Message...
    278264   call    VideoIO_Print
    279265   ; -------------------------------------------
    280266   mov     ah, 02h
    281267   mov     bh, 00h
    282    mov     dx, 0500h                     ; Sets cursor location to 6, 0
     268   mov     dx, 0600h                     ; Sets cursor location to 7, 1
    283269   int     10h
    284270   call    VideoIO_CursorOn
     
    366352   call    VideoIO_Color                 ; Violet, blue
    367353   mov     si, PartPointer
    368    mov     al, cs:[si+LocIPT_Drive]
     354   mov     al, [si+LocIPT_Drive]
    369355   sub     al, 7Fh                       ; Will only display numbers up to 99,
    370356   call    VideoIO_PrintByteNumber       ;  so only showing harddrives...
     
    411397   call    VideoIO_Locate
    412398   mov     si, PartPointer
    413    mov     al, cs:[si+LocIPT_SystemID]
     399   mov     al, [si+LocIPT_SystemID]
    414400   call    PART_SearchFileSysName
    415401   mov     cx, 0C01h
     
    498484
    499485
    500 
    501486; Calculate Menu-Variables for Boot-Menu, these use the filtered Part-Pointers
    502487BOOTMENU_ResetMenuVars          Proc Near   Uses dx
     
    520505   mov     Menu_TotalParts, dl
    521506
    522    ; Now copy the device-name to the ContBIOSbootSeq-IPT entry
    523    movzx   bx, CFG_ResumeBIOSbootSeq
    524    dec     bx
    525    shl     bx, 1
    526    mov     si, wptr [ContinueBIOSbootTable+bx]
    527    mov     di, offset BIOScontIPTentry+LocIPT_Name
    528    push    di
    529       mov     cx, 11
    530       mov     al, ' '
    531       rep     stosb
    532    pop     di
    533   BMRMV_BootDeviceCopyLoop:
    534       lodsb
    535       or      al, al
    536       jz      BMRMV_NoResumeBootSeq
    537       stosb
    538       jmp     BMRMV_BootDeviceCopyLoop
    539   BMRMV_NoResumeBootSeq:
     507   ; Copy device-name to the ContBIOSbootSeq-IPT entry
     508   ;  Normally this does not need to get done here, but is done for safety
     509   ;  reasons if e.g. IPT got changed by SETUP, but that setup was discarded.
     510   call    PART_UpdateResumeBIOSName
    540511
    541512   ; Default-Partition -> Filtered View -> Menu_EntryDefault
     
    554525   mov     Menu_EntryAutomatic, dl
    555526
    556    ; Okay, now we check if Default/Last Kernel Partition Name is available...
    557    ;  if so, simply set Menu_EntryDefault/Menu_EntryLast.
    558    mov     si, offset CFG_LinuxDefaultKernel
    559    call    LINUX_SearchKernelName        ; DL - Filtered Entry No
    560    cmp     dl, 0FFh
    561    je      BMRMV_DefaultKernelNF
    562    mov     Menu_EntryDefault, dl
    563   BMRMV_DefaultKernelNF:
    564    mov     si, offset CFG_LinuxLastKernel
    565    call    LINUX_SearchKernelName        ; DL - Filtered Entry No
    566    cmp     dl, 0FFh
    567    je      BMRMV_LastKernelNF
    568    mov     Menu_EntryLast, dl
    569   BMRMV_LastKernelNF:
     527; [Linux support removed since v1.02]
     528;   ; Okay, now we check if Default/Last Kernel Partition Name is available...
     529;   ;  if so, simply set Menu_EntryDefault/Menu_EntryLast.
     530;   mov     si, offset CFG_LinuxDefaultKernel
     531;   call    LINUX_SearchKernelName        ; DL - Filtered Entry No
     532;   cmp     dl, 0FFh
     533;   je      BMRMV_DefaultKernelNF
     534;   mov     Menu_EntryDefault, dl
     535;  BMRMV_DefaultKernelNF:
     536;   mov     si, offset CFG_LinuxLastKernel
     537;   call    LINUX_SearchKernelName        ; DL - Filtered Entry No
     538;   cmp     dl, 0FFh
     539;   je      BMRMV_LastKernelNF
     540;   mov     Menu_EntryLast, dl
     541;  BMRMV_LastKernelNF:
    570542
    571543   ; restlichen Variablen berechnen...
     
    609581   mov     dl, Menu_EntrySelected
    610582   call    PART_ConvertToStraight        ; CFG_PartLast is non-filtered
    611    mov     di, offset CFG_LinuxLastKernel
    612    mov     cx, 11
     583;   mov     di, offset CFG_LinuxLastKernel
     584;   mov     cx, 11
    613585   cmp     dl, 0FDh                      ; Dont Remember on Floppy/CD-ROM/etc.
    614586   ja      BMSVAM_DontRememberBoot
    615    je      BMSVAM_RememberKernelBoot     ; but remember Kernel-Bootings...
     587;   je      BMSVAM_RememberKernelBoot     ; but remember Kernel-Bootings...
    616588   mov     CFG_PartLast, dl              ; Remember partition in CFG_PartLast
    617    mov     al, ' '
    618    rep     stosb                         ; SPACE out CFG_LinuxLastKernel
     589;   mov     al, ' '
     590;   rep     stosb                         ; SPACE out CFG_LinuxLastKernel
    619591  BMSVAM_DontRememberBoot:
    620592   ret
    621 
    622   BMSVAM_RememberKernelBoot:
    623    mov     dl, Menu_EntrySelected
    624    call    PART_GetPartitionPointer      ; SI - Pointer to Kernel Entry...
    625    add     si, LocIPT_Name
    626    rep     movsb                         ; Copy KernelName 2 CFG_LinuxLastKernel
    627    ret
     593;
     594;  BMSVAM_RememberKernelBoot:
     595;   mov     dl, Menu_EntrySelected
     596;   call    PART_GetPartitionPointer      ; SI - Pointer to Kernel Entry...
     597;   add     si, LocIPT_Name
     598;   rep     movsb                         ; Copy KernelName 2 CFG_LinuxLastKernel
     599;   ret
    628600BOOTMENU_SetVarsAfterMenu       EndP
    629601
     
    683655      push    ax dx
    684656         call    TIMER_GetTicCount
    685          cmp     dx, wptr cs:[FloppyGetNameTimer+2]
     657         cmp     dx, wptr [FloppyGetNameTimer+2]
    686658         ja      BME_ExpiredGetFloppy
    687          cmp     ax, wptr cs:[FloppyGetNameTimer+0]
     659         cmp     ax, wptr [FloppyGetNameTimer+0]
    688660         jb      BME_NoFloppyNameExpired
    689661        BME_ExpiredGetFloppy:
     
    825797   add     ax, CFG_TimedDelay
    826798   adc     dx, 0
    827    mov     word ptr cs:[TimedTimeOut], ax
    828    mov     word ptr cs:[TimedTimeOut+2], dx
     799   mov     wptr [TimedTimeOut], ax
     800   mov     wptr [TimedTimeOut+2], dx
    829801   ret
    830802BOOTMENU_ResetTimedBoot         EndP
     
    835807   add     ax, 36                      ; 18*2 -> 2 seconds
    836808   adc     dx, 0
    837    mov     word ptr cs:[FloppyGetNameTimer], ax
    838    mov     word ptr cs:[FloppyGetNameTimer+2], dx
     809   mov     word ptr [FloppyGetNameTimer], ax
     810   mov     word ptr [FloppyGetNameTimer+2], dx
    839811   ret
    840812BOOTMENU_ResetGetFloppy         EndP
  • trunk/BOOTCODE/REGULAR/DRIVEIO.ASM

    r26 r29  
    1 
    2 ; Disclaimer:
    3 ;=============
    4 ; The sourcecode is released via www.netlabs.org CVS *ONLY*.
    5 ;  You MUST NOT upload it to other servers nor republish it in any way.
    6 The sourcecode is still COPYRIGHTED and NOT RELEASED UNDER GPL.
    7 It's (c) Copyright 1998-2003 by Martin Kiewitz.
    8 You may recompile the source and do *PRIVATE* modifications, but please keep
    9 ;  in mind that modifying this code needs at least *some* assembly skill. If
    10 ;  you mess up your system, because you needed to hack your way through, don't
    11 blame me. Releasing a customized version of AiR-BOOT, selling it in any form
    12 or reusing parts of this source is *PROHIBITED*. Ask me, if you have some
    13 idea about new functionality *before* developing the code, otherwise I will
    14 ;  definitely reject it. Also please accept, that I have some basic design
    15 ;  rules on AiR-BOOT and I will maintain them at all costs, so this won't get
    16 another GRUB.
    17 
     1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
     2;
     3; This file is part of AiR-BOOT
     4;
     5; AiR-BOOT is free software: you can redistribute it and/or modify it under
     6the terms of the GNU General Public License as published by the Free
     7Software Foundation, either version 3 of the License, or (at your option)
     8any later version.
     9;
     10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
     12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     13details.
     14;
     15; You should have received a copy of the GNU General Public License along with
     16AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
     17;
    1818;---------------------------------------------------------------------------
    1919;                                                      AiR-BOOT / DRIVE I/O
    2020;---------------------------------------------------------------------------
    2121
    22 ; Note: Some routines set DS/ES to CS, even if its not needed.
    23 ;        This was done for SECURITY. So DO NOT remove it. Its there to make
    24 ;        sure the correct data is loaded/written to/from harddrive.
    25 ;
    26 ;  IF YOU MODIFY ANYTHING IN HERE, YOU CAN EASILY BREAK YOUR HARDDRIVE!
     22; Note: Some routines set DS/ES to CS or even address via CS, even if its not
     23;        needed. This was done for SECURITY. So DO NOT remove it.
     24;        Its there to make sure the correct data is loaded/written to/from
     25;        harddrive.
     26;
     27;  IF YOU MODIFY ANYTHING IN HERE, YOU MAY EASILY BREAK YOUR HARDDRIVE!
    2728
    2829; Will only load base-configuration, will NOT load IPT nor Hide-Config
     
    124125;  Internal access (to AiR-BOOT) is always done via INT 13h/CHS.
    125126
     127DriveIO_GetHardDriveCount       Proc Near   Uses ds si
     128   push    ds si
     129      push    0040h
     130      pop     ds
     131      mov     si, 0075h
     132      mov     dh, ds:[si]                ; 40:75 -> POST: Total Harddiscs == DL
     133   pop     si ds
     134   mov     TotalHarddiscs, dh
     135   ret
     136DriveIO_GetHardDriveCount       EndP
     137
     138
     139; Fills our LBA-Usage table. It holds the LBA-address, where BIOS/CHS access is
     140;  stopped and BIOS/LBA access is started.
     141;  This is calculated by Sector*Heads. Comparing will get done with Bit 25-10
     142;  on LBA sectors, so we actually divide sector number by 1024.
     143DriveIO_InitLBASwitchTable      Proc Near   Uses es di
     144   mov     di, offset LBASwitchTable
     145   mov     dh, TotalHarddiscs
     146   mov     dl, 80h
     147  DIOILUT_DriveLoop:
     148      push    dx di
     149         mov     ah, 08h
     150         int     13h            ; DISK - GET DRIVE PARAMETERS
     151         mov     ah, 0FBh       ; Assume 255 heads/63 sectors, if error
     152         jc      DIOILUT_Error
     153         and     cl, 111111b    ; Isolate lower 6 bits of CL -> sector count
     154         movzx   ax, cl
     155         mov     bl, dh         ; DH -> head count
     156         mul     bl             ; AX = Sectors*Heads
     157         shl     ah, 1
     158         shl     ah, 1          ; Shift 2 bits, so we are able to compare to
     159                                ;  bit 16-23 of the LBA address
     160        DIOILUT_Error:
     161      pop     di dx
     162      mov     bptr ds:[di], ah  ; Save that value
     163      inc     di                ; Go to next BYTE
     164      inc     dl
     165   dec     dh
     166   jnz     DIOILUT_DriveLoop
     167   ret
     168DriveIO_InitLBASwitchTable      EndP
     169
     170; Adjusts BX:AX / CX:DX to meet LVM sector location
     171;  Destroys SI
     172DriveIO_LVMAdjustToInfoSector   Proc Near   Uses
     173   push    cx
     174      xor     ch, ch
     175      and     cl, 63                     ; Isolate lower bits, because upper
     176      mov     si, 63                     ;  ones may be used for cylinder
     177      sub     si, cx
     178   pop     cx
     179   add     ax, si
     180   adc     bx, 0                         ; Adjust LBA Sector (BX:AX)
     181   or      cl, 63                        ; Set Sector to 63
     182   ret
     183DriveIO_LVMAdjustToInfoSector   EndP
     184
    126185Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    127186 Routine: Loads partition to ExecBase and checks for validity
     
    132191 Preserve: all registers
    133192 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*
    134 DriveIO_LoadPartition           Proc Near  Uses ds si
    135    int 3
     193DriveIO_LoadPartition           Proc Near  Uses si
    136194   mov     wptr cs:[CurPartition_Location+0], ax
    137195   mov     wptr cs:[CurPartition_Location+2], bx
    138196   mov     wptr cs:[CurPartition_Location+4], dx
    139197   mov     wptr cs:[CurPartition_Location+6], cx ; Saves the location
    140    push    ExecBaseSeg
    141    pop     ds
    142    mov     si, ExecBasePtr               ; DS:SI - ExecBase
     198   mov     si, offset PartitionSector    ; DS:SI - ExecBase
    143199   call    DriveIO_LoadSector
    144200   clc
    145    cmp     word ptr ds:[si+LocBR_Magic], 0AA55h
     201   cmp     wptr [si+LocBR_Magic], 0AA55h
    146202   je      DIOLP_Success
    147203   ; We check, if we are scanning partitions. In that case, if CHS is not 0/0/1
     
    165221 Preserve: all registers
    166222 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*
    167 DriveIO_SavePartition           Proc Near  Uses ax bx cx dx ds si
     223DriveIO_SavePartition           Proc Near  Uses ax bx cx dx si
    168224   mov     ax, wptr cs:[CurPartition_Location+0]
    169225   mov     bx, wptr cs:[CurPartition_Location+2]
    170226   mov     dx, wptr cs:[CurPartition_Location+4]
    171227   mov     cx, wptr cs:[CurPartition_Location+6] ; Gets prev. saved location
    172    push    ExecBaseSeg
    173    pop     ds
    174    mov     si, ExecBasePtr               ; DS:SI - ExecBase
     228   mov     si, offset PartitionSector    ; DS:SI - ExecBase
     229   cmp     wptr [si+LocBR_Magic], 0AA55h ; Checks for signature, if not found
     230   jne     DIOSP_SevereError             ;  we assume a really bad error
    175231   call    DriveIO_SaveSector
     232  DIOSP_SevereError:
    176233   ret
    177234DriveIO_SavePartition           EndP
    178235
    179 ; L„sst DS:SI fr Aufrufer
     236; Keeps DS:SI for caller
    180237DriveIO_LoadTmpSector           Proc Near  Uses
    181    push    cs
    182    pop     ds
    183238   mov     si, offset TmpSector
    184239   call    DriveIO_LoadSector
     
    186241DriveIO_LoadTmpSector           EndP
    187242
    188 ; L„sst DS:SI fr Aufrufer
     243; Keeps DS:SI for caller
    189244DriveIO_SaveTmpSector           Proc Near  Uses
    190    push    cs
    191    pop     ds
    192245   mov     si, offset TmpSector
    193246   call    DriveIO_SaveSector
    194247   ret
    195248DriveIO_SaveTmpSector           EndP
     249
     250; Keeps DS:SI for caller, sets carry if valid LVM sector encountered
     251DriveIO_LoadLVMSector           Proc Near  Uses ax bx cx dx
     252   test    [CFG_IgnoreLVM], 1            ; We are supposed to ignore LVM, so
     253   jnz     DIOLLVMS_NoLVMSector          ;  don't load but declare as bad!
     254   mov     ax, wptr cs:[CurPartition_Location+0]
     255   mov     bx, wptr cs:[CurPartition_Location+2]
     256   mov     dx, wptr cs:[CurPartition_Location+4]
     257   mov     cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location
     258   call    DriveIO_LVMAdjustToInfoSector
     259   mov     si, offset LVMSector
     260   call    DriveIO_LoadSector
     261   call    LVM_CheckSectorSignature
     262   jnc     DIOLLVMS_NoLVMSector
     263   call    LVM_CheckSectorCRC
     264   jnc     DIOLLVMS_NoLVMSector
     265   ret
     266   ; This here is called, if an invalid (or no) LVM information sector is found
     267   ;  It will truncate the first byte of the sector, so all other routines
     268   ;  will notice it easily by just comparing the first byte.
     269  DIOLLVMS_NoLVMSector:
     270   mov     bptr [si+LocLVM_SignatureStart], 0
     271   ret
     272DriveIO_LoadLVMSector           EndP
     273
     274; Keeps DS:SI for caller, saves at anytime w/o checks (!)
     275DriveIO_SaveLVMSector           Proc Near  Uses ax bx cx dx
     276   test    [CFG_IgnoreLVM], 1            ; We are supposed to ignore LVM, so
     277   jnz     DIOSLVMS_SevereError          ;  don't save at anytime (security!)
     278   mov     ax, wptr cs:[CurPartition_Location+0]
     279   mov     bx, wptr cs:[CurPartition_Location+2]
     280   mov     dx, wptr cs:[CurPartition_Location+4]
     281   mov     cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location
     282   call    LVM_CheckSectorSignature
     283   jnc     DIOSLVMS_SevereError                  ; LVM Signature must be there
     284   call    DriveIO_LVMAdjustToInfoSector
     285   mov     si, offset LVMSector
     286   call    DriveIO_SaveSector
     287  DIOSLVMS_SevereError:
     288   ret
     289DriveIO_SaveLVMSector           EndP
    196290
    197291; Memory-Block that holds information for LBA-access via INT 13h
     
    206300;  so users will notice that something is bad with their partition table(s)
    207301DriveIO_GotLoadError            Proc Near
    208    test    cs:CurIO_Scanning, 1          ; Must be CS:, cause DS!=CS here
     302   test    cs:CurIO_Scanning, 1          ; Must be CS:, cause DS!=CS maybe here
    209303   jnz     InScanMode
    210304   jmp     MBR_LoadError
     
    213307   push    cs
    214308   pop     ds
     309   call    MBR_Teletype
     310   mov     si, offset BrokenHDD
     311   sub     dl, 50h                       ; 80h -> '0'
     312   cmp     dl, 39h
     313   jbe     DIOGLE_BelowA
     314   add     dl, 7                         ; 3Ah -> 'A'
     315  DIOGLE_BelowA:
     316   mov     bptr [si+5], dl
    215317   call    MBR_Teletype
    216318   jmp     MBRLE_Halt
     
    227329 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*
    228330DriveIO_LoadSector              Proc Near  Uses ax bx ds si es di
    229    test    cs:[CurIO_UseExtension], 1
    230    jz      DIOLS_UseNormal
    231    ; LBA-boundary >16450560 (FB0400h)
    232    cmp     bx, 00FBh
    233    jae     DIOLS_UseExtension
    234    ; or are we forced do use LBA?
    235    test    cs:[CFG_ForceLBAUsage], 1
    236    jnz     DIOLS_UseExtension
     331   test     cs:[CurIO_UseExtension], 1
     332   jz       DIOLS_UseNormal
     333   ; Are we forced do use LBA via Setting?
     334   test     cs:[CFG_ForceLBAUsage], 1
     335   jnz      DIOLS_UseExtension
     336   ; Is the drive not a harddrive?
     337   cmp      dl, 80h
     338   jb       DIOLS_UseNormal
     339   ; Upper 8 bits of LBA-address set? -> Use LBA (maximum boundary is FB0400h)
     340   or       bh, bh
     341   jnz      DIOLS_UseExtension
     342   ; Compare Switch-Table value to bit 16-23 of LBA-address
     343   mov      di, dx
     344   and      di, 007Fh
     345   cmp      bptr cs:[LBASwitchTable+di], bl
     346   jbe      DIOLS_UseExtension
    237347  DIOLS_UseNormal:
    238       mov     di, 3
     348      mov      di, 3
    239349     DIOLS_ErrorLoop:
    240          push    ds
    241          pop     es
    242          mov     bx, si                      ; ES:BX - Destination
    243          mov     ax, 0201h                   ; Function 2 - Load Sector
    244          int     13h
    245          jnc     DIOLS_Success
    246       dec     di
    247       jnz     DIOLS_ErrorLoop
     350         push     ds
     351         pop      es
     352         mov      bx, si                     ; ES:BX - Destination
     353         mov      ax, 0201h                  ; Function 2 - Load Sector
     354         int      13h
     355         jnc      DIOLS_Success
     356      dec      di
     357      jnz      DIOLS_ErrorLoop
    248358      ; Sector load failed...
    249       jmp     DriveIO_GotLoadError
     359      jmp      DriveIO_GotLoadError
    250360
    251361  DIOLS_UseExtension:
     
    260370      pop     ds
    261371      mov     si, offset DriveIO_DAP
    262       mov     ah, 42h                         ; Extended Read
     372      mov     ah, 42h                        ; Extended Read
    263373      int     13h
    264374   pop     cx
     
    281391 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*
    282392DriveIO_SaveSector              Proc Near  Uses ax bx cx ds si es di
    283    test    cs:[CurIO_UseExtension], 1
    284    jz      DIOSS_UseNormal
    285    ; LBA-boundary >16450560 (FB0400h)
    286    cmp     bx, 00FBh
    287    jae     DIOSS_UseExtension
    288    ; or are we forced do use LBA?
    289    test    cs:[CFG_ForceLBAUsage], 1
    290    jnz     DIOSS_UseExtension
     393   test     cs:[CurIO_UseExtension], 1
     394   jz       DIOSS_UseNormal
     395   ; Are we forced do use LBA via Setting?
     396   test     cs:[CFG_ForceLBAUsage], 1
     397   jnz      DIOSS_UseExtension
     398   ; Is the drive not a harddrive?
     399   cmp      dl, 80h
     400   jb       DIOSS_UseNormal
     401   ; Upper 8 bits of LBA-address set? -> Use LBA (maximum boundary is FB0400h)
     402   or       bh, bh
     403   jnz      DIOSS_UseExtension
     404   ; Compare Switch-Table value to bit 16-23 of LBA-address
     405   mov      di, dx
     406   and      di, 007Fh
     407   cmp      bptr cs:[LBASwitchTable+di], bl
     408   jbe      DIOSS_UseExtension
    291409  DIOSS_UseNormal:
    292       mov     di, 3
     410      mov      di, 3
    293411     DIOSS_ErrorLoop:
    294          push    ds
    295          pop     es
    296          mov     bx, si                      ; ES:BX - Destination
    297          mov     ax, 0301h                   ; Function 3 - Write Sector
    298          int     13h
    299          jnc     DIOSS_Success
    300       dec     di
    301       jnz     DIOSS_ErrorLoop
    302       call    MBR_SaveError
     412         push     ds
     413         pop      es
     414         mov      bx, si                     ; ES:BX - Destination
     415         mov      ax, 0301h                  ; Function 3 - Write Sector
     416         int      13h
     417         jnc      DIOSS_Success
     418      dec      di
     419      jnz      DIOSS_ErrorLoop
     420      call     MBR_SaveError
    303421
    304422  DIOSS_UseExtension:
  • trunk/BOOTCODE/REGULAR/OTHER.ASM

    r23 r29  
    1 
    2 ; Disclaimer:
    3 ;=============
    4 ; The sourcecode is released via www.netlabs.org CVS *ONLY*.
    5 ;  You MUST NOT upload it to other servers nor republish it in any way.
    6 The sourcecode is still COPYRIGHTED and NOT RELEASED UNDER GPL.
    7 It's (c) Copyright 1998-2003 by Martin Kiewitz.
    8 You may recompile the source and do *PRIVATE* modifications, but please keep
    9 ;  in mind that modifying this code needs at least *some* assembly skill. If
    10 ;  you mess up your system, because you needed to hack your way through, don't
    11 blame me. Releasing a customized version of AiR-BOOT, selling it in any form
    12 or reusing parts of this source is *PROHIBITED*. Ask me, if you have some
    13 idea about new functionality *before* developing the code, otherwise I will
    14 ;  definitely reject it. Also please accept, that I have some basic design
    15 ;  rules on AiR-BOOT and I will maintain them at all costs, so this won't get
    16 another GRUB.
    17 
     1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
     2;
     3; This file is part of AiR-BOOT
     4;
     5; AiR-BOOT is free software: you can redistribute it and/or modify it under
     6the terms of the GNU General Public License as published by the Free
     7Software Foundation, either version 3 of the License, or (at your option)
     8any later version.
     9;
     10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
     12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     13details.
     14;
     15; You should have received a copy of the GNU General Public License along with
     16AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
     17;
    1818;---------------------------------------------------------------------------
    1919;                                                 AiR-BOOT / OTHER ROUTINES
     
    8989   ; Calculate Cooper-Bar Tables
    9090   call    FX_CalculateTables
     91
     92   ; Calculate LVM-CRC-Table
     93   call    LVM_InitCRCTable
     94
     95   ; Get HardDriveCount
     96   call    DriveIO_GetHardDriveCount
     97
     98   ; Calculate CHS/LBA Switch Table
     99   call    DriveIO_InitLBASwitchTable
    91100
    92101   ; Setup PartitionPointers-Table
     
    140149   int     16h
    141150   mov     SETUP_KeysOnEntry, al
     151
     152   ; Copy device-name to the ContBIOSbootSeq-IPT entry
     153   ;  We may not do this before PRECRAP_CheckConfiguration, because otherwise
     154   ;  this check will fail.
     155   call    PART_UpdateResumeBIOSName
    142156   ret
    143157PRECRAP_Main                    EndP
  • trunk/BOOTCODE/REGULAR/PARTMAIN.ASM

    r23 r29  
    1 
    2 ; Disclaimer:
    3 ;=============
    4 ; The sourcecode is released via www.netlabs.org CVS *ONLY*.
    5 ;  You MUST NOT upload it to other servers nor republish it in any way.
    6 The sourcecode is still COPYRIGHTED and NOT RELEASED UNDER GPL.
    7 It's (c) Copyright 1998-2003 by Martin Kiewitz.
    8 You may recompile the source and do *PRIVATE* modifications, but please keep
    9 ;  in mind that modifying this code needs at least *some* assembly skill. If
    10 ;  you mess up your system, because you needed to hack your way through, don't
    11 blame me. Releasing a customized version of AiR-BOOT, selling it in any form
    12 or reusing parts of this source is *PROHIBITED*. Ask me, if you have some
    13 idea about new functionality *before* developing the code, otherwise I will
    14 ;  definitely reject it. Also please accept, that I have some basic design
    15 ;  rules on AiR-BOOT and I will maintain them at all costs, so this won't get
    16 another GRUB.
    17 
     1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
     2;
     3; This file is part of AiR-BOOT
     4;
     5; AiR-BOOT is free software: you can redistribute it and/or modify it under
     6the terms of the GNU General Public License as published by the Free
     7Software Foundation, either version 3 of the License, or (at your option)
     8any later version.
     9;
     10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
     12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     13details.
     14;
     15; You should have received a copy of the GNU General Public License along with
     16AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
     17;
    1818;---------------------------------------------------------------------------
    1919;                                     AiR-BOOT / PARTiTiON REGULAR ROUTINES
     
    2424   xor     bl, bl
    2525   mov     dl, CFG_PartDefault
    26    call    PART_FixUpPartitionNumber
     26   call    PART_FixUpSelectionNumber
    2727   mov     CFG_PartDefault, dl
    2828   mov     dl, CFG_PartLast
    29    call    PART_FixUpPartitionNumber
     29   call    PART_FixUpSelectionNumber
    3030   mov     CFG_PartLast, dl
    3131   mov     dl, CFG_PartAutomatic
    32    call    PART_FixUpPartitionNumber
     32   call    PART_FixUpSelectionNumber
    3333   mov     CFG_PartAutomatic, dl
    3434
    35    ; Fix-Up Linux Kernel Partition - If lost, search for FAT-16
    36    mov     bl, 06h
    37    mov     dl, CFG_LinuxKrnlPartition
    38    call    PART_FixUpPartitionNumber
    39    mov     CFG_LinuxKrnlPartition, dl
    40 
    41    ; Fix-Up Linux Root Partition - If lost, search for Linux partition (83h)
    42    mov     bl, 83h
    43    mov     dl, CFG_LinuxRootPartition
    44    call    PART_FixUpPartitionNumber
    45    mov     CFG_LinuxRootPartition, dl
     35; [Linux support removed since v1.02]
     36;   ; Fix-Up Linux Kernel Partition - If lost, search for FAT-16
     37;   mov     bl, 06h
     38;   mov     dl, CFG_LinuxKrnlPartition
     39;   call    PART_FixUpPartitionNumber
     40;   mov     CFG_LinuxKrnlPartition, dl
     41;
     42;   ; Fix-Up Linux Root Partition - If lost, search for Linux partition (83h)
     43;   mov     bl, 83h
     44;   mov     dl, CFG_LinuxRootPartition
     45;   call    PART_FixUpPartitionNumber
     46;   mov     CFG_LinuxRootPartition, dl
    4647   ret
    4748PART_FixUpDefaultPartitionValues EndP
     
    6263;            BL - Requested Partition ID
    6364;       Out: DL - New number of partition (guessed normally ;)
    64 PART_FixUpPartitionNumber       Proc Near Uses ax cx
    65    cmp     dl, 0FFh
    66    je      PFUPN_PartitionDisabled
     65PART_FixUpSelectionNumber       Proc Near Uses ax cx
     66   cmp     dl, 080h
     67   je      PFUPN_SelectionDisabled
     68   ja      PFUPN_SpecialSelection
    6769   call    PARTSCAN_GetXref              ; DL - PartitionNo prev IPT
    6870   cmp     dh, 0FFh                      ; DH -> Partition No in new IPT
    69    je      PFUPN_PartitionGone
    70   PFUPN_PartitionDisabled:
    71    ret
    72 
    73    ; Partition is not referenced in New-IPT, so dig for requested partition
    74   PFUPN_PartitionGone:
     71   je      PFUPN_SelectionGone
     72   mov     dl, dh
     73  PFUPN_SelectionDisabled:
     74   ret
     75
     76  PFUPN_SpecialSelection:
     77   cmp     dl, 0FEh                      ; Resume-BIOS?
     78   ja      PFUPN_SpecialSelectionFloppy
     79   cmp     CFG_ResumeBIOSbootSeq, 0
     80   je      PFUPN_SelectionGone
     81   jmp     PFUPN_Found
     82  PFUPN_SpecialSelectionFloppy:
     83   cmp     CFG_IncludeFloppy, 0
     84   je      PFUPN_SelectionGone
     85   jmp     PFUPN_Found
     86
     87   ; Partition is not referenced in New-IPT or Resume-BIOS/Floppy selected, but
     88   ;  actual media is disabled...so dig for requested partition
     89  PFUPN_SelectionGone:
    7590   mov     cl, CFG_Partitions
    7691   or      cl, cl
     
    94109  PFUPN_BootableSearchLoop:
    95110      call    PART_GetPartitionPointer   ; Gets SI for partition DL
    96       mov     al, cs:[si+LocIPT_Flags]
     111      mov     al, ds:[si+LocIPT_Flags]
    97112      and     al, Flags_BootAble
    98113      jnz     PFUPN_Found
     
    106121
    107122  PFUPN_NothingFound:
    108    mov     dl, 0FFh                      ; Now being Disabled
     123   mov     dl, 080h                      ; Now being Disabled
    109124  PFUPN_Found:
    110125   ret
    111 PART_FixUpPartitionNumber       EndP
     126PART_FixUpSelectionNumber       EndP
    112127
    113128; ============================================================================
    114 ;        In: CS:SI - IPT-Entry of partition
    115 ;            ExecBaseSeg:Ptr - Actual Boot-Record of partition
     129;        In: DS:SI - IPT-Entry of partition
     130;            DS:PartitionSector - Actual Boot-Record of partition
    116131;       Out: *none* (BootRecordCRD updated)
    117132PART_UpdateBootRecordCRC        Proc Near Uses bx
    118    push    ds si
    119       push    ExecBaseSeg
    120       pop     ds
    121       mov     si, offset ExecBasePtr
    122       mov     bx, 4B4Dh            ; Magic: 'MK'
    123       call    MBR_GetCheckOfSector
    124    pop     si ds
    125    mov     cs:[si+LocIPT_BootRecordCRC], bx
     133   mov     si, offset PartitionSector
     134   mov     bx, 4B4Dh            ; Magic: 'MK'
     135   call    MBR_GetCheckOfSector
     136   mov     [si+LocIPT_BootRecordCRC], bx
    126137   ret
    127138PART_UpdateBootRecordCRC        EndP
     139
     140; Copies the device-name to the Resume-BIOS IPT entry
     141PART_UpdateResumeBIOSName       Proc Near Uses ax bx cx si di
     142   movzx   bx, CFG_ResumeBIOSbootSeq
     143   dec     bx
     144   shl     bx, 1
     145   mov     si, wptr [ContinueBIOSbootTable+bx]
     146   mov     di, offset BIOScontIPTentry+LocIPT_Name
     147   push    di
     148      mov     cx, 11
     149      mov     al, ' '
     150      rep     stosb
     151   pop     di
     152  PURBN_BootDeviceCopyLoop:
     153      lodsb
     154      or      al, al
     155      jz      PURBN_NoResumeBootSeq
     156      stosb
     157      jmp     PURBN_BootDeviceCopyLoop
     158  PURBN_NoResumeBootSeq:
     159   ret
     160PART_UpdateResumeBIOSName       EndP
    128161
    129162; ============================================================================
     
    166199  PCMPP_NoResumeBootSeqInclude:
    167200
    168    ; Now include all Linux Kernels, if any available...
    169    movzx   cx, LINUX_KernelNo
    170    or      cx, cx
    171    jz      PCMPP_NoLinuxKernels
    172    mov     ax, offset LINUX_KernelEntries
    173   PCMPP_KernelLoop:
    174       mov     ds:[bx], ax
    175       add     bx, 2
    176       add     ax, LocIPT_LenOfIPT
    177    dec     cx
    178    jnz     PCMPP_KernelLoop
    179   PCMPP_NoLinuxKernels:
     201; [Linux support removed since v1.02]
     202;   ; Now include all Linux Kernels, if any available...
     203;   movzx   cx, LINUX_KernelNo
     204;   or      cx, cx
     205;   jz      PCMPP_NoLinuxKernels
     206;   mov     ax, offset LINUX_KernelEntries
     207;  PCMPP_KernelLoop:
     208;      mov     ds:[bx], ax
     209;      add     bx, 2
     210;      add     ax, LocIPT_LenOfIPT
     211;   dec     cx
     212;   jnz     PCMPP_KernelLoop
     213;  PCMPP_NoLinuxKernels:
    180214
    181215   movzx   cx, CFG_Partitions ; LocIPT_MaxPartitions
     
    201235; Gets a pointer to the given partition
    202236;        In: DL - Number of partition
    203 ;       Out: SI - Pointer to it (use CS)
     237;       Out: SI - Pointer to it
    204238PART_GetPartitionPointer        Proc Near   Uses bx
    205239   cmp     dl, 0FEh
     
    208242   movzx   bx, dl
    209243   shl     bx, 1
    210    mov     si, wptr cs:[PartitionPointers+bx]
     244   mov     si, wptr [PartitionPointers+bx]
    211245   ret
    212246  PGPP_IsBIOSbootSeq:
     
    250284   jb      PCTS_IsBIOSbootSeq
    251285   je      PCTS_IsFloppy
    252    cmp     ax, offset LINUX_KernelEntries
    253    jae     PCTS_IsKernelEntry
     286; [Linux support removed since v1.02]
     287;   cmp     ax, offset LINUX_KernelEntries
     288;   jae     PCTS_IsKernelEntry
    254289   sub     ax, offset PartitionTable
    255290   mov     bl, LocIPT_LenOfIPT
     
    257292   mov     dl, al
    258293   ret
    259   PCTS_IsKernelEntry:
    260    mov     dl, 0FDh
    261    ret
     294; [Linux support removed since v1.02]
     295;  PCTS_IsKernelEntry:
     296;   mov     dl, 0FDh
     297;   ret
    262298  PCTS_IsBIOSbootSeq:
    263299   mov     dl, 0FEh
     
    271307;       Out: DL - Number of partition in filtered view
    272308PART_ConvertFromStraight        Proc Near    Uses es di
     309   cmp     dl, 0FEh
     310   jb      PCFS_IsPartition
     311   mov     ax, offset BIOScontIPTentry
     312   je      PCFS_DoSearch
     313   mov     ax, offset FloppyIPTentry
     314   jmp     PCFS_DoSearch
     315  PCFS_IsPartition:
    273316   ; First we get Partition-Offset in AX
    274317   movzx   ax, dl
     
    276319   mul     bl
    277320   add     ax, offset PartitionTable
     321  PCFS_DoSearch:
    278322   ; Now search for this offset in our filtered Partition-Pointer-Table
    279323   push    cs
     
    297341; Destroyed: AX
    298342PART_GetSizeElementPointer      Proc Near   Uses bx
    299    cmp     ax, offset LINUX_KernelEntries
    300    jae     PGSEP_IsKernelEntry
     343; [Linux support removed since v1.02]
     344;   cmp     ax, offset LINUX_KernelEntries
     345;   jae     PGSEP_IsKernelEntry
    301346   mov     si, offset PartitionSizeTable
    302347   sub     ax, offset PartitionTable
    303    jmp     PGSEP_Continue
    304   PGSEP_IsKernelEntry:
    305    mov     si, offset LINUX_KernelSizeTable
    306    sub     ax, offset LINUX_KernelEntries
    307   PGSEP_Continue:
     348;   jmp     PGSEP_Continue
     349; [Linux support removed since v1.02]
     350;  PGSEP_IsKernelEntry:
     351;   mov     si, offset LINUX_KernelSizeTable
     352;   sub     ax, offset LINUX_KernelEntries
     353;  PGSEP_Continue:
    308354   mov     bl, LocIPT_LenOfIPT
    309355   div     bl                            ; Divide with IPTlength
     
    381427;              install MBR Protection, if wanted
    382428;              Special Boot Support, if needed (OS/2 Extended partitions)
     429;              Copy boot-sector to StartBase
    383430;              run boot sector...
    384431PART_StartPartition             Proc Near   Uses ax dx es di
     
    389436   call    PART_ConvertToStraight        ; ...we save straight view for later...
    390437   mov     BootPartNo, dl
     438   ; Straight - FFh -> Floppy boot
     439   ;            FEh -> BIOS continue (CD-ROM, ZIP, etc.)
    391440
    392441   ; We need straight pointers from now on, so calculate the table...
     
    397446
    398447   push    si
    399       mov     dl, cs:[si+LocIPT_Drive]
    400       mov     dh, cs:[si+LocIPT_SystemID]
     448      mov     dl, [si+LocIPT_Drive]
     449      mov     dh, [si+LocIPT_SystemID]
    401450      ; Copy Partition-Name to BootingNow area for display purposes
    402451         add     si, LocIPT_Name
     
    411460      mov     si, offset TXT_BootingNow1
    412461      call    MBR_Teletype
    413       cmp     dh, 0FDh
    414       je      PSP_IsKernel
     462; [Linux support removed since v1.02]
     463;      cmp     dh, 0FDh
     464;      je      PSP_IsKernel
    415465      or      dl, dl
    416466      jnz     PSP_IsHarddisc
     
    420470      jmp     PSP_IsFloppyCDROMetc
    421471
    422      PSP_IsKernel:
    423       IFDEF ReleaseCode
    424          ; Save configuration on HDD boots (save CFG_LinuxLastKernel)
    425          call    DriveIO_SaveConfiguration
    426       ENDIF
    427       call    MBR_Teletype       ; Prints out BootingNow2 including KernelName
    428       mov     si, offset TXT_BootingNowKernel
    429       call    MBR_Teletype
    430       jmp     PSP_IsFloppyCDROMetc
     472; [Linux support removed since v1.02]
     473;    PSP_IsKernel:
     474;      IFDEF ReleaseCode
     475;         ; Save configuration on HDD boots (save CFG_LinuxLastKernel)
     476;         call    DriveIO_SaveConfiguration
     477;      ENDIF
     478;      call    MBR_Teletype       ; Prints out BootingNow2 including KernelName
     479;      mov     si, offset TXT_BootingNowKernel
     480;      call    MBR_Teletype
     481;      jmp     PSP_IsFloppyCDROMetc
    431482
    432483     PSP_IsHarddisc:
     
    440491   pop     si                            ; restores SI (IPT-pointer)
    441492
    442    mov     ax, wptr cs:[si+LocIPT_AbsolutePartTable+0]
    443    mov     bx, wptr cs:[si+LocIPT_AbsolutePartTable+2]
    444    mov     cx, wptr cs:[si+LocIPT_LocationPartTable+1]
    445    mov     dh, bptr cs:[si+LocIPT_LocationPartTable+0]
    446    mov     dl, cs:[si+LocIPT_Drive]
     493   mov     ax, wptr [si+LocIPT_AbsolutePartTable+0]
     494   mov     bx, wptr [si+LocIPT_AbsolutePartTable+2]
     495   mov     cx, wptr [si+LocIPT_LocationPartTable+1]
     496   mov     dh, bptr [si+LocIPT_LocationPartTable+0]
     497   mov     dl, [si+LocIPT_Drive]
    447498   call    DriveIO_LoadPartition         ; Load Table...
    448499   ; --------------------------------------------------- MODIFY PARTITION TABLE
    449    push    ExecBaseSeg
     500   push    cs
    450501   pop     es
    451    mov     di, ExecBasePtr
    452    add     di, 446                ; DS:SI - Erster Partitionseintrag
     502   mov     di, offset PartitionSector+446 ; ES:DI - First Partitionentry
    453503
    454504   ; Remove all active-flags for safety reasons, primary partition table will
     
    464514
    465515   ; Put the partition-to-be-booted location into registers...
    466    mov     ax, wptr cs:[si+LocIPT_AbsoluteBegin+0]
    467    mov     bx, wptr cs:[si+LocIPT_AbsoluteBegin+2]
    468    sub     ax, wptr cs:[si+LocIPT_AbsolutePartTable+0]
    469    sbb     bx, wptr cs:[si+LocIPT_AbsolutePartTable+2]
     516   mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
     517   mov     bx, wptr [si+LocIPT_AbsoluteBegin+2]
     518   sub     ax, wptr [si+LocIPT_AbsolutePartTable+0]
     519   sbb     bx, wptr [si+LocIPT_AbsolutePartTable+2]
    470520   ; BX:AX - absolute position of partition relative to partition table
    471521   ; ...and search for it...
     
    478528     PSP_SearchMismatch:
    479529      add     di, LocBRPT_LenOfEntry     ; 16 Bytes per Partition-Entry
    480    cmp     di, 500+ExecBasePtr
     530   cmp     di, 500+offset PartitionSector
    481531   jb      PSP_SearchLoop
    482532   jmp     MBR_HaltSystem
     
    493543   ;  If yes, set magic bytes 'I13X' at 3000:0 for boot-loader to recognize.
    494544   ;  This method is (c) by IBM <g>
    495    mov     ax, wptr cs:[si+LocIPT_AbsoluteBegin+0]
    496    mov     bx, wptr cs:[si+LocIPT_AbsoluteBegin+2]
     545   mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
     546   mov     bx, wptr [si+LocIPT_AbsoluteBegin+2]
    497547   add     ax, wptr es:[di+LocBRPT_AbsoluteLength+0] ; Add length to absolute
    498548   adc     bx, wptr es:[di+LocBRPT_AbsoluteLength+2] ;  begin location
     
    515565
    516566   ; now check, if we need to hide any partition
    517    test    byte ptr cs:[si+LocIPT_Flags], Flags_HideFeature
     567   test    byte ptr [si+LocIPT_Flags], Flags_HideFeature
    518568   jz      PSP_NoHideFeature
    519569   ; --------------------------------------------------------- PARTITION HIDING
     
    532582      mov     cl, CFG_Partitions
    533583     PSP_PartitionsHideLoop:
    534          mov     dl, cs:[di]
     584         mov     dl, es:[di]
    535585         inc     di
    536586         cmp     dl, 0FFh
     
    543593      ; So something got hidden and we have to remark a primary partition,
    544594      ;  if we are booting something non-primary from 1st hdd.
    545       cmp     bptr ds:[si+LocIPT_Drive], 80h
     595      cmp     bptr [si+LocIPT_Drive], 80h
    546596      ja      PSP_HideAdjustPrimaryMark  ; When booting any hdd, but 1st
    547       mov     ax, wptr ds:[si+LocIPT_AbsolutePartTable]
    548       mov     bx, wptr ds:[si+LocIPT_AbsolutePartTable+2]
     597      mov     ax, wptr [si+LocIPT_AbsolutePartTable]
     598      mov     bx, wptr [si+LocIPT_AbsolutePartTable+2]
    549599      or      ax, ax
    550600      jnz     PSP_HideAdjustPrimaryMark  ; or booting non-primary partition
     
    565615
    566616  PSP_NoHideFeature:
     617   ; Check, if we are supposed to ignore LVM altogether...
     618   test    [CFG_IgnoreLVM], 1
     619   jnz     PSP_NoLVMReassignment
     620   ; --------------------------------------------------------- LVM REASSIGNMENT
     621      ; Driveletter must be set for this partition
     622      test    byte ptr [si+LocIPT_Flags], Flags_DriveLetter
     623      jz      PSP_NoLVMReassignment
     624      movzx   bx, BootPartNo             ; EntryNumber is straight view
     625      mov     al, bptr [DriveLetters+bx]
     626      sub     al, 3Dh                    ; Convert e.g. 80h -> 'C'
     627      cmp     al, bptr [PartitionVolumeLetters+bx]
     628      je      PSP_NoLVMReassignment      ; If driveletters match -> no change
     629      call    LVM_DoLetterReassignment   ; Give partition SI letter AL
     630  PSP_NoLVMReassignment:
    567631   push    si
    568632   ; ------------------------------------------------------- -"PLEASE WAIT..."-
     
    584648   ; -------------------------------------------------- SPECIAL BOOT PROCESSING
    585649   ; Check here, if the Boot shall be done via resume to BIOS...
    586    mov     al, bptr cs:[si+LocIPT_SystemID]
     650   mov     al, bptr [si+LocIPT_SystemID]
    587651   cmp     al, 0FEh                      ; Via BIOS ? (aka resume BIOS boot sequence)
    588652   je      PSP_ResumeBIOSbootSeq
    589    cmp     al, 0FDh                      ; Kernel-Booting ?
    590    je      PSP_KernelBooting
     653; [Linux support removed since v1.02]
     654;   cmp     al, 0FDh                      ; Kernel-Booting ?
     655;   je      PSP_KernelBooting
    591656   jmp     PSP_StartNormal
    592657
     
    597662   dw      0F000h
    598663
    599   PSP_KernelBooting:
    600    call    LINUX_LoadKernel              ; DS:SI - Entry Pointer to Kernel
    601    db      0EAh                          ; if return to here -> Reboot
    602    dw      0FFF0h
    603    dw      0F000h
    604 
    605    ; ==================================================================
    606    ;  FROM THIS POINT ON, ONLY *SI* REGISTER IS NEEDED TO BE PRESERVED
    607    ; ==================================================================
     664; [Linux support removed since v1.02]
     665;  PSP_KernelBooting:
     666;   call    LINUX_LoadKernel              ; DS:SI - Entry Pointer to Kernel
     667;   db      0EAh                          ; if return to here -> Reboot
     668;   dw      0FFF0h
     669;   dw      0F000h
     670
     671   ; =======================================================================
     672   ;  FROM THIS POINT ON, ONLY DS and SI REGISTER IS NEEDED TO BE PRESERVED
     673   ; =======================================================================
    608674
    609675  PSP_StartNormal:
    610    mov     ax, wptr cs:[si+LocIPT_AbsoluteBegin+0]
    611    mov     bx, wptr cs:[si+LocIPT_AbsoluteBegin+2]
    612    mov     cx, cs:[si+LocIPT_LocationBegin+1]
    613    mov     dh, cs:[si+LocIPT_LocationBegin+0]
    614    mov     dl, cs:[si+LocIPT_Drive]
     676   mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
     677   mov     bx, wptr [si+LocIPT_AbsoluteBegin+2]
     678   mov     cx, [si+LocIPT_LocationBegin+1]
     679   mov     dh, [si+LocIPT_LocationBegin+0]
     680   mov     dl, [si+LocIPT_Drive]
    615681   call    DriveIO_LoadPartition         ; Loads boot-sector...
    616682
    617683   test    CFG_DetectVIBR, 1
    618684   jz      PSP_NoVIBR
    619    test    byte ptr cs:[si+LocIPT_Flags], Flags_VIBR_Detection
     685   test    byte ptr [si+LocIPT_Flags], Flags_VIBR_Detection
    620686   jz      PSP_NoVIBR
    621687   ; ---------------------------------------------------------- CHECKS FOR VIBR
    622       push    ds si
    623          push    ExecBaseSeg
    624          pop     ds
    625          mov     si, offset ExecBasePtr
     688      push    si
     689         mov     si, offset PartitionSector
    626690         mov     bx, 4B4Dh               ; Magic: 'MK'
    627691         call    MBR_GetCheckOfSector
    628       pop     si ds
    629       cmp     cs:[si+LocIPT_BootRecordCRC], bx
     692      pop     si
     693      cmp     [si+LocIPT_BootRecordCRC], bx
    630694      je      PSP_NoVIBR
    631       mov     bx, cs:[si+LocIPT_BootRecordCRC]
     695      mov     bx, [si+LocIPT_BootRecordCRC]
    632696      or      bx, bx
    633697      jz      PSP_NoVIBR
     
    645709   jz      PSP_NoMBRprotect
    646710   ; -------------------------------------------------- INSTALLS MBR-PROTECTION
    647    push    si                            ; We need SI later...
     711   push    ds si                         ; We need DS:SI later...
    648712      ; First subtract 1024 bytes from Base-Memory...
    649713      push    ds
     
    658722      ; Now copy in our code (to DX:0)...
    659723
    660       mov     ax, cs
    661       mov     ds, ax
    662       mov     si, offset MBR_Protection   ; DS:SI - Source Image
     724      mov     si, offset MBR_Protection  ; DS:SI - Source Image
    663725      mov     es, dx
    664       xor     di, di                      ; ES:DI - Destination
     726      xor     di, di                     ; ES:DI - Destination
    665727      mov     cx, 512
    666       rep     movsw                       ; Move 1024 bytes...
     728      rep     movsw                      ; Move 1024 bytes...
    667729
    668730      ; Now fill in variables...
     
    671733      mov     ds, ax
    672734      mov     si, 10h*4
    673       xor     di, di                      ; INT 10h Vector to MBR Protection
     735      xor     di, di                     ; INT 10h Vector to MBR Protection
    674736      movsd
    675       mov     si, 13h*4                   ; INT 13h Vector to MBR Protection
     737      mov     si, 13h*4                  ; INT 13h Vector to MBR Protection
    676738      movsd
    677       mov     al, CFG_IgnoreWriteToMBR    ; Option to MBR Protection
     739      mov     al, CFG_IgnoreWriteToMBR   ; Option to MBR Protection
    678740      stosb
    679741
     
    683745      mov     ax, 9
    684746      mov     ds:[si], ax
    685       mov     ds:[si+2], dx               ; Vector hardcoded at DS:0009
     747      mov     ds:[si+2], dx              ; Vector hardcoded at DS:0009
    686748      ; MBR-Protection now active :)
    687    pop     si                          ; Restore SI
     749   pop     si ds                         ; Restore DS:SI
    688750
    689751   ; ------------------------------------------------ SPECIAL PARTITION SUPPORT
    690752   ; needed by OS/2 Warp / eComStation
    691753  PSP_NoMBRprotect:
    692    cmp     bptr cs:[si+LocIPT_SystemID], 08      ; I hate Microsuck NTFS check
     754   cmp     bptr [si+LocIPT_SystemID], 08 ; I hate Microsuck NTFS check
    693755   je      PSP_NoSpecialSupport
    694756
    695       push    ExecBaseSeg
    696       pop     es
    697       mov     di, ExecBasePtr            ; ES:DI - Actual Boot-Record
     757      mov     di, offset PartitionSector ; ES:DI - Actual Boot-Record
    698758      ; Special Support Detection
    699759      mov     ax, wptr es:[di+24]
     
    707767      jne     PSP_NoSpecialSupport
    708768      ; Special Support needed
    709       mov     al, bptr cs:[si+LocIPT_Drive]
     769      mov     al, bptr [si+LocIPT_Drive]
    710770      mov     bptr es:[di+36], al        ; Write Actual Drive-Letter
    711       mov     ax, cs:[si+LocIPT_AbsoluteBegin]
     771      mov     ax, [si+LocIPT_AbsoluteBegin]
    712772      mov     wptr es:[di+28], ax        ; Fixing Hidden Sectors count
    713       mov     ax, cs:[si+LocIPT_AbsoluteBegin+2]
     773      mov     ax, [si+LocIPT_AbsoluteBegin+2]
    714774      mov     wptr es:[di+30], ax        ; Done by OS/2 BootMan as well...
    715775
    716776   ; ------------------------------------------------ LOGICAL PARTITION SUPPORT
    717777  PSP_NoSpecialSupport:
    718    test    byte ptr cs:[si+LocIPT_Flags], Flags_DriveLetter
     778   test    byte ptr [si+LocIPT_Flags], Flags_DriveLetter
    719779   jz      PSP_NoLogicalSupport
    720780
    721781      movzx   bx, BootPartNo             ; EntryNumber is straight view
    722       mov     al, bptr cs:[DriveLetters+bx]
     782      mov     al, bptr [DriveLetters+bx]
    723783      mov     bptr es:[di+37], al        ; Write Drive Letter (OS/2 only)
    724784
     785   ; -------------------------------------------- COPY BOOT-RECORD TO STARTBASE
     786  PSP_NoLogicalSupport:
     787   push    si
     788      mov     ax, StartBaseSeg
     789      mov     es, ax
     790      mov     cx, 256
     791      mov     si, offset PartitionSector
     792      mov     di, StartBasePtr
     793      rep     movsw
     794   pop     si
    725795   ; ---------------------------------------------------- NOW START BOOT-RECORD
    726   PSP_NoLogicalSupport:
    727796   xor     ax, ax
    728797   xor     bx, bx
     
    732801   xor     dh, dh                        ; Drive supported by BIOS
    733802   mov     dl, cs:[si+LocIPT_Drive]      ; Drive Physical No
    734    db      0EAh                          ; JUMP TO Entry Point...Bye Bye
    735    dw      ExecBasePtr
    736    dw      ExecBaseSeg
     803   IFDEF ReleaseCode
     804      db      0EAh                          ; JUMP TO Entry Point...Bye Bye
     805      dw      StartBasePtr
     806      dw      StartBaseSeg
     807   ENDIF
    737808PART_StartPartition             EndP
    738809
     
    740811;        In: DL - Partition to hide
    741812; Destroyed: None
    742 PART_HidePartition              Proc Near   Uses ax bx cx dx si es di
     813PART_HidePartition              Proc Near   Uses ax bx cx dx si di
    743814   call    PART_GetPartitionPointer      ; Pointer to partition (DL) -> SI
    744815
    745816   ; First load the partition table of that partition...
    746    mov     ax, wptr cs:[si+LocIPT_AbsolutePartTable+0]
    747    mov     bx, wptr cs:[si+LocIPT_AbsolutePartTable+2]
    748    mov     cx, wptr cs:[si+LocIPT_LocationPartTable+1]
    749    mov     dh, bptr cs:[si+LocIPT_LocationPartTable+0]
    750    mov     dl, cs:[si+LocIPT_Drive]
     817   mov     ax, wptr [si+LocIPT_AbsolutePartTable+0]
     818   mov     bx, wptr [si+LocIPT_AbsolutePartTable+2]
     819   mov     cx, wptr [si+LocIPT_LocationPartTable+1]
     820   mov     dh, bptr [si+LocIPT_LocationPartTable+0]
     821   mov     dl, [si+LocIPT_Drive]
    751822   call    DriveIO_LoadPartition
    752823   ; Partition-Table now LOADED
    753    push    ExecBaseSeg
    754    pop     es
    755    mov     di, ExecBasePtr
    756    add     di, 446                       ; DS:SI - 1st partitionentry...
     824   mov     di, offset PartitionSector+446 ; ES:DI - 1st partitionentry...
    757825
    758826   ; Put our partition's location into registers...
    759    mov     ax, wptr cs:[si+LocIPT_AbsoluteBegin+0]
    760    mov     bx, wptr cs:[si+LocIPT_AbsoluteBegin+2]
    761    sub     ax, wptr cs:[si+LocIPT_AbsolutePartTable+0]
    762    sbb     bx, wptr cs:[si+LocIPT_AbsolutePartTable+2]
     827   mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
     828   mov     bx, wptr [si+LocIPT_AbsoluteBegin+2]
     829   sub     ax, wptr [si+LocIPT_AbsolutePartTable+0]
     830   sbb     bx, wptr [si+LocIPT_AbsolutePartTable+2]
    763831   ; BX:AX - absolute position of partition relative to partition table
    764832   ; ...and search for it...
     
    771839     PHP_SearchMismatch:
    772840      add     di, LocBRPT_LenOfEntry     ; 16 Bytes per partition entry
    773    cmp     di, 500+ExecBasePtr
     841   cmp     di, 500+offset PartitionSector
    774842   jb      PHP_SearchLoop
    775843   jmp     MBR_HaltSystem                ; not found, something is wrong here
     
    792860;  *not* the BIOS. This one *could* cause havoc to some systems, but I can't
    793861;  do anything else.
    794 ; =In this routine DS may not be equal CS=
    795 PART_MarkFirstGoodPrimary       Proc Near   Uses ax si es di
    796    push    ExecBaseSeg
    797    pop     es
    798    mov     di, ExecBasePtr
    799    add     di, 446                       ; DS:SI - First Partition-Entry
     862PART_MarkFirstGoodPrimary       Proc Near   Uses ax si di
     863   mov     di, offset PartitionSector+446 ; DS:SI - 1st partitionentry
    800864   ; First action to do: Remove the active flag from every partition
    801865   push    di
     
    827891     PMPP_Search1NoHit:
    828892      add     di, LocBRPT_LenOfEntry     ; 16 Bytes per Partition-Entry
    829    cmp     di, 500+ExecBasePtr
     893   cmp     di, 500+offset PartitionSector
    830894   jb      PMPP_Search1Loop
    831895
    832    mov     di, ExecBasePtr
    833    add     di, 446                       ; DS:SI - First Partition-Entry
     896   mov     di, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry
    834897   ; Second Search, hit on anything that is not an extended partition
    835898   ;  (05 or 0Fh)
     
    844907     PMPP_Search2NoHit:
    845908      add     di, LocBRPT_LenOfEntry     ; 16 Bytes per Partition-Entry
    846    cmp     di, 500+ExecBasePtr
     909   cmp     di, 500+offset PartitionSector
    847910   jb      PMPP_Search2Loop
    848911   jmp     PMPP_SearchFailed
     
    859922;            SI - Pointer to Name (8char)
    860923; Destroyed: *none*
    861 PART_SearchFileSysName          Proc Near  Uses ds bx dx
     924PART_SearchFileSysName          Proc Near  Uses bx dx
    862925   movzx   bx, al
    863    push    cs
    864    pop     ds
    865926   mov     si, offset FileSysIDs
    866927  PSFSN_SearchLoop:
     
    892953;        In: AL - FileSysID
    893954;       Out: AL - Hidden File-System-ID
    894 PART_SearchFileSysHiddenID      Proc Near  Uses ds bx
     955PART_SearchFileSysHiddenID      Proc Near  Uses bx
    895956   movzx   bx, al
    896    push    cs
    897    pop     ds
    898957   mov     si, offset FileSysIDs
    899958  PSFSHI_SearchLoop:
  • trunk/BOOTCODE/REGULAR/PARTSCAN.ASM

    r26 r29  
    1 
    2 ; Disclaimer:
    3 ;=============
    4 ; The sourcecode is released via www.netlabs.org CVS *ONLY*.
    5 ;  You MUST NOT upload it to other servers nor republish it in any way.
    6 The sourcecode is still COPYRIGHTED and NOT RELEASED UNDER GPL.
    7 It's (c) Copyright 1998-2003 by Martin Kiewitz.
    8 You may recompile the source and do *PRIVATE* modifications, but please keep
    9 ;  in mind that modifying this code needs at least *some* assembly skill. If
    10 ;  you mess up your system, because you needed to hack your way through, don't
    11 blame me. Releasing a customized version of AiR-BOOT, selling it in any form
    12 or reusing parts of this source is *PROHIBITED*. Ask me, if you have some
    13 idea about new functionality *before* developing the code, otherwise I will
    14 ;  definitely reject it. Also please accept, that I have some basic design
    15 ;  rules on AiR-BOOT and I will maintain them at all costs, so this won't get
    16 another GRUB.
    17 
     1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
     2;
     3; This file is part of AiR-BOOT
     4;
     5; AiR-BOOT is free software: you can redistribute it and/or modify it under
     6the terms of the GNU General Public License as published by the Free
     7Software Foundation, either version 3 of the License, or (at your option)
     8any later version.
     9;
     10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
     12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     13details.
     14;
     15; You should have received a copy of the GNU General Public License along with
     16AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
     17;
    1818;---------------------------------------------------------------------------
    1919;                                             AiR-BOOT / PARTiTiON SCANNING
    2020;---------------------------------------------------------------------------
    2121
    22 ; Note: This is complex code. Also some of these functions have DS != CS, so
    23 ;        make sure that you know what you are doing in here.
     22; Note: This is complex code. So make sure that you know what you are doing in
     23;        here.
    2424
    2525PARTSCAN_ScanForPartitions      Proc Near  Uses
     
    2727   call    PARTSCAN_ResetXref
    2828
    29    push    ds si
    30       push    0040h
    31       pop     ds
    32       mov     si, 0075h
    33       mov     dh, ds:[si]                ; 40:75 -> POST: Total Harddiscs == DL
    34    pop     si ds
    35    mov     TotalHarddiscs, dh
     29   mov     dh, TotalHarddiscs
    3630   xor     al, al
    3731   mov     NewPartitions, al
     
    6761   rep     movsw
    6862
    69    ; Search for any Linux partition and remember, if it got found...
    70    mov     si, offset PartitionTable
    71    movzx   cx, CFG_Partitions
    72    xor     dl, dl                        ; DL - Is Linux here ?
    73    or      cx, cx
    74    jz      PSSFP_NoPartitions
    75   PSSFP_LinuxLoop:
    76       cmp     bptr [si+LocIPT_SystemID], 083h  ; Hard-Coded
    77       jne     PSSFP_NoLinux
    78       mov     dl, 1                      ; Linux found...
    79      PSSFP_NoLinux:
    80       add     si, LocIPT_LenOfIPT
    81    loop    PSSFP_LinuxLoop
    82   PSSFP_NoPartitions:
    83    mov     GotLinux, dl                  ; Set Flag
     63; [Linux support removed since v1.02]
     64;   ; Search for any Linux partition and remember, if it got found...
     65;   mov     si, offset PartitionTable
     66;   movzx   cx, CFG_Partitions
     67;   xor     dl, dl                        ; DL - Is Linux here ?
     68;   or      cx, cx
     69;   jz      PSSFP_NoPartitions
     70;  PSSFP_LinuxLoop:
     71;      cmp     bptr [si+LocIPT_SystemID], 083h  ; Hard-Coded
     72;      jne     PSSFP_NoLinux
     73;      mov     dl, 1                      ; Linux found...
     74;     PSSFP_NoLinux:
     75;      add     si, LocIPT_LenOfIPT
     76;   loop    PSSFP_LinuxLoop
     77;  PSSFP_NoPartitions:
     78;   mov     GotLinux, dl                  ; Set Flag
    8479
    8580   ; ...and finally check, if we need to set a Drive-Letter
     
    125120   call    DriveIO_LoadPartition
    126121   jc      PSSDFP_InvalidPartition
     122   ; LVM Support - Reads LVM Information Sector
     123   call    DriveIO_LoadLVMSector
    127124   call    PARTSCAN_ScanPartition
    128125   IFDEF ReleaseCode
     
    135132PARTSCAN_ScanDriveForPartitions EndP
    136133
     134; Scans Current Partition for Extended Partitions, if found, AX,BX,CX,DX will
     135; be set to this location and Carry will be set
     136PARTSCAN_ScanPartitionForExtended Proc Near  Uses si
     137   mov     si, offset PartitionSector+446 ; DS:SI - 1st partition entry
     138   xor     ax, ax
     139  PSSPFE_ScanLoop:
     140      mov     al, [si+LocBRPT_SystemID]
     141      cmp     al, 5                      ; Is Partition EXTENDED ?
     142      je      PSSPFE_ExtendedPartition
     143      cmp     al, 0Fh                    ; Is Partition EXTENDED (M$) ?
     144      je      PSSPFE_ExtendedPartition
     145      jmp     PSSPFE_IgnorePartition
     146     PSSPFE_ExtendedPartition:
     147      mov     ax, wptr [si+LocBRPT_RelativeBegin]
     148      mov     bx, wptr [si+LocBRPT_RelativeBegin+2]
     149      add     ax, wptr [ExtendedAbsPos+0] ; Adjust...
     150      adc     bx, wptr [ExtendedAbsPos+2] ; (Shit Design!)
     151      test    [ExtendedAbsPosSet], 1
     152      jnz     PSSPFE_ExtendedMainKnown
     153      mov     wptr [ExtendedAbsPos+0], ax
     154      mov     wptr [ExtendedAbsPos+2], bx
     155      mov     [ExtendedAbsPosSet], 1
     156     PSSPFE_ExtendedMainKnown:
     157      mov     cx, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector
     158      mov     dh, bptr [si+LocBRPT_BeginHead]   ; Head
     159      mov     dl, bptr [CurPartition_Location+4] ; Drive
     160      stc
     161      jmp     PSSPFE_EndOfSearch
     162     PSSPFE_IgnorePartition:
     163      add     si, LocBRPT_LenOfEntry
     164   cmp     si, 500+offset PartitionSector
     165   jb      PSSPFE_ScanLoop
     166   clc
     167  PSSPFE_EndOfSearch:
     168   ret
     169PARTSCAN_ScanPartitionForExtended EndP
     170
    137171; The following routines have NOT *DS* set to CS, so we must address via ES
    138 PARTSCAN_ScanPartition          Proc Near  Uses ax ds si
    139    push    ExecBaseSeg
    140    pop     ds
    141    mov     si, ExecBasePtr
    142    add     si, 446                       ; DS:SI - First Partition-Entry
     172PARTSCAN_ScanPartition          Proc Near  Uses ax si
     173   mov     si, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry
    143174  PSSP_ScanLoop:
    144       mov     al, bptr ds:[si+LocBRPT_SystemID]
     175      mov     al, bptr [si+LocBRPT_SystemID]
    145176      cmp     al, 5                      ; Is Partition EXTENDED ?
    146177      je      PSSP_IgnorePartition
     
    149180      cmp     al, 0                      ; Is Partition EMPTY ?
    150181      je      PSSP_IgnorePartition
    151       ; Ignore this Partitions, because there are no real Partitions
     182      ; Ignore these partitions, because there are no real Partitions
    152183      call    PARTSCAN_CheckThisPartition
    153184     PSSP_IgnorePartition:
    154185      ; L”scht das Boot-Able Flag...
    155       and     byte ptr ds:[si+LocBRPT_Flags], 7Fh ; Reset the Active-Flag
     186      and     byte ptr [si+LocBRPT_Flags], 7Fh ; Reset the Active-Flag
    156187      add     si, LocBRPT_LenOfEntry     ; 16 Bytes per partition entry
    157    cmp     si, 500+ExecBasePtr
     188   cmp     si, 500+offset PartitionSector
    158189   jb      PSSP_ScanLoop
    159190   ; If we are on first HDD and in primary partition table -> mark primary
    160    cmp     bptr es:[CurPartition_Location+4], 80h ; Drive
     191   cmp     bptr [CurPartition_Location+4], 80h ; Drive
    161192   jne     PSSP_NoMarkPrimary
    162    cmp     wptr es:[CurPartition_Location+0], 0
     193   cmp     wptr [CurPartition_Location+0], 0
    163194   jne     PSSP_NoMarkPrimary
    164    cmp     wptr es:[CurPartition_Location+2], 0 ; Absolute Location
     195   cmp     wptr [CurPartition_Location+2], 0 ; Absolute Location
    165196   jne     PSSP_NoMarkPrimary
    166197   call    PART_MarkFirstGoodPrimary
     
    175206; the old table, otherwise they are generated freshly.
    176207; Will also fill out PartitionXref to sync HideConfig later
    177 ;        In: DS:SI - Partition-Entry (16-Bytes)
    178 ;            ES    - is CS
    179 ;             (DS is *NOT* CS here)
    180 PARTSCAN_CheckThisPartition     Proc Near  Uses di ds si
     208;        In: SI - Points to Partition-Entry (16-Bytes)
     209PARTSCAN_CheckThisPartition     Proc Near  Uses di si
    181210   local   PartSystemID:byte, PartTypeFlags:byte
    182    local   PartCRC:word, PartPtr:dword
    183 
    184    mov     ax, ds
    185    mov     wptr [PartPtr+2], ax          ; ...
    186    mov     wptr [PartPtr+0], si          ; Save Pointer to PartitionEntry
    187 
    188    mov     al, bptr ds:[si+LocBRPT_SystemID]
     211   local   PartCRC:word, PartPtr:word
     212
     213   mov     wptr [PartPtr], si          ; Save Pointer to PartitionEntry
     214
     215   mov     al, bptr [si+LocBRPT_SystemID]
    189216   mov     PartSystemID, al
    190217
    191    mov     cx, wptr ds:[si+LocBRPT_BeginSector] ; Cylinder/Sector
    192    mov     dh, bptr ds:[si+LocBRPT_BeginHead] ; Head
    193    mov     dl, bptr es:[CurPartition_Location+4] ; Drive
    194    mov     ax, wptr ds:[si+LocBRPT_RelativeBegin] ; Absolute Sector
    195    mov     bx, wptr ds:[si+LocBRPT_RelativeBegin+2]
    196    add     ax, wptr es:[CurPartition_Location+0] ; +Partition-Absolute
    197    adc     bx, wptr es:[CurPartition_Location+2] ;  sectors
     218   mov     cx, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector
     219   mov     dh, bptr [si+LocBRPT_BeginHead] ; Head
     220   mov     dl, bptr [CurPartition_Location+4] ; Drive
     221   mov     ax, wptr [si+LocBRPT_RelativeBegin] ; Absolute Sector
     222   mov     bx, wptr [si+LocBRPT_RelativeBegin+2]
     223   add     ax, wptr [CurPartition_Location+0] ; +Partition-Absolute
     224   adc     bx, wptr [CurPartition_Location+2] ;  sectors
    198225   call    DriveIO_LoadTmpSector         ; Loads Boot record
    199226   ; Sets up DS:SI - TmpSector
     
    218245   ; SI - Boot-Record of Partition
    219246   ; DI - File System Name
    220    ; DS==CS here
    221247   ;================================
    222248
     249   cmp     PartSystemID, 07h          ; We got IFS here?
     250   jne     PCCTP_IFSdone
     251   ; Check, if 'JFS ' is at DWORD offset 36h
     252   cmp     wptr [si+36h], 'FJ'
     253   jne     PCCTP_IFSnoJFS
     254   cmp     wptr [si+38h], ' S'
     255   jne     PCCTP_IFSnoJFS
     256   mov     PartSystemID, 0FCh         ; FC is JFS internally
     257   jmp     PCCTP_IFSdone
     258  PCCTP_IFSnoJFS:
     259   ; Check, if 'HPFS' is at DWORD offset 36h
     260   cmp     wptr [si+36h], 'PH'
     261   jne     PCCTP_ProbablyNTFS
     262   cmp     wptr [si+38h], 'SF'
     263   je      PCCTP_IFSdone              ; 07 is HPFS internally
     264  PCCTP_ProbablyNTFS:
     265   inc     PartSystemID               ; 08 is NTFS instead of 07
     266  PCCTP_IFSdone:
     267
     268   ; First check, if LVM Information Sector is available and this partition
     269   ;  is supported.
     270   push    ax dx si di
     271      mov     si, wptr [PartPtr]
     272      mov     ax, wptr [si+LocBRPT_RelativeBegin] ; Absolute Sector
     273      mov     dx, wptr [si+LocBRPT_RelativeBegin+2]
     274      add     ax, wptr [CurPartition_Location+0] ; +Partition-Absolute
     275      adc     dx, wptr [CurPartition_Location+2] ;  sectors
     276      mov     si, offset LVMSector
     277      call    LVM_SearchForPartition     ; Search for DX:AX partition
     278      jnc     PCCTP_CheckBootRecord
     279      ; Check, if volume has driveletter assigned and remember it for later
     280      mov     al, [si+LocLVM_VolumeLetter]
     281      or      al, al
     282      jnz     PCCTP_HasVolumeLetter
     283      mov     al, 1                      ; 0 would mean "not LVM supported"
     284     PCCTP_HasVolumeLetter:
     285      ; Save VolumeLetter in separate table
     286      movzx   bx, NewPartitions          ; NewPartitions is one behind here, so
     287      mov     [PartitionVolumeLetters+bx], al ; it's already a zero-based offset
     288      ; Now copy VolumeID and VolumeName to temporary space
     289      mov     di, offset MBR_NoName_Patched
     290      mov     ax, [si+LocLVM_PartitionID]
     291      stosw
     292      mov     ax, [si+LocLVM_PartitionID+2]
     293      stosw                              ; Set Serial-Field to LVM-VolumeID
     294      add     si, LocLVM_PartitionName
     295      mov     cx, 5
     296      rep     movsw                      ; Copy LVM-PartitionName to Temp Space
     297      movsb                              ;  (11 bytes in total)
     298   pop     di si dx ax
     299   mov     si, offset MBR_NoName_Patched
     300   xor     ah, ah                        ; no Flags_NoPartName
     301   jmp     PCCTP_NameSearchInIPT
     302
     303     PCCTP_CheckBootRecord:
     304   pop     di si dx ax
    223305   test    ah, FileSysFlags_NoName       ; No-Name-Flag ? -> No Partition Name
    224306   jnz     PCCTP_ThereIsNoName           ;                    available
    225       cmp     PartSystemID, 07h          ; We got IFS here?
    226       jne     PCCTP_NotNTFS
    227       ; Check, if 'HPFS' is at DWORD offset 36h
    228       cmp     wptr ds:[si+36h], 'PH'
    229       jne     PCCTP_SeemsNTFS
    230       cmp     wptr ds:[si+38h], 'SF'
    231       je      PCCTP_NotNTFS
    232      PCCTP_SeemsNTFS:
    233       inc     PartSystemID
    234       jmp     PCCTP_ThereIsNoName
    235      PCCTP_NotNTFS:
     307      ; We check for NTFS (got detected a little bit earlier in this routine)
     308      cmp     PartSystemID, 08h          ; We got IFS/NTFS here?
     309      jne     PCCTP_IsNoNTFS
     310      jmp     PCCTP_ThereIsNoName        ; NTFS has no volume label
     311     PCCTP_IsNoNTFS:
     312      add     si, 2Bh                    ; DS:SI - Partition-Name
    236313      test    ah, FileSysFlags_FAT32     ; FAT32 specific name getting ?
    237314      jz      PCCTP_ResumeNormal
    238315      add     si, 1Ch                    ; Fix for FAT 32, shiat
    239316     PCCTP_ResumeNormal:
    240       add     si, 2Bh                    ; DS:SI - Partition-Name
    241317      mov     cx, 11                     ;         11 bytes length
    242318      call    PART_CheckForValidPartName
    243319      jnc     PCCTP_ThereIsNoName
    244 ;      jnc     PCCTP_SetNameToNoName
    245320      sub     si, 4                      ; DS:SI -> Serial&Name (15-Bytes)
    246321      xor     ah, ah                     ; no Flags_NoPartName
    247       jmp     PCCTP_NameSearchInIPT
    248 
    249 ; WAS: NTFS/HPFS detection problem
    250 ;     PCCTP_SetNameToNoName:
    251 ;      cmp     PartSystemID, 07h          ; We got HPFS that failed ?
    252 ;      jne     PCCTP_NotHPFS              ; -> is NTFS (internal type 08h)
    253 ;      inc     PartSystemID               ; All that fails is Microsoft <bg>
    254 ;     PCCTP_NotHPFS:
    255 ;      jmp     PCCTP_ThereIsNoName
     322;      jmp     PCCTP_NameSearchInIPT
    256323
    257324      ;=======================================================
     
    263330      xor     ah, ah                     ; no Flags_NoPartName cause PartName valid
    264331      mov     di, offset PartitionTable  ; ES:DI - IPT-Start
    265       mov     dl, es:CFG_Partitions
     332      mov     dl, CFG_Partitions
    266333      or      dl, dl
    267       jz      PCCTP_NameCompFailed
     334      jnz     PCCTP_SerialNameCompLoop
     335      jmp     PCCTP_CompareFailed
    268336     PCCTP_SerialNameCompLoop:
    269          mov     al, es:[di+LocIPT_Flags]
     337         mov     al, [di+LocIPT_Flags]
    270338         test    al, Flags_NowFound
    271339         jnz     PCCTP_SerialNameAlreadyFound
     
    285353      mov     dl, CFG_Partitions
    286354     PCCTP_NameCompLoop:
    287          mov     al, es:[di+LocIPT_Flags]
     355         mov     al, [di+LocIPT_Flags]
    288356         test    al, Flags_NowFound
    289357         jnz     PCCTP_NameAlreadyFound
     
    296364         pop     di si
    297365         jne     PCCTP_NameNoMatch
    298          mov     cx, ds:[si+0]           ; Get Serial
    299          mov     es:[di+0], cx
    300          mov     cx, ds:[si+2]
    301          mov     es:[di+2], cx           ; ...and put it into IPT
     366         mov     cx, [si+0]           ; Get Serial
     367         mov     [di+0], cx
     368         mov     cx, [si+2]
     369         mov     [di+2], cx           ; ...and put it into IPT
    302370         jmp     PCCTP_Match
    303371        PCCTP_NameNoMatch:
     
    307375      jnz     PCCTP_NameCompLoop
    308376     PCCTP_NameCompFailed:
     377
     378      ; So finally we search for Location and PartitionID
     379      push    si
     380         ; Initialize some stuff for Location-Search
     381         mov     dh, PartSystemID
     382         mov     si, [PartPtr]           ; DS:SI - Cur Partition Table
     383         ; Relative Sector to MBR/EPR
     384         mov     cx, wptr [si+LocBRPT_RelativeBegin]
     385         mov     bx, wptr [si+LocBRPT_RelativeBegin+2]
     386         add     cx, [CurPartition_Location+0]
     387         add     bx, [CurPartition_Location+2]
     388         ; BX:CX - Absolute First Sector of Partition on HDD
     389      pop     si
     390      mov     di, offset PartitionTable  ; ES:DI - IPT-Start
     391      mov     dl, CFG_Partitions
     392     PCCTP_NameLocCompLoop:
     393         mov     al, [di+LocIPT_Flags]
     394         test    al, Flags_NowFound
     395         jnz     PCCTP_NameLocAlreadyFound
     396         ; Now compare IPT with current Partition
     397         cmp     dh, [di+LocIPT_SystemID]
     398         jne     PCCTP_NameLocMismatch
     399         cmp     cx, [di+LocIPT_AbsoluteBegin]
     400         jne     PCCTP_NameLocMismatch
     401         cmp     bx, [di+LocIPT_AbsoluteBegin+2]
     402         jne     PCCTP_NameLocMismatch
     403         ; We matched location, now copy the current PartitionID and Name to
     404         ;  the old IPT.
     405         push    di
     406            add     di, LocIPT_Serial    ; DS:SI - LocIPT-Serial&Name
     407            mov     cx, 15
     408            rep     movsb                ; Copy 15 bytes
     409         pop     di
     410         jmp     PCCTP_Match
     411        PCCTP_NameLocMismatch:
     412        PCCTP_NameLocAlreadyFound:
     413         add     di, LocIPT_LenOfIPT
     414      dec     dl
     415      jnz     PCCTP_NameLocCompLoop
     416      ; None of the searches worked, so forget it...
    309417      jmp     PCCTP_CompareFailed
    310418
    311419  PCCTP_ThereIsNoName:
    312       ; First, try to find this partition by comparing location and PartitionID
     420      ; Try to find this partition by comparing location and PartitionID
    313421      ;  aka LocIPT_AbsoluteBegin:dword and LocIPT_SystemID
    314422      ; If found, simply go to the normal match-routine, otherwise use the
    315423      ;  File-System-Name to build the Volume-Label for the New IPT Entry.
    316424      mov     dh, PartSystemID
    317       push    ds
    318          lds     si, dptr PartPtr        ; DS:SI - Cur Partition Entry
    319          ; Relative Sector to MBR/EPR
    320          mov     cx, wptr ds:[si+LocBRPT_RelativeBegin]
    321          mov     bx, wptr ds:[si+LocBRPT_RelativeBegin+2]
    322          add     cx, cs:[CurPartition_Location+0]
    323          add     bx, cs:[CurPartition_Location+2]
    324          ; BX:CX - Absolute First Sector of Partition on HDD
    325       pop     ds
     425      mov     si, [PartPtr]           ; DS:SI - Cur Partition Table
     426      ; Relative Sector to MBR/EPR
     427      mov     cx, wptr [si+LocBRPT_RelativeBegin]
     428      mov     bx, wptr [si+LocBRPT_RelativeBegin+2]
     429      add     cx, [CurPartition_Location+0]
     430      add     bx, [CurPartition_Location+2]
    326431      ; Build a standard-Volume Label from FileSystemNamePtr
    327432      ;  We have to call SearchFileSysName again because of NTFS
     
    330435         call    PART_SearchFileSysName   ; We want SI here <- FileSystemNamePtr
    331436         mov     di, offset MBR_NoName_Patched
    332          add     di, 4                   ; Skip Serial-Field
    333          mov     cx, 8
    334          rep     movsb                   ; Copy FileSystemName to Temp Space
     437         xor     ax, ax
     438         stosw
     439         stosw                           ; Set Serial-Field to "NUL"
     440         mov     cx, 4
     441         rep     movsw                   ; Copy FileSystemName to Temp Space
     442         xor     ax, ax
     443         stosw
     444         stosb                           ; Fill last 3 bytes with "NUL"
    335445         mov     si, offset MBR_NoName_Patched
    336446      pop     cx ax
     
    345455      mov     ah, Flags_NoPartName       ;set Flags_NoPartName, PartName invalid
    346456      mov     di, offset PartitionTable  ; ES:DI - IPT-Start
    347       mov     dl, es:CFG_Partitions
     457      mov     dl, CFG_Partitions
    348458      or      dl, dl
    349459      jz      PCCTP_LocCompFailed
    350460     PCCTP_LocCompLoop:
    351          mov     al, es:[di+LocIPT_Flags]
     461         mov     al, [di+LocIPT_Flags]
    352462         test    al, Flags_NowFound
    353463         jnz     PCCTP_LocAlreadyFound
    354464         ; Now compare IPT with current Partition
    355          cmp     dh, es:[di+LocIPT_SystemID]
     465         cmp     dh, [di+LocIPT_SystemID]
    356466         jne     PCCTP_LocMismatch
    357          cmp     cx, es:[di+LocIPT_AbsoluteBegin]
     467         cmp     cx, [di+LocIPT_AbsoluteBegin]
    358468         jne     PCCTP_LocMismatch
    359          cmp     bx, es:[di+LocIPT_AbsoluteBegin+2]
     469         cmp     bx, [di+LocIPT_AbsoluteBegin+2]
    360470         jne     PCCTP_LocMismatch
    361471         jmp     PCCTP_Match
     
    379489   ;  for converting HideConfig.
    380490   mov     dh, dl
    381    mov     dl, es:CFG_Partitions
     491   mov     dl, CFG_Partitions
    382492   sub     dl, dh
    383493   mov     dh, NewPartitions             ; is actually a counter
     
    385495
    386496   ; Get Saved-Flags...
    387    mov     cl, byte ptr es:[di+LocIPT_Flags]     ; Use saved Flags
     497   mov     cl, bptr [di+LocIPT_Flags]    ; Use saved Flags
    388498
    389499   ; ...and Saved-CRC if available...
    390    mov     ax, wptr es:[di+LocIPT_BootRecordCRC]
     500   mov     ax, wptr [di+LocIPT_BootRecordCRC]
    391501   or      ax, ax
    392502   jz      PCCTP_UseNewComputedCRC
     
    394504  PCCTP_UseNewComputedCRC:
    395505   ; ...and mark partition in IPT as already found
    396    or      byte ptr es:[di+LocIPT_Flags], Flags_NowFound
     506   or      bptr [di+LocIPT_Flags], Flags_NowFound
    397507   ; ...get Serial&Name from IPT-table...
    398508   mov     si, di
     
    412522   mov     al, PartTypeFlags
    413523   ; May I auto-add partitions ?
    414    test    es:CFG_PartitionsDetect, 1
     524   test    CFG_PartitionsDetect, 1
    415525   jz      PCCTP_MayNotAddAny ; add, but non-bootable
    416526   test    al, FileSysFlags_BootAble     ; AH kam von SearchFileSysName
     
    447557   ; Calculate Pointer to IPT
    448558   mov     di, offset NewPartTable       ; ES:DI - NewPartTable
    449    movzx   ax, es:NewPartitions
     559   movzx   ax, NewPartitions
    450560   mov     bl, LocIPT_LenOfIPT
    451561   mul     bl
     
    459569   pop     cx
    460570
    461    lds     si, dptr PartPtr              ; DS:SI - Cur Partition Entry
    462    mov     al, bptr es:[CurPartition_Location+4] ; Drive
     571   mov     si, [PartPtr]                 ; DS:SI - Cur Partition Entry
     572   mov     al, bptr [CurPartition_Location+4] ; Drive
    463573   stosb
    464574   mov     al, PartSystemID              ; Unhidden SystemID
     
    468578   mov     ax, PartCRC                   ; BootRecordCRC...
    469579   stosw
    470    mov     al, bptr ds:[si+LocBRPT_BeginHead]
     580   mov     al, bptr [si+LocBRPT_BeginHead]
    471581   stosb
    472    mov     ax, wptr ds:[si+LocBRPT_BeginSector] ; Cylinder/Sector
     582   mov     ax, wptr [si+LocBRPT_BeginSector] ; Cylinder/Sector
    473583   stosw
    474    mov     al, bptr es:[CurPartition_Location+5] ; Head of Part-Table
     584   mov     al, bptr [CurPartition_Location+5] ; Head of Part-Table
    475585   stosb
    476    mov     ax, wptr es:[CurPartition_Location+6] ; Cylinder/Sector
     586   mov     ax, wptr [CurPartition_Location+6] ; Cylinder/Sector
    477587   stosw
    478    mov     ax, wptr ds:[si+LocBRPT_RelativeBegin]
    479    mov     bx, wptr ds:[si+LocBRPT_RelativeBegin+2]
    480    mov     cx, wptr es:[CurPartition_Location+0] ; +Partition-Absolute
    481    mov     dx, wptr es:[CurPartition_Location+2] ;  sectors
     588   mov     ax, wptr [si+LocBRPT_RelativeBegin]
     589   mov     bx, wptr [si+LocBRPT_RelativeBegin+2]
     590   mov     cx, wptr [CurPartition_Location+0] ; +Partition-Absolute
     591   mov     dx, wptr [CurPartition_Location+2] ;  sectors
    482592   add     ax, cx
    483593   adc     bx, dx
     
    489599   mov     ax, dx
    490600   stosw
    491    inc     es:NewPartitions              ; NEW IPT Entry DONE
    492 
    493    cmp     es:NewPartitions, LocIPT_MaxPartitions
     601   inc     NewPartitions                 ; NEW IPT Entry DONE
     602
     603   cmp     NewPartitions, LocIPT_MaxPartitions
    494604   jbe     PCCTP_NotTooManyPartitions
    495    mov     ax, cs
    496    mov     ds, ax
    497605   mov     si, offset TXT_TooManyPartitions
    498606   call    MBR_Teletype
     
    502610   ; UNHIDE PARTITION, if it was hidden previously
    503611   mov     al, PartSystemID
    504    cmp     al, 08h                       ; internally NTFS ?
    505    jne     PCCTP_NoInternalNTFS
    506    dec     al
    507   PCCTP_NoInternalNTFS:
    508    mov     bptr ds:[si+LocBRPT_SystemID], al
    509 
    510    ; Calculate Size of this partition...
    511    movzx   ax, es:NewPartitions
     612   cmp     al, 08h                       ; internally IFS/NTFS?
     613   je      PCCTP_GotInternalIFS
     614   cmp     al, 0FCh                      ; internally IFS/JFS?
     615   jne     PCCTP_NoInternalIFS
     616  PCCTP_GotInternalIFS:
     617   mov     al, 07h
     618  PCCTP_NoInternalIFS:
     619   mov     bptr [si+LocBRPT_SystemID], al
     620
     621   ; Calculate Size of this partition and put it into separate table...
     622   movzx   ax, NewPartitions
    512623   dec     ax
    513624   mov     bx, ax
     
    517628   mov     di, offset PartitionSizeTable
    518629   add     di, ax                        ; DI - Partition Size-Element
    519    mov     ax, wptr ds:[si+LocBRPT_AbsoluteLength] ; Sector-Size
    520    mov     bx, wptr ds:[si+LocBRPT_AbsoluteLength+2]
     630   mov     ax, wptr [si+LocBRPT_AbsoluteLength] ; Sector-Size
     631   mov     bx, wptr [si+LocBRPT_AbsoluteLength+2]
    521632   call    PART_FillOutSizeElement
    522633   ret
    523634PARTSCAN_CheckThisPartition     EndP
    524 
    525 ; Scans Current Partition for Extended Partitions, if found, AX,BX,CX,DX will
    526 ; be set to this location and Carry will be set
    527 PARTSCAN_ScanPartitionForExtended Proc Near  Uses ds si
    528    mov     ax, ExecBaseSeg
    529    mov     ds, ax
    530    mov     si, ExecBasePtr
    531    add     si, 446                       ; DS:SI - First Partition Entry
    532    xor     ax, ax
    533   PSSPFE_ScanLoop:
    534       mov     al, ds:[si+LocBRPT_SystemID]
    535       cmp     al, 5                      ; Is Partition EXTENDED ?
    536       je      PSSPFE_ExtendedPartition
    537       cmp     al, 0Fh                    ; Is Partition EXTENDED (M$) ?
    538       je      PSSPFE_ExtendedPartition
    539       jmp     PSSPFE_IgnorePartition
    540      PSSPFE_ExtendedPartition:
    541       mov     ax, wptr ds:[si+LocBRPT_RelativeBegin]
    542       mov     bx, wptr ds:[si+LocBRPT_RelativeBegin+2]
    543       add     ax, wptr es:[ExtendedAbsPos+0] ; Adjust...
    544       adc     bx, wptr es:[ExtendedAbsPos+2] ; (Shit Design!)
    545       test    es:[ExtendedAbsPosSet], 1
    546       jnz     PSSPFE_ExtendedMainKnown
    547       mov     wptr es:[ExtendedAbsPos+0], ax
    548       mov     wptr es:[ExtendedAbsPos+2], bx
    549       mov     cs:[ExtendedAbsPosSet], 1
    550      PSSPFE_ExtendedMainKnown:
    551       mov     cx, wptr ds:[si+LocBRPT_BeginSector] ; Cylinder/Sector
    552       mov     dh, bptr ds:[si+LocBRPT_BeginHead]   ; Head
    553       mov     dl, bptr es:[CurPartition_Location+4] ; Drive
    554       stc
    555       jmp     PSSPFE_EndOfSearch
    556      PSSPFE_IgnorePartition:
    557       add     si, LocBRPT_LenOfEntry
    558    cmp     si, 500+ExecBasePtr
    559    jb      PSSPFE_ScanLoop
    560    clc
    561   PSSPFE_EndOfSearch:
    562    ret
    563 PARTSCAN_ScanPartitionForExtended EndP
    564635
    565636; ===================
     
    567638; ===================
    568639
    569 ; The following routines have DS==CS again
    570 
    571640; Reset X-Reference
    572 PARTSCAN_ResetXref              Proc Near   Uses ax cx es di
    573    push    cs
    574    pop     es
     641PARTSCAN_ResetXref              Proc Near   Uses ax cx di
    575642   mov     di, offset PartitionXref      ; X-Reference for later syncing
    576643   mov     cx, LocIPT_MaxPartitions
  • trunk/BOOTCODE/REGULAR/PASSWORD.ASM

    r23 r29  
    1 
    2 ; Disclaimer:
    3 ;=============
    4 ; The sourcecode is released via www.netlabs.org CVS *ONLY*.
    5 ;  You MUST NOT upload it to other servers nor republish it in any way.
    6 The sourcecode is still COPYRIGHTED and NOT RELEASED UNDER GPL.
    7 It's (c) Copyright 1998-2003 by Martin Kiewitz.
    8 You may recompile the source and do *PRIVATE* modifications, but please keep
    9 ;  in mind that modifying this code needs at least *some* assembly skill. If
    10 ;  you mess up your system, because you needed to hack your way through, don't
    11 blame me. Releasing a customized version of AiR-BOOT, selling it in any form
    12 or reusing parts of this source is *PROHIBITED*. Ask me, if you have some
    13 idea about new functionality *before* developing the code, otherwise I will
    14 ;  definitely reject it. Also please accept, that I have some basic design
    15 ;  rules on AiR-BOOT and I will maintain them at all costs, so this won't get
    16 another GRUB.
    17 
     1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
     2;
     3; This file is part of AiR-BOOT
     4;
     5; AiR-BOOT is free software: you can redistribute it and/or modify it under
     6the terms of the GNU General Public License as published by the Free
     7Software Foundation, either version 3 of the License, or (at your option)
     8any later version.
     9;
     10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
     12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     13details.
     14;
     15; You should have received a copy of the GNU General Public License along with
     16AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
     17;
    1818;---------------------------------------------------------------------------
    1919;                                                       AiR-BOOT / PASSWORD
     
    2222; Don't ask me, what I'm doing in here to encode the passwords. I don't even
    2323;  know by myself anymore. It's some kind of hash and I hope that it isn't weak
    24 ;  and some mad uber-hacker-god will laugh about it.
     24;  and some mad uber-hacker-god will laugh about it - but i bet so ;-)
    2525
    2626PASSWORD_AskSystemPwd           Proc Near   Uses ax bx si di
     
    4949   ret
    5050PASSWORD_AskChangeBootPwd       EndP
     51
     52;CFG_MasterPassword           dw 0101Fh   ; Encoded Password (this is just CR)
     53;                             dw 07A53h
     54;                             dw 0E797h
     55;                             dw 0A896h
     56; BUGBUG - If unspecified password to ask, check if one of our two are CR
     57;          And if that's the case, we need to skip over checking that one.
     58;          If both are CR, return to caller
     59
    5160
    5261;        In: ax - Magic for AskPassword Subroutine
  • trunk/BOOTCODE/REGULAR/STD_TEXT.ASM

    r23 r29  
    1 
    2 ; Disclaimer:
    3 ;=============
    4 ; The sourcecode is released via www.netlabs.org CVS *ONLY*.
    5 ;  You MUST NOT upload it to other servers nor republish it in any way.
    6 The sourcecode is still COPYRIGHTED and NOT RELEASED UNDER GPL.
    7 It's (c) Copyright 1998-2003 by Martin Kiewitz.
    8 You may recompile the source and do *PRIVATE* modifications, but please keep
    9 ;  in mind that modifying this code needs at least *some* assembly skill. If
    10 ;  you mess up your system, because you needed to hack your way through, don't
    11 blame me. Releasing a customized version of AiR-BOOT, selling it in any form
    12 or reusing parts of this source is *PROHIBITED*. Ask me, if you have some
    13 idea about new functionality *before* developing the code, otherwise I will
    14 ;  definitely reject it. Also please accept, that I have some basic design
    15 ;  rules on AiR-BOOT and I will maintain them at all costs, so this won't get
    16 another GRUB.
    17 
     1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
     2;
     3; This file is part of AiR-BOOT
     4;
     5; AiR-BOOT is free software: you can redistribute it and/or modify it under
     6the terms of the GNU General Public License as published by the Free
     7Software Foundation, either version 3 of the License, or (at your option)
     8any later version.
     9;
     10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
     12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     13details.
     14;
     15; You should have received a copy of the GNU General Public License along with
     16AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
     17;
    1818;---------------------------------------------------------------------------
    1919;                                                           AiR-BOOT / TEXT
    2020;---------------------------------------------------------------------------
    2121
    22 ; If you modify this Copyright and release this shiat under your own name,
     22; If you modify this Copyright and release this under your own name,
    2323;  I'm going to sue your cheap ass, rape your dog and blow up your house. =)
    2424
    25 CopyrightVersionLen         equ   5
    26 Copyright                    db ' AiR-BOOT v1.01 - (c) 1998-2003 Martin Kiewitz, Dedicated to Gerd Kiewitz', 0
    27 IFDEF ReleaseCommercial
    28    RegisteredTo              db 'Registered To: Myself', 0
    29   ELSE
    30    BootEndMsg                db 'Distribute/copy freely. Only meant for private usage.', 0
    31 ENDIF
     25CopyrightVersionLen   equ   5
     26Copyright             db ' AiR-BOOT v1.06 - (c) 1998-2009 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
     27BootEndMsg            db 'Free usage allowed, as long as you dont or have not worked for US government', 0
     28BootEndMsg2           db 'This is GPLv3+ software. Please visit http://AiR-BOOT.sourceforge.net', 0
    3229
    33 CheckID_MBR                  db 'AiRBOOT'
     30CheckID_MBR           db 'AiRBOOT'
     31BrokenHDD             db ' (HDDx)', 0
    3432
    35 ContinueBIOSbootTable        dw offset TXT_SETUP_MAGIC_CDROM
    36                              dw offset TXT_SETUP_MAGIC_Network
    37                              dw offset TXT_SETUP_MAGIC_ZIPLS
    38                              dw     0
     33; Colors for special words hard-coded. Keep all 0s.
     34TXT_SETUP_LowerMessage      db 'This software is released under ', 0, 'GPLv3+.', 0
     35                            db 'It may not be used by US government', 0
     36                            db 'For more information and source, please visit', 0
     37                            db 'http://AiR-BOOT.sourceforge.net', 0
     38                            db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0
     39
     40ContinueBIOSbootTable dw offset TXT_SETUP_MAGIC_CDROM
     41                      dw offset TXT_SETUP_MAGIC_Network
     42                      dw offset TXT_SETUP_MAGIC_ZIPLS
     43                      dw     0
  • trunk/BOOTCODE/REGULAR/TIMER.ASM

    r23 r29  
    1 
    2 ; Disclaimer:
    3 ;=============
    4 ; The sourcecode is released via www.netlabs.org CVS *ONLY*.
    5 ;  You MUST NOT upload it to other servers nor republish it in any way.
    6 The sourcecode is still COPYRIGHTED and NOT RELEASED UNDER GPL.
    7 It's (c) Copyright 1998-2003 by Martin Kiewitz.
    8 You may recompile the source and do *PRIVATE* modifications, but please keep
    9 ;  in mind that modifying this code needs at least *some* assembly skill. If
    10 ;  you mess up your system, because you needed to hack your way through, don't
    11 blame me. Releasing a customized version of AiR-BOOT, selling it in any form
    12 or reusing parts of this source is *PROHIBITED*. Ask me, if you have some
    13 idea about new functionality *before* developing the code, otherwise I will
    14 ;  definitely reject it. Also please accept, that I have some basic design
    15 ;  rules on AiR-BOOT and I will maintain them at all costs, so this won't get
    16 another GRUB.
    17 
     1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
     2;
     3; This file is part of AiR-BOOT
     4;
     5; AiR-BOOT is free software: you can redistribute it and/or modify it under
     6the terms of the GNU General Public License as published by the Free
     7Software Foundation, either version 3 of the License, or (at your option)
     8any later version.
     9;
     10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
     12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     13details.
     14;
     15; You should have received a copy of the GNU General Public License along with
     16AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
     17;
    1818;---------------------------------------------------------------------------
    1919;                                                          AiR-BOOT / TIMER
  • trunk/BOOTCODE/REGULAR/VIDEOIO.ASM

    r23 r29  
    1 
    2 ; Disclaimer:
    3 ;=============
    4 ; The sourcecode is released via www.netlabs.org CVS *ONLY*.
    5 ;  You MUST NOT upload it to other servers nor republish it in any way.
    6 The sourcecode is still COPYRIGHTED and NOT RELEASED UNDER GPL.
    7 It's (c) Copyright 1998-2003 by Martin Kiewitz.
    8 You may recompile the source and do *PRIVATE* modifications, but please keep
    9 ;  in mind that modifying this code needs at least *some* assembly skill. If
    10 ;  you mess up your system, because you needed to hack your way through, don't
    11 blame me. Releasing a customized version of AiR-BOOT, selling it in any form
    12 or reusing parts of this source is *PROHIBITED*. Ask me, if you have some
    13 idea about new functionality *before* developing the code, otherwise I will
    14 ;  definitely reject it. Also please accept, that I have some basic design
    15 ;  rules on AiR-BOOT and I will maintain them at all costs, so this won't get
    16 another GRUB.
    17 
     1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
     2;
     3; This file is part of AiR-BOOT
     4;
     5; AiR-BOOT is free software: you can redistribute it and/or modify it under
     6the terms of the GNU General Public License as published by the Free
     7Software Foundation, either version 3 of the License, or (at your option)
     8any later version.
     9;
     10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
     11WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
     12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
     13details.
     14;
     15; You should have received a copy of the GNU General Public License along with
     16AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
     17;
    1818;---------------------------------------------------------------------------
    1919;                                                      AiR-BOOT / VIDEO I/O
Note: See TracChangeset for help on using the changeset viewer.