This change seems to fix the problem here with silo not being able to deal with bss data. The problem is that silo does access to an address which is calculated from %i3 + bss offset, so %i3 must be somehow initialized.
To do this I created start_client_image() helper which initializes clear context, fills it with stack pointer and client interface handler pointer then switches to it. According to docs all registers not used to convey data to client code must be cleared.
Since my sparc64-elf-gcc cross compiler managed to discard stores to __context in switch_to() I had to make __context a volatile pointer.
Signed-off-by: Igor Kovalenko igor.v.kovalenko@gmail.com
On 5/19/09, Igor Kovalenko igor.v.kovalenko@gmail.com wrote:
This change seems to fix the problem here with silo not being able to deal with bss data. The problem is that silo does access to an address which is calculated from %i3 + bss offset, so %i3 must be somehow initialized.
To do this I created start_client_image() helper which initializes clear context, fills it with stack pointer and client interface handler pointer then switches to it. According to docs all registers not used to convey data to client code must be cleared.
Since my sparc64-elf-gcc cross compiler managed to discard stores to __context in switch_to() I had to make __context a volatile pointer.
Signed-off-by: Igor Kovalenko igor.v.kovalenko@gmail.com
There is something strange with the patch, for example SILO on Gentoo 2008.0 install CD does not load completely: [sparc64] Booting file 'cdrom' with parameters '' Not a bootable ELF image Not a Linux kernel image Loading a.out image... Loaded 7680 bytes entry point is 0x4000 Jumping to entry point... switching to new context: entry point 0x4000 stack 0xffe50a51 SIUnhandled Exception 0x0000000000000068 PC = 0x00000000ffd0fd44 NPC = 0x00000000ffd0fd48 Stopping execution
On Wed, May 20, 2009 at 8:57 PM, Blue Swirl blauwirbel@gmail.com wrote:
On 5/19/09, Igor Kovalenko igor.v.kovalenko@gmail.com wrote:
This change seems to fix the problem here with silo not being able to deal with bss data. The problem is that silo does access to an address which is calculated from %i3 + bss offset, so %i3 must be somehow initialized.
To do this I created start_client_image() helper which initializes clear context, fills it with stack pointer and client interface handler pointer then switches to it. According to docs all registers not used to convey data to client code must be cleared.
Since my sparc64-elf-gcc cross compiler managed to discard stores to __context in switch_to() I had to make __context a volatile pointer.
Signed-off-by: Igor Kovalenko igor.v.kovalenko@gmail.com
There is something strange with the patch, for example SILO on Gentoo 2008.0 install CD does not load completely: [sparc64] Booting file 'cdrom' with parameters '' Not a bootable ELF image Not a Linux kernel image Loading a.out image... Loaded 7680 bytes entry point is 0x4000 Jumping to entry point... switching to new context: entry point 0x4000 stack 0xffe50a51 SIUnhandled Exception 0x0000000000000068 PC = 0x00000000ffd0fd44 NPC = 0x00000000ffd0fd48 Stopping execution
I now see there are other issues with that patch, for example stack pointer is assigned at bottom of client image stack.
Let's do a workaround instead. This patch just clears %i3 before calling client image, allowing silo to initialize and boot image.
On 5/27/09, Igor Kovalenko igor.v.kovalenko@gmail.com wrote:
On Wed, May 20, 2009 at 8:57 PM, Blue Swirl blauwirbel@gmail.com wrote:
On 5/19/09, Igor Kovalenko igor.v.kovalenko@gmail.com wrote:
This change seems to fix the problem here with silo not being able to deal with bss data. The problem is that silo does access to an address which is calculated from %i3 + bss offset, so %i3 must be somehow initialized.
To do this I created start_client_image() helper which initializes clear context, fills it with stack pointer and client interface handler pointer then switches to it. According to docs all registers not used to convey data to client code must be cleared.
Since my sparc64-elf-gcc cross compiler managed to discard stores to __context in switch_to() I had to make __context a volatile pointer.
Signed-off-by: Igor Kovalenko igor.v.kovalenko@gmail.com
There is something strange with the patch, for example SILO on Gentoo 2008.0 install CD does not load completely: [sparc64] Booting file 'cdrom' with parameters '' Not a bootable ELF image Not a Linux kernel image Loading a.out image... Loaded 7680 bytes entry point is 0x4000 Jumping to entry point... switching to new context: entry point 0x4000 stack 0xffe50a51 SIUnhandled Exception 0x0000000000000068 PC = 0x00000000ffd0fd44 NPC = 0x00000000ffd0fd48 Stopping execution
I now see there are other issues with that patch, for example stack pointer is assigned at bottom of client image stack.
Let's do a workaround instead. This patch just clears %i3 before calling client image, allowing silo to initialize and boot image.
Thanks, applied (r500).