在qemu中运行magenta

论坛 期权论坛     
选择匿名的用户   2021-5-23 01:40   142   0
<p>前面已经编译了magenta内核</p>
<p>并且准备好了qemu模拟器</p>
<p><br> </p>
<p>进入magenta目录</p>
<p>看下脚本./scripts/run-magenta-x86-64</p>
<p></p>
<pre class="blockcode"><code class="language-plain">~/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&#61;&#34;$( cd &#34;$( dirname &#34;${BASH_SOURCE[0]}&#34; )&#34; &amp;&amp; pwd )&#34;

exec $DIR/run-magenta -a x86-64 &#34;$&#64;&#34;</code></pre>
<br> 以参数-a x86-64执行run-magenta脚本
<br>
<p></p>
<p>先看下帮助信息</p>
<p></p>
<pre class="blockcode"><code class="language-plain">~/fuchsia/magenta$ ./scripts/run-magenta -h
help:
-a &lt;arch&gt;           : 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 &lt;memory in MB&gt;   : default 512MB
-n                  : run with emulated nic
-N                  : run with emulated nic via tun/tap
-o &lt;dir&gt;            : build directory
-r                  : run release build
-u                  : use uniprocessor
-v                  : use vnc based display
-x &lt;bootfs&gt;         : add eXtra bootfs
-h for help
all arguments after -- are passed to qemu directly</code></pre>
<br> 脚本run-magenta主要是根据平台选择qemu及设置参数
<p></p>
<p>执行./scripts/run-magenta-x86-64</p>
<p>可以看到脚本最终执行的命令</p>
<p></p>
<pre class="blockcode"><code class="language-plain">qemu-system-x86_64 -m 512 -nographic -machine q35 -kernel /home/jiang/fuchsia/magenta/build-magenta-pc-x86-64/magenta.bin -smp cores&#61;2,threads&#61;2,sockets&#61;1 -cpu Haswell,&#43;smap -append</code></pre>
<br>
<p></p>
<p>打印一堆启动信息</p>
<p></p>
<pre class="blockcode"><code class="language-plain">warning: TCG doesn&#39;t support requested feature: CPUID.01H:EDX.vme [bit 1]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.fma [bit 12]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.pcid [bit 17]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.x2apic [bit 21]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.tsc-deadline [bit 24]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.xsave [bit 26]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.avx [bit 28]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.f16c [bit 29]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.rdrand [bit 30]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.fsgsbase [bit 0]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.hle [bit 4]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.avx2 [bit 5]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.erms [bit 9]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.invpcid [bit 10]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.rtm [bit 11]
warning: TCG doesn&#39;t support requested feature: CPUID.0DH:EAX.xsaveopt [bit 0]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:EDX.vme [bit 1]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.fma [bit 12]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.pcid [bit 17]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.x2apic [bit 21]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.tsc-deadline [bit 24]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.xsave [bit 26]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.avx [bit 28]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.f16c [bit 29]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.rdrand [bit 30]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.fsgsbase [bit 0]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.hle [bit 4]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.avx2 [bit 5]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.erms [bit 9]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.invpcid [bit 10]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.rtm [bit 11]
warning: TCG doesn&#39;t support requested feature: CPUID.0DH:EAX.xsaveopt [bit 0]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:EDX.vme [bit 1]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.fma [bit 12]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.pcid [bit 17]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.x2apic [bit 21]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.tsc-deadline [bit 24]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.xsave [bit 26]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.avx [bit 28]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.f16c [bit 29]
warning: TCG doesn&#39;t support requested feature: CPUID.01H:ECX.rdrand [bit 30]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.fsgsbase [bit 0]
warning: TCG doesn&#39;t support requested feature: CPUID.07H:EBX.hle [bit 4]
warning: TCG doesn&#39;t support re
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP