Changeset 38 for trunk/BOOTCODE/SPECIAL


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

Converting to JWasm -- phase #1 (not working) [2012-02-15]

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 WLink generates an oversized image
o Only Tasm with TLink works correctly

Location:
trunk/BOOTCODE/SPECIAL
Files:
6 edited

Legend:

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

    r37 r38  
    5151   jz      MSHPPT_NoMShack
    5252  MSHPPT_HarddriveLoop:
    53       push    ax
    54       push    bx
    55       push    cx
    56       push    dx
     53      push    ax bx cx dx
    5754         xor     ax, ax
    5855         xor     bx, bx     ; Location Absolute Sector 0
     
    6057         xor     dh, dh     ; Location Cylinder 0, Head 0, Sector 1 MBR/PPT
    6158         call    DriveIO_LoadPartition
    62       pop     dx
    63       pop     cx
    64       pop     bx
    65       pop     ax
     59      pop     dx cx bx ax
    6660      jc      MSHPPT_Failure
    6761
  • trunk/BOOTCODE/SPECIAL/FAT16.ASM

    r37 r38  
    103103   xor    di, di
    104104  FAT16SE_SearchLoop:
    105       push   si
    106       push   di
     105      push   si di
    107106         mov    cx, 11
    108107         repe   cmpsb                    ; Compare total 11-bytes
    109       pop    di
    110       pop    si
     108      pop    di si
    111109      je     FAT16SE_EntryFound
    112110      add    di, 32                      ; Skip 1 FAT16-Entry now :)
     
    223221
    224222      ; Set Size-Entry in KernelSizeTable
    225       push   ds
    226       push   si
    227       push   di
     223      push   ds si di
    228224         mov    bx, ds:[si+30]
    229225         mov    ax, ds:[si+28]           ; BX:AX - Size of file in Bytes
     
    244240         mov    di, si
    245241         call   PART_FillOutSizeElement  ; BX:AX -> ES:DI (Size Element)
    246       pop    di
    247       pop    si
    248       pop    ds
     242      pop    di si ds
    249243
    250244      ; Copy entry and make append extension to basename
  • trunk/BOOTCODE/SPECIAL/FX.ASM

    r37 r38  
    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
     34FX_CalculateTables              Proc Near   Uses
    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
     59FX_MakeCooperBarColors          Proc Near   Uses
    6060   mov    bh, ah
    6161   shl    bh, 4
     
    8282      add    di, 3
    8383   loop   FX_MCBC_BuildColorLoop1
    84    push   ax
    85    push   bx
     84   push   ax bx
    8685      add    ax, 0101h
    8786      add    bl, 01h
     
    9392      mov    es:[di+5], bl
    9493      add    di, 6
    95    pop    bx
    96    pop    ax
     94   pop    bx ax
    9795   mov    cx, 15
    9896  FX_MCBC_BuildColorLoop2:
     
    111109;  If FX is active, we will modify the base segment for videoio to page 2,
    112110;  so the screen will be generated there instead of the current page.
    113 FX_StartScreen                  Proc Near
     111FX_StartScreen                  Proc Near   Uses
    114112   test    CFG_CooperBars, 1
    115113   jz      FXSS_NoFX
     
    122120;  If FX is active, we will copy the new screen to scroll area, do the FX,
    123121;  copy the new screen to Page 0 and activate it.
    124 FX_EndScreenLeft                Proc Near
     122FX_EndScreenLeft                Proc Near   Uses
    125123   test    CFG_CooperBars, 1
    126124   jnz     FXESL_Go
     
    143141FX_EndScreenLeft                EndP
    144142
    145 FX_ScrollScreenLeft             Proc Near
     143FX_ScrollScreenLeft             Proc Near   Uses
    146144   mov     FX_WideScrollerCurPos, 640
    147145   mov     FX_WideScrollerDirection, 0
     
    151149FX_ScrollScreenLeft             EndP
    152150
    153 FX_EndScreenRight               Proc Near
     151FX_EndScreenRight               Proc Near   Uses
    154152   test    CFG_CooperBars, 1
    155153   jnz     FXESR_Go
     
    172170FX_EndScreenRight               EndP
    173171
    174 FX_ScrollScreenRight            Proc Near
     172FX_ScrollScreenRight            Proc Near   Uses
    175173   mov     FX_WideScrollerCurPos, 0
    176174   mov     FX_WideScrollerDirection, 1
     
    180178FX_ScrollScreenRight            EndP
    181179
    182 FX_EndScreenInternalGo          Proc Near
     180FX_EndScreenInternalGo          Proc Near   Uses
    183181   mov     FX_WideScrollerSpeed, 1
    184182   mov     FX_WideScrollerSpeedState, 1
     
    201199FX_EndScreenInternalGo          EndP
    202200
    203 FX_EndScreenInternalCleanUp     Proc Near
     201FX_EndScreenInternalCleanUp     Proc Near   Uses
    204202   mov     ax, -1
    205203   call    FX_SetVideoStart
     
    359357;       Out: *none*
    360358; Destroyed: all
    361 FX_CalculateCoopers             Proc Near
     359FX_CalculateCoopers             Proc Near   Uses
    362360   ; Logic: When Intro-State: Increase CooperPos by 1 till 256 -> then active
    363361   ;             Active-State: Use SinusTable, till SinusPos=7Fh -> then Extro
     
    416414FX_CalculateCoopers             EndP
    417415
    418 FX_CalculateWideScroller        Proc Near
     416FX_CalculateWideScroller        Proc Near   Uses
    419417   mov     bx, FX_WideScrollerCurPos
    420418   ;movzx   cx, FX_WideScrollerSpeed
     
    517515FX_CalculateWideScroller        EndP
    518516
    519 FX_WaitRetrace                  Proc Near
     517FX_WaitRetrace                  Proc Near   Uses
    520518   mov    dx, 3DAh
    521519  FX_WR1:
     
    530528FX_WaitRetrace                  EndP
    531529
    532 FX_WaitVRetrace                 Proc Near
     530FX_WaitVRetrace                 Proc Near   Uses
    533531   mov    dx, 3DAh
    534532  FX_WVR1:
  • trunk/BOOTCODE/SPECIAL/LINUX.ASM

    r37 r38  
    188188   add     di, LocIPT_Name
    189189  LSKN_SearchLoop:
    190       push    cx
    191       push    si
    192       push    di
     190      push    cx si di
    193191         mov     cx, 11
    194192         repe    cmpsb                   ; Compare total 11-bytes
    195       pop     di
    196       pop     si
    197       pop     cx
     193      pop     di si cx
    198194      je      LSKN_Found
    199195      add     di, LocIPT_LenOfIPT
     
    228224   ; Linux has 1 'BR' (which is crap) and some setup sectors
    229225   ; we load them at 9000:0, what a luck, we are at 8000:0 :-))
    230    push    ds
    231    push    es
     226   push    ds es
    232227      mov     ax, 9000h
    233228      mov     es, ax
     
    260255      mov     ax, 6000h
    261256      mov     es, ax
    262       ; Push Kernel-Entry-Pointer
    263       push    cx
    264       push    si
     257      push    cx si                      ; Push Kernel-Entry-Pointer
    265258         mov     si, di
    266259         shl     cx, 9                   ; Sectors to Byte Count
     
    269262         shr     cx, 1
    270263         rep     movsw                   ; Copy Data...
    271       ; Get Kernel-Entry-Pointer back
    272       pop     si
    273       pop     cx
     264      pop     si cx                      ; Get Kernel-Entry-Pointer back
    274265     LLL_GotAll:
    275    pop     es
    276    pop     ds
    277 
    278    ; Push Missing-Sectors, StartCluster
    279    push    cx
    280    push    dx
     266   pop     es ds
     267
     268   push    cx dx                          ; Push Missing-Sectors, StartCluster
    281269      mov     ax, 9000h
    282270      mov     ds, ax
     
    348336         stosb                            ; Write another NUL
    349337      pop     cx
    350    ; Pop StartCluster, Missing-Sectors
    351    pop     dx
    352    pop     bx
     338   pop     dx bx                          ; Pop StartCluster, Missing-Sectors
    353339   ; CX - Sector-Count of Kernel Image, DX - Starting Cluster of Kernel Image
    354340   ; BX - Sector-Count left over in 6000:0 area from Setup Code loading
  • trunk/BOOTCODE/SPECIAL/LVM.ASM

    r37 r38  
    2424ENDIF
    2525
    26 LVM_InitCRCTable                Proc Near
     26LVM_InitCRCTable                Proc Near   Uses
    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
     92LVM_CheckSectorSignature        Proc Near   Uses
    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 in case they
    179         ; they are all primary ones.
     178        ; sector of track0; for all four partition entries should they
     179        ; all be primary ones.
    180180        ;
    181181        ; LVM DLAT info for logical partitions is stored in the sector
  • trunk/BOOTCODE/SPECIAL/VIRUS.ASM

    r37 r38  
    3333   mov     di, offset CFG_VIR_INT08
    3434   push    di
    35       repe     scasb
     35      rep     scasb
    3636   pop     di
    3737   jne     VCFS_AlreadyInitiated
     
    102102   int     16h                           ; Waits for any keystroke
    103103   jmp     VCFS_InitNow
    104 
    105104  VCFS_WhewThisIsOne:
    106    call    VIRUS_TryRestore
    107 
    108    ; Code should no reach this since we halt the system in VIRUS_TryRestore.
    109    ret
     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
    110126VIRUS_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 ;
    117 VIRUS_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.
    142 VIRUS_TryRestore    Endp
    143 
    144127
    145128; Checks system for normal-MBR-virus... (done by comparing current MBR with
     
    148131; Segment Registers preserved
    149132VIRUS_CheckForVirus             Proc Near  Uses ds si es di
    150    push    cs
    151    push    cs
    152    pop     ds
    153    pop     es
     133   push    cs cs
     134   pop     ds es
    154135   mov     bx, offset TmpSector
    155136   mov     dx, 0080h
     
    164145   mov     cx, 223                       ; Compare 446 bytes
    165146   repz    cmpsw                         ; if fail: Cross call to Stealth-Virus
    166    ;jne     VCFS_WhewThisIsOne
    167    je      VIRUS_CheckForVirus_end
    168    call    VIRUS_TryRestore
    169   VIRUS_CheckForVirus_end:
     147   jne     VCFS_WhewThisIsOne
    170148   ret
    171149VIRUS_CheckForVirus             EndP
     
    189167
    190168; Will report Carry-Clear, if BackUp MBR is valid (supposingly)
    191 ANTIVIR_CheckBackUpMBR          Proc Near
    192    push    cs
    193    push    cs
    194    pop     es
    195    pop     ds
     169ANTIVIR_CheckBackUpMBR          Proc Near  Uses
     170   push    cs cs
     171   pop     es ds
    196172   mov     bx, offset TmpSector
    197173   mov     dx, 0080h
     
    214190ANTIVIR_CheckBackUpMBR          EndP
    215191
    216 ANTIVIR_RestoreMBR              Proc Near
     192ANTIVIR_RestoreMBR              Proc Near  Uses
    217193   call    ANTIVIR_CheckBackUpMBR
    218194   jnc     ARMBR_DoIt
Note: See TracChangeset for help on using the changeset viewer.