mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-31 14:40:54 +00:00
hw_x86_64: use 'muen' SPEC to implement aspect
This commit is contained in:
parent
750c4ad81d
commit
9f1beaa036
10
repos/base-hw/lib/mk/core-muen.mk
Normal file
10
repos/base-hw/lib/mk/core-muen.mk
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#
|
||||||
|
# \brief Build config for parts of core that depend on Muen status
|
||||||
|
# \author Stefan Kalkowski
|
||||||
|
# \date 2015-06-02
|
||||||
|
#
|
||||||
|
|
||||||
|
REQUIRES = x86_64
|
||||||
|
|
||||||
|
# add library dependencies
|
||||||
|
LIBS += core-muen_off
|
8
repos/base-hw/lib/mk/muen/core-muen.mk
Normal file
8
repos/base-hw/lib/mk/muen/core-muen.mk
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#
|
||||||
|
# \brief Build config for parts of core that depend on Muen status
|
||||||
|
# \author Stefan Kalkowski
|
||||||
|
# \date 2015-06-02
|
||||||
|
#
|
||||||
|
|
||||||
|
# add library dependencies
|
||||||
|
LIBS += core-muen_on
|
@ -10,8 +10,6 @@ INC_DIR += $(REP_DIR)/src/core/include/spec/x86
|
|||||||
|
|
||||||
# add C++ sources
|
# add C++ sources
|
||||||
SRC_CC += spec/x86/platform_support.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/kernel/pd.cc
|
||||||
SRC_CC += spec/x86/cpu.cc
|
SRC_CC += spec/x86/cpu.cc
|
||||||
SRC_CC += spec/x86/bios_data_area.cc
|
SRC_CC += spec/x86/bios_data_area.cc
|
||||||
|
17
repos/base-hw/lib/mk/x86_64/core-muen_off.mk
Normal file
17
repos/base-hw/lib/mk/x86_64/core-muen_off.mk
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#
|
||||||
|
# \brief Build config for Genodes core process
|
||||||
|
# \author Stefan Kalkowski
|
||||||
|
# \date 2015-06-02
|
||||||
|
#
|
||||||
|
|
||||||
|
# add assembly sources
|
||||||
|
SRC_S += spec/x86_64/kernel/crt0_translation_table.s
|
||||||
|
|
||||||
|
# add C++ sources
|
||||||
|
SRC_CC += spec/x86/kernel/thread.cc
|
||||||
|
SRC_CC += spec/x86/kernel/cpu.cc
|
||||||
|
SRC_CC += spec/x86/pic.cc
|
||||||
|
SRC_CC += spec/x86_64/platform_support.cc
|
||||||
|
|
||||||
|
# include less specific configuration
|
||||||
|
include $(REP_DIR)/lib/mk/x86_64/core.inc
|
20
repos/base-hw/lib/mk/x86_64/core-muen_on.mk
Normal file
20
repos/base-hw/lib/mk/x86_64/core-muen_on.mk
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#
|
||||||
|
# \brief Build config for Genodes core process
|
||||||
|
# \author Stefan Kalkowski
|
||||||
|
# \date 2015-06-02
|
||||||
|
#
|
||||||
|
|
||||||
|
# add include paths
|
||||||
|
INC_DIR += $(REP_DIR)/src/core/include/spec/x86_64/muen
|
||||||
|
|
||||||
|
# add assembly sources
|
||||||
|
SRC_S += spec/x86_64/muen/kernel/crt0_translation_table.s
|
||||||
|
|
||||||
|
# add C++ sources
|
||||||
|
SRC_CC += spec/x86_64/muen/kernel/thread.cc
|
||||||
|
SRC_CC += spec/x86_64/muen/kernel/cpu.cc
|
||||||
|
SRC_CC += spec/x86_64/muen/platform_support.cc
|
||||||
|
SRC_CC += spec/x86_64/muen/sinfo.cc
|
||||||
|
|
||||||
|
# include less specific configuration
|
||||||
|
include $(REP_DIR)/lib/mk/x86_64/core.inc
|
22
repos/base-hw/lib/mk/x86_64/core.inc
Normal file
22
repos/base-hw/lib/mk/x86_64/core.inc
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#
|
||||||
|
# \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
|
||||||
|
|
||||||
|
# add assembly sources
|
||||||
|
SRC_S += spec/x86_64/mode_transition.s
|
||||||
|
SRC_S += spec/x86_64/kernel/crt0.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/idt.cc
|
||||||
|
SRC_CC += spec/x86_64/tss.cc
|
||||||
|
|
||||||
|
# include less specific configuration
|
||||||
|
include $(REP_DIR)/lib/mk/x86/core.inc
|
@ -1,25 +1,7 @@
|
|||||||
#
|
#
|
||||||
# \brief Build config for Genodes core process
|
# \brief Build config for Genodes core process
|
||||||
# \author Stefan Kalkowski
|
# \author Stefan Kalkowski
|
||||||
# \author Martin Stein
|
# \date 2015-06-02
|
||||||
# \date 2012-10-04
|
|
||||||
#
|
#
|
||||||
|
|
||||||
# add include paths
|
LIBS += core-muen
|
||||||
INC_DIR += $(REP_DIR)/src/core/include/spec/x86_64
|
|
||||||
|
|
||||||
# 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/pic.cc
|
|
||||||
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
|
|
||||||
|
|
||||||
# include less specific configuration
|
|
||||||
include $(REP_DIR)/lib/mk/x86/core.inc
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
include $(REP_DIR)/lib/mk/base-common.inc
|
|
||||||
|
|
||||||
vpath kernel/interface.cc $(REP_DIR)/src/base/x86_64
|
|
@ -1,35 +0,0 @@
|
|||||||
#
|
|
||||||
# \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_muen/kernel/crt0_translation_table.s
|
|
||||||
SRC_S += spec/x86_64/crt0.s
|
|
||||||
|
|
||||||
# add C++ sources
|
|
||||||
SRC_CC += spec/x86_64_muen/platform_support.cc
|
|
||||||
SRC_CC += spec/x86_64_muen/sinfo.cc
|
|
||||||
SRC_CC += spec/x86_64_muen/kernel/thread.cc
|
|
||||||
SRC_CC += spec/x86_64_muen/kernel/cpu.cc
|
|
||||||
SRC_CC += spec/x86_64/kernel/thread_base.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/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
|
|
@ -1,19 +1,11 @@
|
|||||||
#
|
#
|
||||||
# \brief Build configs that are specific to base-hw/x86_64 on the Muen SK
|
# \brief Build configs that are specific to base-hw/x86_64 on the Muen SK
|
||||||
# \author Martin Stein
|
# \author Reto Buerki
|
||||||
# \date 2011-12-20
|
# \date 2015-04-14
|
||||||
#
|
#
|
||||||
|
|
||||||
# denote wich specs are also fullfilled by this spec
|
# denote wich specs are also fullfilled by this spec
|
||||||
SPECS += hw x86_64_muen
|
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 implied specs
|
||||||
include $(call select_from_repositories,mk/spec-hw.mk)
|
include $(call select_from_repositories,mk/spec-hw_x86_64.mk)
|
||||||
include $(call select_from_repositories,mk/spec-x86_64.mk)
|
|
||||||
|
@ -30,13 +30,14 @@ Cpu_idle::Cpu_idle(Cpu * const cpu) : Cpu_job(Cpu_priority::MIN, 0)
|
|||||||
|
|
||||||
void Cpu_idle::exception(unsigned const cpu)
|
void Cpu_idle::exception(unsigned const cpu)
|
||||||
{
|
{
|
||||||
if (trapno == RESET) {
|
if (trapno == RESET) return;
|
||||||
return;
|
|
||||||
} else if (trapno >= INTERRUPTS_START && trapno <= INTERRUPTS_END) {
|
if (trapno >= INTERRUPTS_START && trapno <= INTERRUPTS_END) {
|
||||||
pic()->irq_occurred(trapno);
|
pic()->irq_occurred(trapno);
|
||||||
_interrupt(cpu);
|
_interrupt(cpu);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PWRN("Unknown exception %lu with error code %lu at ip=%p", trapno,
|
PWRN("Unknown exception %lu with error code %lu at ip=%p", trapno,
|
||||||
errcode, (void *)ip);
|
errcode, (void *)ip);
|
||||||
assert(0);
|
assert(0);
|
@ -24,6 +24,7 @@ enum {
|
|||||||
static const subject_info_type *
|
static const subject_info_type *
|
||||||
const sinfo = ((subject_info_type *)SINFO_BASE_ADDR);
|
const sinfo = ((subject_info_type *)SINFO_BASE_ADDR);
|
||||||
|
|
||||||
|
|
||||||
/* Log channel information */
|
/* Log channel information */
|
||||||
static bool log_channel(
|
static bool log_channel(
|
||||||
const struct Genode::Sinfo::Channel_info * const channel,
|
const struct Genode::Sinfo::Channel_info * const channel,
|
||||||
@ -45,6 +46,7 @@ static bool log_channel(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Log memory region information */
|
/* Log memory region information */
|
||||||
static bool log_memregion(
|
static bool log_memregion(
|
||||||
const struct Genode::Sinfo::Memregion_info * const region,
|
const struct Genode::Sinfo::Memregion_info * const region,
|
||||||
@ -57,9 +59,9 @@ static bool log_memregion(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Fill channel struct with channel information from resource given by index */
|
/* Fill channel struct with channel information from resource given by index */
|
||||||
static void fill_channel_data(
|
static void fill_channel_data(uint8_t idx,
|
||||||
uint8_t idx,
|
|
||||||
struct Genode::Sinfo::Channel_info *channel)
|
struct Genode::Sinfo::Channel_info *channel)
|
||||||
{
|
{
|
||||||
const struct resource_type resource = sinfo->resources[idx];
|
const struct resource_type resource = sinfo->resources[idx];
|
||||||
@ -81,9 +83,9 @@ static void fill_channel_data(
|
|||||||
channel->vector = channel_info.vector;
|
channel->vector = channel_info.vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Fill memregion struct with memory region info from resource given by index */
|
/* Fill memregion struct with memory region info from resource given by index */
|
||||||
static void fill_memregion_data(
|
static void fill_memregion_data(uint8_t idx,
|
||||||
uint8_t idx,
|
|
||||||
struct Genode::Sinfo::Memregion_info *region)
|
struct Genode::Sinfo::Memregion_info *region)
|
||||||
{
|
{
|
||||||
const struct resource_type resource = sinfo->resources[idx];
|
const struct resource_type resource = sinfo->resources[idx];
|
||||||
@ -99,18 +101,21 @@ static void fill_memregion_data(
|
|||||||
region->executable = memregion.flags & MEM_EXECUTABLE_FLAG;
|
region->executable = memregion.flags & MEM_EXECUTABLE_FLAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Returns true if the given resource is a memory region */
|
/* Returns true if the given resource is a memory region */
|
||||||
static bool is_memregion(const struct resource_type * const resource)
|
static bool is_memregion(const struct resource_type * const resource)
|
||||||
{
|
{
|
||||||
return resource->memregion_idx != NO_RESOURCE;
|
return resource->memregion_idx != NO_RESOURCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Returns true if the given resource is a channel */
|
/* Returns true if the given resource is a channel */
|
||||||
static bool is_channel(const struct resource_type * const resource)
|
static bool is_channel(const struct resource_type * const resource)
|
||||||
{
|
{
|
||||||
return is_memregion(resource) && resource->channel_info_idx != NO_RESOURCE;
|
return is_memregion(resource) && resource->channel_info_idx != NO_RESOURCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Sinfo::Sinfo()
|
Sinfo::Sinfo()
|
||||||
{
|
{
|
||||||
if (!check_magic()) {
|
if (!check_magic()) {
|
||||||
@ -126,11 +131,13 @@ Sinfo::Sinfo()
|
|||||||
for_each_channel(log_channel, 0);
|
for_each_channel(log_channel, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Sinfo::check_magic(void)
|
bool Sinfo::check_magic(void)
|
||||||
{
|
{
|
||||||
return sinfo != 0 && sinfo->magic == MUEN_SUBJECT_INFO_MAGIC;
|
return sinfo != 0 && sinfo->magic == MUEN_SUBJECT_INFO_MAGIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Sinfo::get_channel_info(const char * const name,
|
bool Sinfo::get_channel_info(const char * const name,
|
||||||
struct Channel_info *channel)
|
struct Channel_info *channel)
|
||||||
{
|
{
|
||||||
@ -149,6 +156,7 @@ bool Sinfo::get_channel_info(const char * const name,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Sinfo::get_memregion_info(const char * const name,
|
bool Sinfo::get_memregion_info(const char * const name,
|
||||||
struct Memregion_info *memregion)
|
struct Memregion_info *memregion)
|
||||||
{
|
{
|
||||||
@ -167,6 +175,7 @@ bool Sinfo::get_memregion_info(const char * const name,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Sinfo::for_each_channel(Channel_cb func, void *data)
|
bool Sinfo::for_each_channel(Channel_cb func, void *data)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -185,6 +194,7 @@ bool Sinfo::for_each_channel(Channel_cb func, void *data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Sinfo::for_each_memregion(Memregion_cb func, void *data)
|
bool Sinfo::for_each_memregion(Memregion_cb func, void *data)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -203,6 +213,7 @@ bool Sinfo::for_each_memregion(Memregion_cb func, void *data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint64_t Sinfo::get_tsc_khz(void)
|
uint64_t Sinfo::get_tsc_khz(void)
|
||||||
{
|
{
|
||||||
if (!check_magic())
|
if (!check_magic())
|
||||||
@ -211,6 +222,7 @@ uint64_t Sinfo::get_tsc_khz(void)
|
|||||||
return sinfo->tsc_khz;
|
return sinfo->tsc_khz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint64_t Sinfo::get_sched_start(void)
|
uint64_t Sinfo::get_sched_start(void)
|
||||||
{
|
{
|
||||||
if (!check_magic())
|
if (!check_magic())
|
||||||
@ -219,6 +231,7 @@ uint64_t Sinfo::get_sched_start(void)
|
|||||||
return sinfo->tsc_schedule_start;
|
return sinfo->tsc_schedule_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint64_t Sinfo::get_sched_end(void)
|
uint64_t Sinfo::get_sched_end(void)
|
||||||
{
|
{
|
||||||
if (!check_magic())
|
if (!check_magic())
|
@ -146,13 +146,13 @@ proc run_boot_dir {binaries} {
|
|||||||
set elf_img "[run_dir]/image.elf"
|
set elf_img "[run_dir]/image.elf"
|
||||||
|
|
||||||
# Use raw binary object for base-hw on Muen
|
# Use raw binary object for base-hw on Muen
|
||||||
if {[have_spec "hw_x86_64_muen"]} {
|
if {[have_spec "muen"]} {
|
||||||
set raw_img "[run_dir]/image.raw"
|
set raw_img "[run_dir]/image.raw"
|
||||||
exec [cross_dev_prefix]objcopy -O binary bin/$core_bin $raw_img
|
exec [cross_dev_prefix]objcopy -O binary bin/$core_bin $raw_img
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if {[have_spec "x86_64"]} {
|
if {[have_spec "x86_64"] && ![have_spec "muen"]} {
|
||||||
# as startup is done in 32 bit mode, GRUB expects a 32 bit image
|
# as startup is done in 32 bit mode, GRUB expects a 32 bit image
|
||||||
exec [cross_dev_prefix]objcopy -O elf32-i386 bin/$core_bin $elf_img
|
exec [cross_dev_prefix]objcopy -O elf32-i386 bin/$core_bin $elf_img
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user