Changeset 52


Ignore:
Timestamp:
Apr 13, 2014, 4:45:41 PM (11 years ago)
Author:
Ben Rietbroek
Message:

Added BOOKMARK Comments [2013-02-27]

I recently added the 'addons' plugin to Geany, the editor I use on
Linux, and it contains a very handy feature to scan sources for tags
like FIXME:, BOOKMARK: and the like. Custom tags can also be defined.

So I added some major bookmark locations to easily navigate around
multiple sources. What's also nice is that of course these tags can be
listed with grep. For instance, grep -r -n 'BOOKMARK:' *.ASM will
display a list of all bookmark comments with line-numbers in the
assembler sources in the current and underlying directories.

Changes:

o Started fixing the CRC issue

Since AiR-BOOT now updates the PBR on HPFS and JFS, the CRC needs to
be recalculated and stored in the IPT. Otherwise AB will think the
PBR is infected and a virus message will appear.

o Changed PART_UpdateBootRecordCRC

Only PartitionSector could be CRC'd because it was hard coded.
Also, SI got immediately overwritten and that might have been an
unsurfaced bug, even in v.106. Have to investigate this further.
Changed to use BX as a pointer to the sector to be CRC'd.

Location:
trunk/BOOTCODE
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/BOOTCODE/AIR-BOOT.ASM

    r51 r52  
    457457;                                                            FIRST ENTRY-POINT
    458458; -----------------------------------------------------------------------------
     459; BOOKMARK: FIRST ENTRY-POINT (Invoked by BIOS)
    459460; ######################################################
    460461; # ENTRY-POINT WHERE THE BIOS TRANSFERS CONTROL TO US #
     
    490491;                                                            THIRD ENTRY-POINT
    491492; -----------------------------------------------------------------------------
     493; BOOKMARK: THIRD ENTRY-POINT (Relocate code)
    492494;
    493495; No single instruction below should be changed, added or removed in the code
     
    578580
    579581;
     582; BOOKMARK: Halt System
    580583; Entry-point for halting the system.
    581584;
     
    625628                ; Jump again...
    626629                ; This time to the code that relocates to 8000:0000.
     630                ; BOOKMARK: SECOND ENTRY_POINT (Skipped over AB signature)
    627631                jmp     MBR_Start
    628632
     
    675679;
    676680
    677 ;        In: BX - Base Check, DS:SI - Pointer to 512-byte-area to be included
    678 ;       Out: BX - Base Check Result
     681;        In: BX     - Base Check
     682;            DS:SI  - Pointer to 512-byte-area to be included
     683;       Out: BX     - Base Check Result
    679684; Destroyed: SI will get updated (+512)
    680685MBR_GetCheckOfSector    Proc Near   Uses ax cx
     
    709714; This is where the rest of AiR-BOOT gets loaded from track0.
    710715;
    711 
     716; BOOKMARK: Running at relocated position (Load additional sectors)
    712717;------------------------------------------------------------------------------
    713718MBR_RealStart:
     
    719724                mov     sp, 7FFEh       ; Even is better
    720725                push    es              ; ES holds segment where we moved to
    721                 pop     ds              ; Set DS==ES to Code Segment
     726                pop     ds              ; Set DS=ES to Code Segment
    722727
    723728                ;
     
    855860                ORIGIN  001B8h
    856861
    857                 ; AiR-BOOT will merge the field from the MBR it replaces.
     862                ; AiR-BOOT installer will merge the field
     863                ; from the MBR it replaces.
    858864    MBR_DrvSig  db      'DSIG'
    859865
    860866                ; Unused word at 01BCh.
    861867                ; An LVM 2.x MBR puts 0CC33h here.
    862                 ; AiR-BOOT will merge the field from the MBR it replaces.
     868                ; AiR-BOOT installer will merge the field
     869                ; from the MBR it replaces.
    863870    MBR_Spare   dw      '$$'
    864871
     
    870877
    871878                ; The 4 entries just for show.
    872                 ; AiR-BOOT will merge them from the MBR it replaces.
     879                ; AiR-BOOT installer will merge them from the MBR it replaces.
    873880    MBR_PartTable:
    874881                db      16  dup('0')
     
    960967; # ENTRY-POINT AFTER ALL THE INITIAL HASSLE #
    961968; ############################################
     969; BOOKMARK: AiR_BOOT_Start (AiR-BOOT now completely loaded)
    962970AiR_BOOT_Start:
    963971
     
    970978        ;
    971979        ; Pop the old SS:SP from the stack and save it in the BSS.
     980        ; Note that this is outside the normal variable area that gets cleared.
     981        ; This allows AiR-BOOT to restart itself when debugging and come-up
     982        ; with access to the original values of registers the BIOS passed.
    972983        ;
    973984        pop     [OldSP]
     
    10111022                ;
    10121023                ; First it clears the BSS area.
    1013                 ; Note that the old SS:SP is stored outside this area so ti
     1024                ; Note that the old SS:SP is stored outside this area so this
    10141025                ; does not get lost.
    10151026                ; Then initialize various runtime variables and structures.
    10161027                ;
     1028                ; BOOKMARK: Pre Crap
    10171029                call    PRECRAP_Main
    10181030                ; Number of harddisks and other system-info is now known.
     
    10781090; -----------------------------------------------------------------------------
    10791091                ;
    1080                 ; Scan all partitions
     1092                ; BOOKMARK: Scan all partitions
    10811093                ;
    10821094                call    PARTSCAN_ScanForPartitions
     
    11071119                ; partitions.
    11081120                ;
     1121                ; BOOKMARK: Update Driveletters so they are in-sync again
    11091122                call    PARTSCAN_UpdateDriveLetters
    11101123                ; Driveletter <-> Partition correlation is now restored.
     
    11691182
    11701183                ;
    1171                 ; Here we check if eComStation v2.1 is being installed.
     1184                ; BOOKMARK: Check for eCS being installed
     1185                ; Here we check if eComStation v2.1+ is being installed.
    11721186                ; If so, we forgo the menu and directly boot it.
    11731187                ;
     
    12071221
    12081222
     1223                ; BOOKMARK: Scan for Partitions (Only if eCS install going on)
    12091224                ; Because one or more partitions are possibly added, the
    12101225                ; PartitionXref table is not 'in sync' and could cause the
     
    12871302
    12881303
     1304                ; BOOKMARK: Save Configuration
    12891305                ; Save configuration so phase1 boot-through is disabled
    12901306                ; on next boot.
     
    13031319                ; Do some post processing.
    13041320                ;
     1321                ; BOOKMARK: After Crap
    13051322                call    AFTERCRAP_Main
    13061323
     
    13761393            ENDIF
    13771394
     1395                ; BOOKMARK: Build Main Menu
    13781396                call    BOOTMENU_BuildBackground
    13791397                call    BOOTMENU_BuildMain
     
    13861404                call    BOOTMENU_ResetTimedBoot
    13871405
     1406                ; BOOKMARK: Display Main Menu
    13881407                call    BOOTMENU_Execute
    13891408
     
    13981417            ENDIF
    13991418
     1419                ; BOOKMARK: Display bye-screen and start selected partition
    14001420                call    BOOTMENU_BuildGoodBye
    14011421
     
    14581478; It skips the movement of the MBR but otherwise it is a functional restart.
    14591479; The old BIOS SS:SP where the registers on entry are stored is passed along.
    1460 ;
     1480; This entry-point is used for debugging purposes.
     1481;
     1482; BOOKMARK: AiR-BOOT Restart (used for debugging)
    14611483AirbootRestart:
    14621484        mov     bx, [OldSP]     ; Old SP when BIOS transferred control to AB
     
    14701492; It is entered on severe error conditions.
    14711493;
     1494; BOOKMARK: Halt System
    14721495HaltSystem:
    14731496        call    VideoIO_ClearScreen
     
    14851508
    14861509                ;
    1487                 ; The following section includes various assembler
    1488                 ; modules. These contain functionality for a multitude of
    1489                 ; categories like disk-access, video-io, lvm, debugging, etc.
     1510                ; The following section includes various assembler modules
     1511                ; at the source level. These contain functionality for a
     1512                ; multitude of categories like disk-access, video-io, lvm,
     1513                ; debugging, etc. Later versions of AiR-BOOT will use such
     1514                ; modules at the object-file level so they can be shared
     1515                ; more easily.
    14901516                ;
    14911517
     
    14941520;                                                        INCLUDED FILE SECTION
    14951521; -----------------------------------------------------------------------------
     1522
     1523; BOOKMARK: Include Section
    14961524
    14971525;
     
    16191647                ; End of code marker.
    16201648                ;
     1649                ; BOOKMARK: END OF CODE
    16211650                db      'BABE'
    16221651                db      'FACE'
     
    16411670; -----------------------------------------------------------------------------
    16421671
     1672                ; BOOKMARK: BLDLEVEL Information
    16431673                ORIGIN  068A0h
    16441674
     
    16981728
    16991729                ;
    1700                 ; This is the AiR-BOOT MBR-Protection Image.
     1730                ; This is the AiR-BOOT MBR Protection Image.
    17011731                ; The stuff generated here gets overwritten when the
    17021732                ; MBR_PROT module, which is assembled separately,
     
    17041734                ; So you won't find the string below in the generated binary.
    17051735                ;
     1736                ; BOOKMARK: AiR-BOOT MBR Protection Image
    17061737                ORIGIN  06900h
    17071738
     
    17481779                ; variables remain vaild.
    17491780                ;
     1781                ; BOOKMARK: AiR-BOOT Configuration Sector
    17501782                ORIGIN  06C00h
    17511783
     
    18481880                ; Drive Letters.
    18491881                ;
     1882                ; BOOKMARK: Stored Drive Letters
    18501883                ORIGIN  06CB0h
    18511884
     
    18761909                ; So future config changes will not break auto-install.
    18771910                ;
     1911                ; BOOKMARK: Name of eCS Installation Volume
    18781912                ORIGIN  06D00h
    18791913
     
    19021936                ; Entries allocated down from 06E00 boundary.
    19031937                ;
     1938                ; BOOKMARK: Floppy/CD-ROM/BIOS Boot Entries
    19041939                ORIGIN  06DABh                                  ; 427 Boundry
    19051940
     
    19551990                ; AiR-BOOT Internal Partition Table (IPT)
    19561991                ;
     1992                ; BOOKMARK: Internal Partition Table
    19571993                ORIGIN  % (image_size - 0a00h - (image_size - image_size_60secs))
    19581994
     
    20022038                ; Hidden Partition Table (6-bit packed as of v1.0.8)
    20032039                ;
     2040                ; BOOKMARK: Hidden Partition Table (packed)
    20042041                ORIGIN  % (image_size - 600h - (image_size - image_size_60secs) / 2)
    20052042
     
    20382075                ; AiR-BOOT MBR Backup.
    20392076                ;
     2077                ; BOOKMARK: MBR Backup
    20402078                ORIGIN  % (image_size - 200h)
    20412079
     
    20772115;##############################################################################
    20782116
    2079 
     2117; BOOKMARK: BSS Segment
    20802118
    20812119;
     
    21272165;                                                               SECTOR BUFFERS
    21282166; -----------------------------------------------------------------------------
     2167; BOOKMARK: Sector Buffers
    21292168PartitionSector     db  512 dup (?) ; Temporary Sector for Partition
    21302169PBRSector           db  512 dup (?) ; Temporary Sector for JFS/HPFS writeback
     
    21372176; -----------------------------------------------------------------------------
    21382177; Everything used to build a new IPT and reference it to the old one
     2178; BOOKMARK: New Partition Table
    21392179NewPartTable                db  1536 dup (?)    ; New Partition Table
    21402180
     
    21432183;                                                     NEW HIDE PARTITION TABLE
    21442184; -----------------------------------------------------------------------------
    2145 ; New Hide-Partition Table
     2185; BOOKMARK: New Hide-Partition Table
    21462186NewHidePartTable            db  LocIPT_MaxPartitions * LocHPT_LenOfHPT dup (?)
    21472187
     
    21512191;                                                            NEW DRIVE LETTERS
    21522192; -----------------------------------------------------------------------------
    2153 ; Logical Drive-Letters
     2193; BOOKMARK: Logical Drive-Letters
    21542194NewDriveLetters             db  LocIPT_MaxPartitions dup (?)
    21552195
     
    21602200; -----------------------------------------------------------------------------
    21612201; Size-Table (6 bytes per partition)
     2202; BOOKMARK: Partition Size Table
    21622203PartitionSizeTable          db  LocIPT_MaxPartitions * 6 dup (?)
    21632204
     
    21672208; -----------------------------------------------------------------------------
    21682209; Maximum is 52 word entries till now
     2210; BOOKMARK: Partition Pointers
    21692211PartitionPointers           dw  52 dup (?)
    21702212
     
    21772219
    21782220; X-Reference Table (holds new partnr, index is old part nr)
     2221; BOOKMARK: Xref Table
    21792222PartitionXref               db  LocIPT_MaxPartitions dup (?)
    21802223
     
    21872230; 1 - LVM support, but no letter
    21882231; 'C'-'Z' - assigned drive letter
     2232; BOOKMARK: Volume Drive Letters
    21892233PartitionVolumeLetters      db  LocIPT_MaxPartitions dup (?)
    21902234
     
    21942238;                                                          MISC VARS AND FLAGS
    21952239; -----------------------------------------------------------------------------
     2240; BOOKMARK: Misc Vars and Flags
    21962241TotalHarddiscs          db  ?           ; Total harddrives (by POST)
    21972242LBASwitchTable          db  128 dup (?) ; Bit 25-18 for CHS/LBA Switching
     
    23592404; -----------------------------------------------------------------------------
    23602405;
    2361 ; Temporary buffer for 48h INT13X bios call.
     2406; BOOKMARK: Temporary buffer for 48h INT13X bios call.
    23622407;
    23632408
     
    23872432;                                                           OLD AND NEW STACKS
    23882433; -----------------------------------------------------------------------------
    2389 
     2434; BOOKMARK: Storage for Old and New Stack Pointers
    23902435;
    23912436; These need to be outside the variable section because AiR-BOOT can restart
     
    24282473ENDIF
    24292474
     2475            ; BOOKMARK: End of Module
    24302476            END     AiR_BOOT
    24312477
  • trunk/BOOTCODE/REGULAR/PARTMAIN.ASM

    r51 r52  
    134134;        In: DS:SI - IPT-Entry of partition
    135135;            DS:PartitionSector - Actual Boot-Record of partition
    136 ;       Out: *none* (BootRecordCRD updated)
     136;       Out: *none* (BootRecordCRC updated)
     137; CHECKME: Verify the change (BX points to sector to CRC) is working OK
    137138PART_UpdateBootRecordCRC        Proc Near Uses bx
    138         mov     si, offset PartitionSector
     139        push    si
     140        ;~ mov     si, offset PartitionSector
     141        mov     si, bx
    139142        mov     bx, 4B4Dh            ; Magic: 'MK'
    140143        call    MBR_GetCheckOfSector
     144        pop     si
    141145        mov     [si+LocIPT_BootRecordCRC], bx
    142146        ret
     
    144148
    145149
    146 ;
    147 ; What happens here ?
    148 ;
    149150
    150151; Rousseau:
     
    167168; presumably pointed to an area where a null byte was near.
    168169;
    169 ; Fix:
    170 ; Test BX for zero and if so, skip the
     170; BOOKMARK: The nasty pointer bug
    171171
    172172
     
    781781
    782782
    783 ; Rousseau: added
     783
    784784; Compare a volume-label in the IPT to the install-volume
    785785; SI holds pointer to entry in IPT
     
    858858
    859859
    860 ; Setup Phase1
     860
    861861; If found CY=1, AL=partnum, else CY=0, AL=0FFH
     862; BOOKMARK: Setup Phase1
    862863PART_SetupPhase1    Proc    Uses bx cx dx si di
    863864
     
    11421143    ; This loads the MBR in case of PRI or the EBR in case of LOG partitions.
    11431144    ;
     1145    ; BOOKMARK: PBR/EBR loading
    11441146    call    DriveIO_LoadPartition         ; Load Table...                [LOAD]
    11451147
     
    12351237
    12361238    ;
    1237     ; Setup 'I13X' signature.
     1239    ; BOOKMARK: Setup 'I13X' signature.
    12381240    ;
    12391241    PSP_ForceI13X:
     
    14921494        jz      PSP_NoVIBR
    14931495
     1496
    14941497        ; ----------------------------------------------------- CHECKS FOR VIBR
     1498        ; BOOKMARK: Check for virus in PBR
    14951499        push    si
    14961500            mov     si, offset PartitionSector
     
    16991703        ;
    17001704
    1701         ;
    1702         ; Fix hidden sectors field
    1703         ;
     1705        ; BOOKMARK: Fix hidden sectors field
    17041706        mov     ax,[si+LocIPT_AbsoluteBegin]
    17051707        mov     es:[di+1ch], ax     ; Low word of 32-bits "hidden sectors"
     
    17261728
    17271729
    1728         ; FIXME:
     1730        ;
    17291731        ; The PBR is already loaded, no need to load it again in the
    17301732        ; calls below.
     
    17321734        ; Better use the already done discovery to determine the system.
    17331735        ;
    1734 
     1736        ; FIXME: PBR Already loaded
     1737       
    17351738        ; When FAT12/FAT16/HPFS/JFS then boot-drive-letter can be tested
    17361739        ; or adjusted.
     
    19551958        ; WE CONTINUE BOOTING BUT OS/2 - eCS WILL MOST PROBABLY FAIL TO BOOT.
    19561959
    1957         ; FIXME:
    1958         ; ISSUE SOME KIND OF WARNING...
    1959 
     1960        ; FIXME: Issue some kind of warning
     1961       
    19601962        ;mov     ah,07h
    19611963        ;mov     si,offset CheckID_MBR
     
    20352037        pop     si
    20362038
     2039       
     2040        ; BOOKMARK: Update the CRC of the Partition Boot Record.
     2041        ; FIXME:    Update CRC on PBR
     2042        ;~ mov     bx, offset [PBRSector]
     2043        ;~ call    PART_UpdateBootRecordCRC
     2044
     2045       
    20372046        ; Setup the registers for the partition location.
    20382047        mov     ax, wptr [si+LocIPT_AbsoluteBegin+0]
     
    20422051        mov     dl, [si+LocIPT_Drive]
    20432052
    2044         ; Write the adjusted JFS PBR to disk.
     2053       
     2054        ; BOOKMARK: Write the adjusted HPFS/JFS PBR to disk.
    20452055        mov     si, offset [PBRSector]
    20462056        call    DriveIO_SaveSector
     
    20482058    no_jfs_pbr:
    20492059        popa
    2050 
    2051 
    2052         ;xor     ax,ax
    2053         ;int     16h
    2054 
    2055 
    20562060
    20572061
     
    20902094    boot_from_floppy:
    20912095
    2092         ;
    2093         ; Here we copy the prepared partition boot-record to 0000:7C00h
     2096
     2097   
     2098
     2099        ;
     2100        ; Here we copy the prepared boot-record to 0000:7C00h
    20942101        ; to give it control later on.
    20952102        ;
     
    21972204
    21982205
    2199 
     2206        ; BOOKMARK: JUMP TO PBR CODE
    22002207        ; ###############################
    22012208        ; # JUMP TO THE PBR LOADER CODE #
  • trunk/BOOTCODE/REGULAR/STD_TEXT.ASM

    r51 r52  
    5858            ;~ db ' M. Kiewitz  <<@ Interim Release @>> (bld: '
    5959            ;~ db ' M. Kiewitz  <<Release Candidate 2>> (bld: '
    60             db ' M. Kiewitz  <<Release Candidate 3>> (bld: '
     60            db ' M. Kiewitz  <<Release Candidate 4>> (bld: '
    6161            db BLDLVL_YEAR
    6262            db BLDLVL_MONTH
  • trunk/BOOTCODE/SETUP/PART_SET.ASM

    r51 r52  
    620620   je      PSCPN_NotLVMSupported
    621621
    622    ; ------------------------------------------------------------[LVM CHECK]---
    623    ; Load LVM-Sector here and seek to PartitionName
    624    ; Set CurPartition_Location information of destination partition
    625    mov     ax, [si+LocIPT_AbsolutePartTable]
    626    mov     [CurPartition_Location+0], ax
    627    mov     ax, [si+LocIPT_AbsolutePartTable+2]
    628    mov     [CurPartition_Location+2], ax
    629    mov     ah, byte ptr [si+LocIPT_LocationPartTable+0]
    630    mov     al, byte ptr [si+LocIPT_Drive]
    631    mov     [CurPartition_Location+4], ax
    632    mov     ax, [si+LocIPT_LocationPartTable+1]
    633    mov     [CurPartition_Location+6], ax
    634    mov     di, si                        ; Put SI into DI
    635    call    DriveIO_LoadLVMSector
    636    jnc     PSCPN_LVMGotError             ; Security again, if problem -> halt
    637    push    dx
     622    ;
     623    ; BOOKMARK: LVM Label Manipulations
     624    ;
     625   
     626    ; ------------------------------------------------------------[LVM CHECK]---
     627    ; Load LVM-Sector here and seek to PartitionName
     628    ; Set CurPartition_Location information of destination partition
     629    mov     ax, [si+LocIPT_AbsolutePartTable]
     630    mov     [CurPartition_Location+0], ax
     631    mov     ax, [si+LocIPT_AbsolutePartTable+2]
     632    mov     [CurPartition_Location+2], ax
     633    mov     ah, byte ptr [si+LocIPT_LocationPartTable+0]
     634    mov     al, byte ptr [si+LocIPT_Drive]
     635    mov     [CurPartition_Location+4], ax
     636    mov     ax, [si+LocIPT_LocationPartTable+1]
     637    mov     [CurPartition_Location+6], ax
     638    mov     di, si                        ; Put SI into DI
     639    call    DriveIO_LoadLVMSector
     640    jnc     PSCPN_LVMGotError             ; Security again, if problem -> halt
     641    push    dx
    638642      mov     ax, [di+LocIPT_AbsoluteBegin]
    639643      mov     dx, [di+LocIPT_AbsoluteBegin+2]
    640644      call    LVM_SearchForPartition
    641    pop     dx
    642    jnc     PSCPN_LVMGotError             ; Not Found? -> display error and halt
     645    pop     dx
     646    jnc     PSCPN_LVMGotError             ; Not Found? -> display error and halt
    643647
    644648
    645649    ; Point to LVM VolumeName
    646    add     si, LocLVM_VolumeName
    647 
    648 
    649    xchg    si, di                        ; SI-IPTEntry, DI-LVM PartName
    650    jmp     PSCPN_CheckPartName           ; Check, if match...
    651 
    652 
    653 
    654   PSCPN_LVMGotError:
    655    jmp     MBR_LoadError
    656 
    657 
    658 
    659 ;   mov     si, di                        ; Restore SI and bootrecord fall-back
    660   PSCPN_NotLVMSupported:
    661    ; ----------------------------------------------------[BOOT-RECORD CHECK]---
    662    ; Load Boot-Record...
    663    push    dx
     650    add     si, LocLVM_VolumeName
     651
     652
     653    xchg    si, di                        ; SI-IPTEntry, DI-LVM PartName
     654    jmp     PSCPN_CheckPartName           ; Check, if match...
     655
     656
     657
     658    PSCPN_LVMGotError:
     659    jmp     MBR_LoadError
     660
     661
     662
     663    ;   mov     si, di                        ; Restore SI and bootrecord fall-back
     664    PSCPN_NotLVMSupported:
     665    ; ----------------------------------------------------[BOOT-RECORD CHECK]---
     666    ; Load Boot-Record...
     667    ; BOOKMARK: Load Boot Record
     668    push    dx
    664669      mov     ax, [si+LocIPT_AbsoluteBegin+0]
    665670      mov     bx, [si+LocIPT_AbsoluteBegin+2]
     
    668673      mov     dl, [si+LocIPT_Drive]
    669674      call    DriveIO_LoadPartition
    670    pop     dx
    671 
    672    ; We seek to Partition Label within boot-record here
    673    mov     di, offset PartitionSector
    674 
    675    push    si
     675    pop     dx
     676
     677    ; We seek to Partition Label within boot-record here
     678    mov     di, offset PartitionSector
     679
     680    push    si
    676681      mov     al, [si+LocIPT_SystemID]
    677682      call    PART_SearchFileSysName
    678683      ; Replies AH - FileSysFlags, AL - UnhiddenID, SI - FileSysNamePtr
    679    pop     si
    680 
    681    test    ah, FileSysFlags_NoName       ; If NoName by FileSysFlag
    682    jnz     PSCPN_LetUserEditPartName     ;  -> don't put it into BR at anytime
    683    test    ah, FileSysFlags_FAT32        ; FAT32 specific name getting
    684    jz      PSCPN_ResumeNormal
    685    add     di, 1Ch                       ; Fix for FAT 32, shit
    686   PSCPN_ResumeNormal:
    687    add     di, 2Bh                       ; ES:DI - Name of Partition
    688 
    689 
    690 
    691 
    692 
    693    ; This code is used for BR and LVM checking
    694    ; Rousseau: Because AiR-BOOT v1.0.8 uses the LVM_VolumeName, which is copied
    695    ; to the IPT, this compare fails when the LVM_PartitionName is not
    696    ; the same as the LVM_VolumeName. In that case, only the LVM_VolumeName
    697    ; is updated. If they are the same, both are upated so they are the same
    698    ; again after the edit.
    699 
    700   PSCPN_CheckPartName:
     684    pop     si
     685
     686    test    ah, FileSysFlags_NoName       ; If NoName by FileSysFlag
     687    jnz     PSCPN_LetUserEditPartName     ;  -> don't put it into BR at anytime
     688    test    ah, FileSysFlags_FAT32        ; FAT32 specific name getting
     689    jz      PSCPN_ResumeNormal
     690    add     di, 1Ch                       ; Fix for FAT 32, shit
     691    PSCPN_ResumeNormal:
     692    add     di, 2Bh                       ; ES:DI - Name of Partition
     693
     694
     695
     696
     697
     698    ; This code is used for BR and LVM checking
     699    ; Rousseau: Because AiR-BOOT v1.0.8 uses the LVM_VolumeName, which is copied
     700    ; to the IPT, this compare fails when the LVM_PartitionName is not
     701    ; the same as the LVM_VolumeName. In that case, only the LVM_VolumeName
     702    ; is updated. If they are the same, both are upated so they are the same
     703    ; again after the edit.
     704
     705    PSCPN_CheckPartName:
    701706
    702707    ; Do no synchronization initially.
    703708    mov     byte ptr [SyncLvmLabels],0
    704709
    705   ; SI = IPT_Enty, DI points to LVM VolumeName.
     710    ; SI = IPT_Enty, DI points to LVM VolumeName.
    706711
    707712        ; If the partition is an LVM partition then disable editing completely.
     
    709714        jnz     no_type_35h
    710715
    711    ; Cannot boot LVM-Data partitions
    712    pusha
    713    mov     cx, 0C04h
    714    mov     si, offset TXT_SETUP_NoEditType35
    715    call    SETUP_ShowErrorBox
    716    popa
     716    ; Cannot boot LVM-Data partitions
     717    pusha
     718    mov     cx, 0C04h
     719    mov     si, offset TXT_SETUP_NoEditType35
     720    call    SETUP_ShowErrorBox
     721    popa
    717722
    718723
     
    740745
    741746
    742    mov     cx, 11                        ; Partition-Name-Length = 11 Bytes
    743    push    si
    744    push    di
     747    mov     cx, 11                        ; Partition-Name-Length = 11 Bytes
     748    push    si
     749    push    di
    745750      add     si, LocIPT_Name            ; DS:SI -> Partition-Name
    746751      repz    cmpsb
    747    pop     di
    748    pop     si
    749    jne     PSCPN_LetUserEditPartName     ; -> No BR/LVM Changing/Saving
    750 
    751    mov     byte ptr [ChangePartNameSave], 1         ; Remember, so we will save to BR
    752 
    753   ; SI = IPT_Enty, DI points to LVM PartitionName.
    754   PSCPN_LetUserEditPartName:
    755    ; User will now edit the volume label...
    756    mov     cx, 11
    757    add     si, LocIPT_Name               ; DS:SI -> Partition-Name
    758    call    VideoIO_LetUserEditString     ; -> does actual editing
    759    jnc     PSCPN_AllDone                 ; Did user abort ?
    760 
    761    test    byte ptr [ChangePartNameSave], 1
    762    jz      PSCPN_AllDone                 ; Actually we just skip BR/LVM-Save
    763 
    764    ; Check, where to save 2nd destination to...
    765 
    766    ;movzx   bx, dl
    767    mov   bl,dl
    768    mov   bh,0
    769 
    770    cmp     byte ptr [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM
    771    je      PSCPN_SaveBootRecord
    772 
    773 
    774    ; Make DI point to LVM VolumeName in LVM-entry
    775    ;~ sub     di,20
     752    pop     di
     753    pop     si
     754    jne     PSCPN_LetUserEditPartName     ; -> No BR/LVM Changing/Saving
     755
     756    mov     byte ptr [ChangePartNameSave], 1         ; Remember, so we will save to BR
     757
     758    ; SI = IPT_Enty, DI points to LVM PartitionName.
     759    PSCPN_LetUserEditPartName:
     760    ; User will now edit the volume label...
     761    mov     cx, 11
     762    add     si, LocIPT_Name               ; DS:SI -> Partition-Name
     763    call    VideoIO_LetUserEditString     ; -> does actual editing
     764    jnc     PSCPN_AllDone                 ; Did user abort ?
     765
     766    test    byte ptr [ChangePartNameSave], 1
     767    jz      PSCPN_AllDone                 ; Actually we just skip BR/LVM-Save
     768
     769    ; Check, where to save 2nd destination to...
     770
     771    ;movzx   bx, dl
     772    mov   bl,dl
     773    mov   bh,0
     774
     775    cmp     byte ptr [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM
     776    je      PSCPN_SaveBootRecord
     777
     778
     779    ; Make DI point to LVM VolumeName in LVM-entry
     780    ;~ sub     di,20
    776781
    777782        ; Points to LVM VolumeName.
     
    831836
    832837    LVM_no_sync_labels:
    833 
    834    ; Update LVM-CRC now...
    835    mov     si, offset LVMSector
    836    call    LVM_UpdateSectorCRC
    837    IFDEF ReleaseCode
    838       call    DriveIO_SaveLVMSector      ; Save sector
    839    ENDIF
    840    jmp     PSCPN_AllDone
    841 
    842    ; -----------------------------------------------------[BOOT-RECORD SAVE]---
    843   PSCPN_SaveBootRecord:
    844    ; Copy 11 bytes from IPT to Boot-Record
    845    mov     cx, 11
    846    push    si
    847       rep     movsb                      ; Copy IPT-name to Boot-Record
    848    pop     si
    849    IFDEF ReleaseCode
    850       call    DriveIO_SavePartition      ; Saves Boot-Record
    851    ENDIF
    852 
    853    ; And reset VIBR-CRC, otherwise virus-warning and system-halt
    854    sub     si, LocIPT_Name               ; Now pointer points to base again...
    855    call    PART_UpdateBootRecordCRC
    856 
    857   PSCPN_AllDone:
    858    ; This here is done for safety, because we misused CurPartition_Location
    859    xor     ax, ax
    860    mov     di, offset CurPartition_Location
    861    mov     cx, 4
    862    rep     stosw                         ; NUL out CurPartition_Location
    863    ret
     838        ; Update LVM-CRC now...
     839        mov     si, offset LVMSector
     840        call    LVM_UpdateSectorCRC
     841        IFDEF ReleaseCode
     842          call    DriveIO_SaveLVMSector      ; Save sector
     843        ENDIF
     844        jmp     PSCPN_AllDone
     845
     846    ; -----------------------------------------------------[BOOT-RECORD SAVE]---
     847    ; BOOKMARK: Save Boot Record (After change from Setup Menu)
     848    PSCPN_SaveBootRecord:
     849        ; Copy 11 bytes from IPT to Boot-Record
     850        mov     cx, 11
     851        push    si
     852          rep     movsb                      ; Copy IPT-name to Boot-Record
     853        pop     si
     854        IFDEF ReleaseCode
     855          call    DriveIO_SavePartition      ; Saves Boot-Record
     856        ENDIF
     857
     858    ; And reset VIBR-CRC, otherwise virus-warning and system-halt
     859    ; BOOKMARK: Update CRC on Partition Sector
     860    sub     si, LocIPT_Name               ; Now pointer points to base again...
     861    mov     bx, offset [PartitionSector]
     862    call    PART_UpdateBootRecordCRC
     863
     864    PSCPN_AllDone:
     865        ; This here is done for safety, because we misused CurPartition_Location
     866        xor     ax, ax
     867        mov     di, offset CurPartition_Location
     868        mov     cx, 4
     869        rep     stosw                         ; NUL out CurPartition_Location
     870    ret
    864871PARTSETUP_ChangePartitionName   EndP
    865872
  • trunk/BOOTCODE/VERSION.INC

    r51 r52  
    3535
    3636; The Year, Month and Day in BCD so we can easily extract nibbles.
    37 AB_YEAR             EQU     2012h
    38 AB_MONTH            EQU     09h
    39 AB_DAY              EQU     09h
     37AB_YEAR             EQU     2013h
     38AB_MONTH            EQU     02h
     39AB_DAY              EQU     24h
    4040
    4141; The Hours, Minutes and Seconds, again in BCD for easy manipulation.
    42 AB_HOURS            EQU     09h
    43 AB_MINUTES          EQU     09h
    44 AB_SECONDS          EQU     09h
     42AB_HOURS            EQU     21h
     43AB_MINUTES          EQU     16h
     44AB_SECONDS          EQU     00h
    4545
    4646; The AiR-BOOT signature uses big-endian so we shuffle some bits around.
Note: See TracChangeset for help on using the changeset viewer.