This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== Piotr Jaroszyński: Usermode debugging under Linux ====== ===== Week 11 [ Aug 2 - Aug 8 2010 ] ===== ==== drivers in userspace ==== === addressing spaces === First a bit of background. There are four different kind of addresses in gPXE: * virtual - these are the ones you can access directly in gPXE via normal pointer derefence * user - these are a superset (sometimes not proper) of virtual, which possibly allow addressing more stuff * phys - these are physical memory addresses * bus - these are memory addresses how the devices see the memory In linux userpace there is a big (32 or 64 bit depending on arch) flat address space. This lets us easily make virtual addresses equal to user addresses. The problems begin with phys addresses. What a process sees as contiguous memory may not be physically contiguous at all. The kernel maps PAGEs from all over the physical memory to construct the process' address-space. Hence there is no way of converting user addresses to real physical addresses. The good news is that real physical addresses seem to be only really (i.e. passed somewhere to be derefenced) used by virtio and some infiniband drivers. For now we can live without them and currently phys addresses are equal to user and virtual addresses. Bus addresses have the same general problem as phys addresses. The difference is that all memory that is to be accessed by hardware (except infiniband) is allocated with malloc_dma() which can be controled. And indeed malloc_dma() is made to use memory allocated by an [[https://opensource.qualcomm.com/index.php?uiodma|UIO-DMA]] kernel module, which guarantees it's ready to be accessed by hardware and provides us with a bus address for it. Hence we can return a proper address when doing phys_to_bus conversion for these returned by malloc_dma(). The handling of bus addresses begs a question why not make phys == bus addresses and handle the conversion in user_to_phys as it seems to make more sense especially as the adresses are really equal on some hardware. This was tried and backed off because malloc() aligns allocations by their phys address. That could be worked around but doesn't really seem worth it. === some more improvements/cleanup === ==== bnx2 ====


Navigation

* [[:start|Home]] * [[:about|About our Project]] * [[:download|Download]] * [[:screenshots|Screenshots]] * Documentation * [[:howtos|HowTo Guides]] * [[:appnotes|Application Notes]] * [[:faq:|FAQs]] * [[:doc|General Doc]] * [[:talks|Videos, Talks, and Papers]] * [[:hardwareissues|Hardware Issues]] * [[:mailinglists|Mailing lists]] * [[http://support.etherboot.org/|Bugtracker]] * [[:contributing|Contributing]] * [[:editing_permission|Wiki Edit Permission]] * [[:wiki:syntax|Wiki Syntax]] * [[:contact|Contact]] * [[:relatedlinks|Related Links]] * [[:commerciallinks|Commercial Links]] * [[:acknowledgements|Acknowledgements]] * [[:logos|Logo Art]]

QR Code
QR Code soc:2010:peper:journal:week11 (generated for current page)