[syslinux] chain.c32 "map" argument

Joe Pelkey pelkeyj.highvol at gmail.com
Tue Dec 28 23:51:48 PST 2010


Hi,
I have coded a function to parse a string to map BIOS drives to other
BIOS drives.  I need such functionality because I want to chainload grub
from syslinux on a USB flash drive.  The drive is considered a floppy
disk by my BIOS, yet it's MSDOS partitioned, and grub can't handle
partitions on floppy disks (hence my desire to fake 0x80 being 0x00).

The function can map a string of arbitrary drive numbers between 0 and
255 (entered in decimal, octal (leading 0), or hex (leading 0x)) to
other values in a uint8_t array of the form of the p pointer to swapstub
in do_boot() in com32/modules/chain.c.  The syntax can take multiple
comma-delimited arguments of individual mappings, with each mapping in
old=new format.  I can add boot/fdX/hdX tokens to the parser if wanted.

Since I don't know assembly, I need to know if the table modified by the
p pointer in chain.c's swapstub is up to arbitrary drive number changes.
If this a worthy modification to pursue, where can I send my patches (to
syslinux 4.0.3) once I finish?

Also, what file would be best to add the function I made
(parse_drive_map)?  It takes a command-line string and the address of
the map array as input.

Thanks,
Joe Pelkey




More information about the Syslinux mailing list