public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] Sandbox question
Date: Mon, 23 Apr 2012 17:32:37 -0400	[thread overview]
Message-ID: <201204231732.39040.vapier@gentoo.org> (raw)
In-Reply-To: <20120423211757.E8AD1200261@gemini.denx.de>

On Monday 23 April 2012 17:17:57 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > also, what you're proposing is changing the behavior of u-boot when it's
> > in the sandbox so that it acts less like the hardware.  when you run
> > u-boot on the hardware and it's sitting at the prompt, u-boot is running
> > the cpu at 100%.
> 
> Correct.  But then U-Boot is the only master of the CPU, and nothing
> else can be run in parallel.
> 
> In the sandbox, U-Boot is an ordinary user space application and as
> such is supposed to behave well.  Burning 100% CPU is a polling input
> loop is about the most stupid thing we can do.

not when you're aiming to act like the hardware whenever possible.  we 
specifically do not want #ifdef CONFIG_SANDBOX outside of sandbox-specific 
drivers if we can avoid it.  that means we are bound by the implicit 
constraints at the driver boundaries.  so if u-boot common code does:
	while (tstc())
		...
then sandbox should be eating the cpu.  however, it seems that the hush shell 
does while (getc()), so that shouldn't be an issue here.

> > > Why invent new methods when we can encapsulate this in the input
> > > interface?
> > 
> > i'm not inventing new methods.  i'm telling you that the sandbox OS layer
> > today cannot access the C library's errno because u-boot's own
> > implementation of errno is overriding it.  so any call sandbox makes to
> > the OS (like read() or select() or poll()) that results in an error,
> > sandbox has no way of knowing the underlying reason.
> 
> Than this needs to be fixed for sandbox?

the only way to fix it is what i suggested: rename "int errno" in lib/errno.c 
to something like "int uboot_errno" and then add to errno.h: "#define errno 
uboot_errno".  this shouldn't make any difference at all to compiled code.  the 
only difference is that people doing symbol debugging would get a different 
symbol name.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120423/1217b792/attachment.pgp>

  reply	other threads:[~2012-04-23 21:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23  6:41 [U-Boot] Sandbox question Wolfgang Denk
2012-04-23 15:41 ` Mike Frysinger
2012-04-23 17:32   ` Matthias Weisser
2012-04-23 17:39     ` Wolfgang Denk
2012-04-23 17:49       ` Matthias Weisser
2012-04-23 18:30         ` Wolfgang Denk
2012-04-24  9:25           ` Matthias Weißer
2012-04-23 17:58   ` Simon Glass
2012-04-23 18:39     ` Wolfgang Denk
2012-04-23 18:54       ` Mike Frysinger
2012-04-23 19:03       ` Mike Frysinger
2012-04-23 19:33         ` Wolfgang Denk
2012-04-23 20:57           ` Mike Frysinger
2012-04-23 21:16             ` Mike Frysinger
2012-04-23 21:17             ` Wolfgang Denk
2012-04-23 21:32               ` Mike Frysinger [this message]
2012-04-23 21:51 ` [U-Boot] Sandbox: auto exiting on pipe closure Mike Frysinger
2012-08-09 20:39   ` Wolfgang Denk
2012-08-10  0:47     ` Mike Frysinger
  -- strict thread matches above, loose matches on Subject: below --
2013-12-06 23:36 [U-Boot] [PATCH 0/8] Secure boot improvements and test on Beaglebone Black Simon Glass
2013-12-30  7:40 ` [U-Boot] sandbox question TigerLiu at viatech.com.cn
2013-12-31  0:42   ` TigerLiu at viatech.com.cn
2014-01-07 23:58     ` Simon Glass
2014-01-08  0:52       ` TigerLiu at viatech.com.cn
2014-01-08  3:46         ` Abraham Varricatt
2014-01-08 10:30           ` TigerLiu at viatech.com.cn
2011-12-01 16:35 [U-Boot] Sandbox question Andreas Bießmann
2011-12-01 18:13 ` Simon Glass
2011-12-01 19:21 ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201204231732.39040.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox