April 25, 2017

Hacking U-Boot (studying the sources)

U-Boot is supplied as a source tree containing approximately 4 billion source files. Trying to study the source using grep and an editor quickly becomes frustrating. Using ctags can be a big help. What I have found useful is to make a list of the source files actually used to build the copy of U-Boot I am running.

If you configure and build U-Boot, the object files (*.o files) serve as sort of breadcrumbs to find the actual source files used in the build. This is no help as far as the header files, but it is a great aid nonetheless. I wrote a ruby script to locate all of the object files and then the source file that gave rise to them. All told for the orange pi, this reduces things down to 227 files, which is a lot more manageable than the full U-Boot source tree.


Have any comments? Questions? Drop me a line!

Tom's electronics pages / tom@mmto.org