* [Qemu-devel] OpenBios in Sparc can't handle long kernel command lines.
@ 2013-03-22 5:19 Rob Landley
2013-03-28 19:20 ` Mark Cave-Ayland
2013-04-19 10:27 ` [Qemu-devel] " Mark Cave-Ayland
0 siblings, 2 replies; 5+ messages in thread
From: Rob Landley @ 2013-03-22 5:19 UTC (permalink / raw)
To: qemu-devel
If I do this:
qemu-system-sparc -nographic -no-reboot -kernel image -hda hda.sqf
-append 'root=/dev/sda rw init=/sbin/init.sh panic=1
PATH=/usr/distcc:/bin:/sbin console=ttyS0 HOST=sparc CPUS=1
DISTCC_HOSTS=10.0.2.2:31322/1 FTP_SERVER=10.0.2.2 FTP_PORT=31307
NATIVE_BUILD=lfs-bootstrap ' -hdb hdb.img -hdc lfs-bootstrap.hdc -m 256
qemu goes:
^[[H^[[JConfiguration device id QEMU version 1 machine id 32
CPUs: 1 x FMI,MB86904
Unhandled Exception 0x00000007
PC = 0xffd07d28 NPC = 0xffd07d2c
Stopping execution
And then hangs. I've never figured out why it clears the screen first
(none of the other targets do), but I _have_ figured out that the
unhandled exception is "kernel command line too long". Because 197
bytes is just too much data for Sparc to cope with.
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] OpenBios in Sparc can't handle long kernel command lines.
2013-03-22 5:19 [Qemu-devel] OpenBios in Sparc can't handle long kernel command lines Rob Landley
@ 2013-03-28 19:20 ` Mark Cave-Ayland
2013-03-30 13:21 ` [Qemu-devel] [OpenBIOS] " Blue Swirl
2013-04-19 10:27 ` [Qemu-devel] " Mark Cave-Ayland
1 sibling, 1 reply; 5+ messages in thread
From: Mark Cave-Ayland @ 2013-03-28 19:20 UTC (permalink / raw)
To: Rob Landley; +Cc: The OpenBIOS Mailinglist, qemu-devel
On 22/03/13 05:19, Rob Landley wrote:
> If I do this:
>
> qemu-system-sparc -nographic -no-reboot -kernel image -hda hda.sqf
> -append 'root=/dev/sda rw init=/sbin/init.sh panic=1
> PATH=/usr/distcc:/bin:/sbin console=ttyS0 HOST=sparc CPUS=1
> DISTCC_HOSTS=10.0.2.2:31322/1 FTP_SERVER=10.0.2.2 FTP_PORT=31307
> NATIVE_BUILD=lfs-bootstrap ' -hdb hdb.img -hdc lfs-bootstrap.hdc -m 256
>
> qemu goes:
>
> ^[[H^[[JConfiguration device id QEMU version 1 machine id 32
> CPUs: 1 x FMI,MB86904
> Unhandled Exception 0x00000007
> PC = 0xffd07d28 NPC = 0xffd07d2c
> Stopping execution
>
> And then hangs. I've never figured out why it clears the screen first
> (none of the other targets do), but I _have_ figured out that the
> unhandled exception is "kernel command line too long". Because 197 bytes
> is just too much data for Sparc to cope with.
This is actually a bug in OpenBIOS which declares the command line
storage like this:
static void
arch_init( void )
{
static char cmdline[128];
....
kernel_cmdline = (const char *)
fw_cfg_read_i32(FW_CFG_KERNEL_CMDLINE);
if (kernel_cmdline) {
size = strlen(kernel_cmdline);
memcpy(cmdline, kernel_cmdline, size);
obp_arg.argv[1] = cmdline;
}
cmdline[size] = '\0';
....
}
Would increasing it to 256 bytes be enough? I can't say I've ever come
across command lines in a normal environment with more than about 80
characters, but I don't see an issue with increasing it.
ATB,
Mark.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [OpenBIOS] OpenBios in Sparc can't handle long kernel command lines.
2013-03-28 19:20 ` Mark Cave-Ayland
@ 2013-03-30 13:21 ` Blue Swirl
0 siblings, 0 replies; 5+ messages in thread
From: Blue Swirl @ 2013-03-30 13:21 UTC (permalink / raw)
To: The OpenBIOS Mailinglist; +Cc: qemu-devel
On Thu, Mar 28, 2013 at 7:20 PM, Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
> On 22/03/13 05:19, Rob Landley wrote:
>
>> If I do this:
>>
>> qemu-system-sparc -nographic -no-reboot -kernel image -hda hda.sqf
>> -append 'root=/dev/sda rw init=/sbin/init.sh panic=1
>> PATH=/usr/distcc:/bin:/sbin console=ttyS0 HOST=sparc CPUS=1
>> DISTCC_HOSTS=10.0.2.2:31322/1 FTP_SERVER=10.0.2.2 FTP_PORT=31307
>> NATIVE_BUILD=lfs-bootstrap ' -hdb hdb.img -hdc lfs-bootstrap.hdc -m 256
>>
>> qemu goes:
>>
>> ^[[H^[[JConfiguration device id QEMU version 1 machine id 32
>> CPUs: 1 x FMI,MB86904
>> Unhandled Exception 0x00000007
>> PC = 0xffd07d28 NPC = 0xffd07d2c
>> Stopping execution
>>
>> And then hangs. I've never figured out why it clears the screen first
>> (none of the other targets do), but I _have_ figured out that the
>> unhandled exception is "kernel command line too long". Because 197 bytes
>> is just too much data for Sparc to cope with.
>
>
> This is actually a bug in OpenBIOS which declares the command line storage
> like this:
>
> static void
> arch_init( void )
> {
> static char cmdline[128];
>
> ....
>
> kernel_cmdline = (const char *)
> fw_cfg_read_i32(FW_CFG_KERNEL_CMDLINE);
> if (kernel_cmdline) {
> size = strlen(kernel_cmdline);
> memcpy(cmdline, kernel_cmdline, size);
> obp_arg.argv[1] = cmdline;
> }
> cmdline[size] = '\0';
>
> ....
> }
>
> Would increasing it to 256 bytes be enough? I can't say I've ever come
> across command lines in a normal environment with more than about 80
> characters, but I don't see an issue with increasing it.
Isn't strdup() (or memory allocation subsystem) available at that time?
>
>
> ATB,
>
> Mark.
>
> --
> OpenBIOS http://openbios.org/
> Mailinglist: http://lists.openbios.org/mailman/listinfo
> Free your System - May the Forth be with you
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] OpenBios in Sparc can't handle long kernel command lines.
2013-03-22 5:19 [Qemu-devel] OpenBios in Sparc can't handle long kernel command lines Rob Landley
2013-03-28 19:20 ` Mark Cave-Ayland
@ 2013-04-19 10:27 ` Mark Cave-Ayland
2013-04-22 15:40 ` Rob Landley
1 sibling, 1 reply; 5+ messages in thread
From: Mark Cave-Ayland @ 2013-04-19 10:27 UTC (permalink / raw)
To: Rob Landley; +Cc: qemu-devel
On 22/03/13 05:19, Rob Landley wrote:
> If I do this:
>
> qemu-system-sparc -nographic -no-reboot -kernel image -hda hda.sqf
> -append 'root=/dev/sda rw init=/sbin/init.sh panic=1
> PATH=/usr/distcc:/bin:/sbin console=ttyS0 HOST=sparc CPUS=1
> DISTCC_HOSTS=10.0.2.2:31322/1 FTP_SERVER=10.0.2.2 FTP_PORT=31307
> NATIVE_BUILD=lfs-bootstrap ' -hdb hdb.img -hdc lfs-bootstrap.hdc -m 256
>
> qemu goes:
>
> ^[[H^[[JConfiguration device id QEMU version 1 machine id 32
> CPUs: 1 x FMI,MB86904
> Unhandled Exception 0x00000007
> PC = 0xffd07d28 NPC = 0xffd07d2c
> Stopping execution
>
> And then hangs. I've never figured out why it clears the screen first
> (none of the other targets do), but I _have_ figured out that the
> unhandled exception is "kernel command line too long". Because 197 bytes
> is just too much data for Sparc to cope with.
>
> Rob
This is now fixed in OpenBIOS SVN trunk, and so should be included in
QEMU 1.5 when we update the images in git master. Thanks for the report!
ATB,
Mark.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] OpenBios in Sparc can't handle long kernel command lines.
2013-04-19 10:27 ` [Qemu-devel] " Mark Cave-Ayland
@ 2013-04-22 15:40 ` Rob Landley
0 siblings, 0 replies; 5+ messages in thread
From: Rob Landley @ 2013-04-22 15:40 UTC (permalink / raw)
To: Mark Cave-Ayland; +Cc: qemu-devel
On 04/19/2013 05:27:55 AM, Mark Cave-Ayland wrote:
> On 22/03/13 05:19, Rob Landley wrote:
>
>> If I do this:
>>
>> qemu-system-sparc -nographic -no-reboot -kernel image -hda hda.sqf
>> -append 'root=/dev/sda rw init=/sbin/init.sh panic=1
>> PATH=/usr/distcc:/bin:/sbin console=ttyS0 HOST=sparc CPUS=1
>> DISTCC_HOSTS=10.0.2.2:31322/1 FTP_SERVER=10.0.2.2 FTP_PORT=31307
>> NATIVE_BUILD=lfs-bootstrap ' -hdb hdb.img -hdc lfs-bootstrap.hdc -m
>> 256
>>
>> qemu goes:
>>
>> ^[[H^[[JConfiguration device id QEMU version 1 machine id 32
>> CPUs: 1 x FMI,MB86904
>> Unhandled Exception 0x00000007
>> PC = 0xffd07d28 NPC = 0xffd07d2c
>> Stopping execution
>>
>> And then hangs. I've never figured out why it clears the screen first
>> (none of the other targets do), but I _have_ figured out that the
>> unhandled exception is "kernel command line too long". Because 197
>> bytes
>> is just too much data for Sparc to cope with.
>>
>> Rob
>
> This is now fixed in OpenBIOS SVN trunk, and so should be included in
> QEMU 1.5
> when we update the images in git master. Thanks for the report!
Yay! Thank you. I look forward to trying it out when QEMU refreshes.
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-04-22 15:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-22 5:19 [Qemu-devel] OpenBios in Sparc can't handle long kernel command lines Rob Landley
2013-03-28 19:20 ` Mark Cave-Ayland
2013-03-30 13:21 ` [Qemu-devel] [OpenBIOS] " Blue Swirl
2013-04-19 10:27 ` [Qemu-devel] " Mark Cave-Ayland
2013-04-22 15:40 ` Rob Landley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.