openEuler开源新项目,嵌入式实时虚拟机ZVM介绍

ZVM是一款由湖南大学嵌入式与网络计算湖南省重点实验室开发的嵌入式实时虚拟机,基于ZephyrRTOS,支持同时运行Linux和Zephyr。项目已开源至openEuler社区,其关键技术包括安全隔离、设备管理和性能优化,如利用硬件虚拟化技术实现CPU和内存虚拟化,以及中断和设备管理,旨在提供安全、高效的多操作系统环境。

嵌入式实时虚拟机ZVM(Zephyr-based Virtual Machine)是由湖南大学嵌入式与网络计算湖南省重点实验室(以下简称“湖大嵌入式实验室”)主任谢国琪教授主导设计并开发的虚拟化软件。该软件基于实时操作系统(RTOS)Zephyr开发,可同时启动Linux与Zephyr 2个Guest OS,从而在同一硬件平台上实现混合内核部署。

2023年2月,湖大嵌入式实验室正式将该项目开源至openEuler社区。

图片

1. 背景介绍

嵌入式实时虚拟化技术是一种允许在单个硬件平台上同时运行多个操作系统、并保持确定性和时间关键性能的技术,该技术可为嵌入式系统开发带来许多好处,例如硬件整合、系统隔离、系统灵活可靠性、安全性和可扩展性等。嵌入式实时虚拟化可支持智能汽车、数控机床及5G设备等高级应用。

开发嵌入式实时虚拟化软件面临着一些挑战。第一个挑战是如何确保不同Guest OS间的隔离和安全性,尤其是当它们具有不同级别的关键性和可信度时。第二个挑战是如何在不同Guest OS间有效地共享或分配 I/O 设备,这可能需要设备模拟或直通机制。第三个挑战是如何确保作为Guest OS运行的RTOS具备低延迟和高吞吐量。

嵌入式实时虚拟化软件需要通过提供强制的隔离和安全、高效的中断处理、灵活的 I/O 设备管理机制及硬件支持来应对这些挑战。基于架构硬件虚拟化支持与虚拟化主机拓展支持,湖大嵌入式实验室开发了基于Zephyr RTOS的虚拟化软件ZVM,实现了Guest OS间的隔离、设备分配及中断处理,保证了系统的安全与实时。

2. 技术路线

ZVM总体功能需要关注三个部分:安全隔离、设备管理和系统性能提升。

(1)安全隔离: 利用虚拟化技术实现不同特权级的应用支持,确保不同Guest OS间的隔离和安全

CarpVM 是一个用 C 语言编写的小型虚拟机。可以嵌入在应用程序中使用。 包含的指令集有: HALT (code): Halts and attempts to clean up stack, data memory, and label memory before exiting with given exit code. NOP (): Does nothing. Seriously. LOAD (reg, val): Loads given integer value into given register. MOV (dst, src): Copies contents of src register into dst register. ADD (): Pops the top two integers from the stack and pushes their sum. SUB (): Pops the top two integers from the stack and pushes the difference (lower minus upper). MUL (): Pops the top two integers from the stack and pushes their product. MOD (rega, regb): Computes rega % regb and stores in ERX. NOT (reg): Computes bitwise NOT of reg and stores in reg. XOR (): Pops the top two integers from the stack and XORs them. OR (): Pops the top two integers from the stack and ORs them. AND (): Pops the top two integers from the stack and ANDs them. INCR (reg): Increments value in given register. DECR (reg): Decrements value in given register. INC (): Increments the value at the top of the stack. DEC (): Decrements the value at the top of the stack. PUSHR (reg): Pushes value in given register. PUSH (val): Pushes given value. POP (val): Pops an integer from the stack and dumps it into GBG. CMP (): Pops the top two integers from the stack and checks if equal. 0 means equal. Result will be pushed onto the stack. MOV (rega, regb): Move value in rega to regb. JZ (addr): Jumps to given absolute address if top of the stack is 0. RJZ (diff): Adds differential to current EIP (relative jump) if top of the stack is 0. JNZ (addr): Jumps to given absolute address if top of the stack is not 0. RJNZ (diff): Adds differential to current EIP (relative jump) if top of the stack is not 0. JMP (addr): Jumps to given absolute address. RJMP (diff): Adds differential to current EIP (relative jump). DBS (key, val): Sets data memory at key (string pointer) to given value. DBG (key, reg): Gets value from data memory at key (string pointer) and dumps it into given register. CALL (key, nargs): Save state and set EIP to value in data memory at key. RET (val): Push return value and load state. PREG (reg): Prints contents of given register. PTOP (): Peeks top of stack and prints top value. 标签:CarpVM
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

openEuler社区

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值