This is a hard­ware mod for your WRT54G to dou­ble the RAM from 16MB to 32MB. This was tested on a v3.1 unit but should also work on v3.0 and v4.0 (which is just the same as the WRT54GL).

If you intend to use your WRT54G just as a wire­less access point and router, you are prob­a­bly not inter­ested in this mod. If, how­ever, you unleashed the full poten­tial of this sub 100$ “mini-computer” by installing one of the many Linux dis­tros (e.g. Open­WRT), you may sooner or later real­ize, that the stan­dard 16MB may not be enough for your pur­poses. For exam­ple “nmap –sS” will ter­mi­nate with an error mes­sage “Killed” which is due to lim­ited memory!

Get ready for some seri­ous sol­der work to expe­ri­ence the full poten­tial of your WRT!
I became inter­ested in those WRT’s because I needed a fire­wall for my lap­top com­puter at the uni­ver­sity (“what the hell does the best cor­po­rate fire­wall help you, when there’s hun­dreds of peo­ple behind which are com­pletely unaware of com­puter secu­rity and will hap­pily let spread the desease from within?”). So I bought a WRT54G v3.1 for CHF 99.- (~€65.-) at a local hard­ware store and as an old Linux afi­cionado, log­i­cally I installed Open­WRT.

The WRT became sort of a hobby and soon its capa­bil­i­ties expanded from being “just” a fire­wall to improved stor­age (SD/MMC card mod) and con­nec­tive capa­bil­i­ties (Dual Ser­ial Mod), intru­sion detec­tion sys­tem (snort), wire­less net­work snif­fer (kismet) and net­work prob­ing tool (tcp­dump). I also installed RRD­tools to mon­i­tor all the cru­cial para­me­ters of the device. One thing that struck me when check­ing the RRD sta­tis­tics was that the RAM of the device was almost con­stantly at limit. Cer­tain appli­ca­tions (e.g. nmap) would also sim­ply refuse to work.

In search to alle­vi­ate this prob­lem, I found out on linksysinfo.org that the PCB lay­out of my G v3.1 was exactly the same as the the one of the WRT54GS v2.0, a ver­sion with dou­ble the flash and RAM mem­ory, which was unfor­tu­nately not avail­able when I went shop­ping my G (and I think they don’t pro­duce them any­more). Some more research revealed that the firmware and the boot­loader (which deter­mines the avail­able RAM at bootup) were almost iden­ti­cal. The sim­i­lar­ity in hard– and soft­ware led me to believe that apart from the mem­ory chips, these were in fact exactly the same units! It should there­fore be pos­si­ble to upgrade the G to the con­fig­u­ra­tion of a GS, thereby dou­bling its RAM capacity!

This indeed turned out to be true :)
All you have to do is to replace the RAM chip. The exact steps which are involved, are:
1. find a suit­able RAM replace­ment chip
What we are look­ing for is a 16Mx16 chip, which means it has 16 mil­lion addresses each with a 16bit word, i.e. a capac­ity of 256Mbit or 32MByte. You will find these most prob­a­bly on DDR SO-DIMMS, as they have nor­mally 4 chips per rank/side (the mem­ory data bus of a PC is 64bit wide, divided by 4 chips, this gives 16bit per chip). You have to exactly iden­tify the chips and check their spec­i­fi­ca­tions. Impor­tant para­me­ters: TSOP-II 66pin pack­age, 16Mx16bit (4 banks). I found my replace­ment, a Hynix HY5DU561622CT-H from a 128MB SO-DIMM which con­tained 4 of those chips:
WRT54RAM_Hynix

2. iso­late the RAM chip from the SO DIMM
You have to be very care­ful not to destroy it. Use a tem­per­a­ture con­trolled SMD sol­der iron, “Soder-Wick” and an SMD shim blade (a very thin steel-band) to des­ol­der the indi­vid­ual pins of the TSOP. A hot-air sol­der sta­tion is ideal, but not required. After you have detached the chip, care­fully con­trol the leads and if nec­es­sary bend them into proper align­ment.
3. remove the old (16MB) RAM chip from the WRT
As we have no use for this any­more, you could cut the leads which makes removal much more easy. Be care­ful not to detach the sol­der pads from the PCB! The result will look some­thing like .

4. install the new (32MB) RAM chip
You will need a very thin SMD sol­der tip, des­ol­der­ing braid and a mag­ni­fy­ing glass to check the result. Every lead has to be attached clearly to the sol­der pad with­out any inter­con­nec­tions between the leads, like ! Dou­ble and triple check the result!
5. boot your router and see if it works
IF it works, chances are good that you now have 32MB of RAM at your dis­posal, which is plenty for fur­ther projects ;)

Dis­claimer: I can­not be held respon­si­ble for dam­ages which result from car­ry­ing out this pro­ce­dure. It worked for me, but you are com­pletely on your own if you decide to do it. Need­less to say that this will void your prod­uct warranty.