Sunday, January 15, 2006

Connecting WRT54G router to another Router Wirelessly

As I posted before, I was unable to make my Linksys WRT54G router to connect to another wifi router (NETGEAR WG11) wirelessly, eventhough I downloaded a firmware that was supposed to support WDS. Yesterday, I tried again after reading an article at AnandTech: HOWTO: Use Linksys WRT54G as a Wireless Ethernet Bridge.

I downloaded all of the firmwares on www.dd-wrt.com, but only one firmware I tried, as the documentation told me to try the generic version first. After resetting my router, I saw the web menus of the router changed totally. There are more options/features available, but I was just concentrating on how to make my Linksys router could communicate and act as a bridge to my NETGEAR router as the Internet Gateway router.

I disabled all security settings, make ESSID and channels on both routers the same and then add MAC address of Linksys router in the NETGEAR's Allowed Address List. After that, I selected AP on Linksys. I checked the status, but still Linksys showed the signal is 0 dBm. After disabled security, surprisingly, after I check network status on the Linksys, it showed there was some signal. Cool, I said. But, still it did not get any IP address from NETGEAR.

I then bravely select "client-bridged", and it worked now! But I still don't know how to connect to my Linksys router, because it is now acting as a bridge and there is no IP assigned it. It is acting as a transparent bridge (connecting to NETGEAR wirelessly), and my other PC connected to the Linksys got assigned IP address from the NETGEAR.

Anyway, I am now happy because I can now used it to bridge other PCs which do not have wireless cards and the location inhibit them to connect to the Internet router by wire. I still don't know whether this wireless bridge really works as a bridge (able to connect more than one wired PCs to other PCs connected to another router) or just acts as a 'extender'. Will post again later after I've found out.

Monday, January 9, 2006

Game Emulator

A number of open-source developers has established a project called "Multiple Emulator Super System" (MESS) to develop an emulator to make Linux PC able to play old games. Sounds cool, heh?

The Official MESS Home Page

Here are some screenshots of the page. Look at those games, man...they are really old (some of them are like pre-historic games :-)

http://www.mess.org/messscrs.html

Saturday, December 31, 2005

AMD64 3400+ is faster than Pentium EE?

I just realized that my AMD 6400+ laptop was actually faster than Intel's Pentium Extreme Edition 3.72 GHz CPU after reading the following link:

http://www.tomshardware.com/2005/11/21/the_mother_of_all_cpu_charts_2005/page24.html

Wednesday, December 28, 2005

Connecting Holux GM-210 GPS Receiver to Laptop

I bought my portable GPS receiver a few years ago. It was designed to connect to my Sony CLIE NX80V PDA. Somehow, since then I almost never used it. Perhaps because it was too cumbersome to put in my card. I thought I could connect to my laptop, but no it couldn't, because the connector is different.

Now, somebody has posted a way to connect it.

http://astro1.panet.utoledo.edu/~igor/GPS2Clie.html

Some Optimization Flags on GCC

Yesterday, I was playing around with some optimizations options supplied by GCC (ver 4.0.2) on my AMD64 laptop. I created a very small code to compute sin(x) * cos (x). As we know, Pentium and newer processors support a FP machine code to compute these two functions simulatenously in single mnemonic code: FSINCOS.

the code is as follow:

#include

inline double fsincos(double x)
{
return sin(x)*cos(x);
}

First, I compiled it to assembly source with no optimization enabled, just using defaults as follow:

> gcc -c -S fsincos.c -o fsincos.s

and then open the generated assembly code in fsincos.s. Overthere I saw somewhere it called internal library functions for sin and cos trigonometry functions as I expected. I then recompiled it with full optimization flags enabled:

> gcc -c -S -mtune=athlon64 -mfpmath=sse -msse3 -ffast-math -m64 -O3 fsincos.c -o fsincos64.s

Suprisingly, it still called GNU's "sin" and "cos" math functions!. What? I said (not loud, though). I checked again the gcc man page, nothing special about these things. Hm....let's try to add "387" in the mfpmath, I said in my mind.

So, the command is now as follow:

gcc -c -S -mtune=athlon64 -mfpmath=387,sse -msse3 -ffast-math -m64 -O3 fsincos.c -o fsincos64.s

Voila! now the assembly code called inline FP code "fsincos" in it. Since then, I add an environment variable in the enviroment as follow:

export CFLAGS="-mtune=athlon64 -mfpmath=387,sse -msse3 -ffast-math -m64"
export CPPFLAGS=$CFLAGS

X86_64 Assembly Nightmare

A few days ago I was trying to compile mpg123 application. It is a command-line MP3 player. I begin with command:

make help

It gave some options. First I tried "make linux", still failed to compile with a bunch of errors. I then tried "make linux-3dnow", or "make linux-3dnow-alsa". All of them failed to compile at some assembly files (*.s). I look at one of the assembly-code files, and saw that the codes were designed for 32bit platform, while my laptop was running x86_64 Suse v10.0 (64-bit Linux). I did change "pushl %ebp" etc. to "push %rbp" etc., the compiled went OK, but when I tried to run the program, it crashed with segmentation fault message.

Hmm...I then went to AMD website and download all the documentation. These PDF documents are huge (each PDF file has more than 300 pages). I started reading one of them. Will post any progress later.

Stay tuned!