A new port of uClinux on PSP (with accessibility to ms0)

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

Moderators: cheriff, TyRaNiD

Post Reply
bcarroll
Posts: 11
Joined: Mon May 12, 2008 12:52 am

stupid question.. patching buildroot

Post by bcarroll »

Can someone please tell me how to "Apply buildroot-20071216.linuxonpsppatch"?

I am trying to follow the instructions in the "Building the MIPS(el) toolchain for uClinux on PSP" document but cannot figure this step out.
SpikeX
Posts: 8
Joined: Sun Jan 14, 2007 7:12 pm
Location: Germany

Re: stupid question.. patching buildroot

Post by SpikeX »

bcarroll wrote:Can someone please tell me how to "Apply buildroot-20071216.linuxonpsppatch"?
First you need a buildroot version near to 20071216, otherwise you will possibly get some errors while patching.

And then for applying the patch, simply cd to your buildroot source directory and type:
patch -p4 < /path/to/your/buildroot-20071216.linuxonpsppatch
Eprat
Posts: 1
Joined: Mon May 12, 2008 8:20 pm

Trying to compile libstdc++ for psp

Post by Eprat »

Hi,
I am desperately trying to compile the last toolchain for psp. Everything goes right until i try to compile libstdc++. I have tried with gcc-4.2.1 and gcc-4.3.0. I have the same error messages:

/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/./gcc/xgcc -shared-libgcc -B/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/./gcc -nostdinc++ -L/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/src -L/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/src/.libs -B/usr/mipsel-linux-uclibc/bin/ -B/usr/mipsel-linux-uclibc/lib/ -isystem /usr/mipsel-linux-uclibc/include -isystem /usr/mipsel-linux-uclibc/sys-include -Winvalid-pch -Wno-deprecated -x c++-header -g -Os -fno-jump-tables -I/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc -I/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include -I/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1/libstdc++-v3/libsupc++ -O0 -g /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1/libstdc++-v3/include/precompiled/stdc++.h -o mipsel-linux-uclibc/bits/stdc++.h.gch/O0g.gch
In file included from /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/bits/locale_facets.h:47,
from /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/bits/basic_ios.h:44,
from /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/ios:50,
from /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/ostream:45,
from /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/bitset:59,
from /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1/libstdc++-v3/include/precompiled/stdc++.h:56:
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:50: error: expected ';' before '*' token
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:54: error: '__ctype_mask_t' does not name a type
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:55: error: 'mask' does not name a type
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:56: error: 'mask' does not name a type
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:57: error: 'mask' does not name a type
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:58: error: 'mask' does not name a type
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:59: error: 'mask' does not name a type
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:60: error: 'mask' does not name a type
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:61: error: 'mask' does not name a type
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:62: error: 'mask' does not name a type
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:63: error: 'mask' does not name a type
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:64: error: 'mask' does not name a type
/home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/mipsel-linux-uclibc/bits/ctype_base.h:65: error: 'mask' does not name a type
In file included from /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/bits/basic_ios.h:44,
from /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/ios:50,
from /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/ostream:45,
from /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1-final/mipsel-linux-uclibc/libstdc++-v3/include/bitset:59,
from /home/eprat/workspace/psp/buildroot/toolchain_build_mipsel/gcc-4.2.1/libstdc++-v3/include/precompiled/stdc++.h:56:



If anyone have an idea?
Thanks
bcarroll
Posts: 11
Joined: Mon May 12, 2008 12:52 am

Post by bcarroll »

thanks SpikeX for the help....

I have gotten a little further with compiling buildroot... but am still getting errors along the way.

any chance of someone putting up a pre-patched buildroot?

this would make building much easier.
vijay
Posts: 25
Joined: Thu Jan 03, 2008 10:07 pm

Post by vijay »

can someone please share buildroot version 20071216 ........ i cant seem to find it
thanx
bcarroll
Posts: 11
Joined: Mon May 12, 2008 12:52 am

Post by bcarroll »

do the other patches need to be renamed or will they be applied with the default file names?

- Copy gcc-4.2.1.linuxonpsppatch to $(BUILDROOT)/toolchain/gcc/4.2.1/
- Copy uclibc-0.9.29.linuxonpsppatch to $(BUILDROOT)/toolchain/uClibc/
- Copy elf2flt.linuxonpsppatch to $(BUILDROOT)/toolchain/elf2flt/
- Apply buildroot-20071216.linuxonpsppatch

A step by step tutorial would be great....
bcarroll
Posts: 11
Joined: Mon May 12, 2008 12:52 am

Post by bcarroll »

sim,
I cloned your buildroot repository
hg clone http://hg.sequanux.org/buildroot-psp

but all of the files end in .i and are not named correctly (Makefile is _m_a_k_e_f_i_l_e.i)

did I miss a step?
vijay
Posts: 25
Joined: Thu Jan 03, 2008 10:07 pm

Post by vijay »

no one has the buildroot-20071216 ....... i compiled this toolchain before but now i reinstalled my linux, the buildroot which i used to have is gone now ;
please some one share it
SpikeX
Posts: 8
Joined: Sun Jan 14, 2007 7:12 pm
Location: Germany

Post by SpikeX »

For buildroot version 20071216 the following should do the trick:
svn co --revision 20650 svn://uclibc.org/trunk/buildroot

20650 is the last revision before 12/16/2007 and so it should be equivalent to the 20071216 snapshot. I didn't try to compile this version yet, but patching works without any problems.
vijay
Posts: 25
Joined: Thu Jan 03, 2008 10:07 pm

Post by vijay »

@SpikeX
hey thanx ....... it worked ; i got a running toolchain :)

@riverfal
i compiled the busybox but i forgot how to add devices in /dev/* ; last time i saw from your website .......... but now i missed the link .......
please can u help me

if anyone knows how to ...... please tell me

thanx ,
Drajwer
Posts: 6
Joined: Fri Aug 24, 2007 5:32 pm

Post by Drajwer »

Im wondering, does anyone got basic SIO keyboard to work with ? I have SIO keyboard, but when enabled SIO port I got crap chars instead of pressed keys. How to fix it ? Anyone got it to work?
bcarroll
Posts: 11
Joined: Mon May 12, 2008 12:52 am

Post by bcarroll »

has anyone (Jackson) given any thought to including the buildroot-20071216 source in the download section?
bcarroll
Posts: 11
Joined: Mon May 12, 2008 12:52 am

Post by bcarroll »

Anyone have a workaround (or solution) for this issue:
root@slackware9:/usr/src/buildroot-20071216/build_mipsel/psposk2# make
mipsel-linux-g++ -Wl,-elf2flt -static oskmain.o osk.o oskstates.o osk_psp.o Eng.o EngActive.o Cap.o CapActive.o Num.o NumActive.o -o psposk2
/usr/src/buildroot-20071216/build_mipsel/staging_dir/usr/bin/../lib/gcc/mipsel-linux-uclibc/4.2.1/../../../../mipsel-linux-uclibc/bin/ld: warning: cannot find entry symbol lf2flt; defaulting to 0000000000400140
/usr/src/buildroot-20071216/build_mipsel/staging_dir/usr/lib/libc.a(_ppfs_parsespec.os): In function `_ppfs_parsespec':
_ppfs_parsespec.c:(.text+0xb4): undefined reference to `__GI___ctype_b'
collect2: ld returned 1 exit status
make: *** [psposk2] Error 1
bcarroll
Posts: 11
Joined: Mon May 12, 2008 12:52 am

Post by bcarroll »

Is the PSPSDK required for building the kernel?
I noticed a bunch of errors related to mising pspsdk header files during the kernel compilation.
vijay
Posts: 25
Joined: Thu Jan 03, 2008 10:07 pm

Post by vijay »

ye it is
u have to modify the path to pspsdk in config gile
bcarroll
Posts: 11
Joined: Mon May 12, 2008 12:52 am

Post by bcarroll »

I finally got everything compiled without any errors....
but now I am unable to load the kernel. I saw a previous post from roge (didn't see any follow-ups for this one) about decompressing the kernel.. then the psp shut down. I am having this same issue. Any ideas how to resolve?

---edit---

After:
make clean && make ARCH=mips CROSS_COMPILE=mipsel-linux- vmlinux.bin

The kernel now loads... but dies (locks up the PSP) on /init with
BINFMT_FLAT: bad header magic

Does this mean the problem is with my compile of busybox?
bcarroll
Posts: 11
Joined: Mon May 12, 2008 12:52 am

Post by bcarroll »

problem was with busybox compile...
typo in the make cmd line... -W1 and -Wl do very different things.

Now I have a new problem....

Code: Select all

WARNING&#58; R_MIPS_GPREL32 is not supported
ERROR&#58; reloc type R_MIPS_GPREL32 unsupported in this context
218 bad relocs
Failed&#58; mipsel-linux-gcc -static -Wl,-elf2flt -o busybox_unstripped........edited..
collect2&#58; ld returned 1 exit status
make&#58; *** &#91;busybox_unstripped&#93; Error 1
Please help
andrewwan1980
Posts: 38
Joined: Fri Oct 05, 2007 1:31 am

Post by andrewwan1980 »

Will I be able to run Wine on uClinuxPSP to run Windows 95 (not XP) apps... like Visual C++ 6.0? I guess it's a question whether X Windows runs on uClinuxPSP first...
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Oh, come on! How much memory do you think it takes to run Win95 and Visual C6?!

Jim
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

andrewwan1980 wrote:Will I be able to run Wine on uClinuxPSP to run Windows 95 (not XP) apps... like Visual C++ 6.0? I guess it's a question whether X Windows runs on uClinuxPSP first...
Wine still requires an x86 CPU. As the name says, it's not an emulator.
andrewwan1980
Posts: 38
Joined: Fri Oct 05, 2007 1:31 am

Post by andrewwan1980 »

Okay, will we be able to use gcc/g++ and compile our own source codes under uClinux-PSP? I guess we need to port gcc/g++ to uClinux-PSP right? Same with X Windows, and KDevelop, etc.

Matan at http://www.hacker.co.il/psp/bochs/ says he boots up Windows 95 under bochs quite fast, and Solitaire was playable too. So am thinking maybe Visual C++ 6.0 would run...

J.F. are you the guy who did JFduke?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

andrewwan1980 wrote:Okay, will we be able to use gcc/g++ and compile our own source codes under uClinux-PSP? I guess we need to port gcc/g++ to uClinux-PSP right? Same with X Windows, and KDevelop, etc.

Matan at http://www.hacker.co.il/psp/bochs/ says he boots up Windows 95 under bochs quite fast, and Solitaire was playable too. So am thinking maybe Visual C++ 6.0 would run...
Gcc is too big for uclinux on the PSP. Remember, uclinux is for systems without an MMU, so NO VIRTUAL MEMORY! Whan memory you have is all there is. Just as you have to use a cross-compiler to compile the kernel, you'll need to use the cross-compiler for all apps as well.
J.F. are you the guy who did JFduke?
Nope. That's someone else entirely.
Ferdinant
Posts: 6
Joined: Wed Feb 13, 2008 4:32 am

The prebuild toolchain

Post by Ferdinant »

You waited for this, you got it now:

The prebuild Buildroottoolchain is now avalible from Jackson Mo at: http://jacksonm80.googlepages.com/linuxonpsp.htm

Sorry for my bad english ;)
noquarter
Posts: 17
Joined: Sun Jul 23, 2006 5:56 pm

Post by noquarter »

The link to the file on his webpage is broken.
meetpatty
Posts: 1
Joined: Sat Apr 12, 2008 9:29 am

Post by meetpatty »

Has anyone had success using ncurses? I tried to cross compile ncurses 5.6 and ended up with ncurses.h missing function prototypes and I'm getting undefined references to initscr etc.
mrbanjo
Posts: 1
Joined: Thu Jul 03, 2008 6:44 am

Post by mrbanjo »

Hi

I was wondering if it is possible to get ADOM http://www.adom.de/ to run? I get some error about bad header magic, is it because of the file system? Any suggestions? And sorry if this is a rather stupid question, but I have tried to get the game to work for a long time, but since it is my first linux ecperience it is quite tricky :)
SpikeX
Posts: 8
Joined: Sun Jan 14, 2007 7:12 pm
Location: Germany

Post by SpikeX »

mrbanjo wrote:I was wondering if it is possible to get ADOM http://www.adom.de/ to run? I get some error about bad header magic, is it because of the file system? Any suggestions?
The "Bad header magic" has nothing to do with the filesystem. The linux-binary on adom.de is an ELF-binary but the PSP needs a FLAT-binary ;)
M.Jackson
Posts: 85
Joined: Mon Sep 10, 2007 6:37 pm
Contact:

Post by M.Jackson »

meetpatty wrote:Has anyone had success using ncurses? I tried to cross compile ncurses 5.6 and ended up with ncurses.h missing function prototypes and I'm getting undefined references to initscr etc.
Believe it or not, I did try that before when I tried to port the text mode mouse daemon, but encountered so many compatibility issues that I decided to write my own daemon instead to do away with ncurses library. Turns out it's easier than making ncurses work on psp :)
M.Jackson
Posts: 85
Joined: Mon Sep 10, 2007 6:37 pm
Contact:

Post by M.Jackson »

SpikeX wrote:
mrbanjo wrote:I was wondering if it is possible to get ADOM http://www.adom.de/ to run? I get some error about bad header magic, is it because of the file system? Any suggestions?
The "Bad header magic" has nothing to do with the filesystem. The linux-binary on adom.de is an ELF-binary but the PSP needs a FLAT-binary ;)
I remember I have patched the elf2flt tool (by adding code to handle the mmu-less mips arch) to convert elf executables into FLAT binaries that can run on psp. Did you try that?
SpikeX
Posts: 8
Joined: Sun Jan 14, 2007 7:12 pm
Location: Germany

Post by SpikeX »

M.Jackson wrote:
SpikeX wrote:
mrbanjo wrote:I was wondering if it is possible to get ADOM http://www.adom.de/ to run? I get some error about bad header magic, is it because of the file system? Any suggestions?
The "Bad header magic" has nothing to do with the filesystem. The linux-binary on adom.de is an ELF-binary but the PSP needs a FLAT-binary ;)
I remember I have patched the elf2flt tool (by adding code to handle the mmu-less mips arch) to convert elf executables into FLAT binaries that can run on psp. Did you try that?
I didn't try it, but I think it wouldn't work anyway because the prebuit ELF on the website is most probable (they don't wrote anything about that) built for x86 and not for MIPS.
Post Reply