uClinux on the PSP

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

Moderators: cheriff, TyRaNiD

Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Re: Something simple to do

Post by Cpasjuste »

No problems, i could make it. I need to familiarise with uclinux on the psp first and set the environement on my computer of course. I take a look on this right now.

There is no ethernet driver for now ?
chrismulhearn wrote:If anyone is really looking to help the project and doesn't know what exactly they should do, I have a good idea. Get a "live CD" development environment going: A bootable linux system iso that takes all the hassle out of installing the toolchain/kernel/userland libraries/etc.

So the xiptech toolchain, uClibC, SDL, (any other libraries we start throwing in), and the kernel would all be on the ISO already compiled etc.

I'm not sure how those "live cd" linux things work, where do you write your non-transient storage? I guess /bin /etc all that could be on the ISO, but /usr/local and /home/ could be actual partitions... Or even just filesystem images that are files on your regular OS's drive.

For example, for a windows user with C: as their primary IDE master, we would mount /dev/hda1 /mnt
mount -o loop /mnt/usrlocal.img /usr/local
mount -o loop /mnt/home.img /home

This way you could read/write /usr/local/ and /home (and thats where all your psp linux development would happen) and if you were a windows user who didn't want to do any drive partitioning, you wouldnt have to!

Just a thought, let me know if anyone is interested, it could help get rid of some of the initial learning curve.
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Xiptech website is down, can you provide a link for the toolchain :)

Edit: its ok i got it.
Well, alexp is right, people that want to work on this should already have a linux set up .. but i'll do it because its fun.

Edit 2 :

Did you tried the Xiptech's toolchain builder recently ? because it's all fuc***. There was some problem with the downloads since it use some old version of ulibc etc, so i downloaded them manually, but it wont compile, giving a lot of errors.
chrismulhearn
Posts: 80
Joined: Wed Feb 22, 2006 4:43 am

Post by chrismulhearn »

Heh, in the same email you state

1. That people who want to work on this should know how to set it up.

2. That you are having trouble w/ the f'ed up xiptech toolchain installer.

Thanks for proving my point that a livecd development environment would be an asset.

-Chris
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Hehe ... this don't answer my question.

The problem is that the Xiptech toolchain is a big piece of crap and that it was made there is 17 years ago ... i would have to rewrite the building script from A to Z to work.
7oby
Posts: 25
Joined: Fri Jun 09, 2006 2:18 am

Post by 7oby »

I started some work on a live CD and would like to have some feedback.

Actually I did not follow the idea of a live CD, but instead used coLinux, which is a Linux kernel that can run in parallel with Windows.

Advantages
. no need to reboot Windows
. fairly fast
. persistent storage in a Windows file containing an ext3 filesystem
. easy data exchange between systems

Requirements
. Windows 2000/XP
. litte more than 1GB of HD Space
. 256MB of free Ram

Installation
. Download and Install coLinux 0.7.1 pre-release of its website here - just the coLinux-0.7.1-SOMEDATE.exe. In case the installer asks do install TAP-Win32 Adapter. Installer will also ask for initial system: If possible select none (= will be overriden by subsequent installation files) otherwise choose something you prefer.
. Open this page (valid until 2007/08/07). Next to "Zugangscode" enter "psplive". Click button "GMX MediaCenter starten". Download kernel_and_config.zip (2,7MB) and Debian-3.0r2.ext3-mit-backports.zip (290MB). Unzip both archives to the install directory of coLinux (e.g. C:\Programs\coLinux).
. Change cobd0= path in file example.conf in case you did not install to C:\Programs\coLinux

Usage
. execute "C:\Programs\coLinux\colinux-daemon.exe @example.conf"
. wait for system to boot and login. Username/Password : psp/psp
. cd /usr/local/src/linux-2.4.19
. mv linux.srec linux.srec.old
. make clean
. make
. verify that linux.srec has been built successfully.

Other Information
. Linux Distribution used is Debian Sarge 3.1 with backports enabled
. root password : root
. xiptech toolchain put to /opt/toolchain
. share your internet connection (=ICS) with the installed TAP-Win32 Adapter and you are able to access internet from inside Linux
. SSH Server is running such that files can be exchanged or logged into the machine. Use ifconfig in Linux to find your DHCP IP. In my case it's 192.168.0.40 and connect to machine.
. use dselect or aptitude to install more packages (= Debian package management)

ToDo
. install samba for easy file exchange with Windows
. install x11vnc to have graphical interface with Windows
. install Windowmanager and IDE e.g. Eclipse
. agree on location for Xiptech toolchain
. install libraries such as SDL and other include, libs of toolchain. In fact currently only the binary tools /opt/toolchain/bin have been symlinked to /usr/local/bin

The same could be done using any other distribution you are more familiar with. Currently I am running very low on time and I would be glad if other guys jump in and configure the ToDo stuff.

regards,
7oby
Last edited by 7oby on Mon Jul 09, 2007 1:33 am, edited 3 times in total.
7oby
Posts: 25
Joined: Fri Jun 09, 2006 2:18 am

Post by 7oby »

clicked wrong button - can't delete post. Thanx for this inconvencience.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

We've had issues in the past with someone going through and deleting all their posts late one night because he got angry or something. It was rather annoying.

Usually if you edit it with a 'delete me please' someone gets around to deleting it for you.
cloudhunter
Posts: 86
Joined: Thu Aug 17, 2006 3:27 am

Post by cloudhunter »

Rather than using a VNC server, use an windows X server, like mingw. For ideas, I suggest you look at "andlinux". It originally was built for GP2X dev, but has since evolved.

An windows manager isn't really important if you are using a windows x server.

Rather than using samba, it is often faster and with less overhead to use "cofs", a filesystem driver built into colinux.

Cloudy
:)
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Does someone of you tried the Xiptech toolchain ... ?
chrismulhearn
Posts: 80
Joined: Wed Feb 22, 2006 4:43 am

Post by chrismulhearn »

Lots of people have used the Xiptech toolchain, including myself.

It is failing because it can't find some files, right? Some files that it tries to put in some dl/ directory? Just find the files yourself and stick it in the dl/ directory.

-Chris
white rabbit
Posts: 60
Joined: Wed Jul 06, 2005 7:03 pm

Post by white rabbit »

Right, I'm moving jobs (after just getting the house move finished (with lots of DIY still left to do)) so I'm back for a short while, no doubt before I dissapear again for a few months as has become my habit.

I was looking for my uLinux thread and saw this on the front page so had a look.

Well done Chris! I came up against a brick wall and stopped.

I will be getting a copy and trying to get it onto my PSP later (though I have a fair chunk of stuff to do with the PSP and SDK to get back up to speed 1st).

As I'm pretty lazy, can somebody tell me before I go looking:
Is the IR port running in the port?
Can I log into a shell on uLinux on the PSP?

If I can do both, I'll get myself one of those jazzy folding keyboards with the IR thing on the top and get working on code writing on uLinux on the PSP for the PSP whilst commutting on the train.
If I can get this far then I can us the Fiance's 3G mobile card and WiFi to hook into the 'net too :)
I will be able to develop PSP Homebrew on the train and access the web on the PSP :) Oh the joy... wow, sometimes my geek level can worry me!
daisuke0kun
Posts: 3
Joined: Sat May 19, 2007 11:42 am

Post by daisuke0kun »

You can indeed use the snazzy IR port with a Palm 3169WW keyboard and you can use the shell within the PSP, but unfortunately there's not been a wireless driver yet, so sshing in would be pretty tricky. Check out Chris' webpage on this, it's pretty handy and details what's working and what's not.

To Chris - Good work man! I've kept up with the details of this project for a while, but I thought it was beyond me to help out, simply because I didn't have any of the hardware needed. The keyboard development was a breakthrough though, and now that I finally have enough money to grab one (there's never enough money for a poor student :( ) I figured I should register and say congrats. Hope to see more of you around - helping out will be awesome!
daisuke0kun
Posts: 3
Joined: Sat May 19, 2007 11:42 am

Post by daisuke0kun »

Hrm... I was going to try your Debian Sarge toolchain environment, 7oby, but the download link is not valid anymore. Would you mind reuploading it for me and perhaps others that would like to use it? (if not, that's okay too :P)

Edit: The reason I ask is I'm getting an error creating the toolchain (go figure, right?), when "Configuring in mipsel-linux/libiberty". The make runs (pretty much) fine up until the point when it checks if the C compiler can create executables. Much to my dismay, it can't. I've tried with gcc-3.4 and gcc-3.3, in case that was the issue, make clean'ed a billion times, and it doesn't budge. It's probably some stupid mistake on my part somewhere along the line. My point in mentioning all this is if someone can help me out, that'd be excellent, but if not I'm just gonna create a quick Debian system in Qemu and start over from there (who knows, maybe I'll have better luck.) If 7oby doesn't reupload his image, well then I'll just have to contribute mine (though it's a pity to redo work when otherwise unnecessary.)
7oby
Posts: 25
Joined: Fri Jun 09, 2006 2:18 am

Post by 7oby »

daisuke0kun wrote:Hrm... I was going to try your Debian Sarge toolchain environment, 7oby, but the download link is not valid anymore.
Done and link above updated.

Sorry for the inconvenience. The server is pretty fast, but only allows me to serve for 30 days.
IM back!
Posts: 44
Joined: Tue Apr 17, 2007 9:53 pm

Post by IM back! »

thanks for all the work put into this so far!
sorry for spelling!
damned
Posts: 1
Joined: Fri Jun 15, 2007 10:34 pm

another way round

Post by damned »

Would it be easier to solve irq:s and stuff like that with known hardware? I mean, if anyone could make implementation agains usb-port (that might be easier to develop against usb-cable hooked laptop that sends static stream). Then we would easily have acess to some permanent storage and wi-fi (usbfs, other non-native sticks and non native usb wifi). It should be more easier to reverse engineer psp hardware against known hardware, i think?

-- Dmd
mEo
Posts: 6
Joined: Fri Aug 04, 2006 9:17 am
Location: Hong Kong
Contact:

Post by mEo »

What is the status with this project?
I have been trying to compile the binaries, fixed up several wrong urls, but am still having trouble.
I'd love to do some coding for this, but I just need a working environment. Is there a better toolchain somewhere?

Also, why isn't it possible to distribute the compiled linux files? If all you need is hosting, I don't mind hosting a couple of files.
7oby
Posts: 25
Joined: Fri Jun 09, 2006 2:18 am

Post by 7oby »

mEo wrote:What is the status with this project?
For this project to really take off drivers for utilizing the memory stick and W-Lan are very desirable: The memory stick for persistent storage - right now all modifcations you do while running linux vanish upon reboot. You have to put everything you need up front into the corresponding ram disk. The W-lan driver would make it easier to connect to the device (e.g. ssh).
mEo wrote:I have been trying to compile the binaries, fixed up several wrong urls, but am still having trouble.
I'd love to do some coding for this, but I just need a working environment. Is there a better toolchain somewhere?
All information required to get the toolchain is spread over this thread.

A working environment with a working toolchain out of the box is available here:
http://forums.ps2dev.org/viewtopic.php?p=53318#53318
mEo
Posts: 6
Joined: Fri Aug 04, 2006 9:17 am
Location: Hong Kong
Contact:

Post by mEo »

I'll have a look at that windows livecd, when i am next on a windows system though, currently I use linux.
Not keeping any changes sounds expected, similar to the Palm Linux project. That actually resets the entire device, so restoring backups after using it, essential :P

Well, if i can get the coLinux there working, i'll give developing a go. thanks for that
chrismulhearn
Posts: 80
Joined: Wed Feb 22, 2006 4:43 am

Post by chrismulhearn »

What URLs were wrong?

And what do you mean, why isn't it possible to distribute binaries?

"Pre-built kernel. Copy to root directory of your psp's memory stick."

"Source code + binaries for firmware 1.5"

Kinda makes you sound a little crazy, doesnt it.
M.Jackson
Posts: 85
Joined: Mon Sep 10, 2007 6:37 pm
Contact:

Post by M.Jackson »

Hi everyone. I am just a beginner in psp programming, still I found this idea of porting a linux to psp was so fascinating that lately I started porting one on my own as well. Instead of using the port from xiptech, I decided to start from the 2.6 kernel which unfortunately does not support the nommu variant for mips (why not xiptech? perhaps I got too much time to kill...just kidding :) Now I found myself stuck at a point where the system is flooded by irq IP2 (cp0.cause & cp0.status = 0x400) after interrupts are enabled (at some point along start_kernel). The irq requests are so overwhelming that it totally exhausts the cpu whereby the normal execution flow is virtually stopped. Not even installing an empty irq handler that consumes very little cpu time would make a difference at all.

IP2 is supposed to be related to UARTx (is that right?) and I am using UART3 to receive system output (using simple read/write routines that Chris provided). Does this have anything to do with the IP2 surge? Is there anything I missed in the handling of these interrupts?

Thanks!
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

M.Jackson wrote:IP2 is supposed to be related to UARTx (is that right?) and I am using UART3 to receive system output (using simple read/write routines that Chris provided). Does this have anything to do with the IP2 surge? Is there anything I missed in the handling of these interrupts?

Thanks!
PSP is not a standard MIPS. It has its own IRQs which probably use IP2 as a cascade IRQ. You need to mask them with MTIE instruction.

Possible hierarchical tree of IRQs (number before IRQ is a intr number in PSP kernel)

Code: Select all

|
+- IP2 CASCADE IRQ
|  |
|  +- 0 UART_ALL   
|  |  |
|  |  +- 32 UART1   
|  |  +- 33 UART2   
|  |  +- 34 UART3   
|  |  +- 35 UART4   
|  |  +- 36 UART5
|  |  +- 37 UART6   
|  |  +- 38             
|  |  +- 39
|  |
|  +- 1 SPI_ALL
|  |  |
|  |  +- 40 SPI1   
|  |  +- 41 SPI2   
|  |  +- 42 SPI3   
|  |  +- 43 SPI4   
|  |  +- 44 SPI5   
|  |  +- 45 SPI6   
|  |  +- 46             
|  |  +- 47             
|  |
|  +- 2 TIM_PERI_ALL   
|  |  |
|  |  +- 48 TIM1_PERI   
|  |  +- 49 TIM2_PERI   
|  |  +- 50 TIM3_PERI   
|  |  +- 51 TIM4_PERI   
|  |  +- 52             
|  |  +- 53             
|  |  +- 54             
|  |  +- 55             
|  |
|  +- 3 USB_ALL
|  |  |
|  |  +- 56         USB_TS    USB Resume
|  |  +- 57         USBCON_TS    USB Ready
|  |  +- 58         USBDIS_TS    USB Connect
|  |  +- 59         USBREADY_TS    USB Disconnect
|  |  +- 60         SMS1_CON    Memstick Insertion (MSCM1)
|  |  +- 61         SMS1_DISCON    Memstick Removal (MSCM2)
|  |  +- 62         SMS2_CON    WLAN
|  |  +- 63         SMS2_DISCON    WLAN
|  |
|  +- 4 GPIO
|  +- 5 ATA
|  +- 6 SPOCK
|  +- 7 SMS1
|  +- 8 SMS2
|  +- 9 MG   
|  +- 10 AUDIO1   
|  +- 11 AUDIO2   
|  +- 12 IIC
|  +- 13 KEY   
|  +- 14 SIRCS
|  +- 15 TIM0_SYS
|  +- 16 TIM1_SYS
|  +- 17 TIM2_SYS
|  +- 18 TIM3_SYS
|  +- 19 COUNT
|  +- 20 EMC_SM
|  +- 21 DMAC128
|  +- 22 DMAC_SC1
|  +- 23 DMAC_SC2
|  +- 24 KIRK
|  +- 25 AW
|  +- 26 USB_MAIN   
|  +- 27             
|  +- 28             
|  +- 29             
|  +- 30 VSYNC
|  +- 31 SYS_REG
|
+- IP0 64 SOFT1   
|
+- IP1 65 SOFT2
|
+- IP7 66 CPUTIMER
M.Jackson
Posts: 85
Joined: Mon Sep 10, 2007 6:37 pm
Contact:

Post by M.Jackson »

Problem solved! I just made 0xbc300008 = 0 and it worked! Great thanks!

btw, what is a MTIE instruction? I googled it but nothing useful came out...

Thanks again!
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

M.Jackson wrote:Problem solved! I just made 0xbc300008 = 0 and it worked! Great thanks!

btw, what is a MTIE instruction? I googled it but nothing useful came out...

Thanks again!
hummm you're right i thought it was E (like enable) but it is C (controller) : MTIC and MFIC

Move To Interrupt Controler : mtic rt, r0 -> set a 32-bit interrupt mask. Kind of selective CLI/STI on interrupts
Move From Interrupt Controler : mfic rt, r0 -> get a 32-bit interrupt mask.

just google MTIC or MFIC for their usage
M.Jackson
Posts: 85
Joined: Mon Sep 10, 2007 6:37 pm
Contact:

Post by M.Jackson »

hey! I finally got the 2.6 kernel (2.6.22-uc1) up and running on my psp with a simple serial driver, a framebuffer driver and busybox 1.7 working quite nicely at the moment.

Image
Image

To make this work, not only the kernel but also the toolchain (which I downloaded from xiptech and which seemed to be customized for 2.4 kernel and non-mmuless systems) and busybox need to be patched (which really gave me headaches in the past few weeks). Though at this stage all the changes I made still look primitive (a bit messy maybe), I am looking for a place where I can share my code once they take a better shape. Thanks to everyone and this forum where I gained lots of help :)
M.Jackson
Posts: 85
Joined: Mon Sep 10, 2007 6:37 pm
Contact:

Post by M.Jackson »

Now I am still using the serial port (uart3) wired to my pc as the sole input channel to type commands to the console, which is kind of inconvenient as I can not carry my pc around as what I can do with the psp. I was thinking it would be fantastic if I can utilize the joy pad on psp to sort of emulate a keyboard or something. But I could not find any related information about the joy pad, not even from the mighty book of yet-another-psp-doc (or maybe I just overlooked it).

Does anyone know anything about it? like how can I read status or get interrupt notification from a joypad button?

Thanks!
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

See booster's recently-released "psp ipl sdk". It should have code to init the syscon chip and read buttons without using sony libraries.
M.Jackson
Posts: 85
Joined: Mon Sep 10, 2007 6:37 pm
Contact:

Post by M.Jackson »

wow, this ipl package is like the most stunningly remarkably ingenious thing i have ever seen. it's got everything nicely packed together, just so beautiful...man how come i just noticed this?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

M.Jackson wrote:wow, this ipl package is like the most stunningly remarkably ingenious thing i have ever seen. it's got everything nicely packed together, just so beautiful...man how come i just noticed this?
Because it only came out the day before? ;)
stmonkeydoom
Posts: 1
Joined: Tue Oct 16, 2007 12:31 am

Files gone?

Post by stmonkeydoom »

The files on Mr. Mulhearn site seem to be missing. No boot loader, no prebuilt Kernel, none of them. Is there any other site I can get them at?
Post Reply