/*
 * Stub Emulation Loader
 *
 * (This needs to be a static binary that is smaller than 4K (pagesize)
 * because then the entire binary is writeable)
 *
 */

#include <stdio.h>
#define LIBSTART 	0x400000

void (*dosemu)();
char dummy[1088*1024]; /* make sure that the lower 1MB+64K is unused */

int main(int argc, char **argv)
{
	if (uselib("/lib/libemu.2d") != 0) {
		printf("cannot load shared lib\n");
		exit(1);
	}
	dummy[1] = dummy[0];
	dummy[1] = dummy[1024*1024];
	dosemu = (void *) LIBSTART;
	dosemu(argc, argv);
}
