Skip to contentSkip to conversation

again 2.3.28

DISCUSSION Andreas Tobler 5 participants 13 messages Nov 17, 1999 – Nov 18, 1999

lore
Share & tools
lore
#0 lore raw

Hi,

my investigation brought me to the point, where I think the break must be between
prom_init (in prom.c called from Head.S) and identify_machine (in setup.c called from Head.S)
This is my interpretation of the code in Head.S? I certainly could be wrong..... Any ideas?

Thanks,
Andreas

Signature · 7 lines
| Andreas Tobler				
| CH-8004 Zuerich 							
| E-Mail: [email protected]	  [email protected]
-----------------------------------------------------------


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
#1 lore raw
Quoted 5 lines · Andreas Tobler

my investigation brought me to the point, where I think the break must be between prom_init (in prom.c called from Head.S) and identify_machine (in setup.c called from Head.S) This is my interpretation of the code in Head.S? I certainly could be wrong..... Any ideas?

Not really... I have the same problem, and no one seems to have any idea what is causing it:-( I traced it to the same place, but the problem is that you can't really even print anything, (at least not with my limited knowledge), because of the following in head.S:

/*
* Use the first pair of BAT registers to map the 1st 16MB
* of RAM to KERNELBASE. From this point on we can't safely
* call OF any more.
*/
lis r11,KERNELBASE@h
.
.
.

So, we can't use prom_print to print checkpoints and we can't use printk yet.

Ciao,

Signature · 6 lines
David N. Welton, Developer, Linuxcare, Inc.
415.354.4878 x241 tel, 415.701.7457 fax
[email protected], http://www.linuxcare.com/
Linuxcare. At the center of Linux.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
#9 lore raw
In reply to Andreas Tobler

i messed aroudn with .28 last night and it seems to die *after*
mmu_init but before start_kernel, you can test this by making and export a function which simply prom_print("got here\n");'s and then calling it from
head.S with the asm "bl my_got_here_function". it also gets passed
loading the new hash table.

thats all i could do last nite cause i left my serial cable at work :( what i would suggest is that you first apply my arch/ppc/mm/init.c fix and then use a serial debug console (make sure you have this in your kernel), and use kernel arg "console=ttyS0" and have a machine with a terminal running nearby. it could be dieing early in start_kernel...

ani

Quoted 10 lines · Andreas Tobler

Hi,

my investigation brought me to the point, where I think the break must be between
prom_init (in prom.c called from Head.S) and identify_machine (in setup.c called from Head.S)
This is my interpretation of the code in Head.S? I certainly could be wrong..... Any ideas?

Quoted 9 lines

Thanks,
Andreas

Signature · 4 lines
| Andreas Tobler				
| CH-8004 Zuerich 							
| E-Mail: [email protected]	  [email protected]
-----------------------------------------------------------

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

#2 lore raw
In reply to David N. Welton
Quoted 2 lines · David N. Welton

So, we can't use prom_print to print checkpoints and we can't use printk yet.

you can use prom_print to print until start_kernel, then you can
use printk because console_init() is done very early (unless its dieing before that which would really suck), but i'm pretty sure you should be able to prom_print until then. how are you calling your prints?

btw, what machine is this?

ani

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

#10 lore raw
In reply to Ani Joshi
Quoted 5 lines · Ani Joshi

i messed aroudn with .28 last night and it seems to die *after*
mmu_init but before start_kernel, you can test this by making and export a function which simply prom_print("got here\n");'s and then calling it from
head.S with the asm "bl my_got_here_function". it also gets passed
loading the new hash table.

Probably it depends on the machine, since I get up to free_all_bootmem(), which is called by mem_init() in start_kernel(). OK, I have a different box (CHRP) and was actually speaking about 2.3.27, but the 2.3.28 patch doesn't contain relevant changes.

Gr{oetje,eeting}s,
--
Geert Uytterhoeven -- Linux/{m68k~Amiga,PPC~CHRP} -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

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

#3 lore raw
In reply to Ani Joshi
Quoted 6 lines · Ani Joshi
Quoted 2 lines · David N. Welton

So, we can't use prom_print to print checkpoints and we can't use printk yet.

you can use prom_print to print until start_kernel,

This is from arch/ppc/kernel/prom.c :

* Because OF may have mapped I/O devices into the area starting at
* KERNELBASE, particularly on CHRP machines, we can't safely call
* OF once the kernel has been mapped to KERNELBASE. Therefore all
* OF calls should be done within prom_init(), and prom_init()
* and all routines called within it must be careful to relocate
* references as necessary.

This is indeed a CHRP machine, an RS6K F50, to be precise.

So, according to the people who wrote this code, you cannot do that.

Quoted 4 lines

then you can use printk because console_init() is done very early (unless its dieing before that which would really suck), but i'm pretty sure you should be able to prom_print until then. how are you calling your prints?

I was calling them with 'bl myfunc', which was defined as void myfunc () and contained a call to prom_print.

Thanks,

Signature · 6 lines
David N. Welton, Developer, Linuxcare, Inc.
415.354.4878 x241 tel, 415.701.7457 fax
[email protected], http://www.linuxcare.com/
Linuxcare. At the center of Linux.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
#4 lore raw
Quoted 1 line · David N. Welton

This is indeed a CHRP machine, an RS6K F50, to be precise.

ahh, i assumed you were on a pmac using bootx text console, well
yes, in that case you're
right, you cannot use prom_print there, *but*, benh has recently done something about this, check his ibook patches or somewhere on this page for this. he said he wanted to get this done, but i'm not sure if he has finished it yet.

ani

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

#5 lore raw

Mac specific code

Speaking of assuming people are using macs... I have noticed a fair amount of kernel pieces that have troubles if you don't include various pieces of Mac specific code. What is the best way to report these bugs? Unfortunately, my skills are such that I probably won't be able to accompany these bug reports with patches, at this stage... Should I even bother?

Ciao,

Signature · 6 lines
David N. Welton, Developer, Linuxcare, Inc.
415.354.4878 x241 tel, 415.701.7457 fax
[email protected], http://www.linuxcare.com/
Linuxcare. At the center of Linux.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
#11 lore raw
In reply to Geert Uytterhoeven
Quoted 4 lines · Geert Uytterhoeven

Probably it depends on the machine, since I get up to free_all_bootmem(), which is called by mem_init() in start_kernel(). OK, I have a different box (CHRP) and was actually speaking about 2.3.27, but the 2.3.28 patch doesn't contain relevant changes.

could your problem in free_all_bootmem() be caused by
"if(!bootmem_map) BUG();"? because in do_init_bootmem() it frees the bootmem bitmap (which is called very early). is it trying to free something thats already been free'd?

its possible this is happening on pmacs also...

ani

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

#12 lore raw
Quoted 6 lines · Ani Joshi
Quoted 4 lines · Geert Uytterhoeven

Probably it depends on the machine, since I get up to free_all_bootmem(), which is called by mem_init() in start_kernel(). OK, I have a different box (CHRP) and was actually speaking about 2.3.27, but the 2.3.28 patch doesn't contain relevant changes.

Quoted 6 lines

could your problem in free_all_bootmem() be caused by
"if(!bootmem_map) BUG();"? because in do_init_bootmem() it frees the bootmem bitmap (which is called very early). is it trying to free something thats already been free'd?

its possible this is happening on pmacs also...

As I posted before (last Friday), it gets further than that.

I'll try Paul's tree...

Gr{oetje,eeting}s,
--
Geert Uytterhoeven -- Linux/{m68k~Amiga,PPC~CHRP} -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

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

#6 lore raw
In reply to David N. Welton

Ok... hmmm, this may mean something, but I'll leave it to others to tell me if I've found something or if I'm just on crack.

copy_and_flush:

	addi	r5,r5,-4
	addi	r6,r6,-4
4:	li	r0,8
	mtctr	r0
3:	addi	r6,r6,4			/* copy a cache line */
	lwzx	r0,r6,r4
	stwx	r0,r6,r3
	bdnz	3b
	dcbst	r6,r3			/* write it to memory */
	sync
	icbi	r6,r3			/* flush the icache line */
	cmplw	0,r6,r5
	bl	davidw_debug	   <<<<<<<<< POSITION 1	
	blt	4b
	bl	davidw_debug	   <<<<<<<<< POSITION 2
	isync
	addi	r5,r5,4
	addi	r6,r6,4
	blr

When davidw_debug is in position 1, it actually exits the boot load back into the firmware with a 'default catch' or something like that. If it is in position 2, it just hangs and does nothing (possibly continuing with this loop forever?).

Is this significant? Or am I just messing up something else?

Ciao,

Signature · 6 lines
David N. Welton, Developer, Linuxcare, Inc.
415.354.4878 x241 tel, 415.701.7457 fax
[email protected], http://www.linuxcare.com/
Linuxcare. At the center of Linux.

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

You're just messing with something. Most likely you are
disrupting the condition register bits being used by the "blt" branch.

David

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

#8 lore raw
Quoted 3 lines · David Edelsohn

You're just messing with something. Most likely you are
disrupting the condition register bits being used by the "blt" branch.

Hmm... well, the 'davidw_debug' is supposed to crap out. It's a function that calls printk, which I have been told is not really available at that point in the game. I have noticed that I get a nice 'default catch' when it hits the printk, whereas, if I move the function further down the list of things that happens, it apparently isn't reached (or at least nothing is printed), as nothing crashes.

Maybe I should use a function that is guaranteed to crash?

Anyway, by moving this 'bomb' function around and rebooting way too much, I narrowed down a region of code that I don't get the crash after (meaning it hasn't reached my crash function or that it is suddently ok to call it). That's what I posted...

It's been quite time consuming, and not very elegant, but lacking anything else, it's all I have really (supposedly, someone is getting me a null modem cable tommorow so that I can try and connect to the serial port).

Thanks,

Signature · 6 lines
David N. Welton, Developer, Linuxcare, Inc.
415.354.4878 x241 tel, 415.701.7457 fax
[email protected], http://www.linuxcare.com/
Linuxcare. At the center of Linux.

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