This is kinda bugging me. How do you write new firmware or a patch like your doing with OpenWRT. Wouldn't you have to know the assembly language for that specific processor which only the manufacturer would know? What are you essentially doing when you install and/or patch your router with OpenWRT? If you could just give me a general "how this works" that would be great.
Topic: How does OpenWRT work?
The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.
Snowman:
Virtually all chipset vendors provide the manufacturers what's called a BSP-- a board support package. The BSP is a bunch of memory settings for various peripherals on a board. They also provide the manufacturers with a bootloader containing the CFE. A bootloader is a very thin hardware abstraction layer that reads the BSP and then launches an operating system (e.g., like Linux or VxWorks) with the correct system information.
If you look around in the forums, you will see references to CFE and Redboot, for example. These are bootloaders. The chipset vendors may have many different similar chips, so they customize the BSP for each and put them on the bootloader. It is easy to do and it makes it easy to support multiple board types with a single chipset with different peripherals (often called reference designs).
It is also easy to customize the bootloader to run on similar chipsets. For example, the Broadcom BCM6345, BCM6348, BCM6338, and BCM6358 all use the CFE. Each reference design has a different board type. For example, there are BCM96348R, BCM9638GW, BCM968GWV and so on.
Having chipset vendors provide a BSP and bootloader along with reference designs, schematics and working OSs like Linux and VxWorks makes it relatively easy to port OpenWRT to a new platform without having to know or use any assembly code or even have the datasheet (but it really helps). So, when a new board emerges using the same processor and switch and wireless chips, its a matter of figuring out the memory addresses from the running system, a bit of trial and error to put a similar code base used in a working board, and essentially doing a lot of testing to verify that various existing drivers work on the new board.
Where it gets fun is when there is NO code for drivers for a peripheral... then the datasheet for the peripheral (e.g., the WLAN chipset or DSL PHY) is a must, otherwise, that part of the board is dead unless the chipset vendor provides a binary object that works with a wrapper to allow the OpenWRT or other software to use it properly. With the datasheet, and some starter code, a driver can be written over time to replace the chipset vendor's proprietary driver. Such is the case with most wireless chipsets today. Both Atheros and Broadcom chipsets have free or Open Source (FOSS) projects dedicated to supporting the chipsets on OpenWRT. In some cases, there are multiple projects so you have a choice.
I hope this helps your understanding.
marc.
(Last edited by marca56 on 19 Mar 2009, 01:01)
The discussion might have continued from here.