From 3b316b0603ff8910e556da2cb440cc5fe5082dc7 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Sun, 2 Dec 2012 22:41:40 -0800 Subject: [PATCH] add some indication of video driver status --- kernel/video/lfb.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/kernel/video/lfb.c b/kernel/video/lfb.c index cee009d3..af676818 100644 --- a/kernel/video/lfb.c +++ b/kernel/video/lfb.c @@ -108,6 +108,12 @@ void graphics_install_preset(uint16_t w, uint16_t h) { /* XXX: Massive hack */ uint32_t * herp = (uint32_t *)0xA0000; herp[0] = 0xA5ADFACE; + herp[1] = 0xFAF42943; + + for (int i = 2; i < 1000; i += 2) { + herp[i] = 0xFF00FF00; + herp[i+1] = 0x00FF00FF; + } for (uintptr_t fb_offset = 0xE0000000; fb_offset < 0xFF000000; fb_offset += 0x01000000) { /* Enable the higher memory */ @@ -117,13 +123,18 @@ void graphics_install_preset(uint16_t w, uint16_t h) { /* Go find it */ for (uintptr_t x = fb_offset; x < fb_offset + 0xFF0000; x += 0x1000) { - if (((uintptr_t *)x)[0] == 0xA5ADFACE) { + if (((uintptr_t *)x)[0] == 0xA5ADFACE && ((uintptr_t *)x)[1] == 0xFAF42943) { lfb_vid_memory = (uint8_t *)x; goto mem_found; } } } + for (int i = 2; i < 1000; i += 2) { + herp[i] = 0xFF00FF00; + herp[i+1] = 0xFF00FF00; + } + debug_print(WARNING, "Failed to locate video memory. This could end poorly."); mem_found: