#include <floppy.h>
Inherits Block_device.
Inheritance diagram for Floppy:


Public Member Functions | |
| virtual void | init () |
| virtual void | deinit () |
| void | reset () |
| void | send_byte (unsigned short int byte) |
| short int | get_byte () |
| bool | wait_for_op (bool sense_interrupt_status) |
| bool | seek (unsigned char track) |
| void | recalibrate () |
| void | turn_motor_on () |
| void | turn_motor_off () |
| virtual bool | read_block (unsigned block, void *data) |
| virtual bool | write_block (unsigned block, void *data) |
| bool | read_write (unsigned block, void *data, bool read) |
| void | print () |
Public Attributes | |
| Semaphore | operation_lock |
| Timer_callback | motor_kill_callback |
| bool | motor_on |
Protected Attributes | |
| DMA_buffer | buffer |
| bool | disk_change |
| unsigned char | status [7] |
| unsigned char | status_size |
| unsigned char | sr0 |
| unsigned char | current_track |
| Int_handler | handler |
Static Protected Attributes | |
| const Size | BLOCK_SIZE = 512 |
Much of it is based on code by Fabian Nunez.
|
|
Deinitialize the floppy driver.
Implements Block_device. |
|
|
Receive a byte from the floppy disk controller. Return -1 on timeout.
|
|
|
Initialize the floppy driver and reset the drive.
Implements Block_device. |
|
|
Print basic information on the floppy driver.
|
|
||||||||||||
|
Read a block of data from disk into the provided 512-byte buffer.
Implements Block_device. |
|
||||||||||||||||
|
Since reads and writes differ only by a few lines, this function handles both. It is called by read_block() and write_block(). |
|
|
Recalibrate the drive.
|
|
|
Reset the floppy drive to a known state.
|
|
|
Seek to the given track.
|
|
|
Send a byte to the floppy disk controller.
|
|
|
Start drive motor kill countdown.
|
|
|
Turn drive motor on.
|
|
|
Wait for a floppy controller operation to complete. Return false on timeout, true if operation completed. |
|
||||||||||||
|
Write a block of data to disk from the provided 512-byte buffer.
Implements Block_device. |
|
|
|
|
|
floppy read/write data buffer
|
|
|
current track position
|
|
|
|
|
|
floppy interrupt handler
|
|
|
timer callback for stopping motor
|
|
|
whether the motor is on
|
|
|
locked while operation happening
|
|
|
|
|
|
|
|
|
|
Torsion Operating System, Copyright (C) 2000-2004 Dan Helfman