Changeset 51 for trunk/BOOTCODE/REGULAR/DRIVEIO.ASM
- Timestamp:
- Apr 13, 2014, 3:50:38 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/BOOTCODE/REGULAR/DRIVEIO.ASM (modified) (26 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/REGULAR/DRIVEIO.ASM
r50 r51 22 22 23 23 24 IFDEF ModuleNames24 IFDEF MODULE_NAMES 25 25 DB 'DRIVEIO',0 26 26 ENDIF … … 161 161 pop si 162 162 pop ds 163 mov TotalHarddiscs, dh163 mov [TotalHarddiscs], dh 164 164 ret 165 165 DriveIO_GetHardDriveCount EndP … … 172 172 DriveIO_InitLBASwitchTable Proc Near Uses es di 173 173 mov di, offset LBASwitchTable 174 mov dh, TotalHarddiscs174 mov dh, [TotalHarddiscs] 175 175 mov dl, 80h 176 176 DIOILUT_DriveLoop: … … 206 206 207 207 208 209 208 210 ; Adjusts BX:AX / CX:DX to meet LVM sector location 211 ; BX:AX / CX:DX point to MBR or EBR ! 209 212 ; Destroys SI 210 213 ; Rousseau: Enhanced to handle sector-numbers 127 and 255 besides 63 for LVM-info sectors. 211 214 ; Ugly, need to cleanup. 212 215 DriveIO_LVMAdjustToInfoSector Proc Near 213 214 ;~ pusha 215 ;~ call AuxIO_TeletypeNL 216 ;~ 217 ;~ ; LBA 218 ;~ xchg dx,bx 219 ;~ call AuxIO_TeletypeHexDWord 220 ;~ call AuxIO_TeletypeNL 221 ;~ xchg bx,dx 222 ;~ 223 ;~ ; CYL 224 ;~ mov al,ch 225 ;~ call AuxIO_TeletypeHexByte 226 ;~ call AuxIO_TeletypeNL 227 ;~ 228 ;~ ; HEAD 229 ;~ mov al,dh 230 ;~ call AuxIO_TeletypeHexByte 231 ;~ call AuxIO_TeletypeNL 232 ;~ 233 ;~ ; SEC 234 ;~ mov al,cl 235 ;~ call AuxIO_TeletypeHexByte 236 ;~ call AuxIO_TeletypeNL 237 ;~ 238 ;~ ; DRIVE 239 ;~ mov al,dl 240 ;~ call AuxIO_TeletypeHexByte 241 ;~ call AuxIO_TeletypeNL 242 ;~ popa 243 ;~ 244 ;~ ;local ts:word 245 ;~ ;local ts2:word 246 247 pusha 248 249 ; Dump drive 250 ;mov si,offset drive 251 ;call AuxIO_Print 252 ;xchg al,dl 253 ;call AuxIO_TeletypeHexByte 254 ;call AuxIO_TeletypeNL 255 ;xchg dl,al 256 257 ; Dump SPT 258 ;mov si,offset spt_used 259 ;call AuxIO_Print 260 push dx 261 push bx 262 xor dh,dh 263 and dl,01111111b 264 shl dx,1 265 shl dx,1 266 mov bx, offset TrueSecs 267 add bx,dx 268 mov ax,word ptr [bx] 269 ;mov [ts],ax 270 ;call AuxIO_TeletypeHexWord 271 ;call AuxIO_TeletypeNL 272 pop bx 273 pop dx 274 275 pusha 276 push dx 277 ; Location of extended position 278 mov dx,word ptr [ExtendedAbsPos+02] 279 mov ax,word ptr [ExtendedAbsPos+00] 280 ;call AuxIO_TeletypeHexDWord 281 ;call AuxIO_TeletypeNL 282 pop dx 283 284 xor dh,dh 285 and dl,01111111b 286 shl dx,1 287 shl dx,1 288 mov bx, offset TrueSecs 289 add bx,dx 290 291 mov ax, word ptr[bx] 216 push cx ; Save Cyl/Sec part 217 xor ch,ch ; Clear low Cyl part 218 and cl,63 ; Clear high Cyl part 219 push bx ; We need BX... 220 push dx ; and DX temoraily 221 mov bx,offset [TrueSecs] ; Offset of sector table 222 xor dh,dh ; Clear DH because we use DL as index 223 and dl,01111111b ; Remove high bit of BIOS disk-nr 224 shl dx,2 ; Index to DWORD table 225 add bx,dx ; Point to TrueSecs for this disk 226 mov si,[bx] ; Get SPT for this disk 227 pop dx ; Restore DX... 228 pop bx ; and BX 229 ;~ sub si,cx ; Adjust offset !! INCORRECT FOR LBA (TP CX != 0 !!) 230 dec si 231 pop cx ; Restore Cyl/Sec part 232 add ax,si ; Add offset to low part... 233 adc bx,0 ; and high part of LBA address 234 or cl,63 ; Adjust CHS part !FIX ME for > 63! !! FIX HUGE DRIVE !! 235 ret 236 237 238 ;;jmp bliep 239 ;; pusha 240 241 ;; push dx 242 ;; push bx 243 ;; xor dh,dh 244 ;; and dl,01111111b 245 ;; shl dx,1 246 ;; shl dx,1 247 ;; mov bx, offset [TrueSecs] 248 ;; add bx,dx 249 ;; mov ax,word ptr [bx] 250 ;; pop bx 251 ;; pop dx 252 253 254 ; 255 ; AX now contains LVM secs 256 ; 257 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 ;; mov ax, word ptr[bx] 275 292 276 ;call AuxIO_TeletypeHexWord 293 277 ;call AuxIO_TeletypeNL 294 mov al,[ExtendedAbsPosSet] ; if true -> 1st sector of extpart (EBR), not logpart(BPB)278 ;; mov al,[ExtendedAbsPosSet] ; if true -> 1st sector of extpart (EBR), not logpart(BPB) 295 279 ;call AuxIO_TeletypeHexByte 296 280 ;call AuxIO_TeletypeNL 297 281 ;mov si,offset PartitionSector 298 282 ;call AuxIO_DumpSector 299 popa283 ;; popa 300 284 301 285 ; LBA … … 307 291 ;call AuxIO_TeletypeNL 308 292 ;xchg bx,dx 309 popa 310 293 ;; popa 294 295 296 ;;bliep: 311 297 312 298 ;or bx,ax 313 test byte ptr [ExtendedAbsPosSet],1 314 jz pri 315 316 317 318 319 ;pusha 320 ;mov si,offset before_lvm_adjust_log 321 ;call AuxIO_Print 322 ; LBA 323 ;xchg dx,bx 324 ;call AuxIO_TeletypeHexDWord 325 ;call AuxIO_TeletypeNL 326 ;xchg bx,dx 327 ;popa 328 329 330 push dx 331 push bx 332 333 xor dh,dh 334 and dl,01111111b 335 shl dx,1 336 shl dx,1 337 mov bx,offset TrueSecs 338 add bx,dx 339 mov dx,[bx] 340 dec dx 341 add ax,dx 342 343 pop bx 344 pop dx 345 adc bx,0 346 347 348 ;pusha 349 ;mov si,offset after_lvm_adjust_log 350 ;call AuxIO_Print 351 ; LBA 352 ;xchg dx,bx 353 ;call AuxIO_TeletypeHexDWord 354 ;call AuxIO_TeletypeNL 355 ;xchg bx,dx 356 ;popa 357 358 jmp done 359 360 361 362 363 pri: 364 365 366 push ax 367 push cx 368 xor ch, ch ; Zero out upper-byte 369 370 push dx 371 xor dh,dh 372 and dl,01111111b 373 shl dx,1 374 shl dx,1 375 376 push bx 377 mov bx,offset TrueSecs 378 add bx,dx 379 mov ax,[bx] 299 ;; test byte ptr [ExtendedAbsPosSet],1 300 ;; jz pri 301 302 303 ;; push dx 304 ;; push bx 305 306 ;; xor dh,dh 307 ;; and dl,01111111b ; Strip high bit from disk 308 ;; shl dx,1 ; Convert to index 309 ;; shl dx,1 ; into TrueSecs table 310 ;; mov bx,offset [TrueSecs] ; Base of table 311 ;; add bx,dx ; Point to entry for disk 312 ;; mov dx,[bx] ; Get TrueSecs (LVM) 313 ;; dec dx 314 ;; add ax,dx 315 316 ;; pop bx 317 ;; pop dx 318 ;; adc bx,0 319 320 321 ;; jmp done 322 323 324 325 ;; pri: 326 327 328 ;; push ax 329 ;; push cx 330 ;; xor ch, ch ; Zero out upper-byte 331 332 ;; push dx 333 ;; xor dh,dh 334 ;; and dl,01111111b 335 ;; shl dx,1 336 ;; shl dx,1 337 338 ;; push bx 339 ;; mov bx,offset [TrueSecs] 340 ;; add bx,dx 341 ;; mov ax,[bx] 380 342 ;mov [ts2],ax 381 pop bx382 pop dx343 ;; pop bx 344 ;; pop dx 383 345 384 346 … … 394 356 ; ALLEEN TOEPASSEN ALS INT13X NIET ACTIEF ! 395 357 396 and cl, al ; Isolate lower bits, because upper397 mov ah, 0398 mov si, ax ; ones may be used for cylinder399 sub si, cx400 401 pop cx402 pop ax403 404 or cl, al ; Set sector to last sector405 add ax, si ; Adjust lower LBA406 adc bx, 0 ; Adjust LBA Sector (BX:AX)358 ;; and cl, al ; Isolate lower bits, because upper 359 ;; mov ah, 0 360 ;; mov si, ax ; ones may be used for cylinder 361 ;; sub si, cx 362 363 ;; pop cx 364 ;; pop ax 365 366 ;; or cl, al ; Set sector to last sector 367 ;; add ax, si ; Adjust lower LBA 368 ;; adc bx, 0 ; Adjust LBA Sector (BX:AX) 407 369 408 370 … … 421 383 ;~ and ax,[ts] 422 384 423 jmp done424 425 426 427 done:385 ;; jmp done 386 387 388 389 ;; done: 428 390 429 391 ;pusha … … 461 423 ;~ popa 462 424 463 ret425 ;; ret 464 426 DriveIO_LVMAdjustToInfoSector EndP 465 427 … … 496 458 DIOLP_Success: 497 459 498 IFDEF AUX_DEBUG460 IFDEF AUX_DEBUG 499 461 ; show current partition location 500 462 ;~ pushf … … 553 515 DriveIO_SaveTmpSector EndP 554 516 517 518 555 519 ; Keeps DS:SI for caller, sets carry if valid LVM sector encountered 556 520 DriveIO_LoadLVMSector Proc Near Uses ax bx cx dx … … 567 531 call DriveIO_LoadSector 568 532 569 IFDEF AUX_DEBUG533 IFDEF AUX_DEBUG 570 534 ; show current partition location 571 535 ;~ pushf … … 597 561 DriveIO_LoadLVMSector EndP 598 562 563 564 599 565 ; Keeps DS:SI for caller, saves at anytime w/o checks (!) 600 566 DriveIO_SaveLVMSector Proc Near Uses ax bx cx dx … … 608 574 jnc DIOSLVMS_SevereError ; LVM Signature must be there 609 575 610 IFDEF AUX_DEBUG 611 ;~ call DEBUG_DumpRegisters 612 ENDIF 576 IFDEF AUX_DEBUG 577 ;~ dioatlvm db 'DriveIO_LVMAdjustToInfoSector',10,0 578 ;~ pushf 579 ;~ pusha 580 ;~ mov si,offset dioatlvm 581 ;~ call AuxIO_Print 582 ;~ popa 583 ;~ popf 584 call DEBUG_DumpRegisters 585 call DEBUG_DumpCHS 586 ENDIF 613 587 614 588 call DriveIO_LVMAdjustToInfoSector 615 589 616 IFDEF AUX_DEBUG 617 ;~ call DEBUG_DumpRegisters 618 ENDIF 590 IFDEF AUX_DEBUG 591 call DEBUG_DumpRegisters 592 call DEBUG_DumpCHS 593 ENDIF 619 594 620 595 mov si, offset LVMSector … … 670 645 ; Preserve: all registers 671 646 ; ######################################################################### 672 DriveIO_LoadSector Proc Near Uses ax bx ds si es di647 DriveIO_LoadSector Proc Near Uses ax bx cx dx ds si es di 673 648 ; Is the drive not a harddrive? 674 649 cmp dl, 80h … … 680 655 jnz DIOLS_UseExtension 681 656 682 ; Upper 8 bits of LBA-address set? -> Use LBA (maximum boundary is FB0400h) 657 ; Upper 8 bits of LBA-address set? 658 ; Then use LBA (maximum boundary is 16320x16x63 = FB0400h) 683 659 or bh, bh 684 660 jnz DIOLS_UseExtension … … 787 763 788 764 765 ; 766 ; ############################################################ 767 ; # Check for a valid MBR-sector to be written to disk # 768 ; ############################################################ 769 ; 770 ; In 771 ; -- 772 ; DL = Physical Disk 773 ; BX:CX = LBA sector 774 ; DI:SI = Source buffer 775 ; 776 ; Out 777 ; --- 778 ; CY = 1 if invalid MBR in source buffer, 0 if valid 779 ; 780 ; This routine is called when DriveIO_SaveSector attempts to write to the MBR. 781 ; It checks if the sector to be written has some sensible values in certain 782 ; places. In fact, if the sector is written to the boot-disk, the AiR-BOOT 783 ; signature should be present and the partition table should be the same 784 ; as the one at the start of the AiR-BOOT code in memory, except maybe for the 785 ; active flags. 786 ; For other disks, only the active flags are checked to be 00h or 80h and 787 ; the AA55h MBR signature. 788 ; 789 DriveIO_ProtectMBR Proc Near 790 pusha ; Push all registers 791 push es ; Push ES because we need it for string instructions 792 push cs ; Make ES point... 793 pop es ; to CS 794 795 ; Save the pointer to the sector to write in BX 796 mov bx,si 797 798 ; 799 ; If the sector to be written is not the boot-disk, then skip 800 ; checking the AiR-BOOT MBR. 801 ; 802 cmp dl,80h 803 ja DriveIO_ProtectMBR_is_not_bootdisk 804 805 ; 806 ; The boot-disk is accessed so the sector to be written must be 807 ; the AiR-BOOT MBR. This is the same as the first 512 bytes 808 ; relocated to 8000:0000 and this the start of the AB-code. 809 ; 810 mov si,bx ; Get pointer to sector to write 811 xor di,di ; Point DI to start of AB-code (MBR) 812 mov cx, offset [MBR_PartTable] ; Bytes upto P-table must be same 813 cld ; Compare upwards 814 repe cmpsb ; Compare upto P-table 815 816 ; If not the same this is not the an AiR-BOOT boot-disk MBR ! 817 jne DriveIO_ProtectMBR_not_valid_MBR ; SEVERE ERROR ! 818 819 ; Continue with signature check 820 jmp DriveIO_ProtectMBR_check_signature 821 822 823 ; 824 ; The disk is not the boot-disk so we don't know what kind of MBR is on it. 825 ; Some sanity checks should be here. 826 ; 827 DriveIO_ProtectMBR_is_not_bootdisk: 828 829 ; 830 ; sanity checks... 831 ; 832 833 ; Continue with signature check 834 jmp DriveIO_ProtectMBR_check_signature 835 836 837 DriveIO_ProtectMBR_check_signature: 838 ; See if the sector to write contains a valid signature 839 mov si,bx ; Get pointer to sector to write 840 mov di, offset [MBR_Sig] ; Offset to MBR signature 841 add si,di ; Make SI point to it in sec to write 842 lodsw ; Load it 843 cmp ax,0aa55h ; See if it is valid 844 845 ; If no signature this cannot be a valid MBR ! 846 jne DriveIO_ProtectMBR_not_valid_MBR ; SEVERE ERROR ! 847 848 849 ; 850 ; The sector to be written seems to be valid. 851 ; Set CY=0 to indicate a valid MBR. 852 ; 853 DriveIO_ProtectMBR_is_valid_MBR: 854 clc 855 jmp DriveIO_ProtectMBR_end 856 857 ; 858 ; Something is terribly wrong; a non-MBR sector seems about to be written. 859 ; Set CY=1 and let the calling code handle this situation. 860 ; 861 DriveIO_ProtectMBR_not_valid_MBR: 862 stc 863 jmp DriveIO_ProtectMBR_end 864 865 ; 866 ; Return to the caller with no registers modyfied except FLAGS. 867 ; 868 DriveIO_ProtectMBR_end: 869 pop es 870 popa 871 ret 872 DriveIO_ProtectMBR Endp 873 874 875 876 ; ######################################################################### 877 ; Routine: Checks if the MBR is addressed by either CHS or LBA 878 ; ######################################################################### 879 ; Calling : bx:ax - Absolute sector 880 ; cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 881 ; Returns : ZF=1 if MBR is addressed, else ZF=0 882 ; Preserve: all registers 883 ; ######################################################################### 884 DriveIO_MBR_Addressed Proc 885 push ax 886 push bx 887 888 or bx,ax ; Results in 0 in BX if MBR is addressed by LBA 889 jz DriveIO_MBR_Addressed_done 890 891 mov ax,cx ; Results in 1 in AX if CYL 0, SEC 1 is addressed 892 add al,dh ; Results in 1 in AX if HEAD 0 is addressed 893 dec ax ; Results in 0 in AX if MBR is addressed by CHS 894 895 DriveIO_MBR_Addressed_done: 896 pop bx 897 pop ax 898 ret 899 DriveIO_MBR_Addressed EndP 900 901 902 789 903 790 904 ; ######################################################################### … … 797 911 ; Preserve: all registers 798 912 ; ######################################################################### 799 DriveIO_SaveSector Proc Near Uses ax bx cx ds si es di 800 801 IFDEF AUX_DEBUG 913 DriveIO_SaveSector Proc Near Uses ax bx cx dx ds si es di 914 915 916 ;! 917 ;! DEBUG_BLOCK 918 ;! Force write to LBA0 to test interception routine. 919 ;! Do *NOT* enable unless you are debugging, will overwrite MBR ! 920 ;! 921 ;~ __DIO_FORCE_LBA0_WRITE__ EQU 922 IFDEF AUX_DEBUG 923 IFDEF __DIO_FORCE_LBA0_WRITE__ 924 xor ax,ax 925 xor bx,bx 926 xor cx,cx 927 inc cx 928 xor dh,dh 929 ENDIF 930 ENDIF 931 932 933 ;! 934 ;! DEBUG_BLOCK 935 ;! Check what is being written to disk. 936 ;! Uncomment below to activate. 937 ;! 938 __DIO_SS_DMP__ EQU 939 IFDEF AUX_DEBUG 940 IFDEF __DIO_SS_DMP__ 941 pusha 942 push si 943 mov si,offset dioss 944 call AuxIO_Print 945 pop si 802 946 call DEBUG_DumpRegisters 803 947 call AuxIO_DumpSector 804 948 call AuxIO_TeletypeNL 805 ENDIF 806 949 popa 950 ENDIF 951 ENDIF 952 953 ; 954 ; Check if the MBR is the destination for the write. 955 ; ZF=1 if so. 956 ; 957 call DriveIO_MBR_Addressed 958 jnz DriveIO_SaveSector_continue_write 959 960 961 ; MBR is addressed, check the sector that is requested to be written. 962 ; For the bootdisk it should contain the AiR-BOOT signature, valid 963 ; partition-table entries and the AA55h signature. 964 ; If not, something is terribly wrong in some piece of the AB code. 965 ; For any other disk (80h+) at least a valid partition table should 966 ; be present together with the AA55h signature. 967 call DriveIO_ProtectMBR 968 jnc DriveIO_SaveSector_continue_write 969 970 971 ; 972 ; WE HAVE A SEVERE ERROR CONDITION ! 973 ; SOME AB CODE TRIES TO WRITE A NON-MBR TO THE DISK ! 974 ; ASK THE USER TO REPORT THIS ! 975 ; HALT THE SYSTEM ! 976 ; 977 978 ; Show error-box 979 mov cx, 0C04h 980 mov si, offset NonMBRwrite 981 call SETUP_ShowErrorBox 982 mov cx, 0C04h 983 mov si, offset NonMBRwrite_rep 984 call SETUP_ShowErrorBox 985 986 987 IFDEF AUX_DEBUG 988 pusha 989 mov si, offset NonMBRwrite 990 call AuxIO_TeletypeNL 991 call AuxIO_Print 992 call AuxIO_TeletypeNL 993 popa 994 ENDIF 995 996 ; Show popup and halt the system. 997 jmp HaltSystem 998 999 1000 1001 ; 1002 ; Continue the write if not MBR sector or MBR to write is validated. 1003 ; 1004 DriveIO_SaveSector_continue_write: 807 1005 test byte ptr cs:[CurIO_UseExtension], 1 808 1006 jz DIOSS_UseNormal … … 880 1078 ; Rousseau: # Load the master LVM-sector if one exists # 881 1079 ; ------------------------------------------------------ 882 ; Load the master LVM-sector to get the number of sectors per track as eCS views the drive. 883 ; If no master LVM-sector is found it is assumed eCS is not installed. 884 ; The master LVM-sector can be located at three different places according to drive size 885 ; and partitioning scheme and driver used. 886 ; When DANIS506.ADD is used, the eCS extended geometry will be 255/127 for drives >502GiB but <1TiB. 887 ; Then the location will be sector 127 which is LBA 126 (7Eh). 1080 ; Load the master LVM-sector to get the number of sectors per track as 1081 ; eCS views the drive. If no master LVM-sector is found it is assumed eCS 1082 ; is not installed. The master LVM-sector can be located at three different 1083 ; places depending on drive size and partitioning scheme and driver used. 1084 ; When DANIS506.ADD is used, the eCS extended geometry will be 255/127 for 1085 ; drives >502GiB but <1TiB. Then the location will be sector 127 which 1086 ; is LBA 126 (7Eh). 888 1087 ; IBM1S506.ADD will always use 255/255 for the extended eCS geometry. 889 1088 ; DANIS506.ADD will use 255/255 for drives >1TiB. 890 1089 ; Then the location of the master LVM-sector will be 255 which is LBA 254 (FEh). 891 ; When eCS is installed on a huge drive that alread had a system on it, eCS will be confined to the 892 ; lower 502GiB of the drive. In this case the normal geometry from Int13X will be used. 1090 ; When eCS is installed on a huge drive that alread had a system on it, eCS 1091 ; will be confined to the lower 502GiB of the drive. 1092 ; In this case the normal geometry from Int13X will be used. 893 1093 ; This is also the case when no valid master LVM-sector can be found. 894 1094 ; … … 914 1114 915 1115 ; Loop over the sector-translation table, 916 ; process the first three values from high (255) to low (bios spt, most likely 63) 1116 ; process the first three values from high (255) to low. 1117 ; (bios spt, most likely 63) 917 1118 mov cx,3 918 1119 DriveIO_LoadMasterLVMSector_NextTry: … … 921 1122 922 1123 ; Setup destination address 923 mov si, offset LVMSector924 mov w ptr [DriveIO_DAP_Transfer+0],si1124 mov si, offset [LVMSector] 1125 mov word ptr [DriveIO_DAP_Transfer+0],si 925 1126 mov ax, ds 926 mov w ptr [DriveIO_DAP_Transfer+2],ax1127 mov word ptr [DriveIO_DAP_Transfer+2],ax 927 1128 928 1129 ; Get the sector-number of the next possible LVM sector (255,127,63) … … 950 1151 ;~ pop ax 951 1152 952 IFDEFAUX_DEBUG1153 IFDEF AUX_DEBUG 953 1154 ; Dump the value 954 1155 ;~ call AuxIO_TeletypeHexByte 955 1156 ;~ call AuxIO_TeletypeNL 956 ENDIF1157 ENDIF 957 1158 958 1159 ; Setup the requested LBA sector number 959 mov w ptr [DriveIO_DAP_Absolute+0],ax ; LBA low960 mov w ptr [DriveIO_DAP_Absolute+2],00h; LBA high961 mov si, offset DriveIO_DAP ; address request packet1160 mov word ptr [DriveIO_DAP_Absolute+0],ax ; LBA low NORMAL I/O GEBRUIKEN ! 1161 mov word ptr [DriveIO_DAP_Absolute+2],00h ; LBA high 1162 mov si, offset DriveIO_DAP ; address request packet 962 1163 mov ah, 42h 963 int 13h ; do the i/o1164 int 13h ; do the i/o 964 1165 cmc ; Complement carry so we can exit imm. on error 965 1166 jnc DriveIO_LoadMasterLVMSector_End ; oops, return with NC 966 1167 967 1168 968 mov si,offset LVMSector1169 mov si,offset [LVMSector] 969 1170 970 1171 ; See if this is a valid LVM-sector 1172 ; CY=1 if valid 971 1173 call DriveIO_LVMSectorValid 972 1174 … … 992 1194 993 1195 DriveIO_LoadMasterLVMSector_Found: 1196 ; Store the address for later use. 1197 mov ax, word ptr [DriveIO_DAP_Absolute] 1198 mov word ptr [MasterLVMLBA], ax 1199 994 1200 DriveIO_LoadMasterLVMSector_End: 995 1201 popa … … 1011 1217 ; There are a few boundaries that are of importance. 1012 1218 ; Note that these are disk-boundaries and not partition boundaries. 1013 ; Even with a small partition, like <502GiB, OS/2 will use extended geometry on an1014 ; empty huge disk.1219 ; Even with a small partition, like <502GiB, OS/2 will use extended geometry on 1220 ; an empty huge disk. 1015 1221 ; These boundaries are (from high to low): 1016 1222 … … 1040 1246 ; (code 1) 1041 1247 ; 65536*255*63 = 1052835840 = 3EC10000 sectors ~ 502 GiB 1042 ; This is the current OS/2 limit using this geometry because OS/2 can currently 1043 ; not address more than 65536 cylinders. 1044 ; DANI will address space above with 255/127 extended geometry up until the DANI 1TiB boundary (code 2) 1248 ; This is the current OS/2 limit using this geometry because OS/2 can 1249 ; currently not address more than 65536 cylinders. 1250 ; DANI will address space above with 255/127 extended geometry up until 1251 ; the DANI 1TiB boundary (code 2) 1045 1252 1046 1253 ; (code 0) … … 1052 1259 ; 1053 1260 1054 ; 5 = This drive is above the 2^32 LBA32 (2TB) boundary and has more than 4294967296 sectors. 1261 ; 5 = This drive is above the 2^32 LBA32 (2TB) boundary and has more 1262 ; than 4294967296 sectors. 1055 1263 ; LBA48 addressing is needed to access the complete capacity of the drive. 1056 1264 ; OS/2 is currently unable to do so. 1057 1265 1058 1266 ; 4 = This drive is above the 65536*255*255 (4261478400) boundary but below 2^32. 1059 ; This is an OS/2 boundary and OS/2 is not able to access the drive above this boundary. 1060 1061 ; 3 = This drive is above the 2^31 (1TB) boundary and has more than 2147483648 sectors. 1267 ; This is an OS/2 boundary and OS/2 is not able to access the drive above 1268 ; this boundary. 1269 1270 ; 3 = This drive is above the 2^31 (1TB) boundary and has more than 1271 ; 2147483648 sectors. 1062 1272 ; OS/2 is able to access the drive using it's extended geometry. 1063 1273 ; Both DANIS506 and IBM1S506 will use the 255/255 scheme. … … 1067 1277 ; Both DANIS506 and IBM1S506 will use the 255/255 scheme. 1068 1278 1069 ; 1 = This drive is above the 65536*255*63 (1052835840) boundary but below 65536*255*127. 1279 ; 1 = This drive is above the 65536*255*63 (1052835840) boundary but 1280 ; below 65536*255*127. 1070 1281 ; OS/2 is able to access the drive using it's extended geometry. 1071 1282 ; Note that DANIS506 will use 255/127 and IBM1S506 will use 255/255 geometry !
Note:
See TracChangeset
for help on using the changeset viewer.
