18 and Life

Entries from July 2007

Porting Racoon2, the reworked strategy…

July 6, 2007 · 1 Comment

First, I got a good Racoon2 friendly environment with all the support software running. This included : 1. gcc, 2. GNUmake, 3. openssl, 4. zlib, and so on. NOTE:- openssl package from sunfreeware.com didnot help, I had to use the source openssl-0.9.6 using the command ./Configure –prefix=/usr no-threads solaris-x86-gcc (the problem is with Racoon2, it does not have any option like –with-openssl-includedir=/usr/local/ssl/include/ )

Also, before using the autotools or any other shell command or running make (for openssl), we need to set the environment variables, CC=gcc and PATH=$PATH:/usr/local/bin:/usr/css/bin:/usr/sbin:/usr/css/bin/as

So, here are the steps I have followed there after:

First, try to compile the source code in gcc environment on OSol. While configuring, try to see if all the libraries are getting linked, and the script is identifying third party libraries (especially), like openssl and kerberos. (It is to be noted here that the Linux glibc vs. OSol’s libc might be tricky to combat. The two libraries are different in implementation, and the scope of my project does not include making changes to the libc.)

Once this is complete, we can try to build the source. At this stage numerous coding differences caused compile errors. Since I installed gcc-3.4.6, which works fine on linux for compiling Racoon2, the differences were mostly from the way data types are declared in the two OSes. Here are examples of some types of changes made:

#define __P(x) x
:to relplace old style K&R Compiler coding
u_int16_t -->  uint16_t
:different ways of declaring

Next, we need to look into errors due to different names of libraries and their functions. For example, the source is looking for <netinet6/ipsec.h>. On solaris, this is different, and identifiers like SADB_X_SATYPE_IPCOMP and IPSEC_POLICY_NONE are not implemented as it is. Therfore a mapping of Linux-specific functions to Solaris style, has to be completed here. This sounds like a critical task, and the biggest challenge here is not doing the actual mapping, but finding out what to map to. A single header file with function mapping is enough to solve this problem, but my lack of knowledge about the OpenSolaris internals has slowed me down here.

As a reworked strategy, I am planning to use some help from both my mentor and some people from the main Racoon2 mailing list. As all of these errors are arising from one single file from the racoon2 source (lib/rc_type.c) which takes care of all such calls, I believe the racoon2 guys must already be aware of a solution, hence getting to the next step will not be all that impossible.

Once this is over, I am sure the build will not throw many errors. We have however, not got anywhere yet, in terms of project goals. We havent even looked into System calls, and threading differences in the two OSes. While I can get a list of System calls and signals for the two OSes and compare them, fixing the differences in threading (should the need arise) will be much more difficult. I am hoping a function mapping will again solve the issue.

This will have covered bulk of the project’s objectives and issues, at the moment. The later stages are too far away to be planned right now. Also to be noted is that, I am far away from my deliverable of getting IKE to function by mid-term, but then again, that way was not possible. We cannot work one daemon at a time. So I am not unhappy with the amount of work completed and knowledge gained.

Categories: OpenSolaris · Racoon2 · SoC

Ethernet Driver failed on OSol for Broadcom BCM4401-B0 device

July 5, 2007 · 1 Comment

I have had this problem in setting up my Broadcom BCM4401-B0 on the Dell XPS Laptop.

‘make install’ and then ./adddrv.sh runs fine on the bfe-2.3.0a driver, but when I run ‘devfsadm -i bfe’, I get

devfsadm:driver failed to attach: bfe

Further ‘ifconfig bfe0 plumb’ returns

bfe0: No such file or directory

I am running the i386 version, and make install only seems to be installing /kernel/drv/bfe. I have nothing like a /kernel/drv/i386 (in reference to /kernel/drv/amd64 as per this ML archive).

Categories: OpenSolaris

Dual boot OpenSolaris and Linux

July 5, 2007 · 3 Comments

So I started working on OSol a little more than a month ago and realized that dual boot might be more desirable than virtualization for initial stages of my project. There is nothing that can replace a native install. So here’s an easy way that I followed for setting it up…

First install OSol on a partition of size say 20 GB. Solaris does not allow installing on anything other than the first partition, so it has to be done first. The remaining space on the disk could either be formatted with freeDOS or left unpartitioned, depending upon how much space you need for Linux.

Next, install any linux distro on the second primary partition. The thing to note here is that, since we are installing on a primary partition, the grub of Linux will not replace the one for OSol, and hence both can exist simultaneously. The bootloader will simply point to one of them (at this time it will point to the Linux one). So here’s what the partition table looks like:

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               2        1960    15735667+  bf  Solaris
/dev/sda2            1961        2222     2104515   82  Linux swap / Solaris
/dev/sda3   *        2223        4833    20972857+  83  Linux
/dev/sda4            4834       14593    78397200    c  W95 FAT32 (LBA)

Command (m for help):

So when you reboot, the Linux grub will take control. But how do we boot into the OSol installation? Simple, just make the Solaris partition as bootable instead of the linux one, i.e. in this case, make /dev/sda1 active, instead of the /dev/sda3. Then reboot into Solaris and add a simple command to the /boot/grub/menu.lst, which will help you select linux from the OSol grub. (Remember by this method, after you select Linux from the OSol grub, the Linux grub will be shown, so it is possible for you to install multiple Linux or a Windows XP, in the other primary partitions – A maximum of 4 are permitted on a single hard disk).

Here’s what the menu.lst in the OpenSolaris should look like:

#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris Nevada snv_56 X86
kernel /platform/i86pc/multiboot
module /platform/i86pc/boot_archive
#---------------------END BOOTADM--------------------
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris failsafe
kernel /boot/multiboot kernel/unix -s
module /boot/x86.miniroot-safe
#---------------------END BOOTADM--------------------
#-----------ADDED BY RAHUL MURMURIA------------------
title Linux
rootnoverify (hd0,2)
chainloader +1
#--------------------END-----------------------------

Thats all. So now we have a Dual boot ready.

Next up, setting up a good environment for working on a project like mine where gcc is a must. Also, it is long due that I report my progress on my porting project for GSoC. All this coming up shortly…

Categories: Dual boot · Linux · OpenSolaris

USEFI vs. The British Council

July 4, 2007 · Leave a Comment

I recently visited both the places for gaining more information about admissions in the US and the UK for graduate studies. I found a remarkably acute difference in the ways the proceedings were handled at the two places.

At the American Consulate, the first thing I was asked to do was deposit my original drivers license and my cell phone at the counter, and log my name and address at the library gates. I could not help feel intimidated with all the blast doors and metal detectors, all I wanted was some information! Inside the Library, there was a small room for the USEFI and everyone were expected to maintain a lot of silence.

At the USEFI, there was one lady attending the visitors, and for any question I asked, she had one answer, refer the xyz guide on the rack behind you. I asked if I could have a session with the counselor who could guide me specific to my profile, she said, their adviser had resigned, moreover, I need a membership, once they employ one! I finally got up to read some of the guides, when the lady pointed to the top rack saying only those are available for free! Besides, their entire collection was just 4 racks. Internet has a lot more to offer.

The British Council was a lot different. First and foremost, I was allowed my cell phone! When I entered the Library, I saw this huge hall with people actually using the facility. There were lots of journals lying around. There was a lounge with VH1 running on a huge LCD. This brings us back to the very fundamental question, why should libraries always have pin-drop silence? Here we had a library with a built-in lounge and good music!

At the desk, the counselor actually had hands-on information, and I was given a lot of pointers with help of the Education UK website as well as pamphlets on scholarships and University ratings (apparently the Gov. of UK rates universities’ programs on a scale of 5, they do not follow rankings). More over, I was allowed free access to 250 university prospectus, which were useful. I even got to attend a special seminar conducted by the University of Sheffield that evening. They are one of the 20 Russell Group Universities, which is quite prestigious.

The simplicity practiced at the British council is very inviting compared to the hostile atmosphere at the USEFI. It could be argued that the USEFI is located inside the American Consulate and hence the added security could be justified, but the irony and the contrast was too much to digest. All this is of course, my personal opinion, and I am sure there are others out there who appreciate USEFI’s guidance.

Categories: Grad School

Finding a Grad School…

July 4, 2007 · Leave a Comment

Until recently, I had not realized searching for a good masters program would be such a tedious task. After 4 months of thinking and rethinking and visiting almost 50~60 university websites, I have arrived at a shortlist of 12 universities that could be versioned 4.2! My idea of doing “research in a company” seems more achievable now (a few years ago, when none of us knew about research labs, my friends laughed on the idea).

An account with the USNews website, and visits to the USEFI (American Consulate) and the British Council helped a lot. I have also decided to enroll with Edwise, who counsel students on foreign education. Their guidance in choosing a university (although I did my own university searching) and towards visa issues is invaluable. I also evaluate them to be one of the best and the cheapest in India, as most of the other counselors I went to were running a money fleecing business. My experiences at the USEFI and the British Council were really enlightening, not to mention how contrasting the two places were in their atmosphere. This certainly requires a separate blog post.

Categories: Grad School

My new Dell XPS Notebook!

July 2, 2007 · 2 Comments

After a month long wait, and some very heated mail exchanges with the Dell Sales Representative from the Bangalore office, I finally got my notebook delivered on the 28th of May ( The start of Coding day for Google Summer of Code 2007! – I hate the coincidence ). I have used it for a month now and its a marvel. It is exactly what I was looking for. Thanks to the customize option that Dell provides on their website, I manages to have a Intel T7200 Core 2 Duo 2.0 GHz processor and a Nvidia Go 7400 along with more power 9-cell Li-ion battery for a very good price!

Here’s what Sean O’Neal, Dell notebook engineering manager, had to say about the Dell XPS m1210…

Also with the laptop, I ordered the Targus Trademark Backpack. Its a little heavy, but very well thought out! It goes perfectly with the sturdy design of my Dell XPS.

Categories: Dell XPS · Notebook