Commits

Anonymous committed dfc422d

*Removed the old Protokernel patch, since a full patch has been integrated into the PS2SDK.
*Removed support for "loaders" within the CRT0 of the EE core. It will never be started from a thread, hence it's redundant.

  • Participants
  • Parent commits be88f55

Comments (0)

Files changed (5)

 		obj/icon_sys.o obj/icon_icn.o
 
 EECORE_OBJS = obj/ee_core.o \
-		obj/alt_ee_core.o obj/elfldr.o obj/kpatch_10K.o obj/imgdrv.o obj/eesync.o \
+		obj/alt_ee_core.o obj/elfldr.o obj/imgdrv.o obj/eesync.o \
 		obj/usb_cdvdman.o obj/usb_4Ksectors_cdvdman.o obj/smb_cdvdman.o obj/smb_pcmcia_cdvdman.o \
 		obj/hdd_cdvdman.o obj/hdd_pcmcia_cdvdman.o obj/hdd_hdpro_cdvdman.o \
 		obj/cdvdfsv.o obj/usbd_ps2.o obj/usbd_ps3.o obj/usbhdfsd.o obj/cddev.o \
 	$(MAKE) -C ee_core -f Makefile.alt clean
 	echo "    * Elf Loader"
 	$(MAKE) -C elfldr clean
-	echo "    * 10K kernel patches"
-	$(MAKE) -C kpatch_10K clean
 	echo "    * imgdrv.irx"
 	$(MAKE) -C modules/iopcore/imgdrv clean
 	echo "    * eesync.irx"
 	$(MAKE) -C elfldr
 	bin2s elfldr/elfldr.elf asm/elfldr.s elfldr_elf
 
-kpatch_10K.s:
-	echo "    * 10K kernel patches"
-	$(MAKE) -C kpatch_10K
-	bin2s kpatch_10K/kpatch.elf asm/kpatch_10K.s kpatch_10K_elf
-
 imgdrv.s:
 	echo "    * imgdrv.irx"
 	$(MAKE) -C modules/iopcore/imgdrv

File ee_core/src/crt0.s

    nop
 2:
 
-   # store eventual loader arguments (passed via a0)
-
-   la   $2, _loader_args
-   sw   $4, ($2)
-
 setupthread:
    # setup current thread
 
 
    # call main
 
-   ei
-   jal   _getargs
-   nop
+   la   $2, _args
+   lw   $4, ($2)
    jal   main      # main(argc, argv)
-   nop
+   addiu   $5, $2, 4
 
    # call _exit
 
    nop
 1:
 
-   # conditional exit (depending on if we got arguments through the loader or not)
-
    la   $2, _retval
    lw   $4, ($2)
 
-   la   $5, _loader_args
-   lw   $6, ($5)
-   beqz   $6, 1f
-   nop
-
-   # called from a loader, close thread
-
-   lw   $7, ($6)
-   sw   $0, ($7)   # clear thread id
-
-   addiu   $3, $0, 36
-   syscall         # ExitDeleteThread() (noreturn)
-1:
-
-   # not called from a loader, return to browser
-
    addiu   $3, $0, 4
    syscall         # Exit(retval) (noreturn)
 
    syscall         # ExitThread() (noreturn)
    .end   _root
 
-   .ent   _getargs
-_getargs:
-   # check normal arguments
-
-   la   $2, _args
-   lw   $3, ($2)
-   bnez   $3, 1f
-   nop
-
-   # check for arguments passed by a loader
-
-   la   $2, _loader_args
-   lw   $3, ($2)
-   beqzl   $3, 2f
-   addu   $4, $0, 0
-
-   addiu   $2, $3, 4
-1:
-   lw   $4, ($2)
-   addiu   $5, $2, 4
-2:
-   jr   $ra      # $4 = argc, $5 = argv
-   nop
-   .end   _getargs
-
    .bss
    .align   6
 _args:
    .space   4+16*4+256   # argc, 16 arguments, 256 bytes payload
-_loader_args:
-   .space   4      # pointer to loader arguments: thread id, argc, argv
 _retval:
    .space   4

File include/system.h

 int sysPS3Detect(void);
 int sysSetIPConfig(char* ipconfig);
 int sysLoadModuleBuffer(void *buffer, int size, int argc, char *argv);
-void sysApplyKernelPatches(void);
 int sysCheckMC(void);
 #ifdef VMC
 int sysCheckVMC(const char* prefix, const char* sep, char* name, int createSize, vmc_superblock_t* vmc_superblock);
 	}
 	#endif
 
-	// apply kernel patches
-	sysApplyKernelPatches();
-
 	// reset, load modules
 	reset();
 

File src/system.c

 extern void *elfldr_elf;
 extern int size_elfldr_elf;
 
-extern void *kpatch_10K_elf;
-extern int size_kpatch_10K_elf;
-
 extern void *smsutils_irx;
 extern int size_smsutils_irx;
 
 	return 0;
 }
 
-void sysApplyKernelPatches(void) {
-
-	u8 romver[16];
-
-	int fd = fioOpen("rom0:ROMVER", O_RDONLY);
-	if (fd >= 0) {
-		fioRead(fd, romver, sizeof(romver));
-		fioClose(fd);
-
-		// Check in rom0 for PS2 with Protokernel
-		if ((romver[0] == '0')
-		 && (romver[1] == '1')
-		 && (romver[2] == '0')
-		 && (romver[9] == '0')) {
-
-			sbv_patch_protokernel();
-		}
-	}
-}
-
 int sysCheckMC(void) {
 	int dummy, ret;