forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error 80020190 on loading Usermodule

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Coldbird



Joined: 08 Feb 2007
Posts: 155

PostPosted: Thu Feb 18, 2010 10:50 am    Post subject: Error 80020190 on loading Usermodule Reply with quote

I wanted to do it like TyRaNiD and load a little usermodule to circumvent some user / kernel limitations and import some of my kernel module exports...

Sounds nice in theory, that's what happens when I try to turn it into reality.

Code:
Kernel Loader Start
Module Loader patched. Adhoc -> Infra.
ms0:/seplugins/onliner/onliner_user.prx loaded just fine.
ms0:/seplugins/onliner/onliner_user.prx Start: 80020190 - Status: 0
Kernel Loader End


Starting the module results in sceKernelStartModule returning 80020190 which means "no memory" if that error list i checked is right.

But how can a usermodule that has a - pretty empty - module_start and no module_stop and is only 1.1 Kilobyte in size to produce such a error?

I'm pasting the sourcecode of the files in here so you guys have a easier time helping me figure this out.

Makefile
Code:
TARGET = onliner_user
OBJS = main.o debug.o

BUILD_PRX=1
PRX_EXPORTS=exports.exp

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
LDFLAGS= -mno-crt0 -nostartfiles
ASFLAGS = $(CFLAGS)

LIBDIR =

LIBS =

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


main.c
Code:
#include <pspkernel.h>
#include <pspsdk.h>
#include "debug.h"

PSP_MODULE_INFO("onliner_user", PSP_MODULE_USER, 1, 1);
PSP_MAIN_THREAD_PARAMS(0x20, 64, PSP_THREAD_ATTR_USER);
PSP_MAIN_THREAD_NAME("onliner_user");

//module start
int module_start(int args, void *argp)
{
   //result
  int result = 0;

  //debuglog
  debuglog("User Module is alive!\n");

  //return result
  return result;
}

//module stop
int module_stop(int args, void *argp)
{
  //result
  int result = 0;

  //return result
  return result;
}


debug.S
Code:
   .set noreorder

#include "pspstub.s"

   STUB_START "debug",0x40090000,0x00030005
   STUB_FUNC  0xAA692D9D,debuglog
   STUB_FUNC  0x74C12D64,writeBufferToFile
   STUB_FUNC  0x539D6184,appendBufferToFile
   STUB_END


debug.h
Code:
#ifndef _DEBUG_H_
#define _DEBUG_H_

//Debuglog
int debuglog(const char * format, ...);

//Write Buffer to File
int writeBufferToFile(const char * path, void * buffer, int buflen);

//Append Buffer to File
int appendBufferToFile(const char * path, void * buffer, int buflen);

#endif


exports.exp
Code:
PSP_BEGIN_EXPORTS
PSP_EXPORT_START(syslib, 0, 0x8000)
PSP_EXPORT_FUNC(module_start)
PSP_EXPORT_FUNC(module_stop)
PSP_EXPORT_VAR(module_info)
PSP_EXPORT_END
PSP_END_EXPORTS


I beg you guys help me out with this one.
To give some more information, I'm loading the kernel module just fine using game.txt in custom firmware 5.50 GEN-D3, the kernel module in turn loads this user module and starts it but fails with the error mentioned above.

I've tested this with several umds, including (but not limited to just):
Warriors Orochi 2, Dungeon Siege - Throne of Agony, and Final Fantasy Dissidia.
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
Coldbird



Joined: 08 Feb 2007
Posts: 155

PostPosted: Thu Feb 18, 2010 11:02 am    Post subject: Reply with quote

1. Problem solved. For those having the same problem, try to be fast, give your kernel loader a high priority and sneak the module into memory before libc has a chance to allocate the rest of memory for its own heap / stack.

2. Problem arises...

Code:
Kernel Loader Start
ms0:/seplugins/onliner/onliner_user.prx loaded just fine.
ms0:/seplugins/onliner/onliner_user.prx Start: 03C39B15 - Status: 0
Module Loader patched. Adhoc -> Infra.
Kernel Loader End


Module starts fine now... but where in gods sake is the debug output of module_start? "User Module is alive!" is nowhere to be seen in the debug output...
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group