Reading Floppy Drive
Re:Reading Floppy Drive
forget about installing interrupt handlers, I've just seen a fine handler in your floppy code.
Stay safe!
Stay safe!
Re:Reading Floppy Drive
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
how is the physical address calculated from the page and address registers?
Re:Reading Floppy Drive
I have a problem too:
When I try to read block 0.
This is my code for sending bytes for the read command:
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.
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
hi,
the command is not
0x06 but 0x66
be careful when reading the floppy spec
the command is not
0x06 but 0x66
be careful when reading the floppy spec
Re:Reading Floppy Drive
Thanks!Code Slasher wrote: hi,
the command is not
0x06 but 0x66
be careful when reading the floppy spec
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
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
OK, now I can get the floppy driver to read.
This is the status of the read:
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.
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.
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
ok. how is the complete address from the page register and address registers put together? is it pagereg+addrreg=complete addr?Code Slasher wrote: read my post above
Re:Reading Floppy Drive
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
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?
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?
you would have noticed this if you read the posts carefully.page=(unsigned char)((buffer>>16) & 0xff);
offset=(unsigned short)(buffer & 0xffff);
Re:Reading Floppy Drive
what value do i set the step rate and head load/unload time? for 1.44 disk