Tuesday, June 17, 2008

Installing kernel source in Voyage Linux

While making kernel based modules, I got an error of the type:

"Missing .config file in /lib/modules/2.6.20-486-voyage/build"

The reason this happens is because the kernel source is not installed with Voyage Linux, but if you are building kernel modules, you need access to this.

apt-get install kernel-sources does not work either.

What I did was:
  1. Download the corresponding kernel source version from the Linux kernel archives.
  2. Untar to /lib/modules/2.6.20-486-voyage/build
  3. Run "make config"
  4. Make sure to turn on "kernel support for .config files" (turned off by default, this is one of the first few options)
Now, you have a fully functioning kernel source tree in your Voyage Linux installation so you can compile kernel modules.

UPDATE, June 25, 2008: From a forum post, I found that you can actually find the source code for the Voyage Linux 0.4 kernel from their website at : http://www.voyage.hk/dists/0.4/linux/.

Actually, it looks like most of their distros have source online as well. Just replace "0.4" in the above link with your distribution number and expect to find your source tarball there.

Friday, June 13, 2008

Resolving compile problems with PSU's MAR - include directories and postgresql-dev

Today I attempted to install PSU's Multiple Access Router component for WORKIT. However, I found that I had to set up the include directories in the makefile in order to get the component to compile.

These are the lines I added to the CONFIGURE that is used by the Makefile to get it to work:

CFLAGS += -I/usr/lib/gcc/i486-linux-gnu/4.1.2/include/
CFLAGS += -I/usr/include/c++/4.1.2/
CFLAGS += -I/usr/include/c++/4.1.2/i486-linux-gnu/
CFLAGS += -I/usr/include/linux/


In addition, I also had to install the Postgresql-dev package since it complained of "libpq-fe.h" missing. I installed it using:

apt-get install postgresql-dev


I did have to change one setting that was causing a conflict with the INCLUDE directories for the root Makefile. This file was /dotconf/Makefile, and I commented the following line:

# CFLAGS =

dnsmasq now working as DHCP server as well

Now I have dnsmasq working as a DHCP server as well.

In my configuration, I added the following lines:

dhcp-range=ath0,10.0.0.10,10.0.0.250,24h
dhcp-leasefile=/var/tmp/dnsmasq.leases
dhcp-authoritative
# Gateway
dhcp-option=3,10.0.0.1
# DNS
dhcp-option=6,10.0.0.1

and dnsmasq is now able to serve up DHCP addresses on the fly to clients.

dnsmasq now works for DNS requests - after initial "query refused"

For a long time, I was having a problem where dnsmasq refused to respond to DNS requests and gave an error message "query refused".

At first I thought that it might have been because dnsmasq wasn't running or not binding to the proper port, but after using "netstat -ap" and running "dnsmasq -d", it was obvious that dnsmasq was running and able to receive the queries.

So why wasn't dnsmasq failing to do IP lookups and interact with the upstream DNS servers? Even though from most documentation (such as on Debian and ubuntu.wordpress.com) suggests that a simple apt-get would do the trick?

Anyway, I found that my /etc/resolv.conf had only 127.0.0.1 listed as its nameserver, and dnsmasq was using this as its resolv.conf . I looked around to see if I could find another file that the resolvconf binary was generating that had the actual nameservers, and I found this file: /etc/resolvconf/run/interface/eth0

I change a line in /etc/dnsmasq.conf to read:
resolv-file=/etc/resolvconf/run/interface/eth0
And hey presto, it worked!

Thursday, June 12, 2008

Network (eth0) automatically gets IP address using DHCP now

I recently ran into a strange problem with the Voyage/Soekris box, where the box would not get the IP address using DHCP on bootup, even with the network cable plugged in. However, when I manually reset the networking (using ifdown/ifup eth0 or /etc/init.d/networking restart), it would work properly.

This was strange, as it had been working fine all along, and I had the /etc/network/interfaces set up as follows:
auto eth0
iface eth0 inet dhcp
After prolonged searching on the Internet, I found two entries on Ubuntu forums:
that helped, but didn't quite work in my case.

I finally added a line to the /etc/network/interfaces file to make it read like this:
auto eth0
iface eth0 inet dhcp
pre-up ifconfig eth0 up
and then, hey presto, the network card now picks up an IP address automatically on boot.

Fixing dnsmasq problems on Soekris/Voyage Linux

(Sorry, my research blogging has been intermittent - but it does affect my documentation, so I am trying to be consistent about it.)

This morning, I needed to look at the DNS and DHCP servers on the Soekris box - somehow, it wasn't working perfectly.

The problem started when I first tried to install dhcpd (the DHCP server) last year without realizing dnsmasq had already been installed - and without knowing what dnsmasq is. After some frustrating error messages and doing some Google searches for dnsmasq and dhcpd, I finally found out more about how they work.

This article gives a good overview of how to set up dnsmasq.

Tuesday, April 29, 2008

Updates: LightPeers, WORKIT, Spring semester

A few updates since my last blog post, and this is a quick summary:
  1. I finally discovered a related work to BonAHA called LightPeers. LightPeers appears to be a PhD dissertation done in Denmark, and the aim of the project is the same: develop a robust application framework for mobile P2P or ad-hoc applications. There are a few differences between BonAHA and LightPeers, but the basic concept is the same.
  2. I got the WORKIT MIPClient finally working and able to connect to a wireless AP! Yay! Now to get it connected to the WORKIT AP and test its connectivity to that system.
  3. Almost at the end of the Spring semester now. That's good and bad ... because I'll be tied up for the next two weeks with project demos, TA grading and reports ...

Friday, April 18, 2008

Photos of Soekris net5501 in Demarctech ODE-8585 Enclosure

At long last, I have photos of the Soekris net5501 in a Demarctech ODE-8585 enclosure.

This Soekris board is currently running Voyage Linux.

Thanks go to George at Columbia Univ's Physics Machine shop for putting this together.







Monday, March 31, 2008

Ad hoc applications

For our 7DS project, we are dealing with a class of applications that are highly mobile, work in disconnected or intermittently connected networks, and without central servers such as DNS and DHCP.

What name do we give this new set of applications? We call them ad-hoc applications!

The only reference I was able to find for ad-hoc applications seems to suggest that this term isn't very popular, but maybe it will catch on...

Our 7DS system - and the BonAHA framework I am building at Columbia and has been put on SourceForge - will hopefully create a usable framework for these class of ad-hoc applications. We're nearly done with version 1.0, but I still need to fix up some bugs and document the code.

Thursday, March 27, 2008

Drill Bushings from McMaster-Carr for WORKIT Soekris

Hi, I'm back after a long while ... decided to continue using my Blogspot account for work related blogs, while the CS@CU wiki can remain as a wiki for official documentation.

Today, I was looking at finding ways of getting washers/bushings to seal off the Demarctech hardware that encloses our Soekris net5501 box. Talking to George at the machine shop indicates that McMaster-Carr would be the best source of such bushings.

I think I am looking for the items under :
Machining and Clamping > Drill Jig Bushings > Drill Bushings and Liners > Drill Bushings for Soft Materials

More to come soon ... as soon as I figure out exactly what I need.

Thursday, August 24, 2006

Odd "Array" output in Joomla/PHP module solved

I had an odd problem in which a Joomla! module I was writing was outputting "Array" after its output.

I didn't find any code in the module itself that was capable of outputting this error message, since this came after the last line of the module's output echo() statements. So, I was puzzled!

Then I realized that it might have been because I had overwritten a global variable. I had liberally used variables like $id, $content, $categories, etc. So I replaced all my variable names with ones that couldn't possible belong to the reserved variable list ... such as $category__id, etc.

And that solved the problem! :)

Friday, August 04, 2006

C libraries to capture layer two packets

For the 7DS system, we need some libraries for peeking at the link layer packets. These are the ones we found:

Libradiate: http://www.packetfactory.net/projects/libradiate/
libpcap: http://www.tcpdump.org/
libnet: http://www.packetfactory.net/libnet/

Monday, July 31, 2006

Automake/autoconf for 7DS

I finally started workng with the GNU Automake/Autoconf system for 7DS today. It's really neat! Far easier to work with than the faulty manual Makefiles I've been creating so far. I hope to have a fully GNU-style 7DS system (at least for my part) by the end of this week.

I found that the deadline for submitting my paper to INFOCOM has passed, so I will probably be submitting a paper to ICC07.

Wednesday, July 26, 2006

Verbose options and logging levels/priority

Today I did something really cool with the 7DS logging system that enabled me to turn the "verbose" option off and instead introduce something more advanced: a level system that outputs log messages to the log file or screen based on the user setting.

To set this up, I basically made added two functions like this, one for on-screen and one for log files:


int SdsLogSetPrintLevel (int level)
{
print_level = level;
}



and then changed the code so that it prints only the higher priority messages to log file or screen, depending on user settings.


/* If level is greater than specified ,
* then print to stderr. */
if (level >= print_level)
fprintf(stderr, logstatement);

/* If level is greater than specified log level, write to logfile */
if (level >= log_level)
fprintf(logfp, "%s", logstatement);


Of course, I had to set the default values appropriately, so that the log file would get all messages.


int log_level = SDS_LOG_DEBUG, /* File should have debug messages */
print_level = SDS_LOG_INFO; /* Screen should have info messages */

Tuesday, July 25, 2006

7DS code cleaning

I' m continuing to clean up my 7DS code. I have to follow my advisor's instructions on formatting code, which are very helpful.

I'm also finding that other than configuration files and logging, I will well have to start using getopt() for command line options. Well, better late than never...

Tuesday, July 18, 2006

7DS software engineering and wikis

Sorry I haven't been active for a while on this blog ... well, a few days ago, I realized I was running into a brick wall with the 7DS project, not sure of what to do, and faced with an overwhelming array of choices that I didn't know how to handle. :(

Luckily, I e-mailed Henning and met him today (with Se Gi and Andy) to get an idea of how to come to grips with the situation and proceed further with the project.

It looks like:
  1. We will release a version that has the basic features, but working.
    I think this can be released as source code with configure/make/make install, as well as installation binaries.
  2. In parallel, we will draft guidelines for future versions and see how to make 7DS more modular so that it is "future-compatible". Things like the community extensions and file syncronization will be part of the next release.
In addition, Henning suggested that we use a wiki to document our work. That's a great idea! The only thing now is to find a place to host it ... unless we have a CS-wide one.

One great wiki I've heard a lot about is DokuWiki...

Wednesday, June 28, 2006

Installing Eclipse with PHP and C

I decided to install Eclipse today to use as my primary development kit. I've used vi, gEdit, jExt (I really like jExt!) but life might be simpler with an IDE.

So I will try Eclipse with the C development and maybe PHP development environements and see how it works out.

Tuesday, June 27, 2006

Installed DarwinPorts, sqlite, swish-e, and all other required libraries

OK - I finally managed to get DarwinPorts installed on AirTrain (the iMac). I couldn't get it installed under OS X 10.2 - it complained that TCL was built without threading enabled.

Now that I have OS X 10.4 and the Xcode tools, DarwinPorts installed without a hitch from source.

I am now able to successfully build all the other required libraries that I need to get 7DS running on the Mac, including:
- sqlite3
- swish-e
- libconfuse

(and maybe some more? I forget.)

Upgraded AirTrain iMac to Mac OS 10.4

I upgraded AirTrain (the IRT lab iMac) from 10.2 to Mac OS X 10.4. Surprisingly, the install DVD had an upgrade option - so I didn't have to format the disk at all! So much for my warnings to my colleagues to backup all the stuff they needed...

Thursday, June 08, 2006

Porting 7DS from Unix to Mac OS and Windows

Right now, I'm involved in porting the 7DS system from the Linux system to run on Windows and the Mac OS X. It is really fun (!) though it might take a while to complete...

For Windows, I am currently trying Cygwin. I heard that it uses a compatibility layer and a cygwin.dll file though - meaning that Cygwin will have to be installed. I have heard about MinGW and will see if that avoids this issue.

For the Mac OS X, I first heard that we might need to install the XCode development tools, but now it looks like it is not necesssary. The Mac OS X 10.2 system I am working with already has the GCC environment, and except for dynamic library handling, it seems to compile most apps. Dynamic library loading is a problem though: I even installed dlcompat from Fink, but it still has problems! Fink, btw, is a build environment for Darwin that promises to make it easier for people to port open source apps to Mac OS.