KolibriOS kernel
flp_drv.inc File Reference

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
 give_back_application_data: ; give back to application mov edi,[TASK_BASE] mov edi,[edi+TASKDATA.mem_start] add edi,ecx More...
 
label take_data_from_application_1
 take_data_from_application: ; take from application mov esi,[TASK_BASE] mov esi,[esi+TASKDATA.mem_start] add esi,ecx More...
 
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
 

Function Documentation

◆ check_fdd_motor_status_has_work()

void check_fdd_motor_status_has_work ( )

***************************************** CHECK THE MOTOR SHUTDOWN DELAY *

Source
blkdev/flp_drv.inc:296

◆ floppy_init()

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.

Source
blkdev/flp_drv.inc:729

◆ floppy_querymedia()

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.

Source
blkdev/flp_drv.inc:752

◆ floppy_read()

void floppy_read ( )

Reads one or more sectors from the device.

Source
blkdev/flp_drv.inc:887

◆ floppy_read_bootsector()

void floppy_read_bootsector ( )

◆ floppy_read_write()

void floppy_read_write ( dword  userdata,
dword  buffer,
qword  start_sector,
dword  numsectors_ptr 
)

Common part of floppy_read and floppy_write.

Source
blkdev/flp_drv.inc:892

◆ floppy_write()

void floppy_write ( )

Writes one or more sectors to the device.

Source
blkdev/flp_drv.inc:881

Variable Documentation

◆ _info

dd _info
Initial value
?
Source
blkdev/flp_drv.inc:755

◆ _operation

db _operation
Initial value
?
Source
blkdev/flp_drv.inc:895

◆ _sectors_todo

dd _sectors_todo
Initial value
?
Source
blkdev/flp_drv.inc:894

◆ _userdata

dd _userdata
Initial value
?
Source
blkdev/flp_drv.inc:754
Initial value
?
Source
blkdev/rd.inc:186

◆ calculate_chs

label calculate_chs

◆ check_fdd_motor_status

label check_fdd_motor_status

◆ dT

label dT

wait 0.5 s

Source
blkdev/flp_drv.inc:254

◆ End_5

label End_5

DEBUGF 1,' ok
'.

Source
blkdev/flp_drv.inc:148

◆ End_6

label End_6

DEBUGF 1,'K : FDCDataInput: x
',al.

Source
blkdev/flp_drv.inc:182

◆ End_7

◆ end_check_fdd_motor_status

label end_check_fdd_motor_status

◆ end_check_fdd_motor_status_1

label end_check_fdd_motor_status_1

◆ Err

label Err

Track not found.

Source
blkdev/flp_drv.inc:452

◆ Err_1

◆ Err_2

◆ Err_3

◆ Err_4

◆ Exit

◆ Exit_1

◆ Exit_2

◆ Exit_3

◆ Exit_4

◆ FDC_C

DB FDC_C
Initial value
?
Source
blkdev/flp_drv.inc:73

◆ FDC_H

DB FDC_H
Initial value
?
Source
blkdev/flp_drv.inc:74

◆ FDC_N

DB FDC_N
Initial value
?
Source
blkdev/flp_drv.inc:76

◆ FDC_R

DB FDC_R
Initial value
?
Source
blkdev/flp_drv.inc:75

◆ FDC_ST0

DB FDC_ST0

Operation result block.

Initial value
?
Source
blkdev/flp_drv.inc:70

◆ FDC_ST1

DB FDC_ST1
Initial value
?
Source
blkdev/flp_drv.inc:71

◆ FDC_ST2

DB FDC_ST2
Initial value
?
Source
blkdev/flp_drv.inc:72

◆ FDC_Status

DB FDC_Status

Operation completion code with the floppy disk drive controller.

Initial value
?
Source
blkdev/flp_drv.inc:57

◆ FDCDataInput

label FDCDataInput

****************************************** READ BYTE FROM FDC DATA PORT * Procedure doesnt have input params. * Output : * AL - byte read. *

Source
blkdev/flp_drv.inc:159

◆ FDCDataOutput

label FDCDataOutput

*********************************** WRITE BYTE TO FDC DATA PORT * Parameters: * AL - byte to write. *

Source
blkdev/flp_drv.inc:122

◆ FDCInterrupt

label FDCInterrupt

********************************************* FDC INTERRUPT HANDLER *

Source
blkdev/flp_drv.inc:190

◆ FDD_Head

DB FDD_Head
Initial value
?
Source
blkdev/flp_drv.inc:66

◆ FDD_IntFlag

DB FDD_IntFlag

Interrupt flag from floppy disk drive.

Initial value
?
Source
blkdev/flp_drv.inc:59

◆ fdd_motor_on

label fdd_motor_on

◆ fdd_motor_on_B

label fdd_motor_on_B

◆ fdd_motor_status

db fdd_motor_status

Memory area for storing the readed sector FDD_DataBuffer: times 512 db 0 ;DB 512 DUP (?)

Initial value
0
Source
blkdev/flp_drv.inc:84

◆ FDD_Sector

DB FDD_Sector
Initial value
?
Source
blkdev/flp_drv.inc:67

◆ FDD_Time

DD FDD_Time

The moment of the beginning of the last operation with FDD.

Initial value
?
Source
blkdev/flp_drv.inc:61

◆ FDD_Track

DB FDD_Track

Sector coordinates.

Initial value
?
Source
blkdev/flp_drv.inc:65

◆ FDD_Type

db FDD_Type

Drive number.

Initial value
0
Source
blkdev/flp_drv.inc:63

◆ FDDMotorOFF

label FDDMotorOFF

********************************** TURN OFF MOTOR OF DRIVE *

Source
blkdev/flp_drv.inc:329

◆ FDDMotorOFF_1

label FDDMotorOFF_1

◆ FDDMotorOFF_2

label FDDMotorOFF_2

◆ FDDMotorOFF_A

label FDDMotorOFF_A

◆ FDDMotorOFF_B

label FDDMotorOFF_B

◆ FDDMotorON

label FDDMotorON

*********************************** Turn on the motor of drive "A:" *

Source
blkdev/flp_drv.inc:227

◆ FDDMotorON_1

label FDDMotorON_1

◆ FDDMotorON_B

label FDDMotorON_B

◆ floppy1_name

db floppy1_name
Initial value
'fd',0
Source
blkdev/flp_drv.inc:723

◆ floppy2_name

db floppy2_name
Initial value
'fd2',0
Source
blkdev/flp_drv.inc:724

◆ floppy_functions

label floppy_functions

◆ floppy_media_flags

rb floppy_media_flags
Initial value
2
Source
blkdev/flp_drv.inc:707

◆ floppy_mutex

MUTEX floppy_mutex

Hardware does not allow to work with two floppies in parallel, so there is one mutex guarding access to any floppy.

Initial value
Source
blkdev/flp_drv.inc:715

◆ flp_label

rb flp_label

Label and ID of inserted floppy disk.

Initial value
15*2
Source
blkdev/flp_drv.inc:711

◆ flp_number

db flp_number

1- Floppy A, 2-Floppy B

Initial value
0
Source
blkdev/flp_drv.inc:709

◆ GetByteFromFDC

label GetByteFromFDC

Get byte from data port.

Source
blkdev/flp_drv.inc:178

◆ GetStatusInfo

label GetStatusInfo

********************************************* GET INFORMATION ABOUT THE RESULT OF THE OPERATION

Source
blkdev/flp_drv.inc:669

◆ give_back_application_data_1

label give_back_application_data_1

give_back_application_data: ; give back to application mov edi,[TASK_BASE] mov edi,[edi+TASKDATA.mem_start] add edi,ecx

Source
blkdev/flp_drv.inc:21

◆ Init_FDC_DMA

label Init_FDC_DMA

************************************** INITIALIZATION OF DMA MODE FOR FDD *

Source
blkdev/flp_drv.inc:90

◆ n_sector

dd n_sector

temporary save for sector value

Initial value
0
Source
blkdev/flp_drv.inc:708

◆ no_seek_track_1

label no_seek_track_1

◆ old_track

db old_track

old value track

Initial value
0
Source
blkdev/flp_drv.inc:710

◆ OutByteToFDC

label OutByteToFDC

Write byte to data port.

Source
blkdev/flp_drv.inc:143

◆ read_chs_sector

label read_chs_sector

◆ ReadRepCounter

DB ReadRepCounter

Read operation repetition counter.

Initial value
?
Source
blkdev/flp_drv.inc:78

◆ ReadSector

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. *

Source
blkdev/flp_drv.inc:470

◆ ReadSector_1

label ReadSector_1

◆ ReadSectWithRetr

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. *

Source
blkdev/flp_drv.inc:534

◆ RecalibrateFDD

label RecalibrateFDD

******************************* RECALIBRATE DRIVE "A:" *

Source
blkdev/flp_drv.inc:362

◆ RecalRepCounter

DB RecalRepCounter

Recalibration operation repetition counter.

Initial value
?
Source
blkdev/flp_drv.inc:80

◆ save_chs_sector

label save_chs_sector

◆ save_timer_fdd_motor

label save_timer_fdd_motor

***************************************** SAVING TIME STAMP *

Source
blkdev/flp_drv.inc:288

◆ SeekTrack

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. *

Source
blkdev/flp_drv.inc:405

◆ take_data_from_application_1

label take_data_from_application_1

take_data_from_application: ; take from application mov esi,[TASK_BASE] mov esi,[esi+TASKDATA.mem_start] add esi,ecx

Source
blkdev/flp_drv.inc:32

◆ TestRS

◆ TestRS_1

label TestRS_1

◆ TestRS_2

label TestRS_2

Wait for the floppy disk interrupt flag to be set.

Source
blkdev/flp_drv.inc:208

◆ TickCounter

dd TickCounter

Timer tick counter.

Initial value
?
Source
blkdev/flp_drv.inc:55

◆ timer_fdd_motor

dd timer_fdd_motor
Initial value
0
Source
blkdev/flp_drv.inc:85

◆ TryAgain

label TryAgain

◆ TryAgain_1

label TryAgain_1

◆ WaitFDCInterrupt

label WaitFDCInterrupt

******************************************* WAIT FOR INTERRUPT FROM FDC *

Source
blkdev/flp_drv.inc:200

◆ WriteSector

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 *

Source
blkdev/flp_drv.inc:574

◆ WriteSector_1

label WriteSector_1

◆ WriteSectWithRetr

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 *

Source
blkdev/flp_drv.inc:636