Framebuffer support on the Intel Mac
PATCH 1/1 Framebuffer support on the Intel Mac
Hi,
When booting the Intel Mac in non-legacy mode (EFI), it doesn't support textmode. In order to get a console in Xen, I have written a framebuffer for the Intel Mac. At the moment it was only tested on the MacBook. Because a framebuffer is capable of showing more than just text, I have added the Xen logo at startup. I made a photo last week, although this was while I was hacking it and this was under xen-testing. But it should give you an impression of what it looks like. See the end of the email for the URLs.
The patch tests for PCIIDs when VGA support is not available. Only in the case the right device was found, the framebuffer will be used. I hope the code I am using to do this works on all machines and will not break Xen on any other machine.
This is the first patch I send in. If there are problems with the way I am submitting this patch, with the style or with the way it works, please tell me so I can improve the patch.
Thanks,
Marco
http://www.xs4all.nl/~mgerards/xenfb_macbook1.jpg
http://www.xs4all.nl/~mgerards/xenfb_macbook2.jpg
xen/drivers/video/Makefile +1 -0
@@ -2,3 +2,4 @@ obj-y += font_8x16.o obj-y += font_8x8.o obj-y += vga.o +obj-y += imacfb.o
xen/drivers/video/vga.c +26 -8
@@ -14,6 +14,7 @@#include <xen/spinlock.h> #include <xen/console.h> #include <xen/vga.h> +#include <xen/imacfb.h> #include <asm/io.h> #include "font.h"
@@ -345,6 +346,14 @@if (memory_is_conventional_ram (0xB8000 ) ) goto no_vga; + video =ioremap (0xB8000 ,0x8000 ); + +if ( !detect_video (video) ) + { +iounmap (video); + goto no_vga; + } +inb (VGA_IS1_RC );outb (0x00 ,VGA_ATT_IW );
@@ -366,14 +375,6 @@inb (VGA_IS1_RC );outb (0x20 ,VGA_ATT_IW ); - - video =ioremap (0xB8000 ,0x8000 ); - -if ( !detect_video (video) ) - { -iounmap (video); - goto no_vga; - }return video;
@@ -558,6 +559,7 @@static int vgacon_enabled =0 ;static int vgacon_keep =0 ;static int vgacon_lines =25 ; +static int imacfb_enabled =0 ;static const struct font_desc *font;static int xpos, ypos;
@@ -589,7 +591,11 @@ video =setup_vga ();if ( !video ) + { +if (console_imacfb_init () ) + imacfb_enabled =1 ;return ; + }switch ( vgacon_lines ) {
@@ -656,6 +662,12 @@void vga_putchar (int c) { +if ( imacfb_enabled ) + { +console_imacfb_putc (c); +return ; + } +if ( !vgacon_enabled )return ;
@@ -677,6 +689,12 @@ {memset (ci,0 ,sizeof (*ci)); +if ( imacfb_enabled ) + { +console_imacfb_info ( ci ); +return 1 ; + } +if ( !vgacon_enabled )return 0 ;
xen/drivers/video/imacfb.c new file +214 -0
214 lines not on this page · raw message
xen/drivers/video/xenlogo.c new file +5803 -0
2,705 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Part of the diff is not shown here. View the raw message.
Marco Gerards <[email protected]> writes:
Hi,
Quoted 8 lines
When booting the Intel Mac in non-legacy mode (EFI), it doesn't support textmode. In order to get a console in Xen, I have written a framebuffer for the Intel Mac. At the moment it was only tested on the MacBook. Because a framebuffer is capable of showing more than just text, I have added the Xen logo at startup. I made a photo last week, although this was while I was hacking it and this was under xen-testing. But it should give you an impression of what it looks like. See the end of the email for the URLs.
Something I forgot to mention is that I was unable to use ioremap to map in the video memory. But the memory was already mapped to the virtual memory address that matches the physical address.
To be honest, I do not know (yet) why ioremap doesn't work in this case and why directly accessing the memory does work. I am wondering if this will cause problems at a later stage, Xen does not boot all the way yet because there other other things I have to change before Xen will work properly with EFI.
--
Marco