11 /* Call this MMU Hack kernel module after doing mmap, and before doing memset*/
17 /* some programs like some versions of gpSP use some weird version of mmuhack.o
18 * which doesn't seem to work. What's even worse they leave their mmuhack loaded on exit.
19 * So we must remove whatever may be left and always reload _our_ mmuhack.o */
20 system("/sbin/rmmod mmuhack");
22 strcpy(kocmd, "/sbin/insmod ");
23 strncpy(kocmd+13, g_argv[0], 1023-13);
25 for (i = strlen(kocmd); i > 0; i--)
26 if (kocmd[i] == '/') { kocmd[i] = 0; break; }
27 strcat(kocmd, "/mmuhack.o");
29 printf("Installing NK's kernel module for Squidge MMU Hack (%s)...\n", kocmd);
31 mmufd = open("/dev/mmuhack", O_RDWR);
33 if(mmufd < 0) return 0;
40 /* Unload MMU Hack kernel module after closing all memory devices*/
44 printf("Removing NK's kernel module for Squidge MMU Hack... "); fflush(stdout);
45 ret = system("/sbin/rmmod mmuhack");
46 printf("done (%i)\n", ret);