uClinux on the PSP

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

Moderators: cheriff, TyRaNiD

hagisbasheruk
Posts: 7
Joined: Mon Jan 22, 2007 9:30 pm

Post by hagisbasheruk »

It is great that you have got the keyboard functioning Chris.I have an idea that if you were to some how implament may help other people who don't have an IR keyboard.
Looking at my desk while browsing this post drew my eye towards my HP Jornada 720
Image
which has its own keyboard and IR port,this gave me the idea that mabey i and others could use a WinCE or Linux device like this as our IR-keyboard instead of going out to buy another gadget to clutter our desks.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Re: uClinux - now with keyboard!

Post by J.F. »

chrismulhearn wrote:Thanks for the suggestion about the keyboard.

I wrote the driver tonight and it frigging rocks.

Manually creating the key translation map, on the other hand, did not rock. hehehe.

Once i neaten it up tomorrow [few keys are wrong etc] i'll post the newest kernel. now with framebuffer console + keyboard support!
I'll certainly be trying it.

Yes, keymaps can be tedious to put together, and one goof can throw off many other keys. It's just one of those things that you either just bite the bullet and get it over with, or recruit someone else to do it for you. :D
prpik
Posts: 2
Joined: Mon Feb 12, 2007 9:44 pm

Post by prpik »

hlide wrote:
crazyc wrote:
hlide wrote:
  • - 18, 1C and 1D are like a CREATE DIRTY EXCLUSIVE operation
    - 19 is a HIT INVALIDATE operation
    - 1A is a HIT WRITEBACK operation
    - 1B is a HIT WRITEBACK AND INVALIDATE operation
    - 1E and 1F are a FILL operation because of the first test
A function in the ME kernel in firmware 3.02 uses 0x16 and 0x1c. It applies 0x1c to a location on the stack then uses that memory and that just above it frequently. It then uses 0x16 to the same address before it returns. So 0x1c as CREATE DIRTY EXCLUSIVE or LOCK and 0x16 as UNLOCK seems to make sense. It also uses 0xa and 0x1e but
0x16 : INDEX UNLOCK ? because i would be tempted to think a cache operation between 10 and 17 is relative to INDEX.

0x1C seems to be used as a CREATE DIRTY EXCLUSIVE AND LOCK for the very reason the allocated values in stack don't need to be filled. So we can consider they're using a cache line as a fast memory to make something temporary.

0x0A : icache, address. We need another code to test the range of 0x08 until 0x0F.

0x1E : dcache, address. FILL. Prefetch data ?

Wow,
this really rocks!
Can't wait to see cache+framebuffer released (too bad Xiptech did not ported last uClinux and uClibc releases, maybe one day...)

By the way, I can confirm that:
0x06 is Icache Index Unlock
0x16 is Dcache Index Unlock
0x19 is Dcache Hit Invalidate

I'm also pretty sure that:
0x1C is Dcache Create Dirty Exclusive with Lock
0x1E is Dcache Fill
0x1F is Dcache Fill with Lock

Hope this helps
crazyc
Posts: 408
Joined: Fri Jun 17, 2005 10:13 am

Post by crazyc »

hlide wrote: 18, 1C and 1D are like a CREATE DIRTY EXCLUSIVE operation
Looking though the 1.50 utils.prx, there is a function called sceUtilsKernelDcacheDirtyExclusiveRange and sure enough, it uses cache op 0x18.
chrismulhearn
Posts: 80
Joined: Wed Feb 22, 2006 4:43 am

Site updated

Post by chrismulhearn »

Kernel source with Keyboard Driver (WX3369 or whatever its called, the Palm IR keyboard) and Framebuffer Console (and port of SDL)

http://df38.dot5hosting.com/~remember/chris/
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Re: Site updated

Post by J.F. »

chrismulhearn wrote:Kernel source with Keyboard Driver (WX3369 or whatever its called, the Palm IR keyboard) and Framebuffer Console (and port of SDL)

http://df38.dot5hosting.com/~remember/chris/
Cool! Now I gotta try it. :)

It's the Palm 3169ww Wireless Keyboard. :)
prpik
Posts: 2
Joined: Mon Feb 12, 2007 9:44 pm

Re: Site updated

Post by prpik »

chrismulhearn wrote:Kernel source with Keyboard Driver (WX3369 or whatever its called, the Palm IR keyboard) and Framebuffer Console (and port of SDL)

http://df38.dot5hosting.com/~remember/chris/

Hi Chris,
great job!

But am I wrong, or cache has not been enabled on this release?
chrismulhearn
Posts: 80
Joined: Wed Feb 22, 2006 4:43 am

Post by chrismulhearn »

The cache is enabled.

Its a _very_ inefficient implementation at the moment, all invalidate + writeback commands writeback and/or invalidate the WHOLE cache.

But at the moment we almost never need to explicitly writeback or invalidate it.
coltrowdow
Posts: 2
Joined: Sat Mar 03, 2007 4:11 pm

Post by coltrowdow »

Hey, I'm having some really horrible problems trying to compile the kernel. It seems no matter what I do the xiptech toolchain won't make properly, it needs to download some files such as binutils and the kernel source headers, unfortunately the source headers are no longer hosted where it tries to download them from. And the kernel itself is having a multitude of problems that I haven't even tried figuring out yet. is there any way you could host the new kernel somewhere, or even better send me a compiled toolchain for cygwin(however doubtful that may be) Thanks in advance
jjs@
Posts: 3
Joined: Thu Jan 25, 2007 2:29 am

Post by jjs@ »

You have to download these missing files from somewhere else and put the archives into the "source/dl/" directory of the toolchain installer.

Try these locations:
http://ftp.gnu.org/gnu/binutils/binutils-2.12.1.tar.bz2
http://www.kernel.org/pub/linux/libs/uc ... 15.tar.bz2
http://ftp.gnu.org/gnu/gcc/gcc-3.2/gcc-3.2.tar.gz
http://ftp.azc.uam.mx/mirrors/gnu/savan ... 18.tar.bz2

Then comment out all calls to "wget" in the toolchain script. It will then use the local copies (or just change the urls in the script accordingly).

To get the script to execute I also had to comment out the lines starting from
"# Hack things to use the correct shared lib loader" to
"# Fixup where gcc looks for start files to prevent glibc stuff leaking in..."
in the script. I'm not sure what they are supposed to do but they wouldn't execute on my system and it works without them for me.

Another important thing could be that the version 3 of gcc cannot be compiled using a gcc 4.x, that means you have to install a 3.x version of gcc before trying to compile the gcc 3.2 crss-compiler. Before I learned that I always got weird compilation errors in the second compilation pass (with gcc 4).

One note to Cygwin: I also tried installing the toolchain under cygwin, but gave up after several tries. It always ended with "internal compiler errors" and therelike. I'm also not sure if the kernel will compile at all on a non-case-sensitive file system.
Then I tried under a real linux with the changes mentioned above and it compiled without a problem.
coltrowdow
Posts: 2
Joined: Sat Mar 03, 2007 4:11 pm

Post by coltrowdow »

thanks, that should get it working I had tried commenting out that section but I had put the other libs into /build instead of source. I'll try it on a real linux shell after I get it onto my other partition, but I was hoping to get this working before I took the time to do that. again, thanks for your help
chrismulhearn
Posts: 80
Joined: Wed Feb 22, 2006 4:43 am

Post by chrismulhearn »

Just an FYI, if anyone took nice notes when building the Xiptech toolchain and wanted me to put them up on the site, I wouldn't say no... :)
7oby
Posts: 25
Joined: Fri Jun 09, 2006 2:18 am

Post by 7oby »

I'm trying to get the kernel toolchain to build. Building the cross compiler and binutils seems to work. But I'm missing elf2flt sources or binaries.

This location seems to be commented out by purpose:

Code: Select all

#ELF2FLT_SITE:=ftp://www.uclibc.org/uClibc/toolchain/
#ELF2FLT_SOURCE:=elf2flt-20020731.tar.bz2
Furthermore I was wondering whether it's possible to connect by means of an laptop integrated IrDa port to the linux console. I already tried to use irCOMM2k and Hyperterminal in WinXP, but got nothing except some garbage on the screen.

Which protocol ist used by the Palm infrared keyboard? Is it something like this:
http://www.freepatentsonline.com/6760773.html

I wasn't able to find any emulator for this protocol.

regards,
7oby
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Wow, are you over-thinking it or what? Ignore the bogus patent. IR keyboards just send a stream of data each time you press or release a key. The simplest keyboards simply send a single byte x for the key press, and 0x80|x for the key release. Others may put synch bytes before or after the key data.

The Palm 3169ww sends a couple more bytes than many, most of which can be ignored. The data from the Palm is a sync code (0xFF, 0xC0), followed by the primary keycode, followed by the primary keycode check byte (if x is the keycode, this is ~x), followed by a secondary keycode, ended with a closing sync byte (0xC1).

Key Down = 0xFF, 0xC0, K1, ~K1, K2, 0xC1

All you want is the K1 or K2 from the stream. Pretty simple. Key ups are the same -

Key Up = 0xFF, 0xC0, K1|0x80, ~(K1|0x80), K2|0x80, 0xC1


The Belkin F8U1500 send data like this -

Key Down = 0xC0, group, Key, 0xC1
Key Up = 0xC0, group|0x80, Key|0x80, 0xC1


The older Palm Wireless (not the 3169ww above) sends -

Key Down = Key, 0xC1
Key Up = Key|0x80, 0xC1


The Pocketop sends -

Key Down = Key
Key up = Key|0x80

If the key up was the last key up (no more keys held down), it repeats the Key|0x80 once.


The Targus IR keyboard sends -

Key Down = Key
Key Up = Key|0x80


So you can see that getting keys from an IR keyboard is fairly simple. Some more simple than others.
jjs@
Posts: 3
Joined: Thu Jan 25, 2007 2:29 am

Post by jjs@ »

I'm trying to get the kernel toolchain to build. Building the cross compiler and binutils seems to work. But I'm missing elf2flt sources or binaries.

This location seems to be commented out by purpose:
elf2flt is already in the "build/elf2flt/" directory of the toolchain installer.
7oby
Posts: 25
Joined: Fri Jun 09, 2006 2:18 am

Post by 7oby »

jjs@ wrote: elf2flt is already in the "build/elf2flt/" directory of the toolchain installer.
Thanks a lot! This again explains

Code: Select all

clean:
        @echo "Cleaning everything up..."
        #rm -rf $(BUILD_DIR)
Since I was trying different gcc versions and machines, I had to do quite some "rm -rf build" and elf2flt got deleted :-(

Finally my compiled linux kernel runs on the psp.

Let me summarize some of my hazzles - maybe they are useful for others:

. I had quite some difficulties in using some of the "modern" SUSE Linux machines running on x86_64 processors. Finally I gave up on those and gave coLinux on my Windows machine a try. This enabled me to run my beloved Debian 3.1.

. In a coLinux FAQ I found an interesting note:
Set up a development environment with GCC 3.3.3 (or earlier). The 2.4.27 and earlier kernel sources won't compile with GCC 3.4.1.
Certainly the used cross compiler is gcc 3.2 and respects this restriction, however as stated by someone else: He wasn't even able to compile the cross compiler with some gcc 4.x. With common distributions it's rather easy to switch between different gcc versions. I used gcc 3.3.5 for compiling the cross compiler and it worked.

. If you don't change the TARGET_PATH in "toolchain-mips/Makefile" it will build to /opt/toolchain. Don't consider moving the built binaries away from this location, since this path is now referenced by some scripts.

. Don't forget to replace /opt/toolchain/lib with the content of uClibC-binaries-01092007.tar.gz

. Maybe not the smartest way, but this is how I made my Debian aware of the new gcc:

Code: Select all

cd /opt/toolchain/bin
find . -exec ln -s /opt/toolchain/bin/\{} /usr/local/bin/\{} \;
. After downloading and unpacking the kernel sources to e.g. /usr/local/src/linux-2.4.19 do not forget to replace /arch/mipsnommu/ramdisk/ramdisk.gz by the ramdisk.gz provided on the webpage.

. Finally this generated the linux.srec

Code: Select all

cd /usr/local/src/linux-2.4.19
make depend
make
regards,
7oby
j0ey2069
Posts: 1
Joined: Wed Mar 07, 2007 11:05 am

Post by j0ey2069 »

I have been watching this project for a while now, checking up on it now an then and I think the progress that has been made lately is brilliant.

I'm thinking of starting up a website for this soon (forums, news, downloads, svn repo, etc), I'm just wondering what everyone here would think of this.

j0ey2069
cantona
Posts: 1
Joined: Sun Dec 17, 2006 4:57 am

speed up bootloader time

Post by cantona »

Hi all,

I have managed a speed up bootloader from Chris. The old one is load
from srecords (about 3 mins loading time). I changed it to load from
statically linked binary that reduce the loading time to about few
seconds.

Attach psp_bootloader_fast.tar.gz, (put uclinux.bin to root directory
of the memory stick and folder psp_bootloader to GAME directory.
Please try it out and let me know you want the source. (cantona@cantona_NOSPAM.net - remove _NOSPAM)

Thanks
Cantona

http://g.cantona.net/psp_bootloader_fast.tar.gz
chrismulhearn
Posts: 80
Joined: Wed Feb 22, 2006 4:43 am

Post by chrismulhearn »

nice job. The Srecords were a carryover from when I was transmitting the kernel over the serial port. The checksums on every line made handling comm errors nice and simple.

Is anyone looking into direct hardware access of wifi or memory stick? Those are the two most important things standing in the way of this being "useful".

-Chris
Addidis
Posts: 1
Joined: Mon Feb 19, 2007 2:38 am

Graphics offer

Post by Addidis »

Well i was making Chilly some "Tux" backgrounds , and he suggested to postt them here.
http://www.sendspace.com/file/0tulvs

Thats just a real simple one , but if you guys want icons , backgrounds , and boot sounds .... Just let me know :)
addidis@gmail.com
hck-dev
Posts: 8
Joined: Mon Mar 19, 2007 1:23 am
Location: 127.0.0.1

Post by hck-dev »

Hi there, first off all a big congratulations to everyone work on this project. I would like to say that I'm very interested in this project, and would like to take it to a better stage of development.

But before talking about what it is that i would like to do, its better if you people know who i am; I'm currently a student studying programing, and Linux. I'm also a Creative Director, working on my art related works within a group, involving production and post-production. Other fields of understanding include hardware & electronics.

----
Current projects that I'm working on includes;

Nokia Linux (i thought it would be a good idea to port to)
http://sourceforge.net/projects/nokialinux

DSLinux (Porting Apps, Beta Testing, Documentation & Webserver)
http://dslinux.org/

Project Ashes (OpenSource & Free Content Distribution)
http://projectashes.com

FinalTower (Internet Web 2.0 Streaming IPTV System)
http://finaltower.com (currently beta, no site)

Platform Linux
(No Site Yet)
----
"Some point in the near future we'll have to get a better collaborative development environment set up."
What i would like to bring to the table, and to develop for this project is; A minimalistic and simple looking pure XHTML and CSS based site that will have a professional banner and logo design included (my area of expertise), main project blog and possibly developer blogs.

A forum thats link with the site, meaning latest posts could be shown on the main site if needed, the site would be hosted on my dedicated server along side the other content.

An SVN repository and a wiki is a must, they will be setup. and possibly link the SQL so the wiki, site and repository use the same login.

Additional features; Bug Tracker ,Nightly Builds, Marketing (which ill do myself, so we can get this project known), and also having a section devoted to PSPLinux on the biggest PSP homebrew sites.

~~

I could beta test the project, develop code, debug, make drivers and that sort of things. Also another idea was to setup a mini-store, once the project is running better with the new setup. So mini pieces of hardware could be sold (with no extra-profit), or with 5% profit margin (which will be paid out to all the developers)...

These could be pre-packaged Linux on a memorystick, the ir-serial port modification and stuff like that.

~~

I've already started on the proposal above;

Image

Hopefully people will not take my post the wrong way, and i would love to start developing for this project. And get into it straight away with permission.


Many thanks

Onder Koc
(Hck~D3v)
Last edited by hck-dev on Mon Mar 19, 2007 2:16 am, edited 1 time in total.
hck-dev
Posts: 8
Joined: Mon Mar 19, 2007 1:23 am
Location: 127.0.0.1

Re: Graphics offer

Post by hck-dev »

Addidis wrote:...but if you guys want icons , backgrounds , and boot sounds .... Just let me know :)
Do you mind working with me on the graphical side of the PSPLinux project, making spoof GUI and the startup sounds, also the GAMEICON.

You can add me on MSN if u wish, or just PM Me.
chrismulhearn
Posts: 80
Joined: Wed Feb 22, 2006 4:43 am

No web site offers please

Post by chrismulhearn »

I keep seeing messages in my inbox "Hey! Can I help?" And I expect it to be a coder offering assistance with the wifi or memstick, but its just another offer to "run the web site."

This project needs developers. At the moment, I seem to be the only person doing any significant work. Just recently someone updated the bootloader and I'm psyched about that; its the first contribution I've gotten.

For this to have any usefulness whatsoever, it needs WIFI support and Memory Stick support. A web site is the _least_ of my concerns. Once this does something interesting, I'll setup a wiki and the page will make itself.

But if you want to set up a page about this kernel that has no end user applications and has no support for any non-transient storage, by all means, go ahead, but please stop emailing me for my "endorsement".
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

well hardware is not at all documented you know.

to use firmware kernel functions and to drive directly hardware are quite a different challenge.

So i wouldn't expect for a lot of people to be versatile enough about creating from the scratch a driver without any precise knowledge about hardware registers.
crazyc
Posts: 408
Joined: Fri Jun 17, 2005 10:13 am

Post by crazyc »

hlide wrote:well hardware is not at all documented you know.

to use firmware kernel functions and to drive directly hardware are quite a different challenge.

So i wouldn't expect for a lot of people to be versatile enough about creating from the scratch a driver without any precise knowledge about hardware registers.
This could help. (That is a zip file) It doesn't appear to list all registers, but a full documentation of the libertas firmware interface is interesting at least. It does list three types of host interfaces: SDIO, CF and G-SPI (oddly USB is missing). Unless the psp has an SDIO host controller (which is possible but would be slightly ironic so is unlikely) SPI seems like the most probable interface.
chrismulhearn
Posts: 80
Joined: Wed Feb 22, 2006 4:43 am

Post by chrismulhearn »

hlide, everybody who is even potentially capable of developing on this project is fully aware that the lack of documentation makes it difficult.

So, thanks for stating the obvious. Its about as useful as an offer to "run the web site".

Do you just like complaining?

-Chris
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

chrismulhearn wrote:hlide, everybody who is even potentially capable of developing on this project is fully aware that the lack of documentation makes it difficult.

So, thanks for stating the obvious. Its about as useful as an offer to "run the web site".

Do you just like complaining?

-Chris
complaining ? i thought it was you who was complaining about silly people wanting to offer to "run the web site"... well if you know it, you should know that very few of "capable" developpers here are really interested to make a linux for PSP. So don't blame us if you cannot find some "capable" developpers to contribute to your project.

Be sure I would like to help you to contribute anything on your project but I don't feel motivated enough to reverse-engineer the firmware for this purpose.
jtilghman
Posts: 3
Joined: Mon Mar 19, 2007 5:20 pm

Developers...

Post by jtilghman »

I gotta say you all have done some cool things.

Please don't let it go to waste, i am no kernel guy.

But I can do applications, and if the base (ex: linux and devices) are in place then people will code for the PSP like crazy.

the eboot scene is already doing a BUTT LOAD of homebrew, but its all hack because its not really native to the OS.

With a true linux in place this all changes.

Now as far as coders go, well... Maybe taking a look at the homebrew guys might help. They know all kinds of info about the PSP.

Maybe we should bring them in on this.

I think this is very awesome.

BTW after alittle poking around i found this:

http://pspupdates.qj.net/PSP-Phone-Tool ... /aid/86580

Here is a description:

The PSP Phone Tool homebrew application, allows PSP users to send text messages to over 20 different phone servers via the PSP's WiFi connection and built-in web browser.

So, here it seems is a way to find out howto program and to talk to the WiFi and maybe more..

Just my thoughts.

Thanks,
John
cloudhunter
Posts: 86
Joined: Thu Aug 17, 2006 3:27 am

Post by cloudhunter »

... That is just a web portal, nothing to do with Linux or an EBOOT. And EBOOT's are native to the PSP...

Cloudy
:)
jtilghman
Posts: 3
Joined: Mon Mar 19, 2007 5:20 pm

Post by jtilghman »

cloudhunter wrote:... That is just a web portal, nothing to do with Linux or an EBOOT. And EBOOT's are native to the PSP...

Cloudy
Ok.. Fine you missed my point..

I will try again..

EBOOTs are native, yes.. But it's a HACK to get them to run.

Your right, it's not really an application. I should have dug alittle deeper.

But what I was getting at is that the homebrew coders might be able to add knowledge to this subject and help this project along.

Thanks,
John
Post Reply