mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* x86 weirdness
@ 2012-07-30 22:36 Erwin Rol
  2012-07-31 10:49 ` Erwin Rol
  0 siblings, 1 reply; 7+ messages in thread
From: Erwin Rol @ 2012-07-30 22:36 UTC (permalink / raw)
  To: barebox

Hallo,

after I had successfully "ported" barebox to about 5 different embedded 
x86 (mostly N270 and Z510 Atom boards) I ran into problems with a 
Celeron SU2300 CPU based board. After a lot of trail and error, which 
included the implementation of a BIOS based console cause the board does 
not have a RS232 port, it looked like the global variables were not what 
I expected them to be, namely zero.

So in arch/x86/boot/main_entry.c i changed to following;

/**
  * Called plainly from assembler that switches from real to flat mode
  *
  * @note The C environment isn't initialized yet
  */
void uboot_entry(void)
{
#if 0
         /* clear the BSS first */
         memset(__bss_start, 0x00, __bss_stop - __bss_start);
#else
         unsigned char* ptr;
         for (ptr = __bss_start; ptr < __bss_stop; ptr++)
                 *ptr = 0x00;
#endif


         start_barebox();
}


After doing that it works. I have not yet looked into the resulting asm 
to find the differences, but could someone have an explanation for why 
the memset doesn't work and the simple loop does work?

- Erwin







_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-07-31 17:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-30 22:36 x86 weirdness Erwin Rol
2012-07-31 10:49 ` Erwin Rol
2012-07-31 13:13   ` Sascha Hauer
2012-07-31 15:16     ` Erwin Rol
2012-07-31 15:51       ` Jean-Christophe PLAGNIOL-VILLARD
2012-07-31 16:16         ` Erwin Rol
2012-07-31 17:07       ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox