Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6502

With the Intel's xHC, what are the virtual memory requirements?

$
0
0

Not long ago, I had an identity mapped kernel that was running in the low 10MB of RAM. Lately, I decided to move the kernel to the upper half of the virtual address space because this is what most kernels do.

When I did that, I had to rearrange all the code to work with virtual memory differently. Now my xHC driver isn't working anymore and I am trying to eliminate all possibilities as to why.

The error is basically when I reset the root hub ports (I reset only the USB 2.0 ports). When I do that, the USB status register will set the xHC error bit (bit 12 counting from 0). I think the problem is with the event ring. Resetting the ports work until it falls on a port which actually has a device on it. Then it probably tries to write a Port Status Change Event and I think this is what creates the xHC error.

My questions are:

  1. What are the virtual memory requirements of the Intel's xHC?

  2. More specifically, does DMA devices (the xHC) need to have the virtual memory mapped where they write or do they simply ignore paging and write to RAM directly?

  3. Also, do registers contain physical or virtual addresses?

I think I answered the third question already. I had an error where, when I write the Event Ring Segment Table Base Address Register (ERSTBA) after setting the different registers with virtual addresses, it failed and triggered an xHC error. I know the state machine within the xHC for the event ring starts when I write the ERSTBA. I thus thought that, if it works (without setting the error bit), then it probably means that my settings are correct. After putting physical addresses in the different registers, the xHC error bit didn't set and I could go on to reset the root hub ports. I still want to ask the question if someone have got any clarification.

You can browse my code here: Why am I not receiving interrupts on Port Status Change Event with the Intel's xHC on QEMU?. The code I use is a slightly modified version of the answer to this question. I don't want to share it here again for sake of brevity.

Does anyone have any comment, advice or answer for me? Thank you.


Viewing all articles
Browse latest Browse all 6502

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>