[syslinux] IP details in COM32 module

Coe, Colin C. (Unix Engineer) Colin.Coe at woodside.com.au
Mon Jun 11 03:10:02 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

Hi hpa

buff is defined as 'char *buff'.

Many thanks for the pointer, the code no longer produces a hard hang.

I found a few other problems with my code as well.  Things seem to work better when defined as 'char something[n]' rather than 'char *something' but I'm not sure why this would be the case.

I'm getting some inconsistant results and I want to do more testing before I post more questions.

Thanks again

CC

NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.




More information about the Syslinux mailing list