Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jun 2007 16:09:58 +0200
From:      "Die Gestalt" <die.gestalt@gmail.com>
To:        freebsd-drivers@freebsd.org
Subject:   Re: Generic int 13h driver
Message-ID:  <5bf3e10d0706010709yab08f21s256cb894118d3bf4@mail.gmail.com>
In-Reply-To: <5bf3e10d0705241345t11e739we0b896bab868fec6@mail.gmail.com>
References:  <5bf3e10d0705150724q3f0fd25fq89094bd02d8f9d29@mail.gmail.com> <86veetgnk4.fsf@dwp.des.no> <5bf3e10d0705210744s119d1c5cpc20ab1036e9f98ff@mail.gmail.com> <5bf3e10d0705221130t222b80b5w64a4e446b04d6029@mail.gmail.com> <863b1nvqqa.fsf@dwp.des.no> <5bf3e10d0705230314w3038a532uf0d8c0ed18a5d05f@mail.gmail.com> <5bf3e10d0705240839x17792a96hf17e6eebfa5a83da@mail.gmail.com> <5bf3e10d0705241345t11e739we0b896bab868fec6@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi me again... ;)

Well now I correctly hook the interrupts, they are correctly reflected back
to the BIOS and I can write to the disk without a problem. When DMA is on,
however, reading fails (it works when DMA is off in the BIOS). This is
obviously a DMA problem and for some reason the machine does not read the
correct page value.

The problem is that the Virtual 8086 monitor makes an "invalidate page" call
when the operation is finished and my buffers are loaded into a DMA mapping
and I do the proper pre/post synchronization, I've even tried with reversed
sync in case I got it wrong.

I think the problem is a lack of understanding on my side about how DMA
works in FreeBSD. What I do is I have a parent tag and two child tags (one
for reading the other for writing), I do :

bus_dma_tag_create -> bus_dmamap_create

Later I do contigmalloc of my buffer and I load this buffer with
bus_dmamap_load.
I do bus_dmamap_sync before and after the call the BIOS.

The writes are succesfull but the read buffer is left untouched. What do I
do wrong? What is the exact use of the callback?

Thanks for any hint.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5bf3e10d0706010709yab08f21s256cb894118d3bf4>