Port-ofppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ofwboot, why does it work?



The ofwboot version 1.12 doesn't work for me, but I see some reports
that it works for other people. I wonder how:

in arch/ofppc/stand/ofwboot/Locore.c the stack is defined small
int stack[8192/4 + 4] __attribute__((__aligned__ (4), __used__));

and then in arch/ofppc/stand/ofwboot/ofdev.c

int devopen() {
...
/* allow disk blocks up to 65536 bytes */
  char buf[DEV_BSIZE<<7];

This is much larger than the allocated stack, and on my machine I get
(gdb) x buf
0x2027c <OF_open+40>:   0x48007e3d

As a result, as soon as the 'buf' is written, it smashes the OF_* functions.
How does it work on some machines?
Is the stack allocated elsewhere?

-- 
Regards,
Artyom Tarasenko

SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu


Home | Main Index | Thread Index | Old Index