Skip to content
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

Add Multiple OS Support #31

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
1 change: 0 additions & 1 deletion apps/Arm/odroid_vm/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
#

set(PLATFORM "exynos5410" CACHE STRING "" FORCE)
set(VmDtbFile ON CACHE BOOL "provide dtb" FORCE)
23 changes: 11 additions & 12 deletions apps/Arm/odroid_vm/vm_odroid.camkes
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
* SPDX-License-Identifier: BSD-2-Clause
*/


#define VM_RAM_OFFSET 0
#define VM_INITRD_MAX_SIZE 0x1900000 //25 MB

#define VM_RAM_BASE 0x40000000
#define VM_RAM_SIZE 0x20000000
#define VM_DTB_ADDR 0x4F000000
#define VM_INITRD_ADDR 0x4D700000
#define VM_ENTRY_ADDR 0x40080000

import <std_connector.camkes>;

Expand Down Expand Up @@ -212,16 +209,18 @@ assembly {
uart_gcs.ID = 1;
uart_px4.ID = 3;

vm.linux_address_config = {
"linux_ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"linux_ram_offset" : VAR_STRINGIZE(VM_RAM_OFFSET),
vm.vm_address_config = {
"ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"dtb_addr" : VAR_STRINGIZE(VM_DTB_ADDR),
"initrd_max_size" : VAR_STRINGIZE(VM_INITRD_MAX_SIZE),
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR)
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR),
"kernel_entry_addr" : VAR_STRINGIZE(VM_ENTRY_ADDR),
};
vm.vm_image_config = {
"map_one_to_one" : true,
"provide_initrd" : false,
};
vm.linux_image_config = {};

vm.dtb = dtb([{"path": "/soc/chipid@10000000"},
{"path": "/soc/serial@12c20000"},
Expand Down
27 changes: 13 additions & 14 deletions apps/Arm/vm_cross_connector/exynos5422/devices.camkes
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,29 @@

#include <configurations/vm.h>

#define VM_RAM_OFFSET 0
#define VM_INITRD_MAX_SIZE 0x1900000 //25 MB

#define VM_RAM_BASE 0x40000000
#define VM_RAM_SIZE 0x10000000
#define VM_DTB_ADDR 0x4F000000
#define VM_INITRD_ADDR 0x4D700000
#define VM_ENTRY_ADDR 0x40008000

assembly {
composition {}
configuration {
vm0.linux_address_config = {
"linux_ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"linux_ram_offset" : VAR_STRINGIZE(VM_RAM_OFFSET),
vm0.vm_address_config = {
"ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"dtb_addr" : VAR_STRINGIZE(VM_DTB_ADDR),
"initrd_max_size" : VAR_STRINGIZE(VM_INITRD_MAX_SIZE),
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR)
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR),
"kernel_entry_addr" : VAR_STRINGIZE(VM_ENTRY_ADDR)
};
vm0.linux_image_config = {
"linux_bootcmdline" : "console=ttySAC2,115200n8 root=/dev/ram0 nosmp rw debug loglevel=8 pci=nomsi initcall_blacklist=clk_disable_unused",
"linux_stdout" : "serial2:115200n8",

vm0.vm_image_config = {
"kernel_bootcmdline" : "console=ttySAC2,115200n8 root=/dev/ram0 nosmp rw debug loglevel=8 pci=nomsi initcall_blacklist=clk_disable_unused",
"kernel_stdout" : "serial2:115200n8",
"provide_dtb" : false,
"generate_dtb" : true,
"map_one_to_one" : true,
};

vm0.dtb = dtb([{"path": "/firmware@02073000"},
Expand Down
25 changes: 13 additions & 12 deletions apps/Arm/vm_cross_connector/qemu-arm-virt/devices.camkes
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,30 @@

#include <configurations/vm.h>

#define VM_INITRD_MAX_SIZE 0x1900000 //25 MB
#define VM_RAM_BASE 0x40000000
#define VM_RAM_SIZE 0x20000000
#define VM_RAM_OFFSET 0x00000000
#define VM_DTB_ADDR 0x4F000000
#define VM_INITRD_ADDR 0x4D700000
#define VM_ENTRY_ADDR 0x40080000

assembly {
composition {}
configuration {

vm0.linux_address_config = {
"linux_ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"linux_ram_offset" : VAR_STRINGIZE(VM_RAM_OFFSET),
vm0.vm_address_config = {
"ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"dtb_addr" : VAR_STRINGIZE(VM_DTB_ADDR),
"initrd_max_size" : VAR_STRINGIZE(VM_INITRD_MAX_SIZE),
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR)
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR),
"kernel_entry_addr" : VAR_STRINGIZE(VM_ENTRY_ADDR),
};
vm0.linux_image_config = {
"linux_bootcmdline" : "pci=nomsi,realloc=off,bios initcall_blacklist=clk_disable_unused",
"linux_stdout" : "/pl011@9000000",
vm0.vm_image_config = {
"kernel_bootcmdline" : "pci=nomsi,realloc=off,bios initcall_blacklist=clk_disable_unused",
"kernel_stdout" : "/pl011@9000000",
"provide_dtb" : false,
"generate_dtb" : true,
"map_one_to_one" : true,
};

vm0.dtb = dtb([
Expand Down
1 change: 0 additions & 1 deletion apps/Arm/vm_cross_connector/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if(NOT "${PLATFORM}" IN_LIST supported)
endif()
set(VmPCISupport ON CACHE BOOL "" FORCE)
set(LibUSB OFF CACHE BOOL "" FORCE)
set(VmInitRdFile ON CACHE BOOL "" FORCE)
if(${PLATFORM} STREQUAL "qemu-arm-virt")
# force cpu
set(QEMU_MEMORY "2048")
Expand Down
26 changes: 13 additions & 13 deletions apps/Arm/vm_introspect/exynos5422/devices.camkes
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

#include <configurations/vm.h>

#define VM_INITRD_MAX_SIZE 0x1400000
#define VM_RAM_BASE 0x40000000
#define VM_RAM_SIZE 0x8001000
#define VM_RAM_OFFSET 0x00000000
#define VM_RAM_SIZE 0x8001000
#define VM_DTB_ADDR 0x45801000
#define VM_INITRD_ADDR 0x46c01000
#define VM_ENTRY_ADDR 0x40008000

assembly {
composition {}
Expand All @@ -20,19 +19,20 @@ assembly {
vm_memdev.paddr = VM_RAM_BASE;
vm_memdev.size = VM_RAM_SIZE;

vm0.linux_address_config = {
"linux_ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"linux_ram_offset" : VAR_STRINGIZE(VM_RAM_OFFSET),
vm0.vm_address_config = {
"ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"dtb_addr" : VAR_STRINGIZE(VM_DTB_ADDR),
"initrd_max_size" : VAR_STRINGIZE(VM_INITRD_MAX_SIZE),
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR)
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR),
"kernel_entry_addr" : VAR_STRINGIZE(VM_ENTRY_ADDR),
};

vm0.linux_image_config = {
"linux_bootcmdline" : "console=ttySAC2,115200n8 root=/dev/ram0 nosmp rw debug loglevel=8 earlyprintk=serial pci=nomsi",
"linux_stdout" : "serial2:115200n8",
vm0.vm_image_config = {
"kernel_bootcmdline" : "console=ttySAC2,115200n8 root=/dev/ram0 nosmp rw debug loglevel=8 earlyprintk=serial pci=nomsi",
"kernel_stdout" : "serial2:115200n8",
"provide_dtb" : false,
"generate_dtb" : true,
};

vm0.dtb = dtb([{"path": "/firmware@2073000"},
Expand Down
24 changes: 12 additions & 12 deletions apps/Arm/vm_introspect/qemu-arm-virt/devices.camkes
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

#include <configurations/vm.h>

#define VM_INITRD_MAX_SIZE 0xc80000
#define VM_RAM_BASE 0x40000000
#define VM_RAM_SIZE 0x8001000
#define VM_RAM_OFFSET 0x00000000
#define VM_DTB_ADDR 0x47381000
#define VM_INITRD_ADDR 0x46701000
#define VM_ENTRY_ADDR 0x40080000

assembly {
composition {}
Expand All @@ -20,19 +19,20 @@ assembly {
vm_memdev.paddr = VM_RAM_BASE;
vm_memdev.size = VM_RAM_SIZE;

vm0.linux_address_config = {
"linux_ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"linux_ram_offset" : VAR_STRINGIZE(VM_RAM_OFFSET),
vm0.vm_address_config = {
"ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"dtb_addr" : VAR_STRINGIZE(VM_DTB_ADDR),
"initrd_max_size" : VAR_STRINGIZE(VM_INITRD_MAX_SIZE),
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR)
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR),
"kernel_entry_addr" : VAR_STRINGIZE(VM_ENTRY_ADDR),
};

vm0.linux_image_config = {
"linux_bootcmdline" : "",
"linux_stdout" : "/pl011@9000000",
vm0.vm_image_config = {
"kernel_bootcmdline" : "",
"kernel_stdout" : "/pl011@9000000",
"provide_dtb" : false,
"generate_dtb" : true,
};
vm0.num_vcpus = 2;

Expand Down
1 change: 0 additions & 1 deletion apps/Arm/vm_introspect/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if(NOT "${PLATFORM}" IN_LIST supported)
endif()
set(VmPCISupport ON CACHE BOOL "" FORCE)
set(LibUSB OFF CACHE BOOL "" FORCE)
set(VmInitRdFile ON CACHE BOOL "" FORCE)
if(${PLATFORM} STREQUAL "qemu-arm-virt")
# force cpu
set(QEMU_MEMORY "2048")
Expand Down
10 changes: 5 additions & 5 deletions apps/Arm/vm_introspect/src/init_dataport_ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <sel4vmmplatsupport/guest_memory_util.h>
#include <vmlinux.h>

extern unsigned long linux_ram_base;
extern unsigned long linux_ram_size;
extern unsigned long ram_base;
extern unsigned long ram_size;

extern dataport_caps_handle_t memdev_handle;

Expand All @@ -23,12 +23,12 @@ static vm_frame_t dataport_memory_iterator(uintptr_t addr, void *cookie)
vm_frame_t frame_result = { seL4_CapNull, seL4_NoRights, 0, 0 };

uintptr_t frame_start = ROUND_DOWN(addr, BIT(seL4_PageBits));
if (frame_start < linux_ram_base || frame_start > linux_ram_base + linux_ram_size) {
if (frame_start < ram_base || frame_start > ram_base + ram_size) {
ZF_LOGE("Error: Not dataport ram region");
return frame_result;
}

int page_idx = (frame_start - linux_ram_base) / BIT(seL4_PageBits);
int page_idx = (frame_start - ram_base) / BIT(seL4_PageBits);
frame_result.cptr = dataport_get_nth_frame_cap(&memdev_handle, page_idx);
frame_result.rights = seL4_AllRights;
frame_result.vaddr = frame_start;
Expand All @@ -40,6 +40,6 @@ void init_ram_module(vm_t *vm, void *cookie)
{
int err;

err = vm_ram_register_at_custom_iterator(vm, linux_ram_base, linux_ram_size, dataport_memory_iterator, NULL);
err = vm_ram_register_at_custom_iterator(vm, ram_base, ram_size, dataport_memory_iterator, NULL);
assert(!err);
}
26 changes: 13 additions & 13 deletions apps/Arm/vm_minimal/exynos5422/devices.camkes
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@

#include <configurations/vm.h>

#define VM_RAM_OFFSET 0
#define VM_INITRD_MAX_SIZE 0x1900000 //25 MB

#define VM_RAM_BASE 0x40000000
#define VM_RAM_SIZE 0x10000000
#define VM_DTB_ADDR 0x4F000000
#define VM_INITRD_ADDR 0x4D700000
#define VM_ENTRY_ADDR 0x40008000

assembly {
composition {}
configuration {

vm0.linux_address_config = {
"linux_ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"linux_ram_offset" : VAR_STRINGIZE(VM_RAM_OFFSET),
vm0.vm_address_config = {
"ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"dtb_addr" : VAR_STRINGIZE(VM_DTB_ADDR),
"initrd_max_size" : VAR_STRINGIZE(VM_INITRD_MAX_SIZE),
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR)
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR),
"kernel_entry_addr" : VAR_STRINGIZE(VM_ENTRY_ADDR),
};

vm0.linux_image_config = {
"linux_bootcmdline" : "console=ttySAC2,115200n8 root=/dev/ram0 nosmp rw debug loglevel=8 earlyprintk=serial pci=nomsi",
"linux_stdout" : "serial2:115200n8",
vm0.vm_image_config = {
"kernel_bootcmdline" : "console=ttySAC2,115200n8 root=/dev/ram0 nosmp rw debug loglevel=8 earlyprintk=serial pci=nomsi",
"kernel_stdout" : "serial2:115200n8",
"provide_dtb" : false,
"generate_dtb" : true,
"map_one_to_one" : true,
};

vm0.dtb = dtb([{"path": "/firmware@2073000"},
Expand Down
21 changes: 10 additions & 11 deletions apps/Arm/vm_minimal/odroidc2/devices.camkes
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@

#include <configurations/vm.h>

#define VM_RAM_OFFSET 0
#define VM_INITRD_MAX_SIZE 0x1900000 //25 MB

#define VM_RAM_BASE 0x20000000
#define VM_RAM_SIZE 0x10000000
#define VM_DTB_ADDR 0x2F000000
#define VM_INITRD_ADDR 0x2D700000
#define VM_ENTRY_ADDR 0x20080000

assembly {
composition {}
configuration {
vm0.linux_address_config = {
"linux_ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"linux_ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"linux_ram_offset" : VAR_STRINGIZE(VM_RAM_OFFSET),
vm0.vm_address_config = {
"ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"dtb_addr" : VAR_STRINGIZE(VM_DTB_ADDR),
"initrd_max_size" : VAR_STRINGIZE(VM_INITRD_MAX_SIZE),
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR)
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR),
"kernel_entry_addr" : VAR_STRINGIZE(VM_ENTRY_ADDR),
};

vm0.linux_image_config = {};
vm0.vm_image_config = {
"map_one_to_one" : true,
};

vm0.dtb = dtb([
{"path": "/serial@c81004c0"},
Expand Down
Loading