Digging the kboot for playstation3

Probably some of us already read about how the playstation3 firmware runs linux (the “OtherOS”)

Some insight:

1- it uses as bootloader a very minimal linux system that then loads the right kernel using the kexec call (yai!, after the gamecube the other ppc platform with kexec implemented is the playstation3…)
2- the instructions obviously are scarce and seems to point out that the provided loader has a nice script to install just one kind of distro (I’ll let the reader the exercise of guessing witch) and doesn’t seem to provide anything useful if you happen to prefer something else…
3- [update] you can access the busybox shell from kbuild and just install gentoo the usual way (suggested using recent ppc64 stage3 and then build a cell-sources kernel using the cell_defconfig)

The kboot is quite neat in itself: it has a great deal of features (like ssh or tftp) and uses pretty standard tools (busybox, linux, kexec-tools, dropbear) plus something specific (the ps3pf-utils).

I’ll add the ps3pf-utils once I have them mirrored on powerdeveloper and maybe adding an unofficial svn/git for it and libspe2 (since looks like they will be improved a lot in the next weeks and keeping track fo the patches is a bit easier this way)

YAGU – Yet another global update

– Ps3/Cell: I eventually fixed the binutils in order to get it build for spu-elf, I’m about to unbreak better gcc since someone thought NOTE_INSN_EXPECTED_VALUE wouldn’t be of any use, while the spu.md is using it for the cmp instructions… (needless to say my workaround isn’t working that well…), tomorrow hopefully I’ll update the patchset either with the revert of this patch or with a proper solution (hard since I’m not that proficient in gcc internals =/), I’m afraid of glibc…

– Fenice/lscube: trac + git is a no go, trac itself or setuputils on the fedora server that is streaming is from bad to idiotic or maybe it’s just me unproficient, add also that gitweb seems unavailable as fedora and you get an interesting picture, importing is easy, working almost (once everybody figures the commands), so there some uncertain about a full transition.

– Personal life: You can use anything happens to you to improve, still I’m afraid I won’t develop the ability to teleport and/or timeshift in order to improve the situation, anyway I’m unfeeling better.

– University: I’m forced to do something in mono for an exam and obviously I have about 30h to learn enough gtk# to do that, luckly glade is always glade…

Busy times…

I’m trying to archive probably much more than I should, so far:

– Cell/Ps3 stuff -> I’m moving most of the stuff in the portage tree (see the mask), I hope to have an updated toolchain for tomorrow evening.

– Fenice stuff -> the merge is coming on nicely and I’m about to move everything to git, git-grep won the heart of everybody =)

– ffmpeg unleashed -> Yes, I removed the mask today, blender’s ffmpeg has been updated, hopefully I won’t have to hack that way with the newer release…

– myself -> I’m trying to recover a bit of rationality, probably that’s the harder part, working/overworking is helping me not to think too much, well, I’ll see in the next months.

Tales from the ppc64 lairs

I spent some days on the glibc/gcc vs busybox issue, in the end:

– gcc-4.2.0 snapshot hates glibc-2.5 -> I’ll write a bug report about it soonish
– gcc-cell-4.0.2 hates glibc-2.5 -> I’ll check for updates soon.
– vapier forgot that busybox won’t take CFLAGS automatically but you have to set EXTRA_CFLAGS

Busybox now can link as static binary for ppc64 =)

gcc vs glibc vs ppc64

I got eventually a shell on a power5 box to test some stuff.

I’m trying discover what’s broken in glibc and/or gcc when you try to build as ppc64, currently busybox has some problems with setjmp symbols if you try to build it static, while trying snapshots I ended up in having other issues with gcc-4.2 snapshot not building glibc-2.5 and that looks like yet another pain =/

Luckly the box is fast enough to not take that much building and rebuilding glibc =)

CMake… why?

I just did some comparisons about cmake and something better like… autotools?

Step 0:

Some numbers just for fun:

nemesi lu_zero # qlop -tH cmake
cmake: 13 minutes, 35 seconds for 1 merges
nemesi lu_zero # qlop -tH make
make: 1 minute, 0 seconds for 2 merges
nemesi lu_zero # qlop -tH bash
bash: 2 minutes, 32 seconds for 3 merges
nemesi lu_zero # qlop -tH perl
perl: 7 minutes, 52 seconds for 4 merges
nemesi lu_zero # qlop -tH m4
m4: 32 seconds for 1 merges
nemesi lu_zero # qlop -tH automake
automake: 1 minute, 8 seconds for 7 merges
nemesi lu_zero # qlop -tH autoconf
autoconf: 30 seconds for 4 merges

Ok cmake is a ugly hog at least while building.

Step 1:
What you want from your build system:

– take as little resources as possible
– have it as much portable as possible
– have as little as possible to write
– have a good way to express conditionals
– let you have your program correctly built on a large number of arches.
– automagically spot dependencies
– let you use tools like distcc and ccache in an effective way

Step 2:

Uglyness scale before cmake:

imake, scons: bad ideas with a bad implementation, everybody knows that, somebody is workarounding scons a lot, I hope for a fork.

qmake: not sure which part is bad, nobody likes to use it that much for a reason or another.

plain make: simple and to the point, it may not scale that well.

autotools: most people misuse them, many despise certain choices. The lack of good documentation and the version incompatibilities made them in a bad light, things are getting better little by little. The most used system despite the ugly Makefiles produced. I’d use them with their reference at hand.

kbuild: it is wonderful, works really well once you lay it out, it is even simple! Problem: you don’t have a stand alone template to fill so it is much an hacking over existing deployments.

Step 3:

put cmake in the scale:

1- takes forever to build
2- is compact
3- uses the same approach as aclocal m4 files (call them Modules/*.cmake) but has a risible number of them.
4- supports less platforms than autotools
5- the syntax is a brain damage between imake and autotools
6- Hype points because kde4 could use it

Step 4:

When it could have sense:

1- your project is targeting what cmake supports already
2- you like its brain damages more than others
3- you misused autotools and now you are trying to misuse another build system (hopefully it won’t make you misuse it that much).
4- you absolutely love the ability to have project files for some commonly used proprietary ides out of the cmake native files.
5- you want to gain some hype points to your project.

Summary:

cmake is a wonderful technology that should take the way of the dodo and never touch your hard disk, gives nothing more than a lobotomized autotools (and that is good since you can commit less mistakes) has the good mix of hype points and laziness compliant features.

In short cmake developers feel free to ignore me, this is a rant, I hadn’t wrote a build system that will be used by a large project and probably I’m not so entitled to write such large stain of venom.

You obviously can take it seriously and prove me wrong with a next version with 1/2 the build time, less overhead and a nicer syntax.

UPDATE:

flameeyes told me that cmake doesn’t have a way to set cflags/ldflags/asflags on a per target basis. So it is a wonderful regression to pile up to the rest…

UPDATE2:

http://dev.gentoo.org/~lu_zero/development/cdrkit-1.0pre3.tar.bz2
I played a bit with autotools to see how bad they are and/or how good cmake is…
I started from scratch for the first time using autotools…
There are some minor changes but nothing interesting.

Poking in Mesa…

Yesterday I had a look at the curent mesa sources…

And I found out that x86 and amd64 had plenty of optimized code, mostly hand made assembly!
What about ppc you’d ask? Well, there is an empty dir with the code to know if the cpu has altivec or not =_=…

I should study for my last exams so I won’t do much about it in the short time =/

Fixing errors on the toolchain

Recently got some reports about bizarre hangs on binutils on non ppc arches

Today eventually I fixed the (pretty dumb) error I made while preparing the patch, don’t ask me why I hadn’t tracked it before (working on semi-native environment shadowed it pretty well).

Hopefully today I’ll add a fix for the linux makefile trying to use uname -m while crossbuilding headers.

Japan!

As probably some of you already know (since I’m telling everybody about that) I’m about to spend 3 weeks in japan, with some luck I’ll get some random uplink now and then.

I’ll be in Tokyo for a week then I’ll wander for the Island by train for a week and then I’ll spend the rest of the time in Tokyo again.