[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Rust unikernels




Hi Geoffroy and Thomas,

On Tue, Jul 28, 2015 at 4:29 AM, Thomas Leonard <talex5@xxxxxxxxx> wrote:
On 27 July 2015 at 15:54, Thomas Leonard <talex5@xxxxxxxxx> wrote:
> On 27 July 2015 at 09:36, Geoffroy Couprie <contact@xxxxxxxxxxxxxxxxxxx> wrote:
[...]

One other thing I should mention: Mini-OS runs in kernel mode and can
be interrupted at any time. On x86, the interrupt handler uses the
same stack as the rest of the code. Therefore, you must compile with
the Rust equivalent of -mno-red-zone so Rust doesn't assume it can
store things below the current stack pointer.

I'm just starting to learn Rust, but I managed to create a simple static lib and link it into a standalone Mini-OS build:

* build Rust from git with static musl libc support [1]
* compile libhello.a from [2]
* declare the Rust function as an extern in mini-os/kernel.c, call it from start_kernel()
* add -L... -lhello to the Mini-OS linker flags
* make and run

Geoffroy, how does this compare to your approach?

To understand the interactions between Xen, Mini-OS, and MirageOS, I found [3] and [4] useful starting points.

The zinc.rs [5] project, a Rust RTOS for ARM, could provide some inspiration for modeling low-level operations in a type-safe way.


--
Len
Â


--
Dr Thomas Leonard    http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDAÂ BD8E 0713 3F96 CA74 D8BA

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.