parent
411601ebd1
commit
bf3c57511b
|
@ -1 +1 @@
|
||||||
52c29b12c6e2a4c5eb31134cbbe7d01b1e98153b
|
beda4ca63712ef3aa5f6ea93d40f5fd7987e52be
|
||||||
|
|
|
@ -4,7 +4,7 @@ DOWNLOADS := nova.git
|
||||||
|
|
||||||
# r9 branch - use r9_debug for more verbose kernel messages
|
# r9 branch - use r9_debug for more verbose kernel messages
|
||||||
URL(nova) := https://github.com/alex-ab/NOVA.git
|
URL(nova) := https://github.com/alex-ab/NOVA.git
|
||||||
REV(nova) := 57b3c869a24fbe8e70f1b53e0cca23966ba89839
|
REV(nova) := 79b73ffef40009c384c542c9033d737408c4b1df
|
||||||
DIR(nova) := src/kernel/nova
|
DIR(nova) := src/kernel/nova
|
||||||
|
|
||||||
PATCHES := $(sort $(wildcard $(REP_DIR)/patches/*.patch))
|
PATCHES := $(sort $(wildcard $(REP_DIR)/patches/*.patch))
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
/* Genode includes */
|
/* Genode includes */
|
||||||
#include <base/sleep.h>
|
#include <base/sleep.h>
|
||||||
#include <base/thread.h>
|
#include <base/thread.h>
|
||||||
|
#include <util/mmio.h>
|
||||||
#include <util/string.h>
|
#include <util/string.h>
|
||||||
#include <util/xml_generator.h>
|
#include <util/xml_generator.h>
|
||||||
#include <trace/source_registry.h>
|
#include <trace/source_registry.h>
|
||||||
|
@ -256,6 +257,14 @@ static bool cpuid_invariant_tsc()
|
||||||
return edx & 0x100;
|
return edx & 0x100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* boot framebuffer resolution */
|
||||||
|
struct Resolution : Register<64>
|
||||||
|
{
|
||||||
|
struct Bpp : Bitfield<0, 8> { };
|
||||||
|
struct Type : Bitfield<8, 8> { };
|
||||||
|
struct Height : Bitfield<16, 24> { };
|
||||||
|
struct Width : Bitfield<40, 24> { };
|
||||||
|
};
|
||||||
|
|
||||||
/**************
|
/**************
|
||||||
** Platform **
|
** Platform **
|
||||||
|
@ -474,36 +483,15 @@ Platform::Platform() :
|
||||||
_io_mem_alloc.add_range(0, ~0xfffUL);
|
_io_mem_alloc.add_range(0, ~0xfffUL);
|
||||||
Hip::Mem_desc *mem_desc = (Hip::Mem_desc *)mem_desc_base;
|
Hip::Mem_desc *mem_desc = (Hip::Mem_desc *)mem_desc_base;
|
||||||
|
|
||||||
struct mbfb_t {
|
Hip::Mem_desc *boot_fb = nullptr;
|
||||||
uint64_t addr = 0;
|
|
||||||
union {
|
|
||||||
uint64_t size;
|
|
||||||
struct {
|
|
||||||
uint32_t height;
|
|
||||||
uint32_t width;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
union {
|
|
||||||
uint32_t aux;
|
|
||||||
struct {
|
|
||||||
uint8_t bpp;
|
|
||||||
uint8_t type;
|
|
||||||
uint8_t reserved[2];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
} mbi_fb;
|
|
||||||
memset(&mbi_fb, 0, sizeof(mbi_fb));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* All "available" ram must be added to our physical allocator before all
|
* All "available" ram must be added to our physical allocator before all
|
||||||
* non "available" regions that overlaps with ram get removed.
|
* non "available" regions that overlaps with ram get removed.
|
||||||
*/
|
*/
|
||||||
for (unsigned i = 0; i < num_mem_desc; i++, mem_desc++) {
|
for (unsigned i = 0; i < num_mem_desc; i++, mem_desc++) {
|
||||||
if (mem_desc->type == Hip::Mem_desc::FRAMEBUFFER) {
|
if (mem_desc->type == Hip::Mem_desc::FRAMEBUFFER)
|
||||||
mbi_fb.addr = mem_desc->addr;
|
boot_fb = mem_desc;
|
||||||
mbi_fb.size = mem_desc->size;
|
|
||||||
mbi_fb.aux = mem_desc->aux;
|
|
||||||
}
|
|
||||||
if (mem_desc->type != Hip::Mem_desc::AVAILABLE_MEMORY) continue;
|
if (mem_desc->type != Hip::Mem_desc::AVAILABLE_MEMORY) continue;
|
||||||
|
|
||||||
if (verbose_boot_info) {
|
if (verbose_boot_info) {
|
||||||
|
@ -551,10 +539,10 @@ Platform::Platform() :
|
||||||
|
|
||||||
/* remove framebuffer from available memory */
|
/* remove framebuffer from available memory */
|
||||||
if (mem_desc->type == Hip::Mem_desc::FRAMEBUFFER) {
|
if (mem_desc->type == Hip::Mem_desc::FRAMEBUFFER) {
|
||||||
/* align width to 16 byte size */
|
uint32_t const height = Resolution::Height::get(mem_desc->size);
|
||||||
addr_t const width = (mbi_fb.width + 16 - 1) & ~0xful;
|
uint32_t const pitch = mem_desc->aux;
|
||||||
/* calculate size of framebuffer */
|
/* calculate size of framebuffer */
|
||||||
size = width * mbi_fb.height * mbi_fb.bpp / 4;
|
size = pitch * height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* truncate size if base+size larger then natural 32/64 bit boundary */
|
/* truncate size if base+size larger then natural 32/64 bit boundary */
|
||||||
|
@ -635,11 +623,6 @@ Platform::Platform() :
|
||||||
for (unsigned i = 0; i < num_mem_desc; i++, mem_desc++) {
|
for (unsigned i = 0; i < num_mem_desc; i++, mem_desc++) {
|
||||||
if (mem_desc->type == Hip::Mem_desc::ACPI_RSDT) rsdt = mem_desc->addr;
|
if (mem_desc->type == Hip::Mem_desc::ACPI_RSDT) rsdt = mem_desc->addr;
|
||||||
if (mem_desc->type == Hip::Mem_desc::ACPI_XSDT) xsdt = mem_desc->addr;
|
if (mem_desc->type == Hip::Mem_desc::ACPI_XSDT) xsdt = mem_desc->addr;
|
||||||
if (mem_desc->type == Hip::Mem_desc::FRAMEBUFFER) {
|
|
||||||
mbi_fb.addr = mem_desc->addr;
|
|
||||||
mbi_fb.size = mem_desc->size;
|
|
||||||
mbi_fb.aux = mem_desc->aux;
|
|
||||||
}
|
|
||||||
if (mem_desc->type != Hip::Mem_desc::MULTIBOOT_MODULE) continue;
|
if (mem_desc->type != Hip::Mem_desc::MULTIBOOT_MODULE) continue;
|
||||||
if (!mem_desc->addr || !mem_desc->size) continue;
|
if (!mem_desc->addr || !mem_desc->size) continue;
|
||||||
|
|
||||||
|
@ -674,14 +657,17 @@ Platform::Platform() :
|
||||||
xml.attribute("xsdt", String<32>(Hex(xsdt)));
|
xml.attribute("xsdt", String<32>(Hex(xsdt)));
|
||||||
});
|
});
|
||||||
xml.node("boot", [&] () {
|
xml.node("boot", [&] () {
|
||||||
if (mbi_fb.addr) {
|
if (!boot_fb)
|
||||||
xml.node("framebuffer", [&] () {
|
return;
|
||||||
xml.attribute("phys", String<32>(Hex(mbi_fb.addr)));
|
|
||||||
xml.attribute("width", mbi_fb.width);
|
xml.node("framebuffer", [&] () {
|
||||||
xml.attribute("height", mbi_fb.height);
|
xml.attribute("phys", String<32>(Hex(boot_fb->addr)));
|
||||||
xml.attribute("bpp", mbi_fb.bpp);
|
xml.attribute("width", Resolution::Width::get(boot_fb->size));
|
||||||
});
|
xml.attribute("height", Resolution::Height::get(boot_fb->size));
|
||||||
}
|
xml.attribute("bpp", Resolution::Bpp::get(boot_fb->size));
|
||||||
|
xml.attribute("type", Resolution::Type::get(boot_fb->size));
|
||||||
|
xml.attribute("pitch", boot_fb->aux);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue