How to edit the Firmware of WGR614 router

33 posts / 0 new
Last post
Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
How to edit the Firmware of WGR614 router

Hi ! 

I have compiled the tomato code for WGR614L router using the guides given in this website.

I have used the Tomato 1.25 firmware & source code for netgear WGR614L 1.0 

I
just want to know that how could i be able to make any changes in the
code for customizing the firmware according to my needs ?

I want to make changes in the firmware and then updat these changes into my WGR614L router.

 One more thing I would like to ask is that is it possicble to make a backup of the orignal firmware in the router. if so, then how ?

Kindly help me in this regard.

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
Thanks a lot for your reply.

Thanks a lot for your reply. I understand what you are talking about but isnt there any IDE in which the code could be developed. I mean I should be able to write the code and could see the output immediately.. kind of a simulation.

Otherwise, it could take quite much time to create the image every time i edit the code.

and I am talking about original firmware of Netgear. you can say the factory built firmware so that if i could make any weird changes then i could be able to use the backup to restore default firmware.

and about that brief overview of the code. I have seen this post from you. Its really a nice one. But i m an ordinary programmer not so expert therefore can you tell me that can i get the complete description of the code from anywhere.

retro98
retro98's picture
Syed Yasir Imtiaz said:

Syed Yasir Imtiaz said:

One more thing I would like to ask is that is it possible to make a backup of the original firmware in the router. if so, then how?
Kindly help me in this regard.

The procedure from the posting link below backups the flash contents as raw binary files.

http://www.myopenrouter.com/forum/thread/10807/Factory-Reset-breaks-moun...

The other backup methods available are:

  • serial console commands
  • jtag

though these other methods require hardware additions/mods to the router.

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
Thanks a lot for your reply.

Thanks a lot for your reply.

What about the IDE in which the code could be developed...is there any IDE in which i could be able to compile the code and see the immediate results without making the image file.

retro98
retro98's picture
Syed Yasir Imtiaz said:

Syed Yasir Imtiaz said:
Thanks a lot for your reply.
What about the IDE in which the code could be developed...is there any IDE in which i could be able to compile the code and see the immediate results without making the image file.

For IDE, you'll probably have to build your own equivalent. Projects for Linux that might help include cscope, kscope, and kdevelop.

I'm doubtful that you'll be able to see immediate results (by executing the code) especially if your development platform is a Intel/Amd based PC. To execute the cross-compiled code outside the router hardware, you'll need to find a simulator for the router's MIPS processor. Not only that, you'll need to also simulate the router's hardware (its eth switch, radio, buttons, etc). I don't think a wgr614l simulator currently exists.

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
hmmmmmm.... so how the

hmmmmmm.... so how the developers write code for the Tomato firmware and for the router ? Do they follow the same method of making the .chk file every time they make a minor change ?

I have seen that there is a Tomato GUI made in Java. Is that something else ?

retro98
retro98's picture
Syed Yasir Imtiaz said:

Syed Yasir Imtiaz said:
hmmmmmm.... so how the developers write code for the Tomato firmware and for the router ? Do they follow the same method of making the .chk file every time they make a minor change ?
I have seen that there is a Tomato GUI made in Java. Is that something else ?

I can only speak from similar experience working with Linux and drivers on PC platforms. I haven't (yet) experimented with changing or patching the router firmware.

For working on kernel modules, or application layer binaries, those can be loaded into a running router for testing, via network transfer, cifs/smb, or jffs (flash file system). After all, Linux is running and the busybox shell is available. So there's no need to build *.chk files for these cases, until the final code is ready for release in the firmware image.

If you plan to work on the core kernel itself, the development situation is more tricky. I think it's possible to direct the router's CFE boot loader to load a kernel image from network to RAM or some other source. Then you access the hardware serial console port for diagnostics and debug. You'll still have to build a kernel image to load, but you may not need to overwrite the flash content.

For anything made with Java, I believe the code really executes in the user's browser rather than at the router. I doubt there's enough resources available on these routers to support a JRE or running Java code.

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
Can you suggest me that from

Can you suggest me that from where i could read about the serial console ?

I dont have any idea about that.. What i understand is that it would be a method by which the firmware could be upgraded using hardware programming.

Secondly, kindly tell me is there any guide available to make a backup of the orignal firmware of my router. As you have said that if i could build a wrong firmware then it would be disaster fro me :) ... so in that condition i should at least have a backup of the orignal firmware.

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
One thing that I would like

One thing that I would like to ask you about the code is that:

I have downloaded the Tomato 1.25 Firmware & Source Code for NETGEAR WGR614L 1.0 which is been uploaded by you and have successfully generated the .chk and .trx file. It really was a good addition :)

What I want to ask is that:

By running the script it downloads the source code of WRT54GL router. Why is it using the WRT54GL. Because it should use the code of WGR614L router.

What is the difference between Tomato 1.25 Firmware source code and WRT54GL source code.

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
Thanks for your reply...

Thanks for your reply...

I have checked the above link for the original image but it says that The page you have requested was not found.

My router firmware version is v1.1.11_6.0.36

I have seen that it is available in the netgear website in this link:

ftp://downloads.netgear.com/files/GPL/WGR614v8-V1.1.11_6.0.36WW_src.tar....

Would it be the original firmware. Means that can i rely over it ?

Secondly... you have told to use the command "outputimage"
where should i write that ?

one last question is that kindly tell me serial console. Where should i read about that ...

Thanks in advance !

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
Thanks a lot ... its really a

Thanks a lot ... its really a helpful information for me :)

but the firmware you have mentioned is: firmware update v1.1.2_1.0.23

but my version is v1.1.11_6.0.36 ...

If in any case, i would destroy me original firmware i.e v1.1.11_6.0.36 then will it be suitable for me to install the firmware you mentioned ?

retro98
retro98's picture
Syed Yasir Imtiaz said:

Syed Yasir Imtiaz said:
Thanks a lot ... its really a helpful information for me :)
but the firmware you have mentioned is: firmware update v1.1.2_1.0.23
but my version is v1.1.11_6.0.36 ...
If in any case, i would destroy me original firmware i.e v1.1.11_6.0.36 then will it be suitable for me to install the firmware you mentioned ?

The Netgear product support site offers the *.chk image files for both the latest and older official firmware releases for your router.

http://kb.netgear.com/app/products/model/a_id/2590

The *.chk for 1.1.11_6.0.36 is available there. My advice... never, ever, down rev any firmware to releases earlier than the one that's factory installed. Any hidden hardware and firmware rev incompatibility can potentially brick your router. I think what's more important is to backup your router's boot loader and board data, since those are unique to your router, or difficult to find downloads for.

Without a serial console, you can still gain access to the router's command line interface via telnet with the telnet enable utility (for netgear firmware only), and run the outputimage or tftp commands that way. The earlier replies to you about backing up firmware already included those instructions.

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
Ok ... thats really a useful

Ok ... thats really a useful information for me.

As i have told earlier that I am a novice programmer so can you do me a favour please.

Kindly tell me all the commands that i have to write using the telnet utility to backup my routers firmware or boot loader and board data.

the commands that you posted in the earlier reply do not include the outputimage command therefore kindly tell me all the commands that are neceassary to make a backup.

Thanks in advance

retro98
retro98's picture
Syed Yasir Imtiaz said:

Syed Yasir Imtiaz said:
Ok ... thats really a useful information for me.
As i have told earlier that I am a novice programmer so can you do me a favour please.
Kindly tell me all the commands that i have to write using the telnet utility to backup my routers firmware or boot loader and board data.
the commands that you posted in the earlier reply do not include the outputimage command therefore kindly tell me all the commands that are neceassary to make a backup.
Thanks in advance

The only important router command I needed was tftp. I did not use or look at outputimage at the time. The contributor from  Netgear may be able to comment further on the outputimage. You can also try running command yourself to see if it prints any help or description.

Here's my backup session below. How to restore from these backups is an entirely new project which I haven't looked at.

$
$ # This prompt is Solaris Unix with host IP 192.168.1.10. This host runs a previously configured tftp server.
$
$ # The telnetenable utility for Solaris is available in the download section of http://www.myopenrouter.com/
$
$ # Unlock the router's telnet server
$ ./telnetenable 192.168.1.1 001E3A04E2EB Gearguy Geardog
$ # Telnet to the router
$ telnet 192.168.1.1
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.

BusyBox v0.60.0 (2008.05.15-10:32+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

# help

Built-in commands:
-------------------
        . : break cd continue eval exec exit export help login newgrp
        read readonly set shift times trap umask wait

# version
Release version : Netgear Wireless Router WGR614v8
                  U12H07200/V1.1.11/6.0.36NA
           Time : May 15 2008 18:35:41
# cd /tmp
# # format of tftp command: tftp <put command> <source file> <destination ip>:<filename>
# # "boot"
# tftp put /dev/mtd/0ro 192.168.1.10:mtd0-cfe
# # "linux"
# tftp put /dev/mtd/1ro 192.168.1.10:mtd1
# # "rootfs"
# tftp put /dev/mtd/2ro 192.168.1.10:mtd2
# # "T_Meter1"
# tftp put /dev/mtd/3ro 192.168.1.10:mtd3
# # "T_Meter2"
# tftp put /dev/mtd/4ro 192.168.1.10:mtd4
# # "POT"
# tftp put /dev/mtd/5ro 192.168.1.10:mtd5
# # "board_data"
# tftp put /dev/mtd/6ro 192.168.1.10:mtd6
# # "nvram"
# tftp put /dev/mtd/7ro 192.168.1.10:mtd7
# exit

Connection to 192.168.1.1 closed by foreign host.
$ # Check that this host's tftp server actually received the router's data
$ ls -la /tftpboot

Stephen
Stephen's picture
Is serial console the only

Is serial console the only way to recover the router? Will telnet still work if the router was corrupted by a wrong modification in the source code?

Stephen
Stephen's picture
Is serial console the only

Is serial console the only way to recover the router? Will telnet still work if the router was corrupted by a wrong modification in the source code?

achilles
achilles's picture
If you have bricked the

If you have bricked the router , telnet will not work bcoz u will not be able to access the router or its lan interface ....
The only way is to use a serial cable , enter its boot prompt and flash a proper f/w ....
Although the boot environment provides an ethernet iface but it's of no use for telnet ...

Stephen
Stephen's picture
No. My router is not

No. My router is not corrupted yet. I just ask this question in advance, since getting connection with serial cable seems very complicated. You need do some solder work yourself...
Actually, I am trying to plant an IDS called Snort into the firmware, but I don't know how yet. First, what version of firmware shall I use, the original firmware version v1.1.11, DD_WRT, or tomato? I don't know exactly the difference between the 3 firmwares. Could you tell me? Thanks!

Stephen
Stephen's picture
Thanks for the explanation of

Thanks for the explanation of the 3 firmwares! I will pick the original netgear source code. As you said, it uses Linux kernel-2.4.20. It's easy to compile and run Snort on a PC with Linux OS, since Snort runs in user space, rather than kernel space. But how can I integrate Snort code into netgear source code? Where to put Snort code? And how to compile it with the kernel? Do you have any suggestion on this? Thanks!

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
I want to access the wireless

I want to access the wireless part of the router... but i have seen that there is no code for wireless instead only the object files are present..

Can anyone tell me that how could i access the wireless part of the code ??

achilles
achilles's picture
U can't get the source code

U can't get the source code for wireless part ... broadcom provides only object files.. anywaz y wud u need to access the wireless code if u already have a compiled driver at ur disposal .....

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
Actually I want to know the

Actually I want to know the inner functionality of each and every part of the code. You can say that I want to make a documentation so that if I need to edit the code I would know that in this particular folder I have to edit this particular file.

Therefore I asked about the wireless part that I could not find any code.

Anyhow Can you tell me that can i know what is the purpose o different files in the wl folder like:

wl_apo
wl_apsta
wl_sta

etc

Secondly is there any tool through which i could generate the documentation of the code. You would know there are tools that extract the comments and function prototypes from the code so that a documentation is available to understand it.

achilles
achilles's picture
Right now I dnt know abt the

Right now I dnt know abt the tools that u can use for ur purpose but there must be something for this .... If I get any info in this regard I will let u know ...
As far as wl_sta , wl_apsta etc are concerned they are wireless drivers for diffent purposes ... for example if u want to have a wireless driver intended for client mode only u will choose corresponding option in .config and wl_sta.o will be used as wireless module ... similarily if u want to have functinality of both an AP and a station then wl_apsta will be used ...

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
Thanks :)

Thanks :)

But how do you know all this.

I mean there is no code mentioned only the file names.

I am just a beginner to understand the code of the router.

I want to know what each and every file does, just like you ..

you have mentioned about 2 files that what they do, what about the others. should I ask from you about each file :) ???

isnt there any documentation ??

achilles
achilles's picture
These things u will know by

These things u will know by working with the code and also looking at different parts of the code , documentation etc ....
You can ask us watever doubts u have ... the community is here to help ...
As far as documentation of the entire distribution is concerned ...I have not seen anything of such type till now ....
Most of the time I rely on google or on this site for info ....
All d best ... and keep us posted ... :)

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
okkk ... so i have to learn

okkk ... so i have to learn it :)

for the time being i am trying to understand the wireless part of the code.

I want to know what all these files do and in which conditions they are used:

wl_ap
wl_ap_onchip_g
wl_apsta
wl_apsta_onchip_g
wl_sta
wl_sta_onchip_g

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
One more thing i want to ask

One more thing i want to ask is that I have found some wireless code in this directory..

src\linux\linux\drivers\net

is this code somehow different than the one we are talking... what is its purpose ?

achilles
achilles's picture
The code that u have found is

The code that u have found is generic wireless code .... the h/w specific code I mean the wireless driver is not provided as source file ...
The code that u r talking abt is part of linux wireless support and is platform independent .....

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
Ok thanks for explaining the

Ok thanks for explaining the difference between these 2.

As I told earlier that I want to know what all these files do and in which conditions they are used:

wl_ap
wl_ap_onchip_g
wl_apsta
wl_apsta_onchip_g
wl_sta
wl_sta_onchip_g

I want to know that how these files are used in other parts of the programs. As they are object files so how could i know that what are the different functions present in these which we can access, what will be their parameters etc.

Do you have any idea ..

achilles
achilles's picture
As I told earlier all these

As I told earlier all these files are wireless drivers and are used as per ur usage ..... like AP mode , STAtion mode or both i.e APSTAtion ...
Which files will be used depends on what configuration u r choosing while building the kernel .....
I dnt have much idea abt the files with '_g' suffix ... most probaly they are specific to g mode ....
Also all these files are network drivers so I could not understand what u mean by usage of these files in other parts of the code .....
Moreover if u want to do some set/get of parameters related with wireless drivers u can use different wireless configuration tools like wl, iwconfig etc .....

Syed Yasir Imtiaz
Syed Yasir Imtiaz's picture
Actually My task is to

Actually My task is to explore the Wireless part and give a report on what its different files are doing.

what i mean by wireless part is that there are different modules of Router implemented like ethernet, PPP etc. In the same way there could be wirelless part of the code that deals with how different computers communicate with the router wirelessly.

Do you have any idea about that ..

i m quite confused now

Pages