Changeset 151 for trunk/bootcode/regular/driveio.asm
- Timestamp:
- Apr 8, 2017, 12:27:54 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bootcode/regular/driveio.asm
r150 r151 271 271 ret 272 272 DriveIO_InitLBASwitchTable EndP 273 274 275 276 277 ;FIXME: Only LBA gets updated, need to update CHS too !!!!!!!278 279 ; Adjusts BX:AX / CX:DX to meet LVM sector location280 ; BX:AX / CX:DX point to MBR or EBR !281 ; Destroys SI282 ; Rousseau: Enhanced to handle sector-numbers 127 and 255 besides 63 for LVM-info sectors.283 ; Ugly, need to cleanup.284 DriveIO_LVMAdjustToInfoSector Proc Near285 286 IFDEF AUX_DEBUG287 IF 0288 DBG_TEXT_OUT_AUX 'DriveIO_LVMAdjustToInfoSector:'289 PUSHRF290 call DEBUG_DumpRegisters291 ;~ call AuxIO_DumpParagraph292 ;~ call AuxIO_TeletypeNL293 POPRF294 ENDIF295 ENDIF296 297 push cx ; Save Cyl/Sec part298 xor ch,ch ; Clear low Cyl part299 and cl,63 ; Clear high Cyl part300 push bx ; We need BX...301 push dx ; and DX temoraily302 mov bx,offset [TrueSecs] ; Offset of sector table303 xor dh,dh ; Clear DH because we use DL as index304 and dl,01111111b ; Remove high bit of BIOS disk-nr305 shl dx,2 ; Index to DWORD table306 add bx,dx ; Point to TrueSecs for this disk307 mov si,[bx] ; Get SPT for this disk308 pop dx ; Restore DX...309 pop bx ; and BX310 ;~ sub si,cx ; Adjust offset !! INCORRECT FOR LBA (TP CX != 0 !!)311 dec si312 pop cx ; Restore Cyl/Sec part313 add ax,si ; Add offset to low part...314 adc bx,0 ; and high part of LBA address315 or cl,63 ; Adjust CHS part !FIX ME for > 63! !! FIX HUGE DRIVE !!316 317 IFDEF AUX_DEBUG318 IF 0319 DBG_TEXT_OUT_AUX 'adjusted'320 PUSHRF321 call DEBUG_DumpRegisters322 ;~ call AuxIO_DumpParagraph323 ;~ call AuxIO_TeletypeNL324 POPRF325 ENDIF326 ENDIF327 328 ret329 330 DriveIO_LVMAdjustToInfoSector EndP331 332 333 334 335 336 273 337 274 ; #########################################################################
Note:
See TracChangeset
for help on using the changeset viewer.