Changeset 30 for trunk/BOOTCODE/REGULAR


Ignore:
Timestamp:
May 6, 2011, 4:25:19 AM (15 years ago)
Author:
Ben Rietbroek
Message:

AiR-BOOT v1.07 -- As released with eCS v2.1. [2011-05-06]
Signature-date: 2006-03-13. (incorrect)
Trunk contains buildable v1.07 version as distributed with eCS v2.1.
Directory 'tags' contains v1.06 & v1.07 reference versions
built for all languages. Note that language ID for 'Dutch' changed
from 'DT' to 'NL' in v1.07 and that the v1.06 reference version also
uses 'NL' for 'Dutch'.
Also note that helper programs like the installer and setaboot are
are only modified for the OS/2 versions in v1.07.
The signature-date for v1.07 incorrectly states the same
date as for v1.06. The signature-version is correct.
Removed other binaries. (cd-rom images, old releases, etc.)
The tags serve as reference versions:

  • v1.06: rebuilt from source. (tags/v1.06r)
  • v1.07: built as released with eCS v2.1. (tags/v1.07r)
Location:
trunk/BOOTCODE/REGULAR
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/BOOTCODE/REGULAR/BOOTMENU.ASM

    r29 r30  
    2020;---------------------------------------------------------------------------
    2121
     22IFDEF ModuleNames
     23DB 'BOOTMENU',0
     24ENDIF
     25
    2226BOOTMENU_BuildBackground        Proc Near   Uses es di
    2327   call    VideoIO_CursorOff
     
    3236BOOTMENU_BuildBackground        EndP
    3337
     38CLR_COPYRIGHT_CLASSIC   = 0f00h
     39CLR_COPYRIGHT_BM  = 0700h
     40
    3441BOOTMENU_BuildMain              Proc Near   Uses es di
    3542   ; 1st line with Copyright information...
    3643   mov     cx, 0101h
    3744   call    VideoIO_Locate
    38    mov     cx, 0F00h
     45   mov     cx, CLR_COPYRIGHT_BM
    3946   call    VideoIO_Color
    4047   mov     si, offset Copyright
     
    4249
    4350   ; Boot-Window...
    44    mov     cx, 0901h
     51CLR_BOOT_WINDOW_CLASSIC    = 0901h
     52CLR_BOOT_WINDOW_BM         = 0701h
     53
     54   mov     cx, CLR_BOOT_WINDOW_BM
    4555   call    VideoIO_Color
    4656   mov     bx, 0201h
     
    5363   mov     al, TextChar_WinLineRight
    5464   mov     cl, 78
    55    call    VideoIO_Internal_MakeWinRight 
     65   call    VideoIO_Internal_MakeWinRight
    5666
    5767   mov     dl, 18h
     
    6373
    6474   ; Display Top-Infos in Boot-Window
    65    mov     cx, 0B01h
     75
     76CLR_TOP_INFOS_CLASSIC    = 0b01h
     77CLR_TOP_INFOS_BM  = 0301h
     78
     79   mov     cx, CLR_TOP_INFOS_BM
    6680   call    VideoIO_Color
    6781   mov     ch, 03h
     
    91105
    92106   ; Now make the separating vertical lines...
    93    mov     cx, 0901h
     107CLR_SEP_VERT_LINES_CLASSIC    = 0901h
     108CLR_SEP_VERT_LINES_BM   = 0701h
     109
     110   mov     cx, CLR_SEP_VERT_LINES_BM
    94111   call    VideoIO_Color
    95112   mov     ch, 03h
     
    157174   ; Boot-Window is DONE
    158175
    159    mov     cx, 0C04h
    160    call    VideoIO_Color
     176; Rousseau: = Colors =
     177; FG
     178; BG
     179; 7 = grey
     180; 6 = brown
     181; 5 = magenta
     182; 4 = red
     183; 3 = cyan
     184; 2 = green
     185; 1 = blue
     186
     187CLR_INFO_WINDOW_CLASSIC    = 0c04h
     188CLR_INFO_WINDOW_BM   = 0701h
     189
     190   mov     cx, CLR_INFO_WINDOW_BM
     191   ;mov     cx, 0C06h ; brown, main background
     192   call    VideoIO_Color                                                         ; Rousseau: color info window
     193
    161194   mov     bx, 1401h
    162195   mov     dx, 1950h
     
    173206   mov     cx, 1703h
    174207   call    VideoIO_Locate
    175    mov     cx, 0F04h
    176    call    VideoIO_Color
     208
     209CLR_INFO_TEXT_CLASSIC   = 0f04h
     210CLR_INFO_TEXT_BM   = 0701h
     211
     212   mov     cx, CLR_INFO_TEXT_BM                   ; Info text
     213   call    VideoIO_Color                                                         ; Rousseau: color info text
     214
    177215   mov     si, offset TXT_BootMenuHelpText1
    178216   call    VideoIO_Print
     
    182220   call    VideoIO_Print
    183221
    184    mov     cx, 0C04h
     222
     223CLR_F10_SETUP_CLASSIC   = 0c04h
     224CLR_F10_SETUP_BM        = 0901h
     225
     226   mov     cx, CLR_F10_SETUP_BM                            ; background F10 enter Setup
    185227   call    VideoIO_Color
    186228
     
    198240   call    VideoIO_PrintSingleChar
    199241   ; HelpWindow done...
     242
     243
     244   ; Rousseau: Debug Stuff, put here after building Main Menu
     245   ;call    VideoIO_DBG_WriteString
     246   ;call    VideoIO_DBG_WriteString2
     247
    200248   ret
    201249BOOTMENU_BuildMain              EndP
     250
     251
    202252
    203253BOOTMENU_BuildGoodBye           Proc Near   Uses es di
     
    209259   rep     stosw
    210260   ; -------------------------------------------
    211    mov     cx, 0D05h
     261
     262CLR_GOODBYE_WINDOW_CLASSIC = 0d05h
     263CLR_GOODBYE_WINDOW_BM   = 0f01h
     264
     265   mov     cx, CLR_GOODBYE_WINDOW_BM
    212266   call    VideoIO_Color
    213267   mov     bx, 0101h
     
    221275   mov     cx, 9
    222276   mov     al, WinCharRight
    223    mov     ah, 05Dh
     277
     278   ; Little part before version in goodbye-window
     279   ; Does not use color-function
     280   ;mov     ah, 05Dh
     281   mov     ah, 01fh
    224282   rep     stosw
     283
    225284   mov     cx, 010Bh
    226285   call    VideoIO_Locate
     
    240299   mov     al, TextChar_WinRep4
    241300   call    VideoIO_PrintSingleChar
    242    mov     cx, 0E01h
     301
     302CLR_GOODBYE_AB_VERSION_CLASSIC   = 0e01h
     303CLR_GOODBYE_AB_VERSION_BM  = 0e03h
     304
     305   mov     cx, CLR_GOODBYE_AB_VERSION_BM
    243306   call    VideoIO_Color
    244307   mov     si, offset Copyright
    245308   mov     cl, 11+CopyrightVersionLen
    246309   call    VideoIO_FixedPrint
    247    mov     cx, 0D05h
     310
     311   mov     cx, CLR_GOODBYE_WINDOW_BM
     312
    248313   call    VideoIO_Color
    249314   mov     al, TextChar_WinRep5
     
    251316   mov     cx, 020Dh
    252317   call    VideoIO_Locate
    253    mov     cx, 0F05h
     318
     319   CLR_GOODBYE_WINDOW_CLASSIC_2    = 0f05h
     320   CLR_GOODBYE_WINDOW_BM_2   = 0701h
     321
     322   mov     cx,  CLR_GOODBYE_WINDOW_BM_2
    254323   call    VideoIO_Color
    255324   inc     si
     
    272341BOOTMENU_BuildGoodBye           EndP
    273342
     343
     344
    274345; Must preserve AX!
    275346BOOTMENU_BuildTimedBootText     Proc Near   Uses ax cx si es di
    276    mov     cx, 1503h
    277    call    VideoIO_Locate
    278    mov     cx, 0E04h
     347   mov     cx, 1503h ;
     348   call    VideoIO_Locate
     349
     350CLR_NON_TIMED_BAR_CLASSIC  = 0e04h
     351CLR_NON_TIMED_BAR_BM = 0701h
     352
     353   mov     cx, CLR_NON_TIMED_BAR_BM                      ; non-timed time bar
    279354   call    VideoIO_Color
    280355   call    VideoIO_Internal_SetRegs
     
    294369   mov     cx, 1503h
    295370   call    VideoIO_Locate
    296    mov     cx, 0E04h
     371
     372CLR_TIMED_BAR_CLASSIC   = 0e04h
     373CLR_TIMED_BAR_BM  = 0e04h
     374
     375   mov     cx, CLR_TIMED_BAR_BM ; timed time bar, yellow on red
    297376   call    VideoIO_Color
    298377   mov     si, offset TXT_TimedBootLine  ; will print TimedBootEntryName too
     
    325404BOOTMENU_RefreshPartitionText   EndP
    326405
     406
     407CLR_VOLUME_INDEX_CLASSIC   = 0f01h
     408CLR_VOLUME_INDEX_BM  = 0f01h
     409
    327410; Writes Partition-Information to Screen (Boot-Menu)
    328411;        In: CH - Line to print info
     
    339422   mov     dh, cl
    340423   call    VideoIO_Locate
    341    mov     cx, 0F01h                     ; Bwhite, blue
     424   mov     cx, CLR_VOLUME_INDEX_BM                     ; Bwhite, blue
    342425   call    VideoIO_Color
    343426   mov     al, dl
     
    347430   ; === Display Drive-Number and Size (Size only in detailed view) ===
    348431   add     dh, 5
    349    movzx   cx, dh
    350    call    VideoIO_Locate
    351    mov     cx, 0D01h
     432   ;movzx   cx, dh
     433   mov   cl,dh
     434   mov   ch,0
     435
     436   call    VideoIO_Locate
     437
     438CLR_HD_INDEX_CLASSIC    = 0d01h
     439CLR_HD_INDEX_BM   = 0701h
     440
     441   mov     cx, CLR_HD_INDEX_BM
    352442   call    VideoIO_Color                 ; Violet, blue
    353443   mov     si, PartPointer
     
    367457     BMBPT_IsHarddrive:
    368458      ; Now display Size-Element...
    369       mov     cx, 0501h
     459
     460CLR_HD_SIZE_CLASSIC  = 0501h
     461CLR_HD_SIZE_BM = 0701h
     462
     463      mov     cx, CLR_HD_SIZE_BM
    370464      call    VideoIO_Color              ; Dark-Violet, Blue
    371465      mov     al, '/'
    372466      call    VideoIO_PrintSingleChar
    373       mov     cx, 0D01h
     467      mov     cx, CLR_HD_SIZE_BM
    374468      call    VideoIO_Color              ; Violet, Blue
    375469      mov     ax, PartPointer            ; Get Size-Element from PartPtr (AX)
     
    383477
    384478   ; === Display Label ===
    385    movzx   cx, dh
    386    call    VideoIO_Locate
    387    mov     cx, 0E01h
     479   ;movzx   cx, dh
     480   mov   cl,dh
     481   mov   ch,0
     482
     483   call    VideoIO_Locate
     484
     485CLR_LABEL_CLASSIC    = 0e01h
     486CLR_LABEL_BM   = 0f01h
     487
     488   mov     cx, CLR_LABEL_BM
    388489   call    VideoIO_Color                 ; Yellow, blue
    389490   mov     si, PartPointer
     
    394495   ; === Display Type ===
    395496   add     dh, 14
    396    movzx   cx, dh
     497   ;movzx   cx, dh
     498   mov   cl,dh
     499   mov   ch,0
     500
    397501   call    VideoIO_Locate
    398502   mov     si, PartPointer
    399503   mov     al, [si+LocIPT_SystemID]
    400504   call    PART_SearchFileSysName
    401    mov     cx, 0C01h
     505
     506CLR_FS_NAME_CLASSIC  =  0c01h
     507CLR_FS_NAME_BM =  0701h
     508
     509   mov     cx, CLR_FS_NAME_BM
    402510   call    VideoIO_Color                 ; Hrot, Blau
    403511   mov     cl, 8
     
    410518;       Out: DX - will get returned (fixed, if needed)
    411519BOOTMENU_BuildChoiceBar         Proc near   Uses ax es di
     520
     521   ;call  SOUND_Beep
     522
    412523   call    VideoIO_WaitRetrace
     524
     525
     526   ;call  SOUND_Beep
     527
    413528   mov     cl, 10h    ; Color BLUE, Partition DL
    414529   call    BOOTMENU_ReColorPart
     530
     531   ;call  SOUND_Beep
    415532
    416533   ; Check, if clipping needed...
     
    448565   call    BOOTMENU_RefreshPartitionText
    449566
     567
     568; Keuze bar
     569; 00h black
     570; 10h blue
     571; 20h green (also nice)
     572; 30h cyan (also nice)
     573; 40h red
     574; 50h magenta
     575; 60h brown (nice)
     576; 70h white
     577; 80h grey
     578; 90h light blue (nice)
     579; 0a0h bright green
     580; 0b0h bright cyan
     581; 0c0h bright red
     582; 0d0h bright magenta
     583; 0e0h bright yellow
     584; 0f0h bright white
     585
     586
     587CLR_SELECTION_BAR_CLASSIC  = 50h
     588CLR_SELECTION_BAR_BM = 090h
     589
     590
     591
    450592  BMBCB_AfterScrolling:
    451    mov     cl, 50h    ; Color PINK, Partition DL
     593   mov     cl, CLR_SELECTION_BAR_BM    ; Color PINK, Partition DL
    452594   call    BOOTMENU_ReColorPart
    453595   ret
     
    457599; Destroyed: None, but Locate-Pointer gets set
    458600BOOTMENU_ReColorPart            Proc Near   Uses bx cx es di
     601
     602  ; call  SOUND_Beep
     603
    459604   mov     bh, cl     ; Color to BH
    460605   ; First calculate location of bar
     
    475620      and     al, 0Fh
    476621      or      al, bh                     ; Adds background color (from BH)
     622
     623      ;mov      al,97h
     624
    477625      mov     es:[di], al
    478626      add     di, 2
     
    615763   ; Got it, so display bar...
    616764   mov     dh, dl
     765
     766   ;call  SOUND_Beep
     767
    617768   call    BOOTMENU_BuildChoiceBar       ; DH - Active, DL - Last Active
     769
     770   ;call  SOUND_Beep
     771
    618772   call    SOUND_PreBootMenu
    619773
     774
    620775  BME_MainLoop:
     776
     777     ;call    VideoIO_DBG_WriteString2    ; Rousseau
     778
    621779   test    TimedBootEnable, 1
    622780   jz      BME_NoTimedBoot
  • trunk/BOOTCODE/REGULAR/DRIVEIO.ASM

    r29 r30  
    1919;                                                      AiR-BOOT / DRIVE I/O
    2020;---------------------------------------------------------------------------
     21
     22
     23
     24IFDEF ModuleNames
     25DB 'DRIVEIO',0
     26ENDIF
    2127
    2228; Note: Some routines set DS/ES to CS or even address via CS, even if its not
     
    141147;  This is calculated by Sector*Heads. Comparing will get done with Bit 25-10
    142148;  on LBA sectors, so we actually divide sector number by 1024.
    143 DriveIO_InitLBASwitchTable      Proc Near   Uses es di
     149DriveIO_InitLBASwitchTable      Proc Near   Uses es di                           ; Rousseau: LBA !
    144150   mov     di, offset LBASwitchTable
    145151   mov     dh, TotalHarddiscs
     
    152158         jc      DIOILUT_Error
    153159         and     cl, 111111b    ; Isolate lower 6 bits of CL -> sector count
    154          movzx   ax, cl
    155          mov     bl, dh         ; DH -> head count
     160
     161         ; huge disk 127 sec/track on <1TB using DANI
     162;         mov     cl, 07Fh
     163
     164         ;movzx   ax, cl
     165         mov   al,cl
     166         mov   ah,0
     167
     168         mov     bl, dh         ; DH -> head count                               ; Rousseau: nope, it's max head number !
    156169         mul     bl             ; AX = Sectors*Heads
    157170         shl     ah, 1
     
    168181DriveIO_InitLBASwitchTable      EndP
    169182
     183
     184
     185
    170186; Adjusts BX:AX / CX:DX to meet LVM sector location
    171187;  Destroys SI
    172 DriveIO_LVMAdjustToInfoSector   Proc Near   Uses
    173    push    cx
    174       xor     ch, ch
    175       and     cl, 63                     ; Isolate lower bits, because upper
    176       mov     si, 63                     ;  ones may be used for cylinder
    177       sub     si, cx
    178    pop     cx
    179    add     ax, si
    180    adc     bx, 0                         ; Adjust LBA Sector (BX:AX)
    181    or      cl, 63                        ; Set Sector to 63
    182    ret
     188; Rousseau: Enhanced to handle sector-numbers 127 and 255 besides 63 for LVM-info sectors.
     189;           Ugly, need to cleanup.
     190DriveIO_LVMAdjustToInfoSector   Proc Near   Uses                                 ; Rousseau: LVM stuff !
     191
     192
     193
     194;      pusha
     195;      call     AuxIO_TeletypeNL
     196
     197      ; LBA
     198;      xchg     dx,bx
     199;      call     AuxIO_TeletypeHexDWord
     200;      call     AuxIO_TeletypeNL
     201;      xchg     bx,dx
     202
     203      ; CYL
     204;      mov      al,ch
     205;      call     AuxIO_TeletypeHexByte
     206;      call     AuxIO_TeletypeNL
     207
     208      ; HEAD
     209;      mov      al,dh
     210;      call     AuxIO_TeletypeHexByte
     211;      call     AuxIO_TeletypeNL
     212
     213      ; SEC
     214;      mov      al,cl
     215;      call     AuxIO_TeletypeHexByte
     216;      call     AuxIO_TeletypeNL
     217
     218      ; DRIVE
     219;      mov      al,dl
     220;      call     AuxIO_TeletypeHexByte
     221;      call     AuxIO_TeletypeNL
     222
     223;      popa
     224
     225
     226      ;local ts:word
     227      ;local ts2:word
     228
     229      pusha
     230
     231         ; Dump drive
     232         mov      si,offset drive
     233         call     AuxIO_Print
     234         xchg     al,dl
     235         call     AuxIO_TeletypeHexByte
     236         call     AuxIO_TeletypeNL
     237         xchg     dl,al
     238
     239         ; Dump SPT
     240         mov      si,offset spt_used
     241         call     AuxIO_Print
     242         push     dx
     243         push     bx
     244            xor      dh,dh
     245            and      dl,01111111b
     246            shl      dx,1
     247            shl      dx,1
     248            mov      bx, offset TrueSecs
     249            add      bx,dx
     250            mov      ax,word ptr [bx]
     251
     252            ;mov      [ts],ax
     253
     254            call     AuxIO_TeletypeHexWord
     255            call     AuxIO_TeletypeNL
     256         pop      bx
     257         pop      dx
     258
     259         pusha
     260            push     dx
     261               ; Location of extended position
     262               mov      dx,word ptr [ExtendedAbsPos+02]
     263               mov      ax,word ptr [ExtendedAbsPos+00]
     264               call     AuxIO_TeletypeHexDWord
     265               call     AuxIO_TeletypeNL
     266            pop      dx
     267
     268            xor      dh,dh
     269            and      dl,01111111b
     270            shl      dx,1
     271            shl      dx,1
     272            mov      bx, offset TrueSecs
     273            add      bx,dx
     274
     275            mov      ax, word ptr[bx]
     276            call     AuxIO_TeletypeHexWord
     277            call     AuxIO_TeletypeNL
     278            mov      al,[ExtendedAbsPosSet]           ; if true -> 1st sector of extpart (EBR), not logpart(BPB)
     279            call     AuxIO_TeletypeHexByte
     280            call     AuxIO_TeletypeNL
     281      ;      mov      si,offset PartitionSector
     282      ;      call     AuxIO_DumpSector
     283         popa
     284
     285         ; LBA
     286         mov      si,offset before_lvm_adjust
     287         call     AuxIO_Print
     288
     289         xchg     dx,bx
     290         call     AuxIO_TeletypeHexDWord
     291         call     AuxIO_TeletypeNL
     292         xchg     bx,dx
     293      popa
     294
     295
     296      ;or       bx,ax
     297      test     [ExtendedAbsPosSet],1
     298      jz       pri
     299
     300
     301
     302
     303      pusha
     304         mov      si,offset before_lvm_adjust_log
     305         call     AuxIO_Print
     306         ; LBA
     307         xchg     dx,bx
     308         call     AuxIO_TeletypeHexDWord
     309         call     AuxIO_TeletypeNL
     310         xchg     bx,dx
     311      popa
     312
     313
     314      push     dx
     315      push     bx
     316         xor      dh,dh
     317         and      dl,01111111b
     318         shl      dx,1
     319         shl      dx,1
     320         mov      bx,offset TrueSecs
     321         add      bx,dx
     322         mov      dx,[bx]
     323         dec      dx
     324         add      ax,dx
     325      pop      bx
     326      pop      dx
     327      adc      bx,0
     328
     329
     330      pusha
     331         mov      si,offset after_lvm_adjust_log
     332         call     AuxIO_Print
     333         ; LBA
     334         xchg     dx,bx
     335         call     AuxIO_TeletypeHexDWord
     336         call     AuxIO_TeletypeNL
     337         xchg     bx,dx
     338      popa
     339
     340      jmp      done
     341
     342
     343
     344
     345pri:
     346
     347
     348      push     ax
     349      push     cx
     350         xor      ch, ch                           ; Zero out upper-byte
     351
     352         push     dx
     353            xor      dh,dh
     354            and      dl,01111111b
     355            shl      dx,1
     356            shl      dx,1
     357            push     bx
     358               mov      bx,offset TrueSecs
     359               add      bx,dx
     360               mov      ax,[bx]
     361               ;mov      [ts2],ax
     362            pop      bx
     363         pop      dx
     364
     365
     366
     367         ;mov      al, 63
     368         ;call VideoIO_PrintByteDynamicNumber
     369         ;self: jmp self
     370
     371
     372
     373         ; DEZE WERKT SOMS NIET GOED
     374         ; ROMMELT MET CYLINDERS
     375         ; ALLEEN TOEPASSEN ALS INT13X NIET ACTIEF !
     376
     377         and      cl, al                           ; Isolate lower bits, because upper
     378         mov      ah, 0
     379         mov      si, ax                           ;  ones may be used for cylinder
     380         sub      si, cx
     381
     382      pop      cx
     383      pop      ax
     384
     385      or       cl, al                           ; Set sector to last sector
     386
     387      add      ax, si                           ; Adjust lower LBA
     388      adc      bx, 0                            ; Adjust LBA Sector (BX:AX)
     389
     390
     391
     392      ;push     ax
     393      ;call     AuxIO_TeletypeHexWord
     394      ;call     AuxIO_TeletypeNL
     395      ;mov      ax,[ts]
     396      ;call     AuxIO_TeletypeHexWord
     397      ;call     AuxIO_TeletypeNL
     398      ;mov      ax,[ts2]
     399      ;call     AuxIO_TeletypeHexWord
     400      ;call     AuxIO_TeletypeNL
     401      ;pop      ax
     402
     403      ;and      ax,[ts]
     404
     405      jmp done
     406
     407
     408
     409done:
     410
     411
     412
     413      pusha
     414         mov      si,offset after_lvm_adjust
     415         call     AuxIO_Print
     416         ; LBA
     417         xchg     dx,bx
     418         call     AuxIO_TeletypeHexDWord
     419         call     AuxIO_TeletypeNL
     420         xchg     bx,dx
     421      popa
     422
     423
     424
     425;      pusha
     426;      call     AuxIO_TeletypeNL
     427
     428      ; CYL
     429;      mov      al,ch
     430;      call     AuxIO_TeletypeHexByte
     431;      call     AuxIO_TeletypeNL
     432
     433      ; HEAD
     434;      mov      al,dh
     435;      call     AuxIO_TeletypeHexByte
     436;      call     AuxIO_TeletypeNL
     437
     438      ; SEC
     439;      mov      al,cl
     440;      call     AuxIO_TeletypeHexByte
     441;      call     AuxIO_TeletypeNL
     442
     443      ; DRIVE
     444;      mov      al,dl
     445;      call     AuxIO_TeletypeHexByte
     446;      call     AuxIO_TeletypeNL
     447
     448;      popa
     449
     450
     451
     452      ret
    183453DriveIO_LVMAdjustToInfoSector   EndP
    184454
    185 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    186  Routine: Loads partition to ExecBase and checks for validity
    187  ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
    188  Calling : bx:ax - Absolute sector
    189            cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)
    190  Returns : Carry Set if invalid partition encountered
    191  Preserve: all registers
    192  ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*
     455drive:                  db 'drive                    : ',0
     456before_lvm_adjust:      db 'before lvm adjust        : ',0
     457after_lvm_adjust:       db 'after lvm adjust         : ',0
     458before_lvm_adjust_log:  db 'before lvm logical adjust: ',0
     459after_lvm_adjust_log:   db 'after lvm logical adjust : ',0
     460spt_used:               db 'spt used                 : ',0
     461
     462
     463
     464; #########################################################################
     465; Routine: Loads partition to ExecBase and checks for validity
     466; #########################################################################
     467; Calling : bx:ax - Absolute sector
     468;           cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)
     469; Returns : Carry Set if invalid partition encountered
     470; Preserve: all registers
     471; #########################################################################
    193472DriveIO_LoadPartition           Proc Near  Uses si
    194473   mov     wptr cs:[CurPartition_Location+0], ax
     
    209488   stc                                   ; Set carry, so no partition table
    210489  DIOLP_Success:
     490
     491IFDEF AuxDebug
     492   ; show current partition location
     493   pushf
     494   pusha
     495      call     AuxIO_TeletypeNL
     496      mov      si,offset db_curpartloc
     497      call     AuxIO_Print
     498      mov      dx,word ptr [CurPartition_Location+02]
     499      mov      ax,word ptr [CurPartition_Location+00]
     500      call     AuxIO_TeletypeHexDWord
     501      call     AuxIO_TeletypeNL
     502      mov      si,offset PartitionSector
     503      call     AuxIO_DumpSector
     504      call     AuxIO_TeletypeNL
     505   popa
     506   popf
     507ENDIF
     508
    211509   ret
    212510  DIOLP_Failed:
     
    214512DriveIO_LoadPartition           EndP
    215513
    216 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    217  Routine: Writes a partition from ExecBase to its original sector
    218  ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
    219  Calling : none
    220  Returns : none
    221  Preserve: all registers
    222  ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*
     514; #########################################################################
     515; Routine: Writes a partition from ExecBase to its original sector
     516; #########################################################################
     517; Calling : none
     518; Returns : none
     519; Preserve: all registers
     520; #########################################################################
    223521DriveIO_SavePartition           Proc Near  Uses ax bx cx dx si
    224522   mov     ax, wptr cs:[CurPartition_Location+0]
     
    237535DriveIO_LoadTmpSector           Proc Near  Uses
    238536   mov     si, offset TmpSector
    239    call    DriveIO_LoadSector
     537   call    DriveIO_LoadSector                                                    ; Uses INT13X if needed
    240538   ret
    241539DriveIO_LoadTmpSector           EndP
     
    256554   mov     dx, wptr cs:[CurPartition_Location+4]
    257555   mov     cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location
    258    call    DriveIO_LVMAdjustToInfoSector
     556
     557   call    DriveIO_LVMAdjustToInfoSector                                         ; Rousseau: LVM stuff !
     558
    259559   mov     si, offset LVMSector
    260560   call    DriveIO_LoadSector
    261    call    LVM_CheckSectorSignature
     561
     562IFDEF AuxDebug
     563   ; show current partition location
     564   pushf
     565   pusha
     566      call     AuxIO_TeletypeNL
     567      mov      si,offset db_curlvmsec
     568      call     AuxIO_Print
     569      mov      dx,bx
     570      call     AuxIO_TeletypeHexDWord
     571      call     AuxIO_TeletypeNL
     572      mov      si,offset LVMSector
     573      call     AuxIO_DumpSector
     574      call     AuxIO_TeletypeNL
     575   popa
     576   popf
     577ENDIF
     578
     579   ; Rousseau
     580   ;pushf
     581   ;pusha
     582   ;mov   si, offset MyText4
     583   ;call  VideoIO_Print
     584   ;mov   si, offset LVMSector
     585   ;mov   al, [si+LocLVM_VolumeLetter2]
     586   ;call  VideoIO_PrintByteDynamicNumber
     587   ;mov   al, [si+LocLVM_Startable]
     588   ;call  VideoIO_PrintByteDynamicNumber
     589   ;mov   al, [si+LocLVM_OnBootMenu]
     590   ;call  VideoIO_PrintByteDynamicNumber
     591   ;;self: jmp self
     592   ;popa
     593   ;popf
     594
     595   call    LVM_CheckSectorSignature                                              ; Rousseau: LVM stuff !
    262596   jnc     DIOLLVMS_NoLVMSector
    263    call    LVM_CheckSectorCRC
     597   call    LVM_CheckSectorCRC                                                    ; Rousseau: LVM stuff !
    264598   jnc     DIOLLVMS_NoLVMSector
    265599   ret
     
    303637   jnz     InScanMode
    304638   jmp     MBR_LoadError
    305   InScanMode:   
     639  InScanMode:
    306640   mov     si, offset TXT_BrokenPartitionTable
    307641   push    cs
     
    319653DriveIO_GotLoadError            EndP
    320654
    321 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    322  Routine: Loads a specified sector to DS:DI
    323  ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
    324  Calling : bx:ax - Absolute sector
    325            cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)
    326            ds:si - Destination-Adress
    327  Returns : none
    328  Preserve: all registers
    329  ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*
    330 DriveIO_LoadSector              Proc Near  Uses ax bx ds si es di
     655; #########################################################################
     656; Routine: Loads a specified sector to DS:DI
     657; #########################################################################
     658; Calling : bx:ax - Absolute sector
     659;           cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)
     660;           ds:si - Destination-Adress
     661; Returns : none
     662; Preserve: all registers
     663; #########################################################################
     664DriveIO_LoadSector              Proc Near  Uses ax bx ds si es di                ; Rousseau: Disk IO
    331665   test     cs:[CurIO_UseExtension], 1
    332666   jz       DIOLS_UseNormal
    333667   ; Are we forced do use LBA via Setting?
    334    test     cs:[CFG_ForceLBAUsage], 1
     668   test     cs:[CFG_ForceLBAUsage], 1                                            ; Rousseau: LBA
    335669   jnz      DIOLS_UseExtension
    336670   ; Is the drive not a harddrive?
     
    351685         pop      es
    352686         mov      bx, si                     ; ES:BX - Destination
    353          mov      ax, 0201h                  ; Function 2 - Load Sector
     687         mov      ax, 0201h                  ; Function 2 - Load Sector          ; Rousseau: Disk IO -- legacy BIOS call
    354688         int      13h
    355689         jnc      DIOLS_Success
     
    370704      pop     ds
    371705      mov     si, offset DriveIO_DAP
    372       mov     ah, 42h                        ; Extended Read
     706      mov     ah, 42h                        ; Extended Read                     ; Rousseau: Disk IO -- extended BIOS call
    373707      int     13h
    374708   pop     cx
     
    381715DriveIO_LoadSector              EndP
    382716
    383 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    384  Routine: Writes DS:SI to a specified sector
    385  ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
    386  Calling : bx:ax - Absolute sector
    387            cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)
    388            ds:si - Source-Adress
    389  Returns : none
    390  Preserve: all registers
    391  ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*
     717; #########################################################################
     718; Routine: Writes DS:SI to a specified sector
     719; #########################################################################
     720; Calling : bx:ax - Absolute sector
     721;           cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)
     722;           ds:si - Source-Adress
     723; Returns : none
     724; Preserve: all registers
     725; #########################################################################
    392726DriveIO_SaveSector              Proc Near  Uses ax bx cx ds si es di
    393727   test     cs:[CurIO_UseExtension], 1
    394728   jz       DIOSS_UseNormal
    395729   ; Are we forced do use LBA via Setting?
    396    test     cs:[CFG_ForceLBAUsage], 1
     730   test     cs:[CFG_ForceLBAUsage], 1                                            ; Rousseau: LBA
    397731   jnz      DIOSS_UseExtension
    398732   ; Is the drive not a harddrive?
     
    440774   ret
    441775DriveIO_SaveSector              EndP
     776
     777
     778; See if a LVM-sector is valid.
     779; In  : si, pointer to sector
     780; Out : ZF=true, not valid; ZF=false, valid
     781DriveIO_LVMSectorValid           Proc  Near
     782      pusha
     783
     784      call     LVM_CheckSectorSignature
     785      mov      al,0
     786      rcl      al,1                          ; Move CY to AL.0
     787      call     AuxIO_TeletypeHexByte
     788      call     AuxIO_TeletypeNL
     789      or       al,al                         ; Zero if not a valid sector
     790      jz       DriveIO_LVMSectorValid_End    ; Not a valid sector
     791
     792      call     LVM_CheckSectorCRC
     793      stc
     794      mov      al,0
     795      rcl      al,1                          ; Move CY to AL.0
     796      call     AuxIO_TeletypeHexByte
     797      call     AuxIO_TeletypeNL
     798      or       al,al                         ; Zero if not a valid sector
     799
     800   DriveIO_LVMSectorValid_End:
     801
     802      popa
     803      ret
     804DriveIO_LVMSectorValid           EndP
     805
     806; ------------------------------------------------------
     807; Rousseau: # Load the master LVM-sector is one exists #
     808; ------------------------------------------------------
     809; Load the master LVM-sector to get the number of sectors per track as eCS views the drive.
     810; If no master LVM-sector is found it is assumed eCS is not installed.
     811; The master LVM-sector can be located at three different places according to drive size
     812; and partitioning scheme and driver used.
     813; When DANIS506.ADD is used, the eCS extended geometry will be 255/127 for drives >502GiB but <1TiB.
     814; Then the location will be sector 127 which is LBA 126 (7Eh).
     815; IBM1S506.ADD will always use 255/255 for the extended eCS geometry.
     816; DANIS506.ADD will use 255/255 for drives >1TiB.
     817; Then the location of the master LVM-sector will be 255 which is LBA 254 (FEh).
     818; When eCS is installed on a huge drive that alread had a system on it, eCS will be confined to the
     819; lower 502GiB of the drive. In this case the normal geometry from Int13X will be used.
     820; This is also the case when no valid master LVM-sector can be found.
     821;
     822; Return ZF=true if not found, ZF=false when valid master LVM-sector found.
     823DriveIO_LoadMasterLVMSector      Proc  Near
     824      pusha
     825
     826      mov      si,offset db_lmlvm
     827      ;call     AuxIO_Print
     828
     829      mov      al,dl
     830      ;call     AuxIO_TeletypeHexByte
     831      ;call     AuxIO_TeletypeNL
     832
     833
     834      ; Loop over the sector-translation table,
     835      ; process the first three values from high (255) to low (bios spt, most likely 63)
     836      mov      cx,3
     837DriveIO_LoadMasterLVMSector_NextTry:
     838      mov      bx,offset secs_per_track_table         ; sector translation table that corresponds with IsHugeDrive
     839      mov      si, offset LVMSector                   ; space to load the master LVM-sector
     840      mov      [DriveIO_DAP_NumBlocks],1              ; number of sectors to read
     841      mov      wptr [DriveIO_DAP_Transfer+0],si       ; low part of transfer address
     842      mov      ax, ds
     843      mov      wptr [DriveIO_DAP_Transfer+2],ax       ; high part of transfer address
     844      mov      ax,cx                                  ; use the counter...
     845      dec      ax                                     ; as an index into the table
     846      xlatb                                           ; translate to number of sectors
     847      dec      al                                     ; LBA is zero-based, so adjust
     848
     849IFDEF AuxDebug
     850      ; Dump the value
     851      ;call     AuxIO_TeletypeHexByte
     852      ;call     AuxIO_TeletypeNL
     853ENDIF
     854
     855      mov      wptr [DriveIO_DAP_Absolute+0],ax       ; LBA low      ;
     856      mov      wptr [DriveIO_DAP_Absolute+2],00h      ; LBA high
     857      mov      si, offset DriveIO_DAP                 ; address request packet
     858      mov      ah, 42h
     859      int      13h                                    ; do the i/o
     860      jc       DriveIO_LoadMasterLVMSector_NotFound   ; oops, there was an error
     861
     862IFDEF AuxDebug
     863      ; Dump title
     864      mov      si,offset db_masterlvm
     865      ;call     AuxIO_Print
     866
     867      ; Dum sector
     868      mov      si, offset LVMSector
     869      ;call     AuxIO_DumpSector
     870      ;call     AuxIO_TeletypeNL
     871ENDIF
     872      ; See is this is a valid LVM-sector
     873      call     DriveIO_LVMSectorValid
     874
     875IFDEF AuxDebug
     876      pushf
     877      ;call     AuxIO_TeletypeNL
     878      popf
     879ENDIF
     880      ; Yep, we found the master LVM-sector
     881      jnz      DriveIO_LoadMasterLVMSector_Found
     882      ; Try next location
     883      loop     DriveIO_LoadMasterLVMSector_NextTry
     884
     885   ; No master LVM-sector found, set ZF=true
     886   DriveIO_LoadMasterLVMSector_NotFound:
     887      xor      ax,ax
     888
     889   ; Jump here with ZF=false if found
     890   DriveIO_LoadMasterLVMSector_Found:
     891
     892      popa
     893      ret
     894DriveIO_LoadMasterLVMSector     Endp
     895
     896
     897
     898
     899; ---------------------------------------------------
     900; Rousseau ## Large drives, (eCS) geometry and LBA ##
     901; ---------------------------------------------------
     902; A sector size of 512 bytes is assumed in the below calculations.
     903; Note that this scheme changes when the sector size will be 4096 or larger,
     904; like with modern drives that do not translate to 512 bytes per sector anymore.
     905; These drives will have a capacity above the 2TiB LBA32 boundary.
     906; For now, we assume drives <=2TiB with a sector size of 512 bytes.
     907
     908; There are a few boundaries that are of importance.
     909; Note that these are disk-boundaries and not partition boundaries.
     910; Even with a small partition, like <502GiB, OS/2 will use extended geometry on an
     911; empty huge disk.
     912; These boundaries are (from high to low):
     913
     914; (code 5)
     915; 2^32 = 4294967296 = 100000000 sectors = 2048 GiB
     916;   This is the LBA32 2TiB boundary.
     917;   Everything above it must be addressed using LBA48.
     918;   OS/2 can currently not address this space above.
     919
     920; (code4)
     921; 65536*255*255 = 4261478400 = FE010000 sectors ~ 2032 GiB
     922;   This is the max OS/2 boundary using 255/255 extended geometry.
     923;   OS/2 can currently not address this space above.
     924
     925; (code 3)
     926; 2^31 = 2147483648 = 80000000 sectors = 1024 GiB
     927;   This is the LBA32 1TiB boundary.
     928;   OS/2 can address this space and will use 255/255 extended geometry.
     929
     930; (code 2)
     931; 65536*255*127 = 2122383360 = 7E810000 sectors ~ 1012 GiB
     932;   This is the DANI 1TiB boundary.
     933;   OS/2 can address this space and will use 255/255 extended geometry.
     934;   Below this DANI will use 255/127 extended geometry.
     935;   This matters on where the LVM-sectors are located !
     936
     937; (code 1)
     938; 65536*255*63  = 1052835840 = 3EC10000 sectors ~ 502 GiB
     939;   This is the current OS/2 limit using this geometry because OS/2 can currently
     940;   not address more than 65536 cylinders.
     941;   DANI will address space above with 255/127 extended geometry up until the DANI 1TiB boundary (code 2)
     942
     943; (code 0)
     944; Everything below 65536*255*63 will be addressed using standard geometry.
     945
     946
     947;
     948; This function will return the following values:
     949;
     950
     951; 5 = This drive is above the 2^32 LBA32 (2TB) boundary and has more than 4294967296 sectors.
     952;     LBA48 addressing is needed to access the complete capacity of the drive.
     953;     OS/2 is currently unable to do so.
     954
     955; 4 = This drive is above the 65536*255*255 (4261478400) boundary but below 2^32.
     956;     This is an OS/2 boundary and OS/2 is not able to access the drive above this boundary.
     957
     958; 3 = This drive is above the 2^31 (1TB) boundary and has more than 2147483648 sectors.
     959;     OS/2 is able to access the drive using it's extended geometry.
     960;     Both DANIS506 and IBM1S506 will use the 255/255 scheme.
     961
     962; 2 = This drive is above the 65536*255*127 (2122383360) boundary but below 2^31.
     963;     OS/2 is able to access the drive using it's extended geometry.
     964;     Both DANIS506 and IBM1S506 will use the 255/255 scheme.
     965
     966; 1 = This drive is above the 65536*255*63 (1052835840) boundary but below 65536*255*127.
     967;     OS/2 is able to access the drive using it's extended geometry.
     968;     Note that DANIS506 will use 255/127 and IBM1S506 will use 255/255 geometry !
     969;     Using DANI or IBM influences the location of the LVM info-sectors !
     970
     971; 0 = This drive is below the 65536*255*63 (1052835840) boundary.
     972;     OS/2 is able to access this drive using the standard 255/63 geometry.
     973
     974; So, any return value >0 means OS/2 extended geometry will be used.
     975; Value 1 will use 255/127 with DANIS506 but 255/255 with IBM1S506.
     976; Values 2 and 3 will use 255/255 on both drivers.
     977; You can or with 0x01 and check for 3 in this case.
     978; Any value above 3 will be a drive who's capacity cannot be fully used by OS/2
     979; The upper limit of 65536*255*255 will be in effect here.
     980
     981; Note this function currently handles the boot-drive only !
     982; It should be extended and use dl for the drive-number as a parameter.
     983; Because we use this function to get this info in a number of places,
     984; all regs and flags except AX are saved and restored.
     985
     986; DL contains BIOS disk-number; 80h for first, 81h for second, etc.
     987DriveIO_GatherDiskInfo  Proc Near
     988      pushf
     989      push    bx
     990      push    cx
     991      push    dx
     992      push    si
     993      push    di
     994      push    es
     995
     996      ; Set ES to CS for buffer clearing
     997      push    cs
     998      pop     es
     999
     1000      ; Clear the buffer
     1001      ; Don't overwrite the word of the buffersize at index 0 !
     1002      ; Old Phoenix BIOSses require word (flags) at 02 to be zero,
     1003      ; so we clear the whole buffer to be sure.
     1004      mov     cx, i13xbuf_size
     1005      mov     di, offset i13xbuf
     1006      mov     [di],cx
     1007      inc     di
     1008      inc     di
     1009      xor     ah,ah
     1010      cld
     1011      rep stosb
     1012
     1013      ; Get the drive parameters
     1014      mov     ah, 48h                                 ; Get Drive Parameters (extended version)
     1015      ;mov     dl, 80h                                ; Drive number
     1016      mov     si, offset i13xbuf                      ; Buffer for result-info
     1017      push    dx
     1018      int     13h                                     ; Call the BIOS-function
     1019      pop     dx
     1020
     1021      ; Do some error-checking
     1022      or      ah,ah                                   ; AH is zero if no error (ZF=1 if no error)
     1023      mov     ax,0                                    ; Setup code for non-huge drive (does not influence ZF)
     1024      jz      DriveIO_GatherDiskInfo_ok               ; Return if error (AL<>0 thus ZF=0) but CY not set, assuming non-huge drive
     1025      jnc     DriveIO_GatherDiskInfo_ok               ; Return if error (CY=1), assuming non-huge drive
     1026      jmp     DriveIO_GatherDiskInfo_ret
     1027
     1028
     1029   DriveIO_GatherDiskInfo_ok:
     1030
     1031      ;
     1032      ; Store the drive geometry
     1033      ;
     1034
     1035      mov      si, offset i13xbuf
     1036
     1037      xor      dh,dh
     1038      and      dl,01111111b
     1039      shl      dx,1
     1040      shl      dx,1
     1041
     1042      ; Store number of cylinders on disk
     1043      mov      bx, offset BIOS_Cyls
     1044      add      bx,dx
     1045      mov      ax,[si+04h]
     1046
     1047      mov      word ptr [bx+00],ax
     1048      mov      ax,[si+06]
     1049      mov      word ptr [bx+02],ax
     1050
     1051      ; Store number of heads per cylinder
     1052      mov      bx, offset BIOS_Heads
     1053      add      bx,dx
     1054      mov      ax,[si+08h]
     1055      mov      word ptr [bx+00],ax
     1056      mov      ax,[si+0ah]
     1057      mov      word ptr [bx+02],ax
     1058
     1059      ; Store number of sectors per track
     1060      mov      bx, offset BIOS_Secs
     1061      add      bx,dx
     1062      mov      ax,[si+0ch]
     1063      mov      word ptr [bx+00],ax
     1064
     1065      ; Update first byte of translation-table to conform to BIOS SPT
     1066      mov      byte ptr [secs_per_track_table], al
     1067
     1068      mov      ax,[si+0eh]
     1069      mov      word ptr [bx+02],ax
     1070
     1071      ; Store total secs
     1072      mov      bx, offset BIOS_TotalSecs
     1073      add      bx,dx
     1074      add      bx,dx
     1075      mov      ax,[si+10h]
     1076
     1077      mov      word ptr [bx+00],ax
     1078      mov      ax,[si+12h]
     1079      mov      word ptr [bx+02],ax
     1080      mov      ax,[si+14h]
     1081      mov      word ptr [bx+04],ax
     1082      mov      ax,[si+18h]
     1083      mov      word ptr [bx+06],ax
     1084
     1085      ; Store number of bytes per sector
     1086      mov      bx, offset BIOS_Bytes
     1087      add      bx,dx
     1088      mov      ax,[si+18h]
     1089      mov      [bx],ax
     1090
     1091
     1092      ;
     1093      ; See of it's a huge drive of not
     1094      ;
     1095
     1096      ; Drive is larger than 2TiB
     1097      mov     ax,5                                    ; Drive code (5)
     1098      mov     bx, [si+14h]                            ; Low word of high dword of sector-count
     1099      or      bx, [si+16h]                            ; High word of high dword of sector-count
     1100      jnz     DriveIO_GatherDiskInfo_ret              ; If non-zero we have a drive with >2^32 sectors and thus LBA48 addressing
     1101
     1102      ; Drive is larger than max OS/2 capacity
     1103      dec     ax                                      ; Drive code (4)
     1104      mov     bx, [si+12h]                            ; High word of low dword of sector-count
     1105      cmp     bx, 0fe01h                              ; Boundary
     1106      jae     DriveIO_GatherDiskInfo_ret              ; If above or equal to boundary,
     1107                                                      ; we have a drive larger than to 65536*255*255 = FE010000 sectors
     1108
     1109      ; Drive can be completely utilized by OS/2
     1110      dec     ax                                      ; Drive code (3)
     1111      cmp     bx, 8000h                               ; Boundary
     1112      jae     DriveIO_GatherDiskInfo_ret              ; If above or equal to boundary,
     1113                                                      ; we have a drive larger than 2^31 sectors but smaller than 65536*255*255
     1114
     1115      ; This is the small area between DANI 1TiB and LBA 1TiB
     1116      dec     ax                                      ; Drive code (2)
     1117      cmp     bx, 7e81h                               ; Boundary
     1118      jae     DriveIO_GatherDiskInfo_ret              ; If above or equal to boundary,
     1119                                                      ; we have a drive larger than 65536*255*127 but <65536*255*255
     1120                                                      ; DANIS506.ADD will use 255/255 extended geometry
     1121
     1122      ; DANI will use 255/127 in this area, this could impact the location of LVM-sectors ! (last sec on track)
     1123      dec     ax                                      ; Drive code (1)
     1124      cmp     bx, 3ec1h                               ; Boundary
     1125      jae     DriveIO_GatherDiskInfo_ret              ; If above or equal to boundary,
     1126                                                      ; we have a drive larger than 65536*255*63 sectors (OS/2 502GiB Limit!)
     1127                                                      ; DANIS506.ADD will use 255/127 extended geometry !
     1128                                                      ; IBM1S506.ADD will use 255/255 extended geometry !
     1129
     1130      ; We have a drive that can be addressed using standard 255/63 geometry
     1131      dec     ax                                      ; Drive code (0)
     1132                                                      ; We have a drive smaller than 65536*255*63 = 3EC10000 sectors
     1133
     1134   DriveIO_GatherDiskInfo_ret:
     1135      pop     es
     1136      pop     di
     1137      pop     si
     1138      pop     dx
     1139      pop     cx
     1140      pop     bx
     1141
     1142      mov      [CurIO_UseExtension],1
     1143
     1144      popf
     1145      ret
     1146DriveIO_GatherDiskInfo  EndP
     1147
     1148
     1149
     1150; Values for sectors per track table corresponding to DriveIO_IsHugeDrive return value.
     1151secs_per_track_table:   db    63,127,255,255,255,255
     1152
     1153db_lmlvm:   db 'Load Master LVM -- disk: ',0
  • trunk/BOOTCODE/REGULAR/OTHER.ASM

    r29 r30  
    2020;---------------------------------------------------------------------------
    2121
     22IFDEF ModuleNames
     23DB 'OTHER',0
     24ENDIF
     25
    2226;        In: DS:SI - Pointer to begin of string
    2327;            CX - Len of string
     
    7276   dec     dh
    7377   jnz     GLOSS_StringsLoop
    74    movzx   cx, dl
     78   ;movzx   cx, dl
     79   mov   cl,dl
     80   mov   ch,0
     81
    7582   ret
    7683GetLenOfStrings                EndP
     
    8794   mov     VideoIO_Segment, VideoIO_Page0
    8895
     96   ; Don't use blinking attribute
     97   call     VideoIO_NoBlinking
     98
     99   ; Get HardDriveCount
     100   call    DriveIO_GetHardDriveCount
     101
     102
     103               ; Rousseau: added
     104               call    VideoIO_ClearScreen
     105
     106               ; Cursor to upper-left
     107               mov     TextPosX, 0
     108               mov     TextPosY, 0
     109               call    VideoIO_CursorSet
     110
     111               ;mov     ax, VideoIO_Page1
     112               ;call    VideoIO_BackUpTo   ; Copy BIOS POST to Second Page
     113
     114               ; Copyright
     115               mov     si, offset Copyright
     116               call    MBR_Teletype
     117               xor     si,si
     118               call    MBR_TeletypeNL
     119
     120
     121               ;call    SOUND_Beep
     122
     123               ; Build Date
     124               mov     si, offset BUILD_DATE
     125               call    MBR_TeletypeNL
     126
     127               ; Initialize the com-port for debugging
     128               call     AuxIO_Init
     129
     130               xor     si,si
     131               call    MBR_TeletypeNL
     132
     133               xor      cx,cx
     134            PRECRAP_Main_next_disk:
     135
     136               mov      dl,cl
     137               or       dl,80h
     138
     139               call     DriveIO_GatherDiskInfo              ; Also used to fill the geo, should be separate function
     140
     141               mov      bx,offset HugeDisk
     142               add      bx,cx
     143               mov      [bx], al
     144
     145               call     DriveIO_LoadMasterLVMSector         ; returns ZF=1 if no valid LVM record found
     146
     147               pushf
     148               mov      bx, offset TrueSecs
     149               add      bx,cx
     150               add      bx,cx
     151               add      bx,cx
     152               add      bx,cx
     153               popf
     154
     155               ; bx now contains pointer to truesecs for this drive
     156
     157               jz       NoValidMasterLVM
     158
     159               mov      si,offset LVMSector
     160               mov      ax,[si+LocLVM_Secs]
     161               mov      word ptr [bx],ax
     162               jmp      SkipUseBiosSecs
     163
     164
     165            NoValidMasterLVM:
     166               push     bx                   ; push truesecs pointer
     167               mov      bx, offset BIOS_Secs
     168               add      bx,cx
     169               add      bx,cx
     170               add      bx,cx
     171               add      bx,cx
     172
     173               mov      ax,[bx]              ; get biossecs
     174               pop      bx
     175               mov      word ptr [bx],ax     ; store bios secs in truesecs
     176
     177
     178            SkipUseBiosSecs:
     179               inc      cx
     180               cmp      cl,[TotalHarddiscs]
     181               jb       PRECRAP_Main_next_disk
     182
     183
     184
     185IFDEF AuxDebug
     186               ; Write some debug-info to the com-port
     187               call     DEBUG_Dump1
     188ENDIF
     189
     190              ; jz       NoValidMasterLVM
     191
     192
     193               ; A valid Master LVM has been found.
     194               ; We use the values in here to determine the number of sectors per track,
     195               ; since this could be OS/2 extended geometry.
     196
     197              ; jmp      Continue1
     198
     199
     200               ;mov      word ptr [LOG_Secs],63
     201
     202               mov      al,[HugeDisk]           ;; fout, moet nog index bij
     203               call     AuxIO_TeletypeHexByte
     204               call     AuxIO_TeletypeNL
     205
     206               mov      ax,word ptr [TrueSecs]  ;; fout, moet nog index bij
     207               call     AuxIO_TeletypeHexWord
     208               call     AuxIO_TeletypeNL
     209
     210
     211
     212                 ; Huge Disk indicator
     213                 mov     si, offset HugeBootDisk
     214                 call    MBR_Teletype
     215                 mov     al,[HugeDisk]
     216                 mov     si, offset No
     217                 test    al,al
     218                 jz      MBR_HugeDriveIndicator
     219                 mov     si, offset Yes
     220
     221               MBR_HugeDriveIndicator:
     222                 call    MBR_Teletype
     223                 xor     si,si
     224                 call    MBR_TeletypeNL
     225
     226
     227
     228
     229
     230                 ;
     231                 ; Phase 1 Indicator
     232                 ;
     233                 mov     si, offset Phase1
     234                 call    MBR_Teletype
     235
     236                 mov     si, offset eCS_InstallVolume
     237                 mov     al, [si]
     238                 test    al,al                                 ; See if phase 1 is active
     239                 jnz     MBR_Main_BootThrough
     240                 mov     si, offset NotActive
     241
     242               MBR_Main_BootThrough:
     243                 call    MBR_TeleType
     244                 xor     si,si
     245                 call    MBR_TeletypeNL                                          ; ALP barks undefined symbol; must use prototypes ?
     246
     247
    89248   ; Calculate Cooper-Bar Tables
    90249   call    FX_CalculateTables
     
    108267
    109268   call    PRECRAP_CheckFor13extensions
     269
    110270   IFNDEF ReleaseCode
    111271      ret
    112272   ENDIF
     273
    113274   call    PRECRAP_CheckConfiguration
     275
    114276   ; =======================================
    115277   ; Checks for MBR Virii :) I love that job
     
    123285      call    VIRUS_CheckForVirus
    124286  PCM_NoVirusDetection:
     287
     288
    125289   ; ============================================
    126290   ;  Delay for some time and get Strg/Alt State
     
    132296   jz      PCM_LongDelay
    133297  PCM_ShortDelay:
     298
    134299   mov     al, 13                        ; shorten delay,if floppy gets accessed
    135300  PCM_LongDelay:
     301
    136302   call    TIMER_WaitTicCount
     303
    137304   ; First check, if any normal key got pressed...
    138305   mov     ah, 1
     
    143310   call    MBR_Teletype
    144311   mov     al, 54                        ; about 3 seconds, delay again
     312
    145313   call    TIMER_WaitTicCount
     314
    146315  PCM_NoNormalKeyPressed:
    147316   ; Now get keyboard Strg/Alt State
     
    156325   ret
    157326PRECRAP_Main                    EndP
     327
     328
    158329
    159330AFTERCRAP_Main                  Proc Near  Uses
     
    209380   jmp     MBR_HaltSystem
    210381PRECRAP_CheckConfiguration      EndP
     382
     383
     384; Rousseau: added
     385;        In: SI - Pointer to begin of string (EOS is 0)
     386; Destroyed: SI
     387; Fixme: Uses double writes to use attribute with teletype-function.
     388MBR_TeletypeBold                Proc Near   Uses ax bx cx
     389  MBRT_LoopBold:
     390   lodsb
     391   or      al, al
     392   jz      MBRT_EndBold
     393   push    ax
     394   mov     ah,09h
     395   mov     bx,15
     396   mov     cx,1
     397   int     10h
     398   pop     ax
     399   mov     ah,0eh
     400   mov     bx,7            ; Does not do anything in text-modus
     401   mov     cx,1
     402   int     10h
     403   jmp     MBRT_LoopBold
     404  MBRT_EndBold:
     405   ret
     406MBR_TeletypeBold                EndP
     407
     408;        In: SI - Pointer to begin of string (EOS is 0)
     409; Destroyed: SI
     410; Fixme: Uses double writes to use attribute with teletype-function.
     411MBR_TeletypeVolName             Proc Near   Uses ax bx cx
     412   mov     cx, 11
     413  MBRT_LoopVolName:
     414   mov     dx,cx           ; Backup counter
     415   lodsb
     416   or      al, al
     417   jz      MBRT_EndVolName
     418   push    ax
     419   mov     ah,09h
     420   mov     bx,15
     421   mov     cx,1
     422   int     10h             ; DX is preserved
     423   pop     ax
     424   mov     ah,0eh
     425   mov     bx,7            ; Does not do anything in text-modus
     426   mov     cx,1
     427   int     10h             ; DX is preserved
     428   mov     cx,dx           ; Restore counter
     429   loop    MBRT_LoopVolName
     430  MBRT_EndVolName:
     431   ret
     432MBR_TeletypeVolName             EndP
     433
     434; Rousseau: added
     435; Move cursor to next line
     436; Just do a new-line if SI==0
     437MBR_TeletypeNL                  Proc Near   Uses ax bx cx
     438   test    si,si
     439   jz      MBR_TeletypeNL_NL
     440   call    MBR_Teletype
     441  MBR_TeletypeNL_NL:
     442   push    si
     443   mov     si, offset NL
     444   call    MBR_Teletype
     445   pop     si
     446   ret
     447MBR_TeletypeNL                  EndP
     448
     449; Sync teletype position to VideoIO
     450MBR_TeletypeSyncPos     Proc Near   Uses ax bx cx dx
     451   pushf
     452   mov   bh, 0
     453   mov   ah, 02h
     454   mov   dh,[TextPosY]
     455   mov   dl,[TextPosX]
     456   int   10h
     457   popf
     458   ret
     459MBR_TeletypeSyncPos     EndP
  • trunk/BOOTCODE/REGULAR/PARTMAIN.ASM

    r29 r30  
    2020;---------------------------------------------------------------------------
    2121
     22IFDEF ModuleNames
     23DB 'PARTMAIN',0
     24ENDIF
     25
    2226PART_FixUpDefaultPartitionValues Proc Near  Uses dx si di
    2327   ; Fix-Up Default and Last Partition - If lost, search for Bootable
     
    140144; Copies the device-name to the Resume-BIOS IPT entry
    141145PART_UpdateResumeBIOSName       Proc Near Uses ax bx cx si di
    142    movzx   bx, CFG_ResumeBIOSbootSeq
     146   ;movzx   bx, CFG_ResumeBIOSbootSeq
     147   mov   bl,CFG_ResumeBIOSbootSeq
     148   mov   bh,0
     149
    143150   dec     bx
    144151   shl     bx, 1
     
    213220;  PCMPP_NoLinuxKernels:
    214221
    215    movzx   cx, CFG_Partitions ; LocIPT_MaxPartitions
     222   ;movzx   cx, CFG_Partitions ; LocIPT_MaxPartitions
     223   mov   cl,CFG_Partitions ; LocIPT_MaxPartitions
     224   mov   ch,0
     225
    216226   or      cx, cx
    217227   jz      PCMPP_NoPartitions
     
    240250   je      PGPP_IsBIOSbootSeq            ; FEh -> Resume BIOS boot Sequence
    241251   ja      PGPP_IsFloppy                 ; FFh -> Floppy
    242    movzx   bx, dl
     252   ;movzx   bx, dl
     253   mov   bl,dl
     254   mov   bh,0
     255
    243256   shl     bx, 1
    244257   mov     si, wptr [PartitionPointers+bx]
     
    278291;       Out: DL - Number of partition in straight view
    279292PART_ConvertToStraight          Proc Near   Uses
    280    movzx   bx, dl
    281    shl     bx, 1
    282    mov     ax, wptr cs:[PartitionPointers+bx]
     293   ;movzx   bx, dl
     294   mov   bl,dl                                  ; partition number to bl
     295   mov   bh,0                                   ; zero extend to word
     296
     297   shl     bx, 1                                ; convert to word index
     298   mov     ax, wptr cs:[PartitionPointers+bx]   ; get the partition pointer
    283299   cmp     ax, offset FloppyIPTentry
    284300   jb      PCTS_IsBIOSbootSeq
     
    315331  PCFS_IsPartition:
    316332   ; First we get Partition-Offset in AX
    317    movzx   ax, dl
     333   ;movzx   ax, dl
     334   mov   al,dl
     335   mov   ah,0
     336
    318337   mov     bl, LocIPT_LenOfIPT
    319338   mul     bl
     
    354373   mov     bl, LocIPT_LenOfIPT
    355374   div     bl                            ; Divide with IPTlength
    356    movzx   bx, al
     375   ;movzx   bx, al
     376   mov   bl,al
     377   mov   bh,0
     378
    357379   shl     ax, 1
    358380   shl     bx, 2
     
    409431      dec     di                         ; Go to previous char
    410432      jmp     PFOSE_DigitLoop
    411      
     433
    412434  PFOSE_EndOfDigitLoop:
    413435   ret
    414436PART_FillOutSizeElement         EndP
     437
     438
     439
     440
     441; ###################
     442; # START PARTITION #
     443; ###################
    415444
    416445; Starts Partition DL from Internal Partition Table.
     
    454483         mov     di, offset TXT_BootingNowPartName
    455484         jz      PSP_NoName
    456          rep     movsb
     485         rep     movsb                                                           ; Copy label-name to boot
    457486        PSP_NoName:
    458487         xor     al, al
    459488         stosb              ; Ending Zero
    460       mov     si, offset TXT_BootingNow1
     489      mov     si, offset TXT_BootingNow1                                         ; "Booting the system using "
    461490      call    MBR_Teletype
    462491; [Linux support removed since v1.02]
     
    484513      IFDEF ReleaseCode
    485514         ; Save configuration on HDD boots (save CFG_PartLast)
    486          call    DriveIO_SaveConfiguration
     515         call    DriveIO_SaveConfiguration                                       ; Rouaaseu: SAVE CONFIGURATION !
    487516      ENDIF
    488517      call    MBR_Teletype     ; Prints out BootingNow2 including PartitionName
     
    496525   mov     dh, bptr [si+LocIPT_LocationPartTable+0]
    497526   mov     dl, [si+LocIPT_Drive]
    498    call    DriveIO_LoadPartition         ; Load Table...
     527   call    DriveIO_LoadPartition         ; Load Table...                         ; Rousseau: LOAD PARTITION !
    499528   ; --------------------------------------------------- MODIFY PARTITION TABLE
    500529   push    cs
     
    536565   or      byte ptr es:[di+LocBRPT_Flags], 80h ; set ACTIVE partition
    537566   IFDEF ReleaseCode
    538       call    DriveIO_SavePartition      ; Saves the Partition-Table
     567      call    DriveIO_SavePartition      ; Saves the Partition-Table             ; Rousseau: SAVE PARTITION !
    539568   ENDIF
    540569
     
    549578   ; BX:AX -> Absolute End-Position of Partition
    550579
    551    test    CFG_ForceLBAUsage, 1
     580   test    CFG_ForceLBAUsage, 1                                                  ; Rousseau: LBA
    552581   jnz     PSP_ForceI13X
    553    ; LBA-boundary at 16450560 (FB0400h)
     582   ; LBA-boundary at 16450560 (FB0400h) (16320x16x63)
    554583   cmp     bx, 00FBh
    555584   jb      PSP_NoI13X
    556585  PSP_ForceI13X:
    557    push    es di
     586   push    es di si
    558587      mov     ax, 3000h
    559588      mov     es, ax
    560589      xor     di, di
     590      ; Blokkeert starten van IBM BM !!
    561591      mov     wptr es:[di], '1I'
    562592      mov     wptr es:[di+2], 'X3'
    563    pop     di es
     593
     594      ;mov      si,3000h
     595      ;call     AuxIO_DumpSector
     596
     597   pop     si di es
    564598  PSP_NoI13X:
    565599
     
    607641      mov     cx, 0001h                  ; Cylinder 0, Sector 1
    608642      mov     dx, 0080h                  ; First HD, Head 0
    609       call    DriveIO_LoadPartition      ; Load Primary Partition Table
     643      call    DriveIO_LoadPartition      ; Load Primary Partition Table          ; Rousseau: LOAD MBR !
    610644      call    PART_MarkFirstGoodPrimary
    611645      IFDEF ReleaseCode
    612          call    DriveIO_SavePartition   ; Saves the Partition-Table
     646         call    DriveIO_SavePartition   ; Saves the Partition-Table             ; Rousseau: SAVE MBR !
    613647      ENDIF
    614648     PSP_NoHideAdjustPrimaryMark:
     
    622656      test    byte ptr [si+LocIPT_Flags], Flags_DriveLetter
    623657      jz      PSP_NoLVMReassignment
    624       movzx   bx, BootPartNo             ; EntryNumber is straight view
     658      ;movzx   bx, BootPartNo             ; EntryNumber is straight view
     659      mov   bl,BootPartNo             ; EntryNumber is straight view
     660      mov   bh,0
     661
    625662      mov     al, bptr [DriveLetters+bx]
    626663      sub     al, 3Dh                    ; Convert e.g. 80h -> 'C'
     
    679716   mov     dh, [si+LocIPT_LocationBegin+0]
    680717   mov     dl, [si+LocIPT_Drive]
    681    call    DriveIO_LoadPartition         ; Loads boot-sector...
     718   call    DriveIO_LoadPartition         ; Loads boot-sector...                  ; Rousseau: LOAD PART BOOT-SECTOR !!
    682719
    683720   test    CFG_DetectVIBR, 1
     
    734771      mov     si, 10h*4
    735772      xor     di, di                     ; INT 10h Vector to MBR Protection
    736       movsd
     773      ;movsd
     774      movsw
     775      movsw
     776
    737777      mov     si, 13h*4                  ; INT 13h Vector to MBR Protection
    738       movsd
     778      ;movsd
     779      movsw
     780      movsw
     781
    739782      mov     al, CFG_IgnoreWriteToMBR   ; Option to MBR Protection
    740783      stosb
     
    753796  PSP_NoMBRprotect:
    754797   cmp     bptr [si+LocIPT_SystemID], 08 ; I hate Microsuck NTFS check
    755    je      PSP_NoSpecialSupport
     798
     799   ;je      PSP_NoSpecialSupport
    756800
    757801      mov     di, offset PartitionSector ; ES:DI - Actual Boot-Record
     
    759803      mov     ax, wptr es:[di+24]
    760804      cmp     ax, 003Fh                  ; Physical Layout-Sectors... Safety check
    761       ja      PSP_NoSpecialSupport
     805
     806
     807      ; Rousseau: # Boot Logical Partitions)
     808      ; FreeDOS and eCS on extpart on non-huge needs special support. (old ja jump)
     809      ; PC-DOS7 on huge pri fat16 2G works with both (XP too) when at start of disk. (also when offset at 20MiB)
     810      ; PCD7 bonkt vast als in 2GiB log at start of space. "Starting PC DOS..." verschijnt. PCD Loader probleem.
     811      ; Offset van start-of-disk bij PCD7 niet meer dan 2GiB maken.
     812      ; Special is needed to boot ECS-CXXVAC (log-part) on Douwskie Box with 40G disk.
     813      ; FreeDOS 20G PRI SOD op 400G start niet met special.
     814      ; Heeft drive-id op 26h (36d) van 0dh !
     815      ; WinXP werkt met special en not-special op 400G normal geo.
     816      ; eCS op PRI op 2G met os2 ext geo werkt ook met beide.
     817      ; eCS LOG werkt niet zonder special op 400G.
     818      ; (hidden secs op 3F en moet 3F00 zijn; BM staat ervoor, 3F00=255*63+63)
     819      ; Laatste 63 is MBR.
     820      ;
     821      ; It seems PRI's already get special treatment in that they get their hidden secs updated.
     822      ; (100MB HD, moved 50MB PRI-DOS part UP, DFSee complains about wrong hidden, but AiR-BOOT corrects it before booting)
     823
     824      ; FreeDOS zet 63 in SPT in BPB op 255/255 geo !!!!
     825
     826      ; PC-DOS7 wil vaak niet starten als er meerdere pri's actief zijn.
     827      ; Logo verschijnt wel maar start niet door.
     828
     829
     830      ; Display volume-name
     831      pushf
     832      push     si
     833      add      si, LocIPT_Name
     834      call     MBR_TeletypeVolName
     835      xor      si,si
     836      call     MBR_TeletypeNL                                                    ; Rousseau: Just before booting the selected partition
     837      pop      si
     838      popf
     839
     840
     841
     842      jmp     special                                                            ; Rousseau: GOT IT !!! (LOG-BOOT) (alleen op huge disks !)
     843      ;jmp      PSP_NoSpecialSupport
     844      ;ja      PSP_NoSpecialSupport                                              ; Rousseau: original M. Kiewitz...
     845      ;jbe     PSP_NoSpecialSupport                                               ;   had to change to opposite !
     846
     847
    762848      mov     ax, wptr es:[di+26]
    763849      cmp     ax, 00FFh                  ; Physical Layout-Heads... Safety check
    764850      ja      PSP_NoSpecialSupport
    765851      mov     al, bptr es:[di+36]
    766       cmp     al, 80h                    ; Drive Letter
     852      cmp     al, 80h                    ; Drive Letter (ID)
    767853      jne     PSP_NoSpecialSupport
     854
    768855      ; Special Support needed
     856special:
     857      ; Write actual drive-letter to partition boot-record.
     858      ; This is according to BPB.
    769859      mov     al, bptr [si+LocIPT_Drive]
    770       mov     bptr es:[di+36], al        ; Write Actual Drive-Letter
     860      ; Also an influence with FreeDOS !
     861      ; Generates JFS ERROR when not set correctly !!!
     862      mov     bptr es:[di+36], al               ; Write Actual Drive-Letter (80h id first drive)        !!!!!!!!!!!!!!!!!!!!!!!
     863
     864      ; This could be incorrect when a partition is moved,
     865      ; or the system installer puts the wrong value here.
     866      ; FreeDOS (log-part) i.e. puts 03fH (63d) here, eventhough it is not a the start of the disk.
     867      ; This fixing is done by OS/2 BM as well, according to Martin.
    771868      mov     ax, [si+LocIPT_AbsoluteBegin]
    772       mov     wptr es:[di+28], ax        ; Fixing Hidden Sectors count
     869      mov     wptr es:[di+28], ax               ; low word of hidden sectors
    773870      mov     ax, [si+LocIPT_AbsoluteBegin+2]
    774       mov     wptr es:[di+30], ax        ; Done by OS/2 BootMan as well...
     871      mov     wptr es:[di+30], ax               ; high word of hidden sectors
    775872
    776873   ; ------------------------------------------------ LOGICAL PARTITION SUPPORT
    777874  PSP_NoSpecialSupport:
     875
     876;jmp   PSP_NoLogicalSupport
     877
    778878   test    byte ptr [si+LocIPT_Flags], Flags_DriveLetter
    779879   jz      PSP_NoLogicalSupport
    780880
    781       movzx   bx, BootPartNo             ; EntryNumber is straight view
     881      ;movzx   bx, BootPartNo             ; EntryNumber is straight view
     882      mov   bl,BootPartNo             ; EntryNumber is straight view
     883      mov   bh,0
     884
    782885      mov     al, bptr [DriveLetters+bx]
    783886      mov     bptr es:[di+37], al        ; Write Drive Letter (OS/2 only)
     
    793896      rep     movsw
    794897   pop     si
    795    ; ---------------------------------------------------- NOW START BOOT-RECORD
     898   ; ---------------------------------------------------- NOW START BOOT-RECORD  ; Rousseau: START PARTITION BOOT-RECORD !!
     899
     900
     901IFDEF AuxDebug
     902;   call     DEBUG_Dump2
     903ENDIF
     904
     905               ;
     906               ; ########################### WAIT FOR KEY ################################
     907               ;
     908
     909   ; Rousseau:
     910   ; Wait for key so we can see which volume is going to be started.
     911   ;xor     ax, ax
     912   ;int     16h
     913   ;cmp     al, 1bh                        ; is escape-key ?
     914   ;jne   skip_reenter
     915
     916   ;jmp      MBR_Main_ReEnterBootMenuPre   ; yep, re-enter boot-menu
     917
     918skip_reenter:
     919
     920
     921
     922
     923
     924
     925
     926
     927   ;
     928   ; BYE BYE
     929   ;
    796930   xor     ax, ax
    797931   xor     bx, bx
     
    801935   xor     dh, dh                        ; Drive supported by BIOS
    802936   mov     dl, cs:[si+LocIPT_Drive]      ; Drive Physical No
     937
    803938   IFDEF ReleaseCode
    804       db      0EAh                          ; JUMP TO Entry Point...Bye Bye
     939      db      0EAh                       ; JUMP TO Entry Point...Bye Bye
    805940      dw      StartBasePtr
    806941      dw      StartBaseSeg
    807942   ENDIF
    808943PART_StartPartition             EndP
     944
     945
     946
     947
     948
     949
     950
     951
     952
     953
    809954
    810955; This routine is called to hide a partition
     
    9231068; Destroyed: *none*
    9241069PART_SearchFileSysName          Proc Near  Uses bx dx
    925    movzx   bx, al
     1070   ;movzx   bx, al
     1071   mov   bl,al
     1072   mov   bh,0
     1073
    9261074   mov     si, offset FileSysIDs
    9271075  PSFSN_SearchLoop:
     
    9431091   mov     ah, dl
    9441092   ; AH is now the FileSystem-Flag
    945    movzx   bx, bh
     1093   ;movzx   bx, bh
     1094   mov   bl,bh
     1095   mov   bh,0
     1096
    9461097   shl     bx, 3   ; Offsets * 8
    9471098   mov     si, offset FileSysNames
    9481099   add     si, bx
    949    ret         
     1100   ret
    9501101PART_SearchFileSysName          EndP
    9511102
     
    9541105;       Out: AL - Hidden File-System-ID
    9551106PART_SearchFileSysHiddenID      Proc Near  Uses bx
    956    movzx   bx, al
     1107   ;movzx   bx, al
     1108   mov   bl,al
     1109   mov   bh,0
     1110
    9571111   mov     si, offset FileSysIDs
    9581112  PSFSHI_SearchLoop:
     
    10191173   ret
    10201174PART_CheckForValidPartName      EndP
     1175
     1176
     1177; Rousseau: added
     1178; Compare a volume-label in the IPT to the install-volume
     1179; SI holds pointer to entry in IPT
     1180; CY set if this entry is also the install-volume
     1181PART_IsInstallVolume            Proc Near   Uses ax cx dx si di
     1182      cld                                    ; Advance upwards with lodsb
     1183      mov   di, offset eCS_InstallVolume     ; Address of install-volume label (max. 11 chars)
     1184
     1185      mov   cx, 11                           ; Maximum length of label
     1186      xor   dl, dl                           ; Not found yet
     1187
     1188    ; Compare next character
     1189    PART_IsInstallVolumeNext:
     1190      lodsb                                  ; Load byte from SI (IPT-entry)
     1191      ;cmp      al,' '                        ; If space then use zero
     1192      ;jne      PART_IsInstallVolume_skip1
     1193      ;xor      al,al
     1194   PART_IsInstallVolume_skip1:
     1195      xchg     ah,al                         ; Save char to AH
     1196      xchg     si,di                         ; Exchange pointers
     1197      lodsb                                  ; Load byte from SI (install-volume label)
     1198      ;cmp      al,' '                        ; If space then use zero
     1199      ;jne      PART_IsInstallVolume_skip2
     1200      ;xor      al,al
     1201   PART_IsInstallVolume_skip2:
     1202      xchg     si,di                         ; Reexchange pointers
     1203      call     AuxIO_Teletype
     1204      call     CONV_ToUpper
     1205      call     AuxIO_Teletype
     1206      xchg     al,ah
     1207      call     AuxIO_Teletype
     1208      call     CONV_ToUpper
     1209      call     AuxIO_Teletype
     1210      call     AuxIO_TeletypeNL
     1211
     1212      ; Are both of them zero ?
     1213      ; Then the names could be the same, but cx must not equal 11
     1214      ; because that would indicate a null-string.
     1215      mov      dh,al
     1216      or       dh,ah
     1217      jz       PART_IsInstallVolumeFound
     1218
     1219      cmp      ah,al                         ; Are the the same ?
     1220      jnz      PART_IsInstallVolumeNotFound  ; Nope, compare ended
     1221      loop     PART_IsInstallVolumeNext      ; Yep, Compare next character
     1222
     1223   PART_IsInstallVolumeFound:
     1224      ; If CX is still 11 this was a zero string
     1225      ; and thus not a valid volume-name.
     1226      ; This should not occur as this function is only called when the first
     1227      ; byte is non-zero.
     1228      cmp      cx,11
     1229      je       PART_IsInstallVolumeNotFound
     1230      ; Found !
     1231      mov      dl,1                          ; Found
     1232      jmp      PART_IsInstallVolumeEnd
     1233
     1234
     1235   PART_IsInstallVolumeNotFound:
     1236      mov      dl,0
     1237      jmp      PART_IsInstallVolumeEnd
     1238
     1239
     1240   PART_IsInstallVolumeEnd:
     1241      ; Set the status in CY
     1242      mov      al,dl
     1243      add      al,'0'
     1244      call     AuxIO_TeletypeHexByte
     1245      call     AuxIO_TeletypeNL
     1246      rcr      dl,1                          ; Put found-flag in CY
     1247      ret
     1248PART_IsInstallVolume            EndP
  • trunk/BOOTCODE/REGULAR/PARTSCAN.ASM

    r29 r30  
    2020;---------------------------------------------------------------------------
    2121
     22
     23IFDEF ModuleNames
     24DB 'PARTSCAN',0
     25ENDIF
     26
    2227; Note: This is complex code. So make sure that you know what you are doing in
    2328;        here.
     
    4853   mov     si, offset NewPartTable
    4954   mov     di, offset PartitionTable
    50    movzx   ax, NewPartitions
     55   ;movzx   ax, NewPartitions
     56   mov   al,NewPartitions
     57   mov   ah,0
     58
    5159   mov     CFG_Partitions, al
    5260   mov     bl, LocIPT_LenOfIPT
     
    5866   mov     si, offset NewDriveLetters
    5967   mov     di, offset DriveLetters
    60    mov     cx, LocIPT_MaxPartitions/2
    61    rep     movsw
     68   mov     cx, LocIPT_MaxPartitions
     69   rep     movsb
    6270
    6371; [Linux support removed since v1.02]
     
    8290   or      dl, dl
    8391   jz      PSSFP_NoAutoDriveLetter
    84    movzx   cx, CFG_Partitions
     92   ;movzx   cx, CFG_Partitions
     93   mov   cl,CFG_Partitions
     94   mov   ch,0
     95
    8596   or      cx, cx
    8697   jz      PSSFP_NoAutoDriveLetter
     
    118129   mov     wptr [ExtendedAbsPos+2], ax
    119130  PSSDFP_LoadThisPartition:
    120    call    DriveIO_LoadPartition
     131
     132   call    DriveIO_LoadPartition                                                 ; Rousseau: load a partition record
     133
    121134   jc      PSSDFP_InvalidPartition
     135
    122136   ; LVM Support - Reads LVM Information Sector
    123    call    DriveIO_LoadLVMSector
     137   call    DriveIO_LoadLVMSector                                                 ; Rousseau: load LVM sector
     138
    124139   call    PARTSCAN_ScanPartition
    125140   IFDEF ReleaseCode
     
    223238   add     ax, wptr [CurPartition_Location+0] ; +Partition-Absolute
    224239   adc     bx, wptr [CurPartition_Location+2] ;  sectors
    225    call    DriveIO_LoadTmpSector         ; Loads Boot record
     240   call    DriveIO_LoadTmpSector         ; Loads Boot record                     ; Rousseau: LOAD PARTITION BOOT RECORD !!
    226241   ; Sets up DS:SI - TmpSector
    227242
     
    249264   cmp     PartSystemID, 07h          ; We got IFS here?
    250265   jne     PCCTP_IFSdone
    251    ; Check, if 'JFS ' is at DWORD offset 36h
     266   ; Check, if 'JFS ' is at DWORD offset 36h                                     ; Rousseau: JFS check (LVM / IPT?)
    252267   cmp     wptr [si+36h], 'FJ'
    253268   jne     PCCTP_IFSnoJFS
     
    284299     PCCTP_HasVolumeLetter:
    285300      ; Save VolumeLetter in separate table
    286       movzx   bx, NewPartitions          ; NewPartitions is one behind here, so
     301      ;movzx   bx, NewPartitions          ; NewPartitions is one behind here, so
     302      mov   bl,NewPartitions          ; NewPartitions is one behind here, so
     303      mov   bh,0
     304
    287305      mov     [PartitionVolumeLetters+bx], al ; it's already a zero-based offset
    288306      ; Now copy VolumeID and VolumeName to temporary space
     
    291309      stosw
    292310      mov     ax, [si+LocLVM_PartitionID+2]
    293       stosw                              ; Set Serial-Field to LVM-VolumeID
     311      stosw
     312                              ; Set Serial-Field to LVM-VolumeID
     313      push     di
    294314      add     si, LocLVM_PartitionName
     315
    295316      mov     cx, 5
    296317      rep     movsw                      ; Copy LVM-PartitionName to Temp Space
    297       movsb                              ;  (11 bytes in total)
     318      movsb                               ;  (11 bytes in total)
     319
     320      pop   di
     321      cmp   PartSystemID, 0ah
     322
     323      jne   PCCTP_NoIbmBm
     324      mov   si, offset ibm_bm_name
     325      mov   cx,5
     326      rep   movsw
     327      movsb
     328
     329
     330
     331   PCCTP_NoIbmBm:
     332
     333
    298334   pop     di si dx ax
    299335   mov     si, offset MBR_NoName_Patched
     
    304340   pop     di si dx ax
    305341   test    ah, FileSysFlags_NoName       ; No-Name-Flag ? -> No Partition Name
    306    jnz     PCCTP_ThereIsNoName           ;                    available
     342
     343   jz      PCCTP_ThereIsAName
     344   jmp     PCCTP_ThereIsNoName           ;                    available
     345
     346   PCCTP_ThereIsAName:
     347
    307348      ; We check for NTFS (got detected a little bit earlier in this routine)
    308349      cmp     PartSystemID, 08h          ; We got IFS/NTFS here?
     
    312353      add     si, 2Bh                    ; DS:SI - Partition-Name
    313354      test    ah, FileSysFlags_FAT32     ; FAT32 specific name getting ?
     355
    314356      jz      PCCTP_ResumeNormal
     357
    315358      add     si, 1Ch                    ; Fix for FAT 32, shiat
    316359     PCCTP_ResumeNormal:
    317360      mov     cx, 11                     ;         11 bytes length
    318361      call    PART_CheckForValidPartName
    319       jnc     PCCTP_ThereIsNoName
     362      jc    PCCTP_ThereIsAName2
     363
     364      jmp     PCCTP_ThereIsNoName
     365
     366   PCCTP_ThereIsAName2:
     367
    320368      sub     si, 4                      ; DS:SI -> Serial&Name (15-Bytes)
    321369      xor     ah, ah                     ; no Flags_NoPartName
     
    343391            repz    cmpsb
    344392         pop     di si
    345          je      PCCTP_Match
     393
     394         jne   PCCTP_NoMatchYet
     395
     396         jmp      PCCTP_Match
     397
     398      PCCTP_NoMatchYet:
     399
    346400        PCCTP_SerialNameAlreadyFound:
    347401         add     di, LocIPT_LenOfIPT
     
    477531     PCCTP_LocCompFailed:
    478532      jmp     PCCTP_CompareFailed
    479      
     533
    480534   ; ==================================
    481535   ; =MATCH=, found partition in IPT...
     
    557611   ; Calculate Pointer to IPT
    558612   mov     di, offset NewPartTable       ; ES:DI - NewPartTable
    559    movzx   ax, NewPartitions
     613   ;movzx   ax, NewPartitions
     614   mov   al,NewPartitions
     615   mov   ah,0
     616
    560617   mov     bl, LocIPT_LenOfIPT
    561618   mul     bl
     
    575632   stosb
    576633   mov     al, cl                        ; Partition-Flags from register...
    577    stosb 
     634   stosb
    578635   mov     ax, PartCRC                   ; BootRecordCRC...
    579636   stosw
     
    620677
    621678   ; Calculate Size of this partition and put it into separate table...
    622    movzx   ax, NewPartitions
     679   ;movzx   ax, NewPartitions
     680   mov   al,NewPartitions
     681   mov   ah,0
     682
    623683   dec     ax
    624684   mov     bx, ax
     
    658718; Destroyed: None
    659719PARTSCAN_DefXref                Proc Near   Uses ax bx cx dx si di
    660    movzx   bx, dl
     720   ;movzx   bx, dl
     721   mov   bl,dl
     722   mov   bh,0
     723
    661724   mov     bptr [PartitionXref+bx], dh      ; X-Reference
    662725   ; Copy Hide-Config of IPT partition to new location in new table
     
    673736   rep     movsb                            ; Copy Hide-Config to NewHideTable
    674737   ; Process Logical-Drive-Letter table as well...
    675    movzx   bx, dl
     738   ;movzx   bx, dl
     739   mov   bl,dl
     740   mov   bh,0
     741
    676742   mov     al, bptr [DriveLetters+bx]       ; Get Drv-Letter from org. pos
    677    movzx   bx, dh
     743   ;movzx   bx, dh
     744   mov   bl,dl
     745   mov   bh,0
     746
    678747   mov     bptr [NewDriveLetters+bx], al    ; Put Drv-Letter to new pos
    679748   ret
     
    684753; Destroyed: None
    685754PARTSCAN_GetXref                Proc Near   Uses bx
    686    movzx   bx, dl
     755   ;movzx   bx, dl
     756   mov   bl,dl
     757   mov   bh,0
     758
    687759   mov     dh, bptr [PartitionXref+bx]      ; X-Reference
    688760   ret
     
    702774         cmp     al, 0FFh
    703775         je      PSSHCWX_SyncEmpty
    704          movzx   bx, al
     776         ;movzx   bx, al
     777         mov   bl,al
     778         mov   bh,0
     779
    705780         mov     al, [PartitionXref+bx]     ; Translate it
    706781         cmp     al, 0FFh
     
    729804   ret
    730805PARTSCAN_SyncHideConfigWithXref EndP
     806
     807ibm_bm_name:   db 'IBM BootMan',0
  • trunk/BOOTCODE/REGULAR/PASSWORD.ASM

    r29 r30  
    1919;                                                       AiR-BOOT / PASSWORD
    2020;---------------------------------------------------------------------------
     21
     22IFDEF ModuleNames
     23DB 'PASSWORD',0
     24ENDIF
     25
    2126
    2227; Don't ask me, what I'm doing in here to encode the passwords. I don't even
     
    164169  PE_ContinueLoop:
    165170      mov     al, ds:[si]
    166       movzx   bx, ds:[si+8]
     171      ;movzx   bx, ds:[si+8]
     172      mov   bl,ds:[si+8]
     173      mov   bh,0
     174
    167175      add     bl, 16
    168176      mov     ah, ds:[si+bx]
  • trunk/BOOTCODE/REGULAR/STD_TEXT.ASM

    r29 r30  
    2020;---------------------------------------------------------------------------
    2121
     22IFDEF ModuleNames
     23DB 'STD_TEXT',0
     24ENDIF
     25
    2226; If you modify this Copyright and release this under your own name,
    2327;  I'm going to sue your cheap ass, rape your dog and blow up your house. =)
    2428
    25 CopyrightVersionLen   equ   5
    26 Copyright             db ' AiR-BOOT v1.06 - (c) 1998-2009 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
    27 BootEndMsg            db 'Free usage allowed, as long as you dont or have not worked for US government', 0
    28 BootEndMsg2           db 'This is GPLv3+ software. Please visit http://AiR-BOOT.sourceforge.net', 0
     29CopyrightVersionLen   equ   6
     30;Copyright             db ' AiR-BOOT v1.06 - (c) 1998-2009 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
     31Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
     32;Copyright             db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Rousseau test-version >502G (build: #24)', 0
     33;Copyright             db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz   -  Release Candidate 1  -  (build: #25)', 0
     34;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc2-b27)', 0
     35;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc3-b31)', 0
     36;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc4-b33)', 0
     37;Copyright             db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc5-b35)', 0
     38
     39;BootEndMsg            db 'Free usage allowed, as long as you dont or have not worked for US government', 0
     40
     41; Rousseau: switch around
     42BootEndMsg           db 'This is GPLv3+ software. Please visit http://AiR-BOOT.sourceforge.net', 0
     43BootEndMsg2            db 'http://www.gnu.org/licenses/gpl.txt', 0
     44
     45AuxInitMsg           db 'Initializing Serial Communications on COM',0
    2946
    3047CheckID_MBR           db 'AiRBOOT'
     
    3350; Colors for special words hard-coded. Keep all 0s.
    3451TXT_SETUP_LowerMessage      db 'This software is released under ', 0, 'GPLv3+.', 0
    35                             db 'It may not be used by US government', 0
     52;                            db 'It may not be used by US government', 0
     53                            db 'http://www.gnu.org/licenses/gpl.txt', 0
    3654                            db 'For more information and source, please visit', 0
    3755                            db 'http://AiR-BOOT.sourceforge.net', 0
    38                             db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0
     56;                            db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0
     57                            db 'Contact via e-mail: ', 0, 'airboot@ecomstation.com', 0
    3958
    4059ContinueBIOSbootTable dw offset TXT_SETUP_MAGIC_CDROM
  • trunk/BOOTCODE/REGULAR/TIMER.ASM

    r29 r30  
    2020;---------------------------------------------------------------------------
    2121
     22IFDEF ModuleNames
     23DB 'TIMER',0
     24ENDIF
     25
    2226; This here is one of the rare cases that I'm using DIV and MUL opcodes. I
    2327;  could have coded around them in here as well, but I was too lazy. Most of
     
    3943;       Out: Nothing
    4044TIMER_WaitTicCount              Proc Near   Uses ax bx dx
    41    movzx   bx, al
     45   ;movzx   bx, al
     46   mov   bl,al
     47   mov   bh,0
     48
    4249   call    TIMER_GetTicCount
    4350   add     bx, ax                        ; BX - Required lower Tic
     
    6269   mul     bl                            ; Result * 91
    6370   mov     dx, ax
    64    movzx   ax, bh
     71   ;movzx   ax, bh
     72   mov   al,bh
     73   mov   ah,0
     74
    6575   mov     bl, 18
    6676   mul     bl                            ; Remainder * 18
     
    8090   div     dl                            ; Tics : 91
    8191   mov     dh, al
    82    movzx   ax, ah
     92   ;movzx   ax, ah
     93   mov   al,ah
     94   mov   ah,0
     95
    8396   mov     dl, 18
    8497   div     dl                            ; Remainder : 18
     
    87100   mov     bl, 5
    88101   mul     bl                            ; Result * 5
    89    movzx   dx, dh
     102   ;movzx   dx, dh
     103   mov   dl,dh
     104   mov   dh,0
     105
    90106   add     ax, dx                        ; Add both together...
    91107   ret
  • trunk/BOOTCODE/REGULAR/VIDEOIO.ASM

    r29 r30  
    1919;                                                      AiR-BOOT / VIDEO I/O
    2020;---------------------------------------------------------------------------
     21
     22IFDEF ModuleNames
     23DB 'VIDEOIO',0
     24ENDIF
    2125
    2226VideoIO_WaitRetrace             Proc Near   Uses ax dx
     
    3236   ret
    3337VideoIO_WaitRetrace             EndP
     38
     39
    3440
    3541; Holds the current position. Yeah, I know this is in the code area, but who
     
    100106   mov     ax, VideoIO_Segment
    101107   mov     es, ax
    102    movzx   ax, TextPosY
     108   ;movzx   ax, TextPosY
     109   mov   al,TextPosY
     110   mov   ah,0
     111
    103112   mov     bl, 160
    104113   mul     bl
     
    169178VideoIO_FixedPrint              EndP
    170179
     180; Rousseau:
     181; Turn off blinking
     182; http://www.ctyme.com/intr/rb-0088.htm does not mention this
     183VideoIO_NoBlinking              Proc Near   Uses ax bx
     184      mov      bx,0
     185      mov      ax,1003h
     186      int      10h
     187   ret
     188VideoIO_NoBlinking              EndP
     189
    171190;        In: AL - Single Char to Print
    172191; Destroyed: None
     
    179198   ret
    180199VideoIO_PrintSingleChar         EndP
     200
     201
     202
     203; Print hex-byte to screen
     204; This outputs two characters
     205; In:          AL - byte to send
     206; Out:         AL - byte sent
     207; Destroyed:   None
     208VideoIO_PrintHexByte    Proc     Near  Uses  ax
     209      call     CONV_BinToAsc              ; Returns high hex-nibble in AH, low hex-nibble in AL
     210      xchg     al,ah                      ; High hex-nibble first
     211      call     VideoIO_PrintSingleChar    ; Output to screen
     212      xchg     al,ah                      ; Low hex-nibble next
     213      call     VideoIO_PrintSingleChar    ; Output to screen
     214      ret
     215VideoIO_PrintHexByte    EndP
     216
     217
     218; Print hex-word to screen
     219; This outputs four characters
     220; In:          AX - word to send
     221; Out:         AX - word sent
     222; Destroyed:   None
     223VideoIO_PrintHexWord    Proc     Near
     224      xchg     al,ah                      ; High byte first
     225      call     VideoIO_PrintHexByte       ; Output to screen
     226      xchg     al,ah                      ; low byte next
     227      call     VideoIO_PrintHexByte       ; Output to screen
     228      ret
     229VideoIO_PrintHexWord    EndP
     230
     231
     232; Print hex-dword to screen
     233; This outputs eight characters
     234; In:          DX:AX - dword to send
     235; Out:         DX:AX - dword sent
     236; Destroyed:   None
     237VideoIO_PrintHexDWord   Proc     Near
     238      xchg     ax,dx
     239      call     VideoIO_PrintHexWord       ; High word first
     240      xchg     ax,dx
     241      call     VideoIO_PrintHexWord       ; Low word next
     242      ret
     243VideoIO_PrintHexDWord   EndP
     244
     245
     246; Print hex-qword to screen
     247; This outputs sixteen characters
     248; In:          BX:CX:DX:AX - qword to send
     249; Out:         BX:CX:DX:AX - qword sent
     250; Destroyed:   None
     251VideoIO_PrintHexQWord   Proc     Near
     252      xchg     dx,bx
     253      xchg     ax,cx
     254      call     VideoIO_PrintHexDWord      ; High dword first
     255      xchg     dx,bx
     256      xchg     ax,cx
     257      call     VideoIO_PrintHexDWord      ; Low dword next
     258      ret
     259VideoIO_PrintHexQWord   EndP
     260
     261
     262
     263
    181264
    182265;        In: AL - Single Char to Print
     
    205288   cmp     al, 99
    206289   ja      VIOPBN_DoNotWriteAnything
    207    movzx   bx, al
     290   ;movzx   bx, al
     291   mov   bl,al
     292   mov   bh,0
     293
    208294   call    VideoIO_Internal_SetRegs
    209295   cmp     bl, 10
    210296   jb      VIOPBN_Lower10
    211297   push    ax
    212       movzx   ax, bl
     298      ;movzx   ax, bl
     299      mov   al,bl
     300      mov   ah,0
     301
    213302      mov     dl, 10
    214303      div     dl
     
    231320;        In: AL - Single Byte to Print
    232321; Destroyed: None
    233 VideoIO_PrintByteDynamicNumber  Proc Near   Uses ax bx dx es di
     322VideoIO_PrintByteDynamicNumber  Proc Near   Uses ax bx cx dx es di               ; Rousseau: cx was missing from push-list
    234323   xor     cl, cl
    235324   mov     bh, al
     
    240329   cmp     ah, 100
    241330   jb      VIOPBDN_Lower100
    242    movzx   ax, ah
     331   ;movzx   ax, ah
     332   mov   al,ah
     333   mov   ah,0
     334
    243335   mov     dl, 100
    244336   div     dl
     
    249341   add     di, 2
    250342 VIOPBDN_Lower100:
    251    movzx   ax, ah
     343   ;movzx   ax, ah
     344   mov   al,ah
     345   mov   ah,0
     346
    252347   mov     dl, 10
    253348   div     dl
     
    270365; Destroyed: None Important
    271366VideoIO_Internal_MakeWinDown    Proc Near   Uses dx di
    272    movzx   dx, cl
     367   ;movzx   dx, cl
     368   mov   dl,cl
     369   mov   dh,0
     370
    273371   mov     bl, al
    274372   call    VideoIO_Internal_SetRegs
     
    281379   dec     dx
    282380   jnz     VIOIMWD_Loop
    283    ret     
     381   ret
    284382VideoIO_Internal_MakeWinDown    EndP
    285383
     
    287385; Destroyed: None Important
    288386VideoIO_Internal_MakeWinRight   Proc Near   Uses dx di
    289    movzx  dx, cl
     387   ;movzx  dx, cl
     388   mov   dl,cl
     389   mov   dh,0
     390
    290391   mov    bl, al
    291392   call   VideoIO_Internal_SetRegs
     
    298399      dec    dx
    299400   jnz    VIOIMWR_Loop
    300    ret     
     401   ret
    301402VideoIO_Internal_MakeWinRight   EndP
    302403
     
    366467   sub     bl, WinBeginPosX
    367468   dec     bl
    368  
     469
    369470  VIOIMW_Loop:
    370471      mov     ch, WinBeginPosY
     
    439540      call    VideoIO_CursorSet
    440541      call    VideoIO_CursorOn           ; Set and turn cursor on
    441      
     542
    442543      ; ES:DI - Screen-Position to Start of String
    443544      ; DL    - Position in String (relative to begin, base=0)
     
    460561         cmp     dl, StringLen           ; String "full" ?
    461562         jae     VIOLUES_Loop
    462          movzx   bx, dl
     563         ;movzx   bx, dl
     564         mov   bl,dl
     565         mov   bh,0
     566
    463567         shl     bx, 1
    464568         mov     es:[di+bx], al
     
    476580         mov     al, ' '
    477581         dec     dl
    478          movzx   bx, dl
     582         ;movzx   bx, dl
     583         mov   bl,dl
     584         mov   bh,0
     585
    479586         shl     bx, 1
    480587         mov     es:[di+bx], al
     
    502609   ret
    503610VideoIO_LetUserEditString       EndP
     611
     612
     613
     614;
     615; Rousseau Additions.
     616;
     617
     618
     619; Function Template
     620;ProcName                        Proc Near   Uses ax bx cx dx si es di
     621;ProcName                        EndP
     622
     623
     624;
     625; Clear the current page
     626;
     627VideoIO_ClearScreen             Proc Near   Uses ax bx cx dx si es di
     628   mov   al, 0       ; clear entire window
     629   mov   bh,07h      ; Attribute for new lines
     630   xor   cx,cx       ; Row, Column ULC
     631   xor   dx,dx
     632   dec   dx          ; Row, Column LRC (does this corrupt other pages ?)
     633   mov   ah, 06h     ; Function Code
     634   int   10h         ; Do It !
     635   ret
     636VideoIO_ClearScreen             EndP
     637
     638;
     639; Rousseau: added
     640; Set poosition to teletype cursor
     641;
     642VideoIO_SyncPos                 Proc Near   Uses ax bx cx dx
     643   pushf
     644   mov   bh, 0
     645   mov   ah, 03h
     646   int   10h
     647   mov   [TextPosX], dl
     648   mov   [TextPosY], dh
     649   popf
     650   ret
     651VideoIO_SyncPos                 EndP
     652
     653
     654
     655VideoIO_DBG_WriteString         Proc Near   Uses ax bx cx dx si es di
     656   mov   ch, [CFG_Partitions]                                                    ; y
     657   add   ch, 7
     658   add   ch, [CFG_IncludeFloppy]
     659   push cx
     660   mov   cl, 1                                                                   ; x
     661   call  VideoIO_Locate
     662   mov   ch, 15                                                                  ; fgc
     663   mov   cl, 0                                                                   ; bgc
     664   call  VideoIO_Color
     665   mov   si, offset ShowBootLog
     666   call  VideoIO_Print
     667   pop cx
     668   inc   ch
     669
     670   ;mov   ch, 21                                                                 ; y
     671   mov   cl, 1                                                                   ; x
     672   call  VideoIO_Locate
     673   mov   ch, 15                                                                  ; fgc
     674   mov   cl, 0                                                                   ; bgc
     675   call  VideoIO_Color
     676
     677
     678   ; Rousseau:
     679   mov al, [NewPartitions]
     680   ;call  VideoIO_PrintByteDynamicNumber
     681   mov al, [CFG_Partitions]
     682   ;call  VideoIO_PrintByteDynamicNumber
     683   ret
     684VideoIO_DBG_WriteString         EndP
     685
     686
     687; Dump the disk-info.
     688; Disk number is in DL.
     689VideoIO_DumpDiskInfo    Proc Near
     690
     691   VideoIO_DumpDiskInfo_next_disk:
     692      push     dx
     693      xor      ax,ax
     694      mov      al,[TextPosY]
     695      push     ax
     696
     697      mov      ax,21
     698      mov      dh,dl
     699      and      dh,01111111b
     700      mul      dh
     701      mov      dh,al
     702
     703      mov      [TextPosX],dh
     704
     705      mov   si, offset Disk
     706      call  VideoIO_Print
     707      mov   al,dl
     708
     709      ; NIET GOED, GAAT FOUT > 9, HEX PRINT GEBRUIKEN !!
     710      shr      al,4
     711      add      al,'0'
     712      call     VideoIO_PrintSingleChar
     713      mov      al,dl
     714      and      al,01111111b
     715      add      al,'0'
     716      call     VideoIO_PrintSingleChar
     717      mov      al,'h'
     718      call     VideoIO_PrintSingleChar
     719
     720      inc      [TextPosY]
     721      mov      [TextPosX],dh
     722
     723      mov      al,'-'
     724      mov      cl,17
     725      call     VideoIO_PrintSingleMultiChar
     726
     727      inc      [TextPosY]
     728      mov      [TextPosX],dh
     729      mov      si, offset BiosCyls
     730      call     VideoIO_Print
     731
     732      push     dx
     733      mov      bx,offset BIOS_Cyls
     734      xor      dh,dh
     735      and      dl,01111111b
     736      shl      dx,1
     737      shl      dx,1
     738      add      bx,dx
     739      mov      ax,[bx]
     740      mov      dx,[bx+02]
     741      call     VideoIO_PrintHexDWord
     742      pop      dx
     743
     744      inc      [TextPosY]
     745      mov      [TextPosX],dh
     746      mov      si, offset BiosHeads
     747      call     VideoIO_Print
     748
     749      push     dx
     750      mov      bx,offset BIOS_Heads
     751      xor      dh,dh
     752      and      dl,01111111b
     753      shl      dx,1
     754      shl      dx,1
     755      add      bx,dx
     756      mov      ax,[bx]
     757      mov      dx,[bx+02]
     758      call     VideoIO_PrintHexDWord
     759      pop      dx
     760
     761      inc      [TextPosY]
     762      mov      [TextPosX],dh
     763      mov      si, offset BiosSecs
     764      call     VideoIO_Print
     765
     766      push     dx
     767      mov      bx,offset BIOS_Secs
     768      xor      dh,dh
     769      and      dl,01111111b
     770      shl      dx,1
     771      shl      dx,1
     772      add      bx,dx
     773      mov      ax,[bx]
     774      mov      dx,[bx+02]
     775      call     VideoIO_PrintHexDWord
     776      pop      dx
     777
     778      inc      [TextPosY]
     779      mov      [TextPosX],dh
     780      mov      si, offset LvmSecs
     781      call     VideoIO_Print
     782
     783      push     dx
     784      mov      bx,offset TrueSecs
     785      xor      dh,dh
     786      and      dl,01111111b
     787      shl      dx,1
     788      shl      dx,1
     789      add      bx,dx
     790      mov      ax,[bx]
     791      mov      dx,[bx+02]
     792      call     VideoIO_PrintHexDWord
     793      pop      dx
     794
     795      inc      [TextPosY]
     796      mov      [TextPosX],dh
     797      mov      si, offset BiosLBA
     798      call     VideoIO_Print
     799
     800      push     dx
     801      mov      bx,offset BIOS_TotalSecs
     802      xor      dh,dh
     803      and      dl,01111111b
     804      shl      dx,1
     805      shl      dx,1
     806      shl      dx,1
     807      add      bx,dx
     808      mov      ax,[bx]
     809      mov      dx,[bx+02]
     810      call     VideoIO_PrintHexDWord
     811      pop      dx
     812
     813      inc      [TextPosY]
     814      mov      [TextPosX],dh
     815
     816      pop      ax
     817      mov      [TextPosY],al
     818      pop      dx
     819
     820      inc      dl
     821      mov      al,dl
     822      and      al,01111111b
     823      cmp      al,[TotalHarddiscs]
     824      jae      VideoIO_DumpDiskInfo_end
     825      jmp      VideoIO_DumpDiskInfo_next_disk
     826
     827   VideoIO_DumpDiskInfo_end:
     828      mov      [TextPosX],0
     829      add      [TextPosY],6
     830      ret
     831VideoIO_DumpDiskInfo    EndP
     832
     833
     834
     835; Disk Info to Dump to AB LogScreen
     836Disk:             db "DISK ",0
     837BiosCyls:         db "Cyls    :",0
     838BiosHeads:        db "Heads   :",0
     839BiosSecs:         db "Secs    :",0
     840LvmSecs:          db "SecsLVM :",0
     841BiosLBA:          db "LBA Secs:",0
     842
     843
     844HugeBootDisk:     db "Boot Disk is Huge    : ",0
     845DisksFound:       db "Disks Found          : ",0
     846PartitionsFound:  db "Partitions Found     : ",0
     847;AutoStartPart:    db "Auto Start Partition : ",0
     848
     849Phase1:           db "eCS Install Phase 1  : ",0
     850
     851
     852ShowMenu:         db "Press TAB to return to the AiR-BOOT Menu",0
     853ShowBootLog:      db "Press TAB to see the Boot Log...",0
     854
     855Yes:              db "YES",0
     856No:               db "NO",0
     857On:               db "ON",0
     858Off:              db "OFF",0
     859None:             db "NONE",0
     860Active:           db "ACTIVE",0
     861NotActive:        db "NOT ACTIVE",0
     862
     863; New Line for use by MBR_Teletype
     864NL:         db 0dh, 0ah, 0
Note: See TracChangeset for help on using the changeset viewer.