[syslinux] Com32 api problem !

H. Peter Anvin hpa at zytor.com
Thu Apr 3 09:00:05 PDT 2008


Kjetil.Mikkelborg at kongsberg.com wrote:
> Hi
> 
> Could this code be modified to write to disk also (and if so, how)?
> I need a simple com32 module which wipes the first 2048 bytes of the disk which the system is using for localboot.
> 

It's pretty easy... look at chain.c32 (chain.c) for how to read from an 
arbitrary disk.  To write, you use function 03h/43h instead of 02h/42h. 
  You can get the disk number from which we booted from 
syslinux_derivative_info() (see <syslinux/config.h>); obviously assuming 
syslinux/extlinux.

"The disk which the system is using for localboot", however, is much 
fuzzier; if you have, say, booted from a network, there is no generic 
way to know what disk the BIOS would have booted next in response to 
"localboot 0".

	-hpa




More information about the Syslinux mailing list