Floppy disk write problem

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
ehenkes
Posts:34
Joined:Fri Jul 24, 2009 5:35 pm
Floppy disk write problem

Post by ehenkes » Mon Jun 21, 2010 7:24 pm

I have a problem writing sectors to the floppy:
Is here something wrong?

Code: Select all

 
519   if (operation == 1) // write a sector
520 	{
521 	flpydsk_dma_write();
522 	flpydsk_send_command(FDC_CMD_WRITE_SECT | FDC_CMD_EXT_MULTITRACK | FDC_CMD_EXT_DENSITY);
523 	}
524 	
525 	flpydsk_send_command(head << 2 | CurrentDrive->ID);
526 	flpydsk_send_command(track);
527 	flpydsk_send_command(head);
528 	flpydsk_send_command(sector);
529 	flpydsk_send_command(FLPYDSK_SECTOR_DTL_512);
530 	flpydsk_send_command(FLPY_SECTORS_PER_TRACK);
531 	flpydsk_send_command(FLPYDSK_GAP3_LENGTH_3_5);
532 	flpydsk_send_command(0xFF);
533 	flpydsk_wait_irq(); 
This code should write one sector, but it writes the same content to the sector+9 higher, too. That's not funny. :(

ehenkes
Posts:34
Joined:Fri Jul 24, 2009 5:35 pm

Re: Floppy disk write problem

Post by ehenkes » Tue Jun 22, 2010 6:17 pm

FDC_CMD_EXT_MULTITRACK <--- that makes no sense for single sectors

Post Reply