crosvm/tools/examples/baremetal
Daniel Verkamp 9fde8f499a examples/baremetal: exit instead of hanging
Use an INT3 (0xCC) instruction to cause the example to exit after
printing the message. This is more convenient than having to manually
kill crosvm from another terminal.

BUG=None
TEST=Run baremetal and observe that it exits

Change-Id: I4baeecca41d156c82bb1e1b27d0f8c2ba93959f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3691966
Reviewed-by: Anton Romanov <romanton@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-06-23 22:30:40 +00:00
..
.cargo
src examples/baremetal: exit instead of hanging 2022-06-23 22:30:40 +00:00
build.rs
Cargo.toml
layout.ld examples/baremetal: make paddr == vaddr 2022-06-23 22:30:39 +00:00
README.md
rust-toolchain
x86_64-naked.json

This is a small baremetal x86_64 application that can be booted with crosvm. You can simply do cargo run and it'll build it and use crosvm from PATH to launch it. Alternatively you can build it with cargo build and run with crosvm run --disable-sandbox path/to/target/x86_64-naked/debug/baremetal

The application does nothing but output Hello World! log line over serial port and go into infinite loop. This is expected and you'll need to kill crosvm to stop it.