[syslinux] Returning to syslinux bootloader

Michael Brown mbrown at fensystems.co.uk
Thu Apr 16 10:43:28 PDT 2009


On Thursday 16 April 2009 16:38:10 Dag Wieers wrote:
> On Thu, 16 Apr 2009, H. Peter Anvin wrote:
> > Erwan Velu wrote:
> >> Any hints on how it could be done ?
> >> At least, I could be interested in HDT being able to return to hdt after
> >> running as external tool like memtest etc...
> >
> > You'd have to return all hardware and all BIOS memory to the state it
> > was before the target was invoked.  The complexity of this depends on
> > the target.  Linux, for example, is very complex.
> >
> > The clean way to do this is through the reset path.
>
> So if this were to be implemented, syslinux needs to retain the memory,
> and there would be a new syslinux API call for going back to that state ?
>
> Instead of HDT taking care of this, it would make more sense that memtest
> itself would perform the callback if it found syslinux hooks. And HDT
> could replace the syslinux state by its own ?

When jumping to a Linux kernel image, there is not even a return address on 
the stack.  memtest could presumably be packaged in some image format that 
has a return path, e.g. COM32?  This should allow it to return even with 
stock syslinux.

FWIW, I have experimented with returning to the gPXE bootloader from an MS-DOS 
instance booted via iSCSI.  gPXE captures the INT18/INT19 vectors so that it 
can continue cleanly in the case of a failed iSCSI boot.  It is possible to 
abuse this in DOS by writing a reboot.com executable that just calls INT19.  
It does kind of work, but it's not hugely reliable, because DOS will have 
edited the interrupt vector table, etc. and so the machine is left in a 
pretty unsafe state for booting a subsequent OS without a reset.

Michael




More information about the Syslinux mailing list