全部博文(116)
分类:
2011-07-22 10:33:34
PSPBoot (or "the PSP bootloader") is a for the -based on / based on the () chipset. This bootloader supersedes the bootloader and can be found on both (AR7WRD and variants) using the TNETW1130 (ACX100) and TNETW1350A wifi chips, and non-wireless (AR7RD and variants) routers. The primary function of PSPBoot is to start (i.e., ) the for the router's firmware. Pspboot also has a built in server that is remarkably similar to the Adam2 ftp server. The Pspboot ftp server can similarly be used to access the router to do various things (e.g., upgrading the router's firmware). Pspboot also has a with its own set of commands. The command line can be accessed from a .
ContentsThe AR7 router family typically have chips from , , or , and some are manufactured by other companies but are compatible with the AMD chips. These chips are normally in - typically, "mtd0", "mtd1", "mtd2", "mtd3" and "mtd4"). In these routers, the bootloader is located in the mtd2 partition, which is normally 64kb in size. The mtd2 partition normally starts at 0x90000000 and ends at offset 0x90010000 on the flash chip. On a PSPboot router, the geometry of the flash memory (for a 4mb flash chip) may look like this:
The linux resides in the mtd0 partition. The resides in mtd1. The and the bootloader's reside in mtd3, while mtd4 (if present) holds the entire firmware.
The sizes and locations of the mtd2 and mtd3 partitions are normally fixed, and can almost invariably be found at the offsets listed above. Any departure from these is unusual in AR7 routers, and would most likely be problematic for the operation of the router, or for upgrades of its firmware.
Some manufacturers of AR7 routers (e.g., Acorp, Safecom) seem to support only one of Adam2 or PSPBoot in their firmwares, while some (e.g., , Solwise, Aztech) support both. Some third party AR7 firmwares such as and perhaps support both.
PSPBoot versusAs has been indicated, PSPBoot supersedes the older Adam2 bootloader. It is unlikely that any new AR7 routers using Adam2 are being made. PSPBoot is only slightly backwards compatible with Adam2. Each expects a linux kernel in a different format from the other, so that a kernel compiled for one will fail to load with the other. Furthermore, even though they both expect to reside in mtd2, load their kernel from mtd1, and load their environment variables from mtd3, the offsets for their mtd1 and mtd3 partitions are very different. This is not made easier by the fact that some (but not all) Adam2 mtd2 partitions are 128kb in size. Finally, many of the environment variables have different names between the two bootloaders.
A router with a modern firmware will not perform very differently whether it has Adam2 or PSPBoot. However, PSPBoot has the clear edge over Adam2 in some respects:
The PSP bootloader comes in a number of different versions (sometimes, varying according to the manufacturer of the router), each with different features enabled, and each supporting a specific flash chip. While the bootloader can be upgraded to a different version, it is not advisable - for the simple reason that, if something goes wrong with the upgrade (and there is a lot that can go wrong), the only way in which the router could be recovered would be through a interface. This is not a process for the faint-hearted, and normally requires extensive technical (and electrical) skills. Therefore only the very brave would venture to upgrade their bootloader.
The PSPBoot EnvironmentThe PSPBoot environment is located in the first 10kb of the mtd3 partition. This can be accessed in a number of ways. First, at the bootloader's own , the command printenvcan be executed to list the environment variables or any of them, and setenv can be executed to set/change the value of a specific environment variable. It is not possible under normal circumstances to access the bootloader's command prompt. The only way in which this can be done is to build a cable, and then interrupt the router's boot process at the serial console. Given the technicalities involved in such an enterprise, it is, unsurprisingly, not an option for most people.
With this in mind, the firmwares normally provide an to the relevant section of the mtd3 partition through a called /proc/ticfg/env. The usual method of accessing the PSPBoot environment variables is to to the router's firmware's linux , and read from or write to this "file". So for example, the command
/proc/ticfg/envwill display the contents of the environment. The command can be used to set/change the values of specific variables, so for example, the command
echo Version 3.5.5 > /proc/ticfg/envwill set the value of the environment variable "Version" to "3.5.5" (creating a new entry for the if it doesn't already exist).
The PSPBoot Environment VariablesThis is an example of a PSPBoot environment listing:
The list of routers with the PSP bootloader is too vast to reproduce in full. Below is a selection: