Payload autoloader
sys_init_osd.self replacer to load plugins at boot in non-cobra.

a) the generated "sys_init_osd.self" should replace sys_init_osd.self in /dev_flash/sys/internal/

b) where it calls the original previously renamed sys_init_osd_orig.self

c) then it tries to load one of the payloads by the following order 
	"/dev_usb000/payload.bin", 				 	
	"/dev_flash/sys/internal/payload.bin",		 	

d) The ideal approach would be to allocate space using lv2_aloc(),
but it is not yet available when sys_init_osd runs.
So, the payload will be loaded in a zone in the last 64KB segment of LV2.
It runs immediatelly after just to load the plugins.
After-it it is not needed anymore.
So, even if latter on the PS3 allocs space in this last LV2 64KB segment, there will be no issue.
As I side note, I've never seen any usage for this segment in any of the many lv2 dumps I've seen until today.
Anyway, I've included a simple commented code for a lv2_alloc() function that will search for the alloc symbol, 
creates a fake syscall to the alloc, calls the syscall (allocs v2 memory), restores the syscall table, and exits.

e) payload must be for the correct firmware version.

f) psnpatch will use the payload compiled from symbols.h for a special "firmware 0.00" 
that will work as placeholders for the real symbols.
This way, psnpatch will patch the payload when installing it to work in the currently running firmware version. 
Hopefully this will make the process firmware independent, and should give some flexibility for small source code changes to the payload.
Nevertheless, the developper should be very carefull to aovid using new symbols / functions besides the ones declared in symbols.h for FIRMWARE_0_00

g) plugins will be loaded from config in /dev_hdd0/prx_plugins.txt

h) 3 possible flags (place in /dev_usb000/core_flags/ or /dev_usb001/core_flags/)
"verbose"   write a detailed log in /dev_usb000
"failsafe"  loads ONLY original sys_init_osd.self (sys_init_osd_orig.self) + vsh.self
"noplugins" loads the payload but skip loading the plugins

In case of an ultimate emergency, 
the core tries to rescue the system by loading the vsh.self from:
/dev_usb000/emergency.self

===============================

COMPILATION:
	a) payload_autoloader needs psl1ght with ppu-gcc 4.5.2
	b) prx-payload needs old psl1ght with ppu-gcc 4.2.0
sky and mamba are still in tests as they are not working properly at boot time.

payload firmware dependent symbols are in
lv2/include/lv2/symbols.h

===============================

This program is based in:
- New Core by MiralaTijera 
- New Core changes by Estwald 
- prx-loader by User 
- prx-loader unofficial updates by _NZV_ and Joonie
- boot plugins loader from cobra's stage2.bin (modulespatch.c)
(c) 2013 MiralaTijera <www.elotrolado.net> (Original Core)
(c) 2013 Estwald <www.elotrolado.net> (New Core)
(c) 2015 KW

"New Core" is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

"New Core" is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with "New Core". If not, see <http://www.gnu.org/licenses/>.
===============================
