On 19/09/08 01:12 +0200, Carl-Daniel Hailfinger wrote:
On 18.09.2008 23:59, Carl-Daniel Hailfinger wrote:
On 18.09.2008 22:09, Robert Millan wrote:
--- arch/x86/stage1.c (revision 867) +++ arch/x86/stage1.c (working copy) @@ -139,6 +140,14 @@ } #endif /* CONFIG_PAYLOAD_ELF_LOADER */
+int run_address_multiboot(void *f) +{
- int ret;
- __asm__ __volatile__ ("call *%3" : "=a" (ret) : "a" (MB_MAGIC2), "b" (0xf0000), "c" (f));
- return ret;
+}
The function above belongs in multiboot.c
I forgot to mention that the clobber list is incomplete, possibly leading to corruption if a payload returns.
Lets be honest with ourselves, none of our code is capable of processing the return of a payload. Complaining about this is falling out of an airplane and on the way down telling the other guy that he should be wearing a helmet.
Technically, we should be saving and then restoring the kitchen sink when we come back - something that isn't practical to do in a clobber list. Yes, folks, sometimes assembly can be useful and this is one of those times.
Jordan