-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The device model is a user mode program which manages VM's life cycles and handles various vmexits events. The initial version just calls exit() syscall without doing anything else. Signed-off-by: Vijay Dhanraj <[email protected]> Signed-off-by: Chuanxiao Dong <[email protected]>
- Loading branch information
1 parent
4a6fef6
commit 0000873
Showing
11 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,9 @@ | |
"modules": { | ||
"userinit": { | ||
"path": "/init" | ||
}, | ||
"dm": { | ||
"path": "/dm" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,9 @@ | |
"modules": { | ||
"userinit": { | ||
"path": "/init" | ||
}, | ||
"dm": { | ||
"path": "/dm" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,9 @@ | |
"modules": { | ||
"userinit": { | ||
"path": "/init" | ||
}, | ||
"dm": { | ||
"path": "/dm" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,9 @@ | |
"modules": { | ||
"userinit": { | ||
"path": "/init" | ||
}, | ||
"dm": { | ||
"path": "/dm" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "dm" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
userlib.workspace = true | ||
syscall = { path = "../../syscall" } | ||
|
||
[lints] | ||
workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fn main() { | ||
println!("cargo:rustc-link-arg=-Tuser/lib/module.lds"); | ||
println!("cargo:rustc-link-arg=-no-pie"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: MIT | ||
// | ||
// Copyright (c) 2024 Intel Corporation. | ||
// | ||
// Author: Chuanxiao Dong <[email protected]> | ||
|
||
#![no_std] | ||
#![no_main] | ||
|
||
use core::panic::PanicInfo; | ||
use syscall::exit; | ||
|
||
fn dm_exit() -> ! { | ||
exit(0); | ||
} | ||
|
||
#[no_mangle] | ||
pub extern "C" fn _start() -> ! { | ||
dm_exit(); | ||
} | ||
|
||
#[panic_handler] | ||
fn panic(_info: &PanicInfo<'_>) -> ! { | ||
dm_exit(); | ||
} |