My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
GettingStarted  
Quick-start steps to get you going
Updated Jan 19, 2012 by t...@kynesim.co.uk
  1. Read the specification so you understand what this code is for and have an idea about how to use it.
  2. Clone the default repository.
  3. git clone https://code.google.com/p/kbus/
  4. Build the kernel module. You will need to have the kernel-headers package for your current running kernel installed.
  5. cd kbus
    make -C kbus
  6. Ensure that the kbus device nodes get reasonable permissions.
    • If your system runs udev (most Debian and Ubuntu do) you can do this by installing the generated udev rules file.
    • sudo cp kbus/45-kbus.rules /etc/udev/rules.d/
    • or
    • cd kbus
      sudo make rules
      cd ..
    • On non-udev systems, we recommend file mode 666 for /dev/kbus[0-9]*.
    • Note that device nodes may be created on the fly via an ioctl! For this reason we recommend a udev rule along the lines of the one created by the kernel module makefile.
  7. Build the C library and utilities.
  8. make
  9. Optionally, run the tests. You will need to have the python-nose package installed.
  10. cd python
    nosetests -d kbus
    cd ..
    • Note that the test will attempt to use sudo to insert and remove the module from the running kernel several times, and will complain if it cannot.
    • Note that the tests deliberately behave badly to test error conditions. Do not be alarmed by complaints appearing in your kernel log.
  11. Choose your language and, if necessary, build its interface.
  12. make -C cppkbus # C++
    # OR #
    make -C jkbus # Java
    • The C library can be found in libkbus.
    • The C++ library in cppkbus does not depend on libkbus.
    • The Java library "jkbus" builds libkbus into a JNI shared library. It requires a full JDK in order to build.
    • The Python bindings in do not need to be built; just add the python directory to your PYTHONPATH.
  13. Go and use kbus in your software...

Unfortunately there aren't many good examples at the moment. While python/kbus/test/test_kbus.py gives the kernel module a good shake-down, it's not really didactic as it deliberately behaves badly in order to confirm the correct error behaviour...!

Note: If you plan to hack on the kernel module, we strongly recommend you create a virtual machine so you can play with it without having to reboot your entire machine if something goes wrong. (Trust us on this one, we've had to do it a lot.)


Sign in to add a comment
Powered by Google Project Hosting