Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PlayStation 2 - Major progress, help me finish!
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 10, 11, 12  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
rmh3093
Advocate
Advocate


Joined: 06 Aug 2003
Posts: 2138
Location: Albany, NY

PostPosted: Thu Nov 02, 2006 7:41 pm    Post subject: Reply with quote

hows that goin?
_________________
Do not meddle in the affairs of wizards, for they are subtle and quick to anger.
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Fri Nov 03, 2006 3:10 am    Post subject: Reply with quote

Sorry, been busy with work.

http://www.linux-mips.org/pub/linux/mips/kernel/v2.4/linux-2.4.17.tar.gz
http://www.aura-online.co.uk/~chewi/ps2-kernel-1.patch
http://www.aura-online.co.uk/~chewi/ps2-patch-config

Download the MIPS kernel from the first URL. Apply the patch from the second URL. Copy the config from the third URL.

Code:
make oldconfig
make dep
make


You should get the same results I did. There are still a few non-PS2 bits in the patch because when I was stripping down the patch, it wasn't easy to remove non-PS2 bits that appeared very close to PS2-specific bits. These non-PS2 bits should be safe to ignore for now though because they are generally only used when their respective configuration options are enabled. The errors that occur are probably either due to me being a little over-zealous with the stripping in some places and not zealous enough in other places. They may also be down to the fact that the PS2-specific files are making use of things that either don't exist or aren't quite the same. For example, I noticed that the PS2 APA driver tries to access certain properties of the hd_struct structure that simply don't exist in the standard MIPS kernel. You will probably need to consult the standard MIPS kernel, the PS2-specific kernel and perhaps even the 2.2.26 kernel in order to work some of these problems out.

If you make any progress, let me know so we don't waste time on things that have already been fixed. I will probably get back to this at the weekend.
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Sat Nov 04, 2006 4:34 am    Post subject: Reply with quote

"Well fuck me sideways!" is what I just said to my friend. :lol: You're not gonna believe this. I've just spent a mere two hours on this and not only did I manage to get the kernel to build but it booted perfectly FIRST TIME. 8O I'm starting to scare myself. Without further ado, here is the latest patch...

http://www.aura-online.co.uk/~chewi/ps2-kernel-2.patch

It still needs a bit of work. I notice there's still some rather nasty compiler warnings in irq.c. I need to trim the patch a bit more because there's still some extra fat in there. Obviously USB support is very important so I need to get that working again but I think I'll try patching this against a later kernel version first because I suspect that the USB code in the later kernels might be easier to work with. I would continue working on this now but it's 4:30am. :P
Back to top
View user's profile Send private message
sh0
n00b
n00b


Joined: 04 Nov 2006
Posts: 5
Location: Germany

PostPosted: Sat Nov 04, 2006 3:28 pm    Post subject: Reply with quote

Great work chewi!

Are you going to release a whole gentoo-ps2 overlay (with uclibc etc.) ?

Would be nice to reactivate my old PS2 with Gentoo 8)

I tried this many years ago but none seems to be interested about a PS2 Gentoo
at the PS2 Linux Comunity...
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Sat Nov 04, 2006 3:35 pm    Post subject: Reply with quote

sh0 wrote:
Are you going to release a whole gentoo-ps2 overlay (with uclibc etc.) ?

Of course, that's why I set up the wiki and repository. :) I'm working on the kernel patch right now.

You appear to be a new forum member. Out of interest, where did you hear about this?
Back to top
View user's profile Send private message
sh0
n00b
n00b


Joined: 04 Nov 2006
Posts: 5
Location: Germany

PostPosted: Sat Nov 04, 2006 3:44 pm    Post subject: Reply with quote

I searched the Forum because I just wanted to know (once again) if there is somebody
who is still interested in PS2 Linux ...

Thats where I found this thread. Iam using Gentoo for a long time now but wasn't much active at the
forums, so my account was droped and I'am back to a 0 poster ...
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Sat Nov 04, 2006 5:38 pm    Post subject: Reply with quote

It's okay, I believe you're not a n00b. :wink:

New, slightly leaner patch. Tested and working! http://www.aura-online.co.uk/~chewi/ps2-kernel-3.patch
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Sat Nov 04, 2006 7:12 pm    Post subject: Reply with quote

And again. About 1200 lines less. Failed to boot on one occasion but I knew why straight away. Gonna take a break for a bit.
http://www.aura-online.co.uk/~chewi/ps2-kernel-4.patch
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Sat Nov 04, 2006 11:08 pm    Post subject: Reply with quote

Hmm need to backtrack a little bit. The PS2 kernel uses its own functions for manipulating the registers. I didn't think this was PS2-specific stuff but I now realise it is. It makes things quite a bit more messy than they would overwise need to be but oh well. At least it's easy to change the normal syntax to the PS2-specific syntax.
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Sun Nov 05, 2006 5:28 pm    Post subject: Reply with quote

Okay so #4 was really a dud. I think the reason why it worked at all was because I had accidentally removed the "R5900 specific context" option. I assume that option enables R5900 specific optimisations. Adding this option again caused the build to fail. I had also accidentally removed "fast test and set" support. Anyway, both these options are now present and working. :)

http://www.aura-online.co.uk/~chewi/ps2-kernel-5.patch
http://www.aura-online.co.uk/~chewi/ps2-patch-config

If you downloaded the config file before, download it again because it has changed.
Back to top
View user's profile Send private message
sh0
n00b
n00b


Joined: 04 Nov 2006
Posts: 5
Location: Germany

PostPosted: Sun Nov 05, 2006 7:17 pm    Post subject: Reply with quote

Sweet,
but it looks like you striped a bit too much from the USB section:

I tried to copy some files from the 2.4.17_ps2 kernel:
Code:
4326  usb-ohci-nonpci.c
12051 usb-ohci-pci.c
1193  usb-ohci-ps2.c
2211  usb-ohci-sa1111.c
70437 usb-ohci.c
17941 usb-ohci.h

Tried to compile with this config options:
Code:
CONFIG_USB=y
CONFIG_USB_OHCI=y
CONFIG_USB_NON_PCI_OHCI=y
CONFIG_USB_OHCI_PS2=y

Results in some warnings but it compiled 8)

Here is a diff based on your latest (5) patch http://devel.sh0.org/usb-ps2-kernel-5.patch
I hope this might help a bit fixing the USB issue...
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Sun Nov 05, 2006 8:06 pm    Post subject: Reply with quote

Yeah I know that including all that would fix it but that's probably more than we actually need. I want to keep the patch small for easy maintenance. If I can't figure it out, then yeah, I'll just include it all. Haven't tried yet, just trying to trim the rest of it first. Thanks though. :)
Back to top
View user's profile Send private message
sh0
n00b
n00b


Joined: 04 Nov 2006
Posts: 5
Location: Germany

PostPosted: Sun Nov 05, 2006 8:29 pm    Post subject: Reply with quote

OKies,
I could trim it a bit more if you like to.

Wouldn't it be easyer to seperate the patches ?

10-ps2-usb.patch
20-ps2-mcfs.patch
etc.
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Sun Nov 05, 2006 8:35 pm    Post subject: Reply with quote

I really appreciate the offer but working on this collaboratively is tricky. I haven't got that much more to do anyway.

I don't think separating the patches is really necessary since no one is going to want to apply just some of them. A lot of the code is shared as well so the individual patches wouldn't work in isolation.
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Sun Nov 05, 2006 10:25 pm    Post subject: Reply with quote

New one. Nearly finished trimming it now! http://www.aura-online.co.uk/~chewi/ps2-kernel-6.patch

From now on, you need to explicity include the CROSS_COMPILE value. This is the norm when cross-compiling a kernel. Don't forget the trailing dash.

Code:
make CROSS_COMPILE=mipsEEel-scei-linux-uclibc-
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Mon Nov 06, 2006 10:24 am    Post subject: Reply with quote

Finished trimming it! More or less anyway. :wink: http://www.aura-online.co.uk/~chewi/ps2-kernel-7.patch

I've got to get back to some real work but the plan now is to try and patch against a later 2.4 and then to get USB and APA working again. I was thinking about which 2.4 I should aim for. I guess I may as well go for gold and try 2.4.33.3. If that proves too difficult, I'll try something a little earlier.
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Tue Nov 07, 2006 3:12 am    Post subject: Reply with quote

I've fixed up the patch against 2.4.33.3 and I'm now trying to build it. It gets very far but then the assembler trips over and starts spouting this crap.

Code:
mipsEEel-scei-linux-uclibc-gcc -D__KERNEL__ -I/usr/src/linux-2.4.33.3.test/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -I /usr/src/linux-2.4.33.3.test/include/asm/gcc -G 0 -mno-abicalls -fno-pic -pipe  -finline-limit=100000 -march=r5900  -c int-handler.S -o int-handler.o
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h: Assembler messages:
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:187: Error: unrecognized opcode `__asm__('
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:188: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:189: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:190: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:191: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:192: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:193: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:194: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:195: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:196: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:197: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:198: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:199: Warning: rest of line ignored; first ignored character is `"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:199: Error: unrecognized opcode `_ssnop'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:199: Error: unrecognized opcode `_ssnop                              \n\t"'
/usr/src/linux-2.4.33.3.test/include/asm/hazards.h:200: Warning: rest of line ignored; first ignored character is `"'


...and so on. I did see this happen once before with 2.4.17. Removing an unneeded #include seemed to fix it but I'm not having the same luck this time. It would suggest some kind of syntax error somewhere but I don't think there is one. I'm thinking that perhaps I need a later binutils version than 2.14. Maybe it's time to give garlicbread's patch a try!
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Tue Nov 07, 2006 11:08 am    Post subject: Reply with quote

Hmm something's up with the binutils patch. The assembler is broken.

Code:
GNU assembler version 2.16.1 (mipsEEel-scei-linux-uclibc) using BFD version 2.16.1
Assembler messages:
Error: internal: bad mips opcode (bits 0x7c0 undefined): dextm t,r,+A,+G
Error: internal: bad mips opcode (bits 0xffc0 undefined): dextu t,r,+E,+H
Error: internal: bad mips opcode (bits 0xffc0 undefined): dinsm t,r,+A,+F
Error: internal: bad mips opcode (bits 0xffc0 undefined): dinsu t,r,+E,+F
Fatal error: Broken assembler.  No assembly attempted.


I'll either have to figure that out, which could be hard, or I'll have to find another way around the kernel problem. I was going to take a look at the binutils patch anyway so that it can be safely applied universally across MIPS.
Back to top
View user's profile Send private message
rmh3093
Advocate
Advocate


Joined: 06 Aug 2003
Posts: 2138
Location: Albany, NY

PostPosted: Tue Nov 07, 2006 1:50 pm    Post subject: Reply with quote

cd /usr/src/linux-ps2
echo 'mips' > .hhl_target_cpu
echo 'mipsEEel-scei-linux-uclibc-' > .hhl_cross_compile
make

:)
_________________
Do not meddle in the affairs of wizards, for they are subtle and quick to anger.
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Tue Nov 07, 2006 1:57 pm    Post subject: Reply with quote

Eh? If you're referring to having to set CROSS_COMPILE all the time, I did that because that's how the standard kernel does is. Those .hhl files were a MontaVista thing.
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Wed Nov 08, 2006 3:36 am    Post subject: Reply with quote

Well I sort of fixed binutils by removing some lines from mips-opc.c but the assembler appears to be even more broken.

Code:
mipsEEel-scei-linux-uclibc-gcc -D__KERNEL__ -I/usr/src/linux-2.4.33.3.test/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -I /usr/src/linux-2.4.33.3.test/include/asm/gcc -G 0 -mno-abicalls -fno-pic -pipe  -finline-limit=100000 -march=r5900   -nostdinc -iwithprefix include -DKBUILD_BASENAME=ps2dev  -c -o ps2dev.o ps2dev.c
ps2dev.c: In function `ps2dev_init':
ps2dev.c:1063: warning: unused variable `gs_revision'
{standard input}: Assembler messages:
{standard input}:1214: Error: opcode not supported on this processor: mips3 (mips3) `pextlw $8,$7,$6'
{standard input}:1759: Error: opcode not supported on this processor: mips3 (mips3) `pextlw $8,$5,$4'


The binutils patch needs some serious work, I'm afraid.
Back to top
View user's profile Send private message
rmh3093
Advocate
Advocate


Joined: 06 Aug 2003
Posts: 2138
Location: Albany, NY

PostPosted: Fri Nov 10, 2006 3:20 pm    Post subject: Reply with quote

Chewi wrote:
Eh? If you're referring to having to set CROSS_COMPILE all the time, I did that because that's how the standard kernel does is. Those .hhl files were a MontaVista thing.


oh.... yeah i didnt remember ever seeing those.... why dont your just hardcode the ARCH and CROSSCOMPILER into the make file, just put that in a broken out patch or something


PS: class is over in a week and then I will finally get to start playing with this
_________________
Do not meddle in the affairs of wizards, for they are subtle and quick to anger.
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Fri Nov 10, 2006 3:34 pm    Post subject: Reply with quote

I have hardcoded ARCH but not CROSS_COMPILE in case someone wants to use a different CHOST. I guess I could set a default value instead.

If anyone can figure what's wrong with binutils, I'd be very grateful. I haven't managed to figure it out yet though I've been very busy with work.
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Sat Nov 11, 2006 3:38 am    Post subject: Reply with quote

I managed to fix the first problem again without removing lines from mips-opc.c. Instead, I changed all the + characters to *. The second problem is still present though. It seems my initial assumption about these problems being related was wrong.
Back to top
View user's profile Send private message
Chewi
l33t
l33t


Joined: 01 Sep 2003
Posts: 789
Location: Edinburgh, Scotland

PostPosted: Sat Nov 11, 2006 4:24 am    Post subject: Reply with quote

Okay, there's some good news and some bad news. The good news is that I managed to fix binutils 2.16.1. I'm very pleased about that! The bad news is that the kernel compilation still trips up in the same place that the older binutils did. Damn. I guess it wasn't due to binutils being too old after all. I'll put the new binutils ebuild into the overlay tomorrow... or today since it's like 4:25am. :P
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 10, 11, 12  Next
Page 6 of 12

 
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