Category:Unikraft Users: Difference between revisions

From Xen
Jump to navigationJump to search
(Notes about console and memory allocation)
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 56: Line 56:


In this early release, there a couple of things that do not work yet as expected. Please check out
In this early release, there a couple of things that do not work yet as expected. Please check out
[https://wiki.xenproject.org/wiki/Category:Unikraft_Devel this page#Core_Team_-_Current_Work_Items] to get an overview of items we are working on:
[https://wiki.xenproject.org/wiki/Category:Unikraft_Devel#Core_Team_-_Current_Work_Items this page] to get an overview of items we are working on:


* Console on Xen is not working. In order to see any output, use a Xen hypervisor that supports debug consoles (you probably need to rebuild the hypervisor with `debug=y`). In Unikraft's menu go to <code>Library configuration -> ukdebug -> Message redirection</code> and select <code>kernel messages on debug output</code>.
* Console on Xen on ARM is not working. In order to see any output, use a Xen hypervisor that supports debug consoles (you probably need to rebuild the hypervisor with `debug=y`). In Unikraft's menu go to <code>Library configuration -> ukdebug -> Message redirection</code> and select <code>kernel messages on debug output</code>. Note that <code>printf()</code> will still not work until the Xen console is implemented.
Note that <code>printf()</code> will still not work until the Xen console is implemented.


* Memory allocator fails for Xen on ARM. In Unikraft's menu, unselect <code>Library configuration -> ukboot -> Initialize ukallocbbuddy as allocator</code>
* Initialization of memory allocator crashes on Xen on ARM. In Unikraft's menu, unselect <code>Library configuration -> ukboot -> Initialize ukallocbbuddy as allocator</code>

* Scheduling works currently only on x86 and Xen.

Latest revision as of 14:27, 22 December 2017

Getting started with Unikraft

In the following we will compile and run a small "Hello World"-application with Unikraft. Before we start you'll need to make sure that you have gcc, make and git installed.

First of all, we are going to create a directory structure for building Unikraft:

 mkdir unikraft
 cd unikraft
 mkdir apps

Clone the Unikraft main repo:

 git clone http://xenbits.xen.org/git-http/unikraft/unikraft.git

Clone the helloworld application to apps/:

 cd apps
 git clone http://xenbits.xen.org/git-http/unikraft/apps/helloworld.git

We're now ready to start configuring the application image via Unikraft's menu. To access it, simply type:

 cd helloworld
 make menuconfig

Select your target architecture and platforms. There will be an image generated for each platform. After you exit and saved your configuration, we can build the individual unikernel images:

 make

After the build completed, you can run your image. The execution steps depends where you run the image on.

For Linux user-space, the image is just a standard ELF, so you can simply run it with:

 ./build/helloworld_linuxu-x86_64

For KVM, you can use the following command line:

 qemu-system-x86_64 -enable-kvm -m 4 -device isa-debug-exit -vga none -device sga -serial stdio -kernel build/helloworld_kvm-x86_64

For Xen, you first need to create a VM configuration:

 name          = 'helloworld'
 vcpus         = '1'
 memory        = '4'
 kernel        = './build/helloworld_xen-x86_64'

Save it as helloworld.cfg and run the guest with:

 xl create -c helloworld.cfg


And that's it! For more information please check out the documentation in our Unikraft repository. Thanks!


Known issues

In this early release, there a couple of things that do not work yet as expected. Please check out this page to get an overview of items we are working on:

  • Console on Xen on ARM is not working. In order to see any output, use a Xen hypervisor that supports debug consoles (you probably need to rebuild the hypervisor with `debug=y`). In Unikraft's menu go to Library configuration -> ukdebug -> Message redirection and select kernel messages on debug output. Note that printf() will still not work until the Xen console is implemented.
  • Initialization of memory allocator crashes on Xen on ARM. In Unikraft's menu, unselect Library configuration -> ukboot -> Initialize ukallocbbuddy as allocator
  • Scheduling works currently only on x86 and Xen.

This category currently contains no pages or media.