1 /* tag: openbios qt plugin skeleton
3 * Copyright (C) 2003 Stefan Reinauer
5 * See the file "COPYING" for further information about
6 * the copyright and warranty status of this work.
13 #include "unix/plugins.h"
14 #include "unix/plugin_pci.h"
16 #include "plugin_qt.h"
17 #include "pciconfig.h"
22 volatile unsigned char * fb=0;
23 volatile int gui_running=0;
30 void *gui_thread(void *ptr)
32 threaddata *td=(threaddata *)ptr;
34 QApplication a(td->argc, td->argv);
40 fb=w.getFrameBuffer();
50 extern int plugin_qt_init(void);
51 int plugin_qt_init(void)
54 char *args[]={ "plugin_qt" };
55 threaddata mytd = { 1, args };
58 printf("Initializing \"framebuffer\" plugin...");
60 pthread_create(&mythread, NULL, gui_thread, &mytd);
64 /* now we have the framebuffer start address.
65 * updating pci config space to reflect this
68 *(u32 *)(pci_config_space+0x14)=(u32)((unsigned long)fb>>32);
70 *(u32 *)(pci_config_space+0x14)=0;
72 *(u32 *)(pci_config_space+0x10)=(u32)((unsigned long)fb&0xffffffff);
74 /* next is to write the rom address. We write that at a random
75 * address in pci config space for now.
78 *(u32 *)(pci_config_space+0x34)=(u32)((unsigned long)qt_fcode>>32);
80 *(u32 *)(pci_config_space+0x34)=0;
82 *(u32 *)(pci_config_space+0x30)=(u32)((unsigned long)qt_fcode&0xffffffff);
84 /* FIXME: we need to put the fcode image for this
85 * device to the rom resource, once it exists
88 /* register pci device to be available to beginagain */
89 pci_register_device(0, 2, 0, pci_config_space);
97 PLUGIN_AUTHOR("Stefan Reinauer <stepan@openbios.org>")
98 PLUGIN_DESCRIPTION("QT gui plugin emulating framebuffer device")
99 PLUGIN_LICENSE("GPL v2")
100 PLUGIN_DEPENDENCIES("pci")