[syslinux] reboot from com32

H. Peter Anvin hpa at zytor.com
Tue Aug 14 10:24:06 PDT 2007

Miguel wrote:
> HPA wrote:
>> The easiest way is to use __farcall() to call to 0xf000:0xfff0:
>> __noreturn syslinux_reboot(int warm)
>> {
>>   static com32sys_t dummy_regs;
>>   uint16_t * const reboot_flag = (uint16_t *)0x472;
>>   *reboot_flag = warm ? 0x1234 : 0;
>>   __farcall(0xf000, 0xfff0, &dummy_regs, NULL);
>> }
>> I just added syslinux_reboot() to the git tree.
>> 	-hpa
> I have been unable to get this to work properly.
> On an HP DL360G2 it returns from syslinux_reboot, independent of whether
> it is warm or cold.

That's utterly weird.  Hanging I could have seen, but returning is just
weirder than weird.

> On a Dell PE850 it hangs (but will respond to Ctl-Alt-Del), independent of
> whether it is warm or cold.
> The code that I am using is below in its entirety. It is a tweaked version
> of samples/hello.c that responds to 'warm' or 'cold'.
> My only thought is:
> Q: Does __farcall switch out of 32 bit mode and back into 16 bit mode?

Yes, it does.

The most likely explanation IMO is that there is a bug in __farcall.
Unlike __intcall it hasn't been extensively used.  They do, however,
share almost all the code.


More information about the Syslinux mailing list