• Transputer B008 DMA on the bare metal --- examples?

    From Tom Stepleton@21:1/5 to All on Fri Oct 21 18:11:06 2022
    Hi again,

    Are there any good examples out there of doing DMA with a B008 card?

    I've set aside Helios for now and am eager for advice about how to get data out of a Transputer on a B008 in a hurry. DMA seems like the ticket for me and my 286. In fact, I'd be happy for the Transputer to shove bytes directly into the 16 kilobytes at
    address B8000 --- that's right, straight into video memory of the mighty CGA card. (Snow, what snow?)

    I've never done much bare-metal PC programming so I don't know if this is really even all that sensible a proposition. Either way, DMA examples would be welcome. I think the DMA transfer listing in the B008 Rev. E user guide
    (https://www.transputer.net/mg/b008ug/b008ug.html#x1-60000C.3)
    tells me most of what I need to know on the PC side, but the example code for the Transputer side is missing (it's only on the floppy disk that comes with the B008). Does anyone have any guide to what the Transputer has to be doing to do DMA in a B008?

    Cheers,
    --Tom

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tom Ivar Helbekkmo@21:1/5 to Tom Stepleton on Sun Oct 23 12:12:02 2022
    Tom Stepleton <stepleton@gmail.com> writes:

    Does anyone have any guide to what the Transputer has to be doing to
    do DMA in a B008?

    Nothing special, really. The B008, like the B004 and compatible boards,
    offers a link that goes to the host computer, and the code on the
    Transputer just has to use that link, sending and receiving bytes across
    it. It's then up to the host computer how it wants to serve the link;
    whether one byte at a time using port I/O, or, in the case of the B008,
    using DMA. (The C012 chip on the B008 knows how to implement its half
    of the DMA dance with the PC host through the ISA bus.)

    When the Transputer sends a message, it gets queued on the B008 for
    transfer to the host, and when the host sends a message, it gets queued
    on the B008 for transfer to the Transputer. In both directions, if DMA
    is to be used between the host and the B008, the host has to program its
    DMA controller correctly, and then tell the B008 to go ahead and run the
    DMA transfer. The code running on the Transputers on the B008 don't
    know whether the transfer is done using port I/O or DMA; it just sees a
    normal inter-Transputer link that happens to go to the host.

    Are there any good examples out there of doing DMA with a B008 card?

    I've implemented a MINIX 3.4 driver for the B004 and B008. It does DMA
    for the latter. I've got a little write-up about that on my web site,
    at <https://hamartun.priv.no/b004.html>, and there are links from there
    to the code on github. I mostly use the driver to support Helios.

    -tih
    --
    Most people who graduate with CS degrees don't understand the significance
    of Lisp. Lisp is the most important idea in computer science. --Alan Kay

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tom Stepleton@21:1/5 to Tom Ivar Helbekkmo on Sun Oct 23 05:21:25 2022
    On Sunday, October 23, 2022 at 11:12:04 AM UTC+1, Tom Ivar Helbekkmo wrote:
    Tom Stepleton <step...@gmail.com> writes:

    Does anyone have any guide to what the Transputer has to be doing to
    do DMA in a B008?
    Nothing special, really.

    Thanks Tom, that's very helpful indeed!

    In the time since I've posted, I've learned more about DMA on the IBM PC AT, and it seems like it's an open question whether DMA is actually any faster or more practical than polling with the CPU. A number of resources suggest that DMA's main advantage
    in the AT is precise timing --- apparently that's useful for the floppy disk. It could be useful for me, too, if I want to avoid "snow" on the CGA display. If that proves necessary, your notes will be invaluable.

    (I didn't know much about PC DMA when I first posted --- now I know a few basics. I suppose I'd expected that expansion cards would be able to take over the ISA bus and manage their own DMA, but I can see I was being a bit too optimistic!)

    Thanks again,
    --Tom

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)