qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Booting custom kernel in qemu
@ 2011-05-26 19:59 Apelete Seketeli
  2011-05-27 12:55 ` Amit Shah
  0 siblings, 1 reply; 4+ messages in thread
From: Apelete Seketeli @ 2011-05-26 19:59 UTC (permalink / raw)
  To: qemu-devel

Hello,

I'm trying to boot a custom linux kernel in qemu, and I plan to
contribute the necessary work to make it work (this is the first step
I'm taking to add OS support in qemu). I'm totally new to qemu, and I
haven't found enough information to know how to start debugging the
thing, so I thought of asking here.

I wanted to launch the kernel in a terminal for practical purposes, so
I tried:

qemu -kernel bzImage -append console=ttyS0

There still was no output in the terminal after that, so I'm planning
to attach qemu to gdb, and try to debug it that way.

Can you please provide some help on how to debug the kernel in qemu ?
-- 
        Apelete

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Booting custom kernel in qemu
  2011-05-26 19:59 [Qemu-devel] Booting custom kernel in qemu Apelete Seketeli
@ 2011-05-27 12:55 ` Amit Shah
  2011-05-28 20:05   ` Apelete Seketeli
  0 siblings, 1 reply; 4+ messages in thread
From: Amit Shah @ 2011-05-27 12:55 UTC (permalink / raw)
  To: Apelete Seketeli; +Cc: qemu-devel

On (Thu) 26 May 2011 [21:59:01], Apelete Seketeli wrote:
> Hello,
> 
> I'm trying to boot a custom linux kernel in qemu, and I plan to
> contribute the necessary work to make it work (this is the first step
> I'm taking to add OS support in qemu). I'm totally new to qemu, and I
> haven't found enough information to know how to start debugging the
> thing, so I thought of asking here.
> 
> I wanted to launch the kernel in a terminal for practical purposes, so
> I tried:
> 
> qemu -kernel bzImage -append console=ttyS0

Add -serial stdio to get those logs.

		Amit

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Booting custom kernel in qemu
  2011-05-27 12:55 ` Amit Shah
@ 2011-05-28 20:05   ` Apelete Seketeli
  2011-05-29  9:41     ` Andreas Färber
  0 siblings, 1 reply; 4+ messages in thread
From: Apelete Seketeli @ 2011-05-28 20:05 UTC (permalink / raw)
  To: Amit Shah; +Cc: qemu-devel

On 27-May-11, Amit Shah wrote:
> On (Thu) 26 May 2011 [21:59:01], Apelete Seketeli wrote:
> > Hello,
> > 
> > I'm trying to boot a custom linux kernel in qemu, and I plan to
> > contribute the necessary work to make it work (this is the first step
> > I'm taking to add OS support in qemu). I'm totally new to qemu, and I
> > haven't found enough information to know how to start debugging the
> > thing, so I thought of asking here.
> > 
> > I wanted to launch the kernel in a terminal for practical purposes, so
> > I tried:
> > 
> > qemu -kernel bzImage -append console=ttyS0
> 
> Add -serial stdio to get those logs.

Well,

qemu -kernel bzImage -append console=ttyS0 -serial stdio

does not give me any output, I guess it's because the thing get stuck
early during the boot process. For the time being I'm using

qemu -kernel bzImage -append console=ttyS0 -S -nographic

in order to launch gdbserver in the monitor and attach a gdb in the
host; I hope I'll be able to follow the boot process in the debugger
and understand qemu inner workings.

I have a question though:

$ qemu -S -kernel arch/x86/boot/bzImage -append console=ttyS0 -nographic -serial stdio
chardev: opening backend "stdio" failed
qemu: could not open serial device 'stdio': No such file or directory

Why do I get an error since stdio is (according to the manual) the
standard device in non graphical mode ? 

-- 
        Apelete

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Booting custom kernel in qemu
  2011-05-28 20:05   ` Apelete Seketeli
@ 2011-05-29  9:41     ` Andreas Färber
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Färber @ 2011-05-29  9:41 UTC (permalink / raw)
  To: Apelete Seketeli; +Cc: Amit Shah, qemu-devel

Am 28.05.2011 um 22:05 schrieb Apelete Seketeli:

> On 27-May-11, Amit Shah wrote:
>> On (Thu) 26 May 2011 [21:59:01], Apelete Seketeli wrote:
>>> I wanted to launch the kernel in a terminal for practical  
>>> purposes, so
>>> I tried:
>>>
>>> qemu -kernel bzImage -append console=ttyS0
>>
>> Add -serial stdio to get those logs.
>
> [...] For the time being I'm using
>
> qemu -kernel bzImage -append console=ttyS0 -S -nographic
>
> in order to launch gdbserver in the monitor and attach a gdb in the
> host; [...]

You can use -S -s or -S -gdb ... for that.

> $ qemu -S -kernel arch/x86/boot/bzImage -append console=ttyS0 - 
> nographic -serial stdio
> chardev: opening backend "stdio" failed
> qemu: could not open serial device 'stdio': No such file or directory
>
> Why do I get an error since stdio is (according to the manual) the
> standard device in non graphical mode ?

-nographic implies -serial stdio, so it's redundant. When using SDL or  
Cocoa, -serial stdio gives you serial on the console in addition to  
the graphical window. -nographic just gives you the console output.

HTH,
Andreas

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-29  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-26 19:59 [Qemu-devel] Booting custom kernel in qemu Apelete Seketeli
2011-05-27 12:55 ` Amit Shah
2011-05-28 20:05   ` Apelete Seketeli
2011-05-29  9:41     ` Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).