pspsdk on psp

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

Moderators: cheriff, TyRaNiD

Post Reply
edepot
Posts: 111
Joined: Sat Apr 09, 2005 3:39 pm

pspsdk on psp

Post by edepot »

Is it possible to have a self contained PSP having a C compiler with PSPSDK (all on a large memory stick to hold all the libraries and binary executables). And maybe a virtual keyboard for typing in the commands for editing and compiling? 32MB should be enough memory to hold everything right? (a mini cygwin-like environment).

That way you can just take the PSP anywhere and compile programs instead of lugging around a large laptop where it is not feasible.

I am thinking all that is required is the compiler, an editor, and basic file move, name, deletion, copying would do (file manipulation).
a_noob
Posts: 97
Joined: Sun Sep 17, 2006 8:33 am
Location: _start: jr 0xDEADBEEF

Post by a_noob »

LOL. If this was a Joke thread than nice one. Have you even looked at the size of your pspdev folder?? Mines 204.3mb So fitting all that on a 32mb memory stick Wouldnt be feasable. Also The gcc compiler would have to have some major patches to be able to run on the psp. Plus OSK are way too slow for coding. And even if you did get teh compiler working on/for the psp it would take it quite sometime to compile each program. But since you seem interested why dont you look into it? It is all possible on a larger memory stick it just ends up being way more work than its worth. I used to have the same idea. It still would be nice but it is just not practicall Even with a it keyboard

Code: Select all

.øOº'ºOø.
'ºOo.oOº'
flatmush
Posts: 28
Joined: Tue Aug 07, 2007 9:15 am
Location: Here
Contact:

Post by flatmush »

A_Nub you really should read what people say before attempting to flame them. He means 32Mb ram.
(all on a large memory stick to hold all the libraries and binary executables).
Also I got bored one day and typed up a few KB's of code in FlatEdit so typing on an osk is fine as long as the osk allows for fast typing and you are used to it. The real problem would be porting GCC, while it could be done, nobody wants to because there isn't too much point.

You really should search because this question has been asked and answered about 100 times. There is one option which is to run a compiler through bochs although it would probably be very slow.
futaris
Posts: 45
Joined: Wed Dec 28, 2005 7:47 am

Post by futaris »

Your best bet would be get uclinux on PSP running with memory support. Then it would be a matter of compiling pspsdk on uclinux/psp.
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Re: pspsdk on psp

Post by hlide »

having a JIT compiler would be more senseful than having gcc compiler running on psp.
edepot
Posts: 111
Joined: Sat Apr 09, 2005 3:39 pm

Post by edepot »

I vote for GCC running on the R4000 natively. I mean there already
exists GCC for MIPS R4000, so this shouldn't be so hard. As for the PSPSDK it may be more sensible to just distribute the compiled version,
because it may take the PSP days to make the sdk library like on cygwin for the PC. Getting the whole linux environment running on the PSP is
probably not important. You can get a nice gui compiler/editor that
handles creating programs automatically, so the programmer only
worries about the coding portion. It would save lots of resources and
memory.

In fact, I think if this is done right, it would be more sensible to code
directly on the PSP. The only thing holding this back is a nice keyboard
entry method. (virtual keyboard). So if the aforementioned touchscreen
is possible, it may save a lot of people a lot of headaches. Since you
would be compiling code running on 32MB main memory, the 333Mhz
CPU should be up to the task, you don't need super fast PC quad-core
processors to compile little PSP program modules.
crazyc
Posts: 408
Joined: Fri Jun 17, 2005 10:13 am

Post by crazyc »

edepot wrote:I vote for GCC running on the R4000 natively. I mean there already
exists GCC for MIPS R4000, so this shouldn't be so hard
The PSP does not have an R4000. The R4000 is a 16 year old 64-bit CPU with an MMU. Allegrex is a partial MIPS32R2 CPU without an MMU. A GCC port would be extremely difficult as AFAIK GCC has never been hosted on an MMUless machine.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

All with the 32Mb of RAM?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Art wrote:All with the 32Mb of RAM?
You could get around the 32MB of RAM by going with an older, smaller version of gcc. For example, 2.95 would run on systems with less than 16MB of RAM. I just don't see where a PSP hosted version of gcc would really be helpful.
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

J.F. wrote:
Art wrote:All with the 32Mb of RAM?
You could get around the 32MB of RAM by going with an older, smaller version of gcc. For example, 2.95 would run on systems with less than 16MB of RAM. I just don't see where a PSP hosted version of gcc would really be helpful.
worse, how long would it take to compile a project on PSP... *evil*

seriously, some people really lack of sense.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

I suspect that what he wants could be better handled by learning Lua or python, both of which are already available on the PSP.
edepot
Posts: 111
Joined: Sat Apr 09, 2005 3:39 pm

Post by edepot »

I think many of you are missing the point. If I wanted to code in LUA or Python, or something running interpreted (JIT or not), I wouldn't be asking about a C compiler running natively on the PSP right? It is
a nice challenge, and very do-able too.

Having another layer between code and the metal reduces the speed and memory available on the system. (for the final resultant program)

The eventual goal?
Have something able to code things like the following directly on the PSP and have the final code run directly on the PSP:

http://www.edepot.com/games_asteroids.html
http://www.edepot.com/win95.html

The main chunk for the above programs are under 100KB so don't tell me
the PSP is not capable of compiling things of such small size.
So an bitmap editor, text editor, compiler, and file explorer.
Shouldn't be too hard to interface with all those homebrew os's available.
Now the hard work of converting GCC into a PBP might seem difficult,
but in actuality it is easier than porting an emulator to the PSP and
you see lots of emulators on the PSP.
sashz
Posts: 33
Joined: Thu Feb 23, 2006 1:48 am
Contact:

Post by sashz »

hlide wrote:
J.F. wrote:
Art wrote:All with the 32Mb of RAM?
seriously, some people really lack of sense.
Why not? As start point - asm compiler - adaptation PS2 asm5900 for PSP, and LCC as C compiler (MIPS port already). Well, lcc optimization sucks, but it's as begin :) Also we will need console emulation, i think there is no problem for add screen/ir keyboard support to psplink :)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You don't seem to understand - a compiler is not just "a compiler". Have you looked at the dependency list the pspsdk has? It's at least a DOZEN PACKAGES, all of which depend on other software. It if were just "a compiler", it wouldn't be much of an issue. Only converting a compiler will not give you a PSP development system. Why do you think it takes linux, BSD, OSX, or CygWin as the BASE for building and using the SDK?
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

sashz, a quote isn't a quote when you've edited it, or omitted from it.
how about taking less time and effort to do it properly.

I'm getting a used laptop primarily for PSP programming.
Assuming it will be runnig Win 2K and cygwin, what minumum CPU
and RAM specs are recommended?
Art.
User avatar
tacoSunday
Posts: 34
Joined: Fri Aug 31, 2007 10:05 pm

Post by tacoSunday »

If you want to compile c programs on a resource starved system like the psp. GCC is not going to be of much use. You will need to implement your own compiler. You will have to resort to the tried and true staged methodology. That means many passes over the code to compile it. The less memory you have , the more stages you will have to break it into. Each stage does it's thing and then outputs the result to a file in an intermediate format. The next stage takes the output from the previous stage makes it's personal contribution to the process and dumps it in another intermediate format. This is the way we used to make compilers back in the day before we had gobs of memory coming out of our arses! The psp is not actually that bad off in this sense, but it is still a very tight squeeze for a C compiler.

Compiler theory is not a light subject by any means and C is a very complex place to start your venture into this realm. I would think that you could find source for a c compiler on the internet that was written back in the day(hopefully in c) and port that instead. This is still a lot of work though, as you would have to redo the backend to emit mips and deal with the container format(aka elf) amongst many other things.

Therefore I would have to say that while a C compiler on the psp is technically feasible and even slightly interesting, it just isn't worth the MASSIVE effort required. Now something simpler with a much more rigid syntax would indeed be within the realm of doable wilst retaining your sanity.

Take a look at: http://compilers.iecc.com/crenshaw/

for a very quick and very dirty run through of making your own compiled language.

I promise you will have far more fun and success on your first time out with a toy language.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Art wrote:sashz, a quote isn't a quote when you've edited it, or omitted from it.
how about taking less time and effort to do it properly.

I'm getting a used laptop primarily for PSP programming.
Assuming it will be runnig Win 2K and cygwin, what minumum CPU
and RAM specs are recommended?
Art.
I've got both my main system, and a laptop set up for PSP dev. The laptop is an ECS G320 - a 1GHz C7 VIA EPIA based system. A 1GHz C7 is about like a 700 MHz P3. It came with 128MB of RAM, which worked, but was slow as you had to hit the harddrive all the time for virtual memory. I've since bumped it up to 512MB, which is much better.

Given the processor power mentioned above, it takes about two hours to compile the full SDK (gcc included). Once the SDK is done, apps are no problem... just a few minutes to compile most. So don't be afraid to use OLD P3 systems with little memory. They'll just have a one-time initial setup that takes a few hours, but after that, it should be tolerable. I would recommend a minimum of 256MB of RAM. Gcc tends to be a memory hog, so as much RAM as you can afford is recommended.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Thanks J.F., I've my budget allows for a little bettert than that out of a laptop.
Hopefully a one point something GHz and RAM that comes with it.
My PC with 512Mb has run into RAM issues when I've tried to include to many objects, but I could go back to loading seperate image and sound files
on the PSP,
or putting everything in one big non-standard file for the PSP to load.
Cheers, Art.
Post Reply