KINGx - Das inoffizielle PlayStation Forum & News Portal

Normale Version: Problem mit Module Exports/Imports
Sie sehen gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
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:

Code:
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 Smile

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.

HacKmaN :
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"

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!
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:

Code:
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:

Code:
# 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:

Code:
    .set noreorder

#include "pspstub.s"

    STUB_START "u235",0x40090000,0x00020005
    STUB_FUNC  0x492BCBE6,u235Init
    STUB_FUNC  0xD72A9DF4,u235Flash
    STUB_END

dxem :
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? Tongue
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 Wink

HacKmaN :

dxem :
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? Tongue
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 Wink


sry hab mich verschieben ;D

und funktioniert noch immer nicht >.< ich verstehs nicht

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...
hier mal die makefile vom user payload:

Code:
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:

Code:
#include &lt;pspkernel.h&gt;
#include &lt;pspsdk.h&gt;
#include &lt;systemctrl.h&gt;

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;
}

dxem :
hier mal die makefile vom user payload:

Code:
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:

Code:
#include &lt;pspkernel.h&gt;
#include &lt;pspsdk.h&gt;
#include &lt;systemctrl.h&gt;

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!

soll ich dir mal ein kleinen tip geben? Wink 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^^
boa danke man. es funkt Wink
Referenz-URLs