Changeset 40 for trunk/BOOTCODE/SETUP


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

Legend:

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

    r38 r40  
    3030LocMENU_ItemPack             equ          8 ; only if VariablePtr>0
    3131
    32 SETUP_UpperFixString:         db 'SETUP ',0 ; AddOn fr "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 for "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   Uses
     71SETUP_CheckEnterSETUP           Proc Near
    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   Uses ; the main-menu routine
     119SETUP_MenuTask                  Proc Near   ; 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   Uses
     296SETUP_DrawMenuOnScreen          Proc Near
    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    push    cx si                         ; BackUp Coordinates and ItemPackPtr
     398   ; BackUp Coordinates and ItemPackPtr
     399   push    cx
     400   push    si
    399401      push    cx
    400402         cmp     cl, 40
     
    420422      call    VideoIO_PrintSingleChar    ; Write double-point
    421423      mov     word ptr TextColorFore, dx
    422    pop     si cx
     424   pop     si
     425   pop     cx
    423426   add     cl, 26                        ; Fix X-coordinate (for ItemPack)
    424427   call    VideoIO_Locate
     
    498501SETUP_DrawMenuWindow            EndP
    499502
    500 SETUP_DrawMenuBase              Proc Near   Uses
    501    call    BOOTMENU_BuildBackGround
     503SETUP_DrawMenuBase              Proc Near
     504   call    BOOTMENU_BuildBackground
    502505   ; -------------------------------------------- Upper Copyright...
    503506   mov     cx, 0F00h
     
    705708;SETUP_EnterMenu_LinuxCommandLine EndP
    706709
    707 SETUP_EnterMenu_DefineMasterPassword Proc Near Uses
     710SETUP_EnterMenu_DefineMasterPassword Proc Near
    708711   mov     di, offset CFG_MasterPassword
    709712   call    SETUP_EnterMenu_DefinePassword
     
    711714SETUP_EnterMenu_DefineMasterPassword EndP
    712715
    713 SETUP_EnterMenu_DefineBootPassword Proc Near Uses
     716SETUP_EnterMenu_DefineBootPassword Proc Near
    714717   mov     di, offset CFG_BootPassword
    715718   call    SETUP_EnterMenu_DefinePassword
     
    720723
    721724; [Linux support removed since v1.02]
    722 ;SETUP_EnterMenu_EnterLinuxCmdLine Proc Near Uses
     725;SETUP_EnterMenu_EnterLinuxCmdLine Proc Near
    723726;   mov     cx, 0D05h
    724727;   call    VideoIO_Color
     
    845848   mov     ax, VideoIO_Page2
    846849   call    VideoIO_BackUpTo
    847    push    ax di
     850   push    ax
     851   push    di
    848852      mov     ax, 20h                    ; Space
    849853      mov     cx, 16
    850854      rep     stosb                      ; Kill new password
    851855      mov     es:[di], ah                ; ending NUL
    852    pop     di ax
     856   pop     di
     857   pop     ax
    853858   cmp     ax, 0ABABh                    ; Magic Processing...
    854859   je      SLEP_MagicLayOut
     
    10391044  SEMSAES_DoThis:
    10401045   xor     al, al
    1041    mov     CFG_AutoEnterSETUP, al
     1046   mov     CFG_AutoEnterSetup, al
    10421047   add     CFG_LastTimeEditLow, 1
    10431048   adc     CFG_LastTimeEditHi, 0         ; Update Time-Stamp
     
    10551060   jnz     SEMEWS_UserAbort
    10561061   ; If we were forced to enter Setup, save configuration anyway...
    1057    test    CFG_AutoEnterSETUP, 1
     1062   test    CFG_AutoEnterSetup, 1
    10581063   jz      SEMEWS_DoThis
    10591064   jmp     SEMEWS_DoThis                 ; Cross-Jump to SaveAndExitSetup!
     
    10721077;       Out: Non-Zero Flag set -> User is sure
    10731078; Destroyed: None
    1074 SETUP_Warning_AreYouSure        Proc Near Uses
     1079SETUP_Warning_AreYouSure        Proc Near
    10751080   mov     cx, 0C04h
    10761081   call    VideoIO_Color
     
    11671172
    11681173; Cur Value in DL, Maximum Value in DH. Add/Sub in CL
    1169 SETUPMAGIC_InternalCheckUp      Proc Near   Uses
     1174SETUPMAGIC_InternalCheckUp      Proc Near
    11701175   or      cl, cl                        ; CL==0?    -> Decrease
    11711176   jz      SMICU_Substract               ; otherwise -> Increase
     
    12221227   mov     al, dl
    12231228   call    VideoIO_PrintByteDynamicNumber
    1224    push    ds es
    1225    pop     ds es                         ; Pseudo-(XCHG DS, ES)
     1229   ; Pseudo-(XCHG DS, ES)
     1230   push    ds
     1231   push    es
     1232   pop     ds
     1233   pop     es
     1234
    12261235   mov     di, si
    12271236   add     di, LocMENU_ItemPack          ; ES:DI - ItemPack
    12281237   mov     si, 4000                      ; DS:SI - Screen Page 1
    1229    push    es di
     1238   push    es
     1239   push    di
    12301240      mov     cx, 4
    12311241     SMCBD_Loop:
     
    12331243         stosb
    12341244      loop    SMCBD_Loop                 ; okay we got it...trick!
    1235    pop     si ds                         ; DS:SI - ItemPack
     1245   ; DS:SI - ItemPack
     1246   pop     si
     1247   pop     ds
    12361248   mov     cx, 12
    12371249   call    GetLenOfName                  ; Gets the length of the number
     
    12991311      call    PART_GetPartitionPointer
    13001312      mov     ax, ds:[si+LocIPT_Flags]
    1301       test    ax, Flags_BootAble
     1313      test    ax, Flags_Bootable
    13021314      jz      SMCP_Inc_RejectPartition
    13031315      jmp     SMCP_GotSelection
     
    13301342      call    PART_GetPartitionPointer
    13311343      mov     ax, ds:[si+LocIPT_Flags]
    1332       test    ax, Flags_BootAble
     1344      test    ax, Flags_Bootable
    13331345      jz      SMCP_Dec_RejectPartition
    13341346
  • trunk/BOOTCODE/SETUP/MENUS.ASM

    r38 r40  
    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

    r38 r40  
    2525
    2626; This here is called from Menu in AIR-BSET.asm
    27 PARTSETUP_Main                  Proc Near   Uses
     27PARTSETUP_Main                  Proc Near
    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.
    112114  PSM_KeyENTER:
    113115   call    PARTSETUP_ChangePartitionName
     
    120122  PSM_KeyBootAble:
    121123   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:
    122131   mov     al, [si+LocIPT_Flags]
    123    xor     al, Flags_BootAble
     132   xor     al, Flags_Bootable
    124133   mov     [si+LocIPT_Flags], al
    125134   call    PARTSETUP_DrawPartitionInfo
    126135   call    PARTSETUP_BuildChoiceBar
     136  PSM_KeyBootAble_istype35:
    127137   jmp     PSM_MainLoop
    128138
     
    164174PARTSETUP_Main                  EndP
    165175
     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
     181PARTSETUP_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
     198PARTSETUP_IsType35      EndP
     199
     200
    166201; Draw all standard-things for Partition Setup, dynamic content not included.
    167202PARTSETUP_DrawMenuBase          Proc Near   Uses dx
     
    251286   call    VideoIO_FixedPrint
    252287
    253    mov     si, offset TXT_SETUPHELP_PARTSETUP
     288   mov     si, offset TXT_SETUPHELP_PartSetup
    254289   call    SETUP_DrawMenuHelp
    255290   ret
     
    370405         mov     cl, 11
    371406         call    VideoIO_FixedPrint
    372    pop     si cx
     407   pop     si
     408   pop     cx
    373409
    374410   ; Display "Flags" field aka "BVHL"
     
    379415   mov     bh, bl
    380416   mov     al, TXT_SETUP_FlagLetterBootable
    381    and     bl, Flags_BootAble
     417   and     bl, Flags_Bootable
    382418   call    PARTSETUP_DrawOneFlag
    383419   mov     bl, bh
     
    429465;            DH - New Active (to be activated)
    430466; Destroyed: None
    431 PARTSETUP_BuildChoiceBar        Proc Near   Uses
     467PARTSETUP_BuildChoiceBar        Proc Near
    432468   cmp     dl, dh
    433469   je      PSBCB_SkipRetrace
     
    666702        cmp     byte ptr [si+LocIPT_SystemID], 035h
    667703        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
    668713        jmp     PSCPN_AllDone
    669714    no_type_35h:
    670715
    671716   mov     cx, 11                        ; Partition-Name-Length = 11 Bytes
    672    push    si di
     717   push    si
     718   push    di
    673719      add     si, LocIPT_Name            ; DS:SI -> Partition-Name
    674720      repz    cmpsb
    675    pop     di si
     721   pop     di
     722   pop     si
    676723   jne     PSCPN_LetUserEditPartName     ; -> No BR/LVM Changing/Saving
    677724
     
    741788
    742789   ; ----------------------------------------------[LVM SAVE PARTITION NAME]---
    743    ; Copy 11 bytes from IPT into LVM PartitonName, back-padd with zero's
     790   ; Copy 11 bytes from IPT into LVM PartitionName, back-padd with zero's
    744791   mov     cx, 11
    745792   push    si
     
    848895      cmp     ah, Keys_F1
    849896      je      PHSM_KeyF1
    850       cmp     ah, Keys_Enter
     897      cmp     ah, Keys_ENTER
    851898      je      PHSM_KeyToogle
    852899      cmp     ah, Keys_Plus
     
    9581005   sub     dl, cl                        ; Adjust position
    9591006   sub     dl, 2
    960    push    cx si                         ; SI == Label Field
     1007   push    cx
     1008   push    si                         ; SI == Label Field
    9611009      mov     cx, dx
    9621010      call    VideoIO_Locate
     
    9651013      mov     si, offset TXT_SETUP_HideFeature2
    9661014      call    VideoIO_Print
    967    pop     si cx
     1015   pop     si
     1016   pop     cx
    9681017   call    VideoIO_FixedPrint
    9691018   mov     al, '>'
     
    11341183;            DH - New Active (to be activated)
    11351184; Destroyed: None
    1136 PARTHIDESETUP_BuildChoiceBar    Proc Near   Uses
     1185PARTHIDESETUP_BuildChoiceBar    Proc Near
    11371186   cmp     dl, dh
    11381187   je      PHSBCB_SkipRetrace
     
    12651314   mov     di, offset HidePartitionTable
    12661315   add     di, ax                        ; We got the pointer
    1267    push    di di
     1316   push    di
     1317   push    di
    12681318      mov     cx, LocIPT_MaxPartitions
    12691319      mov     al, 0FFh
     
    13671417         cmp     ah, Keys_ESC
    13681418         je      PSDLS_KeyDONE
    1369          cmp     ah, Keys_Enter
     1419         cmp     ah, Keys_ENTER
    13701420         je      PSDLS_KeyDONE
    13711421         ; Direct-Letter-Input
Note: See TracChangeset for help on using the changeset viewer.