base: use BDA header in base-nova like base-hw

Moves the Bios Data Area header from base-hw to base. Modifies the
base-nova core console that it uses the header as replacement for
the previous BDA bit logic.

Ref #1625
This commit is contained in:
Martin Stein
2015-07-10 19:58:30 +02:00
committed by Norman Feske
parent c6f73d365a
commit f3e76b3e9a
7 changed files with 109 additions and 78 deletions

View File

@ -14,56 +14,10 @@
#pragma once
/* Genode includes */
#include <bios_data_area.h>
#include <drivers/uart/x86_uart_base.h>
#include <util/mmio.h>
#include <unmanaged_singleton.h>
namespace Genode
{
enum { BDA_MMIO_BASE_VIRT = 0x1ff000 };
class Bios_data_area;
class Serial;
Bios_data_area * bda();
}
class Genode::Bios_data_area : Mmio
{
friend Unmanaged_singleton_constructor;
private:
struct Serial_base_com1 : Register<0x400, 16> { };
struct Equipment : Register<0x410, 16>
{
struct Serial_count : Bitfield<9, 3> { };
};
/*
* Constructor
*
* The BDA page must be mapped already (see crt0_translation_table.s).
*/
Bios_data_area() : Mmio(BDA_MMIO_BASE_VIRT) { }
public:
/**
* Obtain I/O ports of COM interfaces from BDA
*/
addr_t serial_port() const
{
Equipment::access_t count = read<Equipment::Serial_count>();
return count ? read<Serial_base_com1>() : 0;
}
/**
* Return BDA singleton
*/
static Bios_data_area * singleton() {
return unmanaged_singleton<Bios_data_area>(); }
};
namespace Genode { class Serial; }
/**
* Serial output driver for core

View File

@ -0,0 +1,19 @@
/*
* \brief Structure of the Bios Data Area after preparation through Bender
* \author Martin Stein
* \date 2015-07-10
*/
/*
* 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.
*/
/* core includes */
#include <bios_data_area.h>
using namespace Genode;
addr_t Bios_data_area::_mmio_base_virt() { return 0x1ff000; }