summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMichal Idziorek <miguel@miguel-acer.softwarefools.com>2014-08-28 23:09:41 +0200
committerMichal Idziorek <miguel@miguel-acer.softwarefools.com>2014-08-28 23:09:41 +0200
commit508aab5090b68c966ee3cf704b03946a207dd1bc (patch)
treed31028167c318d8abd2c8e4dcd03c6580c00181c /kernel
parent12df83e1621cd036c248beab1f7abc5242a0b1a7 (diff)
fix floppy driver (dma setup & sectors_per_track)
Diffstat (limited to 'kernel')
-rw-r--r--kernel/floppy.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/kernel/floppy.c b/kernel/floppy.c
index f5af4df..9e27214 100644
--- a/kernel/floppy.c
+++ b/kernel/floppy.c
@@ -38,8 +38,13 @@ void flpydsk_initialize_dma () {
x86_outb (0x04, 0xb0); //high
x86_outb (0xd8, 0xff); //reset master flip-flop
- x86_outb (0x05, 0xff); //count to 0x23ff (number of bytes in a 3.5" floppy disk track)
- x86_outb (0x05, 0x23);
+
+ // x86_outb (0x05, 0xff); //count to 0x23ff (number of bytes in a 3.5" floppy disk track)
+// x86_outb (0x05, 0x23);
+// hey, lets do just ONE sector instead (0x200)
+ x86_outb (0x05, 0xff);
+ x86_outb (0x05, 0x01);
+
x86_outb (0x80, 0); //external page register = 0
x86_outb (0x0a, 0x02); //unmask dma channel 2
log("dma",FOOLOS_LOG_INFO,"initialized");
@@ -345,7 +350,8 @@ void flpydsk_write_sector_imp (uint8_t head, uint8_t track, uint8_t sector) {
flpydsk_send_command ( head); // first head should match with above!
flpydsk_send_command ( sector);
flpydsk_send_command ( FLPYDSK_SECTOR_DTL_512 );
- flpydsk_send_command ( 1 ); // number of tracks we want
+ //flpydsk_send_command ( 1 ); // number of tracks we want
+ flpydsk_send_command ( FLPY_SECTORS_PER_TRACK ); // number of tracks !
/*
flpydsk_send_command (
@@ -387,7 +393,8 @@ void flpydsk_read_sector_imp (uint8_t head, uint8_t track, uint8_t sector) {
flpydsk_send_command ( head);
flpydsk_send_command ( sector);
flpydsk_send_command ( FLPYDSK_SECTOR_DTL_512 );
- flpydsk_send_command ( 1 ); // number of tracks we want
+ //flpydsk_send_command ( 1 ); // number of tracks we want
+ flpydsk_send_command ( FLPY_SECTORS_PER_TRACK ); // number of tracks !
/*
flpydsk_send_command (