Changeset 118 for trunk/bootcode/regular/driveio.asm
- Timestamp:
- Apr 8, 2017, 12:27:17 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bootcode/regular/driveio.asm
r117 r118 741 741 742 742 mov di, ds ; segment for transfer address 743 mov cx, ax ; low word of lba744 743 call DriveIO_ReadSectorLBA ; extended read 745 744 jc DriveIO_GotLoadError ; halt on error … … 792 791 ;# EFFECTS : Modifies DAP structure and fills transfer buffer 793 792 ;# ---------------------------------------------------------------------------- 794 ;# IN : BX: CX - LBA address of sector793 ;# IN : BX:AX - LBA address of sector 795 794 ;# : DI:SI - SEG:OFF of transfer buffer 796 795 ;# ---------------------------------------------------------------------------- 797 ;# OUT : CF=1 - failure , AH failure code796 ;# OUT : CF=1 - failure 798 797 ;############################################################################## 799 DriveIO_ReadSectorLBA Proc Near Uses bx cx dx si di ds es798 DriveIO_ReadSectorLBA Proc Near 800 799 801 800 IFDEF AUX_DEBUG … … 818 817 ENDIF 819 818 819 ; Push all registers 820 pusha 821 push ds 822 push es 823 820 824 ; One sector to read 821 825 mov cs:[INT13X_DAP_NumBlocks], 1 … … 826 830 827 831 ; Setup LBA64 address of requested sector 828 mov wptr cs:[INT13X_DAP_Absolute+0], cx ; low word lower part832 mov wptr cs:[INT13X_DAP_Absolute+0], ax ; low word lower part 829 833 mov wptr cs:[INT13X_DAP_Absolute+2], bx ; high word lower part 830 834 mov wptr cs:[INT13X_DAP_Absolute+4], 0 ; low word upper part … … 850 854 851 855 DriveIO_ReadSectorLBA_exit: 852 ret 853 856 857 ; Pop all registers 858 pop es 859 pop ds 860 popa 861 862 ret 854 863 DriveIO_ReadSectorLBA EndP 855 864 … … 861 870 ;# EFFECTS : Modifies DAP structure and mofifies the disk 862 871 ;# ---------------------------------------------------------------------------- 863 ;# IN : AL - write flags, AL.0 verify (1.0,2.0), AL.1 verify (2.1+) 864 ;# : BX:CX - LBA address of sector 872 ;# IN : BX:AX - LBA address of sector 865 873 ;# : DI:SI - SEG:OFF of transfer buffer 866 874 ;# ---------------------------------------------------------------------------- 867 ;# OUT : CF=1 - failure , AH failure code875 ;# OUT : CF=1 - failure 868 876 ;############################################################################## 869 DriveIO_WriteSectorLBA Proc Near Uses bx cx dx si di ds es877 DriveIO_WriteSectorLBA Proc Near 870 878 871 879 IFDEF AUX_DEBUG … … 886 894 ENDIF 887 895 888 ; Mask reserved bits for write flags -- should check version here 889 and al, 03h 890 891 ; Actually, force 'no-write-verify' for now... 892 xor al, al 896 ; Push all registers 897 pusha 898 push ds 899 push es 893 900 894 901 ; One sector to read … … 900 907 901 908 ; Setup LBA64 address of requested sector 902 mov wptr cs:[INT13X_DAP_Absolute+0], cx ; low word lower part909 mov wptr cs:[INT13X_DAP_Absolute+0], ax ; low word lower part 903 910 mov wptr cs:[INT13X_DAP_Absolute+2], bx ; high word lower part 904 911 mov wptr cs:[INT13X_DAP_Absolute+4], 0 ; low word upper part … … 909 916 910 917 ; Do the extended write 918 xor al, al ; no write verify 911 919 mov ah, 43h ; write function 912 920 int 13h ; transfer to bios … … 924 932 925 933 DriveIO_WriteSectorLBA_exit: 926 ret 927 934 935 ; Pop all registers 936 pop es 937 pop ds 938 popa 939 940 ret 928 941 DriveIO_WriteSectorLBA EndP 929 942 … … 1017 1030 1018 1031 ; Now read the LBA sector specified in CX 1019 xor bx, bx ; LBA high, CX already has LBA low 1032 mov ax, cx ; LBA low 1033 xor bx, bx ; LBA high 1020 1034 mov di, ds ; Segment of temp buffer 1021 1035 mov si, offset [TmpSector] ; Offset of temp buffer … … 1054 1068 ; For now we assume this is the correct Master LVM sector for the disk. 1055 1069 inc cx ; CX was prepared to read next, correct that 1056 stc ; Indicate we have found aMaster LVM sector1070 stc ; Indicate we have found the Master LVM sector 1057 1071 1058 1072 DriveIO_LocateMasterLVMSector_done: … … 1364 1378 1365 1379 mov di, ds ; segment for transfer address 1366 mov cx, ax ; low word of lba1367 xor ax, ax ; no verify1368 1380 call DriveIO_WriteSectorLBA ; extended write 1369 1381 jc MBR_SaveError ; halt on error
Note:
See TracChangeset
for help on using the changeset viewer.