Skip to content
Open
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
7 changes: 7 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Files:
docs/assets/virtio_console_example.svg
examples/virtio-snd/docs/sound-structure.svg
examples/virtio-snd/docs/virtio-snd.svg
examples/windows/docs/uefi_boot.png
Copyright: UNSW
License: CC-BY-SA-4.0

Expand All @@ -39,3 +40,9 @@ Files:
examples/*/board/*/rootfs.cpio.gz
Copyright: Buildroot
License: GPL-2.0-or-later

Files:
examples/windows/images/autounattend.xml
examples/windows/images/unattend.iso
Copyright: Christoph Schneegans
License: MIT
7 changes: 7 additions & 0 deletions LICENSES/MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the " Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 changes: 11 additions & 0 deletions ci/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@ def listify(s: str | Sequence[str]) -> Sequence[str]:
],
"tests_exclude": [],
},
"windows": {
"configs": ["debug", "release"],
"build_systems": ["make"],
"boards": [
"x86_64_generic_vtx",
],
"tests_exclude": [
{ "config": "debug" },
{ "config": "release" },
],
},
}

## Type Hinting + Sanity Checks ##
Expand Down
24 changes: 18 additions & 6 deletions examples/rust/src/vmm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extern "C" {
fn fault_handle(vcpu_id: usize, msginfo: MessageInfo) -> bool;
}

pub const GUEST_MAX_RAM_REGIONS: usize = 1;
pub const GUEST_MAX_RAM_REGIONS: usize = 3;

#[repr(C)]
pub struct guest_ram_region {
Expand Down Expand Up @@ -134,11 +134,23 @@ fn init() -> VmmHandler {
let success = guest_init(arch_guest_init {
num_vcpus: 1,
num_guest_ram_regions: 1,
guest_ram_regions: [guest_ram_region {
gpa_start: GUEST_RAM_START_GPA,
size: GUEST_RAM_SIZE,
vmm_vaddr: GUEST_RAM_VMM_VADDR as *mut _,
}],
guest_ram_regions: [
guest_ram_region {
gpa_start: GUEST_RAM_START_GPA,
size: GUEST_RAM_SIZE,
vmm_vaddr: GUEST_RAM_VMM_VADDR as *mut _,
},
guest_ram_region {
gpa_start: 0,
size: 0,
vmm_vaddr: 0 as *mut _,
},
guest_ram_region {
gpa_start: 0,
size: 0,
vmm_vaddr: 0 as *mut _,
},
],
pci_init: guest_pci_init {
ecam_gpa: 0,
ecam_size: 0,
Expand Down
42 changes: 42 additions & 0 deletions examples/windows/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Copyright 2024, UNSW
#
# SPDX-License-Identifier: BSD-2-Clause
#

BUILD_DIR ?= build
export MICROKIT_CONFIG ?= debug

ifeq ($(strip $(MICROKIT_SDK)),)
$(error MICROKIT_SDK must be specified)
endif
override MICROKIT_SDK := $(abspath $(MICROKIT_SDK))

# Allow to user to specify a custom partition
PARTITION :=
ifdef PARTITION
export PARTITION_ARG := --partition $(PARTITION)
endif

BUILD_DIR ?= build
export BUILD_DIR := $(abspath ${BUILD_DIR})
export WINDOWS_EXAMPLE := $(abspath .)

export CC_USERLEVEL := clang
export MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit
export SDDF := $(abspath ../../dep/sddf)
export LIBVMM := $(abspath ../../)

IMAGE_FILE := $(BUILD_DIR)/loader.img
REPORT_FILE := $(BUILD_DIR)/report.txt

all: $(IMAGE_FILE)

qemu $(IMAGE_FILE) $(REPORT_FILE) clean clobber: $(BUILD_DIR)/Makefile FORCE
$(MAKE) -C $(BUILD_DIR) MICROKIT_SDK=$(MICROKIT_SDK) $(notdir $@)

$(BUILD_DIR)/Makefile: windows.mk
mkdir -p $(BUILD_DIR)
cp windows.mk $@

FORCE:
Loading
Loading