Page 2 of 2

Re:Reading Floppy Drive

Posted: Sun Dec 28, 2003 12:34 pm
by BI lazy
forget about installing interrupt handlers, I've just seen a fine handler in your floppy code.

Stay safe!

Re:Reading Floppy Drive

Posted: Fri Jan 02, 2004 10:47 am
by slacker
what is the flip flop byte? and how would i setup the page register if i dont using paging? and is there a document around on the web that shows the different bit settings in the mode register?

Re:Reading Floppy Drive

Posted: Fri Jan 02, 2004 7:42 pm
by slacker
anyone write a floppy driver with paging disabled?

Re:Reading Floppy Drive

Posted: Sun Jan 04, 2004 11:04 am
by slacker
how is the physical address calculated from the page and address registers?

Re:Reading Floppy Drive

Posted: Sun Jan 04, 2004 7:18 pm
by Slasher
read my post above

Re:Reading Floppy Drive

Posted: Mon Jan 05, 2004 10:26 am
by petrusss
I have a problem too:

Code: Select all

FDD: st0 0x80  st1 0x0  st2 0x0  Cylinder 1  Head 1  Sector 18  Sector size 2.
FDD: drive ready.
FDD: head is not active.
FDD: selected drive is 0.
FDD: invalid command; the controller could not start command execution.
When I try to read block 0.

This is my code for sending bytes for the read command:

Code: Select all

   SendByte(0x06);
   SendByte(head << 2);
   SendByte(cyl);
   SendByte(head);
   SendByte(sect);
   SendByte(2);
   SendByte(18);
   SendByte(0x1B);
   SendByte(0xFF);

Re:Reading Floppy Drive

Posted: Mon Jan 05, 2004 7:52 pm
by Slasher
hi,
the command is not
0x06 but 0x66
be careful when reading the floppy spec

Re:Reading Floppy Drive

Posted: Mon Jan 05, 2004 8:22 pm
by petrusss
Code Slasher wrote: hi,
the command is not
0x06 but 0x66
be careful when reading the floppy spec
Thanks!
Just to be sure: are my other definitions correct?

Code: Select all

#define CMD_READ         0x66
#define CMD_CALIBRATE      0x07
#define CMD_VERSION         0x10
#define CMD_SPECIFY         0x03
#define CMD_SIS            0x08
#define CMD_CONFIGURE      0x13
#define CMD_SEEK         0xF

Re:Reading Floppy Drive

Posted: Mon Jan 05, 2004 9:09 pm
by Slasher
here is a list of commands

Code: Select all

/*controller commands*/

#define FIX_DRIVE_DATA                  0x03
#define CHECK_DRIVE_STATUS          0x04
#define CALIBRATE_DRIVE                 0X07
#define CHECK_INTERRUPT_STATUS   0X08
#define FORMAT_TRACK                   0x4D
#define READ_SECTOR                     0x66
#define READ_DELETE_SECTOR         0xCC
#define READ_SECTOR_ID                0X4A
#define READ_TRACK                      0x42
#define SEEK_TRACK                      0X0F
#define WRITE_SECTOR                  0xC5
#define WRITE_DELETE_SECTOR       0xC9

Re:Reading Floppy Drive

Posted: Tue Jan 06, 2004 12:57 pm
by petrusss
OK, now I can get the floppy driver to read.
This is the status of the read:

Code: Select all

FDD: st0: 0  st1: 0  st2: 0  Cylinder: 0  Head: 0  Sector: 2  Sector size: 2.
And nothing is written to the memory =(

EDIT:
I changed my DMA transfer starter and this is what happened:
I set the DMA -> CPU, 0x56, and when I READ it writes garbage to the first sector of my floppy!

OK: This is the latest:
I entered 0x0 as the position of memory and I could write some characters to the floppy.
It looks llike the DMA believes it should get the data from 0x0.

Re:Reading Floppy Drive

Posted: Tue Jan 06, 2004 1:23 pm
by slacker
Code Slasher wrote: read my post above
ok. how is the complete address from the page register and address registers put together? is it pagereg+addrreg=complete addr?

Re:Reading Floppy Drive

Posted: Tue Jan 06, 2004 4:34 pm
by slacker
i just read that the address is composed of 24 bits. the higher 8 bits are held in the page register. so if i wanted the address 0x400000 to be the location in memory would i put 0 in the page register and 0x4000 in the address register?

Re:Reading Floppy Drive

Posted: Tue Jan 06, 2004 4:34 pm
by Slasher
why do you want to work backwards?
why no choose an address, then get the page and offset for that address? This way you can be certain of where you are reading/writing?
page=(unsigned char)((buffer>>16) & 0xff);
offset=(unsigned short)(buffer & 0xffff);
you would have noticed this if you read the posts carefully.

Re:Reading Floppy Drive

Posted: Tue Jan 06, 2004 4:36 pm
by slacker
huh

Re:Reading Floppy Drive

Posted: Wed Jan 07, 2004 11:44 am
by slacker
what value do i set the step rate and head load/unload time? for 1.44 disk