On 05/03/14 08:50, Andrei E. Warkentin wrote:
Hi Andrei,
Hi,
This is a patch against r1272 which implements fully bootcode booting via Apple boot partition descriptors. The current implementation in libopenbios/bootcode_load.c hardcoded values for QUIK (the old OldWorld bootloader), which is useless if you try to boot anything else.
In particular, I implemented this to simplify my development and test cycle on iQUIK (https://github.com/andreiw/quik), but I also tested this with the NetBSD floppy. The later now boots to stage 2 as well, although it tries using some functionality unavailable in the OpenBIOS implementation when compared to Apple's.
I did this in the simplest way possible.
Thanks for the patch! I've been aware for a while that the bootcode loader is slightly different from the others, although I've not been too keen to alter the existing behaviour in case it breaks anything. However it seems that you've got some test cases so... I've taken your patch as a starting point and reworked the bootcode loader to get rid of the global Forth variables and bring it in line with the others.
Can you try the attached squashed patch and confirm that it still works in your tests? With these changes I can still boot my basic quik hard disk image which is all I have.
One minor comment is that when you submit patches, please can you try and isolate different changes and be wary of whitespace? For example, I see that you've also added some code so that mac-parts.c will drop out early if want_bootcode is set which is a global behaviour change and so should be done as a separate patch.
Btw, I see that the optimization bugs are still present. I had to compile with -O0, otherwise the resulting image doesn't boot (GCC 4.8 here).
That's interesting because I don't see that problem here? Then again I had problems with existing toolchains and so ended up rebuilding my cross-compiler by hand which eliminated all the problems I was seeing:
build@kentang:~$ powerpc-elf-gcc -v Using built-in specs. COLLECT_GCC=powerpc-elf-gcc COLLECT_LTO_WRAPPER=/home/build/ppc-cross/libexec/gcc/powerpc-elf/4.8.2/lto-wrapper Target: powerpc-elf Configured with: ../gcc-4.8.2/configure --prefix=/home/build/ppc-cross --enable-languages=c --target=powerpc-elf --disable-libssp Thread model: single gcc version 4.8.2 (GCC) build@kentang:~$
ATB,
Mark.