hw: skeleton for building x86_64_muen

The hw_x86_64_muen platform is a x86/64 base-hw kernel which runs as
isolated subject (guest) on the Muen Separation Kernel (SK) [1].

The platform is implemented as an extension to hw_x86_64 replacing the
PIC and timer drivers with paravirtualized variants. The skeleton
contains a dummy PIC and timer implementation for now.

[1] - http://muen.sk
This commit is contained in:
Reto Buerki 2015-04-14 12:12:15 +02:00 committed by Stefan Kalkowski
parent 3420cc0b71
commit dcd20f1566
6 changed files with 167 additions and 0 deletions

View File

@ -0,0 +1,3 @@
include $(REP_DIR)/lib/mk/base-common.inc
vpath kernel/interface.cc $(REP_DIR)/src/base/x86_64

View File

@ -0,0 +1,34 @@
#
# \brief Build config for Genodes core process
# \author Stefan Kalkowski
# \author Martin Stein
# \date 2012-10-04
#
# add include paths
INC_DIR += $(REP_DIR)/src/core/include/spec/x86_64_muen
INC_DIR += $(REP_DIR)/src/core/include/spec/x86_64
INC_DIR += $(REP_DIR)/src/core/include/spec/x86
# add assembly sources
SRC_S += spec/x86_64/mode_transition.s
SRC_S += spec/x86_64/kernel/crt0.s
SRC_S += spec/x86_64/kernel/crt0_translation_table.s
SRC_S += spec/x86_64/crt0.s
# add C++ sources
SRC_CC += spec/x86_64/kernel/thread_base.cc
SRC_CC += spec/x86_64/platform_support.cc
SRC_CC += spec/x86_64/idt.cc
SRC_CC += spec/x86_64/tss.cc
SRC_CC += spec/x86/platform_support.cc
SRC_CC += spec/x86/kernel/thread.cc
SRC_CC += spec/x86/kernel/cpu.cc
SRC_CC += spec/x86/kernel/pd.cc
SRC_CC += spec/x86/cpu.cc
SRC_CC += x86/io_port_session_component.cc
SRC_CC += x86/platform_services.cc
SRC_CC += kernel/vm_thread.cc
# include less specific configuration
include $(REP_DIR)/lib/mk/core.inc

View File

@ -0,0 +1,19 @@
#
# \brief Build configs that are specific to base-hw/x86_64 on the Muen SK
# \author Martin Stein
# \date 2011-12-20
#
# denote wich specs are also fullfilled by this spec
SPECS += hw x86_64_muen
SPECS += pci ps2 vesa framebuffer
# configure multiprocessor mode
NR_OF_CPUS = 1
# set address where to link text segment at
LD_TEXT_ADDR ?= 0x200000
# include implied specs
include $(call select_from_repositories,mk/spec-hw.mk)
include $(call select_from_repositories,mk/spec-x86_64.mk)

View File

@ -0,0 +1,56 @@
/*
* \brief Programmable interrupt controller for core
* \author Reto Buerki
* \date 2015-04-14
*/
/*
* Copyright (C) 2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _PIC_H_
#define _PIC_H_
namespace Genode
{
/**
* Programmable interrupt controller for core
*/
class Pic;
}
class Genode::Pic
{
public:
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,
};
/*
* Dummies
*/
Pic() { }
bool take_request(unsigned &irq) { return false; }
void finish_request() { }
void unmask(unsigned const i, unsigned) { }
void mask(unsigned const i) { }
void mask() { }
void init_cpu_local() { }
bool is_ip_interrupt(unsigned, unsigned) { return false; }
void trigger_ip_interrupt(unsigned) { }
};
namespace Kernel { class Pic : public Genode::Pic { }; }
#endif /* _PIC_H_ */

View File

@ -0,0 +1,46 @@
/*
* \brief Timer driver for core
* \author Reto Buerki
* \date 2015-04-14
*/
/*
* Copyright (C) 2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _TIMER_H_
#define _TIMER_H_
#include <base/stdint.h>
namespace Genode
{
/**
* Timer driver for core on Muen
*/
class Timer;
}
class Genode::Timer
{
public:
Timer() { }
static unsigned interrupt_id(int) { return 0; }
inline void start_one_shot(uint32_t const tics, unsigned) { }
uint32_t ms_to_tics(unsigned const ms) { return 0; }
unsigned value(unsigned) { return 0; }
static void disable_pit(void) { }
};
namespace Kernel { class Timer : public Genode::Timer { }; }
#endif /* _TIMER_H_ */

View File

@ -0,0 +1,9 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw \
--include power_on/qemu --include log/qemu --include image/iso