mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-05 02:19:24 +00:00
parent
af9ab9190b
commit
8cc2662aac
10
repos/README
10
repos/README
@ -31,33 +31,25 @@ but build upon of each other:
|
||||
|
||||
:'nova':
|
||||
NOVA hypervisor developed at University of Technology Dresden
|
||||
See [https://genode.org/documentation/platforms/nova]
|
||||
|
||||
:'foc':
|
||||
Fiasco.OC is a modernized version of the Fiasco microkernel with a
|
||||
completely revised kernel interface fostering capability-based
|
||||
security. It is not compatible with L4/Fiasco.
|
||||
See [https://genode.org/documentation/platforms/foc]
|
||||
|
||||
:'hw':
|
||||
The hw platform allows the execution of Genode on bare ARM and x86 hardware
|
||||
without the need for a separate kernel. The kernel functionality is
|
||||
included in core except in the special case of the Muen separation
|
||||
kernel.
|
||||
See [https://genode.org/documentation/platforms/hw] and
|
||||
[https://genode.org/documentation/platforms/muen]
|
||||
included in core.
|
||||
|
||||
:'okl4':
|
||||
OKL4 kernel (x86_32 and ARM) developed at Open-Kernel-Labs.
|
||||
See [https://genode.org/documentation/platforms/okl4]
|
||||
|
||||
:'pistachio':
|
||||
L4ka::Pistachio kernel developed at University of Karlsruhe.
|
||||
See [https://genode.org/documentation/platforms/pistachio]
|
||||
|
||||
:'fiasco':
|
||||
L4/Fiasco kernel developed at University of Technology Dresden.
|
||||
See [https://genode.org/documentation/platforms/fiasco]
|
||||
|
||||
:'sel4':
|
||||
seL4 microkernel developed at NICTA/General Dynamics
|
||||
|
@ -1 +0,0 @@
|
||||
0x00200000
|
@ -1,164 +0,0 @@
|
||||
|
||||
=============================================
|
||||
Getting started with 'base-hw' on the Muen SK
|
||||
=============================================
|
||||
|
||||
|
||||
The Muen Team
|
||||
|
||||
Abstract
|
||||
########
|
||||
|
||||
This is a short tutorial that depicts a handy way to get a Genode image, built
|
||||
with 'base-hw', started as subject on the Muen Separation Kernel (SK)
|
||||
[https://muen.sk].
|
||||
|
||||
Tutorial
|
||||
########
|
||||
|
||||
For information on how to download, build and prove the Muen SK refer to the
|
||||
project website. In summary: install the Ada/SPARK tool-chain and all required
|
||||
distribution packages. Also ensure that you have installed the Genode tool-chain
|
||||
that is available at:
|
||||
|
||||
:[https://genode.org/download/tool-chain]:
|
||||
Genode tool-chain
|
||||
|
||||
To automatically download the Muen kernel and integrate it with Genode, issue
|
||||
the following commands:
|
||||
|
||||
! cd <genode_dir>
|
||||
! ./tool/ports/prepare_port muen
|
||||
|
||||
The next step is to create a build directory prepared for compiling Genode for
|
||||
Muen. Use the create_builddir tool for this task:
|
||||
|
||||
! ./tool/create_builddir muen
|
||||
|
||||
You can customize Muen system by changing the --image-muen RUN_OPT parameters
|
||||
in the 'build.conf' file in the build directory under build/etc.
|
||||
|
||||
The file contains explanatory comments above each configuration variable, which
|
||||
are all set to their default values.
|
||||
|
||||
Muen systems are built for a specific hardware platform and by default the
|
||||
system is built for the Lenovo T430s. All currently supported platforms have a
|
||||
corresponding hardware specification which can be found in the Muen project
|
||||
directory under 'policy/hardware'. Note that the Muen project directory can be
|
||||
found at '<genode_dir>/contrib/muen-*/src/kernel/muen'.
|
||||
|
||||
To get a list of all currently supported hardware platforms issue the following
|
||||
command:
|
||||
|
||||
! ls contrib/muen-*/src/kernel/muen/policy/hardware/ | grep -v common
|
||||
|
||||
Set the '--image-muen-hardware' and '--image-muen-platform' parameters to point
|
||||
to the configuration files of your intended hardware platform. Note that the
|
||||
specified paths for both '--image-muen-hardware', '--image-muen-platform' and
|
||||
'--image-muen-system' must be either relative to the Muen policy directory
|
||||
(e.g. 'platform/lenovo-t430s.xml' or 'xml/genode-base_hw_simple.xml') or
|
||||
absolute paths. Also change the other parameters to match your environment.
|
||||
|
||||
If no hardware configuration for your specific hardware is available, refer to
|
||||
the README of the 'mugenhwcfg' tool
|
||||
[https://git.codelabs.ch/?p=muen/mugenhwcfg.git] for instructions on how to
|
||||
generate a new configuration.
|
||||
|
||||
You can now change to the created build directory and compile a Genode system:
|
||||
|
||||
! cd build/muen/
|
||||
! make run/log
|
||||
|
||||
Once the build is done, the Muen system which contains the Genode scenario is
|
||||
available as a Multiboot binary image under 'var/run/log/image.bin'. If an
|
||||
error occurs during the Muen build process check the log file located at
|
||||
'kernel/build.log'.
|
||||
|
||||
Automated hardware deployment
|
||||
#############################
|
||||
|
||||
For automated deployment and execution on real hardware, the iPXE and AMT run
|
||||
mechanisms provided by the Genode build system can be used. The modules are
|
||||
controlled by the RUN_OPT variable specified in the 'etc/build.conf' file. An
|
||||
example configuration for executing a Muen/Genode system on a real x86 machine
|
||||
using AMT for resetting the target system and capturing the log output while
|
||||
loading the Muen system image via iPXE:
|
||||
|
||||
!RUN_OPT += --include power_on/amt
|
||||
!RUN_OPT += --power-on-amt-host 192.168.254.2
|
||||
!RUN_OPT += --power-on-amt-password 'foo!'
|
||||
!RUN_OPT += --include load/ipxe
|
||||
!RUN_OPT += --load-ipxe-base-dir /srv/www
|
||||
!RUN_OPT += --load-ipxe-boot-dir boot
|
||||
!RUN_OPT += --include log/amt
|
||||
!RUN_OPT += --log-amt-host 192.168.254.2
|
||||
!RUN_OPT += --log-amt-password 'foo!'
|
||||
|
||||
The target machine is expected to request the following iPXE configuration:
|
||||
http://${HOST_URL}/${ipxe-boot-dir}/boot.cfg. This can be achieved by building
|
||||
iPXE with the following embedded script:
|
||||
|
||||
! #!ipxe
|
||||
! dhcp
|
||||
! chain http://${HOST_URL}/${ipxe-boot-dir}/boot.cfg
|
||||
|
||||
For additional information on iPXE and embedded scripts refer to the iPXE website
|
||||
at [http://ipxe.org/howto/chainloading#breaking_the_loop_with_an_embedded_script].
|
||||
|
||||
The deployment host must serve the Genode system image via http. In the above
|
||||
example the root directory of the webserver is '/srv/www'. Note that the
|
||||
webserver must support ranged requests as otherwise iPXE will not load (large)
|
||||
system image files correctly.
|
||||
|
||||
Integration of Muen with Genode
|
||||
###############################
|
||||
|
||||
Instead of letting the Genode build system compile and assemble the complete
|
||||
Muen system, you can let it only build a specific Genode base-hw run scenario
|
||||
and then do the integration yourself. This will for example allow you to run a
|
||||
simple script like run/log on Muen in the Bochs x86 emulator
|
||||
[http://bochs.sf.net], removing the requirement for having access to supported
|
||||
hardware.
|
||||
|
||||
As a first step acquire the Muen sources by executing the following commands:
|
||||
|
||||
! git clone https://git.codelabs.ch/git/muen.git
|
||||
! cd muen
|
||||
! git submodule update --init tools/mugenschedcfg
|
||||
! git submodule update --init components/libxhcidbg
|
||||
! make SYSTEM=xml/genode-base_hw_simple.xml COMPONENTS="libdebuglog libmudm libmutime libxhcidbg dbgserver sm time" emulate
|
||||
|
||||
This will build a Muen SK system and start it using the Bochs emulator. You
|
||||
should get the following error:
|
||||
|
||||
! mupack: File '<muen_workdir>/pack/../policy/obj/base_hw' referenced by
|
||||
! physical memory region 'base_hw|bin' not found
|
||||
|
||||
This means that the Muen packer tool was unable to find the component binary
|
||||
'base_hw', which is expected since it has not yet been compiled.
|
||||
|
||||
Now it is time to build the Genode 'base-hw' image for Muen. To tell the Genode
|
||||
build system that the Muen system integration is performed externally by
|
||||
changing the --image-muen-external-build parameter in the 'etc/build.conf' file
|
||||
within your build Genode directory like so:
|
||||
|
||||
! RUN_OPT += --image-muen-external-build 1
|
||||
|
||||
After this change you can build the Genode 'base-hw' image and export it to the
|
||||
Muen working directory using the following command:
|
||||
|
||||
! objcopy -O binary var/run/log/boot/image.elf <muen_workdir>/policy/obj/base_hw
|
||||
|
||||
Change back to the Muen working directory to package the system image and
|
||||
restart emulation:
|
||||
|
||||
! cd <muen_workdir>
|
||||
! make SYSTEM=xml/genode-base_hw_simple.xml COMPONENTS="libdebuglog libmudm libmutime libxhcidbg dbgserver sm time" emulate
|
||||
|
||||
The serial output of the system is written to the
|
||||
'<muen_workdir>/emulate/serial.out' file. You should see the following line:
|
||||
|
||||
! [init -> test-log] Test done.
|
||||
|
||||
This indicates the successful execution of the Genode 'run/log' scenario as
|
||||
Muen subject on Bochs.
|
@ -1,211 +0,0 @@
|
||||
/*
|
||||
* \brief Muen subject information API
|
||||
* \author Reto Buerki
|
||||
* \date 2015-04-21
|
||||
*
|
||||
* Defines functions to retrieve information about the execution environment of
|
||||
* a subject running on the Muen Separation Kernel.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__SPEC__X86_64__MUEN__SINFO_H_
|
||||
#define _INCLUDE__SPEC__X86_64__MUEN__SINFO_H_
|
||||
|
||||
#include <base/stdint.h>
|
||||
|
||||
struct Subject_info_type;
|
||||
struct Scheduling_info_type;
|
||||
|
||||
namespace Genode
|
||||
{
|
||||
/**
|
||||
* Muen Subject Info class
|
||||
*/
|
||||
class Sinfo;
|
||||
}
|
||||
|
||||
class Genode::Sinfo
|
||||
{
|
||||
public:
|
||||
|
||||
enum Config {
|
||||
MUEN_SUBJECT_INFO_MAGIC = 0x02006f666e69756dULL,
|
||||
MAX_RESOURCE_COUNT = 255,
|
||||
MAX_NAME_LENGTH = 63,
|
||||
PHYSICAL_BASE_ADDR = 0xe00000000,
|
||||
SIZE = 0x8000,
|
||||
HASH_LENGTH = 32,
|
||||
MEM_WRITABLE_FLAG = (1 << 0),
|
||||
MEM_EXECUTABLE_FLAG = (1 << 1),
|
||||
MEM_CHANNEL_FLAG = (1 << 2),
|
||||
DEV_MSI_FLAG = (1 << 0),
|
||||
};
|
||||
|
||||
Sinfo(const addr_t base_addr);
|
||||
|
||||
/* Resource name */
|
||||
struct Name_type {
|
||||
uint8_t length;
|
||||
char data[MAX_NAME_LENGTH];
|
||||
uint8_t null_term;
|
||||
} __attribute__((packed));
|
||||
|
||||
enum Content {
|
||||
CONTENT_UNINITIALIZED,
|
||||
CONTENT_FILL,
|
||||
CONTENT_FILE,
|
||||
};
|
||||
|
||||
/* Structure holding information about a memory region */
|
||||
struct Memregion_type {
|
||||
enum Content content;
|
||||
uint64_t address;
|
||||
uint64_t size;
|
||||
uint8_t hash[HASH_LENGTH];
|
||||
uint8_t flags;
|
||||
uint16_t pattern;
|
||||
char padding[1];
|
||||
} __attribute__((packed));
|
||||
|
||||
/*
|
||||
* Structure holding information about a PCI device,
|
||||
* explicitly padded to the size of the largest resource variant
|
||||
*/
|
||||
struct Device_type {
|
||||
uint16_t sid;
|
||||
uint16_t irte_start;
|
||||
uint8_t irq_start;
|
||||
uint8_t ir_count;
|
||||
uint8_t flags;
|
||||
char padding[sizeof(struct Memregion_type) - 7];
|
||||
} __attribute__((packed));
|
||||
|
||||
/* Currently known resource types */
|
||||
enum Resource_kind {
|
||||
RES_NONE,
|
||||
RES_MEMORY,
|
||||
RES_EVENT,
|
||||
RES_VECTOR,
|
||||
RES_DEVICE
|
||||
};
|
||||
|
||||
/* Resource data depending on the kind of resource */
|
||||
union Resource_data {
|
||||
struct Memregion_type mem;
|
||||
struct Device_type dev;
|
||||
uint8_t number;
|
||||
};
|
||||
|
||||
/* Exported resource with associated name */
|
||||
struct Resource_type {
|
||||
enum Resource_kind kind;
|
||||
struct Name_type name;
|
||||
char padding[3];
|
||||
union Resource_data data;
|
||||
} __attribute__((packed));
|
||||
|
||||
/* Muen subject information (sinfo) structure */
|
||||
struct Subject_info_type {
|
||||
uint64_t magic;
|
||||
uint32_t tsc_khz;
|
||||
struct Name_type name;
|
||||
uint16_t resource_count;
|
||||
char padding[1];
|
||||
struct Resource_type resources[MAX_RESOURCE_COUNT];
|
||||
} __attribute__((packed));
|
||||
|
||||
/*
|
||||
* Check Muen sinfo Magic.
|
||||
*/
|
||||
bool check_magic(void) const;
|
||||
|
||||
/*
|
||||
* Return subject name.
|
||||
*
|
||||
* The function returns NULL if the subject name cannot be retrieved.
|
||||
*/
|
||||
const char * get_subject_name(void);
|
||||
|
||||
/*
|
||||
* Return resource with given name and kind.
|
||||
*
|
||||
* If no resource with given name exists, null is returned.
|
||||
*/
|
||||
const struct Resource_type *
|
||||
get_resource(const char *const name, enum Resource_kind kind) const;
|
||||
|
||||
/*
|
||||
* Return information for PCI device with given SID.
|
||||
*
|
||||
* The function returns null if no device information for the specified device
|
||||
* exists.
|
||||
*/
|
||||
const struct Device_type * get_device(const uint16_t sid) const;
|
||||
|
||||
/*
|
||||
* Resource callback.
|
||||
*
|
||||
* Used in the for_each_resource function. The optional void data
|
||||
* pointer can be used to pass additional data.
|
||||
*/
|
||||
typedef bool (*resource_cb)(const struct Resource_type *const res,
|
||||
void *data);
|
||||
|
||||
/*
|
||||
* Invoke given callback function for each available resource.
|
||||
*
|
||||
* Resource information and the optional data argument are passed to each
|
||||
* invocation of the callback. If a callback invocation returns false,
|
||||
* processing is aborted and false is returned to the caller.
|
||||
*/
|
||||
bool for_each_resource(resource_cb func, void *data) const;
|
||||
|
||||
/*
|
||||
* Return TSC tick rate in kHz.
|
||||
*
|
||||
* The function returns 0 if the TSC tick rate cannot be retrieved.
|
||||
*/
|
||||
uint64_t get_tsc_khz(void) const;
|
||||
|
||||
/*
|
||||
* Return start time of current minor frame in TSC ticks.
|
||||
*/
|
||||
uint64_t get_sched_start(void) const;
|
||||
|
||||
/*
|
||||
* Return end time of current minor frame in TSC ticks.
|
||||
*/
|
||||
uint64_t get_sched_end(void) const;
|
||||
|
||||
/*
|
||||
* Log sinfo status.
|
||||
*/
|
||||
void log_status();
|
||||
|
||||
private:
|
||||
|
||||
Subject_info_type * sinfo = nullptr;
|
||||
Scheduling_info_type * sched_info = nullptr;
|
||||
char subject_name[MAX_NAME_LENGTH + 1];
|
||||
bool subject_name_set = false;
|
||||
|
||||
/*
|
||||
* Iterate over all resources beginning at given start resource. If the res
|
||||
* member of the iterator is nil, the function (re)starts the iteration at the first
|
||||
* resource.
|
||||
*/
|
||||
struct iterator {
|
||||
const struct Resource_type *res;
|
||||
unsigned int idx;
|
||||
};
|
||||
|
||||
bool iterate_resources(struct iterator *const iter) const;
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__SPEC__X86_64__MUEN__SINFO_H_ */
|
@ -36,6 +36,5 @@ vpath base/% $(BASE_HW_DIR)/src
|
||||
vpath bootstrap/% $(BASE_HW_DIR)/src
|
||||
vpath hw/% $(BASE_HW_DIR)/src/lib
|
||||
vpath lib/base/% $(BASE_HW_DIR)/src
|
||||
vpath lib/muen/% $(BASE_HW_DIR)/src
|
||||
vpath lib/base/% $(BASE_DIR)/src
|
||||
vpath lib/startup/% $(BASE_DIR)/src
|
||||
|
@ -1,12 +0,0 @@
|
||||
REQUIRES = x86_64
|
||||
|
||||
REP_INC_DIR += src/bootstrap/spec/x86_64
|
||||
|
||||
SRC_CC += bootstrap/spec/x86_64/platform_muen.cc
|
||||
SRC_CC += lib/muen/sinfo.cc
|
||||
SRC_CC += hw/spec/64bit/memory_map.cc
|
||||
|
||||
SRC_S += bootstrap/spec/x86_64/crt0.s
|
||||
SRC_S += bootstrap/spec/x86_64/crt0_translation_table_muen.s
|
||||
|
||||
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)
|
@ -1,48 +0,0 @@
|
||||
#
|
||||
# \brief Build config for Genodes core process
|
||||
# \author Stefan Kalkowski
|
||||
# \author Martin Stein
|
||||
# \date 2012-10-04
|
||||
#
|
||||
|
||||
REQUIRES = x86_64
|
||||
|
||||
LIBS += sinfo-muen
|
||||
|
||||
# add include paths
|
||||
REP_INC_DIR += src/core/spec/x86_64/muen
|
||||
REP_INC_DIR += src/core/spec/x86_64
|
||||
|
||||
# add assembly sources
|
||||
SRC_S += spec/x86_64/crt0.s
|
||||
SRC_S += spec/x86_64/exception_vector.s
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += kernel/cpu_up.cc
|
||||
SRC_CC += kernel/vm_thread_on.cc
|
||||
SRC_CC += kernel/lock.cc
|
||||
SRC_CC += spec/x86/io_port_session_component.cc
|
||||
SRC_CC += spec/x86/io_port_session_support.cc
|
||||
SRC_CC += spec/x86_64/bios_data_area.cc
|
||||
SRC_CC += spec/x86_64/cpu.cc
|
||||
SRC_CC += spec/x86_64/kernel/cpu.cc
|
||||
SRC_CC += spec/x86_64/kernel/pd.cc
|
||||
SRC_CC += spec/x86_64/kernel/thread.cc
|
||||
SRC_CC += spec/x86_64/kernel/thread.cc
|
||||
SRC_CC += spec/x86_64/muen/kernel/thread_exception.cc
|
||||
SRC_CC += spec/x86_64/muen/kernel/vm.cc
|
||||
SRC_CC += spec/x86_64/muen/platform_services.cc
|
||||
SRC_CC += spec/x86_64/muen/platform_support.cc
|
||||
SRC_CC += spec/x86_64/muen/sinfo_instance.cc
|
||||
SRC_CC += spec/x86_64/muen/timer.cc
|
||||
SRC_CC += spec/x86_64/muen/vm_session_component.cc
|
||||
SRC_CC += spec/x86_64/platform_support_common.cc
|
||||
SRC_CC += vm_session_common.cc
|
||||
SRC_CC += vm_session_component.cc
|
||||
|
||||
SRC_CC += spec/64bit/memory_map.cc
|
||||
|
||||
vpath spec/64bit/memory_map.cc $(call select_from_repositories,src/lib/hw)
|
||||
|
||||
# include less specific configuration
|
||||
include $(call select_from_repositories,lib/mk/core-hw.inc)
|
@ -1,5 +0,0 @@
|
||||
SRC_CC = sinfo.cc
|
||||
|
||||
REP_INC_DIR += include/spec/x86_64/muen
|
||||
|
||||
vpath sinfo.cc $(call select_from_repositories,src/lib/muen)
|
@ -1,29 +0,0 @@
|
||||
diff --git a/contrib/ada-bfd/Makefile b/contrib/ada-bfd/Makefile
|
||||
index cd776781e..36c87b126 100644
|
||||
--- a/contrib/ada-bfd/Makefile
|
||||
+++ b/contrib/ada-bfd/Makefile
|
||||
@@ -1,6 +1,6 @@
|
||||
-REV = 235a23452f7c5104ce6270a84f9794f497d496aa
|
||||
+REV = 1ee4c51befbda90360e519f5b76c17db124e2973
|
||||
PKG = ada-bfd
|
||||
-SRC = https://github.com/stcarrez/ada-bfd.git
|
||||
+SRC = https://github.com/skalk/ada-bfd.git
|
||||
|
||||
define CMD_CONFIGURE
|
||||
cd $(WRK) && ./configure --prefix=$(BUILDDIR)
|
||||
diff --git a/contrib/projects/bfdada.gpr b/contrib/projects/bfdada.gpr
|
||||
index 8a9cd711a..6cbe14152 100644
|
||||
--- a/contrib/projects/bfdada.gpr
|
||||
+++ b/contrib/projects/bfdada.gpr
|
||||
@@ -1,8 +1,8 @@
|
||||
library project Bfdada is
|
||||
- for Source_Dirs use ("../build/share/ada/adainclude/bfdada");
|
||||
+ for Source_Dirs use ("../build/include/bfdada.static");
|
||||
for Library_Name use "ada-bfd";
|
||||
- for Library_Dir use "../build/lib";
|
||||
- for Library_ALI_Dir use "../build/lib/ada/adalib/bfdada";
|
||||
+ for Library_Dir use "../build/lib/bfdada.static";
|
||||
+ for Library_ALI_Dir use "../build/lib/bfdada.static";
|
||||
for Library_Kind use "static";
|
||||
for Externally_Built use "true";
|
||||
end Bfdada;
|
@ -1,31 +0,0 @@
|
||||
diff --git a/projects/execute b/projects/execute
|
||||
index 43820f0ed..e2dbda43c 100755
|
||||
--- a/projects/execute
|
||||
+++ b/projects/execute
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python2
|
||||
#
|
||||
# Build system execution wrapper.
|
||||
#
|
||||
diff --git a/tools/scripts/mulog-subject.py b/tools/scripts/mulog-subject.py
|
||||
index cb6e355dd..51965a797 100755
|
||||
--- a/tools/scripts/mulog-subject.py
|
||||
+++ b/tools/scripts/mulog-subject.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python2
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
diff --git a/tools/scripts/mulog.py b/tools/scripts/mulog.py
|
||||
index 6d7fe8bb2..671913441 100755
|
||||
--- a/tools/scripts/mulog.py
|
||||
+++ b/tools/scripts/mulog.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/python
|
||||
+#!/usr/bin/python2
|
||||
|
||||
import sys
|
||||
import re
|
||||
|
@ -1 +0,0 @@
|
||||
11b5bd32a0234b9f7279d82487eb3d0d0eaee4db
|
@ -1,21 +0,0 @@
|
||||
LICENSE := GPLv3
|
||||
VERSION := git
|
||||
DOWNLOADS := muen.git
|
||||
|
||||
URL(muen) := https://git.codelabs.ch/git/muen.git
|
||||
REV(muen) := 7f41b2748e0ed6aadc3e43426390ae4efc3c5e65
|
||||
DIR(muen) := src/kernel/muen
|
||||
|
||||
PATCHES := $(sort $(wildcard $(REP_DIR)/patches/muen_*.patch))
|
||||
PATCH_OPT := -p1 -d src/kernel/muen
|
||||
|
||||
$(call check_tool,git)
|
||||
$(call check_tool,iasl)
|
||||
$(call check_tool,tidy)
|
||||
$(call check_tool,xsltproc)
|
||||
|
||||
default : additional_steps
|
||||
additional_steps : $(DOWNLOADS) _patch
|
||||
$(VERBOSE)git -C src/kernel/muen submodule update --init tools/mugenschedcfg > /dev/null
|
||||
$(VERBOSE)git -C src/kernel/muen submodule update --init components/libxhcidbg > /dev/null
|
||||
$(VERBOSE)$(MAKE) -C src/kernel/muen/contrib QUIET=true download
|
@ -1,7 +0,0 @@
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
all: $(INSTALL_DIR)/acpi
|
||||
endif
|
||||
|
||||
$(INSTALL_DIR)/acpi:
|
||||
echo "<acpi><bdf start=\"0\" count=\"16384\" base=\"0xf8000000\"/><drhd/></acpi>" > $@
|
||||
|
@ -1,4 +0,0 @@
|
||||
BOARD = muen
|
||||
|
||||
include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc
|
||||
|
@ -1 +0,0 @@
|
||||
2021-01-22 f4732bbeeea2ef33b7368882019aaece498b1e83
|
@ -1,2 +0,0 @@
|
||||
base-hw
|
||||
base
|
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* \brief Initial pagetables for x86_64_muen
|
||||
* \author Adrian-Ken Rueegsegger
|
||||
* \author Reto Buerki
|
||||
* \date 2015-04-22
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
.set MIN_PAGE_SIZE_LOG2, 12
|
||||
|
||||
.data
|
||||
|
||||
/*****************************************
|
||||
** Identity mapping from 2MiB to 1GiB **
|
||||
** plus mappings for Muen pvirt pages **
|
||||
*****************************************/
|
||||
|
||||
/* PML4 */
|
||||
.p2align MIN_PAGE_SIZE_LOG2
|
||||
.global _kernel_pml4
|
||||
_kernel_pml4:
|
||||
.quad _kernel_pdp + 0xf
|
||||
.fill 511, 8, 0x0
|
||||
|
||||
/* PDP */
|
||||
.p2align MIN_PAGE_SIZE_LOG2
|
||||
_kernel_pdp:
|
||||
.quad _kernel_pd + 0xf
|
||||
.fill 55, 8, 0x0
|
||||
.quad _kernel_pd_pvirt + 0xf
|
||||
.fill 455, 8, 0x0
|
||||
|
||||
/* PD */
|
||||
.p2align MIN_PAGE_SIZE_LOG2
|
||||
_kernel_pd:
|
||||
.quad 0
|
||||
.set entry, 0x20018f
|
||||
.rept 511
|
||||
.quad entry
|
||||
.set entry, entry + 0x200000
|
||||
.endr
|
||||
|
||||
.p2align MIN_PAGE_SIZE_LOG2
|
||||
_kernel_pd_pvirt:
|
||||
.quad 0xe0000018f
|
||||
.fill 511, 8, 0x0
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* \brief Platform implementations specific for x86_64
|
||||
* \author Reto Buerki
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2015-05-04
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#include <platform.h>
|
||||
#include <muen/sinfo.h>
|
||||
|
||||
using Sinfo = Genode::Sinfo;
|
||||
|
||||
enum {
|
||||
TIMER_BASE_ADDR = 0xe00010000,
|
||||
TIMER_SIZE = 0x1000,
|
||||
TIMER_PREEMPT_BASE_ADDR = 0xe00011000,
|
||||
TIMER_PREEMPT_SIZE = 0x1000,
|
||||
|
||||
COM1_PORT = 0x3f8,
|
||||
};
|
||||
|
||||
|
||||
Bootstrap::Platform::Board::Board()
|
||||
: core_mmio(Memory_region { Sinfo::PHYSICAL_BASE_ADDR, Sinfo::SIZE },
|
||||
Memory_region { TIMER_BASE_ADDR, TIMER_SIZE },
|
||||
Memory_region { TIMER_PREEMPT_BASE_ADDR, TIMER_PREEMPT_SIZE })
|
||||
{
|
||||
Sinfo sinfo(Sinfo::PHYSICAL_BASE_ADDR);
|
||||
const struct Sinfo::Resource_type *
|
||||
region = sinfo.get_resource("ram", Sinfo::RES_MEMORY);
|
||||
|
||||
if (!region)
|
||||
Genode::error("Unable to retrieve base-hw ram region");
|
||||
else
|
||||
early_ram_regions.add(Memory_region
|
||||
{ region->data.mem.address, region->data.mem.size });
|
||||
}
|
||||
|
||||
|
||||
unsigned Bootstrap::Platform::enable_mmu()
|
||||
{
|
||||
using ::Board::Cpu;
|
||||
|
||||
Cpu::Cr3::write(Cpu::Cr3::Pdb::masked((addr_t)core_pd->table_base));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Board::Serial::Serial(Genode::addr_t, Genode::size_t, unsigned baudrate)
|
||||
:X86_uart(COM1_PORT, 0, baudrate) {}
|
@ -1,50 +0,0 @@
|
||||
/*
|
||||
* \brief x86_64_muen constants
|
||||
* \author Adrian-Ken Rueegsegger
|
||||
* \date 2015-07-02
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _CORE__SPEC__X86_64__MUEN__BOARD_H_
|
||||
#define _CORE__SPEC__X86_64__MUEN__BOARD_H_
|
||||
|
||||
#include <hw/spec/x86_64/pc_board.h>
|
||||
#include <spec/x86_64/muen/pic.h>
|
||||
#include <spec/x86_64/muen/timer.h>
|
||||
#include <cpu/cpu_state.h>
|
||||
|
||||
namespace Kernel { class Cpu; }
|
||||
|
||||
namespace Board {
|
||||
using namespace Hw::Pc_board;
|
||||
|
||||
enum {
|
||||
TIMER_BASE_ADDR = 0xe00010000,
|
||||
TIMER_SIZE = 0x1000,
|
||||
TIMER_PREEMPT_BASE_ADDR = 0xe00011000,
|
||||
TIMER_PREEMPT_SIZE = 0x1000,
|
||||
|
||||
VECTOR_REMAP_BASE = 48,
|
||||
TIMER_EVENT_PREEMPT = 30,
|
||||
TIMER_EVENT_KERNEL = 31,
|
||||
TIMER_VECTOR_KERNEL = 32,
|
||||
TIMER_VECTOR_USER = 50,
|
||||
};
|
||||
|
||||
using Vm_state = Genode::Cpu_state;
|
||||
|
||||
enum { VCPU_MAX = 1 };
|
||||
|
||||
struct Vm_page_table {};
|
||||
struct Vm_page_table_array {};
|
||||
|
||||
struct Vcpu_context { Vcpu_context(Kernel::Cpu &) {} };
|
||||
}
|
||||
|
||||
#endif /* _CORE__SPEC__X86_64__MUEN__BOARD_H_ */
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* \brief Kernel backend for execution contexts in userland
|
||||
* \author Adrian-Ken Rueegsegger
|
||||
* \author Reto Buerki
|
||||
* \date 2015-04-28
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* core includes */
|
||||
#include <kernel/cpu.h>
|
||||
#include <kernel/thread.h>
|
||||
|
||||
using namespace Kernel;
|
||||
|
||||
void Thread::exception(Cpu & cpu)
|
||||
{
|
||||
switch (regs->trapno) {
|
||||
case Cpu::Context::PAGE_FAULT:
|
||||
_mmu_exception();
|
||||
return;
|
||||
case Cpu::Context::UNDEFINED_INSTRUCTION:
|
||||
Genode::raw(*this, ": undefined instruction at ip=", (void*)regs->ip);
|
||||
_die();
|
||||
return;
|
||||
case Cpu::Context::SUPERVISOR_CALL:
|
||||
_call();
|
||||
return;
|
||||
}
|
||||
if (regs->trapno >= Cpu::Context::INTERRUPTS_START &&
|
||||
regs->trapno <= Cpu::Context::INTERRUPTS_END) {
|
||||
cpu.pic().irq_occurred(regs->trapno);
|
||||
_interrupt(cpu.id());
|
||||
return;
|
||||
}
|
||||
Genode::raw(*this, ": triggered unknown exception ", regs->trapno,
|
||||
" with error code ", regs->errcode, " at ip=", (void*)regs->ip);
|
||||
_die();
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
/*
|
||||
* \brief Kernel backend for virtual machines
|
||||
* \author Stefan Kalkowski
|
||||
* \author Reto Buerki
|
||||
* \author Adrian-Ken Rueegsegger
|
||||
* \date 2015-06-03
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#include <assertion.h>
|
||||
#include <platform_pd.h>
|
||||
#include <kernel/cpu.h>
|
||||
#include <kernel/vm.h>
|
||||
|
||||
Kernel::Vm::Vm(unsigned,
|
||||
Board::Vm_state & state,
|
||||
Kernel::Signal_context & context,
|
||||
Identity & id)
|
||||
: Kernel::Object { *this },
|
||||
Cpu_job(Cpu_priority::MIN, 0),
|
||||
_state(state),
|
||||
_context(context),
|
||||
_id(id),
|
||||
_vcpu_context(cpu_pool().primary_cpu())
|
||||
{
|
||||
affinity(cpu_pool().primary_cpu());
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Vm::exception(Cpu & cpu)
|
||||
{
|
||||
pause();
|
||||
if (_state.trapno == 200) {
|
||||
_context.submit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_state.trapno >= Genode::Cpu_state::INTERRUPTS_START &&
|
||||
_state.trapno <= Genode::Cpu_state::INTERRUPTS_END) {
|
||||
cpu.pic().irq_occurred(_state.trapno);
|
||||
_interrupt(cpu.id());
|
||||
_context.submit(1);
|
||||
return;
|
||||
}
|
||||
Genode::raw("VM: triggered unknown exception ", _state.trapno,
|
||||
" with error code ", _state.errcode);
|
||||
|
||||
ASSERT_NEVER_CALLED;
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Vm::proceed(Cpu & cpu)
|
||||
{
|
||||
cpu.tss.ist[0] = (addr_t)&_state + sizeof(Genode::Cpu_state);
|
||||
|
||||
asm volatile("sti \n"
|
||||
"mov $1, %rax \n"
|
||||
"vmcall");
|
||||
}
|
||||
|
||||
|
||||
void Kernel::Vm::inject_irq(unsigned) { }
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
* \brief Programmable interrupt controller for core
|
||||
* \author Reto Buerki
|
||||
* \date 2015-04-14
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _CORE__SPEC__X86_64__MUEN__PIC_H_
|
||||
#define _CORE__SPEC__X86_64__MUEN__PIC_H_
|
||||
|
||||
namespace Board
|
||||
{
|
||||
/**
|
||||
* Programmable interrupt controller for core
|
||||
*/
|
||||
class Pic;
|
||||
}
|
||||
|
||||
class Board::Pic
|
||||
{
|
||||
public:
|
||||
|
||||
struct Virtual_context {};
|
||||
|
||||
enum {
|
||||
/*
|
||||
* FIXME: dummy ipi value on non-SMP platform, should be removed
|
||||
* when SMP is an aspect of CPUs only compiled where
|
||||
* necessary
|
||||
*/
|
||||
IPI = 255,
|
||||
NR_OF_IRQ = 256,
|
||||
};
|
||||
|
||||
void irq_occurred(unsigned irq)
|
||||
{
|
||||
if (irq < NR_OF_IRQ)
|
||||
isr[irq] = true;
|
||||
}
|
||||
|
||||
bool take_request(unsigned &irq)
|
||||
{
|
||||
for (int i = 0; i < NR_OF_IRQ; i++) {
|
||||
if (isr[i] == true) {
|
||||
irq = i;
|
||||
isr[i] = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dummies
|
||||
*/
|
||||
Pic() { }
|
||||
void finish_request() { }
|
||||
void unmask(unsigned const, unsigned) { }
|
||||
void mask(unsigned const) { }
|
||||
bool is_ip_interrupt(unsigned, unsigned) { return false; }
|
||||
void store_apic_id(unsigned const) { }
|
||||
void irq_mode(unsigned, unsigned, unsigned) { }
|
||||
|
||||
private:
|
||||
|
||||
bool isr[NR_OF_IRQ] = {false};
|
||||
};
|
||||
|
||||
#endif /* _CORE__SPEC__X86_64__MUEN__PIC_H_ */
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* \brief Platform specific services for HW kernel on Muen
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2015-06-03
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/service.h>
|
||||
|
||||
/* core includes */
|
||||
#include <core_env.h>
|
||||
#include <platform.h>
|
||||
#include <platform_services.h>
|
||||
#include <vm_root.h>
|
||||
#include <io_port_root.h>
|
||||
|
||||
/*
|
||||
* Add I/O port service and virtualization specific vm service
|
||||
*/
|
||||
void Genode::platform_add_local_services(Rpc_entrypoint &ep,
|
||||
Sliced_heap &sliced_heap,
|
||||
Registry<Service> &services,
|
||||
Trace::Source_registry &trace_sources)
|
||||
{
|
||||
static Vm_root vm_root(ep, sliced_heap, core_env().ram_allocator(),
|
||||
core_env().local_rm(), trace_sources);
|
||||
static Core_service<Vm_session_component> vm_ls(services, vm_root);
|
||||
|
||||
static Io_port_root io_port_root(*core_env().pd_session(),
|
||||
platform().io_port_alloc(), sliced_heap);
|
||||
static Core_service<Io_port_session_component> io_port_ls(services,
|
||||
io_port_root);
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
/*
|
||||
* \brief Platform implementations specific for x86_64_muen
|
||||
* \author Reto Buerki
|
||||
* \author Adrian-Ken Rueegsegger
|
||||
* \date 2015-04-21
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/mmio.h>
|
||||
|
||||
/* core includes */
|
||||
#include <board.h>
|
||||
#include <platform.h>
|
||||
#include <sinfo_instance.h>
|
||||
|
||||
#include <base/internal/unmanaged_singleton.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
struct Mmconf_address : Register<64>
|
||||
{
|
||||
enum { PCI_CONFIG_BASE = 0xf8000000 };
|
||||
|
||||
struct Sid : Bitfield<12, 16> { };
|
||||
|
||||
/**
|
||||
* Calculate SID (source-id, see VT-d spec section 3.4.1) from device PCI
|
||||
* config space address.
|
||||
*/
|
||||
static unsigned to_sid(access_t const addr) {
|
||||
return Sid::get(addr - PCI_CONFIG_BASE); }
|
||||
};
|
||||
|
||||
struct Msi_address : Register<32>
|
||||
{
|
||||
enum { BASE = 0xfee00010 };
|
||||
|
||||
struct Bits_0 : Bitfield<5, 15> { };
|
||||
struct Bits_1 : Bitfield<2, 1> { };
|
||||
struct Handle : Bitset_2<Bits_0, Bits_1> { };
|
||||
|
||||
/**
|
||||
* Return MSI address register value for given handle to enable Interrupt
|
||||
* Requests in Remappable Format, see VT-d specification section 5.1.2.2.
|
||||
*/
|
||||
static access_t to_msi_addr(Msi_address::Handle::access_t const handle)
|
||||
{
|
||||
access_t addr = BASE;
|
||||
Handle::set(addr, handle);
|
||||
return addr;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
bool Platform::get_msi_params(const addr_t mmconf, addr_t &address,
|
||||
addr_t &data, unsigned &irq_number)
|
||||
{
|
||||
const unsigned sid = Mmconf_address::to_sid(mmconf);
|
||||
const struct Sinfo::Device_type *dev = sinfo()->get_device(sid);
|
||||
|
||||
if (!dev) {
|
||||
error("error retrieving Muen info for device with SID ", Hex(sid));
|
||||
return false;
|
||||
}
|
||||
if (!dev->ir_count) {
|
||||
error("device ", Hex(sid), " has no IRQ assigned");
|
||||
return false;
|
||||
}
|
||||
if (!(dev->flags & Sinfo::DEV_MSI_FLAG)) {
|
||||
error("device ", Hex(sid), " not configured for MSI");
|
||||
return false;
|
||||
}
|
||||
|
||||
data = 0;
|
||||
address = Msi_address::to_msi_addr(dev->irte_start);
|
||||
irq_number = dev->irq_start;
|
||||
|
||||
log("enabling MSI for device with SID ", Hex(sid), ": "
|
||||
"IRTE ", dev->irte_start, ", IRQ ", irq_number);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Platform::_init_additional_platform_info(Xml_generator &)
|
||||
{
|
||||
/* export subject info page as ROM module */
|
||||
_rom_fs.insert(new (core_mem_alloc())
|
||||
Rom_module((addr_t)Sinfo::PHYSICAL_BASE_ADDR,
|
||||
Sinfo::SIZE, "subject_info_page"));
|
||||
}
|
||||
|
||||
|
||||
enum { COM1_PORT = 0x3f8 };
|
||||
Board::Serial::Serial(Genode::addr_t, Genode::size_t, unsigned baudrate)
|
||||
:X86_uart(COM1_PORT, 0, baudrate) {}
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* \brief Sinfo kernel singleton
|
||||
* \author Reto Buerki
|
||||
* \date 2016-05-09
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2016-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#include <sinfo_instance.h>
|
||||
#include <platform.h>
|
||||
|
||||
Genode::Sinfo * Genode::sinfo()
|
||||
{
|
||||
static Sinfo singleton(Platform::mmio_to_virt(Sinfo::PHYSICAL_BASE_ADDR));
|
||||
return &singleton;
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* \brief Sinfo kernel singleton
|
||||
* \author Reto Buerki
|
||||
* \date 2016-05-09
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2016-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _CORE__SPEC__X86_64__MUEN__SINFO_INSTANCE_H_
|
||||
#define _CORE__SPEC__X86_64__MUEN__SINFO_INSTANCE_H_
|
||||
|
||||
/* base includes */
|
||||
#include <muen/sinfo.h>
|
||||
|
||||
namespace Genode
|
||||
{
|
||||
/**
|
||||
* Return sinfo singleton
|
||||
*/
|
||||
Sinfo * sinfo();
|
||||
}
|
||||
|
||||
#endif /* _CORE__SPEC__X86_64__MUEN__SINFO_INSTANCE_H_ */
|
@ -1,90 +0,0 @@
|
||||
/*
|
||||
* \brief Timer driver for core
|
||||
* \author Reto Buerki
|
||||
* \author Martin Stein
|
||||
* \date 2015-04-14
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* base includes */
|
||||
#include <base/log.h>
|
||||
#include <drivers/timer/util.h>
|
||||
|
||||
/* core includes */
|
||||
#include <kernel/timer.h>
|
||||
#include <platform.h>
|
||||
#include <board.h>
|
||||
#include <sinfo_instance.h>
|
||||
|
||||
using namespace Genode;
|
||||
using namespace Kernel;
|
||||
|
||||
|
||||
Board::Timer::Timer(unsigned) : ticks_per_ms(sinfo()->get_tsc_khz()), start(0)
|
||||
{
|
||||
/* first sinfo instance, output status */
|
||||
sinfo()->log_status();
|
||||
|
||||
const struct Sinfo::Resource_type *
|
||||
region = sinfo()->get_resource("timed_event", Sinfo::RES_MEMORY);
|
||||
if (!region) {
|
||||
raw("muen-timer: Unable to retrieve timed event region");
|
||||
throw Invalid_region();
|
||||
}
|
||||
|
||||
event_page = (Subject_timed_event *)
|
||||
Platform::mmio_to_virt(region->data.mem.address);
|
||||
event_page->event_nr = Board::TIMER_EVENT_KERNEL;
|
||||
raw("muen-timer: Page @", Hex(region->data.mem.address), ", "
|
||||
"frequency ", ticks_per_ms, " kHz, "
|
||||
"event ", (unsigned)event_page->event_nr);
|
||||
|
||||
region = sinfo()->get_resource("monitor_timed_event", Sinfo::RES_MEMORY);
|
||||
if (region) {
|
||||
raw("muen-timer: Found guest timed event page @", Hex(region->data.mem.address),
|
||||
" -> enabling preemption");
|
||||
guest_event_page = (Subject_timed_event *)
|
||||
Platform::mmio_to_virt(region->data.mem.address);
|
||||
guest_event_page->event_nr = Board::TIMER_EVENT_PREEMPT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unsigned Timer::interrupt_id() const {
|
||||
return Board::TIMER_VECTOR_KERNEL; }
|
||||
|
||||
|
||||
void Timer::_start_one_shot(time_t const ticks)
|
||||
{
|
||||
static const time_t MIN_TICKS = 10UL;
|
||||
|
||||
_device.start = _device.rdtsc();
|
||||
uint64_t t = _device.start + ((ticks > MIN_TICKS) ? ticks : MIN_TICKS);
|
||||
_device.event_page->tsc_trigger = t;
|
||||
|
||||
if (_device.guest_event_page)
|
||||
_device.guest_event_page->tsc_trigger = t;
|
||||
}
|
||||
|
||||
|
||||
time_t Timer::ticks_to_us(time_t const ticks) const {
|
||||
return timer_ticks_to_us(ticks, _device.ticks_per_ms); }
|
||||
|
||||
|
||||
time_t Timer::us_to_ticks(time_t const us) const {
|
||||
return us * (_device.ticks_per_ms / 1000); }
|
||||
|
||||
|
||||
time_t Timer::_max_value() const { return ~0UL; }
|
||||
|
||||
|
||||
time_t Timer::_duration() const
|
||||
{
|
||||
return _device.rdtsc() - _device.start;
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* \brief Timer driver for core
|
||||
* \author Reto Buerki
|
||||
* \date 2015-04-14
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _TIMER_DRIVER_H_
|
||||
#define _TIMER_DRIVER_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/stdint.h>
|
||||
|
||||
namespace Board { class Timer; }
|
||||
|
||||
|
||||
struct Board::Timer
|
||||
{
|
||||
enum { TIMER_DISABLED = ~0ULL };
|
||||
|
||||
Genode::uint64_t ticks_per_ms;
|
||||
Genode::uint64_t start;
|
||||
|
||||
struct Subject_timed_event
|
||||
{
|
||||
Genode::uint64_t tsc_trigger;
|
||||
Genode::uint8_t event_nr :6;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct Subject_timed_event * event_page = 0;
|
||||
struct Subject_timed_event * guest_event_page = 0;
|
||||
|
||||
inline Genode::uint64_t rdtsc() const
|
||||
{
|
||||
Genode::uint32_t lo, hi;
|
||||
asm volatile("rdtsc" : "=a" (lo), "=d" (hi));
|
||||
return (Genode::uint64_t)hi << 32 | lo;
|
||||
}
|
||||
|
||||
class Invalid_region { };
|
||||
|
||||
Timer(unsigned);
|
||||
};
|
||||
|
||||
#endif /* _TIMER_DRIVER_H_ */
|
@ -1,89 +0,0 @@
|
||||
/*
|
||||
* \brief Core-specific instance of the VM session interface
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2015-06-03
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <util/construct_at.h>
|
||||
|
||||
/* core includes */
|
||||
#include <vm_session_component.h>
|
||||
#include <platform.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
static Board::Vm_page_table_array & dummy_array()
|
||||
{
|
||||
static Board::Vm_page_table_array a;
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
void Vm_session_component::_attach(addr_t, addr_t, size_t) { }
|
||||
|
||||
|
||||
void Vm_session_component::_attach_vm_memory(Dataspace_component &,
|
||||
addr_t const,
|
||||
Attach_attr const) { }
|
||||
|
||||
|
||||
void Vm_session_component::attach_pic(addr_t) { }
|
||||
|
||||
|
||||
void Vm_session_component::_detach_vm_memory(addr_t, size_t) { }
|
||||
|
||||
|
||||
void * Vm_session_component::_alloc_table()
|
||||
{
|
||||
static Board::Vm_page_table table;
|
||||
return (void*) &table;
|
||||
}
|
||||
|
||||
|
||||
Vm_session_component::Vm_session_component(Rpc_entrypoint &ep,
|
||||
Resources resources,
|
||||
Label const &,
|
||||
Diag,
|
||||
Ram_allocator &ram_alloc,
|
||||
Region_map ®ion_map,
|
||||
unsigned, Trace::Source_registry &)
|
||||
: Ram_quota_guard(resources.ram_quota),
|
||||
Cap_quota_guard(resources.cap_quota),
|
||||
_ep(ep),
|
||||
_constrained_md_ram_alloc(ram_alloc, _ram_quota_guard(), _cap_quota_guard()),
|
||||
_sliced_heap(_constrained_md_ram_alloc, region_map),
|
||||
_region_map(region_map),
|
||||
_table(*construct_at<Board::Vm_page_table>(_alloc_table())),
|
||||
_table_array(dummy_array()),
|
||||
_id({0, nullptr}) { }
|
||||
|
||||
|
||||
Vm_session_component::~Vm_session_component()
|
||||
{
|
||||
/* detach all regions */
|
||||
while (true) {
|
||||
addr_t out_addr = 0;
|
||||
|
||||
if (!_map.any_block_addr(&out_addr))
|
||||
break;
|
||||
|
||||
detach(out_addr);
|
||||
}
|
||||
|
||||
/* free region in allocator */
|
||||
for (unsigned i = 0; i < _vcpu_id_alloc; i++) {
|
||||
Vcpu & vcpu = _vcpus[i];
|
||||
if (vcpu.ds_cap.valid()) {
|
||||
_region_map.detach(vcpu.ds_addr);
|
||||
_constrained_md_ram_alloc.free(vcpu.ds_cap);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
TARGET = muen
|
||||
REQUIRES = x86_64
|
||||
MUEN_SRC_DIR = $(call select_from_ports,muen)/src/kernel/muen
|
||||
MUEN_BUILD_DIR = $(BUILD_BASE_DIR)/kernel
|
||||
MUEN_CONF_FILE = $(MUEN_BUILD_DIR)/muen.conf
|
||||
MUEN_DST_DIR = $(MUEN_BUILD_DIR)/muen
|
||||
MUEN_LOG = $(MUEN_BUILD_DIR)/build.log
|
||||
|
||||
MUEN_SYSTEM = $(shell sed -n "/^SYSTEM/s/^.*=\\s*//p" ${MUEN_CONF_FILE})
|
||||
MUEN_HARDWARE = $(shell sed -n "/^HARDWARE/s/^.*=\\s*//p" ${MUEN_CONF_FILE})
|
||||
MUEN_PLATFORM = $(shell sed -n "/^PLATFORM/s/^.*=\\s*//p" ${MUEN_CONF_FILE})
|
||||
MUEN_COMPONENTS = $(shell sed -n "/^COMPONENTS/s/^.*=\\s*//p" ${MUEN_CONF_FILE})
|
||||
GNAT_PATH = $(shell sed -n "/^GNAT_PATH/s/^.*=\\s*//p" ${MUEN_CONF_FILE})
|
||||
SPARK_PATH = $(shell sed -n "/^SPARK_PATH/s/^.*=\\s*//p" ${MUEN_CONF_FILE})
|
||||
|
||||
BUILD_ENV = PATH=$(GNAT_PATH)/bin:$(SPARK_PATH)/bin:$$PATH
|
||||
BUILD_OPTS = SYSTEM=$(MUEN_SYSTEM) HARDWARE=$(MUEN_HARDWARE) PLATFORM=$(MUEN_PLATFORM) NO_PROOF=true
|
||||
|
||||
ifeq ($(VERBOSE),)
|
||||
BUILD_OPTS += BUILD_OUTPUT_VERBOSE=true
|
||||
else
|
||||
BUILD_OPTS += BUILD_OUTPUT_NOCOLOR=true
|
||||
endif
|
||||
|
||||
$(TARGET): $(MUEN_DST_DIR)
|
||||
$(MSG_BUILD)Muen policy
|
||||
$(VERBOSE)$(BUILD_ENV) $(MAKE) -C $(MUEN_DST_DIR) $(BUILD_OPTS) policy-merge rts >> $(MUEN_LOG) 2>&1
|
||||
$(MSG_BUILD)Muen components
|
||||
$(VERBOSE)$(BUILD_ENV) $(MAKE) -C $(MUEN_DST_DIR)/components \
|
||||
COMPONENTS=$(MUEN_COMPONENTS) $(BUILD_OPTS) >> $(MUEN_LOG) 2>&1
|
||||
$(MSG_BUILD)Muen kernel
|
||||
$(VERBOSE)$(BUILD_ENV) $(MAKE) -C $(MUEN_DST_DIR)/policy $(BUILD_OPTS) compile >> $(MUEN_LOG) 2>&1
|
||||
$(VERBOSE)$(BUILD_ENV) $(MAKE) -C $(MUEN_DST_DIR)/kernel $(BUILD_OPTS) >> $(MUEN_LOG) 2>&1
|
||||
$(VERBOSE)$(BUILD_ENV) $(MAKE) -C $(MUEN_DST_DIR)/components $(BUILD_OPTS) install-tau0 >> $(MUEN_LOG) 2>&1
|
||||
|
||||
$(MUEN_DST_DIR): $(MUEN_SRC_DIR)
|
||||
$(VERBOSE)mkdir -p $(MUEN_DST_DIR)
|
||||
$(VERBOSE)tar c -C $(MUEN_SRC_DIR) . | tar x -m -C $(MUEN_DST_DIR)
|
||||
|
||||
clean cleanall: clean_muen
|
||||
|
||||
#
|
||||
# Make sure to execute the 'clean_muen' rule prior the generic clean
|
||||
# rule in 'prg.mk' because the generic rule will attempt to remove $(TARGET)
|
||||
# file, which is a directory in our case.
|
||||
#
|
||||
clean_prg_objects: clean_muen
|
||||
|
||||
clean_muen:
|
||||
$(VERBOSE)rm -rf $(MUEN_DST_DIR)
|
||||
$(VERBOSE)rm -f $(MUEN_CONF_FILE)
|
||||
$(VERBOSE)rm -f $(MUEN_LOG)
|
||||
|
||||
.PHONY: $(TARGET)
|
@ -1,24 +0,0 @@
|
||||
/*
|
||||
* \brief Muen scheduling group info
|
||||
* \author Adrian-Ken Rueegsegger
|
||||
* \date 2016-12-06
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2016 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _BASE__MUEN__MUSCHEDINFO_H_
|
||||
#define _BASE__MUEN__MUSCHEDINFO_H_
|
||||
|
||||
#include <base/stdint.h>
|
||||
|
||||
struct Scheduling_info_type {
|
||||
Genode::uint64_t tsc_schedule_start;
|
||||
Genode::uint64_t tsc_schedule_end;
|
||||
} __attribute__((packed, aligned (8)));
|
||||
|
||||
#endif /* _BASE__MUEN_MUSCHEDINFO_H_ */
|
@ -1,243 +0,0 @@
|
||||
/*
|
||||
* \brief Muen subject information API impl
|
||||
* \author Reto Buerki
|
||||
* \date 2015-04-21
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#include <base/log.h>
|
||||
#include <base/snprintf.h>
|
||||
#include <util/string.h>
|
||||
|
||||
#include <muen/sinfo.h>
|
||||
|
||||
#include "muschedinfo.h"
|
||||
|
||||
#define roundup(x, y) ( \
|
||||
{ \
|
||||
const typeof(y) __y = y; \
|
||||
(((x) + (__y - 1)) / __y) * __y; \
|
||||
})
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
static_assert(sizeof(Sinfo::Subject_info_type) <= Sinfo::SIZE,
|
||||
"Size of subject info type larger than Sinfo::SIZE.");
|
||||
|
||||
|
||||
static const char * const content_names[] = {
|
||||
"uninitialized", "fill", "file",
|
||||
};
|
||||
|
||||
uint8_t no_hash[Sinfo::HASH_LENGTH] = {0};
|
||||
|
||||
/* Return true if given buffer contains a hash */
|
||||
static bool hash_available(const uint8_t * const first)
|
||||
{
|
||||
return memcmp(first, no_hash, Sinfo::HASH_LENGTH) != 0;
|
||||
}
|
||||
|
||||
|
||||
static bool names_equal(const struct Sinfo::Name_type *const n1,
|
||||
const char *const n2)
|
||||
{
|
||||
return n1->length == strlen(n2) && strcmp(n1->data, n2) == 0;
|
||||
}
|
||||
|
||||
|
||||
/* Convert given hash to hex string */
|
||||
static char *hash_to_hex(char *buffer, const unsigned char *first)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < Sinfo::HASH_LENGTH; i++)
|
||||
snprintf(&buffer[i * 2], 3, "%02x", (unsigned int)*first++);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
static bool log_resource(const struct Sinfo::Resource_type *const res, void *)
|
||||
{
|
||||
char hash_str[65];
|
||||
|
||||
switch (res->kind) {
|
||||
case Sinfo::RES_MEMORY:
|
||||
Genode::log("muen-sinfo: memory [",
|
||||
content_names[res->data.mem.content],
|
||||
", addr ", Genode::Hex(res->data.mem.address),
|
||||
" size ", Genode::Hex(res->data.mem.size), " ",
|
||||
res->data.mem.flags & Sinfo::MEM_WRITABLE_FLAG ? "rw" : "ro",
|
||||
res->data.mem.flags & Sinfo::MEM_EXECUTABLE_FLAG ? "x" : "-",
|
||||
res->data.mem.flags & Sinfo::MEM_CHANNEL_FLAG ? "c" : "-",
|
||||
"] ", res->name.data);
|
||||
|
||||
if (res->data.mem.content == Sinfo::CONTENT_FILL)
|
||||
Genode::log("muen-sinfo: [pattern ", res->data.mem.pattern, "]");
|
||||
|
||||
if (hash_available(res->data.mem.hash))
|
||||
Genode::log("muen-sinfo: [hash 0x",
|
||||
Genode::Cstring(hash_to_hex(hash_str, res->data.mem.hash)),
|
||||
"]");
|
||||
break;
|
||||
case Sinfo::RES_DEVICE:
|
||||
Genode::log("muen-sinfo: device [sid ", Genode::Hex(res->data.dev.sid),
|
||||
" IRTE/IRQ start ", res->data.dev.irte_start,
|
||||
"/", res->data.dev.irq_start,
|
||||
" IR count ", res->data.dev.ir_count,
|
||||
" flags ", res->data.dev.flags, "] ", res->name.data);
|
||||
break;
|
||||
case Sinfo::RES_EVENT:
|
||||
Genode::log("muen-sinfo: event [number ", res->data.number, "] ", res->name.data);
|
||||
break;
|
||||
case Sinfo::RES_VECTOR:
|
||||
Genode::log("muen-sinfo: vector [number ", res->data.number, "] ", res->name.data);
|
||||
break;
|
||||
case Sinfo::RES_NONE:
|
||||
break;
|
||||
default:
|
||||
Genode::log("muen-sinfo: UNKNOWN resource at address %p\n",
|
||||
res);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Sinfo::Sinfo(const addr_t base_addr)
|
||||
:
|
||||
sinfo((Subject_info_type *)base_addr)
|
||||
{
|
||||
const uint64_t sinfo_page_size = roundup(sizeof(Subject_info_type), 0x1000);
|
||||
sched_info = ((Scheduling_info_type *)(base_addr + sinfo_page_size));
|
||||
|
||||
if (!check_magic()) {
|
||||
Genode::warning("muen-sinfo: Subject information MAGIC mismatch");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Sinfo::check_magic(void) const
|
||||
{
|
||||
return sinfo != 0 && sinfo->magic == MUEN_SUBJECT_INFO_MAGIC;
|
||||
}
|
||||
|
||||
|
||||
const char * Sinfo::get_subject_name(void)
|
||||
{
|
||||
if (!check_magic())
|
||||
return nullptr;
|
||||
|
||||
if (!subject_name_set)
|
||||
{
|
||||
memset(subject_name, 0, MAX_NAME_LENGTH + 1);
|
||||
memcpy(subject_name, &sinfo->name.data, sinfo->name.length);
|
||||
subject_name_set = true;
|
||||
}
|
||||
|
||||
return subject_name;
|
||||
}
|
||||
|
||||
|
||||
bool Sinfo::iterate_resources(struct iterator *const iter) const
|
||||
{
|
||||
if (!iter->res) {
|
||||
iter->res = &sinfo->resources[0];
|
||||
iter->idx = 0;
|
||||
} else {
|
||||
iter->res++;
|
||||
iter->idx++;
|
||||
}
|
||||
return iter->idx < sinfo->resource_count
|
||||
&& iter->res->kind != RES_NONE;
|
||||
}
|
||||
|
||||
|
||||
const struct Sinfo::Resource_type *
|
||||
Sinfo::get_resource(const char *const name, enum Resource_kind kind) const
|
||||
{
|
||||
struct iterator i = { nullptr, 0 };
|
||||
|
||||
while (iterate_resources(&i))
|
||||
if (i.res->kind == kind && names_equal(&i.res->name, name))
|
||||
return i.res;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
const struct Sinfo::Device_type * Sinfo::get_device(const uint16_t sid) const
|
||||
{
|
||||
struct iterator i = { nullptr, 0 };
|
||||
|
||||
while (iterate_resources(&i))
|
||||
if (i.res->kind == RES_DEVICE && i.res->data.dev.sid == sid)
|
||||
return &i.res->data.dev;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
bool Sinfo::for_each_resource(resource_cb func, void *data) const
|
||||
{
|
||||
struct iterator i = { nullptr, 0 };
|
||||
|
||||
while (iterate_resources(&i))
|
||||
if (!func(i.res, data))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
uint64_t Sinfo::get_tsc_khz(void) const
|
||||
{
|
||||
if (!check_magic())
|
||||
return 0;
|
||||
|
||||
return sinfo->tsc_khz;
|
||||
}
|
||||
|
||||
|
||||
uint64_t Sinfo::get_sched_start(void) const
|
||||
{
|
||||
if (!check_magic())
|
||||
return 0;
|
||||
|
||||
return sched_info->tsc_schedule_start;
|
||||
}
|
||||
|
||||
|
||||
uint64_t Sinfo::get_sched_end(void) const
|
||||
{
|
||||
if (!check_magic())
|
||||
return 0;
|
||||
|
||||
return sched_info->tsc_schedule_end;
|
||||
}
|
||||
|
||||
|
||||
void Sinfo::log_status()
|
||||
{
|
||||
if (!sinfo) {
|
||||
Genode::log("Sinfo API not initialized");
|
||||
return;
|
||||
}
|
||||
if (!check_magic()) {
|
||||
Genode::log("Sinfo MAGIC not found");
|
||||
return;
|
||||
}
|
||||
|
||||
const uint16_t count = sinfo->resource_count;
|
||||
|
||||
Genode::log("muen-sinfo: Subject name is '",
|
||||
Sinfo::get_subject_name(), "'");
|
||||
Genode::log("muen-sinfo: Subject exports ", count, " resources");
|
||||
for_each_resource(log_resource, nullptr);
|
||||
}
|
@ -2,7 +2,6 @@ proc have_platform_drv {} {
|
||||
return [expr [have_board imx53_qsb] \
|
||||
|| [have_board imx53_qsb_tz] \
|
||||
|| [have_board rpi] \
|
||||
|| [have_board muen] \
|
||||
|| [have_board pc]]
|
||||
}
|
||||
|
||||
@ -14,7 +13,6 @@ proc usb_host_drv_binary { } {
|
||||
if {[have_board rpi]} { return rpi_usb_host_drv }
|
||||
if {[have_board imx6q_sabrelite]} { return imx6q_sabrelite_usb_host_drv }
|
||||
if {[have_board imx8q_evk]} { return imx8q_evk_usb_host_drv }
|
||||
if {[have_board muen]} { return x86_pc_usb_host_drv }
|
||||
if {[have_board pc]} { return x86_pc_usb_host_drv }
|
||||
return no_usb_drv_available
|
||||
}
|
||||
@ -25,7 +23,6 @@ proc usb_host_drv_binary { } {
|
||||
#
|
||||
proc audio_drv_binary { } {
|
||||
if {[have_board linux]} { return linux_audio_drv }
|
||||
if {[have_board muen]} { return pci_audio_drv }
|
||||
if {[have_board pc]} { return pci_audio_drv }
|
||||
return no_audio_drv_available
|
||||
}
|
||||
@ -49,7 +46,7 @@ proc acpi_drv_name { } {
|
||||
proc platform_drv_build_components {} {
|
||||
set drv_build_components ""
|
||||
lappend_if [have_platform_drv] drv_build_components drivers/platform
|
||||
if {[have_board pc] || [have_board muen]} {
|
||||
if {[have_board pc]} {
|
||||
lappend drv_build_components server/report_rom
|
||||
if {[acpi_drv_name] eq "acpi_drv"} {
|
||||
lappend drv_build_components drivers/acpi
|
||||
@ -72,7 +69,6 @@ proc platform_drv_binary {} {
|
||||
if {[have_board imx53_qsb_tz]} { return imx53_platform_drv }
|
||||
if {[have_board rpi]} { return rpi_platform_drv }
|
||||
if {[have_board pc]} { return platform_drv }
|
||||
if {[have_board muen]} { return platform_drv }
|
||||
return no_platform_drv_available
|
||||
}
|
||||
|
||||
@ -82,11 +78,7 @@ proc platform_drv_boot_modules {} {
|
||||
|
||||
if {[have_spec x86]} {
|
||||
lappend drv_boot_modules report_rom
|
||||
if {[have_board muen]} {
|
||||
lappend drv_boot_modules acpi
|
||||
} else {
|
||||
lappend drv_boot_modules [acpi_drv_name]
|
||||
}
|
||||
lappend drv_boot_modules [acpi_drv_name]
|
||||
}
|
||||
|
||||
return $drv_boot_modules
|
||||
|
@ -10,11 +10,6 @@ if { [get_cmd_switch --autopilot] && [have_include "power_on/qemu"] } {
|
||||
exit 0
|
||||
}
|
||||
|
||||
if { [have_board muen] } {
|
||||
puts "Run script is not supported on this platform"
|
||||
exit 0
|
||||
}
|
||||
|
||||
build "core init test/smp"
|
||||
|
||||
create_boot_directory
|
||||
|
@ -1,4 +1,4 @@
|
||||
if {[expr ![have_spec nova] && ![have_spec sel4] && ![have_spec hw] && ![have_spec foc] || ![have_spec x86] || [have_include power_on/qemu] || [have_board muen]]} {
|
||||
if {[expr ![have_spec nova] && ![have_spec sel4] && ![have_spec hw] && ![have_spec foc] || ![have_spec x86] || [have_include power_on/qemu]]} {
|
||||
puts "\n Run script is not supported on this platform. \n"; exit 0 }
|
||||
|
||||
proc wifi_ssid {} {
|
||||
|
@ -38,12 +38,12 @@
|
||||
# input events on the host PC.
|
||||
#
|
||||
|
||||
if { [have_board linux] || [have_board muen] } {
|
||||
puts "Run script does not support Linux and Muen."
|
||||
if {[have_board linux]} {
|
||||
puts "Run script does not support Linux."
|
||||
exit 0
|
||||
}
|
||||
|
||||
if { [get_cmd_switch --autopilot] && [have_include "power_on/qemu"] } {
|
||||
if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} {
|
||||
puts "Run script does not support autopilot mode on Qemu"
|
||||
exit 0
|
||||
}
|
||||
|
@ -5,18 +5,18 @@
|
||||
|
||||
assert_spec x86
|
||||
|
||||
if { [have_spec linux] || [have_board muen] } {
|
||||
puts "Run script does not support Linux and Muen."
|
||||
if {[have_spec linux]} {
|
||||
puts "Run script does not support Linux."
|
||||
exit 0
|
||||
}
|
||||
|
||||
if { [get_cmd_switch --autopilot] && [have_include "power_on/qemu"] } {
|
||||
puts "Run script does not support autopilot mode on Qemu"
|
||||
if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} {
|
||||
puts "Run script does not support autopilot mode on Qemu."
|
||||
exit 0
|
||||
}
|
||||
|
||||
if { [get_cmd_switch --autopilot] && ![have_spec x86_64] } {
|
||||
puts "Run script does not support autopilot mode on this platform"
|
||||
if {[get_cmd_switch --autopilot] && ![have_spec x86_64]} {
|
||||
puts "Run script does not support autopilot mode on this platform."
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
|
||||
Device drivers needed for scenarios
|
||||
using one network interface
|
@ -1,3 +0,0 @@
|
||||
_/src/platform_drv
|
||||
_/src/ipxe_nic_drv
|
||||
_/raw/drivers_nic-muen
|
@ -1 +0,0 @@
|
||||
2021-01-22 649375243e611123c3dbe98b84cfcb10e6fdbcf5
|
@ -1,4 +0,0 @@
|
||||
content: drivers.config
|
||||
|
||||
drivers.config:
|
||||
cp $(REP_DIR)/recipes/raw/drivers_nic-muen/$@ $@
|
@ -1,55 +0,0 @@
|
||||
<config>
|
||||
|
||||
<parent-provides>
|
||||
<service name="IRQ"/>
|
||||
<service name="IO_MEM"/>
|
||||
<service name="IO_PORT"/>
|
||||
<service name="ROM"/>
|
||||
<service name="PD"/>
|
||||
<service name="RM"/>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
<service name="Timer"/>
|
||||
<service name="Uplink"/>
|
||||
</parent-provides>
|
||||
|
||||
<default caps="100"/>
|
||||
|
||||
<start name="platform_drv" caps="210" managing_system="yes">
|
||||
<resource name="RAM" quantum="3M"/>
|
||||
<provides>
|
||||
<service name="Platform"/>
|
||||
<service name="Acpi"/>
|
||||
</provides>
|
||||
<route>
|
||||
<service name="IRQ"> <parent/> </service>
|
||||
<service name="IO_MEM"> <parent/> </service>
|
||||
<service name="IO_PORT"> <parent/> </service>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="Timer"> <parent/> </service>
|
||||
</route>
|
||||
<config>
|
||||
<policy label_prefix="nic_drv"> <pci class="ETHERNET"/> </policy>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
<start name="nic_drv" caps="120">
|
||||
<binary name="ipxe_nic_drv"/>
|
||||
<resource name="RAM" quantum="8M"/>
|
||||
<config mode="uplink_client"/>
|
||||
<route>
|
||||
<service name="Platform"> <child name="platform_drv"/> </service>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="RM"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="Timer"> <parent/> </service>
|
||||
<service name="Uplink"> <parent/> </service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
</config>
|
@ -1 +0,0 @@
|
||||
2021-01-22 59880f834aba427a44be3999aabd710b6d930e19
|
@ -5,8 +5,8 @@
|
||||
# configured for the application and for the USB driver.
|
||||
#
|
||||
|
||||
if { [have_include "power_on/qemu"] || [have_spec linux] || [have_board muen] } {
|
||||
puts "Run script does not support Qemu, Linux, and Muen"
|
||||
if {[have_include "power_on/qemu"] || [have_spec linux]} {
|
||||
puts "Run script does not support Qemu or Linux"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
|
||||
Device drivers needed to run interactive
|
||||
scenarios on Muen
|
@ -1,6 +0,0 @@
|
||||
_/src/platform_drv
|
||||
_/src/ps2_drv
|
||||
_/src/usb_drv
|
||||
_/src/vesa_drv
|
||||
_/src/event_filter
|
||||
_/raw/drivers_interactive-muen
|
@ -1 +0,0 @@
|
||||
2021-01-22 dfbca31669fc42cdef43f17685ca3a84e8d47f42
|
@ -1,7 +0,0 @@
|
||||
content: drivers.config fb_drv.config event_filter.config en_us.chargen special.chargen
|
||||
|
||||
drivers.config fb_drv.config event_filter.config:
|
||||
cp $(REP_DIR)/recipes/raw/drivers_interactive-muen/$@ $@
|
||||
|
||||
en_us.chargen special.chargen:
|
||||
cp $(REP_DIR)/src/server/event_filter/$@ $@
|
@ -1,105 +0,0 @@
|
||||
<config>
|
||||
|
||||
<parent-provides>
|
||||
<service name="IRQ"/>
|
||||
<service name="IO_MEM"/>
|
||||
<service name="IO_PORT"/>
|
||||
<service name="ROM"/>
|
||||
<service name="PD"/>
|
||||
<service name="RM"/>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
<service name="Timer"/>
|
||||
<service name="Capture"/>
|
||||
<service name="Event"/>
|
||||
</parent-provides>
|
||||
|
||||
<default caps="60"/>
|
||||
|
||||
<service name="Input">
|
||||
<default-policy> <child name="input_filter"/> </default-policy> </service>
|
||||
|
||||
<start name="platform_drv" caps="200" managing_system="yes">
|
||||
<resource name="RAM" quantum="3M"/>
|
||||
<provides>
|
||||
<service name="Platform"/>
|
||||
<service name="Acpi"/>
|
||||
</provides>
|
||||
<route>
|
||||
<service name="IRQ"> <parent/> </service>
|
||||
<service name="IO_MEM"> <parent/> </service>
|
||||
<service name="IO_PORT"> <parent/> </service>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="Timer"> <parent/> </service>
|
||||
</route>
|
||||
<config>
|
||||
<policy label_prefix="ps2_drv"> <device name="PS2"/> </policy>
|
||||
<policy label_prefix="fb_drv"> <pci class="VGA"/> </policy>
|
||||
<policy label_prefix="usb_drv"> <pci class="USB"/> </policy>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
<start name="fb_drv" caps="120">
|
||||
<binary name="vesa_fb_drv"/>
|
||||
<resource name="RAM" quantum="16M"/>
|
||||
<route>
|
||||
<service name="ROM" label="config"> <parent label="fb_drv.config"/> </service>
|
||||
<service name="Platform"> <child name="platform_drv"/> </service>
|
||||
<service name="IO_PORT"> <parent/> </service>
|
||||
<service name="IO_MEM"> <parent/> </service>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="Timer"> <parent/> </service>
|
||||
<service name="Capture"> <parent/> </service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="ps2_drv" caps="80">
|
||||
<resource name="RAM" quantum="1280K"/>
|
||||
<config/>
|
||||
<route>
|
||||
<service name="Platform"> <child name="platform_drv"/> </service>
|
||||
<service name="Event"> <child name="event_filter" label="ps2"/> </service>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="Timer"> <parent/> </service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="usb_drv" caps="150">
|
||||
<resource name="RAM" quantum="14M"/>
|
||||
<config uhci="yes" ehci="yes" xhci="yes"> <hid/> </config>
|
||||
<route>
|
||||
<service name="Platform"> <child name="platform_drv"/> </service>
|
||||
<service name="Event"> <child name="event_filter" label="usb"/> </service>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="RM"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="Timer"> <parent/> </service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="event_filter" caps="90">
|
||||
<resource name="RAM" quantum="1280K"/>
|
||||
<provides> <service name="Event"/> </provides>
|
||||
<route>
|
||||
<service name="ROM" label="config"> <parent label="event_filter.config"/> </service>
|
||||
<service name="Event"> <parent/> </service>
|
||||
<service name="ROM"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="Timer"> <parent/> </service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
</config>
|
@ -1,30 +0,0 @@
|
||||
<config>
|
||||
<output>
|
||||
<chargen>
|
||||
<merge>
|
||||
<accelerate max="50" sensitivity_percent="1000" curve="127">
|
||||
<button-scroll>
|
||||
<input name="ps2"/>
|
||||
<vertical button="BTN_MIDDLE" speed_percent="-10"/>
|
||||
<horizontal button="BTN_MIDDLE" speed_percent="-10"/>
|
||||
</button-scroll>
|
||||
</accelerate>
|
||||
<input name="usb"/>
|
||||
</merge>
|
||||
<mod1>
|
||||
<key name="KEY_LEFTSHIFT"/> <key name="KEY_RIGHTSHIFT"/>
|
||||
</mod1>
|
||||
<mod2>
|
||||
<key name="KEY_LEFTCTRL"/> <key name="KEY_RIGHTCTRL"/>
|
||||
</mod2>
|
||||
<mod3>
|
||||
<key name="KEY_RIGHTALT"/> <!-- AltGr -->
|
||||
</mod3>
|
||||
<repeat delay_ms="230" rate_ms="90"/>
|
||||
<include rom="en_us.chargen"/>
|
||||
<include rom="special.chargen"/>
|
||||
</chargen>
|
||||
</output>
|
||||
<policy label_prefix="ps2_drv" input="ps2"/>
|
||||
<policy label_prefix="usb_drv" input="usb"/>
|
||||
</config>
|
@ -1 +0,0 @@
|
||||
<config width="1024" height="768" buffered="yes"/>
|
@ -1 +0,0 @@
|
||||
2021-01-22 5dc9b2b9d1f7f7f7c7985d38ac4969ca90f5726a
|
@ -52,7 +52,6 @@ proc bogomips_max_time { } {
|
||||
if {[have_spec x86_64]} { return 600 }
|
||||
if {[have_spec x86_32]} { return 3150 }
|
||||
}
|
||||
if {[have_board muen]} { return 600 }
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
append_platform_drv_build_components
|
||||
|
||||
lappend_if [have_board pc] build_components drivers/ps2
|
||||
lappend_if [have_board muen] build_components drivers/ps2
|
||||
lappend_if [have_board linux] build_components drivers/framebuffer/sdl
|
||||
lappend_if [have_board linux] build_components server/nitpicker
|
||||
|
||||
@ -53,7 +52,7 @@ append config {
|
||||
|
||||
append_platform_drv_config
|
||||
|
||||
append_if [expr [have_board pc] || [have_board muen]] config {
|
||||
append_if [have_board pc] config {
|
||||
<start name="ps2_drv">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
<config verbose_keyboard="no" verbose_mouse="no" verbose_scancodes="no"
|
||||
@ -158,7 +157,6 @@ set boot_modules { core ld.lib.so init timer dynamic_rom event_dump }
|
||||
append_platform_drv_boot_modules
|
||||
|
||||
lappend_if [have_board pc] boot_modules ps2_drv
|
||||
lappend_if [have_board muen] boot_modules ps2_drv
|
||||
lappend_if [have_board linux] boot_modules fb_sdl
|
||||
lappend_if [have_board linux] boot_modules nitpicker
|
||||
|
||||
|
@ -109,44 +109,30 @@ namespace Platform {
|
||||
unsigned read(Pci::Bdf const bdf, unsigned char const addr,
|
||||
Device::Access_size const size, bool const track = true)
|
||||
{
|
||||
unsigned ret;
|
||||
unsigned const offset = _dev_base(bdf) + addr;
|
||||
char const * const field = _pciconf.local_addr<char>() + offset;
|
||||
unsigned const offset = _dev_base(bdf) + addr;
|
||||
char const * const field_ptr = _pciconf.local_addr<char>() + offset;
|
||||
|
||||
if (offset >= _pciconf_size)
|
||||
throw Invalid_mmio_access();
|
||||
|
||||
/*
|
||||
* Memory access code is implemented in a way to make it work
|
||||
* with Muen subject monitor (SM) device emulation and also
|
||||
* general x86 targets. On Muen, the simplified device
|
||||
* emulation code (which also works for Linux) always returns
|
||||
* 0xffff in EAX to indicate a non-existing device. Therefore,
|
||||
* we enforce the usage of EAX in the following assembly
|
||||
* templates. Also clear excess bits before return to guarantee
|
||||
* the requested size.
|
||||
*/
|
||||
switch (size) {
|
||||
|
||||
case Device::ACCESS_8BIT:
|
||||
if (track)
|
||||
_use_register(addr, 1);
|
||||
asm volatile("movb %1,%%al" :"=a" (ret) :"m" (*((volatile unsigned char *)field)) :"memory");
|
||||
return ret & 0xff;
|
||||
return *(uint8_t const *)field_ptr;
|
||||
|
||||
case Device::ACCESS_16BIT:
|
||||
if (track)
|
||||
_use_register(addr, 2);
|
||||
return *(uint16_t const *)field_ptr;
|
||||
|
||||
asm volatile("movw %1,%%ax" :"=a" (ret) :"m" (*(volatile unsigned short *)field) :"memory");
|
||||
return ret & 0xffff;
|
||||
case Device::ACCESS_32BIT:
|
||||
if (track)
|
||||
_use_register(addr, 4);
|
||||
|
||||
asm volatile("movl %1,%%eax" :"=a" (ret) :"m" (*(volatile unsigned int *)field) :"memory");
|
||||
return ret;
|
||||
default:
|
||||
return ~0U;
|
||||
return *(uint32_t const *)field_ptr;
|
||||
}
|
||||
return ~0U;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -163,8 +149,8 @@ namespace Platform {
|
||||
unsigned const value, Device::Access_size const size,
|
||||
bool const track = true)
|
||||
{
|
||||
unsigned const offset = _dev_base(bdf) + addr;
|
||||
char const * const field = _pciconf.local_addr<char>() + offset;
|
||||
unsigned const offset = _dev_base(bdf) + addr;
|
||||
char * const field_ptr = _pciconf.local_addr<char>() + offset;
|
||||
|
||||
if (offset >= _pciconf_size)
|
||||
throw Invalid_mmio_access();
|
||||
@ -174,23 +160,23 @@ namespace Platform {
|
||||
* for an explanation of the assembly templates
|
||||
*/
|
||||
switch (size) {
|
||||
|
||||
case Device::ACCESS_8BIT:
|
||||
if (track)
|
||||
_use_register(addr, 1);
|
||||
|
||||
asm volatile("movb %%al,%1" : :"a" (value), "m" (*(volatile unsigned char *)field) :"memory");
|
||||
*(uint8_t volatile *)field_ptr = value;
|
||||
break;
|
||||
|
||||
case Device::ACCESS_16BIT:
|
||||
if (track)
|
||||
_use_register(addr, 2);
|
||||
|
||||
asm volatile("movw %%ax,%1" : :"a" (value), "m" (*(volatile unsigned char *)field) :"memory");
|
||||
*(uint16_t volatile *)field_ptr = value;
|
||||
break;
|
||||
|
||||
case Device::ACCESS_32BIT:
|
||||
if (track)
|
||||
_use_register(addr, 4);
|
||||
|
||||
asm volatile("movl %%eax,%1" : :"a" (value), "m" (*(volatile unsigned char *)field) :"memory");
|
||||
*(uint32_t volatile *)field_ptr = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -11,11 +11,6 @@ if {[have_include "power_on/qemu"] || [have_include "power_on/linux"]} {
|
||||
exit 0
|
||||
}
|
||||
|
||||
if { [have_spec muen] } {
|
||||
puts "Run script does not support Muen."
|
||||
exit 0
|
||||
}
|
||||
|
||||
if {[get_cmd_switch --autopilot] && [have_spec x86_32] &&
|
||||
![expr [have_board foc] || [have_spec nova]]} {
|
||||
puts stderr "\nNetperf WIFI running with non-ACPI kernel on native x86_32 test machine is not supported because of wrong interrupt number in pci config space (should be 11 instead 10).\n"
|
||||
|
@ -11,11 +11,6 @@ if {[have_include "power_on/qemu"] || [have_include "power_on/linux"]} {
|
||||
exit 0
|
||||
}
|
||||
|
||||
if { [have_board muen] } {
|
||||
puts "Run script does not support Muen."
|
||||
exit 0
|
||||
}
|
||||
|
||||
if {[get_cmd_switch --autopilot] && [have_spec x86_32] &&
|
||||
![expr [have_board foc] || [have_spec nova]]} {
|
||||
puts stderr "\nNetperf WIFI running with non-ACPI kernel on native x86_32 test machine is not supported because of wrong interrupt number in pci config space (should be 11 instead 10).\n"
|
||||
|
@ -62,14 +62,13 @@ if {[have_include "power_on/qemu"]} {
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Tested for nova and muen.
|
||||
if {(![have_spec nova] && ![have_board muen])} {
|
||||
# Tested for nova
|
||||
if {![have_spec nova]} {
|
||||
puts "Platform is unsupported."
|
||||
exit 0
|
||||
}
|
||||
|
||||
set virtualbox_binary "virtualbox-rem"
|
||||
if {[have_board muen]} { set virtualbox_binary "virtualbox-muen" }
|
||||
if {[have_spec nova]} { set virtualbox_binary "virtualbox-nova" }
|
||||
set virtualbox5_binary "virtualbox5-rem"
|
||||
if {[have_spec nova]} { set virtualbox5_binary "virtualbox5-nova" }
|
||||
|
@ -350,7 +350,7 @@ append_if [expr $use_usb] config {
|
||||
</start>
|
||||
}
|
||||
|
||||
append_if [expr [have_board pc] || [have_board muen]] config {
|
||||
append_if [have_board pc] config {
|
||||
<start name="fb_drv" priority="-1" caps="150">
|
||||
<binary name="vesa_fb_drv"/>
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
@ -401,11 +401,10 @@ lappend_if [expr $use_cpu_load] boot_modules top
|
||||
lappend_if [have_spec nova] boot_modules log_core
|
||||
|
||||
# platform-specific modules
|
||||
lappend_if [expr $use_ps2] boot_modules ps2_drv
|
||||
lappend_if [expr $use_usb] boot_modules usb_drv
|
||||
lappend_if [expr $use_usb] boot_modules usb_report_filter
|
||||
lappend_if [have_board pc] boot_modules vesa_fb_drv
|
||||
lappend_if [have_board muen] boot_modules vesa_fb_drv
|
||||
lappend_if [have_spec x86] boot_modules rtc_drv
|
||||
lappend_if [expr $use_ps2] boot_modules ps2_drv
|
||||
lappend_if [expr $use_usb] boot_modules usb_drv
|
||||
lappend_if [expr $use_usb] boot_modules usb_report_filter
|
||||
lappend_if [have_board pc] boot_modules vesa_fb_drv
|
||||
lappend_if [have_spec x86] boot_modules rtc_drv
|
||||
|
||||
append_platform_drv_boot_modules
|
||||
|
@ -1,18 +1,10 @@
|
||||
# kernel to use (nova, hw, sel4, linux, or foc)
|
||||
#KERNEL ?= nova
|
||||
|
||||
# board to use (pc, linux, or muen)
|
||||
# board to use (pc or linux)
|
||||
BOARD ?= pc
|
||||
|
||||
# local variable for run-tool arguments that depend on the used board
|
||||
BOARD_RUN_OPT(muen) = --include image/muen
|
||||
BOARD_RUN_OPT(muen) += --image-muen-hardware hardware/lenovo-t430s.xml
|
||||
BOARD_RUN_OPT(muen) += --image-muen-platform platform/lenovo-t430s.xml
|
||||
BOARD_RUN_OPT(muen) += --image-muen-gnat-path /opt/gnat
|
||||
BOARD_RUN_OPT(muen) += --image-muen-spark-path /opt/spark
|
||||
BOARD_RUN_OPT(muen) += --image-muen-system xml/genode-base_hw.xml
|
||||
BOARD_RUN_OPT(muen) += --image-muen-components 'libdebuglog libmudm libmutime libxhcidbg dbgserver sm time'
|
||||
BOARD_RUN_OPT(muen) += --image-muen-external-build 0
|
||||
BOARD_RUN_OPT(linux) = --include power_on/linux --include log/linux
|
||||
BOARD_RUN_OPT(pc) = $(QEMU_RUN_OPT)
|
||||
|
||||
|
@ -39,13 +39,6 @@ proc core_link_address { } {
|
||||
#
|
||||
proc run_boot_dir {binaries} {
|
||||
|
||||
# generate static ACPI report for platform driver on Muen
|
||||
if {[have_board "muen"]} {
|
||||
set fh [open "bin/acpi" "WRONLY CREAT TRUNC"]
|
||||
puts $fh "<acpi><bdf start=\"0\" count=\"16384\" base=\"0xf8000000\"/><drhd/></acpi>"
|
||||
close $fh
|
||||
}
|
||||
|
||||
#
|
||||
# Build bootstrap, the core object, and the dynamic linker on demand
|
||||
#
|
||||
@ -174,14 +167,8 @@ proc run_boot_dir {binaries} {
|
||||
# Generate pulsar config file
|
||||
#
|
||||
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
|
||||
if {[have_board "muen"]} {
|
||||
exec gzip [run_dir]/image.bin
|
||||
puts $fh " exec /boot/unzip"
|
||||
puts $fh " load /image.bin.gz"
|
||||
} else {
|
||||
puts $fh " exec /boot/bender"
|
||||
puts $fh " load /boot/image.elf"
|
||||
}
|
||||
puts $fh " exec /boot/bender"
|
||||
puts $fh " load /boot/image.elf"
|
||||
close $fh
|
||||
|
||||
generate_tftp_config
|
||||
@ -194,13 +181,9 @@ proc run_boot_dir {binaries} {
|
||||
set fh [open "[run_dir]/boot.cfg" "WRONLY CREAT TRUNC"]
|
||||
puts $fh "#!ipxe"
|
||||
|
||||
if {[have_board "muen"]} {
|
||||
puts $fh "kernel image.bin"
|
||||
} else {
|
||||
install_pxe_bootloader_to_run_dir
|
||||
puts $fh "kernel boot/bender"
|
||||
puts $fh "module boot/image.elf"
|
||||
}
|
||||
install_pxe_bootloader_to_run_dir
|
||||
puts $fh "kernel boot/bender"
|
||||
puts $fh "module boot/image.elf"
|
||||
puts $fh "boot"
|
||||
close $fh
|
||||
|
||||
|
@ -459,7 +459,6 @@ proc check_for_missing_depot_archives { } {
|
||||
|
||||
proc drivers_interactive_pkg { } {
|
||||
|
||||
if {[have_board muen]} { return drivers_interactive-muen }
|
||||
if {[have_board linux]} { return drivers_interactive-linux }
|
||||
if {[have_board pc]} { return drivers_interactive-pc }
|
||||
if {[have_board pbxa9]} { return drivers_interactive-pbxa9 }
|
||||
@ -478,7 +477,6 @@ proc drivers_interactive_pkg { } {
|
||||
proc drivers_nic_pkg { } {
|
||||
|
||||
if {[have_board pc]} { return drivers_nic-pc }
|
||||
if {[have_board muen]} { return drivers_nic-muen }
|
||||
if {[have_board linux]} { return drivers_nic-linux }
|
||||
if {[have_board pbxa9]} { return drivers_nic-pbxa9 }
|
||||
if {[have_board rpi]} { return drivers_nic-rpi }
|
||||
|
@ -1,87 +0,0 @@
|
||||
##
|
||||
# Muen system image configuration parameters
|
||||
#
|
||||
# \param --image-muen-external-build Muen system is built automatically or externally
|
||||
# \param --image-muen-system Muen system policy
|
||||
# \param --image-muen-components Muen system components
|
||||
# \param --image-muen-hardware Muen hardware specification
|
||||
# \param --image-muen-platform Muen platform specification
|
||||
# \param --image-muen-gnat-path Path to GNAT toolchain
|
||||
# \param --image-muen-spark-path Path to SPARK toolchain
|
||||
#
|
||||
|
||||
proc muen_external { } {
|
||||
return [get_cmd_arg --image-muen-external-build "0"]
|
||||
}
|
||||
|
||||
proc muen_system { } {
|
||||
return [get_cmd_arg --image-muen-system ""]
|
||||
}
|
||||
proc muen_components { } {
|
||||
return [get_cmd_arg --image-muen-components ""]
|
||||
}
|
||||
|
||||
proc muen_hardware { } {
|
||||
return [get_cmd_arg --image-muen-hardware ""]
|
||||
}
|
||||
|
||||
proc muen_platform { } {
|
||||
return [get_cmd_arg --image-muen-platform ""]
|
||||
}
|
||||
|
||||
proc muen_gnat_path { } {
|
||||
return [get_cmd_arg --image-muen-gnat-path "/usr/gnat"]
|
||||
}
|
||||
|
||||
proc muen_spark_path { } {
|
||||
return [get_cmd_arg --image-muen-spark-path "/opt/spark2014"]
|
||||
}
|
||||
|
||||
##
|
||||
# Build and integrate Muen system image
|
||||
#
|
||||
# \param elf_img ELF binary of Genode subject
|
||||
#
|
||||
proc run_image {elf_img} {
|
||||
if {![have_board "muen"]} {
|
||||
puts stderr "You've to build for the BOARD=muen"
|
||||
exit -1
|
||||
}
|
||||
|
||||
# For external Muen system integration there is nothing left to do.
|
||||
if {[muen_external]} {
|
||||
puts "build finished due to external Muen system integration"
|
||||
exit 0
|
||||
}
|
||||
|
||||
#
|
||||
# Generate Muen build config file
|
||||
#
|
||||
set fh [open "[run_dir]/muen.conf" "WRONLY CREAT TRUNC"]
|
||||
puts $fh "GNAT_PATH = [muen_gnat_path]"
|
||||
puts $fh "SPARK_PATH = [muen_spark_path]"
|
||||
puts $fh "SYSTEM = [muen_system]"
|
||||
puts $fh "COMPONENTS = \"[muen_components]\""
|
||||
puts $fh "HARDWARE = [muen_hardware]"
|
||||
puts $fh "PLATFORM = [muen_platform]"
|
||||
close $fh
|
||||
|
||||
#
|
||||
# Build Muen kernel
|
||||
#
|
||||
puts "using Muen system policy '[muen_system]' on platform '[muen_hardware]'"
|
||||
if {![file exists kernel]} { exec mkdir kernel }
|
||||
exec cp [run_dir]/muen.conf kernel/muen.conf
|
||||
build kernel
|
||||
|
||||
# Use raw binary object for base-hw on Muen
|
||||
set bin_img "[run_dir]/[run_name].bin"
|
||||
exec [cross_dev_prefix]objcopy -O binary $elf_img $bin_img
|
||||
|
||||
#
|
||||
# Package Muen system image
|
||||
#
|
||||
exec cp $bin_img "kernel/muen/policy/obj/base_hw"
|
||||
exec make -C kernel/muen/pack SYSTEM=[muen_system] HARDWARE=[muen_hardware] PLATFORM=[muen_platform]
|
||||
exec cp kernel/muen/pack/obj/muen.img "[run_dir]/image.bin"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user