log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- Elsear brings super-fast Networking to Risc PC/A7000/A7000+ (News:)
- Latest hardware upgrade from RISCOSbits (News:)
- RISC OS London Show Report 2024 (News:1)
- Announcing the TIB 2024 Advent Calendar (News:1)
- Code GCC produces that makes you cry #12684 (Prog:39)
- RISCOSbits releases a new laptop solution (News:)
- Rougol November 2024 meeting on monday (News:)
- Drag'n'Drop 14i1 edition reviewed (News:)
- WROCC November 2024 talk o...ay - Andrew Rawnsley (ROD) (News:2)
- October 2024 News Summary (News:3)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
 
View on Mastodon
@www.iconbar.com@rss-parrot.net
Site Search
 
Article archives
Acorn Arcade forums: Programming: PCI_MemoryWrite not doing what is expected
 
  PCI_MemoryWrite not doing what is expected
  ksattic (17:59 27/5/2006)
  VincceH (14:18 28/5/2006)
    ksattic (03:31 29/5/2006)
      VincceH (09:28 29/5/2006)
        ksattic (03:11 30/5/2006)
 
Simon Wilson Message #75740, posted by ksattic at 17:59, 27/5/2006
ksattic
Finally, an avatar!

Posts: 1291
I have a 64KB buffer allocated from a user mode program that I need to copy into PCI space. I alloced the PCI RAM and obtained the logical and PCI addresses using PCI_RAMAlloc.

The problem is that when copying from the PCI buffer to my user buffer using PCI_MemoryRead, the copy appears to complete fine (zeroes are copied over my user buffer). However, when copying from the user buffer to the PCI buffer using PCI_MemoryWrite, nothing is copied. There are alternative ways to do the copy, but I am wondering why this fails to do what is expected.
  ^[ Log in to reply ]
 
VinceH Message #75782, posted by VincceH at 14:18, 28/5/2006, in reply to message #75740
VincceH
Lowering the tone since the dawn of time

Posts: 1600
Flags in R4? The Castle's online docs don't seem to say what these are (unless I'm missing something). I wonder if its an ommission or if it's a case of being reserved for future use for flags - but in which case that something /is/ looking at what is passed atm even though it isn't used?
  ^[ Log in to reply ]
 
Simon Wilson Message #75804, posted by ksattic at 03:31, 29/5/2006, in reply to message #75782
ksattic
Finally, an avatar!

Posts: 1291
Flags in R4? The Castle's online docs don't seem to say what these are (unless I'm missing something). I wonder if its an ommission or if it's a case of being reserved for future use for flags - but in which case that something /is/ looking at what is passed atm even though it isn't used?
The only flag I know of is bit 3 (memory is prefetchable), but I tried that, and it had no effect (I wouldn't expect it to though).

The current "cheating so and so" method I am using is to unprotect the memory pages using the MMU, before doing the copy in user mode. :o
  ^[ Log in to reply ]
 
VinceH Message #75808, posted by VincceH at 09:28, 29/5/2006, in reply to message #75804
VincceH
Lowering the tone since the dawn of time

Posts: 1600
Flags in R4? The Castle's online docs don't seem to say what these are (unless I'm missing something). I wonder if its an ommission or if it's a case of being reserved for future use for flags - but in which case that something /is/ looking at what is passed atm even though it isn't used?
The only flag I know of is bit 3 (memory is prefetchable), but I tried that, and it had no effect (I wouldn't expect it to though).
No, I wouldn't either.


The current "cheating so and so" method I am using is to unprotect the memory pages using the MMU, before doing the copy in user mode. :o
MMU... I noticed yesterday that PCI_RAMAlloc mentions a call to OS_MMUControl. It jogged a vague memory, but just didn't click when I read it yesterday - but now I'm thinking an error or inconsistency in the documentation mentioned not long ago on csap?

<googles>

Okay, it was actually aproaching a year ago:

PCI DMA buffers and OS_MMUControl

But looking at Castle's documentation now, it's been fixed.

So that won't be relevant.
  ^[ Log in to reply ]
 
Simon Wilson Message #75826, posted by ksattic at 03:11, 30/5/2006, in reply to message #75808
ksattic
Finally, an avatar!

Posts: 1291
I did try draining the write buffer using OS_MMUControl 1 with bit 28 set. You're right, it's probably not relevant here given that I am seeing nothing copied, but I do it for safety anyway in PCITV (although I do user->pci memory copies in a different way there, using some assembly to copy in supervisor mode).

I'll send John Ballance an email.
  ^[ Log in to reply ]
 

Acorn Arcade forums: Programming: PCI_MemoryWrite not doing what is expected