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 

PSP_FW_VERSION=271 & 0x1000 (Kernel Mode)

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



Joined: 04 Apr 2007
Posts: 30

PostPosted: Fri Sep 21, 2007 4:16 am    Post subject: PSP_FW_VERSION=271 & 0x1000 (Kernel Mode) Reply with quote

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
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Sep 21, 2007 6:52 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
califrag



Joined: 04 Apr 2007
Posts: 30

PostPosted: Fri Sep 21, 2007 7:24 am    Post subject: Reply with quote

edit - solved

Last edited by califrag on Fri Sep 21, 2007 3:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Sep 21, 2007 8:02 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
califrag



Joined: 04 Apr 2007
Posts: 30

PostPosted: Fri Sep 21, 2007 9:26 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
califrag



Joined: 04 Apr 2007
Posts: 30

PostPosted: Fri Sep 21, 2007 3:06 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Sep 21, 2007 4:14 pm    Post subject: Reply with quote

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:
    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. :)
Back to top
View user's profile Send private message AIM Address
califrag



Joined: 04 Apr 2007
Posts: 30

PostPosted: Fri Sep 21, 2007 4:28 pm    Post subject: Reply with quote

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! :)
Back to top
View user's profile Send private message
cheriff
Regular


Joined: 23 Jun 2004
Posts: 262
Location: Sydney.au

PostPosted: Fri Sep 21, 2007 4:47 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Sat Sep 22, 2007 4:24 am    Post subject: Reply with quote

[quote="J.F."]
califrag wrote:

Code:
    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?
Back to top
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Sep 22, 2007 6:43 am    Post subject: Reply with quote

weltall wrote:
J.F. wrote:

Code:
    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.
Back to top
View user's profile Send private message AIM Address
califrag



Joined: 04 Apr 2007
Posts: 30

PostPosted: Sat Sep 22, 2007 10:12 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
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