Changeset 40 for trunk/BOOTCODE/SPECIAL


Ignore:
Timestamp:
Apr 11, 2014, 9:58:17 PM (12 years ago)
Author:
Ben Rietbroek
Message:

Converting to JWasm -- phase 3 (not working) [2012-02-16]

WARNING!!

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

Problems

o Problem with location of BSS
o Problem with segments

Info

o Adjusted DISCLAIM.TXT

Location:
trunk/BOOTCODE/SPECIAL
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/BOOTCODE/SPECIAL/F00K/BILLSUXX.ASM

    r38 r40  
    5151   jz      MSHPPT_NoMShack
    5252  MSHPPT_HarddriveLoop:
    53       push    ax bx cx dx
     53      push    ax
     54      push    bx
     55      push    cx
     56      push    dx
    5457         xor     ax, ax
    5558         xor     bx, bx     ; Location Absolute Sector 0
     
    5760         xor     dh, dh     ; Location Cylinder 0, Head 0, Sector 1 MBR/PPT
    5861         call    DriveIO_LoadPartition
    59       pop     dx cx bx ax
     62      pop     dx
     63      pop     cx
     64      pop     bx
     65      pop     ax
    6066      jc      MSHPPT_Failure
    6167
  • trunk/BOOTCODE/SPECIAL/FAT16.ASM

    r38 r40  
    103103   xor    di, di
    104104  FAT16SE_SearchLoop:
    105       push   si di
     105      push   si
     106      push   di
    106107         mov    cx, 11
    107108         repe   cmpsb                    ; Compare total 11-bytes
    108       pop    di si
     109      pop    di
     110      pop    si
    109111      je     FAT16SE_EntryFound
    110112      add    di, 32                      ; Skip 1 FAT16-Entry now :)
     
    221223
    222224      ; Set Size-Entry in KernelSizeTable
    223       push   ds si di
     225      push   ds
     226      push   si
     227      push   di
    224228         mov    bx, ds:[si+30]
    225229         mov    ax, ds:[si+28]           ; BX:AX - Size of file in Bytes
     
    240244         mov    di, si
    241245         call   PART_FillOutSizeElement  ; BX:AX -> ES:DI (Size Element)
    242       pop    di si ds
     246      pop    di
     247      pop    si
     248      pop    ds
    243249
    244250      ; Copy entry and make append extension to basename
  • trunk/BOOTCODE/SPECIAL/FX.ASM

    r38 r40  
    2727;  If you rip this code, I will ./ your ass. =]
    2828
    29 Include SPECIAL\FXTABLES.asm
     29Include SPECIAL/FXTABLES.ASM
    3030
    3131FX_MaxScanLine                equ 384
    3232FX_TotalCooperBars            equ   7
    3333
    34 FX_CalculateTables              Proc Near   Uses
     34FX_CalculateTables              Proc Near
    3535   ; Calculate the Cooper-Bar Color-Table -> FX_CooperColors
    3636   mov    di, offset FX_CooperColors
     
    5757;       Out: *none*
    5858; Destroyed: DI - updated, +96
    59 FX_MakeCooperBarColors          Proc Near   Uses
     59FX_MakeCooperBarColors          Proc Near
    6060   mov    bh, ah
    6161   shl    bh, 4
     
    8282      add    di, 3
    8383   loop   FX_MCBC_BuildColorLoop1
    84    push   ax bx
     84   push   ax
     85   push   bx
    8586      add    ax, 0101h
    8687      add    bl, 01h
     
    9293      mov    es:[di+5], bl
    9394      add    di, 6
    94    pop    bx ax
     95   pop    bx
     96   pop    ax
    9597   mov    cx, 15
    9698  FX_MCBC_BuildColorLoop2:
     
    109111;  If FX is active, we will modify the base segment for videoio to page 2,
    110112;  so the screen will be generated there instead of the current page.
    111 FX_StartScreen                  Proc Near   Uses
     113FX_StartScreen                  Proc Near
    112114   test    CFG_CooperBars, 1
    113115   jz      FXSS_NoFX
     
    120122;  If FX is active, we will copy the new screen to scroll area, do the FX,
    121123;  copy the new screen to Page 0 and activate it.
    122 FX_EndScreenLeft                Proc Near   Uses
     124FX_EndScreenLeft                Proc Near
    123125   test    CFG_CooperBars, 1
    124126   jnz     FXESL_Go
     
    141143FX_EndScreenLeft                EndP
    142144
    143 FX_ScrollScreenLeft             Proc Near   Uses
     145FX_ScrollScreenLeft             Proc Near
    144146   mov     FX_WideScrollerCurPos, 640
    145147   mov     FX_WideScrollerDirection, 0
     
    149151FX_ScrollScreenLeft             EndP
    150152
    151 FX_EndScreenRight               Proc Near   Uses
     153FX_EndScreenRight               Proc Near
    152154   test    CFG_CooperBars, 1
    153155   jnz     FXESR_Go
     
    170172FX_EndScreenRight               EndP
    171173
    172 FX_ScrollScreenRight            Proc Near   Uses
     174FX_ScrollScreenRight            Proc Near
    173175   mov     FX_WideScrollerCurPos, 0
    174176   mov     FX_WideScrollerDirection, 1
     
    178180FX_ScrollScreenRight            EndP
    179181
    180 FX_EndScreenInternalGo          Proc Near   Uses
     182FX_EndScreenInternalGo          Proc Near
    181183   mov     FX_WideScrollerSpeed, 1
    182184   mov     FX_WideScrollerSpeedState, 1
     
    199201FX_EndScreenInternalGo          EndP
    200202
    201 FX_EndScreenInternalCleanUp     Proc Near   Uses
     203FX_EndScreenInternalCleanUp     Proc Near
    202204   mov     ax, -1
    203205   call    FX_SetVideoStart
     
    357359;       Out: *none*
    358360; Destroyed: all
    359 FX_CalculateCoopers             Proc Near   Uses
     361FX_CalculateCoopers             Proc Near
    360362   ; Logic: When Intro-State: Increase CooperPos by 1 till 256 -> then active
    361363   ;             Active-State: Use SinusTable, till SinusPos=7Fh -> then Extro
     
    414416FX_CalculateCoopers             EndP
    415417
    416 FX_CalculateWideScroller        Proc Near   Uses
     418FX_CalculateWideScroller        Proc Near
    417419   mov     bx, FX_WideScrollerCurPos
    418420   ;movzx   cx, FX_WideScrollerSpeed
     
    515517FX_CalculateWideScroller        EndP
    516518
    517 FX_WaitRetrace                  Proc Near   Uses
     519FX_WaitRetrace                  Proc Near
    518520   mov    dx, 3DAh
    519521  FX_WR1:
     
    528530FX_WaitRetrace                  EndP
    529531
    530 FX_WaitVRetrace                 Proc Near   Uses
     532FX_WaitVRetrace                 Proc Near
    531533   mov    dx, 3DAh
    532534  FX_WVR1:
  • trunk/BOOTCODE/SPECIAL/LINUX.ASM

    r38 r40  
    188188   add     di, LocIPT_Name
    189189  LSKN_SearchLoop:
    190       push    cx si di
     190      push    cx
     191      push    si
     192      push    di
    191193         mov     cx, 11
    192194         repe    cmpsb                   ; Compare total 11-bytes
    193       pop     di si cx
     195      pop     di
     196      pop     si
     197      pop     cx
    194198      je      LSKN_Found
    195199      add     di, LocIPT_LenOfIPT
     
    224228   ; Linux has 1 'BR' (which is crap) and some setup sectors
    225229   ; we load them at 9000:0, what a luck, we are at 8000:0 :-))
    226    push    ds es
     230   push    ds
     231   push    es
    227232      mov     ax, 9000h
    228233      mov     es, ax
     
    255260      mov     ax, 6000h
    256261      mov     es, ax
    257       push    cx si                      ; Push Kernel-Entry-Pointer
     262      ; Push Kernel-Entry-Pointer
     263      push    cx
     264      push    si
    258265         mov     si, di
    259266         shl     cx, 9                   ; Sectors to Byte Count
     
    262269         shr     cx, 1
    263270         rep     movsw                   ; Copy Data...
    264       pop     si cx                      ; Get Kernel-Entry-Pointer back
     271      ; Get Kernel-Entry-Pointer back
     272      pop     si
     273      pop     cx
    265274     LLL_GotAll:
    266    pop     es ds
    267 
    268    push    cx dx                          ; Push Missing-Sectors, StartCluster
     275   pop     es
     276   pop     ds
     277
     278   ; Push Missing-Sectors, StartCluster
     279   push    cx
     280   push    dx
    269281      mov     ax, 9000h
    270282      mov     ds, ax
     
    336348         stosb                            ; Write another NUL
    337349      pop     cx
    338    pop     dx bx                          ; Pop StartCluster, Missing-Sectors
     350   ; Pop StartCluster, Missing-Sectors
     351   pop     dx
     352   pop     bx
    339353   ; CX - Sector-Count of Kernel Image, DX - Starting Cluster of Kernel Image
    340354   ; BX - Sector-Count left over in 6000:0 area from Setup Code loading
  • trunk/BOOTCODE/SPECIAL/LVM.ASM

    r38 r40  
    2424ENDIF
    2525
    26 LVM_InitCRCTable                Proc Near   Uses
     26LVM_InitCRCTable                Proc Near
    2727   ; Initializes our LVM-CRC-Table
    2828   xor    cl, cl
     
    9090;       Out: Carry set, if valid LVM signature found
    9191; Destroyed: None
    92 LVM_CheckSectorSignature        Proc Near   Uses
     92LVM_CheckSectorSignature        Proc Near
    9393   test    [CFG_IgnoreLVM], 1            ; We are supposed to ignore LVM, so
    9494   jnz     LVMCSS_InvalidSignature       ;  any sector is bad!
     
    176176LVM_GetDriveLetter      Proc Near   Uses bx cx dx si di ds es
    177177        ; For primary partitions this information is stored in the last
    178         ; sector of track0; for all four partition entries should they
    179         ; all be primary ones.
     178        ; sector of track0; for all four partition entries in case they
     179        ; they are all primary ones.
    180180        ;
    181181        ; LVM DLAT info for logical partitions is stored in the sector
  • trunk/BOOTCODE/SPECIAL/VIRUS.ASM

    r38 r40  
    3333   mov     di, offset CFG_VIR_INT08
    3434   push    di
    35       rep     scasb
     35      repe     scasb
    3636   pop     di
    3737   jne     VCFS_AlreadyInitiated
     
    102102   int     16h                           ; Waits for any keystroke
    103103   jmp     VCFS_InitNow
     104
    104105  VCFS_WhewThisIsOne:
    105    mov     si, offset TXT_VirusFoundMain
    106    call    MBR_Teletype
    107    ; Now check BackUp MBR for validation (AiRBOOT signature), do this
    108    ; using direct-calls to original bios handler.
    109    call    ANTIVIR_RestoreMBR
    110    jnc     VCFS_ValidRestore
    111    mov     si, offset TXT_VirusFound1damn
    112    call    MBR_Teletype
    113    call    MBR_Teletype                  ; VirusFound1any
    114    mov     si, offset TXT_VirusFoundEnd
    115    call    MBR_Teletype
    116    jmp     MBR_HaltSystem
    117 
    118   VCFS_ValidRestore:
    119    mov     si, offset TXT_VirusFound1ok
    120    call    MBR_Teletype
    121    mov     si, offset TXT_VirusFound1any
    122    call    MBR_Teletype
    123    mov     si, offset TXT_VirusFoundEnd
    124    call    MBR_Teletype
    125    jmp     MBR_HaltSystem
     106   call    VIRUS_TryRestore
     107
     108   ; Code should no reach this since we halt the system in VIRUS_TryRestore.
     109   ret
    126110VIRUS_CheckForStealth           EndP
     111
     112;
     113; This procedure is created to avoid jumping to labels that are local to
     114; procedures. JWasm does not allow that.
     115; Should be fixed better later.
     116;
     117VIRUS_TryRestore    Proc Near
     118        mov     si, offset TXT_VirusFoundMain
     119        call    MBR_Teletype
     120        ; Now check BackUp MBR for validation (AiRBOOT signature), do this
     121        ; using direct-calls to original bios handler.
     122        call    ANTIVIR_RestoreMBR
     123        jnc     VIRUS_TryRestore_ValidRestore
     124
     125        mov     si, offset TXT_VirusFound1damn
     126        call    MBR_Teletype
     127        call    MBR_Teletype                  ; VirusFound1any
     128        mov     si, offset TXT_VirusFoundEnd
     129        call    MBR_Teletype
     130        jmp     MBR_HaltSystem
     131
     132    VIRUS_TryRestore_ValidRestore:
     133        mov     si, offset TXT_VirusFound1ok
     134        call    MBR_Teletype
     135        mov     si, offset TXT_VirusFound1any
     136        call    MBR_Teletype
     137        mov     si, offset TXT_VirusFoundEnd
     138        call    MBR_Teletype
     139        jmp     MBR_HaltSystem
     140
     141        ; Code should not reach this since we halt the system.
     142VIRUS_TryRestore    Endp
     143
    127144
    128145; Checks system for normal-MBR-virus... (done by comparing current MBR with
     
    131148; Segment Registers preserved
    132149VIRUS_CheckForVirus             Proc Near  Uses ds si es di
    133    push    cs cs
    134    pop     ds es
     150   push    cs
     151   push    cs
     152   pop     ds
     153   pop     es
    135154   mov     bx, offset TmpSector
    136155   mov     dx, 0080h
     
    145164   mov     cx, 223                       ; Compare 446 bytes
    146165   repz    cmpsw                         ; if fail: Cross call to Stealth-Virus
    147    jne     VCFS_WhewThisIsOne
     166   ;jne     VCFS_WhewThisIsOne
     167   je      VIRUS_CheckForVirus_end
     168   call    VIRUS_TryRestore
     169  VIRUS_CheckForVirus_end:
    148170   ret
    149171VIRUS_CheckForVirus             EndP
     
    167189
    168190; Will report Carry-Clear, if BackUp MBR is valid (supposingly)
    169 ANTIVIR_CheckBackUpMBR          Proc Near  Uses
    170    push    cs cs
    171    pop     es ds
     191ANTIVIR_CheckBackUpMBR          Proc Near
     192   push    cs
     193   push    cs
     194   pop     es
     195   pop     ds
    172196   mov     bx, offset TmpSector
    173197   mov     dx, 0080h
     
    190214ANTIVIR_CheckBackUpMBR          EndP
    191215
    192 ANTIVIR_RestoreMBR              Proc Near  Uses
     216ANTIVIR_RestoreMBR              Proc Near
    193217   call    ANTIVIR_CheckBackUpMBR
    194218   jnc     ARMBR_DoIt
Note: See TracChangeset for help on using the changeset viewer.