File tree 7 files changed +83
-2
lines changed
7 files changed +83
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ members = [
16
16
" syscall" ,
17
17
# init process
18
18
" init" ,
19
+ # device model application
20
+ " dm" ,
19
21
]
20
22
21
23
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ IGVMBIN = bin/igvmbld
45
45
IGVMMEASURE = "target/x86_64-unknown-linux-gnu/${TARGET_PATH}/igvmmeasure"
46
46
IGVMMEASUREBIN = bin/igvmmeasure
47
47
INITELF = "target/x86_64-unknown-none/${TARGET_PATH}/init"
48
+ DMELF = "target/x86_64-unknown-none/${TARGET_PATH}/dm"
48
49
49
50
RUSTDOC_OUTPUT = target/x86_64-unknown-none/doc
50
51
DOC_SITE = target/x86_64-unknown-none/site
@@ -134,7 +135,11 @@ bin/init: bin
134
135
cargo build --manifest-path init/Cargo.toml ${CARGO_ARGS} --bin init
135
136
objcopy -O elf64-x86-64 --strip-unneeded ${INITELF} $@
136
137
137
- user : bin/init
138
+ bin/dm : bin
139
+ cargo build --manifest-path dm/Cargo.toml ${CARGO_ARGS} --bin dm
140
+ objcopy -O elf64-x86-64 --strip-unneeded ${DMELF} $@
141
+
142
+ user : bin/init bin/dm
138
143
139
144
${FS_BIN} : bin
140
145
ifneq ($(FS_FILE ) , none)
@@ -177,7 +182,7 @@ bin/svsm-test.bin: bin/stage1-test
177
182
178
183
clippy :
179
184
cargo clippy --workspace --all-features --exclude svsm-fuzz --exclude igvmbuilder --exclude igvmmeasure -- -D warnings
180
- cargo clippy --workspace --all-features --exclude svsm-fuzz --exclude svsm --exclude init --target=x86_64-unknown-linux-gnu -- -D warnings
185
+ cargo clippy --workspace --all-features --exclude svsm-fuzz --exclude svsm --exclude init --exclude dm -- target=x86_64-unknown-linux-gnu -- -D warnings
181
186
RUSTFLAGS=" --cfg fuzzing" cargo clippy --package svsm-fuzz --all-features --target=x86_64-unknown-linux-gnu -- -D warnings
182
187
cargo clippy --workspace --all-features --tests --target=x86_64-unknown-linux-gnu -- -D warnings
183
188
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " dm"
3
+ version = " 0.1.0"
4
+ edition = " 2021"
5
+
6
+ [[bin ]]
7
+ name = " dm"
8
+ path = " src/main.rs"
9
+ test = false
10
+
11
+ [dependencies ]
12
+ syscall = { path = " ../syscall" }
13
+
14
+ [lints ]
15
+ workspace = true
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MIT OR Apache-2.0
2
+ fn main ( ) {
3
+ println ! ( "cargo:rustc-link-arg-bin=dm=-nostdlib" ) ;
4
+ println ! ( "cargo:rustc-link-arg-bin=dm=-no-pie" ) ;
5
+ println ! ( "cargo:rustc-link-arg-bin=dm=-Tdm/dm.lds" ) ;
6
+ }
Original file line number Diff line number Diff line change
1
+ OUTPUT_ARCH (i386:x86-64 )
2
+
3
+ SECTIONS
4
+ {
5
+ .text : {
6
+ *(.text)
7
+ *(.text.*)
8
+ }
9
+ . = ALIGN (4096);
10
+ .rodata : { *(.rodata) *(.rodata.*) }
11
+ . = ALIGN (4096);
12
+ .data : { *(.data) *(.data.*) }
13
+ . = ALIGN (4096);
14
+ .bss : {
15
+ *(.bss) *(.bss.*)
16
+ . = ALIGN (4096);
17
+ }
18
+ . = ALIGN (4096);
19
+ }
20
+
21
+ ENTRY (dm_start )
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MIT OR Apache-2.0
2
+ //
3
+ // Copyright (c) 2024 Intel Corporation.
4
+ //
5
+ // Author: Chuanxiao Dong <chuanxiao.dong@intel.com>
6
+
7
+ #![ no_std]
8
+ #![ no_main]
9
+
10
+ use core:: panic:: PanicInfo ;
11
+ use syscall:: exit;
12
+
13
+ fn dm_exit ( ) -> ! {
14
+ exit ( 0 ) ;
15
+ }
16
+
17
+ #[ no_mangle]
18
+ pub extern "C" fn dm_start ( ) -> ! {
19
+ dm_exit ( ) ;
20
+ }
21
+
22
+ #[ panic_handler]
23
+ fn panic ( _info : & PanicInfo < ' _ > ) -> ! {
24
+ dm_exit ( ) ;
25
+ }
You can’t perform that action at this time.
0 commit comments