Functions | |
void | check_fdd_motor_status_has_work () |
***************************************** CHECK THE MOTOR SHUTDOWN DELAY * More... | |
void | floppy_init () |
This function is called in boot process. It creates filesystems /fd and/or /fd2, if the system has one/two floppy drives. More... | |
void | floppy_querymedia () |
Returns information about disk media. Floppy drives do not support insert notifications, DISK_NO_INSERT_NOTIFICATION is set, the disk subsystem calls this function before each filesystem operation. If the media has changed, return error for the first call as signal to finalize work with old media and the true geometry for the second call. Assume that media is (possibly) changed anytime when motor is off. More... | |
void | floppy_read_bootsector () |
void | floppy_write () |
Writes one or more sectors to the device. More... | |
void | floppy_read () |
Reads one or more sectors from the device. More... | |
void | floppy_read_write (dword userdata, dword buffer, qword start_sector, dword numsectors_ptr) |
Common part of floppy_read and floppy_write. More... | |
Variables | |
label | give_back_application_data_1 |
label | take_data_from_application_1 |
dd | TickCounter |
Timer tick counter. More... | |
DB | FDC_Status |
Operation completion code with the floppy disk drive controller. More... | |
DB | FDD_IntFlag |
Interrupt flag from floppy disk drive. More... | |
DD | FDD_Time |
The moment of the beginning of the last operation with FDD. More... | |
db | FDD_Type |
Drive number. More... | |
DB | FDD_Track |
Sector coordinates. More... | |
DB | FDD_Head |
DB | FDD_Sector |
DB | FDC_ST0 |
Operation result block. More... | |
DB | FDC_ST1 |
DB | FDC_ST2 |
DB | FDC_C |
DB | FDC_H |
DB | FDC_R |
DB | FDC_N |
DB | ReadRepCounter |
Read operation repetition counter. More... | |
DB | RecalRepCounter |
Recalibration operation repetition counter. More... | |
db | fdd_motor_status |
Memory area for storing the readed sector FDD_DataBuffer: times 512 db 0 ;DB 512 DUP (?) More... | |
dd | timer_fdd_motor |
label | Init_FDC_DMA |
************************************** INITIALIZATION OF DMA MODE FOR FDD * More... | |
label | FDCDataOutput |
*********************************** WRITE BYTE TO FDC DATA PORT * Parameters: * AL - byte to write. * More... | |
label | TestRS |
label | OutByteToFDC |
Write byte to data port. More... | |
label | End_5 |
DEBUGF 1,' ok '. More... | |
label | FDCDataInput |
****************************************** READ BYTE FROM FDC DATA PORT * Procedure doesnt have input params. * Output : * AL - byte read. * More... | |
label | TestRS_1 |
label | GetByteFromFDC |
Get byte from data port. More... | |
label | End_6 |
DEBUGF 1,'K : FDCDataInput: x ',al. More... | |
label | FDCInterrupt |
********************************************* FDC INTERRUPT HANDLER * More... | |
label | WaitFDCInterrupt |
******************************************* WAIT FOR INTERRUPT FROM FDC * More... | |
label | TestRS_2 |
Wait for the floppy disk interrupt flag to be set. More... | |
label | End_7 |
label | FDDMotorON |
*********************************** Turn on the motor of drive "A:" * More... | |
label | FDDMotorON_B |
label | FDDMotorON_1 |
label | dT |
wait 0.5 s More... | |
label | fdd_motor_on_B |
label | fdd_motor_on |
label | save_timer_fdd_motor |
***************************************** SAVING TIME STAMP * More... | |
label | check_fdd_motor_status |
label | end_check_fdd_motor_status_1 |
label | end_check_fdd_motor_status |
label | FDDMotorOFF |
********************************** TURN OFF MOTOR OF DRIVE * More... | |
label | FDDMotorOFF_1 |
label | FDDMotorOFF_2 |
label | FDDMotorOFF_A |
label | FDDMotorOFF_B |
label | RecalibrateFDD |
******************************* RECALIBRATE DRIVE "A:" * More... | |
label | SeekTrack |
***************************************************** TRACK SEARCH * Parameters are passed through global variables: * FDD_Track - track number (0-79); * FDD_Head - head number (0-1). * Result of operation is written to FDC_Status. * More... | |
label | Err |
Track not found. More... | |
label | Exit |
label | ReadSector |
******************************************************* READING A DATA SECTOR * Parameters are passed through global variables: * FDD_Track - track number (0-79); * FDD_Head - head number (0-1); * FDD_Sector - sector number (1-18). * Result of operation is written to FDC_Status. * If the read operation is successful, the contents * of the sector will be written to FDD_DataBuffer. * More... | |
label | Err_1 |
label | Exit_1 |
label | ReadSectWithRetr |
******************************************************* READ SECTOR (WITH RETRY OF OPERATION ON FAILURE) * Parameters are passed through global variables: * FDD_Track - track number (0-79); * FDD_Head - head number (0-1); * FDD_Sector - sector number (1-18). * Result of operation is written to FDC_Status. * If the read operation is successful, the contents * of the sector will be written to FDD_DataBuffer. * More... | |
label | TryAgain |
label | ReadSector_1 |
label | Exit_2 |
label | Err_3 |
label | WriteSector |
******************************************************* WRITE DATA SECTOR * Parameters are passed through global variables: * FDD_Track - track number (0-79); * FDD_Head - head number (0-1); * FDD_Sector - sector number (1-18). * Result of operation is written to FDC_Status. * If the write operation is successful, the contents * of FDD_DataBuffer will be written to the sector * More... | |
label | Err_2 |
label | Exit_3 |
label | WriteSectWithRetr |
******************************************************* WRITE SECTOR (WITH REPEAT ON FAILURE) * Parameters are passed through global variables: * FDD_Track - track number (0-79); * FDD_Head - head number (0-1); * FDD_Sector - sector number (1-18). * Result of operation is written to FDC_Status. * If the write operation is successful, the contents * of FDD_DataBuffer will be written to the sector * More... | |
label | TryAgain_1 |
label | WriteSector_1 |
label | Exit_4 |
label | Err_4 |
label | GetStatusInfo |
********************************************* GET INFORMATION ABOUT THE RESULT OF THE OPERATION More... | |
label | floppy_functions |
rb | floppy_media_flags |
dd | n_sector |
temporary save for sector value More... | |
db | flp_number |
1- Floppy A, 2-Floppy B More... | |
db | old_track |
old value track More... | |
rb | flp_label |
Label and ID of inserted floppy disk. More... | |
MUTEX | floppy_mutex |
Hardware does not allow to work with two floppies in parallel, so there is one mutex guarding access to any floppy. More... | |
db | floppy1_name |
db | floppy2_name |
dd | _userdata |
dd | _info |
label | read_chs_sector |
label | save_chs_sector |
label | calculate_chs |
label | no_seek_track_1 |
dd | _sectors_todo |
db | _operation |
void check_fdd_motor_status_has_work | ( | ) |
***************************************** CHECK THE MOTOR SHUTDOWN DELAY *
void floppy_init | ( | ) |
This function is called in boot process. It creates filesystems /fd and/or /fd2, if the system has one/two floppy drives.
void floppy_querymedia | ( | ) |
Returns information about disk media. Floppy drives do not support insert notifications, DISK_NO_INSERT_NOTIFICATION is set, the disk subsystem calls this function before each filesystem operation. If the media has changed, return error for the first call as signal to finalize work with old media and the true geometry for the second call. Assume that media is (possibly) changed anytime when motor is off.
void floppy_read | ( | ) |
Reads one or more sectors from the device.
void floppy_read_bootsector | ( | ) |
void floppy_read_write | ( | dword | userdata, |
dword | buffer, | ||
qword | start_sector, | ||
dword | numsectors_ptr | ||
) |
Common part of floppy_read and floppy_write.
void floppy_write | ( | ) |
Writes one or more sectors to the device.
dd _info |
db _operation |
dd _sectors_todo |
dd _userdata |
label calculate_chs |
label check_fdd_motor_status |
label dT |
wait 0.5 s
label End_5 |
DEBUGF 1,' ok
'.
label End_6 |
DEBUGF 1,'K : FDCDataInput: x
',al.
label End_7 |
label end_check_fdd_motor_status |
label end_check_fdd_motor_status_1 |
label Err |
Track not found.
label Err_1 |
label Err_2 |
label Err_3 |
label Err_4 |
label Exit |
label Exit_1 |
label Exit_2 |
label Exit_3 |
label Exit_4 |
DB FDC_C |
DB FDC_H |
DB FDC_N |
DB FDC_R |
DB FDC_ST0 |
DB FDC_ST1 |
DB FDC_ST2 |
DB FDC_Status |
Operation completion code with the floppy disk drive controller.
label FDCDataInput |
****************************************** READ BYTE FROM FDC DATA PORT * Procedure doesnt have input params. * Output : * AL - byte read. *
label FDCDataOutput |
*********************************** WRITE BYTE TO FDC DATA PORT * Parameters: * AL - byte to write. *
label FDCInterrupt |
********************************************* FDC INTERRUPT HANDLER *
DB FDD_Head |
DB FDD_IntFlag |
label fdd_motor_on |
label fdd_motor_on_B |
db fdd_motor_status |
Memory area for storing the readed sector FDD_DataBuffer: times 512 db 0 ;DB 512 DUP (?)
DB FDD_Sector |
DD FDD_Time |
The moment of the beginning of the last operation with FDD.
DB FDD_Track |
db FDD_Type |
label FDDMotorOFF |
********************************** TURN OFF MOTOR OF DRIVE *
label FDDMotorOFF_1 |
label FDDMotorOFF_2 |
label FDDMotorOFF_A |
label FDDMotorOFF_B |
label FDDMotorON |
*********************************** Turn on the motor of drive "A:" *
label FDDMotorON_1 |
label FDDMotorON_B |
db floppy1_name |
db floppy2_name |
label floppy_functions |
rb floppy_media_flags |
MUTEX floppy_mutex |
Hardware does not allow to work with two floppies in parallel, so there is one mutex guarding access to any floppy.
rb flp_label |
db flp_number |
label GetByteFromFDC |
Get byte from data port.
label GetStatusInfo |
********************************************* GET INFORMATION ABOUT THE RESULT OF THE OPERATION
label give_back_application_data_1 |
label Init_FDC_DMA |
************************************** INITIALIZATION OF DMA MODE FOR FDD *
dd n_sector |
label no_seek_track_1 |
db old_track |
label OutByteToFDC |
Write byte to data port.
label read_chs_sector |
DB ReadRepCounter |
label ReadSector |
******************************************************* READING A DATA SECTOR * Parameters are passed through global variables: * FDD_Track - track number (0-79); * FDD_Head - head number (0-1); * FDD_Sector - sector number (1-18). * Result of operation is written to FDC_Status. * If the read operation is successful, the contents * of the sector will be written to FDD_DataBuffer. *
label ReadSector_1 |
label ReadSectWithRetr |
******************************************************* READ SECTOR (WITH RETRY OF OPERATION ON FAILURE) * Parameters are passed through global variables: * FDD_Track - track number (0-79); * FDD_Head - head number (0-1); * FDD_Sector - sector number (1-18). * Result of operation is written to FDC_Status. * If the read operation is successful, the contents * of the sector will be written to FDD_DataBuffer. *
label RecalibrateFDD |
******************************* RECALIBRATE DRIVE "A:" *
DB RecalRepCounter |
label save_chs_sector |
label save_timer_fdd_motor |
***************************************** SAVING TIME STAMP *
label SeekTrack |
***************************************************** TRACK SEARCH * Parameters are passed through global variables: * FDD_Track - track number (0-79); * FDD_Head - head number (0-1). * Result of operation is written to FDC_Status. *
label take_data_from_application_1 |
label TestRS |
label TestRS_1 |
label TestRS_2 |
Wait for the floppy disk interrupt flag to be set.
dd TickCounter |
dd timer_fdd_motor |
label TryAgain |
label TryAgain_1 |
label WaitFDCInterrupt |
******************************************* WAIT FOR INTERRUPT FROM FDC *
label WriteSector |
******************************************************* WRITE DATA SECTOR * Parameters are passed through global variables: * FDD_Track - track number (0-79); * FDD_Head - head number (0-1); * FDD_Sector - sector number (1-18). * Result of operation is written to FDC_Status. * If the write operation is successful, the contents * of FDD_DataBuffer will be written to the sector *
label WriteSector_1 |
label WriteSectWithRetr |
******************************************************* WRITE SECTOR (WITH REPEAT ON FAILURE) * Parameters are passed through global variables: * FDD_Track - track number (0-79); * FDD_Head - head number (0-1); * FDD_Sector - sector number (1-18). * Result of operation is written to FDC_Status. * If the write operation is successful, the contents * of FDD_DataBuffer will be written to the sector *