|
Verfasser |
Nachricht |
dx3m
Manta
Beiträge: 490
Gruppe: Developer
Registriert seit: Aug 2010
Status:
Abwesend
Danke erhalten: 643
|
Problem mit Module Exports/Imports
hey leutz ich hab da ein problem..
und zwar möchte ich ein Kernel Module Exportieren und in ein Usermode EBOOT importieren.
Das module exportieren funktioniert auch wunderbar. hab sogar schon in das usermode eboot die nid's dafür eingebunden. Funktioniert alles wunderbar, nur wenn ich das Module jetzt laden will kommt entweder ein 0x800XXXX Error oder ein 0xDEADBEEF error o.O
hier nochmal den code wie ich das module lade:
SceUID mod = pspSdkLoadStartModule("xxx.prx", PSP_MEMORY_PARTITION_KERNEL);
if (mod < 0)
{
printf("Error 0x%08X\n", mod);
sceKernelDelayThread(2*1000*1000);
sceKernelExitGame();
}
hoffe es kann mir jemand weiterhelfen
|
|
24.10.2010 00:57 |
|
|
|
HacKmaN
Ex-Developer
Beiträge: 2.423
Gruppe: User
Registriert seit: Oct 2009
Status:
Offline
Danke erhalten: 3319
|
RE: Problem mit Module Exports/Imports
1. Du kannst keine Module exportieren, nur Funktionen.
2. Bist du dir sicher dass das modul im kmode läuft und du alles via Syscalls exportierst?
3. Schreib mal den ganzen Fehlercode hier rein.
|
|
24.10.2010 09:30 |
|
|
|
dx3m
Manta
Beiträge: 490
Gruppe: Developer
Registriert seit: Aug 2010
Status:
Abwesend
Danke erhalten: 643
|
RE: Problem mit Module Exports/Imports
1. Du kannst keine Module exportieren, nur Funktionen.
2. Bist du dir sicher dass das modul im kmode läuft und du alles via Syscalls exportierst?
3. Schreib mal den ganzen Fehlercode hier rein.
1. ich meinte auch die funktionen ;D
2. ich hab da funktionen drinnen wie assingin flash0 als "rw" mode und machne nand funktionen, das module läuft im kernel mode(0x1006 hab ichs laufen) und die mit hilfe der exports datei hab ich dann die funktionen exportiert. Das importieren in das Usermode payload funktioniert auch.
3. Jo klar.. "Error 0x800200D9"
|
|
24.10.2010 13:23 |
|
|
|
HacKmaN
Ex-Developer
Beiträge: 2.423
Gruppe: User
Registriert seit: Oct 2009
Status:
Offline
Danke erhalten: 3319
|
RE: Problem mit Module Exports/Imports
0x800200D9 = SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED
Wie groß ist die Datei? Bist du dir sicher dass du die build_prx.mak verwendest, nicht die build.mak?
Und lass sie mit Modus 0x1000 laufen.
Und nochmal die Frage von oben... wie exportierst du die Funktionen? Als Syscalls oder als normale Sprünge? Wenn du sie als normale Sprünge exportierst können nur Kernel Module drauf zugreifen!
|
|
24.10.2010 17:14 |
|
|
|
dx3m
Manta
Beiträge: 490
Gruppe: Developer
Registriert seit: Aug 2010
Status:
Abwesend
Danke erhalten: 643
|
RE: Problem mit Module Exports/Imports
So
ich verwende die build_prx.mak und funktioniert.
im 0x1000 hab ich sie auch schon laufen lassen und funkt auch nicht. >.<
Edit: Die datei ist 1.914 Bytes groß!
hier mal die Makefile:
TARGET = u235
OBJS = main.o
CFLAGS = -Os -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
#PSP_FW_VERSION = 500
BUILD_PRX = 1
PRX_EXPORTS = exports.exp
USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1
LDFLAGS = -mno-crt0 -nostartfiles
LIBS =
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build_prx.mak
all:
rm *.elf
rm *.o
die exports:
# Define the exports for the prx
PSP_BEGIN_EXPORTS
# These four lines are mandatory (although you can add other functions like module_stop)
# syslib is a psynonym for the single mandatory export.
PSP_EXPORT_START(syslib, 0, 0x8000)
PSP_EXPORT_FUNC_HASH(module_start)
PSP_EXPORT_VAR_HASH(module_info)
PSP_EXPORT_END
PSP_EXPORT_START(u235, 0, 0x4001)
PSP_EXPORT_FUNC_HASH(u235Init)
PSP_EXPORT_FUNC_HASH(u235Flash)
PSP_EXPORT_END
PSP_END_EXPORTS
und die u235.S für das Usermode Payload:
.set noreorder
#include "pspstub.s"
STUB_START "u235",0x40090000,0x00020005
STUB_FUNC 0x492BCBE6,u235Init
STUB_FUNC 0xD72A9DF4,u235Flash
STUB_END
Dieser Beitrag wurde zuletzt bearbeitet: 24.10.2010 19:15 von dx3m.
|
|
24.10.2010 19:13 |
|
|
|
HacKmaN
Ex-Developer
Beiträge: 2.423
Gruppe: User
Registriert seit: Oct 2009
Status:
Offline
Danke erhalten: 3319
|
RE: Problem mit Module Exports/Imports
ich verwende die build_prx.mak und funktioniert.
im 0x1000 hab ich sie auch schon laufen lassen und funkt auch nicht. >.<
Was jetzt... funktionierts oder funktionierts nicht?
Die Größe ist ok, würd mich jetzt wundern wenn es nicht funktionieren würde, und die Funktionen werden auch als Syscalls exportiert.
//EDIT:
Versuchs mal ohne LIBC
Dieser Beitrag wurde zuletzt bearbeitet: 24.10.2010 19:23 von HacKmaN.
|
|
24.10.2010 19:22 |
|
|
|
dx3m
Manta
Beiträge: 490
Gruppe: Developer
Registriert seit: Aug 2010
Status:
Abwesend
Danke erhalten: 643
|
RE: Problem mit Module Exports/Imports
ich verwende die build_prx.mak und funktioniert.
im 0x1000 hab ich sie auch schon laufen lassen und funkt auch nicht. >.<
Was jetzt... funktionierts oder funktionierts nicht?
Die Größe ist ok, würd mich jetzt wundern wenn es nicht funktionieren würde, und die Funktionen werden auch als Syscalls exportiert.
//EDIT:
Versuchs mal ohne LIBC
sry hab mich verschieben ;D
und funktioniert noch immer nicht >.< ich verstehs nicht
|
|
24.10.2010 19:29 |
|
|
|
HacKmaN
Ex-Developer
Beiträge: 2.423
Gruppe: User
Registriert seit: Oct 2009
Status:
Offline
Danke erhalten: 3319
|
RE: Problem mit Module Exports/Imports
Ich auch nicht. Poste mal nen Teil der main.c (ohne die ganzen funktionen), nur die wichtigsten Sachen.
Und noch ne Sache... ist deine eboot eine statische oder eine relocateable ELF? Afaik können nur Relocateable ELFs Kernel PRXs laden...
Dieser Beitrag wurde zuletzt bearbeitet: 24.10.2010 19:38 von HacKmaN.
|
|
24.10.2010 19:37 |
|
|
|
dx3m
Manta
Beiträge: 490
Gruppe: Developer
Registriert seit: Aug 2010
Status:
Abwesend
Danke erhalten: 643
|
RE: Problem mit Module Exports/Imports
hier mal die makefile vom user payload:
TARGET = reactor
OBJS = main.o u235.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS) -c
LIBDIR =
LDFLAGS =
LIBS = -lpspkubridge -lpspsystemctrl_user
BUILD_PRX = 1
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Reactor Block 4
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
und die main.c vom kprx:
#include <pspkernel.h>
#include <pspsdk.h>
#include <systemctrl.h>
PSP_MODULE_INFO("u235", 0x1000, 1, 0);
PSP_MAIN_THREAD_ATTR(0);
int u235Init() // Init u235.
{
//my stuff
return 0;
}
char buf[2*1024*1024];
int u235Flash(char *filein, char *fileout) // FlashFile
{
//my stuff
return 0;
}
int module_start(SceSize args, void *argp)
{
return 0;
}
int module_stop()
{
return 0;
}
Dieser Beitrag wurde zuletzt bearbeitet: 24.10.2010 19:54 von dx3m.
|
|
24.10.2010 19:49 |
|
|
|
HacKmaN
Ex-Developer
Beiträge: 2.423
Gruppe: User
Registriert seit: Oct 2009
Status:
Offline
Danke erhalten: 3319
|
RE: Problem mit Module Exports/Imports
hier mal die makefile vom user payload:
TARGET = reactor
OBJS = main.o u235.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS) -c
LIBDIR =
LDFLAGS =
LIBS = -lpspkubridge -lpspsystemctrl_user
BUILD_PRX = 1
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Reactor Block 4
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
und die main.c vom kprx:
#include <pspkernel.h>
#include <pspsdk.h>
#include <systemctrl.h>
PSP_MODULE_INFO("u235", 0x1000, 1, 0);
PSP_MAIN_THREAD_ATTR(0);
int u235Init() // Init u235.
{
//my stuff
}
char buf[2*1024*1024];
int u235Flash(char *filein, char *fileout) // FlashFile
{
//my stuff
return 0;
}
int module_start(SceSize args, void *argp)
{
return 0;
}
int module_stop()
{
return 0;
}
Mach den Puffer (buf) weg, benutz lieber sceKernelAllocPartitionMemory
//EDIT: Und kompilier die EBOOT-Data.psp als PRX, nicht als statische ELF!
Dieser Beitrag wurde zuletzt bearbeitet: 24.10.2010 19:54 von HacKmaN.
|
|
24.10.2010 19:52 |
|
Folgende User bedanken sich: |
|
Ceikor
Ex-Developer
Beiträge: 581
Gruppe: User
Registriert seit: Dec 2008
Status:
Abwesend
Danke erhalten: 701
|
RE: Problem mit Module Exports/Imports
soll ich dir mal ein kleinen tip geben? und eventuell den source?
Ich geh mal davon aus das du dateien in den flash schreiben möchtest, stimmts?
Dann nutze iop.prx die ist zwar 8kb groß aber macht absolut nichts und du kannst dann wunderbar über den usermode im flash schreiben^^
|
|
24.10.2010 19:56 |
|
|
|
dx3m
Manta
Beiträge: 490
Gruppe: Developer
Registriert seit: Aug 2010
Status:
Abwesend
Danke erhalten: 643
|
RE: Problem mit Module Exports/Imports
boa danke man. es funkt
|
|
24.10.2010 20:15 |
|
|
|