| View previous topic :: View next topic |
| Author |
Message |
califrag
Joined: 04 Apr 2007 Posts: 30
|
Posted: Fri Sep 21, 2007 4:16 am Post subject: PSP_FW_VERSION=271 & 0x1000 (Kernel Mode) |
|
|
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 |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Fri Sep 21, 2007 6:52 am Post subject: |
|
|
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 |
|
 |
califrag
Joined: 04 Apr 2007 Posts: 30
|
Posted: Fri Sep 21, 2007 7:24 am Post subject: |
|
|
edit - solved
Last edited by califrag on Fri Sep 21, 2007 3:07 pm; edited 1 time in total |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Fri Sep 21, 2007 8:02 am Post subject: |
|
|
| 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 |
|
 |
califrag
Joined: 04 Apr 2007 Posts: 30
|
Posted: Fri Sep 21, 2007 9:26 am Post subject: |
|
|
| 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 |
|
 |
califrag
Joined: 04 Apr 2007 Posts: 30
|
Posted: Fri Sep 21, 2007 3:06 pm Post subject: |
|
|
| 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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Fri Sep 21, 2007 4:14 pm Post subject: |
|
|
| 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 |
|
 |
califrag
Joined: 04 Apr 2007 Posts: 30
|
Posted: Fri Sep 21, 2007 4:28 pm Post subject: |
|
|
| 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 |
|
 |
cheriff Regular
Joined: 23 Jun 2004 Posts: 262 Location: Sydney.au
|
Posted: Fri Sep 21, 2007 4:47 pm Post subject: |
|
|
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 |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Sat Sep 22, 2007 4:24 am Post subject: |
|
|
[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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sat Sep 22, 2007 6:43 am Post subject: |
|
|
| 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 |
|
 |
califrag
Joined: 04 Apr 2007 Posts: 30
|
Posted: Sat Sep 22, 2007 10:12 am Post subject: |
|
|
| 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 |
|
 |
|