xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Xen Unikernel: from zero to Hello World!
@ 2015-10-27 19:42 Carl Patenaude Poulin
  2015-10-27 19:59 ` Konrad Rzeszutek Wilk
  2015-10-28 12:02 ` Andrew Cooper
  0 siblings, 2 replies; 3+ messages in thread
From: Carl Patenaude Poulin @ 2015-10-27 19:42 UTC (permalink / raw)
  To: xen-devel

Hi all,

Thanks to Andrew Cooper's priceless help, I've managed to put
together a Xen PV kernel that does nothing except loop forever. I'm
going to try making it print "Hello, world!".

I was hoping someone could fact-check my research. What I've dug up
is:
* I need to load my unikernel with `xl -c` to get console output.
* My kernel currently refuses to load with the `-c` option. From
what I've read online, this is because I need to implement a console
device driver, similar to Mini-OS's xencons_ring.c.
* On Xen debug builds, I don't need a console device driver, I can
just do HYPERVISOR_console_io hypercalls.

What strategy would you use to debug this early in the development
process? Is there a debugger I should be using?

I'd appreciate any information and any links to information, even
when it's only tangentially relevant.

Thanks in advance,

Carl Patenaude Poulin
B Eng Software undergraduate at McGill University

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

* Re: Xen Unikernel: from zero to Hello World!
  2015-10-27 19:42 Xen Unikernel: from zero to Hello World! Carl Patenaude Poulin
@ 2015-10-27 19:59 ` Konrad Rzeszutek Wilk
  2015-10-28 12:02 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-10-27 19:59 UTC (permalink / raw)
  To: Carl Patenaude Poulin; +Cc: xen-devel

On Tue, Oct 27, 2015 at 03:42:19PM -0400, Carl Patenaude Poulin wrote:
> Hi all,
> 
> Thanks to Andrew Cooper's priceless help, I've managed to put
> together a Xen PV kernel that does nothing except loop forever. I'm
> going to try making it print "Hello, world!".
> 
> I was hoping someone could fact-check my research. What I've dug up
> is:
> * I need to load my unikernel with `xl -c` to get console output.
> * My kernel currently refuses to load with the `-c` option. From
> what I've read online, this is because I need to implement a console
> device driver, similar to Mini-OS's xencons_ring.c.

/me nods.
> * On Xen debug builds, I don't need a console device driver, I can
> just do HYPERVISOR_console_io hypercalls.

Right.
> 
> What strategy would you use to debug this early in the development
> process? Is there a debugger I should be using?

You can use gdbsx - and then gdb.  See http://www.slideshare.net/xen_com_mgr/from-printk-to-qemu-xenlinux-kernel-debugging
slide 15.

> 
> I'd appreciate any information and any links to information, even
> when it's only tangentially relevant.
> 
> Thanks in advance,
> 
> Carl Patenaude Poulin
> B Eng Software undergraduate at McGill University
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: Xen Unikernel: from zero to Hello World!
  2015-10-27 19:42 Xen Unikernel: from zero to Hello World! Carl Patenaude Poulin
  2015-10-27 19:59 ` Konrad Rzeszutek Wilk
@ 2015-10-28 12:02 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2015-10-28 12:02 UTC (permalink / raw)
  To: Carl Patenaude Poulin, xen-devel

On 27/10/15 19:42, Carl Patenaude Poulin wrote:
> Hi all,
>
> Thanks to Andrew Cooper's priceless help, I've managed to put
> together a Xen PV kernel that does nothing except loop forever. I'm
> going to try making it print "Hello, world!".
>
> I was hoping someone could fact-check my research. What I've dug up
> is:
> * I need to load my unikernel with `xl -c` to get console output.

-c is a parameter to `xl create`

Alternatively, you could do `xl create` followed by `xl console` later. 
However, there are usability issues with both of these approaches in
combination with short-lived domains.

> * My kernel currently refuses to load with the `-c` option. From
> what I've read online, this is because I need to implement a console
> device driver, similar to Mini-OS's xencons_ring.c.

What is the error message you get?  A PV guest always has a console, so
there is no refusal available to happen.  I suspect you have actually
hit one of the usability issues I eluded to above.

> * On Xen debug builds, I don't need a console device driver, I can
> just do HYPERVISOR_console_io hypercalls.

Always do all development with a debug hypervisor.  Even for guests, you
get more useful information out when something goes wrong.

Longterm you will want a better way of getting logging out of the guest,
but console_io hypercalls are a good start for very early bits.

~Andrew

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

end of thread, other threads:[~2015-10-28 12:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-27 19:42 Xen Unikernel: from zero to Hello World! Carl Patenaude Poulin
2015-10-27 19:59 ` Konrad Rzeszutek Wilk
2015-10-28 12:02 ` Andrew Cooper

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).