Mem Proxy ========= Introduction ------------ Mem Proxy consists of three components: mem-proxy - a kernel module that allows userland processes access to the kernel address space. mem-proxyd - a daemon which allows applications running on other machines access to the mem-proxy module. Client library - a high-level library which allows scripts to access mem-proxyd over the network. So What is it good for? ----------------------- I've used this initally to play around with the GPIO pins on my Edimax BR-6104KP. I was writing a 7-segment display driver and it was much easier to get the logic right by writing it in Python and then converting to C, than developing directly in C. Use of Python on a remote machine requires no compile->Upload->Flash->Boot cycle so is far more rapid. Since playing about with the GPIO pins I've added kmalloc() and kfree() capability, since some devices like USB controllers need to write results to DMA memory. You could use this to prototype an MMC driver or investigate IO pins/LEDs on unknown routers. For some applications it may be that this can be used to avoid writing a driver altogether - with embedded applications the kernel->userland divide sometimes just gets in the way. Usage instructions ------------------ - I'm Assuming a recent svn checkout of OpenWrt Kamikaze from dev.openwrt.org. - go to the packages directory:: $ cd trunk/packages - Get the source:: $ svn co http://linux-adm5120.svn.sourceforge.net/svnroot/linux-adm5120/trunk/BR-6104K/OpenWrt/mem-proxyd $ svn co http://linux-adm5120.svn.sourceforge.net/svnroot/linux-adm5120/trunk/BR-6104K/OpenWrt/mem-proxy - Now run 'make menuconfig' and select mem-proxy from kernel modules->other, and mem-proxyd from utilities. - Build using:: $ make V=99 - Burn the firmware or upload it to DRAM. - The firmware should boot, the mem-proxy module should get loaded automatically and the mem-proxyd daemon should get run, although this may occur a few seconds after getting the OpenWrt shell. - The directory trunk/packages/mem-proxyd/examples contains both the client library (mem.py) and a couple of examples for the Edimax router, one to flash the LEDs on and off, and another to access the USB controller. - Using the library is pretty easy from Python. Assuming your router has address 10.0.0.44:: $ python >>> import mem >>> myrouter = mem.Proxy("10.0.0.44") >>> data = myrouter.Read(0xb2000000) - See the examples for further details. If you access hardware registers you need to map their addresses into KSEG1 - see the examples for details. If you find this useful, send me an email at: bifferos@yahoo.co.uk.