Subject: Porting To New System

From: "developer" <[email-masked]>
Date: Fri, 27 May 2005 03:11:23

Hello all,

I'm a long time Linux user, and computer engineering student. I've recently become interested in porting Linux to Sony's PSP gaming system. I'm wanting to do this mainly as an exercise in understanding the kernel better, also I just think it would be neat :). The PSP system has a MIPS R4000 CPU which is already supported so it is my understanding that the port should not be so difficult, not to say that I think it will be easy. At this time I have a gcc toolchain set up which allows me to write and execute code on the PSP, however I have never attempted a kernel port so I'm a little unsure on what to do. I'm looking for someone who wouldn't mind assisting me with my project by helping me with my questions on the porting process. I you have time to answer a few emails here and there, and would like to help me, I would greatly appreciate it.

Thanks,
Cameron Cooper

---

From: Stanislaw Skowronek <[email-masked]>
Date: Fri, 27 May 2005 06:37:34 +0200 (MET DST)

First, does the PSP's processor have a MMU? If not, then there is not much
point in porting Linux (or for that matter, anything else). A machine
without a MMU is pretty worthless under Linux except as a fixed-function
embedded system; to wit, mmap(2) will not work.

Next, see http://www.linux-mips.org/wiki/index.php/Porting - it's
excellent. I don't know if a PSP has an accessible serial port - if not,
then you are somewhat screwed (OK, so not that bad; I've done a port that
used graphical display from the beginning for all debugging purposes).

You've got to do three things:
 1) use lines no longer than 80 chars in your mails ;)
 2) get all docs on the PSP you can get - reverse engineering is fun but
    only if you enjoy hacking for 14 hours a day,
 3) take a look at some directory in arch/mips.

Of course, the hardest of them is (2) in my experience, unless Sony felt
generous at the time and released all PSP docs. My port was completely
reverse-engineered but I wouldn't advise to do that unless you are sure
you can spare the time and effort.

Oh, and one more thing: USE THE CVS LINUX-MIPS.ORG TREE! The kernel.org
tree is so out of sync that it's virtually worthless.

Cheers,

Stanislaw Skowronek

---

From: "Ed Okerson" <[email-masked]>
Date: Thu, 26 May 2005 22:13:57 -0700 (PDT)

> Hello all,
>
> I'm a long time Linux user, and computer engineering student. I've
> recently become interested in porting Linux to Sony's PSP gaming system.
> I'm wanting to do this mainly as an exercise in understanding the kernel
> better, also I just think it would be neat :). The PSP system has a MIPS
> R4000 CPU which is already supported so it is my understanding that the
> port should not be so difficult, not to say that I think it will be easy.
> At this time I have a gcc toolchain set up which allows me to write and
> execute code on the PSP, however I have never attempted a kernel port so
> I'm a little unsure on what to do. I'm looking for someone who wouldn't
> mind assisting me with my project by helping me with my questions on the
> porting process. I you have time to answer a few emails here and there,
> and would like to help me, I would greatly appreciate it.

You should probably have a look at http://www.psp-linux.org/ click on
messages boards at the top of the page to get to all the action.  I am
sure these guys can answer all your questions.

Ed Okerson

---

From: Stanislaw Skowronek <[email-masked]>
Date: Fri, 27 May 2005 07:40:23 +0200 (MET DST)

> sure these guys can answer all your questions.

Hurm, hurm. I think that the closed-circle development model is, uhm, less
efficient - there are no tech info on the forums which means nobody can
try and follow. They just finished organizing themselves, and it took them
*three months*. Three months wasted on choosing developers. He he he.

That said, they have really hard work to do - I wish them all the luck
they need, which is *a lot*. Cracking locked-down systems with proprietary
formats is incredibly hard. It's hard enough when they aren't proprietary,
or when they aren't deliberately locked-down.

Stanislaw Skowronek

PS. There are also some funny things there, like "Off-Topic: please keep
related to the PSP". Maybe I'm just an anal-retentive paranoid (OK, I know
I am), but when I see something like that I feel put upon. It's like all
those "keep off the grass" and "private property, survivors will be shot
again" signs. Placed in the middle of Sahara.

---

From: Kumba <[email-masked]>
Date: Fri, 27 May 2005 02:22:27 -0400

> or when they aren't deliberately locked-down.

With this in mind, I'm watching the port of Linux to the Nintendo DS.  They 
apparently just got 2.6 and framebuffer working, so it'll be interesting to see 
where they go with it.  Given the DS is a far more constrained system, and 
Nintendo not very forthcoming on their hardware specs, I'm surprised at the 
speed with which they've gotten things working.

And PSP isn't entirely closed -- it is based to a certain degree off PS2 
hardware, of which Sony release 6 of a supposed 7 total technical documents 
regarding the innards of the system.  Now I imagine alot of the custom hacks 
needed to support the R5900 in PS2 aren't needed in PSP, since it uses a more 
standard CPU, this might have an impact on how fast or slow they wind up porting 
the kernel.

--Kumba

-- 
"Such is oft the course of deeds that move the wheels of the world: small hands 
do them because they must, while the eyes of the great are elsewhere."  --Elrond

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 27 May 2005 23:51:41 +0100

On Fri, May 27, 2005 at 03:11:23AM +0000, developer wrote:

> I'm a long time Linux user, and computer engineering student. I've recently become interested in porting Linux to Sony's PSP gaming system. I'm wanting to do this mainly as an exercise in understanding the kernel better, also I just think it would be neat :). The PSP system has a MIPS R4000 CPU which is already supported

Nitpicking - it's probably an 4K, not R4000 which is ~ '91 vintage.

  Ralf

---

From: Cameron Cooper <[email-masked]>
Date: Sat, 28 May 2005 15:43:44 -0400

> Nitpicking - it's probably an 4K, not R4000 which is ~ '91 vintage.

It's a R4000.

http://www.linux-mips.org/wiki/index.php/PSP

Cameron

---

From: Thiemo Seufer <[email-masked]>
Date: Sat, 28 May 2005 21:50:11 +0200

> http://www.linux-mips.org/wiki/index.php/PSP

That's what the press release claims, but it is most likely wrong.

Thiemo

---

From: Ralf Baechle <[email-masked]>
Date: Sat, 28 May 2005 20:55:03 +0100

> http://www.linux-mips.org/wiki/index.php/PSP

Don't believe everything you read ...  Sony claims the processors are two
R4000 32-bit cores.  Which is obvious nonsense, the R4000 is 64-bit.

  Ralf

---

From: Cameron Cooper <[email-masked]>
Date: Sat, 28 May 2005 15:55:43 -0400

> R4000 32-bit cores.  Which is obvious nonsense, the R4000 is 64-bit.

Thanks, that is very useful to know.

Cameron