Changeset 103866 in vbox for trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-bootsector.asm
- Timestamp:
- Mar 15, 2024 12:07:48 PM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-bootsector.asm
r102270 r103866 57 57 ;; Enables support for fake 63.5 MB floppies with 255 sectors, 2 heads and 255 tracks. 58 58 %define BS3KIT_BOOTSECTOR_SUPPORT_63_5MB_FLOPPIES 59 ;; Enables code to avoid trying to read across 64kB DMA boundaries. 60 %define BS3KIT_BOOTSECTOR_DODGE_BOUNDARIES 59 61 60 62 ;; Halts on failure location. For debugging. … … 499 501 mov ax, si 500 502 .do_read: 503 504 %ifdef BS3KIT_BOOTSECTOR_DODGE_BOUNDARIES 505 ; Dodge around 64kB DMA boundaries 506 push di ; di is 'paragraph' address of buffer 507 push ax ; Example: di = 1f60h, al = 12h = 18-sector request; 508 shr di, 5 ; 0fbh addr = 1f600h (can fit 5x 200h below 128kB) 509 and di, 7fh ; 7bh 510 add di, ax ; 8dh 511 sub di, 80h ; 0dh 512 pop ax ; 12h 513 js .non_boundary 514 sub ax, di ; 05h 515 .non_boundary: 516 pop di 517 %endif 518 501 519 %if 0 ; DEBUG 502 520 push ax … … 511 529 mov es, di ; es:bx -> buffer 512 530 int 13h 531 %ifdef BS3KIT_BOOTSECTOR_DODGE_BOUNDARIES 532 jc .failure 533 %else 513 534 jnc .advance_sector 514 535 515 536 cmp ah, 9 ; DMA 64KB crossing error 516 %if 0 ; This hack doesn't work. If the FDC is in single sided mode we end up with a garbled image. Probably "missing" sides.517 je .read_one518 519 cmp ah, 20h ; Controller error, probably because we're reading side 1 on a single sided floppy520 537 jne .failure 521 cmp bMaxHead, 0522 je .failure523 cmp dh, 1524 jne .failure525 xor dh, dh526 mov bMaxHead, dh527 inc ch528 jmp .the_load_loop529 .read_one:530 %elifdef HLT_ON_FAILURE531 je .read_one_ok532 cli533 hlt534 .read_one_ok:535 %else536 jne .failure537 %endif538 538 mov ax, 1 ; Retry reading a single sector. 539 539 jmp .read_again 540 %endif ; !BS3KIT_BOOTSECTOR_DODGE_BOUNDARIES 540 541 541 542 ; advance to the next sector/head/cylinder and address. … … 592 593 ; Something went wrong, display a message. 593 594 ; 595 .str_sErrMsgBang: 596 db ' rd err!' 597 594 598 .failure: 595 599 %if 1 ; Disable to save space for debugging. 596 %if 1 597 push ax 598 %endif 599 600 mov al, ah 601 call bs3PrintHexInAl 600 602 ; print message 601 mov si, .s _szErrMsg603 mov si, .str_sErrMsgBang 602 604 .failure_next_char: 603 605 lodsb 604 606 call bs3PrintChrInAl 605 cmp si, .s_szErrMsgEnd 606 jb .failure_next_char 607 608 ; panic 609 %if 1 610 pop ax 611 mov al, ah 612 push bs3PrintHexInAl 613 %endif 614 call Bs3Panic 615 .s_szErrMsg: 616 db 13, 10, 'rd err! ' 617 %else 618 hlt 619 jmp .failure 607 cmp byte [si], '!' ; Don't trust that int 10h/0eh preserves al 608 jne .failure_next_char 620 609 %endif 621 610 %else 622 611 .failure: 623 hlt 624 %endif 625 .s_szErrMsgEnd: 612 %endif 613 jmp Bs3Panic 626 614 ;ENDPROC bs3InitLoadImage - don't want the padding. 627 615
Note:
See TracChangeset
for help on using the changeset viewer.