Skip to contentSkip to conversation

Please make K2 Linux bootable without PeeMON again

DISCUSSION Michael Sokolov 2 participants 2 messages Nov 27, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines · Tom Rini

Er, why can't you find the magic location for the bi_recs and set that as well as the other registers you need to?

Because that location is tied to the kernel's symbols (__bss_start in this case), and I have no way of knowing where that is. The kernel has already been loaded into memory (by occult) by the time my booter runs, and my booter doesn't have access to the original vmlinux ELF header or to System.map.

Quoted 6 lines
Quoted 3 lines

The patch below makes the K2 vmlinux expect a pointer to bi_recs in R3 like I do on the Adirondack and makes the "simple" zImage goo pass a pointer to its magic bi_recs in R3.

And breaks all of the other ports which use 'simple' and expect bi_recs in the 'normal' place.

No, it doesn't. The patch I posted yesterday doesn't and cannot break anything. The bi_recs are still being created in exactly the same place as before, I just made the wrapper set R3 to point to that location before jumping to the kernel. As R3 on entry to the kernel was previously undefined for "simple", this cannot break anything. Why R3? Because there already is a precedent for it (Adirondack).

Quoted 2 lines

For now I'd much rather add back in the register
checks.

You mean put arch/ppc/platforms/k2_setup.c back the way it was? That would work for me. In that case you would also need to make arch/ppc/boot/common/relocate.S put at least some meaningful values in R4 and R6 (at least zeros) so that the kernel doesn't interpret garbage in those registers as pointers to stuff.

Quoted 2 lines

For 2.5 we can agree on a less magical and more predictable location. Would somewhere around the end of memory work for you?

But why won't you just let me put it where I want and tell the kernel where I put it? I'll fork Linux if I have to, but I would prefer not to.

MS

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 10 lines · Michael Sokolov
Quoted 2 lines · Tom Rini

Er, why can't you find the magic location for the bi_recs and set that as well as the other registers you need to?

Because that location is tied to the kernel's symbols (__bss_start in this case), and I have no way of knowing where that is. The kernel has already been loaded into memory (by occult) by the time my booter runs, and my booter doesn't have access to the original vmlinux ELF header or to System.map.

Alright. But what other magical bits do you need to shove in the registers? The wrappers do:
rec = (struct bi_record *)_ALIGN((ulong)zimage_size + (1<<20)-1,(1<<20));

Does the occult magic know the size?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

The patch below makes the K2 vmlinux expect a pointer to bi_recs in R3 like I do on the Adirondack and makes the "simple" zImage goo pass a pointer to its magic bi_recs in R3.

And breaks all of the other ports which use 'simple' and expect bi_recs in the 'normal' place.

No, it doesn't. The patch I posted yesterday doesn't and cannot break anything.

Er, oh yeah, thanks.:w

Quoted 5 lines
Quoted 2 lines

For 2.5 we can agree on a less magical and more predictable location. Would somewhere around the end of memory work for you?

But why won't you just let me put it where I want and tell the kernel where I put it? I'll fork Linux if I have to, but I would prefer not to.

Well, the register magic is being deprecated in 2.5, or that's the plan anyhow. Why can't the occult load whatever the 2.5 bi_recs look like into memory someplace?

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/