Changeset 38 for trunk/BOOTCODE/SETUP


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/SETUP
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BOOTCODE/SETUP/MAIN.ASM

    r37 r38  
    3030LocMENU_ItemPack             equ          8 ; only if VariablePtr>0
    3131
    32 SETUP_UpperFixString          db 'SETUP ',0 ; AddOn for "AiR-BOOT SETUP vX.XX"
    33 
    34 Include SETUP/MENUS.ASM                  ; Menu structures
    35 Include SETUP/PART_SET.ASM               ; Partition Setup (in extra file)
     32SETUP_UpperFixString:         db 'SETUP ',0 ; AddOn fr "AiR-BOOT SETUP vX.XX"
     33
     34Include SETUP\MENUS.ASM                  ; Menu structures
     35Include SETUP\PART_SET.ASM               ; Partition Setup (in extra file)
    3636
    3737;            CH - Current Item Number
     
    6969SETUP_SwitchToSelectedItem      EndP
    7070
    71 SETUP_CheckEnterSETUP           Proc Near
     71SETUP_CheckEnterSETUP           Proc Near   Uses
    7272
    7373
     
    117117;        In: BP - Pointer to Menu
    118118;   CurMenu: Left Side 0-6, Right Side 8-14 (Bit 3!)
    119 SETUP_MenuTask                  Proc Near   ; the main-menu routine
     119SETUP_MenuTask                  Proc Near   Uses ; the main-menu routine
    120120   cmp     SETUP_ExitEvent, 1
    121121   jne     SMT_NoImmediateExit
     
    129129
    130130   mov     ax, ds:[bp+1]   ; Help Pointer
    131    cmp     ax, offset TXT_SETUPHELP_Main ; ask only in main-menu...
     131   cmp     ax, offset TXT_SETUPHELP_MAIN ; ask only in main-menu...
    132132   jne     SMT_NotMainMenu
    133133   call    FX_EndScreenLeft              ; Do FX, if requested...
     
    155155      cmp     ah, Keys_Right
    156156      je      SMT_KeyLeftRight
    157       cmp     ah, Keys_ENTER
    158       je      SMT_KeyENTER
     157      cmp     ah, Keys_Enter
     158      je      SMT_KeyEnter
    159159      cmp     ah, Keys_Plus
    160160      je      SMT_KeyPlus
     
    199199   jmp     SMT_FixUpModify
    200200
    201   SMT_KeyENTER:                          ; Enters Menu, if no ItemPack available
     201  SMT_KeyEnter:                          ; Enters Menu, if no ItemPack available
    202202   mov     ch, dh
    203203   call    SETUP_SwitchToSelectedItem    ; Calculates SI for Item-No (CH)
     
    238238  SMT_KeyEsc:
    239239   mov     ax, ds:[bp+1]                 ; Help Pointer
    240    cmp     ax, offset TXT_SETUPHELP_Main ; embarassing? ;-)
     240   cmp     ax, offset TXT_SETUPHELP_MAIN ; embarassing? ;-)
    241241   jne     SMT_ReturnPrev
    242242   jmp     SMT_ExitWithoutSaving
     
    294294;        In: BP - Pointer to Menu
    295295;       Out: DH - Active Item on Screen
    296 SETUP_DrawMenuOnScreen          Proc Near
     296SETUP_DrawMenuOnScreen          Proc Near   Uses
    297297   call    SETUP_DrawMenuWindow
    298298   mov     cx, CLR_MENU_WINDOW_BM
     
    396396   add     ch, 6                         ; Fix coordinate...
    397397   ; Display the Name and a double-point first
    398    ; BackUp Coordinates and ItemPackPtr
    399    push    cx
    400    push    si
     398   push    cx si                         ; BackUp Coordinates and ItemPackPtr
    401399      push    cx
    402400         cmp     cl, 40
     
    422420      call    VideoIO_PrintSingleChar    ; Write double-point
    423421      mov     word ptr TextColorFore, dx
    424    pop     si
    425    pop     cx
     422   pop     si cx
    426423   add     cl, 26                        ; Fix X-coordinate (for ItemPack)
    427424   call    VideoIO_Locate
     
    501498SETUP_DrawMenuWindow            EndP
    502499
    503 SETUP_DrawMenuBase              Proc Near
    504    call    BOOTMENU_BuildBackground
     500SETUP_DrawMenuBase              Proc Near   Uses
     501   call    BOOTMENU_BuildBackGround
    505502   ; -------------------------------------------- Upper Copyright...
    506503   mov     cx, 0F00h
     
    708705;SETUP_EnterMenu_LinuxCommandLine EndP
    709706
    710 SETUP_EnterMenu_DefineMasterPassword Proc Near
     707SETUP_EnterMenu_DefineMasterPassword Proc Near Uses
    711708   mov     di, offset CFG_MasterPassword
    712709   call    SETUP_EnterMenu_DefinePassword
     
    714711SETUP_EnterMenu_DefineMasterPassword EndP
    715712
    716 SETUP_EnterMenu_DefineBootPassword Proc Near
     713SETUP_EnterMenu_DefineBootPassword Proc Near Uses
    717714   mov     di, offset CFG_BootPassword
    718715   call    SETUP_EnterMenu_DefinePassword
     
    723720
    724721; [Linux support removed since v1.02]
    725 ;SETUP_EnterMenu_EnterLinuxCmdLine Proc Near
     722;SETUP_EnterMenu_EnterLinuxCmdLine Proc Near Uses
    726723;   mov     cx, 0D05h
    727724;   call    VideoIO_Color
     
    848845   mov     ax, VideoIO_Page2
    849846   call    VideoIO_BackUpTo
    850    push    ax
    851    push    di
     847   push    ax di
    852848      mov     ax, 20h                    ; Space
    853849      mov     cx, 16
    854850      rep     stosb                      ; Kill new password
    855851      mov     es:[di], ah                ; ending NUL
    856    pop     di
    857    pop     ax
     852   pop     di ax
    858853   cmp     ax, 0ABABh                    ; Magic Processing...
    859854   je      SLEP_MagicLayOut
     
    10441039  SEMSAES_DoThis:
    10451040   xor     al, al
    1046    mov     CFG_AutoEnterSetup, al
     1041   mov     CFG_AutoEnterSETUP, al
    10471042   add     CFG_LastTimeEditLow, 1
    10481043   adc     CFG_LastTimeEditHi, 0         ; Update Time-Stamp
     
    10601055   jnz     SEMEWS_UserAbort
    10611056   ; If we were forced to enter Setup, save configuration anyway...
    1062    test    CFG_AutoEnterSetup, 1
     1057   test    CFG_AutoEnterSETUP, 1
    10631058   jz      SEMEWS_DoThis
    10641059   jmp     SEMEWS_DoThis                 ; Cross-Jump to SaveAndExitSetup!
     
    10771072;       Out: Non-Zero Flag set -> User is sure
    10781073; Destroyed: None
    1079 SETUP_Warning_AreYouSure        Proc Near
     1074SETUP_Warning_AreYouSure        Proc Near Uses
    10801075   mov     cx, 0C04h
    10811076   call    VideoIO_Color
     
    11721167
    11731168; Cur Value in DL, Maximum Value in DH. Add/Sub in CL
    1174 SETUPMAGIC_InternalCheckUp      Proc Near
     1169SETUPMAGIC_InternalCheckUp      Proc Near   Uses
    11751170   or      cl, cl                        ; CL==0?    -> Decrease
    11761171   jz      SMICU_Substract               ; otherwise -> Increase
     
    12271222   mov     al, dl
    12281223   call    VideoIO_PrintByteDynamicNumber
    1229    ; Pseudo-(XCHG DS, ES)
    1230    push    ds
    1231    push    es
    1232    pop     ds
    1233    pop     es
    1234 
     1224   push    ds es
     1225   pop     ds es                         ; Pseudo-(XCHG DS, ES)
    12351226   mov     di, si
    12361227   add     di, LocMENU_ItemPack          ; ES:DI - ItemPack
    12371228   mov     si, 4000                      ; DS:SI - Screen Page 1
    1238    push    es
    1239    push    di
     1229   push    es di
    12401230      mov     cx, 4
    12411231     SMCBD_Loop:
     
    12431233         stosb
    12441234      loop    SMCBD_Loop                 ; okay we got it...trick!
    1245    ; DS:SI - ItemPack
    1246    pop     si
    1247    pop     ds
     1235   pop     si ds                         ; DS:SI - ItemPack
    12481236   mov     cx, 12
    12491237   call    GetLenOfName                  ; Gets the length of the number
     
    13111299      call    PART_GetPartitionPointer
    13121300      mov     ax, ds:[si+LocIPT_Flags]
    1313       test    ax, Flags_Bootable
     1301      test    ax, Flags_BootAble
    13141302      jz      SMCP_Inc_RejectPartition
    13151303      jmp     SMCP_GotSelection
     
    13421330      call    PART_GetPartitionPointer
    13431331      mov     ax, ds:[si+LocIPT_Flags]
    1344       test    ax, Flags_Bootable
     1332      test    ax, Flags_BootAble
    13451333      jz      SMCP_Dec_RejectPartition
    13461334
  • trunk/BOOTCODE/SETUP/MENUS.ASM

    r37 r38  
    6969SETUP_MainMenu:
    7070                db      0                ; Where Current Item will get saved
    71                 dw      offset TXT_SETUPHELP_Main ; Pointer to help information
     71                dw      offset TXT_SETUPHELP_MAIN ; Pointer to help information
    7272                ; The Menu-Items start here...
    7373                dw      offset SETUP_EnterMenu_PartitionSetup, 0
     
    103103SETUP_BasicOptions:
    104104                db      0                ; Where Current Item will get saved
    105                 dw      offset TXT_SETUPHELP_SubMenu ; Pointer to help info
     105                dw      offset TXT_SETUPHELP_SUBMENU ; Pointer to help info
    106106                ; The Menu-Items start here...
    107107                dw      offset SETUPMAGIC_ChangeDefaultSelection, offset CFG_PartDefault
     
    135135                dw      0, 0
    136136                dw      offset SETUPMAGIC_EnableDisable, offset CFG_ProtectMBR
    137                 dw      offset TXT_SETUP_MbrProtection, offset TXT_SETUPHELP_MbrProtection
     137                dw      offset TXT_SETUP_MBRprotection, offset TXT_SETUPHELP_MBRprotection
    138138                dw      6 dup (0)
    139139                dw      offset SETUPMAGIC_EnableDisable, offset CFG_IgnoreWriteToMBR
    140                 dw      offset TXT_SETUP_IgnoreMbrWrites, offset TXT_SETUPHELP_IgnoreMbrWrites
     140                dw      offset TXT_SETUP_IgnoreMBRwrites, offset TXT_SETUPHELP_IGNOREMBRWRITES
    141141                dw      6 dup (0)
    142142                dw      0, 0
     
    151151SETUP_AdvancedOptions:
    152152                db      0                ; Where Current Item will get saved
    153                 dw      offset TXT_SETUPHELP_SubMenu ; Pointer to help info
     153                dw      offset TXT_SETUPHELP_SUBMENU ; Pointer to help info
    154154                ; The Menu-Items start here...
    155155                dw      offset SETUPMAGIC_ChangeBootMenu, offset CFG_BootMenuActive
     
    163163                ; Separator Line
    164164                dw      0, 0
    165                 dw      offset TXT_SETUP_SecurityOptions, 0
     165                dw      offset TXT_SETUP_SECURITYOPTIONS, 0
    166166                dw      offset SETUPMAGIC_EnableDisable, offset CFG_PasswordSetup
    167167                dw      offset TXT_SETUP_PasswordedSetup, offset TXT_SETUPHELP_PasswordedSetup
     
    198198SETUP_ExtendedBootOptions:
    199199                db      0                ; Where Current Item will get saved
    200                 dw      offset TXT_SETUPHELP_SubMenu ; Pointer to help information
     200                dw      offset TXT_SETUPHELP_SUBMENU ; Pointer to help information
    201201                ; The Menu-Items start here...
    202202; [Linux support removed since v1.02]
  • trunk/BOOTCODE/SETUP/PART_SET.ASM

    r37 r38  
    2525
    2626; This here is called from Menu in AIR-BSET.asm
    27 PARTSETUP_Main                  Proc Near
     27PARTSETUP_Main                  Proc Near   Uses
    2828   ; Build Fixed Content...
    2929   call    PARTSETUP_DrawMenuBase
     
    5353      cmp     ah, Keys_F1
    5454      je      PSM_KeyF1
    55       cmp     ah, Keys_ENTER
     55      cmp     ah, Keys_Enter
    5656      je      PSM_KeyENTER
    5757      ; Flags-Change
     
    110110   jmp     PSM_MainLoop
    111111
    112     ; Disabling editing for type 0x35 is currently implemented
    113     ; in PARTSETUP_ChangePartitionName.
    114112  PSM_KeyENTER:
    115113   call    PARTSETUP_ChangePartitionName
     
    122120  PSM_KeyBootAble:
    123121   call    PART_GetPartitionPointer      ; Gets Partition (DL) Pointer -> SI
    124    ; See if this is an eCS LVM Volume.
    125    ; In that case, we don't allow it to be made bootable.
    126    ; We also show a popup to inform the user.
    127    call    PARTSETUP_IsType35
    128    je      PSM_KeyBootAble_istype35
    129 
    130   PSM_KeyBootAble_notype35:
    131122   mov     al, [si+LocIPT_Flags]
    132    xor     al, Flags_Bootable
     123   xor     al, Flags_BootAble
    133124   mov     [si+LocIPT_Flags], al
    134125   call    PARTSETUP_DrawPartitionInfo
    135126   call    PARTSETUP_BuildChoiceBar
    136   PSM_KeyBootAble_istype35:
    137127   jmp     PSM_MainLoop
    138128
     
    174164PARTSETUP_Main                  EndP
    175165
    176 
    177 ; See if this is a partition of type 0x35 and display error
    178 ; when user tries to set it as bootable.
    179 ; IN:   SI = Pointer to partition
    180 ; OUT:  ZF = Set if 0x35, clear otherwise
    181 PARTSETUP_IsType35      Proc    Near
    182    mov     al, [si+LocIPT_SystemID]
    183    cmp     al, 35h
    184    jne     PARTSETUP_IsType35_end
    185    pushf
    186    pusha
    187    ; Cannot boot LVM-Data partitions
    188    mov     cx, 0C04h
    189    mov     si, offset TXT_SETUP_NoBootType35
    190    call    SETUP_ShowErrorBox
    191    popa
    192    call    PARTSETUP_DrawMenuBase
    193    call    PARTSETUP_RefreshPartitions
    194    call    PARTSETUP_BuildChoiceBar
    195    popf
    196   PARTSETUP_IsType35_end:
    197    ret
    198 PARTSETUP_IsType35      EndP
    199 
    200 
    201166; Draw all standard-things for Partition Setup, dynamic content not included.
    202167PARTSETUP_DrawMenuBase          Proc Near   Uses dx
     
    286251   call    VideoIO_FixedPrint
    287252
    288    mov     si, offset TXT_SETUPHELP_PartSetup
     253   mov     si, offset TXT_SETUPHELP_PARTSETUP
    289254   call    SETUP_DrawMenuHelp
    290255   ret
     
    405370         mov     cl, 11
    406371         call    VideoIO_FixedPrint
    407    pop     si
    408    pop     cx
     372   pop     si cx
    409373
    410374   ; Display "Flags" field aka "BVHL"
     
    415379   mov     bh, bl
    416380   mov     al, TXT_SETUP_FlagLetterBootable
    417    and     bl, Flags_Bootable
     381   and     bl, Flags_BootAble
    418382   call    PARTSETUP_DrawOneFlag
    419383   mov     bl, bh
     
    465429;            DH - New Active (to be activated)
    466430; Destroyed: None
    467 PARTSETUP_BuildChoiceBar        Proc Near
     431PARTSETUP_BuildChoiceBar        Proc Near   Uses
    468432   cmp     dl, dh
    469433   je      PSBCB_SkipRetrace
     
    702666        cmp     byte ptr [si+LocIPT_SystemID], 035h
    703667        jnz     no_type_35h
    704 
    705    ; Cannot boot LVM-Data partitions
    706    pusha
    707    mov     cx, 0C04h
    708    mov     si, offset TXT_SETUP_NoEditType35
    709    call    SETUP_ShowErrorBox
    710    popa
    711 
    712 
    713668        jmp     PSCPN_AllDone
    714669    no_type_35h:
    715670
    716671   mov     cx, 11                        ; Partition-Name-Length = 11 Bytes
    717    push    si
    718    push    di
     672   push    si di
    719673      add     si, LocIPT_Name            ; DS:SI -> Partition-Name
    720674      repz    cmpsb
    721    pop     di
    722    pop     si
     675   pop     di si
    723676   jne     PSCPN_LetUserEditPartName     ; -> No BR/LVM Changing/Saving
    724677
     
    788741
    789742   ; ----------------------------------------------[LVM SAVE PARTITION NAME]---
    790    ; Copy 11 bytes from IPT into LVM PartitionName, back-padd with zero's
     743   ; Copy 11 bytes from IPT into LVM PartitonName, back-padd with zero's
    791744   mov     cx, 11
    792745   push    si
     
    895848      cmp     ah, Keys_F1
    896849      je      PHSM_KeyF1
    897       cmp     ah, Keys_ENTER
     850      cmp     ah, Keys_Enter
    898851      je      PHSM_KeyToogle
    899852      cmp     ah, Keys_Plus
     
    1005958   sub     dl, cl                        ; Adjust position
    1006959   sub     dl, 2
    1007    push    cx
    1008    push    si                         ; SI == Label Field
     960   push    cx si                         ; SI == Label Field
    1009961      mov     cx, dx
    1010962      call    VideoIO_Locate
     
    1013965      mov     si, offset TXT_SETUP_HideFeature2
    1014966      call    VideoIO_Print
    1015    pop     si
    1016    pop     cx
     967   pop     si cx
    1017968   call    VideoIO_FixedPrint
    1018969   mov     al, '>'
     
    11831134;            DH - New Active (to be activated)
    11841135; Destroyed: None
    1185 PARTHIDESETUP_BuildChoiceBar    Proc Near
     1136PARTHIDESETUP_BuildChoiceBar    Proc Near   Uses
    11861137   cmp     dl, dh
    11871138   je      PHSBCB_SkipRetrace
     
    13141265   mov     di, offset HidePartitionTable
    13151266   add     di, ax                        ; We got the pointer
    1316    push    di
    1317    push    di
     1267   push    di di
    13181268      mov     cx, LocIPT_MaxPartitions
    13191269      mov     al, 0FFh
     
    14171367         cmp     ah, Keys_ESC
    14181368         je      PSDLS_KeyDONE
    1419          cmp     ah, Keys_ENTER
     1369         cmp     ah, Keys_Enter
    14201370         je      PSDLS_KeyDONE
    14211371         ; Direct-Letter-Input
Note: See TracChangeset for help on using the changeset viewer.