[syslinux] Com32 error?

G. Murali Krishnan gmkrishn at cs.uchicago.edu
Mon Nov 18 15:13:46 PST 2002


> Right... I see you have the same problem that I just fixed in the sample
> code -- the sample code works by accident because there is only one
> function.  I found that problem today and just fixed it; expect a new
> prerelease today to deal with that (it's a bug in the sample code, not
> in SYSLINUX.)

1. The pre2 code doesn't fix this problem.
2. I then removed the extra function so there is only one function
3. I still have the original problem. The BIOS function works
   as expected but not INT 22h.

It would very helpful, if you could publish a "Hello World" code, which
uses INT22h to print the string instead of the BIOS interrupts. That would
clear a lot of problems.

relevant parts of the code
---
int _start(unsigned int nargs, char *cmdline,
	   void (*syscall)(unsigned char, com32sys_t *, com32sys_t *),
	   void *bounce_ptr, unsigned int bounce_len)
{
  char *msg = "Hello, World!\r\n";
  com32sys_t inreg, outreg;
  char *p,*s,*t;
  unsigned int ctr;

  t=(char *)bounce_ptr;
  for (ctr=0; ctr < 20; ctr++) t[ctr]=msg[ctr];
  /* Copy the string over to bounce_ptr */
  /* For some reason the next line of code doesn't work */
  /* s=msg; while (*s) (*s++=*t++);  *t=0x0; */

  memset(&inreg, 0, sizeof inreg);
  inreg.eax.w[0]=0x02;
  inreg.es =SEGMENT(bounce_ptr);
  inreg.ebx.w[0]= OFFSET(bounce_ptr);
  syscall(0x22,&inreg,NULL);

  memset(&inreg,0,sizeof inreg);
  msg[0]='!';
  for ( p = msg ; *p ; p++ ) {
    inreg.edx.b[0] = *p;
    inreg.eax.b[1] = 0x02;	/* Write Character */
    syscall(0x21, &inreg, NULL);
  }

  return 0;
}

################################################################
#  Ry 254, Ryerson Hall,   #    Ph : +1 773 702-1031 (Off)     #
#  1100 E 58th Street      #         +1 773 575-4836 (Cell)    #
#  Chicago, IL - 60637,    #   URL : http://www.g-murali.com   #
#  USA.                    #  email: gmkrishn at cs.uchicago.edu  #
################################################################




More information about the Syslinux mailing list