forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Linux 2.6 on PS2
Goto page Previous  1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Wed Oct 10, 2007 11:56 pm    Post subject: Reply with quote

eth0, I know what you mean, but the problem is that at this stage we need experienced toolchain and kernel hackers. Such people with time to spare on something like this are in very short supply so it's really the lack of knowledgable people rather than the lack of docs that's the problem. Of course, docs can be used to teach people but I'm not about to write a book on toolchain hacking. The PS2-specific stuff is just the icing on the cake, you need to understand the toolchain before you can seriously start messing with it. Having said all that, I only learnt what I know from an online crash course in MIPS assembly and staring at the GCC source for days on end. Besides writing a guide on how to build the toolchain, the best I can probably do is document my patch so far to explain why I have made the changes I have.
Back to top
View user's profile Send private message Visit poster's website
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Thu Oct 11, 2007 4:01 am    Post subject: Reply with quote

Gah! Clearly I'm not with it at the moment. I was getting ldc1/sdc1 confused with lld/scd. The latter two are also missing from the EE but as I originally thought, GCC doesn't seem to use them. The former two are missing because the EE only has 32-bit floating point registers. But the error involves movdi_64bit, which I thought was just for integers, not floats. I'm still quite confused!
Back to top
View user's profile Send private message Visit poster's website
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Thu Oct 11, 2007 8:15 am    Post subject: Reply with quote

I've just had a look at mips.c in GCC SVN. It just so happens that the code that deals with this was significantly changed just 7 days ago. I think this new code will help me to fix the problem. The trouble is I don't want to start using GCC SVN but I don't exactly want to wait for the next release either, especially since the last one was 3 days ago and didn't include these changes. Hmm.
Back to top
View user's profile Send private message Visit poster's website
pontus



Joined: 30 Sep 2007
Posts: 2

PostPosted: Thu Oct 25, 2007 5:20 am    Post subject: Reply with quote

I found that changing to O32 ABI gets rid of the sdc1 et al. I believe the N32 ABI is defined for 64-bit floating point registers, so the quickest way to a working Linux 2.6 could well be O32.
Back to top
View user's profile Send private message
Mega Man



Joined: 18 Jun 2005
Posts: 274

PostPosted: Mon Nov 19, 2007 2:33 am    Post subject: Reply with quote

For your information my kernelloader supports now USB with linux. So you can now use your USB keyboard with initrd. Support for mc and pad will follow soon.

http://mitglied.lycos.de/ps2dev/linux.html

Is there some progress with linux 2.6 and the gcc?
Back to top
View user's profile Send private message Visit poster's website
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Mon Nov 19, 2007 4:12 am    Post subject: Reply with quote

That's fantastic news, man. It'll help a lot.

I got distracted when I decided to take up the task of cleaning up the Unreal/UT ebuilds on Gentoo. I've very nearly finished that now so I should be getting back to things soon after getting back home. I'm currently away sorting out wedding plans. Such a hectic life I lead. :P
Back to top
View user's profile Send private message Visit poster's website
Mega Man



Joined: 18 Jun 2005
Posts: 274

PostPosted: Mon Nov 19, 2007 10:55 am    Post subject: Reply with quote

Best wishes for your wedding.

I added support for memory cards and enabled USB also when ps2link is used for debugging (intrelay.irx).

http://mitglied.lycos.de/ps2dev/linux.html
Back to top
View user's profile Send private message Visit poster's website
Mega Man



Joined: 18 Jun 2005
Posts: 274

PostPosted: Fri Nov 23, 2007 11:55 am    Post subject: Reply with quote

I added support for ps2 pads in kernelloader.
Back to top
View user's profile Send private message Visit poster's website
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Thu Nov 29, 2007 10:33 am    Post subject: Reply with quote

The wedding isn't till May but thanks. :)

It sounds like you've covered just about everything in that loader. Is there anything else left to do?

Not a whole lot to report here. Before the break, I tried a snapshot of GCC but couldn't figure out the previous problem. Since returning, I've grabbed a newer snapshot. The MIPS area seems to be very active and many of the changes are relevant but I'm still facing the same problem at the moment. I have some ideas now, though. I just noticed that they changed the names of the multiply/divide registers and now they kind of clash with the names we were using for the PS2's own registers so I'm going to have to go through the whole patch and change register names all over the place. Doh!
Back to top
View user's profile Send private message Visit poster's website
Mega Man



Joined: 18 Jun 2005
Posts: 274

PostPosted: Sat Dec 01, 2007 10:53 pm    Post subject: Reply with quote

I think I only need to change TGE to get everything working. The loader seems to be stable.
Back to top
View user's profile Send private message Visit poster's website
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Sun Dec 02, 2007 11:34 pm    Post subject: Reply with quote

I'm now working with a GCC snapshot dated 20071130. I've got the -linux target to build again. I think the reason it failed is because I wasn't redefining LONG_DOUBLE_TYPE_SIZE as 64 anymore. The default is 128 and setting it to 128 causes the TF/TC mode stuff to be included in libgcc. I'm not 100% sure but I think that stuff requires TF floating point emulation to be built but we can't use that because I think it requires TI support in hardware. The R5900 does have that but I won't add support for it until the end. Phew!

So I built the -elf target again and starsim still runs. I was about to post this but then thought I'd better try madplay too. Somewhat good news. It gets one line further than it did before but it still doesn't work and unfortunately, the machine freezes up so I can't diagnose the problem. Hmmm.

Code:
pksh version 2.1
 Connecting to 192.168.1.204
pksh> iopexec isjpcm.irx
log: IOP cmd: 1 args
log: iSjPCM v2.2 - by Sjeep, Lukasz Bruun & Evilo
log: iSjPCM: RPC Initialize
log: loadmodule: id 33, ret 0
pksh> eeexec madplay.elf bass.mp3
log: unmounting
log: unmounted
log: Get Reboot Request From EE
log: ps2ip_ShutDown: Shutting down ps2ip-module
log: tty mounted
log: host: mounted
log: IOP cmd thread started
log: Naplink thread started
log: loadbuffer: id 31, ret 0
log: loadmodule: fname rom0:CLEARSPU args 0 arg
log: clearspu: completed
log: loadmodule: id 32, ret 1
log: read/write allocate memory 4000
log: EE: Cmd thread
log: loadelf: fname host:madplay.elf secname all
log: loadelf version 3.30
log: Input ELF format filename = host:madplay.elf
log: 0 00100000 00038000 ....
log: 1 00138020 00025fd8 ...
log: Loaded, host:madplay.elf
log: start address 0x100158
log: gp address 00000000
log: MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
Back to top
View user's profile Send private message Visit poster's website
d3roga



Joined: 04 Dec 2007
Posts: 1

PostPosted: Tue Dec 04, 2007 8:04 pm    Post subject: Reply with quote

I've been quite impressed with your work on getting linux 2.6 to run on PS2. So I thought that I'd try to do some work on it on my own too.

If I've understood correctly the latest binutils patch is for version 2.16 (http://gps2.aura-online.co.uk/ was down so couldn't check the latest updates). I've been digging around binutils a bit and decided on trying to bring the patch up-to-date for version 2.18.
Back to top
View user's profile Send private message
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Tue Dec 04, 2007 9:51 pm    Post subject: Reply with quote

Hey. Thanks for getting involved.

The server crashed last night but it's up again now. Sorry about that. The latest binutils patch is for 2.16.1. The work was initially done by the Gentoo user garlicbread but he didn't actually try building or running anything with it. It needed further fixing up, which I did, and I also separated out the R5900, IRX and DVP patches. I haven't tested the DVP stuff at all but that isn't important right now. garlicbread said he also tried to patch up to 2.17 but had some problems. Maybe they weren't serious though.

I'm happy with binutils as it is because 2.16.1 is still relatively recent and works adequately with the latest stuff. Still, you're welcome to take it further if you want! I haven't made any changes to binutils since the last commit so what's in the repository now is the latest.
Back to top
View user's profile Send private message Visit poster's website
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Tue Dec 04, 2007 10:37 pm    Post subject: Reply with quote

Great news! madplay doesn't crash anymore! It doesn't play any sound either but this is still a step forward.

Code:
pksh version 2.1
 Connecting to 192.168.1.204
pksh> iopexec isjpcm.irx
log: IOP cmd: 1 args
log: iSjPCM v2.2 - by Sjeep, Lukasz Bruun & Evilo
log: iSjPCM: RPC Initialize
log: loadmodule: id 33, ret 0
pksh> eeexec madplay.elf bass.mp3
log: unmounting
log: unmounted
log: Get Reboot Request From EE
log: ps2ip_ShutDown: Shutting down ps2ip-module
log: tty mounted
log: host: mounted
log: IOP cmd thread started
log: Naplink thread started
log: loadbuffer: id 31, ret 0
log: loadmodule: fname rom0:CLEARSPU args 0 arg
log: clearspu: completed
log: loadmodule: id 32, ret 1
log: read/write allocate memory 4000
log: EE: Cmd thread
log: loadelf: fname host:madplay.elf secname all
log: loadelf version 3.30
log: Input ELF format filename = host:madplay.elf
log: 0 00100000 00037ff0 ....
log: 1 00138010 00025fe8 ...
log: Loaded, host:madplay.elf
log: start address 0x100158
log: gp address 00000000
log: MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
log: loadbuffer: addrres 51b00 args 0 arg
log: iSjPCM v2.2 - by Sjeep, Lukasz Bruun & Evilo
log: iSjPCM: RPC Initialize
log: loadbuffer: id 33, ret 0
log: iSjPCM: Memory Allocated. 1455872 bytes left.
log: iSjPCM: Sound buffers cleared
log: iSjPCM: SPU2 initialised!
log: iSjPCM: Setting up playing thread
log: iSjPCM: Entering playing thread.
log: open name host:bass.mp3 flag 1 data 44978
log: open fd = 2
log: 0 frames decoded (0:00:00.0), -inf dB peak amplitude, 0 clipped samples


I had an idea that turned out to be a rather good one. GCC uses a macro called TARGET_NEWABI to set a lot of other macros. It's definition is usually (mips_abi == ABI_N32 || mips_abi == ABI_64). As far as I understand it, EABI should also included here but it's not because it's been deprecated by GCC. Redefining this with EABI included did the trick. :)

I've also been trying some other stuff in the ps2dev repository. SDL, SDL_image, SDL_gfx and their dependencies all build without a hitch but none of the tests successfully run just yet. Some of them crash with a register dump so I do have some leads to follow.
Back to top
View user's profile Send private message Visit poster's website
GhostWolf



Joined: 12 Dec 2007
Posts: 1

PostPosted: Wed Dec 12, 2007 7:41 am    Post subject: Reply with quote

I have been looking for Linux on the PS2 so I'm looking forward to the end user release of this.
Good Work people! and good luck!
Back to top
View user's profile Send private message
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Wed Dec 12, 2007 7:56 am    Post subject: Reply with quote

You could be waiting some time but thanks.

Work is heavy at the moment but I'm still finding a little time to work on this. I'm out of ideas for now so I've started adding support for the 128-bit MMI instructions. This seems to be easier than I originally thought. Once that's done, this GCC will be actually have all the features of 3.2.2 and more! Then it'll just be a case of actually getting it to work properly. Piece of cake. ;)
Back to top
View user's profile Send private message Visit poster's website
Mega Man



Joined: 18 Jun 2005
Posts: 274

PostPosted: Tue Dec 25, 2007 12:20 am    Post subject: Reply with quote

I have a new kernelloader release 1.0.
Now I have also a binary release it can load kernel and initrd from USB memory stick or ps2 memory card.

http://mitglied.lycos.de/ps2dev/kernelloader1.0/kloader.elf

Added
Here are files that can be used for testing:
http://mitglied.lycos.de/ps2dev/vmlinux
http://mitglied.lycos.de/ps2dev/initrd.gz


Last edited by Mega Man on Tue Dec 25, 2007 1:38 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Tue Dec 25, 2007 12:54 am    Post subject: Reply with quote

That's a great Christmas present. :D
Back to top
View user's profile Send private message Visit poster's website
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Fri Dec 28, 2007 5:41 am    Post subject: Reply with quote

I fancied a change of scenery so I decided to have a go at getting Linux 2.6 to recognise the APA partition format. I thought it would be easy. Sadly not. The partition stuff has changed a little bit since 2.4.17. This alone wouldn't be so bad but there's another problem. APA partitions are not (always) contiguous. They are split into 512MB segments across the disk. It looked as though support for non-contiguous partitions had been removed but when I tried to find out why that was, I realised that they weren't supported in vanilla 2.4.17 either. It seems this feature is exclusive to MontaVista's kernel. I'm not sure whether bringing this feature up to date will be possible. It will probably make getting any patch committed to the official kernel quite tricky. Bugger.
Back to top
View user's profile Send private message Visit poster's website
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Sat Dec 29, 2007 1:52 am    Post subject: Reply with quote

I've spent much of today staring at kernel source and I now have a fairly solid idea of how Linux handles partitions. Fascinating! I have a rough idea of how I'd go about adding support for non-contiguous partitions but I'm not confident enough to actually give it a shot right now. There are a few bits in the MontaVista code (something to do with hashes?) that I don't understand the relevance of. Maybe they don't really do anything but then why would they be there? I also have to be careful because screwing this up could nuke my PC's hard drives! I'd certainly test it in an emulator first. Maybe another time. Back to GCC!
Back to top
View user's profile Send private message Visit poster's website
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sat Dec 29, 2007 6:22 am    Post subject: Reply with quote

To handle non-contiguous partitions, use the device-mapper. You could even set it all up from userspace using "dmsetup create", see man dmsetup and Documentation/device-mapper/linear.txt for examples.
Back to top
View user's profile Send private message
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Sat Dec 29, 2007 11:02 pm    Post subject: Reply with quote

Aha! That's exactly what I need. Thanks. I had looked around but all I could find was LVM, which isn't quite the same thing. I would like it to be possible to boot from an APA partition but I guess an initrd/initramfs could do the trick there.
Back to top
View user's profile Send private message Visit poster's website
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Mon Dec 31, 2007 5:03 am    Post subject: Reply with quote

I'll continue the APA stuff here...

http://forums.ps2dev.org/viewtopic.php?p=62801
Back to top
View user's profile Send private message Visit poster's website
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Tue Feb 05, 2008 9:05 pm    Post subject: Reply with quote

Minor news. After toing and froing with the maintainer of gnuconfig since August, with him changing his mind three times, I managed to convince him to add mips64r5900 to config.sub. I'm not sure when this update will hit Portage. I have asked for a bump but it was last updated very recently.
Back to top
View user's profile Send private message Visit poster's website
mazxim



Joined: 24 Jan 2008
Posts: 23

PostPosted: Mon Feb 11, 2008 3:10 am    Post subject: Reply with quote

Chewi, you are a MYTH man! Thanks so much for your hard work, don't give up this project, I simply hope that you still having fun with all this matter! ;)

For who don't know how much efforts this guy have put on the project, here there's a link:

http://gps2.aura-online.co.uk/trac/gentoo-ps2/ <--- GENTOO ON PS2 !!!

..good speed!
Back to top
View user's profile Send private message Visit poster's website
jaymacdonald



Joined: 24 Feb 2007
Posts: 22

PostPosted: Thu Feb 14, 2008 5:58 am    Post subject: Reply with quote

Hi, could you add USB->USB support, like NapLink (http://naplink.napalm-x.com/)? Thanks.
Back to top
View user's profile Send private message
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Thu Feb 14, 2008 11:10 pm    Post subject: Reply with quote

Some of you guys are crazy. I appreciate the thanks but I'm not that great. Really. =P A little research into these things goes a long way. I really wish some of you would have a shot at this yourselves but you don't seem to believe me when I say it's not THAT scary.

jay, I'm not familiar with NapLink and I don't think it's relevant to what I'm doing, I'm afraid.

I've only had a little time lately. I usually only have time to renew the patches against the latest GCC snapshot and by the time I get around to looking at it again, a new snapshot has already come out. I hope 4.3 gets released soon.

I've just built myself a new machine. Quad core. :D That should make building GCC much faster. I also plan to switch back to JFS. Deleting and unpacking GCC on XFS takes aaaages.
Back to top
View user's profile Send private message Visit poster's website
jaymacdonald



Joined: 24 Feb 2007
Posts: 22

PostPosted: Thu Feb 14, 2008 11:16 pm    Post subject: Reply with quote

Chewi wrote:
Some of you guys are crazy. I appreciate the thanks but I'm not that great. Really. =P A little research into these things goes a long way. I really wish some of you would have a shot at this yourselves but you don't seem to believe me when I say it's not THAT scary.

jay, I'm not familiar with NapLink and I don't think it's relevant to what I'm doing, I'm afraid.

I've only had a little time lately. I usually only have time to renew the patches against the latest GCC snapshot and by the time I get around to looking at it again, a new snapshot has already come out. I hope 4.3 gets released soon.

I've just built myself a new machine. Quad core. :D That should make building GCC much faster. I also plan to switch back to JFS. Deleting and unpacking GCC on XFS takes aaaages.


Great work. Sorry, I was refering to the bootloader that Mega Man was creating. (for loading bootimage from naplink).
Also, I am in possession of the Sony RTE, but no hard drive or ethernet. Can I use a disc and the RTE to load Gentoo On my PS2?
Back to top
View user's profile Send private message
Chewi



Joined: 26 Nov 2006
Posts: 109
Location: Perth, Scotland

PostPosted: Thu Feb 14, 2008 11:26 pm    Post subject: Reply with quote

You mean a read-only system on a DVD? Maybe. If I remember rightly, loading ROMs from a disc for SNES-Station requires you to do the swap trick so the same rule probably applies here. Unless your console is modded, of course. That's also assuming that recent Gentoo stuff is working, which it isn't, but you could do the same for Black Rhino or whatever.
Back to top
View user's profile Send private message Visit poster's website
jaymacdonald



Joined: 24 Feb 2007
Posts: 22

PostPosted: Thu Feb 14, 2008 11:53 pm    Post subject: Reply with quote

Chewi wrote:
You mean a read-only system on a DVD? Maybe. If I remember rightly, loading ROMs from a disc for SNES-Station requires you to do the swap trick so the same rule probably applies here. Unless your console is modded, of course. That's also assuming that recent Gentoo stuff is working, which it isn't, but you could do the same for Black Rhino or whatever.


My system has the independence exploit, so I can run homebrew and the rest. (Swap-Magic too).
The bootloader is a step at recreating the RTE, or am I wrong?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Goto page Previous  1, 2, 3, 4, 5  Next
Page 4 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group