PSP_FW_VERSION=271 & 0x1000 (Kernel Mode)

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
califrag
Posts: 30
Joined: Wed Apr 04, 2007 4:43 pm

PSP_FW_VERSION=271 & 0x1000 (Kernel Mode)

Post by califrag »

original post restoration to best of ability:

Trying to create a homebrew compiled with PSP_FW_VERSION=271, was changing

PSP_MODULE_INFO("Test", 0, 1, 1) to PSP_MODULE_INFO("Test", 0x1000, 1, 1)

Everytime I tried to start it would fail with error code 80020148.

Tried adding
BUILD_PRX = 1
USE_KERNEL_LIBS
USE_KERNEL_LIBC
adding -lpspkernel

Nothing worked. Ended up not needing kernel mode after all (thanks Tyranid (: )

the rest was just the basic "Hello World" source code.
Last edited by califrag on Fri Sep 21, 2007 5:27 pm, edited 2 times in total.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Not build a static elf is always a good start, oh and you cannot load a kernel module from an EBOOT at all anyway, at best you need to load a user mode module then boot strap a kernel module from there.

As with anything do you really need kernel mode ? If you say yes then think about it again :P
califrag
Posts: 30
Joined: Wed Apr 04, 2007 4:43 pm

Post by califrag »

edit - solved
Last edited by califrag on Fri Sep 21, 2007 3:07 pm, edited 1 time in total.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You cannot run in kernel mode in the newer firmwares. So just quit trying to go that direction. Your program MUST run in user mode. Then if you need to call something from kernel mode, you need to put that code into an external PRX that loads and runs in kernel mode. Look at the nanddumper example in the 3xxHEN archive to see what I'm talking about. If you look at the newest version of PPA, you'll see that he had ONE SINGLE function that needed kernel mode - a call to change the audio sample rate, so PPA has everything in user mode with a PRX that has one single function - that audio call.
califrag
Posts: 30
Joined: Wed Apr 04, 2007 4:43 pm

Post by califrag »

J.F. Thanks for the response - that clears a lot up - and thanks for stopping me before I invested even more time unsucessfully trying to load kernel mode ;B I've already wasted almost a week lol. I will look into PPA and try the prx route once I'm home from work then will post any results. Thanks again.
califrag
Posts: 30
Joined: Wed Apr 04, 2007 4:43 pm

Post by califrag »

Okay I feel like a complete moron now. Thanks for your help JF seems like my problem was the fact that I was trying to load files from a directory that did not exist. BLAH as soon as I created the directory everything went A OK.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

califrag wrote:Okay I feel like a complete moron now. Thanks for your help JF seems like my problem was the fact that I was trying to load files from a directory that did not exist. BLAH as soon as I created the directory everything went A OK.
Easy mistakes are easy to overlook. Often just talking about them to others allows you to finally see them. That's one reason we ask people to post code when they ask about something. Here's some code on checking for a directory, and making it if it doesn't exist.

Code: Select all

    int d;

    d = sceIoDopen(dir_name);
    if (d >= 0)
        /* directory already exists */
        sceIoDclose(d);
    else
        sceIoMkdir(dir_name, 0777);
Doing something like that, you can avoid the hassle of people not copying over required (but empty) directories when installing the app. I learned that the hard way on one of my apps. :)
califrag
Posts: 30
Joined: Wed Apr 04, 2007 4:43 pm

Post by califrag »

JF that is perfect I was trying something like that myself but for whatever reason could not get it to work correctly. I have a working "fileExists?" function that checks a filepath, but could not get directories down. This will save me from always re-creating the folders when I don't need to! :)
cheriff
Regular
Posts: 258
Joined: Wed Jun 23, 2004 5:35 pm
Location: Sydney.au

Post by cheriff »

califrag: Would it be possible for you to restore youe original post? Or at least something similar please?

One of the great thing about forums (as opposed to say, IRC) is that the topics stay up and someone searching along at a later date may have similar issues - keeping these things up will help them too.
Damn, I need a decent signature!
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

J.F. wrote:
califrag wrote:

Code: Select all

    int d;

    d = sceIoDopen(dir_name);
    if (d >= 0)
        /* directory already exists */
        sceIoDclose(d);
    else
        sceIoMkdir(dir_name, 0777);
Doing something like that, you can avoid the hassle of people not copying over required (but empty) directories when installing the app. I learned that the hard way on one of my apps. :)
sorry but don't you think that sceiomkdir is enough? that's what i use to make the capture folder in my prx. i call it anyway and it's more optimized (space point of view); after all it won't make another dir, the maximum it could do is return an error.
don't you think so?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

weltall wrote:
J.F. wrote:

Code: Select all

    int d;

    d = sceIoDopen(dir_name);
    if (d >= 0)
        /* directory already exists */
        sceIoDclose(d);
    else
        sceIoMkdir(dir_name, 0777);
Doing something like that, you can avoid the hassle of people not copying over required (but empty) directories when installing the app. I learned that the hard way on one of my apps. :)
sorry but don't you think that sceiomkdir is enough? that's what i use to make the capture folder in my prx. i call it anyway and it's more optimized (space point of view); after all it won't make another dir, the maximum it could do is return an error.
don't you think so?
If I remember correctly, it "kills" the old directory. So if the directory exists, you don't get an error, you just get a "clean" directory and all your stuff in it is gone. It's been a while since I worked on that, so I might be remembering that incorrectly. Anywho, looking for the directory before making it also allows you to do something if it does exist compared to when it doesn't. For example, maybe in the does exist branch, you look for some files. It would be silly to look for files right after making the directory - it's empty. So the code I gave could be expanded for other purposes.
califrag
Posts: 30
Joined: Wed Apr 04, 2007 4:43 pm

Post by califrag »

the folder actually doesn't get killed if it already exists. but you're right in that it allows you to do other stuff, i.e. if the folder already exists, rename the old one and create a new one. or whatever you may want.
Post Reply