Page 1 of 2

gc-linux kernel build

Posted: Wed Mar 15, 2017 2:49 pm
by liquitt
Hey,
has anybody ever tried to build a newer linux kernel? Since all the new kernel still bring a arch/powerpc/gamecube_defconfig file with them...
Just curious and i don't have a build machine atm - but might set one up for that.

Re: gc-linux kernel build

Posted: Wed Mar 15, 2017 4:37 pm
by novenary
Just tried it with the latest devkitppc. Two problems so far. It's most likely fixable but I don't really feel like looking into it right now.

Code: Select all

arch/powerpc/perf/bhrb.S: Assembler messages:
arch/powerpc/perf/bhrb.S:26: Error: unrecognized opcode: `cmpldi'
arch/powerpc/perf/bhrb.S:28: Error: unrecognized opcode: `ld'
arch/powerpc/perf/bhrb.S:29: Error: unrecognized opcode: `sldi'

Code: Select all

arch/powerpc/kernel/idle_6xx.S: Assembler messages:
arch/powerpc/kernel/idle_6xx.S:135: Error: unrecognized opcode: `dssall'
I'm using the 4.10.3 tarball from kernel.org, and this is all I've tried:

Code: Select all

export ARCH=powerpc
export CROSS_COMPILE=powerpc-eabi-
make gamecube_defconfig
make -j8

Re: gc-linux kernel build

Posted: Wed Mar 15, 2017 4:40 pm
by liquitt
i just realised - we don't have any patches for version > 2.6.32 :)

Re: gc-linux kernel build

Posted: Wed Mar 15, 2017 4:44 pm
by novenary
If a defconfig is included you should still be able to get a basic kernel built. That is indeed pretty ancient though. :P

Welcome back, by the way. :)

Re: gc-linux kernel build

Posted: Wed Mar 15, 2017 5:23 pm
by tueidj
Streetwalker wrote:

Code: Select all

arch/powerpc/perf/bhrb.S: Assembler messages:
arch/powerpc/perf/bhrb.S:26: Error: unrecognized opcode: `cmpldi'
arch/powerpc/perf/bhrb.S:28: Error: unrecognized opcode: `ld'
arch/powerpc/perf/bhrb.S:29: Error: unrecognized opcode: `sldi'
That file shouldn't be getting built... try adding CONFIG_PPC_PERF_CTRS=n to gamecube_defconfig.

Code: Select all

arch/powerpc/kernel/idle_6xx.S: Assembler messages:
arch/powerpc/kernel/idle_6xx.S:135: Error: unrecognized opcode: `dssall'
The BEGIN_FTR_SECTION/END_FTR_SECTION block surrounding that instruction should be guarded with #ifdef CONFIG_ALTIVEC/#endif as per https://github.com/01org/kvm-sgx/blob/4 ... es.txt#L37

Re: gc-linux kernel build

Posted: Wed Mar 15, 2017 6:22 pm
by liquitt
which kernel did you try btw? 4.10.3?
and thanks - i instantly feel home again!

Re: gc-linux kernel build

Posted: Wed Mar 15, 2017 7:54 pm
by novenary
Well, I guess this is something? Video output is garbled but this is what I get over USB Gecko after applying tueidj's workarounds and hacking a DOL together.
Image

Next step would be to stick a userspace in there but I'm lazy right now.

Re: gc-linux kernel build

Posted: Wed Mar 15, 2017 8:59 pm
by liquitt
yay! that looks good indeed. c'mon - you can do it ;)

Re: gc-linux kernel build

Posted: Wed Mar 15, 2017 10:11 pm
by novenary
So as discussed on IRC, besides the USB Gecko console and the PIC, pretty much all of the drivers are missing and will need to be forward-ported from gc-linux. This is definitely not a showstopper, but it's still quite a bit of work and I have other priorities right now so I'll pass, but I might come back to it later.

Re: gc-linux kernel build

Posted: Wed Mar 15, 2017 11:18 pm
by liquitt
Streetwalker wrote:So as discussed on IRC, besides the USB Gecko console and the PIC, pretty much all of the drivers are missing and will need to be forward-ported from gc-linux. This is definitely not a showstopper, but it's still quite a bit of work and I have other priorities right now so I'll pass, but I might come back to it later.
once i have a 2.6.32 system up and running i'll see what's in there ;)

Re: gc-linux kernel build

Posted: Mon Mar 20, 2017 2:23 pm
by novenary
Here's what I've got so far. Patch and dol included, you will need to modify elf2dol for now if you want to build it (remove the exit at line 225). The kernel binary will be at arch/powerpc/boot/dtbImage.gamecube.

Re: gc-linux kernel build

Posted: Tue Mar 21, 2017 8:09 pm
by emu_kidid
I'm gone for a week and liquitt and gc-Linux come back to life!

Re: gc-linux kernel build

Posted: Tue Mar 21, 2017 8:22 pm
by megalomaniac
emu_kidid wrote:I'm gone for a week and liquitt and gc-Linux come back to life!
maybe you should leave more often, things seem to always happen when "you're" not around

Re: gc-linux kernel build

Posted: Wed Mar 22, 2017 10:35 am
by liquitt
haha :D

Re: gc-linux kernel build

Posted: Wed Mar 22, 2017 4:15 pm
by Sierron
Now we just need proper video output. That fruit salat output isn't helping.

But nice to see some further work on this :)

Re: gc-linux kernel build

Posted: Tue Jul 25, 2017 2:00 am
by jn____
I've written a few buildroot patches automatically generate a .DOL file from a mainline kernel for gamecube.
I haven't tested it yet, because I currently don't have a USBGecko, but it should make userspace generation a lot more convenient.

Code: Select all

$ git clone -b gc https://github.com/neuschaefer/buildroot && cd buildroot
$ make gamecube_defconfig
$ make menuconfig #or nconfig
$ make linux-menuconfig #or linux-nconfig
$ make -j4
... wait while it compiles everything ...
And then you'll have a kernel.dol in images/, if everything went well.

Expect the gc branch to move nonlinearly as I tweak and refine things.

Re: gc-linux kernel build

Posted: Tue Jul 25, 2017 11:19 am
by novenary
Nice. Does it generate a kernel with appended initrd? Since there's no SD driver at the moment it would be convenient to have.

Re: gc-linux kernel build

Posted: Wed Jul 26, 2017 11:41 am
by liquitt
Nice! Progress!
...my GC got out of the basement already, it's getting closer, haha

Re: gc-linux kernel build

Posted: Sat Jul 29, 2017 2:15 am
by emu_kidid
liquitt wrote:Nice! Progress!
...my GC got out of the basement already, it's getting closer, haha
It must have the GC legs attachment, be careful it doesn't run away.

Seriously though, I'd love to see this up & running, can we get a repo up somewhere where we can all contribute and add support for ide-exi, sdhc, wkf, etc.

Re: gc-linux kernel build

Posted: Thu Aug 03, 2017 12:13 am
by jn____
Streetwalker wrote:Nice. Does it generate a kernel with appended initrd? Since there's no SD driver at the moment it would be convenient to have.
Yes, the gamecube/wii_defconfig uses a baked-in initrd.

So far, I've tested on the Wii, and got a shell over usbgecko (kernel patches with the forward-ported drivers coming soon-ish, maybe). GC didn't work, but the buildroot part of it should be fine.

You can also tell buildroot to use a kernel from a custom git repo, if you need that.

Re: gc-linux kernel build

Posted: Thu Aug 03, 2017 8:02 am
by novenary
Here's my source tree in case you're interested. https://github.com/Streetwalrus/gc-linux
I've only tested it on GC. The elf2dol patch has been merged into devkitppc tools but you still need to compile the latest version from git.

Re: gc-linux kernel build

Posted: Thu Aug 17, 2017 4:23 pm
by Sierron
Any update on this?

Re: gc-linux kernel build

Posted: Fri Aug 18, 2017 12:01 am
by novenary
Not really. I'm personally busy with other projects and Linux on the GameCube is pretty boring imo, not much you can do with 24MB RAM (that another device can't do better anyway).
Of course having something that works is really cool, but having no real purpose for it doesn't motivate me at all.

Re: gc-linux kernel build

Posted: Wed Sep 06, 2017 2:11 pm
by SyproLives
Are you talking about managing the filter tables of a Linux kernel? If so, this will be useful, as there's some info on iptables that should help.

Re: gc-linux kernel build

Posted: Wed Sep 06, 2017 7:40 pm
by novenary
What do you mean? The point is to get modern kernels to boot on the GC.