Hi, just finished this training (solution available on my fork) and wanted to contribute back some of my experience.
Setup
- I completed this on Ubuntu 22.04 and had problem with the initial setup since
tomli is not available on the python std lib in 3.10, worked around this by installing it manually pip install tomli
- At first I could not build the driver at all since the guest machine does not have
make installed and the host buildroot cross compiler was not detected, only way I could make this work was to change CROSS_PREFIX := x86_64-buildroot-linux-gnu- to CROSS_PREFIX := x86_64-linux- here in order to build on host.
- Took some time to setup vscode intellisense and the Makefile extension was a nice solution, perhaps the guide can suggest how to setup this?
Development
- Could not find the allocation message in
dmesg as suggested here (perhaps it expects me to log it?)
- Why would MSI-X not be available if the guest machine is known (as suggested here), is this purely for learning purpose or Im missing something about interrupts on Linux?
- On the mmap part, does the solution where we map the whole ring buffer could even work with
dma_mmap_coherent as the guide suggested? I couldn't make this work and after chatting with claude it suggested that it is not possible to achieve the whole ring buffer mapped using a single mmap call without using remap_pfn_range instead (of-course claude could be wrong so wanted to verify if I had some problem with my implementation or the whole idea was to make me understand the different between those 2 functions).
At first I wanted to just open a PR to upstream my workarounds for the setup issues but figured out that 1 - Ubuntu 22.04 is pretty old, 2 - I might be missing something so its better to first discuss it here.
Any way thank you very much for this guide! it helped me a lot!
Hi, just finished this training (solution available on my fork) and wanted to contribute back some of my experience.
Setup
tomliis not available on the python std lib in 3.10, worked around this by installing it manuallypip install tomlimakeinstalled and the host buildroot cross compiler was not detected, only way I could make this work was to changeCROSS_PREFIX := x86_64-buildroot-linux-gnu-toCROSS_PREFIX := x86_64-linux-here in order to build on host.Development
dmesgas suggested here (perhaps it expects me to log it?)dma_mmap_coherentas the guide suggested? I couldn't make this work and after chatting with claude it suggested that it is not possible to achieve the whole ring buffer mapped using a single mmap call without usingremap_pfn_rangeinstead (of-course claude could be wrong so wanted to verify if I had some problem with my implementation or the whole idea was to make me understand the different between those 2 functions).At first I wanted to just open a PR to upstream my workarounds for the setup issues but figured out that 1 - Ubuntu 22.04 is pretty old, 2 - I might be missing something so its better to first discuss it here.
Any way thank you very much for this guide! it helped me a lot!