2012/3/10 Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net:
I'm glad to announce libhwremote 0.1, a library which forwards hardware accesses over a serial line to a machine running SerialICE. No QEMU needed! All you have to do to run lspci/superiotool/... against a remote SerialICE target is to compile those tools against libhwremote, and then just run them like you would run them natively.
libhwremote is an early prototype. Due to that it has quite a few quirks:
- Each run of a libhwremote enabled application requires the application
to be started before SerialICE prints its banner, i.e. start the application, then hit reset on the SerialICE target. The reason is the init code which expects "newline,serialice_banner,newline" to do anything useful. If that banner is not there, the results are undefined.
- The error handling is mostly working but not really nice.
- /dev/ttyUSB0 is hardcoded for serial line access, you may want to
change that.
- MMIO functions are totally untested, I didn't find any code which
needed it (except for flashrom, but probing for flash chips might interfere with SerialICE functionality if SerialICE runs from ROM).
- The pciutils patch is totally untested, but I expect it to work.
A big THANK YOU goes to Idwer Vollering who tested a dozen iterations of this code until I had figured out the very surprising and unique properties of the SerialICE protocol.
Another big THANK YOU goes to Ron Minnich who sent a mail titled "[SerialICE] an idea" which motivated me to start this little project: http://serialice.com/pipermail/serialice/2009-November/000043.html
This code sat unfinished on my disk since December 2009, and it's about time I finished it enough to be usable.
Notes::
- superiotool support is tested and stable
- pciutils (lspci/setpci/...) support is untested, but should work.
Please fetch latest superiotool from the coreboot git tree and latest pciutils from the pciutils git tree to apply the patches.
git clone'd from git://git.kernel.org/pub/scm/utils/pciutils/pciutils.git
libhwremote is available at: http://ra.openbios.org/~carldani/libhwremote-0.1.tar.gz
superiotool patch is available at: http://ra.openbios.org/~carldani/superiotool_hwremote.diff
pciutils patch is available at: http://ra.openbios.org/~carldani/pciutils_hwremote.diff
I plan to check this code into a source code repository really soon, but for now a tarball and separate patch downloads have to suffice.
Tests and bug reports appreciated.
Where is i386-io-libhwremote.h?
$ make distclean ; make rm -f `find . -name "*~" -o -name "*.[oa]" -o -name "#*#" -o -name TAGS -o -name core -o -name "*.orig"` rm -f update-pciids lspci setpci example lib/config.* *.[78] pci.ids.* lib/*.pc lib/*.so lib/*.so.* rm -rf maint/dist cd lib && ./configure Configuring libpci for your system... i386--libhwremote 3.2.9-1-ARCH i386 libhwremote Looking for access methods... i386-ports dump Checking for zlib support... yes (auto-detected) Checking for DNS support... yes (auto-detected) Checking whether to build a shared library... no (set manually) make -C lib all make[1]: Entering directory `/home/idwer/coreboot/libhwremote/pciutils/lib' gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o init.o init.c gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o access.o access.c gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o generic.o generic.c gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o dump.o dump.c gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o names.o names.c gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o filter.o filter.c gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o names-hash.o names-hash.c gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o names-parse.o names-parse.c gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o names-net.o names-net.c names-net.c: In function ‘dns_parse_packet’: names-net.c:78:22: warning: variable ‘x’ set but not used [-Wunused-but-set-variable] gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o names-cache.o names-cache.c gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o params.o params.c gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o caps.o caps.c gcc -O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -c -o i386-ports.o i386-ports.c i386-ports.c:30:33: fatal error: i386-io-libhwremote.h: No such file or directory compilation terminated. make[1]: *** [i386-ports.o] Error 1 make[1]: Leaving directory `/home/idwer/coreboot/libhwremote/pciutils/lib' make: *** [lib/libpci.a] Error 2
Regards, Carl-Daniel
SerialICE mailing list SerialICE@serialice.com http://serialice.com/mailman/listinfo/serialice