Archive for April, 2008

Posted on 04-16-2008 under electronics, howto, linux

After two days of banging my head against the wall, interspersed with issuing ineffectual commands, I’ve finally done it. (See shot below).

Xilinx Cable Connected and Running!

The cable drivers available with the Xilinx 9.1i software suite just won’t compile on my system. Apparently they use some proprietary functionality that does not support any kernel other than 2.4. And since I have 2.6 installed…

I had help from here, here and here.

Here’s a rundown of how I made it run on my system, which is a Debian 4.0 testing, with the following output for uname -a

Linux galileo 2.6.24-1-686 #1 SMP Thu Mar 27 17:45:04 UTC 2008 i686 GNU/Linux

I used bash throughout. If you use another shell, some commands may change.

1.

In order to avoid problems later, install libusb-dev and fxload.

 aptitude install libusb-dev fxload

2.

Make a directory somewhere to store the driver’s sources.

mkdir ~/tmp/xildriver
cd ~/tmp/xildriver

3.

Download the source tarball.

 wget "http://git.zerfleddert.de/cgi-bin/gitweb.cgi/
usb-driver?a=snapshot;h=HEAD;sf=tgz" -O usb-driver.tar.gz

(without the line breaks)

 tar zxvf usb-driver.tar.gz
 cd usb-driver

4.

Compile the driver.

 make

5.

copy the library to a lib directory.

 su
 cp *.so /usr/local/lib/
 exit

This step is totally optional. Just make sure you substitute the right path in the next step.

6.

make the linker aware of the new library

 export LD_PRELOAD=/usr/local/lib/libusb-driver.so

This step will need to be repeated every time you login. Or you can add it to your shell’s rc file. For bash this is /home/user/.bashrc.

All the previous steps are common to all tutorials and sources I’ve mentioned earlier. Its also given in the README file that comes with the source. After this though, its all from Verhaegen’s email.

7.

Make a new udev rule file
I absolutely do not understand this step, but I believe it has something to do with how the USB cable is detected.

 su
 vim /etc/udev/50-xilinx-usb-osdriver.rules    # a new file with arbitrary
#name ("50" is recommended)

Now paste this into the file and save it.

ACTION=="add", BUS=="usb", SYSFS{idVendor}=="03fd", MODE="666"

If you don’t know how to use vim, use nano instead ( or learn it). If you would rather use a graphical editor, then exit from root user and type

kdesu kwrite /etc/udev/50-xilinx-usb-osdriver.rules

Now restart udev.

 /etc/init.d/udev restart

8.

Get the bus and number of the USB cable.
Plug the board in and type

lsusb | grep Xilinx

Note the bus number and the device number. Here’s my output

 Bus 005 Device 016: ID 03fd:0008 Xilinx, Inc.

9.

Update firmware
If the ID in the above line is not 03fd:0008 in your case, do the following.

 su
 /sbin/fxload -v -t fx2 -I /home/zohair/installed/Xilinx91i/bin/
lin/xusbdfwu.hex -D /proc/bus/usb/005/016

Again without the linebreaks.
Replace your bus and device numbers from the above step into this command.

10.

Start impact (as normal user of course)

 ~/installed/Xilinx91i/bin/lin/impact

Impact should detect your cable automatically. If it does not go to Output->Cable Setup: and choose Xilinx USB cable.

If it still does not work, there are some more instructions in Verhaegen’s email (steps 13 onwards).

Credits

Credits go to Michael Gernoth who took the time out to make these drivers. And also to Paul Verhaegen’s excellent email and Luzerne GANHIR . Thanks guys.

Posted on 04-13-2008 under linux

Referring to my previous post on getting a domain name for my dynamic IP home server, there was one thing left to do.

Recently I had to reboot my computer, because I had to get some work done on Windows. (Orcad don’t work on ‘Nix.) Long story short, noip2 didn’t start automatically on reboot. No surprise as nobody installed the startup script (duh!).

The noip2 tarball contains the init script for Debian, as well as for Gentoo and Redhat. This should be copied to /etc/init.d and renamed to noip2.sh, as is written down in the file itself. I don’t understand init scripts at all, but somehow this worked. Apparently noip2 runs under root, which is no big deal really. But you won’t be able to see the stats if you use

 noip2 -S

under normal user mode. You’ll have to change to root to see any stats.

[Update] Please read No-IP continued for updates.

Posted on 04-11-2008 under web crawling

Go here first

Something’s Fishy

Heck yes it does!

Now go here

Got the idea yet?

Here’s a little helper. Go to Yubnub, and enter

 20g10 my text

(Does not work with special characters though. Only alphanumerics please. )

Enjoy

Posted on 04-10-2008 under linux

I just registered for No-IP.com, just to see what my server would look like from the web. Brilliantly, the No-IP dynamic update program is available on Debian. A quick

 aptitude install noip2

and I was enjoying the joys of being url accessible.

Not surprisingly my ISP soon hiccuped, causing me to lose my IP address. This was the perfect test for No-IP.

Which went bad. It soon became apparent that no-ip wasn’t doing what it was meant to. After looking through the excellent guide by No-IP, forum posts, and more, I still couldn’t get it to run.

It then occurred to me that the utility could be using a different port, one that would be blocked by my firewall. So I tried a really risky, “disable firewall” test. And what do you know, no-ip worked just fine. So the problem was with the port, but which one? I can’t test all 65,536 ports!

Since I already had the utility’s source code, as I had followed their guide, I looked through the files. Thankfully there was only one C file, and a quick look uncovered this line.

 #define CLIENT_IP_PORT		8245

Bloody ****, if you had only told us there was a port you needed ….

Problem fixed. But I shouldn’t have had to muck about in the code in the first place. No-IP is a business and they could lose customers this way. The guide was written for complete laymen, and such a person just cannot go looking through code. Proper documentation is necessary people.

Then again, if No-IP hadn’t given us the code, I wouldn’t have found that port so easily.

[Update] Please read No-IP continued for updates.

Posted on 04-09-2008 under pakistan, software

Earlier this week, I was having a conversation with a friend about how we’re so used to Windows, we don’t even notice it. Most of us believe that Windows is a ubiquitous part of computers. Computers can’t run without it. “What, you’re not on Windows? How are you chatting with me, then?”. I hear that a lot.

I believe the reason is that we’ve been virtually “brought up” with Windows. Our idea of computer literacy is “My Computer” and “Microsoft Office”. When we have a problem with our computers we turn to our friends. Our friends know Windows. The guy at the computer shop on the corner knows Windows; and does not shy from showing off his “IT” skills by frequently refreshing the desktop while an application loads. Of course most of the troubleshooting means either turning your computer off and on again, or reinstalling Windows. (Recently, I have had the pleasure of having to reinstall Windows on our family computer three times during the last year alone.)

Having extremely lax (read non-existent), copyright laws helps of course. If Windows were priced the same as in other countries we wouldn’t be able to afford it. Windows is more expensive than most Pakistanis’ salaries. (In such a scenario, I’m sure we would be more open to Free and Open Source Software.)

Therefore we know Windows. If we have any problems, we have loads of people to help us out. But nobody knows about any alternatives. We dont even realize that we’re missing anything.

If a child were to be raised in an environment where he/she were to be exposed to alternative computing systems, they’d know the difference. They’d appreciate the options and realize there’s more to computers than refreshing your desktop. And this is not just some geek fantasy, the world we’re living in is increasingly computerized. Our whole lives revolve around computers. Its only logical to assume the next generation of kids would be even more involved with technology.

So the question is, does a child grow up with a monopolistic, closed behemoth of an operating system; the future progress of which is ensured by the underhanded tactics employed by its parent company (ala OOXML); or an open, creatively charged atmosphere.

It is actually very difficult to ensure the latter, as Terry Hancock’s broken toys prove. Here’s some excerpts.

To make a long story short, the company, for some obscure and counter-intuitive reason, decided it would be more economically sensible to waste engineering time on designing their very own USB mass storage device interface, instead of using the free one that is made available to all hardware developers worldwide. Uh-huh. Real smart.

So, even if I were running Windows, this lovely toy would attempt to compromise its security for me. Furthermore, just to trigger my paranoia a little more, the AUTORUN.INI file isn’t even fully readable—aside from a one-line message at the top that warns me not to touch the contents of the file, the rest is binary gibberish (which is pretty weird in an INI file, at least the last time I used Windows. Admittedly, that was last century, but still).

If big producers are willing to waste engineering time and drive up costs in order to ensure that their customers are locked into a particular platform, then I suppose we just can’t expect to rely on them much longer.

What cost can you evaluate on the disappointment of a child? Or on the value of avoiding it? What does it teach our children when they can’t have the things other children take for granted, simply because it was designed not to be compatible?

« Previous entries | Next entries »