在qemu中运行magenta

本文档描述了如何在QEMU模拟环境中运行Magenta内核。首先,已经完成了Magenta内核的编译,并配置好QEMU。通过执行`./scripts/run-magenta-x86-64`脚本启动模拟器,该脚本最终调用的命令显示了启动信息。在Magenta内核启动后,可以使用`help`命令查看可用选项,最后通过Ctrl + a x组合键退出QEMU模拟器。
摘要由CSDN通过智能技术生成

前面已经编译了magenta内核

并且准备好了qemu模拟器


进入magenta目录

看下脚本./scripts/run-magenta-x86-64

~/fuchsia/magenta$ cat ./scripts/run-magenta-x86-64 
#!/bin/bash

# Copyright 2016 The Fuchsia Authors
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

exec $DIR/run-magenta -a x86-64 "$@"

以参数-a x86-64执行run-magenta脚本

先看下帮助信息

~/fuchsia/magenta$ ./scripts/run-magenta -h
help:
-a <arch>           : arm32, arm64, or x86-64
-b                  : build first
-c                  : add item to kernel commandline
-d                  : run with emulated disk
-g                  : use graphical console
-k                  : use KVM
-m <memory in MB>   : default 512MB
-n                  : run with emulated nic
-N                  : run with emulated nic via tun/tap
-o <dir>            : build directory
-r                  : run release build
-u                  : use uniprocessor
-v                  : use vnc based display
-x <bootfs>         : add eXtra bootfs
-h for help
all arguments after -- are passed to qemu directly

脚本run-magenta主要是根据平台选择qemu及设置参数

执行./scripts/run-magenta-x86-64

可以看到脚本最终执行的命令

qemu-system-x86_64 -m 512 -nographic -machine q35 -kernel /home/jiang/fuchsia/magenta/build-magenta-pc-x86-64/magenta.bin -smp cores=2,threads=2,sockets=1 -cpu Haswell,+smap -append

打印一堆启动信息

warning: TCG doesn't support requested feature: CPUID.01H:EDX.vme [bit 1]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.pcid [bit 17]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.x2apic [bit 21]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.tsc-deadline [bit 24]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.xsave [bit 26]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.avx [bit 28]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.f16c [bit 29]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.rdrand [bit 30]
warning: TCG doesn't support requested feature: CPUID.07H:EBX.fsgsbase [bit 0]
warning: TCG doesn't support requested feature: CPUID.07H:EBX.hle [bit 4]
warning: TCG doesn't support requested feature: CPUID.07H:EBX.avx2 [bit 5]
warning: TCG doesn't support requested feature: CPUID.07H:EBX.erms [bit 9]
warning: TCG doesn't support requested feature: CPUID.07H:EBX.invpcid [bit 10]
warning: TCG doesn't support requested feature: CPUID.07H:EBX.rtm [bit 11]
warning: TCG doesn't support requested feature: CPUID.0DH:EAX.xsaveopt [bit 0]
warning: TCG doesn't support requested feature: CPUID.01H:EDX.vme [bit 1]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.fma [bit 12]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.pcid [bit 17]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.x2apic [bit 21]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.tsc-deadline [bit 24]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.xsave [bit 26]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.avx [bit 28]
warning: TCG doesn't support requested feature: CPUID.01H:ECX.f16
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值