本文共 1371 字,大约阅读时间需要 4 分钟。
Redboot is a choice for us if we need to implement our boot loader without do it all by ourselves. It is a portion of eCos package and we get the whole eCos pacakge when we want to get redboot source code. The cross-tool is also included in such a package.
We get all source code of eCos including its of redboot. In fact, we do not need so much more and we may lose in so much more code. We only need to care for hal, redboot and a few other subtrees, for example services which provided compress/uncompress algorithms.
The real entry of redboot is reset_vector in /ecos/packages/hal/xxx/arch/current/src/vector.S. After some simple iniitializations such as MMU configuraiton or memory controller initializaiton, then transmit the control to cyg_start which just likes the main entry for c program. The cyg_start is in /ecos/packages/redboot/current/src/main.c.
All jobs are dealt in cyg_start. Firstly, it will do some initializaitons such as memory size configuration,workspace configuration. And then executes all routines in __RedBoot_INIT_TAB__ section. At this point, all hardware and software initializations are completed. The following job is its duty, loading application. If there has a script and auto loading script enabled, the script will be executed. After procedded the script, the command line loop is started and then we can key in these commands now.
转载地址:http://vknfb.baihongyu.com/