This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] add option to override redboot abort script check


Andrew Lunn wrote:
On Mon, Aug 25, 2008 at 10:02:37PM -0400, Jose Vasconcellos wrote:
This patch factors out the test for ^C that is used to bypass the start-up script.
By creating the function redboot_abort_script and declaring weak, it's possible
to easily replace it for custom needs.


In my case, there's no easily accessible serial port so get to the redboot prompt
telnet is used. However, if there's a boot script, there needs to be a way for the
user to abort it in an easy manner. So, in my platform specific code, the
redboot_abort_script is replaced by code to check for to see button if a button
is pressed.

What i don't like about this is that it removes the normal ^C handling. For you that is probably O.K. however in other situations, it would be better to add additional mechanism, rather than replace mechanisms. So in the field you can use a jumper on a GPIO, but the developers desk which does have a serial port, maybe via a bed of nails, can continue to use ^C etc.

Indeed, the initial discussion did not mention using weak functions (although I suspected this). I'm also not keen on a wholesale replacement.

Redboot makes a lot of use of HAL tables, eg for adding new commands,
idle handlers, etc. What i would suggest is adding a new table for
script abort functions. The ^C handler would be the first entry in the
table. HALs or other packages could then add more entries, eg read a
GPIO line etc. If any of these functions return true, the script is
aborted.

Another possibility would be to use a HAL defined macro, in the same spirit as HAL_MEM_REAL_REGION_TOP which is used in that same file (main.c)



--
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]