Skip to content

Commit cce3121

Browse files
committed
Update Cargo.toml and configuration files for ArceOS support; adjust dependencies and paths for modules
1 parent 9a393d9 commit cce3121

File tree

8 files changed

+48
-33
lines changed

8 files changed

+48
-33
lines changed

Cargo.lock

Lines changed: 20 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ axvmconfig = {git = "https://github.com/arceos-hypervisor/axvmconfig.git", branc
9292
[patch.crates-io]
9393
axvmconfig = { path = "crates/axvmconfig" }
9494
axvisor_api = {path = "../axvisor_api"}
95-
# page_table_entry = { path = "../page_table_multiarch/page_table_entry" }
96-
# page_table_multiarch = { path = "../page_table_multiarch/page_table_multiarch", features = ["stage-2"]}
95+
# axvcpu = { path = "./crates/axvcpu" }
9796

9897
[patch."https://github.com/arceos-hypervisor/axvmconfig.git"]
9998
axvmconfig = {path = "crates/axvmconfig"}

configs/vms/arceos-riscv64-qemu-smp1.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ phys_cpu_ids = [0]
2020
entry_point = 0x8020_0000
2121
# The location of image: "memory" | "fs".
2222
# load from memory.
23-
image_location = "fs"
23+
image_location = "memory"
2424
# The file path of the kernel image.
25-
kernel_path = "/guest/helloworld_riscv64-qemu-virt.bin"
25+
kernel_path = "/path/tmp/images/helloworld_riscv64-qemu-virt.bin"
2626
# The load address of the kernel image.
2727
kernel_load_addr = 0x8020_0000
2828
# The file path of the device tree blob (DTB).
@@ -40,7 +40,7 @@ dtb_load_addr = 0x8220_0000
4040
# Memory regions with format (`base_paddr`, `size`, `flags`, `map_type`).
4141
# For `map_type`, 0 means `MAP_ALLOC`, 1 means `MAP_IDENTICAL`.
4242
memory_regions = [
43-
[0x8000_0000, 0x4000_0000, 0x7, 1], # System RAM 1G MAP_ALLOC
43+
[0x8000_0000, 0x800_0000, 0x7, 0], # System RAM 1G MAP_ALLOC
4444
]
4545

4646
#
@@ -49,7 +49,6 @@ memory_regions = [
4949
[devices]
5050
# Pass-through devices.
5151
passthrough_devices = [
52-
["/",],
5352
]
5453

5554
# Passthrough addresses.
@@ -60,7 +59,6 @@ passthrough_addresses = [
6059

6160
# Devices that are not desired to be passed through to the guest
6261
excluded_devices = [
63-
["/pci@30000000"],
6462
]
6563

6664
# Emu_devices.

configs/vms/linux-riscv64-qemu-smp1.toml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ phys_cpu_ids = [0]
1717
#
1818
[kernel]
1919
# The entry point of the kernel image.
20-
entry_point = 0x8020_0000
20+
entry_point = 0x9000_0000
2121
# The location of image: "memory" | "fs".
2222
# load from memory.
23-
image_location = "fs"
23+
image_location = "memory"
2424
# The file path of the kernel image.
2525
# kernel_path = "linux-6.6.62.bin"
26-
kernel_path = "/guest/qemu-riscv64"
26+
kernel_path = "/path/tmp/images/qemu_riscv64_linux/qemu-riscv64"
2727
# The load address of the kernel image.
28-
kernel_load_addr = 0x8020_0000
28+
kernel_load_addr = 0x9000_0000
2929
# The file path of the device tree blob (DTB).
30-
dtb_path = "/guest/linux-aarch64-qemu-smp1.dtb"
30+
dtb_path = "/path/tmp/configs/linux-riscv64-qemu-smp1.dtb"
3131
# The load address of the device tree blob (DTB).
32-
dtb_load_addr = 0x8000_0000
32+
dtb_load_addr = 0x9200_0000
3333

3434
# Memory regions with format (`base_paddr`, `size`, `flags`, `map_type`).
3535
# For `map_type`, 0 means `MAP_ALLOC`, 1 means `MAP_IDENTICAL`.
3636
memory_regions = [
37-
[0x8000_0000, 0x1000_0000, 0x7, 1], # System RAM 1G MAP_IDENTICAL
37+
[0x9000_0000, 0x4000_0000, 0x7, 2], # System RAM 1G MAP_IDENTICAL
3838
]
3939

4040
#
@@ -44,27 +44,24 @@ memory_regions = [
4444
# Pass-through devices.
4545
# Name Base-Ipa Base-Pa Length Alloc-Irq.
4646
passthrough_devices = [
47-
["/"],
48-
#["/timer"],
47+
# ["/soc/serial@10000000", 0x1000_0000, 0x1000_0000, 0x1000, 33],
4948
]
5049

5150
# Passthrough addresses.
5251
# Base-GPA Length.
5352
passthrough_addresses = [
54-
#[0x28041000, 0x100_0000]
53+
[0x1000_0000, 0x1000], # uart
54+
[0x1000_1000, 0x8000], # virtio-mmio
5555
]
5656

5757
# Devices that are not desired to be passed through to the guest
5858
excluded_devices = [
59-
# ["/gic-v3"],
6059
]
6160

6261
# Emu_devices.
6362
# Name Base-Ipa Ipa_len Alloc-Irq Emu-Type EmuConfig.
6463
emu_devices = [
65-
# ["gppt-gicd", 0x0800_0000, 0x1_0000, 0, 0x21, []],
66-
# ["gppt-gicr", 0x080a_0000, 0x2_0000, 0, 0x20, [1, 0x2_0000, 0]], # 1 vcpu, stride 0x20000, starts with pcpu 0
67-
# ["gppt-gits", 0x0808_0000, 0x2_0000, 0, 0x22, [0x0808_0000]], # host_gits_base
64+
["plic", 0x0c00_0000, 0x60_0000, 0, 0x30, [2]], # [context_num]
6865
]
6966

7067
interrupt_mode = "passthrough"

kernel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ axhvc.workspace = true
3636
axruntime = {workspace = true, features = ["alloc", "irq", "paging", "smp", "multitask"]}
3737
axvcpu.workspace = true
3838
axvm.workspace = true
39+
axdriver.workspace = true
3940

4041
# System independent crates provided by ArceOS, these crates could be imported by remote url.
4142
axerrno.workspace = true
@@ -57,7 +58,6 @@ axdevice_base = "0.1"
5758
axvisor_api = "0.1"
5859
driver.workspace = true
5960

60-
6161
[target.'cfg(target_arch = "aarch64")'.dependencies]
6262
aarch64-cpu-ext = "0.1"
6363
arm-gic-driver = {version = "0.15.5", features = ["rdif"]}

modules/axconfig/src/lib.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ pub mod devices {
4040
#[doc = " Timer interrupt num (PPI, physical timer)."]
4141
pub const TIMER_IRQ: usize = 0xf0;
4242
#[doc = " VirtIO MMIO regions with format (`base_paddr`, `size`)."]
43-
pub const VIRTIO_MMIO_RANGES: &[(usize, usize)] = &[];
43+
pub const VIRTIO_MMIO_RANGES: &[(usize, usize)] = &[
44+
(0x1000_1000, 0x1000),
45+
(0x1000_2000, 0x1000),
46+
(0x1000_3000, 0x1000),
47+
(0x1000_4000, 0x1000),
48+
(0x1000_5000, 0x1000),
49+
(0x1000_6000, 0x1000),
50+
(0x1000_7000, 0x1000),
51+
(0x1000_8000, 0x1000),
52+
];
4453
}
4554
#[doc = ""]
4655
#[doc = " Platform configs"]

modules/axruntime/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ pub fn rust_main(cpu_id: usize, arg: usize) -> ! {
128128
// build_mode = {}\n\
129129
// smp = {}\n\
130130
// ",
131-
132131
// );
133132
#[cfg(feature = "rtc")]
134133
ax_println!(

platform/riscv64-qemu-virt/axconfig.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cpu-num = 4 # uint
1414
# Base address of the whole physical memory.
1515
phys-memory-base = 0x8000_0000 # uint
1616
# Size of the whole physical memory. (8GB)
17-
phys-memory-size = 0x2_0000_0000 # uint
17+
phys-memory-size = 0x1_0000_0000 # uint
1818
# Base physical address of the kernel image.
1919
kernel-base-paddr = 0x8020_0000 # uint
2020
# Base virtual address of the kernel image.
@@ -44,6 +44,7 @@ mmio-ranges = [
4444
[0x1000_1000, 0x8000], # VirtIO
4545
[0x3000_0000, 0x1000_0000], # PCI config space
4646
[0x4000_0000, 0x4000_0000], # PCI memory ranges (ranges 1: 32-bit MMIO space)
47+
[0x2_7fe0_0000, 0x1000_0000]
4748
] # [(uint, uint)]
4849
# VirtIO MMIO ranges with format (`base_paddr`, `size`).
4950
virtio-mmio-ranges = [

0 commit comments

Comments
 (0)