OSDev.org
https://forum.osdev.org/

IRQ 6 (FDC) firing in initializ.. but not after read command
https://forum.osdev.org/viewtopic.php?f=1&t=33034
Page 2 of 2

Author:  Ycep [ Wed Jul 11, 2018 8:23 am ]
Post subject:  Now IRQ fires, and read ends successfully, but getting emp.

@BenLunt : Thanks a lot, I have updated my FDC code with various error checking and real hardware tolerance you included in it. While looking at I noticed that I didn't used the configure command at all. Althrough that still did not fix the problem.
What did fixed it, is looking at the Bochs debug console.
Code:
04496036403d[DMA   ] DMA-1: set_mask_bit=4, channel=0, mask now=01h

This:
Code:
channel=0

And yes, I have made a mistake in the same function twice. Now it works anyway...
Now the IRQ does fire, I'm getting the result bytes, I get <<READ DONE>> in Bochs debug console, but DMA doesn't write anything on the buffer at all.
As I probably said in some of previous posts, one thing I suspect is this:
Code:
04496036477e[DMA   ] io write to address 00000004, len=2
04496036521e[DMA   ] io write to address 00000005, len=2

Now looking at the Bochs source code... :
Code:
BX_ERROR(("io write to address %08x, len=%u",  (unsigned) address, (unsigned) io_len))

That's a BX_ERROR! (Runs away in horror)
Updated code:

Attachments:
File comment: ISA DMA stuff.
dma.c [2.77 KiB]
Downloaded 13 times
File comment: Main floppy driver file.
fdc.c [9.49 KiB]
Downloaded 15 times

Author:  Octocontrabass [ Wed Jul 11, 2018 10:15 am ]
Post subject:  Re: IRQ 6 (FDC) firing in initializ.. but not after read com

Lukand wrote:
As I probably said in some of previous posts, one thing I suspect is this:
Code:
04496036477e[DMA   ] io write to address 00000004, len=2
04496036521e[DMA   ] io write to address 00000005, len=2

Now looking at the Bochs source code... :
Code:
BX_ERROR(("io write to address %08x, len=%u",  (unsigned) address, (unsigned) io_len))

That's a BX_ERROR! (Runs away in horror)

Those ports are only 8 bits, you can't write a word to them. You have to write one byte at a time, and keep track of whether the DMA controller thinks you're writing the low byte or the high byte.

Author:  Ycep [ Wed Jul 11, 2018 10:56 am ]
Post subject:  FDC [Solved]

@Octocontrobass: Looking at the source code, I also noticed that. Though when I wanted to write that I have found the problem, you also found it :) Thanks.

Now it works because of true СЕРБСКИЙ POWER!
Which only the Srbski can create and imagine!


Hahaha, just joking. Really thanks to everybody who helped me and showed their will to help.
It appears to be working,
so now we go to the vast lands of FAT12, filesystem and etc....

Page 2 of 2 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/