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/VariablesAndDPTs/CreateDPT.asm

    r227 r258  
    6363.StoreFlags:
    6464    mov     [di+DPT.wFlags], ax
    65 
    66 %ifdef MODULE_SERIAL
    67     cmp     byte [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
    68     jnz     .StoreAddressing
    69     or      byte [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
    70 %endif
    7165    ; Fall to .StoreAddressing
    7266
     
    205199.StoreDeviceSpecificParameters:
    206200    call    Device_FinalizeDPT
     201
     202%ifdef MODULE_SERIAL_FLOPPY
     203;
     204; These two instructions serve two purposes:
     205; 1. If the drive is a floppy drive (CF set), then we effectively increment the counter.
     206; 2. If this is a hard disk, and there have been any floppy drives previously added, then the hard disk is
     207;    effectively discarded.  This is more of a safety check then code that should ever normally be hit (see below).
     208;    Since the floppy DPT's come after the hard disk DPT's, without expensive (code size) code to relocate a DPT,
     209;    this was necessary.  Now, this situation shouldn't happen in normal operation, for a couple of reasons:
     210;       A. xtidecfg always puts configured serial ports at the end fo the IDEVARS list
     211;       B. the auto serial code is always executed last
     212;       C. the serial server always returns floppy drives last
     213;
     214    adc     byte [RAMVARS.xlateVars+XLATEVARS.bFlopCreateCnt], 0
     215    jnz     .AllDone   
     216%else
     217;
     218; Even without floppy support enabled, we shouldn't try to mount a floppy image as a hard disk, which
     219; could lead to unpredictable results since no MBR will be present, etc.  The server doesn't know that
     220; floppies are supported, so it is important to still fail here if a floppy is seen during the drive scan.
     221;
     222    jc      .AllDone
     223%endif
     224
    207225    ; Fall to .StoreDriveNumberAndUpdateDriveCount
    208226
     
    230248    ja      SHORT .AllDone              ;  If so, return
    231249    mov     [RAMVARS.bFirstDrv], dl     ; Store first drive number
     250
     251.AllDone:
    232252    clc
    233 .AllDone:
    234253    ret
     254
Note: See TracChangeset for help on using the changeset viewer.