Ignore:
Timestamp:
Feb 22, 2012, 7:01:53 PM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Added floppy drive emulation over the serial connection (MODULE_SERIAL_FLOPPY). Along the way, various optimizations were made to stay within the 8K ROM size target. Also, serial code now returns the number of sectors transferred.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm

    r257 r258  
    1515;   Returns with INTPACK:
    1616;       If succesfull:
    17 ;           AH:     3 (Hard disk accessible)
     17;           AH:     Hard Disk: 3 (Hard disk accessible)
     18;                   Floppy:    1 (Floppy disk, without change detection)
    1819;           CX:DX:  Total number of sectors
    1920;           CF:     0
     
    2526ALIGN JUMP_ALIGN
    2627AH15h_HandlerForReadDiskDriveSize:
     28%ifdef MODULE_SERIAL_FLOPPY
     29    mov     cl, 1                                       ; 1 = floppy disk, no change detection
     30               
     31    test    dl,dl                                       ; DO NOT store the sector count if this is a
     32    jns     .FloppyDrive                                ; floppy disk, some OS's depend on this not
     33                                                        ; happening for floppies in order to boot.
     34%endif
     35       
    2736    call    AH15h_GetSectorCountToBXDXAX
    28     mov     [bp+IDEPACK.intpack+INTPACK.cx], dx ; HIWORD to CX
    29     mov     [bp+IDEPACK.intpack+INTPACK.dx], ax ; LOWORD to DX
     37    mov     [bp+IDEPACK.intpack+INTPACK.cx], dx         ; HIWORD to CX
     38    xchg    [bp+IDEPACK.intpack+INTPACK.dx], ax         ; LOWORD to DX, AL gets drive number
    3039
    31     xor     ah, ah
    32     call    Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH    ; Store success to BDA and CF
    33     mov     BYTE [bp+IDEPACK.intpack+INTPACK.ah], 3             ; Type code = Hard disk
     40    xor     ah, ah     
     41%ifdef MODULE_SERIAL_FLOPPY             
     42    mov     cl, 3                                       ; 3 = Hard Disk Accessible
     43.FloppyDrive:
     44       
     45    call    Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber   ; Store success to BDA and CF       
     46    mov     BYTE [bp+IDEPACK.intpack+INTPACK.ah], cl
     47%else
     48    call    Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH    ; Store success to BDA and CF       
     49    mov     BYTE [bp+IDEPACK.intpack+INTPACK.ah], 3
     50%endif     
     51       
    3452    jmp     Int13h_ReturnFromHandlerWithoutStoringErrorCode
    3553
Note: See TracChangeset for help on using the changeset viewer.