summaryrefslogtreecommitdiff
path: root/Source/Kernel/Devices/Floppy/FloppyDrive.class.h
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-08-31 21:44:26 +0200
committerAlexis211 <alexis211@gmail.com>2009-08-31 21:44:26 +0200
commitdf76b24fed5ac3b5af406aad3df277d7f4c347e5 (patch)
treeea8a0ca4856cce9da63c047eff6e72a58c643159 /Source/Kernel/Devices/Floppy/FloppyDrive.class.h
parent6bf215215e1ebaa9613b51500031e6963c12d33b (diff)
downloadMelon-df76b24fed5ac3b5af406aad3df277d7f4c347e5.tar.gz
Melon-df76b24fed5ac3b5af406aad3df277d7f4c347e5.zip
Now we can read frop floppy drives !!! Next : FAT driver.
Diffstat (limited to 'Source/Kernel/Devices/Floppy/FloppyDrive.class.h')
-rw-r--r--Source/Kernel/Devices/Floppy/FloppyDrive.class.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/Source/Kernel/Devices/Floppy/FloppyDrive.class.h b/Source/Kernel/Devices/Floppy/FloppyDrive.class.h
new file mode 100644
index 0000000..3ff832b
--- /dev/null
+++ b/Source/Kernel/Devices/Floppy/FloppyDrive.class.h
@@ -0,0 +1,41 @@
+#ifndef DEF_FLOPPYDRIVE_CLASS_H
+#define DEF_FLOPPYDRIVE_CLASS_H
+
+#include <Devices/BlockDevice.proto.h>
+
+#include "FloppyController.class.h"
+
+class FloppyDrive : public BlockDevice {
+ friend class FloppyController;
+ friend u32int floppyMotorTimer();
+ private:
+ FloppyDrive(FloppyController *fdc, u8int number, u8int type); //Private constructor, called by FloppyController()
+
+ u8int m_motorState, m_motorTimeout, m_driveNumber, m_driveType;
+ u32int m_cylinders, m_sectors;
+ FloppyController *m_fdc;
+
+ u8int m_buffer[FLOPPY_DMALEN];
+ u32int m_buffCyl, m_buffTime; //Used for keeping track of what is in buffer, this is a sort of cache system
+
+ bool setup();
+ bool calibrate();
+ bool setMotorState(bool on);
+ bool killMotor();
+ bool seek(u32int cyli, s32int head);
+ bool doTrack(u32int cyl, u8int dir);
+
+ public:
+ String getClass();
+ String getName();
+
+ bool readOnly();
+ u64int blocks();
+ bool readBlocks(u64int startblock, u32int count, u8int *data);
+ bool writeBlocks(u64int startblock, u32int count, u8int* data);
+ u32int blockSize(); //Always 512
+
+ u64int chs2lba(u32int cylinder, u32int head, u32int sector);
+};
+
+#endif