diff --git a/Cargo.lock b/Cargo.lock index 0ec9b19ec..88ffa88f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1139,6 +1139,13 @@ dependencies = [ "subtle", ] +[[package]] +name = "userdm" +version = "0.1.0" +dependencies = [ + "userlib", +] + [[package]] name = "userinit" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 7218eae08..11b311ac2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,8 @@ members = [ "user/lib", # Init user-space module "user/init", + # device model module + "user/dm", ] @@ -39,6 +41,7 @@ syscall = { path = "syscall" } packit = { path = "packit" } userlib = { path = "user/lib" } userinit = { path = "user/init" } +userdm = { path = "user/dm" } # crates.io aes-gcm = { version = "0.10.3", default-features = false } diff --git a/configs/all-targets.json b/configs/all-targets.json index 3a4a7f820..ba0c2004a 100644 --- a/configs/all-targets.json +++ b/configs/all-targets.json @@ -53,6 +53,9 @@ "modules": { "userinit": { "path": "/init" + }, + "userdm": { + "path": "/dm" } } } diff --git a/configs/hyperv-target.json b/configs/hyperv-target.json index 4a4379cf5..57e9afc7d 100644 --- a/configs/hyperv-target.json +++ b/configs/hyperv-target.json @@ -35,6 +35,9 @@ "modules": { "userinit": { "path": "/init" + }, + "userdm": { + "path": "/dm" } } } diff --git a/configs/qemu-target.json b/configs/qemu-target.json index ceb60bd07..c292dc8a8 100644 --- a/configs/qemu-target.json +++ b/configs/qemu-target.json @@ -34,6 +34,9 @@ "modules": { "userinit": { "path": "/init" + }, + "userdm": { + "path": "/dm" } } } diff --git a/configs/vanadium-target.json b/configs/vanadium-target.json index 4a000095d..c9f6f66a3 100644 --- a/configs/vanadium-target.json +++ b/configs/vanadium-target.json @@ -35,6 +35,9 @@ "modules": { "userinit": { "path": "/init" + }, + "userdm": { + "path": "/dm" } } } diff --git a/user/dm/Cargo.toml b/user/dm/Cargo.toml new file mode 100644 index 000000000..6b7c35aab --- /dev/null +++ b/user/dm/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "userdm" +version = "0.1.0" +edition = "2021" + +[dependencies] +userlib.workspace = true + +[lints] +workspace = true diff --git a/user/dm/build.rs b/user/dm/build.rs new file mode 100644 index 000000000..563023a57 --- /dev/null +++ b/user/dm/build.rs @@ -0,0 +1,4 @@ +fn main() { + println!("cargo:rustc-link-arg=-Tuser/lib/module.lds"); + println!("cargo:rustc-link-arg=-no-pie"); +} diff --git a/user/dm/src/main.rs b/user/dm/src/main.rs new file mode 100644 index 000000000..192f67cfd --- /dev/null +++ b/user/dm/src/main.rs @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: MIT +// +// Copyright (c) 2024 Intel Corporation. +// +// Author: Vijay Dhanraj + +#![no_std] +#![no_main] + +use userlib::*; + +declare_main!(main); + +fn main() -> u32 { + 0 +}