Skip to content

Axvisor type15 #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ rusty-tags.vi
# dev env
/crates
/Cargo.toml.bk
/deps

# tools should be downloaded from github
tools/*
57 changes: 34 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 22 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[profile.release]
lto = true
debug = true

[package]
name = "axvisor"
Expand All @@ -11,6 +12,7 @@ license = "GPL-3.0-or-later OR Apache-2.0 OR MulanPubL-2.0 OR MulanPSL2"

[features]
fs = ["axstd/fs"]
irq = ["axstd/irq"]

[dependencies]
log = "=0.4.21"
Expand All @@ -25,16 +27,18 @@ axstd = { git = "https://github.com/arceos-hypervisor/arceos.git", branch = "vmm
"alloc",
"paging",
# "fs",
"irq",
# "irq",
"hv",
"multitask",
# "sched_rr"
]}
# "sched_rr",
"smp",
] }

# System dependent modules provided by ArceOS-Hypervisor.
axvm = { git = "https://github.com/arceos-hypervisor/axvm.git" }
axvcpu = { git = "https://github.com/arceos-hypervisor/axvcpu.git" }
axaddrspace = { git = "https://github.com/arceos-hypervisor/axaddrspace.git" }
axvmconfig = { git = "https://github.com/arceos-hypervisor/axvmconfig.git", default-features = false }

# System independent crates provided by ArceOS, these crates could be imported by remote url.
crate_interface = "0.1"
Expand All @@ -50,3 +54,18 @@ axconfig = { git = "https://github.com/arceos-hypervisor/arceos.git", branch = "
prettyplease = "0.2"
quote = "1.0"
syn = "2.0"

[patch."https://github.com/arceos-hypervisor/arceos.git"]
axstd = { path = "./crates/arceos/ulib/axstd" }

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

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

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

[patch."https://github.com/arceos-hypervisor/axaddrspace.git"]
axaddrspace = { path = "./crates/axaddrspace" }
68 changes: 68 additions & 0 deletions HOW-to.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
```
mkdir -p deps
cd deps
git clone [email protected]:EquationOS/jailhouse-equation.git

```

## Getting Started

### Build

```bash
make PLATFORM=x86_64-qemu-linux defconfig
make PLATFORM=x86_64-qemu-linux SMP=4 LOG=debug scp_linux
```

### Test in QEMU (ubuntu as the guest OS)

1. Download the guest image and run in QEMU:

```bash
cd scripts/vmm/host
make image # download image and configure for the first time
make qemu # execute this command only for subsequent runs
```

You can login the guest OS via SSH. The default username and password is `ubuntu` and `123`. The default port is `2334` and can be changed by QEMU arguments.

2. Copy helpful scripts into the guest OS:

```bash
scp -P 2334 scripts/vmm/guest/* ubuntu@localhost:/home/ubuntu # in host
```

3. Setup in the guest OS:

Here, you need to copy the [jailhouse-equation](https://github.com/EquationOS/jailhouse-equation) manually, because it is still WIP and not published.

Copy jailhouse-equation dir:
```bash
scp -P 2334 -r deps/jailhouse-equation ubuntu@localhost:~/ # in host
```

Then run `setup.sh` in guest, (you only need to run it once see [`setup.sh`](scripts/guest/setup.sh) for details).

```bash
ssh -p 2334 ubuntu@localhost # in host
./setup.sh # in guest
```

4. Compile Jailhouse:

You need to do this each time after modifing the jailhouse code.

```
cd jailhouse-equation
make
```

To change the CPU number reserved for ArceOS, modify the `RT_CPUS` macro in `jailhouse-equation/tools/jailhouse.c`.

5. Enable AxVisor

`./enable-axvisor.sh`

## Development

`cd scripts/ && ./dev_deps.sh`
Loading
Loading