[U-Boot] RFC: Testing U-Boot Part 1

Simon Glass sjg at chromium.org
Sat Aug 27 02:29:18 CEST 2011


Hi Mike,

On Fri, Aug 26, 2011 at 1:59 PM, Mike Frysinger <vapier at gentoo.org> wrote:
> On Friday, August 26, 2011 00:36:15 Graeme Russ wrote:
>> On Fri, Aug 26, 2011 at 1:32 PM, Simon Glass wrote:
>> > 4. When I create a driver, like the serial test driver, should that be
>> > serial_test.c, test_serial.c, sandbox_serial or something else?
>>
>> I guess you'll have /drivers/serial/sandbox.c, /drivers/net/sandbox.c
>> etc.
>>
>> /include/configs/sandbox.h will need to include defaults for how
>> these devices are configured. For example, you may want to have
>> the sandbox serial go to /dev/ttyS0 or /dev/ttyS1
>
> since we get a main() entry point, we can make these into runtime flags

Yes that's the plan.

>
>> Make sure that printf() goes through U-Boot printf() not the host's libc
>
> u-boot already takes care of this by running the linker directly.  it is the
> compiler driver (i.e. `gcc`) that adds the implicit -lc and friends.

My plan is actually to have a minimal link script and mostly do things
as the native compiler intends.

>
>> And have you dealt with putc() and getc() hooking so that the U-Boot
>> stdio can go to either the hosts stdio or a serial port?
>
> that would be the problem of the sandbox serial driver, and i dont think it'd
> be that hard.  simply use read/write syscalls directly :).

Yes - I am thinking of an os.c file which contains the OS interface -
it will include Linux headers and no common.h, so avoid conflicts.

Regards,
Simon

> -mike
>


More information about the U-Boot mailing list