Horms <[EMAIL PROTECTED]> writes: > On Tue, Jun 13, 2006 at 09:24:34PM +0200, Michael Schierl wrote: >> [please cc: me since I am not subscribed on the list] >> >> Hi, >> >> First, If this is the wrong list to discuss kexec, please tell me. It is >> hard to find any homepage or documentation about kexec in the web. >> >> I am trying to use kexec to run some X86 real-mode code from Linux. I >> tried to mimic a bzImage file, but although GRUB and ISOLINUX load it, >> kexec (the userland program from kexec-tools) does not like to load the >> image at all (I used the --real-mode switch but it did not help). >> >> [My aim is to to chainload another (non-free) OS by loading its boot >> sector into memory and executing it. Just like chainloader in GRUB, but >> from kexec.]
A reasonable goal. >> Now I created a "hello world kernel" that just echoes "Hello world" >> using Int 0x10 BIOS function. That one shows the same behaviour. Works >> in GRUB, but not with kexec. >> >> I uploaded this "kernel" to >> http://home.arcor.de/mschierlm/test/hello.tar.gz >> if anyone wants to have a look at it. >> >> Is it just impossible to load real mode code with kexec? Or is another >> kernel format than bzImage more appropriate? Where do I find >> documentation for those other formats (if they may work better?) > > Taking a wild stab in the tark, I suspect that your problem is that > when a kernel is run by kexec it skips all the BIOS stuff. I have > to confess that I really don't know what the is Int 0x10 BIOS function, > but it sounds problemeatic in a kexec context to me. The problem isn't that the kernel skips the BIOS stuff, we skip the BIOS stuff because the kinds of problems are unfortunately frequent. > Other than that, I think that yes you should be able to use kexec to > bootstrap into any kind of kernel (or code running in real mode). > Certainly linux->xen is possible (and with patches I have posted > to xen-devel, xen->xen and xen->linux, though thats not really relevant), > so its not restricted to booting linux. Correct. Most BIOS's get confused after the kernel has run so after 16bit BIOS calls can be a problem. I have a test image called kexec_test from when I was really trying to get the 16bit mode with BIOS calls to work. It uses the serial port to report how far it has gotten. Depending on how ambitious you are I have a fairly good clue on what needs to happen to make things work even when the BIOS would muck things up. I have a vague memory that the --real-mode switch had a bug in some version so that may be the problem rather than the bios. In any event kexec_test will report how far it gets and be a useful starting place for further debugging. Eric _______________________________________________ fastboot mailing list [email protected] https://lists.osdl.org/mailman/listinfo/fastboot
