[syslinux] proper way to sleep

Erwan Velu erwan at seanodes.com
Tue Aug 21 10:55:16 PDT 2007

Miguel wrote:
> This is not spam about sleep aids :)
> Q: Is there a 'standard' way to sleep for a specified number of BIOS ticks
> (or seconds) in a com32 program?
> I grepped through the com32 library source and didn't find anything for
> 'sleep' or 'tick'.
> If not, you may want to consider adding:
>   void syslinux_sleep(int seconds);
>   void syslinux_sleep_bios_ticks(int ticks);
I had the same problem in my com32 modules.. It could be nice to add a 
sleep(unsigned int msec) function.

Can't we use such code ?

unsigned char sleep(unsigned int msec)
   unsigned long micro = 1000*msec;
   com32sys_t inreg,outreg;
   REG_AH(inreg) = 0x86;
   REG_CX(inreg) = (micro >> 16);
   REG_DX(inreg) = (micro & 0xFFFF);
   return REG_AH(outreg);

More information about the Syslinux mailing list