Skip to content

Commit ce5181e

Browse files
committed
Add linux submodule and config
1 parent 3396deb commit ce5181e

File tree

6 files changed

+2456
-6
lines changed

6 files changed

+2456
-6
lines changed

.gitmodules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
[submodule "seabios"]
22
path = seabios
33
url = https://github.com/mythril-hypervisor/seabios.git
4+
shallow = true
5+
[submodule "linux"]
6+
path = linux
7+
url = https://github.com/mythril-hypervisor/linux.git
8+
shallow = true

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ DOCKER_IMAGE=adamschwalm/hypervisor-build:9
66
multiboot2_binary = target/$(MULTIBOOT2_TARGET)/$(BUILD_TYPE)/mythril_multiboot2
77
mythril_src = $(shell find . -type f -name '*.rs' -or -name '*.S' -or -name '*.ld' \
88
-name 'Cargo.toml')
9+
kernel = linux/arch/x86_64/boot/bzImage
910
seabios = seabios/out/bios.bin
1011
git_hooks_src = $(wildcard .mythril_githooks/*)
1112
git_hooks = $(subst .mythril_githooks,.git/hooks,$(git_hooks_src))
@@ -20,7 +21,7 @@ ifeq ($(BUILD_TYPE), release)
2021
endif
2122

2223
.PHONY: all
23-
all: multiboot2 $(seabios)
24+
all: multiboot2 $(seabios) $(kernel)
2425

2526
.PHONY: multiboot2
2627
multiboot2: $(multiboot2_binary)
@@ -38,12 +39,16 @@ $(seabios):
3839
cp scripts/seabios.config seabios/.config
3940
make -C seabios
4041

42+
$(kernel):
43+
cp scripts/kernel.config linux/.config
44+
make -C linux bzImage
45+
4146
.PHONY: qemu
42-
qemu: multiboot2 $(seabios)
47+
qemu: multiboot2 $(seabios) $(kernel)
4348
./scripts/mythril-run.sh $(multiboot2_binary) $(QEMU_EXTRA)
4449

4550
.PHONY: qemu-debug
46-
qemu-debug: multiboot2-debug $(seabios)
51+
qemu-debug: multiboot2-debug $(seabios) $(kernel)
4752
./scripts/mythril-run.sh $(multiboot2_binary) \
4853
-gdb tcp::1234 -S $(QEMU_EXTRA)
4954

@@ -69,6 +74,7 @@ test: test_core
6974
clean:
7075
$(CARGO) clean
7176
make -C seabios clean
77+
make -C linux clean
7278

7379
.PHONY: dev-init
7480
dev-init: install-git-hooks

linux

Submodule linux added at f1d6a7b

mythril_multiboot2/src/main.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,13 @@ fn default_vm(
113113
linux::load_linux(
114114
"kernel",
115115
"initramfs",
116-
"rodata=0 nopti disableapic acpi=off earlyprintk=serial,0x3f8,115200 console=ttyS0 debug nokaslr noapic mitigations=off root=/dev/ram0 rdinit=/init\0"
117-
.as_bytes(),
116+
core::concat!(
117+
"rodata=0 nopti disableapic acpi=off ",
118+
"earlyprintk=serial,0x3f8,115200 ",
119+
"console=ttyS0 debug nokaslr noapic mitigations=off ",
120+
"root=/dev/ram0 rdinit=/init\0"
121+
)
122+
.as_bytes(),
118123
mem,
119124
&mut fw_cfg_builder,
120125
services,

0 commit comments

Comments
 (0)