[syslinux] IP details in COM32 module

H. Peter Anvin hpa at zytor.com
Sun Jun 10 21:36:03 PDT 2007


Coe, Colin C. (Unix Engineer) wrote:
>                 /* BIOS is right, boot config in argv[1]  */
>                 char *details;
>                 printf("BIOS revision OK, starting rebuild...\n");
>                 /* Parse the 'flash_bios' append line */
>                 for (i=1; i<argc; i++) {
>                      sprintf(buff, "%s %s", buff, argv[i]);
>                 }

How is buff defined?

>                 sprintf(__com32.cs_bounce, "%s bootproto=static
> ksdevice=eth0 ip=%s netmask=%s gateway=%s dns=%s domain=%s", buff,
> my_ip, my_netmask, my_gateway, my_dns, my_domain);
> 
>                 printf("__com32.cs_bounce contains '%s'\n",
> __com32.cs_bounce);
> 
>                 /* Populate the registers AX and BX then call INT22 */
>                 memset(&reg, 0, sizeof(reg));
>                 reg.eax.w[0] = 0x0003;
>                 reg.ebx.w[0] = OFFS(__com32.cs_bounce);
>                 reg.es       = SEG(__com32.cs_bounce);
>                 __intcall(0x22, &reg, &reg);

You can replace this section with something like:

#include <syslinux/boot.h>

	char command[2048];

	snprintf(command, sizeof command, "%s bootproto=static ksdevice=eth0
ip=%s netmask=%s gateway=%s dns=%s domain=%s", buff,
my_ip, my_netmask, my_gateway, my_dns, my_domain);

	syslinux_run_command(command);

	-hpa




More information about the Syslinux mailing list