Skip to content

Commit

Permalink
Nop out the read of the FS register in EMX's syscall interface for now.
Browse files Browse the repository at this point in the history
Eventually, we'll maybe need to set the FS register to be a proper TIB pointer,
but I'm mostly hoping that everything else was well-behaved enough to always
use DosGetInfoBlocks() instead. Yeah, right.
  • Loading branch information
icculus committed Oct 2, 2016
1 parent f681be1 commit d982370
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lx_loader.c
Expand Up @@ -919,9 +919,17 @@ static LxModule *loadLxModule(const char *fname, uint8 *exe, uint32 exelen, int

// !!! FIXME: hack to nop out some 16-bit code in emx.dll startup...
if ((i == 1) && (strcmp(modname, "EMX") == 0)) {
// This is the 16-bit signal handler installer. nop it out.
uint8 *ptr = ((uint8 *) retval->mmaps[1].addr) + 28596;
for (uint32 i = 0; i < 37; i++)
*(ptr++) = 0x90; // nop

// This is a read of the FS register for the TIB, but we need to wire that up still.
ptr = ((uint8 *) retval->mmaps[1].addr) + 237;
*(ptr++) = 0x31; // xorl %esi,%esi ...makes next piece of code skip TIB stuff.
*(ptr++) = 0xf6;
for (uint32 i = 0; i < 14; i++)
*(ptr++) = 0x90; // nop
}


Expand Down

0 comments on commit d982370

Please sign in to comment.