User Tools

Site Tools


doc:devel:hw.hacking.first.steps

Hardware Hacking First Steps

You bought yourself a new router, and it's nice. You can connect a hard disc to it and then it shares it's content over samba. It even can do torrent. Wow. But then you stumbled over OpenWrt and it's 2000 packages you can install just like that. Never mind all the other FOSS software you could compile for it. And you started crying and decided: you neeeed OpenWrt on your router. And if your router is already supported, dandy, flash it on and have fun. But if your router is not (yet) supported? Well, then do this:

Gain Access

  • you could login to some unix shell after booting, over Ethernet with telnet/ssh. Example: hacking.dockstar (dockstar)
  • you could login to bootloader console while booting, over Ethernet or over the Serial Port
  • you could access the hardware without any booting, without any software present, over the JTAG Port with JTAG Software, like HairyDairyMaid

Gather Information about Hardware

  • Depending on the bootloader that is being used, you could utilize different commands to gather hardware information. Please see the manual for that particular bootloader to get this done. Once you have the information you could keep it for yourself or post it online. Depending on how fast you are, there probably is going to be information regarding this already available or you are the first one. This simple step is necessary because the manufacturer usually does not document exactly what hardware has been installed. Now with this information you are going to use google or the search engine of your choice, to see what GNU/Linux drivers are available, and if, in which kernel version they have been integrated into. For example:
  • http://en.wikipedia.org/wiki/Comparison_of_open_source_wireless_drivers#Linux you can see, since which or until which Kernel version drivers for wireless radio circuitry, has been integrated.
  • But of course there is much more to a system, in this case in form of a SoC, then the wireless drivers. Anything needs drivers. For example the VLYNQ needs to be supported by the Kernel. etc. And you are done. If you really want to continue, you could find help here:

Oh, you should also learn a programing language, like C.

Gather Information about Software

  • bootloader This is probably going the first piece of software you are going to notice. But the rest of the system could be of interest as well:
  • Most probably it's a kind of outdated GNU/Linux Kernel with FOSS drivers or with binary only drivers or both. Then you are lucky, because the source code of the Linux Kernel is licensed under the GPLv2 and this constrains the seller to make the modified source code, if he actually bothered to modify anything, and he probably did, available to the customers (and not necessarily to the public) free of charge.

Now maybe the drivers for the components have already been integrated into mainline kernel, which means that a newer kernel should work on this device out of the box. If not, you could continue to use the one, from the manufacturer. So combine this kernel with other FOSS software, you want to run on it… ;-)

  • In case the manufacturer did not use a Linux Kernel but some kind of *BSD, you're fucked, since the license the *BSD sources are under are not GPL. This particularly means, the usurper does not have to make source code available. He could, but he doesn't have to. Oh may you have much "fun" with *BSD. :-P

Gather Information about Flash Layout

overall Flash Layout

The overall Flash Layout looks like the Example. Simply an overview over the different MTD-partition there are. And what their meaning is.

precise Flash Layout

This is more tricky, here you want to know exactly what is written on the flash: flash.layout

The data could be zipped or g'zipped or even be encrypted. Also, there is going to be some number's between the data blocks, like CRC or whatever.

Software Development

Now you want to run you own Software on your device. Maybe it's hardware has already support in some projects or in the mainline kernel. If not, then consider adding a new device or a complete new platform to develop software for. Please do not bother developers or potential developers to write code for this. Present the information you gathered, if it interesting enough, somebody is going to do that ;-) Now to write code, the developer needs only some bread and water and a simple text editor, but to test this code, he's going to need the hardware itself. You could donate or maybe just lend the hardware.

Add Device

Add Platform

Software Development

The homepage needs no cookies, no javascript, no nothing enabled. It simply works. ;-) It is available under the Creative Commons BY-SA license:

doc/devel/hw.hacking.first.steps.txt · Last modified: 2013/03/22 03:20 by jeq