
Hi Daniel,
On Fri, Jul 19, 2013 at 1:49 AM, Rossier Daniel Daniel.Rossier@heig-vd.chwrote:
Hi Simon, (My first name is Daniel ;-)
I finally succeeded in booting u-boot on QEMU/x86 and even using tftp with networking. And thanks for your tips. First, I changed my version of qemu (from git back to 1.4.50) which solved the problem of eclipse/gdb. Now it works.
Then, using the "pc" machine of QEMU, coreboot defines the CAR address at 0x19200000 does not work on the emulated PC: when U-boot tries to writes all information required by the GDT, it does not write anything at this address: that explains why the system crashes on the instruction following the lgdt in setup_gdt (loading the GDT with all values at 0 makes any further access including code not possible).
So, I changed to 0x01200000 which still remains an accessible portion of RAM as configured by coreboot. I got the U-boot banner, but still with some crashes. The following bug concerned the use of rdtsc instruction which is not supported by QEMU yet. So I hardcoded a value like 0xf10 in get_tbclk_mhz() so that no access to tsc is necessary (ok, just for an approximation in a first time). I was able to the the u-boot> prompt.
I also added CONFIG_E1000 to have the network enabled (e1000 is supported by the "pc" machine) in order to use tftp (I want to be able to transfer some small piece of x86 code and test it in u-boot). And a new problem occurred: tftp unconditionally leaded to an "access violation" return by the local tftp server of qemu. After some quite long hours of debugging, and comparing with old version of U-boot, I found a bug in lib/vsprintf.c. In some case, the null-termination character is not set at the right place leading to a bad length of string. I attached the patch which solved my problem.
Sound like a lot of progress!
Could you please send that patch to the mailing list? I did notice it but have not got around to sending out one.
I'm now able to transfer any file in U-boot/qemu/x86. Great! In a near future, I will also enable saveenv in order to preserve the environment in a flash file.
Sounds great.
Regards, Simon