Reading Floppy Drive

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
BI lazy

Re:Reading Floppy Drive

Post by BI lazy »

forget about installing interrupt handlers, I've just seen a fine handler in your floppy code.

Stay safe!
slacker

Re:Reading Floppy Drive

Post 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?
slacker

Re:Reading Floppy Drive

Post by slacker »

anyone write a floppy driver with paging disabled?
slacker

Re:Reading Floppy Drive

Post by slacker »

how is the physical address calculated from the page and address registers?
Slasher

Re:Reading Floppy Drive

Post by Slasher »

read my post above
petrusss

Re:Reading Floppy Drive

Post 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);
Slasher

Re:Reading Floppy Drive

Post by Slasher »

hi,
the command is not
0x06 but 0x66
be careful when reading the floppy spec
petrusss

Re:Reading Floppy Drive

Post 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
Slasher

Re:Reading Floppy Drive

Post 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
petrusss

Re:Reading Floppy Drive

Post 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.
slacker

Re:Reading Floppy Drive

Post 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?
slacker

Re:Reading Floppy Drive

Post 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?
Slasher

Re:Reading Floppy Drive

Post 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.
slacker

Re:Reading Floppy Drive

Post by slacker »

huh
slacker

Re:Reading Floppy Drive

Post by slacker »

what value do i set the step rate and head load/unload time? for 1.44 disk
Post Reply