<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="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
exec $DIR/run-magenta -a x86-64 "$@"</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 <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</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=2,threads=2,sockets=1 -cpu Haswell,+smap -append</code></pre>
<br>
<p></p>
<p>打印一堆启动信息</p>
<p></p>
<pre class="blockcode"><code class="language-plain">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.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.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 re |
|