diff options
Diffstat (limited to 'roms/openbios/arch/unix')
30 files changed, 2752 insertions, 0 deletions
diff --git a/roms/openbios/arch/unix/Kconfig b/roms/openbios/arch/unix/Kconfig new file mode 100644 index 00000000..8faafc0a --- /dev/null +++ b/roms/openbios/arch/unix/Kconfig @@ -0,0 +1,18 @@ + +config HOST_UNIX +	bool "Build Hosted Unix binary" +	default y +	help +	  Build a version of the OpenBIOS kernel that runs in a  +	  Unix-like operating system. + +config UNIX_QT +	depends HOST_UNIX +	bool "QT frontend for Unix binary" +	default n +	help +	  Enable this option if you wish to add a graphical user  +	  interface to the openbios hosted unix binary. This option +	  needs the QT library installed. + +source "arch/unix/plugins/Kconfig" diff --git a/roms/openbios/arch/unix/Makefile b/roms/openbios/arch/unix/Makefile new file mode 100644 index 00000000..a8c6565e --- /dev/null +++ b/roms/openbios/arch/unix/Makefile @@ -0,0 +1,29 @@ +#  + +include			../../config/Makefile.top + +SUBDIRS-$(CONFIG_PLUGINS)	= plugins +SUBDIRS-$(CONFIG_UNIX_QT)	= gui_qt + +DICTIONARIES		= unix +unix-SRC		= tree.fs $(ARCHDICT_SRC) + +PROGRAMS		= unix + +unix-OBJS               = $(unix-y) +unix-y			+= blk.o  +unix-y			+= boot.o  +unix-y			+= unix.o  +unix-y			+= $(KOBJS)  +unix-y			+= $(MODULE_LIBS) $(FS_LIBS) $(DRIVER_LIBS) $(LIBC_LIBS) +unix-$(CONFIG_PLUGINS)  += plugins.o  + +unix-LDFLAGS		= $(unix-LDFLAGS-$(CONFIG_PLUGINS)) +unix-LDFLAGS-y		= -rdynamic $(LIBDL_LDFLAGS) +unix-LDFLAGS-n		=  +unix-LDADD		=  + +INCLUDES		= -I../../kernel -I../../kernel/include -DBOOTSTRAP + +include			$(rules)/Rules.forth +include			$(rules)/Rules.make diff --git a/roms/openbios/arch/unix/blk.c b/roms/openbios/arch/unix/blk.c new file mode 100644 index 00000000..d0f5c6a4 --- /dev/null +++ b/roms/openbios/arch/unix/blk.c @@ -0,0 +1,115 @@ +/* + *  <arch/unix/blk.c> + * + *	block device emulation for unix hosts + * + *   Copyright (C) 2004 Stefan Reinauer <stepan@openbios.org> + * + *   This program is free software; you can redistribute it and/or + *   modify it under the terms of the GNU General Public License + *   version 2 + * + */ + +#include "config.h" +#include "libopenbios/bindings.h" +#include "blk.h" + +typedef struct { +	int	unit; +	int	channel; +} blk_data_t; + + +DECLARE_NODE( blk, INSTALL_OPEN, sizeof(blk_data_t), "+/unix/block/disk" ); + +static void +blk_open( blk_data_t *pb ) +{ +	phandle_t ph; + +	fword("my-unit"); + +	pb->unit = POP(); +	pb->channel = 0;	/* FIXME */ + +	selfword("open-deblocker"); + +	/* interpose disk-label */ +	ph = find_dev("/packages/disk-label"); +	fword("my-args"); +	PUSH_ph( ph ); +	fword("interpose"); + +	/* printk("osi-blk: open %d\n", pb->unit ); */ + +	PUSH( -1 ); +} + +static void +blk_close( __attribute__((unused)) blk_data_t *pb ) +{ +	selfword("close-deblocker"); +} + + +/* ( buf blk nblks -- actual ) */ +static void +blk_read_blocks( blk_data_t *pb ) +{ +	cell i, n = POP(); +	cell blk = POP(); +	char *dest = (char*)POP(); + +	// printk("blk_read_blocks %x block=%d n=%d\n", (ucell)dest, blk, n ); + +	for( i=0; i<n; ) { +		char buf[4096]; +		ucell m = MIN( n-i, sizeof(buf)/512 ); + +		if( read_from_disk(pb->channel, pb->unit, blk+i, (ucell)buf, m*512) < 0 ) { +			printk("read_from_disk: error\n"); +			RET(0); +		} +		memcpy( dest, buf, m * 512 ); +		i += m; +		dest += m * 512; +	} +	PUSH( n ); +} + +/* ( -- bs ) */ +static void +blk_block_size( __attribute__((unused)) blk_data_t *pb ) +{ +	PUSH( 512 ); +} + +/* ( -- maxbytes ) */ +static void +blk_max_transfer( __attribute__((unused)) blk_data_t *pb ) +{ +	PUSH( 1024*1024 ); +} + +static void +blk_initialize( __attribute__((unused)) blk_data_t *pb ) +{ +	fword("is-deblocker"); +} + + +NODE_METHODS( blk ) = { +	{ NULL,			blk_initialize	}, +	{ "open",		blk_open	}, +	{ "close",		blk_close	}, +	{ "read-blocks",	blk_read_blocks	}, +	{ "block-size",		blk_block_size	}, +	{ "max-transfer",	blk_max_transfer}, +}; + +void +blk_init( void ) +{ +	REGISTER_NODE( blk ); +} diff --git a/roms/openbios/arch/unix/blk.h b/roms/openbios/arch/unix/blk.h new file mode 100644 index 00000000..aa3b9656 --- /dev/null +++ b/roms/openbios/arch/unix/blk.h @@ -0,0 +1,8 @@ + +#ifndef _H_BLK +#define _H_BLK + +extern void 	blk_init( void ); +extern int	read_from_disk( int channel, int unit, int blk, unsigned long mphys, int size ); + +#endif   /* _H_BLK */ diff --git a/roms/openbios/arch/unix/boot.c b/roms/openbios/arch/unix/boot.c new file mode 100644 index 00000000..f4a29428 --- /dev/null +++ b/roms/openbios/arch/unix/boot.c @@ -0,0 +1,84 @@ +/* + * + */ +#undef BOOTSTRAP +#include "config.h" +#include "libopenbios/bindings.h" +#include "libopenbios/elf_load.h" +#include "arch/common/nvram.h" +#include "libc/diskio.h" + +void boot(void); +void *load_elf(char *spec); + +void +*load_elf(char *spec) +{ +#if 0 +	int fd; +	void *entry=NULL; +	int i, lszz_offs, elf_offs; +	char buf[128]; // , *addr; +	Elf_ehdr ehdr; +	Elf_phdr *phdr; +	size_t s; + +	if( (fd=open_io(spec)) == -1 ) +		return NULL; + +	if( (elf_offs=find_elf(fd)) < 0 ) { +		printk("----> %s is not an ELF image\n", buf ); +		return NULL; +	} + +	if( !(phdr=elf_readhdrs(fd, 0, &ehdr)) ) { +		printk("elf32_readhdrs failed\n"); +		return NULL; +	} + +	(unsigned long long *)entry = ehdr.e_entry; + +	lszz_offs = elf_offs; +	for( i=0; i<ehdr.e_phnum; i++ ) { +		s = MIN( phdr[i].p_filesz, phdr[i].p_memsz ); +		seek_io( fd, elf_offs + phdr[i].p_offset ); +		/* printk("filesz: %08lX memsz: %08lX p_offset: %08lX p_vaddr %08lX\n", +		   phdr[i].p_filesz, phdr[i].p_memsz, phdr[i].p_offset, +		   phdr[i].p_vaddr ); */ +		if( phdr[i].p_vaddr != phdr[i].p_paddr ) +			printk("WARNING: ELF segment virtual addr != physical addr\n"); +		lszz_offs = MAX( lszz_offs, elf_offs + phdr[i].p_offset + phdr[i].p_filesz ); +		if( !s ) +			continue; + +		 printk("ELF ROM-section loaded at %08lX (size %08lX)\n", +				 (unsigned long)phdr[i].p_vaddr, (unsigned long)phdr[i].p_memsz); +	} +	free( phdr ); +	return entry; +#else +	return NULL; +#endif +} + +void +boot( void ) +{ +	char *path; +	void *entry; + +        /* Copy the incoming path */ +        fword("2dup"); +        path = pop_fstr_copy(); + +	if(!path) { +		printk("[unix] Booting default not supported.\n"); +		return; +	} +	printk("[unix] Booting '%s'\n",path); +	entry=load_elf(path); +	if(entry) +                printk("successfully loaded client at %llx.\n", (unsigned long long)(ucell)entry); +	else +		printk("failed.\n"); +} diff --git a/roms/openbios/arch/unix/build.xml b/roms/openbios/arch/unix/build.xml new file mode 100644 index 00000000..bc0cf9e7 --- /dev/null +++ b/roms/openbios/arch/unix/build.xml @@ -0,0 +1,23 @@ +<build condition="HOST_UNIX"> + + <dictionary name="openbios-unix" init="openbios" target="forth"> +  <object source="tree.fs"/> + </dictionary> + + <executable name="openbios-unix" target="target"> +  <rule> +	$(call quiet-command,$(CC) $(CFLAGS) -rdynamic $(LIBDL_LDFLAGS) -o $@ $^,"  LINK  $(TARGET_DIR)$@") +  </rule> +  <object source="unix.c" flags="-DBOOTSTRAP"/> +  <object source="boot.c" flags="-DBOOTSTRAP"/> +  <object source="blk.c"  flags="-DBOOTSTRAP"/> +  <object source="plugins.c" flags="-DBOOTSTRAP" condition="PLUGINS"/> +  <external-object source="libbootstrap.a"/> +  <external-object source="libpackages.a"/> +  <external-object source="libopenbios.a"/> +  <external-object source="libdrivers.a"/> +  <external-object source="libfs.a"/> +  <external-object source="liblibc.a"/> + </executable> + +</build> diff --git a/roms/openbios/arch/unix/gui_qt/Makefile b/roms/openbios/arch/unix/gui_qt/Makefile new file mode 100644 index 00000000..20eb1580 --- /dev/null +++ b/roms/openbios/arch/unix/gui_qt/Makefile @@ -0,0 +1,42 @@ +# +# Makefile of QT user interface for OpenBIOS +#  +#  (C) 2004 Stefan Reinauer <stepan@openbios.org> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# version 2 +#    + +include		../../../config/Makefile.top + +XTARGETS                = qt + +qt-OBJS                 = $(obj-y) +obj-y                   += gui_qt.o + +QMAKE		= qmake +UIDIR	= $(shell pwd ) +TOPDIR		= $(shell cd $(top_srcdir) ; pwd) +ABSOINC		= $(shell cd $(ARCHINCLUDES) 2> /dev/null ; pwd ) + +export UIDIR TOPDIR ABSOINC + +$(ODIR)/makefile.qmake: gui-qt.pro Makefile +	@echo "ODIR: $(ODIR)" +	@test -d $(ODIR) || $(INSTALL) -d $(ODIR) +	@test -d $(ODIR)/qbuild || $(INSTALL) -d $(ODIR)/qbuild +	@install -m 644 gui-qt.pro $(ODIR)/ +	cd $(ODIR) ; $(QMAKE) -o makefile.qmake + +$(ODIR)/libgui_qt.a: $(ODIR)/makefile.qmake $(wildcard *.cpp) +	cd $(ODIR) ; $(MAKE) -f makefile.qmake +	@ln -f $(ODIR)/qbuild/libgui_qt.a $@ + +clean-local: +	@rm -f $(ODIR)/makefile.qmake +	@rm -rf $(QBUILDDIR) + +INCLUDES	= -I$(top_srcdir)/include -DBOOTSTRAP + +include		$(rules)/Rules.make diff --git a/roms/openbios/arch/unix/gui_qt/gui-qt.cpp b/roms/openbios/arch/unix/gui_qt/gui-qt.cpp new file mode 100644 index 00000000..24c08428 --- /dev/null +++ b/roms/openbios/arch/unix/gui_qt/gui-qt.cpp @@ -0,0 +1,128 @@ +/* tag: qt user interface fb class + * + * Copyright (C) 2003-2004 Stefan Reinauer + * + * See the file "COPYING" for further information about + * the copyright and warranty status of this work. + */ + +#include "gui-qt.h" +#include "logo.xpm" + +#include <iostream> + +static const int sizex=640; +static const int sizey=480; +static const int depth=8; + +static unsigned char color[256][3]={ +	{ 0x00, 0x00, 0x00 }, +	{ 0x00, 0x00, 0xaa }, +	{ 0x00, 0xaa, 0x00 }, +	{ 0x00, 0xaa, 0xaa }, +	{ 0xaa, 0x00, 0x00 }, +	{ 0xaa, 0x00, 0xaa }, +	{ 0xaa, 0x55, 0x00 }, +	{ 0xaa, 0xaa, 0xaa }, +	{ 0x55, 0x55, 0x55 }, +	{ 0x55, 0x55, 0xff }, +	{ 0x55, 0xff, 0x55 }, +	{ 0x55, 0xff, 0xff }, +	{ 0xff, 0x55, 0x55 }, +	{ 0xff, 0x55, 0xff }, +	{ 0xff, 0xff, 0x55 }, +	{ 0xff, 0xff, 0xff }, +}; + +FrameBufferWidget::FrameBufferWidget(QWidget *parent, const char * name) +: QWidget(parent, name, Qt::WType_TopLevel) +{ +	setCaption ("OpenBIOS"); +	setIcon(QPixmap(logo)); + +	QPopupMenu *file = new QPopupMenu (this); + +	file->insertItem( "E&xit",  this, SLOT(quit()), CTRL+Key_Q ); + +	QPopupMenu *help = new QPopupMenu( this ); +	help->insertItem("&About OpenBIOS", this, SLOT(about()), CTRL+Key_H ); +	help->insertItem( "About &Qt", this, SLOT(aboutQt()) ); + +	menu = new QMenuBar( this ); +	Q_CHECK_PTR( menu ); +	menu->insertItem( "&File", file ); +	menu->insertSeparator(); +	menu->insertItem( "&Help", help ); +	menu->setSeparator( QMenuBar::InWindowsStyle ); + +	setFixedSize(sizex,sizey+menu->heightForWidth(sizex)); + +	buffer.create(sizex, sizey, depth, 256); + +	for (int i=16; i < 256; i++) { +		color[i][0]=i; +		color[i][1]=i; +		color[i][2]=i; +	} + +	for (int i=0; i< 256; i++) +		buffer.setColor(i, qRgb(color[i][0], color[i][1], color[i][2])); + +	buffer.fill( 0 ); + +	updatetimer=new QTimer(this); +	connect( updatetimer, SIGNAL(timeout()), this, SLOT(update()) ); +	updatetimer->start(200,FALSE); + +	setMouseTracking( TRUE ); +} + +unsigned char * FrameBufferWidget::getFrameBuffer(void) +{ +	return buffer.bits(); +} + +void FrameBufferWidget::paintEvent ( QPaintEvent * ) +{ +	QPainter p( this ); +	p.drawImage(0,menu->heightForWidth(sizex),buffer, 0,0, sizex, sizey); +} + +void FrameBufferWidget::about() +{ +	QMessageBox::about( this, "About OpenBIOS", +			  "              Welcome to OpenBIOS 1.01\n" +			  "  IEEE 1275-1994 Open Firmware implementation\n\n" +			  "written by Stefan Reinauer <stepan@openbios.org>\n\n" +			  "                http://www.openbios.org/\n"); +} + +void FrameBufferWidget::aboutQt() +{ +	QMessageBox::aboutQt( this, "OpenBIOS" ); +} + +void FrameBufferWidget::quit() +{ +	extern volatile int gui_running; +	extern volatile int runforth; + +	gui_running=0; +	interruptforth=1; + +	qApp->quit(); +} + +void FrameBufferWidget::update() +{ +	QPainter p( this ); +	p.drawImage(0,menu->heightForWidth(sizex),buffer, 0,0, sizex, sizey); +} + +void FrameBufferWidget::keyPressEvent(QKeyEvent * e) +{ +	int a=e->ascii(); +	if (a) { +		std::cout << " key '" << e->text() << "' pressed" << std::endl; +	} +} diff --git a/roms/openbios/arch/unix/gui_qt/gui-qt.h b/roms/openbios/arch/unix/gui_qt/gui-qt.h new file mode 100644 index 00000000..202619f7 --- /dev/null +++ b/roms/openbios/arch/unix/gui_qt/gui-qt.h @@ -0,0 +1,44 @@ +/* tag: qt user interface fb class description + * + * Copyright (C) 2003-2004 Stefan Reinauer <stepan@openbios.org> + * + * See the file "COPYING" for further information about + * the copyright and warranty status of this work. + */ + +#ifndef __framebufferwidget_h +#define __framebufferwidget_h + +#include <qapplication.h> +#include <qwidget.h> +#include <qimage.h> +#include <qpainter.h> +#include <qmenubar.h> +#include <qpopupmenu.h> +#include <qmessagebox.h> +#include <qstatusbar.h> +#include <qtimer.h> + +class FrameBufferWidget : public QWidget { +	Q_OBJECT +	public: +		FrameBufferWidget(QWidget *parent=0, const char *name=0); +		unsigned char *getFrameBuffer(void); + +	public slots: +		void quit(); +		void about(); +		void aboutQt(); +		void update(); + +	private: +		QImage     buffer; +		QMenuBar   *menu; +		QStatusBar *status; +		QTimer     *updatetimer; +		void paintEvent ( QPaintEvent * ); +	protected: +		void keyPressEvent(QKeyEvent * e); +}; + +#endif diff --git a/roms/openbios/arch/unix/gui_qt/gui-qt.pro b/roms/openbios/arch/unix/gui_qt/gui-qt.pro new file mode 100644 index 00000000..f58baecf --- /dev/null +++ b/roms/openbios/arch/unix/gui_qt/gui-qt.pro @@ -0,0 +1,18 @@ +# tag: qmake project file for OpenBIOS QT user interface +# +# Copyright (C) 2003-2004 Stefan Reinauer <stepan@openbios.org> +# +# See the file "COPYING" for further information about +# the copyright and warranty status of this work. +# + +TEMPLATE    = lib +CONFIG     += qt thread warn_on release staticlib +LIBS	    =  +INCLUDEPATH = qbuild $(ABSOINC) $(TOPDIR)/include +DESTDIR     = qbuild +OBJECTS_DIR = qbuild +MOC_DIR     = qbuild +TARGET      = gui_qt +HEADERS	    = $(UIDIR)/gui-qt.h +SOURCES	    = $(UIDIR)/gui-qt.cpp $(UIDIR)/qt-main.cpp diff --git a/roms/openbios/arch/unix/gui_qt/logo.xpm b/roms/openbios/arch/unix/gui_qt/logo.xpm new file mode 100644 index 00000000..9e2ac60b --- /dev/null +++ b/roms/openbios/arch/unix/gui_qt/logo.xpm @@ -0,0 +1,132 @@ +/* This logo was created by Stephan Lau, + * created to xpm by Stefan Reinauer + */ +static char *logo[] = { +/* columns rows colors chars-per-pixel */ +"300 80 44 1", +"  c #010101", +". c #070709", +"X c #0B0B0B", +"o c #0F0F11", +"O c #121212", +"+ c #1B1B1B", +"@ c #1F1F21", +"# c #232323", +"$ c #262628", +"% c #2B2B2C", +"& c #2E2E30", +"* c #333333", +"= c #373739", +"- c #3B3B3B", +"; c #434343", +": c #464648", +"> c #4B4B4B", +", c #4E4E50", +"< c #535353", +"1 c #5B5B5B", +"2 c #5E5E60", +"3 c #646464", +"4 c #666668", +"5 c #6B6B6B", +"6 c #747474", +"7 c #767678", +"8 c #7B7B7B", +"9 c #838383", +"0 c #8A8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hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgfdssaapuuuytteeewq0009998867666555555555555565666778899000qwwerttyyuuppassdfghhhhhhhhhhgfgggghhhgfgfghhhhggffghhhhggffghhhhgfggghhhhgfggghhhhgfgfghhhhfgfgghhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfdsapuytrwq0986555554455555555555555555555555555555555555555555555555555555555555555555555555556790qertyiuuuafhhhfpiishhhhfipidhhhhfiiidhhhhdiiifhhhhsiiifhhhhsiipghhhhaiipghhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgfdaiuttq0976555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555558iuue5579wuuuuiasfduuishhhhduuudhhhhduuudhhhhsuuufhhhhauuughhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfdaittw086555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555558yuur55549uuiw55569uuutyiadsuuudhhhhsuuudhhhhsuuufhhhhauuughhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgfapyrw975555555555555555555555555555555555555555555555555555555555555555555555555555555554555555555555555555554455555555555555555555558uuue54559uuuw55559uuuq55550uiutypafduuufhhhhsuuufhhhhsuuufhhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgdautw965555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555679qqerttuuppaasdddffgghghhhhhhhhhghhggfduuupaappuuuuyeq090uuuq55559uyi05555quuuuadghsuuufhhhhauuufhhhhauuighhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfsite0655555555555555555555555555555555555555555555555555555555555555555555555455555555555555555690wrtiiaddghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfuuuahhhhfuuushhhhfuuuaaiittuuuq55550uuu95560tuuudhhhhsuuughhhhauuufhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhhhhgsite955555555555555555555555555455555555555555555555555555555555555555555555555545555555555570wryiadfhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhhhhhhhhhhguuuahhhhfuuuahhhhfuuushhhhduuudfsaiuuuuq5555qiuu99etipuuifhhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgaut0655555555555555555555555555555555555555555555556555555555555555555555555555555555554559qruisfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgdsdfhhhhgdddfhhhhfddsfhhhhgdddfhhhhfddsffspyteeq755559qetisfhgfdddghhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgsir065555555555555555555555555555455555555555555555554555555555555555555555555555555555580rupsghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhsuudhhhhhhhhhhhhfuuphhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgspyt085555560tudghhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgaue9555555555555555554<----=---=---==-==<555555---:3:--=--=-*--==--<55555545<;------==->135890phhhhhy009tfq0009009090909wshhhhhhg<;;:;;;:<9fhhhhhhhf$    rhhhhhs3#    ;phhhhhhhf0#    Owghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhdpue0655559wuaghhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgsue855555455555555555555:O.                  *5455-   *.                &44555>O                   6ghhh+   5O                ehghhh9        . Xighhhhh9    -gfggf3        +sddffd8O        rddffffffffgffffgffffffffggffffffffgffffgffdaute09868eusghhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfpr955555555555555555555555%  .%=************&   +2555o   +=************%   +3343%  X-<3568888787884.  ;dggq.  O19888888888888,   8fgghsO      .    1fggghsO    ysdfiO          9ttuu>      .   1rtuyuuuuuuuuuuuuiuuuuuuuuuuuuuuuuuuuuuuuuuuuiiuuuut06449rpdhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhduw85555555555555555555555555*  .,111<1111111111<   #113-   #<<111111111111<   #123-  Xtssaaaaaaaaaaaaa   <sdf@  Otaaaaasaaaaaaaae   9sdgg,            =sdggh<    2ipa0            7etr#           <etttuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuighfauw857wudhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhfie7555555555555555555555554555:   =1<<<<<<<<<<<<<<&   -<<3X  X<<><<<<1,,<<<<<&   ;7e8   9apiiiiiipiiiiii6   0ia9   8uuuiipipiiiiiii>  oyisdt    X%%      2iadgy    Xrty6    @69&    X90e;    *3%     49wttuuuuuuuuuuuuuuuuuuuuuuuuuuuyuyyyuuyuuuuuuuuuuihhhhhhgayw86eifhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhar8555555555555555555555555555543.  +<,>>>,>><>>>>,,:.  O;:<&   -:;>>><>,,<><>,:.  $eytO  -puuyuuuuuuuuuiutX  %rytO  *ytrtyuuiuuuuuuu9   1ruis%.   108- .   8tisd%    <qw9X   #tre>    *59,    -86*    O47qetuuuuuuuuuuuuuuuuuuuuuuuuuuuiasddsaiuuuuuuuuuuighhhhhhhhhgatq9tahhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhgiq55555555555555555555555555555555-   ;>:>:,<<<,<<<<<<# . %-;: . O:;;;>>,<<>,,<38;   5qr3   eutttuuiiiipiiii1   5wr<   qreeryuiipiiipii$  X0wru8    O976&    +9wya0    O999O    qeq9O    >3<    +751.    &159wtyuuuuuuuuuuuuuuuuuuuuuuuuisfhhhhhhgdpuuuuuiuuihhhhhhhhhhhhhhdierighhhhhhh", +"hhhhhhhhhhhhhhhhhfi05555555555555555555555555555555552   #>;;:,,<<<11<11<>   +--;+   ;;--;><<1116qtpy   -009   ,ttrrtuppaaaaaaay   -q09   ;ewqrtupaaaaaaap9   10qrtX   .3754X  . >60tuX    387%    3w09:    +3<O.   153%    O:159wtyuuuuiuuuuuuuuuuuuuuuuuuaghhhhhhhhhhhdiuuuuuuighhhhhhhhhhhhhhhhfaupghhhhh", +"hhhhhhhhhhhhhhhhiq55555555555555555555555555555555555+  X;:;;><<112311212+  .---&   $;-;;><138eusddd-  X000%  oerrrtuaadsdddddd-  o090$  Xwqqetypadddsddsao .%q9qr3    $856-    +160t5    $761    X9097X    ;1&    &54<     *;159wtyuuuuuuuuuuuuuuuuuuuuuushhhhhhhhhhhhhhdpyuuuuihhhhhhhhhhhhhhhhhhhhgsdhhhh", +"hhhhhhhhhhhhhhsr555555545555555555555555555555555555,   %;;-:><123333535>   %---O  .;--;;<5wifgfgfgt   1w04   2ewerupsffgffggft   1w05   1wqqeyasffgfgggg9   7q0wq     6665     ,360w     666O    <999=    %32.  . <31+.   +>>160rtuuuuuuuuuuuuuuuuuuuuuyshhhhhhhhhhhhhhhhfuuuuuighhhhhhhhhhhhhhhhhhhhhhhghh", +"hhhhhhhhhhhhhi05555555555555555555555555555555555555o .X;;-::<1335555454X  X:--$   &:--,6rsfghhghgh#  Orq0O   <<<<156999090999#  +rqqO  +qqqetisgghhghhha   >rqqe*    >867#    *358e*    >76;    #9994  . .44-    o2<>++++O>><48qrtuuuuuuuuuuuuiuuuuuuuuphhhhhhhhhhhhhhhhhhsyuiuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhu65555555555555555555555555555555555555-   *;-->>1355555554-   *;--.  O;-<5rpdfhhhhhhh9   7rq<                       6eq,   5w0wtisdgghhhhhh<  Oqwqw8    X7773    X45608    X666.    3779%    ;55X.   %<1356651<<369etyuuuuuuuuuuuuuuuuuuuuudhhhhhhhhhhhhhhhhhhgpyuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhi755555555555555555555555555555555555553.  +;--;><2555555553.  O:--$   *16qtiafhghhhhhgO  *rq9X  @,>:><356787888787653rq9X  %wqqryadfghhhhhhy   3rqqrO    <669O    >569q+    <66*    =8781    O953     &<24698533359qryuuuuuuuuuuuiuuuuuuuuuphhhhhhhhhhhhhhhhhhhhsyuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhs955555555555555555555555555555555555555%   -;;;><1335555555$   -;;*   %9wweypdfhhhhhhh4   eeq-   90990rtupaaaaaaaapiutee-   9qqerusfhhhhhhhh#  +twqr1    @868=    $867q1    @873    o5689O    166;     &<36999865690etyyuuuuuuuuuuuuuuuuuuuudhhhhhhhhhhhhhhhhhhhhfiuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhy55555555555555555555555555555555555555<   #;--:,<3355555551   #;;-+  Xqwqetisfhghhhhhp   1eq7   >q999qrtuuipipuippuytrr8   :wqqruadfhhhhhhh9   6ewweX    363%    #6689qX    276#    >769,    $867*     +13800q9999qrtyuuuuuuuuuuuuuuuuuuuuuufhhhhhhhhhhhhhhhhhhhhhpuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhh955555555555555555555555555555555555555@  .:-;;:<1335555554+  .;:-*   1wqqrupfghhhhhhh;  Oeeq$ ..q0990qrtuuuuuuuuuuuuttr&  XqqqetpdfghhhhhhfO  *tewe>            %8869q<    *76<    O6687X    4669$    .X159qeeeqqqrryuuuuuuuuuuuuuuuuuuuiuuighhhhhhhhhhhhhhhhhhhhhpyuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhh55555555555555555555555555555555555555:   $;-;;,<335555554:   $:-2+  +qqqeyidgghhhhhhr   1rq3   1q000rryuipiiipiiiiiuuu7   1wqwtuadghhhhhhh6   qwww0           =20979q9    X566X    <679= .  -8680-    . >69errtrrrtyyuuuuuuuuuuuuuuuuuuuuuuihhhhhhhhhhhhhhhhhhhhhhpyuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhh95555555555555555555555555555555555555O  X:--;><2355555553O  O:162   3eqerusdghhhhhhf#  $tqqO  +qqqwrtipaaaaaaaaaaaaapp+  Oeqqetpsgghhhhhhs   >ewqr&.         ;q0998qe*    >86;    #7685    O6680e1      *50ettyyyyyuuuuuuuuuuuuuuuuuuuuuuuuuhhhhhhhhhhhhhhhhhhhhhhpuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhht655555555555555555555555555555555555:   %;-;:<1335555555&  .:500X  +eqerypsghhhhhhh6  Oqeq3   1qqwryiasddddddddddddsd7   8wqqtuafghhhhhhh;  Oreqw7            -999qw7.   +665X    4679@    :789wt6      O50etyyuuuuuuuuuuuuuuuuuuuuuuuuuiuuughhhhhhhhhhhhhhhhhhhhhpyuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhs955555555555555555555555555555555555%   --;;>1135555553-   ,0eq>   =wqerisfghhhhhf9   8rwq-   9qqetpsdffgfgffgfdttgfa   *rqqryadghhhhhhhq   4rqwrO    *-@      79qeu+    ,76*  . *7681    O8680ruy      X49etyuuuuuuuuuuuuuuuuuuuuiuuuuuuuuudhhhhhhhhhhhhhhhhhhhhgiuuuhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhu65555555555555555555555555555555554#                    .4eew9   X                 Oqteww=                     #dgg;   9wqwtisfghhhhhhfX  Xewqe3    %63<     @70ey5    #961    X6678X    3679ruip&      48wryuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuphhhhhhhhhhhhhhhhhhhhduuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhu7555555555555555554555555555555545,@X     .         .+>qyrre&  X8O             O-7utreer9=X                   ufg5   +ewqruadghhhhhhf;   >eqweX .  451>     -6qyyO    366#    ;769<    $769wtpaa3     O36qrtuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuighhhhhhhhhhhhhhhhhhhpyuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhp95455555555555555555555555555555331:;---;><1111111117tutre8   1q999wtipaaasssaaaiutrrrruyrq09qruiasasasasassssddddaitrwetisfhghhhhhhgfautewr;    -654%    o56eu<    =86:  . O8687     6669ruada4     @160ryuuuuuuuuuuuuuuuuuuiuuuuuuuuuuuuahhhhhhhhhhhhhhhhhhsuuuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhde555555555555555555555555555555331,;---;;,<<<<<1<<8tutrtt+  Or099qwtuipppppppiiuytrtyiiiteq0qryupppppppppppppssdspurreriafghhhhhhhhgdaueee8    X665<     ;38e9    X765X    1679%    >669wyadfd5     *150rtuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuushhghhhhhhhhhhhhhgiyuuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhiq555555555555555555555555555533<<:;-;;>>,>,>,,,6ttyttt3   5q9990rttuuuuuuyuuyyttyupaapurewertyyuuuuuuuuuuuipasaputttypsgghhhhhhhggsautrt*    ,667#   .+159e*    >86;.   $6695    .8680tisfgd3    X:160rtuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuudhhhhhhhhhhhhhhgiuiuuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhfi055555555555555555555555555332<>>:;:>>>,<>,>6tuuuiiuX  *eq00wrryyuuuuyuuuuuyuiiasdsaputrtttuuyuyuuuuyyuupaassaiuyupsfghhhhhhhhhgdaiuy6    O967<     146q3    O865     5679O    ,769wuafggfX    #:150rtuuuuuuuuuuuuuuuuuuuuuuiuuuuuuuuuuushhhhhhhhhhhhfiuuuuuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhfiq5555555555555555555554555431<<<,<<<<<<<15tippppa<.  0wqqetyippppppppppippaasdfgfdsapiipipppppppppppppaadddsaapasfghhhhhhhhhggfsapi+    1678O    -5589+    176%    -679,    +85O    rgg0    X-,36qrtuuuuuuuuuuuuiuuuuuuuuuuuuuuuuiuuuuupfghhhhhhhfauuuuuuuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhat85555555555555555555555433221111111113tsssssdr   >eqqetupaasaaasaasssasddfgggggfdssasassaassasaasssddffffddddfgghhhhhhhhhhhgfdd8    $878>    X55601    $761    X5788o    37-    -dfd@    &>,39qryuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuypsdffdspuuuuuuuuuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhfiw6555555555555555555555333332322331efffdffs+   qqwetiadfffdfddfffdfffffgghhhgggfffdfdffdfdfdfdfdfffggfggfggghhhhhhhhhhhhggggp     6666     >6699     676+    >679-    =73    .yss8   .O,,159etyuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuyuyuuuuuuuuuuuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhfiw7545555555555555555555545353350dgggghg4   -rqqruadfggghghhggghgghhhhhhhhhhghghhghgghghghghghghhhhhhhhghghhhhhhhhhhhhhhhg<    ;669&    +666q*    -76,  . O8686    X66$    <uiuO  . -><57qryuuuuuuuuuuuuuuuuuuuuuuuuuiuuuuuuuuiuuuuuuuuuuuuuuuuuuuuuughhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhdir955555555555555555555555555uhhhhhhhgfsuteqrtpdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhu    X7764 .   15696    .766# .  <679$.   <7<    oqty-    %<<149etyuuuuuuuuuuuuuiuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuiuuuuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhsue85555455555555555555559dhhhhhhhgfauteeriadghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh*    >865X    -667q#    >765     668=    =86%    -0q1    +4357qtiasdddddddddddddddsdddddddsddddddsddddddddddddsddddddddddddshhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfaue755555555555555555ehhhhhhhhgdautrtuadghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhq     ;-%     +76703    O868:   . >>%    +975     %2*    X6669wuadghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhsit06553555555555phhhhhhhggfaiuuupsfghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfO .          +76680X    3869- .         %986>     . .   X5877qtpsgghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgaur065455555dhhhhhhhhgfdaapadfghghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh6 .          -8767q>    *7699*  .    .  -0989;          +98669qusfggfffghhhhgfffghhhhgfffghhhhgdfdghhhhgfffghhhhgfffghhhhdfffghhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgspte955fhhhhhhhhggfddddfghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhs       .   O3987800     5760e4        O3099997        X;996136qpdfhfuuuahhhhduuushhhhduuudhhhhduuufhhhhsuuufhhhhauuughhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfahhhhhhhhhhggffggghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh-        X%>688780r&    ,869qry<     #;89999qwr3o    O=58887559rdghhguuushhhhfuuishhhhduuudhhhhduuufhhhhsuuufhhhhauuufhhhhauuighhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgdauq841<15566890ryupute9880ruuur3<;1156889qrtyyr41>,145670979qyfgghfuuuahhhhfuuushhhhdiuudhhhhduuudhhhhsuuufhhhhauiughhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhggdptq8433356789qrupaaite990ruppitq85345790wtypiitw84335680qe0qrugghhfuuushhhhfuuushhhhduuudhhhhsuuudhhhhauuufhhhhsuuufhhhhpuuighhhhhhhhhhhhhghhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhg7-&508666880qrtipssaiyeqqrtpsspue076699qetipsaaurq866790ettwrtphhhhfuuuahhhhfuuudhhhhduuudhhhhduuidhhhhsuuufhhhhauuifsfhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhg9O550eqq0qwertuisdffsauyttupsddsayrqqqqrtupaddfdpureq0qeryiprtyahhhhfuuushhhhfuuushhhhfuuudhhhhduuudhhhhsuuufhhhhauuug;0hhauuighhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh;8saiuuttuyuipaddgggfsaiiiasffgfaaiytyuupaddgggfdpuuyyuupadauuuahhhhfiuiahhhhfiuudhhhhduuidhhhhduuufhhhhsiiufhhhhauuug>0hhpiuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhO   ysaaaOt3  4dggp%  %usssu&  *ifssaaaasdffghOpggsOtaat-  -ufggXahhpOfggOp7 .5fgfgghhhgggf9    6gggOphhhXigg9    6gggX    9gggi*  *pghhO; 4@+dhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhp*4tgffdf %&er phh+;yu&&gfg+:uu*%hgffddfffghhh uhgd tdd@%yy:+hhh uhhu hhh **tr ahhhhhhhhhhh 0uut<hhh uhhf uhh 0uut<hhhp*4uufhhh$;uu**hhh *0 7*0hhhh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hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh" +}; diff --git a/roms/openbios/arch/unix/gui_qt/qt-main.cpp b/roms/openbios/arch/unix/gui_qt/qt-main.cpp new file mode 100644 index 00000000..8311fe63 --- /dev/null +++ b/roms/openbios/arch/unix/gui_qt/qt-main.cpp @@ -0,0 +1,97 @@ +/* tag: openbios qt user interface + * + * Copyright (C) 2003-2004 Stefan Reinauer + * + * See the file "COPYING" for further information about + * the copyright and warranty status of this work. + */ + + +extern "C" { +#include <pthread.h> +#include <unistd.h> +#include "unix/plugins.h" +#include "unix/plugin_pci.h" +} +#include "gui-qt.h" + +#define DEBUG + +volatile unsigned char * fb=0; +volatile int gui_running=0; + +typedef struct { +	int argc; +	char **argv; +} threaddata; + +void *gui_thread(void *ptr) +{ +	threaddata *td=(threaddata *)ptr; + +	QApplication a(td->argc, td->argv); +	FrameBufferWidget w; + +	a.setMainWidget(&w); +	w.show(); + +	fb=w.getFrameBuffer(); + +	gui_running=-1; +	a.exec(); +	gui_running=0; + +	return 0; +} + +extern "C" { +extern int plugin_qt_init(void); +int plugin_qt_init(void) +{ +	pthread_t mythread; +	char *args[]={ "plugin_qt" }; +	threaddata mytd = { 1, args }; + +#ifdef DEBUG +	printf("Initializing \"framebuffer\" plugin..."); +#endif +	pthread_create(&mythread, NULL, gui_thread, &mytd); +	while (!fb) +		usleep(20); + +#if 0 + +	/* now we have the framebuffer start address. +	 * updating pci config space to reflect this +	 */ +#if (BITS > 32) +	*(u32 *)(pci_config_space+0x14)=(u32)((unsigned long)fb>>32); +#else +	*(u32 *)(pci_config_space+0x14)=0; +#endif +	*(u32 *)(pci_config_space+0x10)=(u32)((unsigned long)fb&0xffffffff); + +	/* next is to write the rom address. We write that at a random +	 * address in pci config space for now. +	 */ +#if (BITS > 32) +	*(u32 *)(pci_config_space+0x34)=(u32)((unsigned long)qt_fcode>>32); +#else +	*(u32 *)(pci_config_space+0x34)=0; +#endif +	*(u32 *)(pci_config_space+0x30)=(u32)((unsigned long)qt_fcode&0xffffffff); + +	/* FIXME: we need to put the fcode image for this +	 * device to the rom resource, once it exists +	 */ + +	/* register pci device to be available to beginagain */ +	pci_register_device(0, 2, 0, pci_config_space); +#endif +#ifdef DEBUG +	printf("done.\n"); +#endif +	return 0; +} + +} diff --git a/roms/openbios/arch/unix/plugins.c b/roms/openbios/arch/unix/plugins.c new file mode 100644 index 00000000..855454b0 --- /dev/null +++ b/roms/openbios/arch/unix/plugins.c @@ -0,0 +1,197 @@ +/* tag: plugin interface for openbios forth kernel + * + * Copyright (C) 2003, 2004 Stefan Reinauer + * + * See the file "COPYING" for further information about + * the copyright and warranty status of this work. + */ + +#include "sysinclude.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <dlfcn.h> + +#include "unix/plugins.h" + +unsigned char *plugindir = "/usr/share/OpenBIOS/plugins"; +#define PLUGINDIR  plugindir +#define PATHSIZE   256 + +#define CONFIG_DEBUG_PLUGINS + +typedef struct iorange iorange_t; +struct iorange { +	const char *name; +	unsigned int start; +	unsigned int end; +	io_ops_t *ops; +	iorange_t *next; +}; + +static iorange_t *ioranges = NULL; + +typedef struct plugin plugin_t; +struct plugin { +	const char *name; +	plugin_t *next; +}; + +static plugin_t *plugins = NULL; + +io_ops_t *find_iorange(u32 reg) +{ +	iorange_t *range = ioranges; +	while (range) { +		if (range->start <= reg && range->end >= reg) +			return range->ops; +		range = range->next; +	} +	return NULL; +} + +int register_iorange(const char *name, io_ops_t * ops, unsigned int rstart, +		     unsigned int rend) +{ +	iorange_t *newrange; + +	/* intersection check */ +	newrange = ioranges; +	while (newrange) { +		int fail = 0; +		/* new section swallows old section */ +		if (newrange->start >= rstart && newrange->end <= rend) +			fail = -1; +		/* new section start or end point are within range */ +		if (newrange->start <= rstart && newrange->end >= rstart) +			fail = -1; +		if (newrange->start <= rend && newrange->end >= rend) +			fail = -1; +		if (fail) { +			printf("Error: overlapping IO regions: %s and %s\n", +				newrange->name, name); +			return -1; +		} +		newrange = newrange->next; +	} + +	newrange = malloc(sizeof(iorange_t)); + +	newrange->name = name; +	newrange->ops = ops; +	newrange->start = rstart; +	newrange->end = rend; +	newrange->next = ioranges; + +	ioranges = newrange; + +	return 0; +} + +int is_loaded(const char *plugin_name) +{ +	plugin_t *p = plugins; +	while (p) { +		if (!strcmp(plugin_name, p->name)) +			return -1; +		p = p->next; +	} +	return 0; +} + +int load_plugin(const char *plugin_name) +{ +	void *handle; +	char *error; +	char path[PATHSIZE]; + +	int (*init_plugin) (void); +	char **deps; +	char **plugin_info; +	plugin_t *p; + +	if (is_loaded(plugin_name)) { +		printf("Plugin %s already loaded.\n", plugin_name); +		return 0; +	} + +	strncpy(path, PLUGINDIR, PATHSIZE); +	strncat(path, "/plugin_", PATHSIZE); +	strncat(path, plugin_name, PATHSIZE); +	strncat(path, ".so", PATHSIZE); + +#if DEBUG +	printf("Opening plugin %s\n", path); +#endif + +	handle = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); +	if (!handle) { +		error = dlerror(); +		printf("Error: Could not open plugin \"%s\": %s\n", +		       plugin_name, error); +		exit(1); +	} +#ifdef CONFIG_DEBUG_PLUGINS +	plugin_info = dlsym(handle, "plugin_author"); +	if ((error = dlerror()) == NULL) +		printf("Plugin %s author:  %s\n", plugin_name, *plugin_info); +	plugin_info = dlsym(handle, "plugin_license"); +	if ((error = dlerror()) == NULL) +		printf("Plugin %s license: %s\n", plugin_name, *plugin_info); +	plugin_info = dlsym(handle, "plugin_description"); +	if ((error = dlerror()) == NULL) +		printf("Plugin %s descr.: %s\n", plugin_name, *plugin_info); +#endif +	p = malloc(sizeof(plugin_t)); +	p->next = plugins; +	p->name = plugin_name; +	plugins = p; + +	deps = dlsym(handle, "plugin_deps"); +	if ((error = dlerror()) != NULL) +		deps = NULL; + + +	strncpy(path, "plugin_", PATHSIZE); +	strncat(path, plugin_name, PATHSIZE); +	strncat(path, "_init", PATHSIZE); + +	init_plugin = dlsym(handle, path); +	if ((error = dlerror()) != NULL) { +		printf("error: %s\n", error); +		exit(1); +	} + +	if (deps) { +		int i = 0; +		char *walk = deps[0]; +#ifdef CONFIG_DEBUG_PLUGINS +		printf("\nPlugin %s dependencies:", plugin_name); +#endif +		while (walk) { +			printf(" %s", walk); +			if (!is_loaded(walk)) { +#ifdef CONFIG_DEBUG_PLUGINS +				printf("(loading)\n"); +#endif +				load_plugin(walk); +			} +#ifdef CONFIG_DEBUG_PLUGINS +			else { +				printf("(loaded)"); +			} +#endif +			walk = deps[++i]; +		} +	} + +	printf("\n"); +#if DEBUG +	printf("Initializing module:\n"); +#endif + +	return init_plugin(); + +	// We don't dlclose the handle here since +	// we want to keep our symbols for later use. +} diff --git a/roms/openbios/arch/unix/plugins/Kconfig b/roms/openbios/arch/unix/plugins/Kconfig new file mode 100644 index 00000000..43237bf9 --- /dev/null +++ b/roms/openbios/arch/unix/plugins/Kconfig @@ -0,0 +1,16 @@ +config PLUGINS +	depends HOST_UNIX +	bool "Plugin system (obsolete)" +	default n +	 +config PLUGIN_PCI +	depends HOST_UNIX && PLUGINS +	bool "PCI Emulation" +	default n + +config PLUGIN_QT +	bool "QT Display Emulation" +	depends HOST_UNIX && PLUGINS && PLUGIN_PCI +	default n +	help +	  This plugin needs qt installed. Disable if you don't have qt. diff --git a/roms/openbios/arch/unix/plugins/Makefile b/roms/openbios/arch/unix/plugins/Makefile new file mode 100644 index 00000000..c6b9a651 --- /dev/null +++ b/roms/openbios/arch/unix/plugins/Makefile @@ -0,0 +1,13 @@ + +include				../../../config/Makefile.top + +SUBDIRS-$(CONFIG_PLUGIN_PCI)	+= plugin_pci +SUBDIRS-$(CONFIG_PLUGIN_QT)	+= plugin_qt + +PROGRAMS			= # loader +loader-OBJS			= loader.o +loader-LDFLAGS			= -dynamic $(LIBDL_LDFLAGS) + +INCLUDES			= -DBOOTSTRAP + +include				$(rules)/Rules.make diff --git a/roms/openbios/arch/unix/plugins/Rules.plugin b/roms/openbios/arch/unix/plugins/Rules.plugin new file mode 100644 index 00000000..9e9b6255 --- /dev/null +++ b/roms/openbios/arch/unix/plugins/Rules.plugin @@ -0,0 +1,15 @@ +# -*- makefile -*- + +INCLUDES		= -I$(top_srcdir)/include -DBOOTSTRAP +CFLAGS			= -fPIC + +%.so: %.o +	$(CC) -shared $(CFLAGS) $(filter %.o,$^) -o $@ + +THISDIR			:= $(notdir $(shell pwd)) + +all-local:		$(addprefix $(ODIR)/../,$(PLUGINS)) + +$(ODIR)/../%.so: $(ODIR)/%.so +	install -d ../$(ODIR) +	ln -f "../$(THISDIR)"/$< $@ diff --git a/roms/openbios/arch/unix/plugins/loader.c b/roms/openbios/arch/unix/plugins/loader.c new file mode 100644 index 00000000..d3781de7 --- /dev/null +++ b/roms/openbios/arch/unix/plugins/loader.c @@ -0,0 +1,209 @@ +/* tag: openbios plugin loader + * + * Copyright (C) 2003 Stefan Reinauer + * + * See the file "COPYING" for further information about + * the copyright and warranty status of this work. + */ + +/* This is a simple plugin loader. OpenBIOS duplicates some + * of this code in kernel/arch/unix/plugins.c. This code is + * here for reference and simple testing. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <dlfcn.h> +#include <unistd.h>		// sleep + +#include "unix/plugins.h" + +#define PLUGINDIR  "/usr/share/OpenBIOS/plugins" +#define PATHSIZE   256 + +#define DEBUG_PLUGINS + +typedef struct iorange iorange_t; +struct iorange { +	const char *name; +	unsigned int start; +	unsigned int end; +	io_ops_t *ops; +	iorange_t *next; +}; + +iorange_t *ioranges = NULL; + +typedef struct plugin plugin_t; +struct plugin { +	const char *name; +	plugin_t *next; +}; + +plugin_t *plugins = NULL; + +int register_iorange(const char *name, io_ops_t * ops, unsigned int rstart, +		     unsigned int rend) +{ +	iorange_t *newrange; + +	/* intersection check */ +	newrange = ioranges; +	while (newrange) { +		int fail = 0; +		/* new section swallows old section */ +		if (newrange->start >= rstart && newrange->end <= rend) +			fail = -1; +		/* new section start or end point are within range */ +		if (newrange->start <= rstart && newrange->end >= rstart) +			fail = -1; +		if (newrange->start <= rend && newrange->end >= rend) +			fail = -1; +		if (fail) { +			printf("Error: overlapping IO regions: %s and %s\n", +			     newrange->name, name); +			return -1; +		} +		newrange = newrange->next; +	} + +	newrange = malloc(sizeof(iorange_t)); + +	newrange->name = name; +	newrange->ops = ops; +	newrange->start = rstart; +	newrange->end = rend; +	newrange->next = ioranges; + +	ioranges = newrange; + +	return 0; +} + +int is_loaded(const char *plugin_name) +{ +	plugin_t *p = plugins; +	while (p) { +		if (!strcmp(plugin_name, p->name)) +			return -1; +		p = p->next; +	} +	return 0; +} + +int load_plugin(const char *plugin_name) +{ +	void *handle; +	char *error; +	char path[PATHSIZE]; + +	int (*init_plugin) (void); +	char **deps; +	char **plugin_info; +	plugin_t *p; + +	if (is_loaded(plugin_name)) { +		printf("Plugin %s already loaded.\n", plugin_name); +		return 0; +	} + +	strncpy(path, PLUGINDIR, PATHSIZE); +	strncat(path, "/plugin_", PATHSIZE); +	strncat(path, plugin_name, PATHSIZE); +	strncat(path, ".so", PATHSIZE); + +#if DEBUG +	printf("Opening plugin %s\n", path); +#endif + +	handle = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); +	if (!handle) { +		error = dlerror(); +		printf("Error: Could not open plugin \"%s\": %s\n", +		       plugin_name, error); +		exit(1); +	} +#ifdef DEBUG_PLUGINS +	plugin_info = dlsym(handle, "plugin_author"); +	if ((error = dlerror()) == NULL) +		printf("Plugin %s author:  %s\n", plugin_name, *plugin_info); +	plugin_info = dlsym(handle, "plugin_license"); +	if ((error = dlerror()) == NULL) +		printf("Plugin %s license: %s\n", plugin_name, *plugin_info); +	plugin_info = dlsym(handle, "plugin_description"); +	if ((error = dlerror()) == NULL) +		printf("Plugin %s descr.: %s\n", plugin_name, *plugin_info); +#endif +	p = malloc(sizeof(plugin_t)); +	p->next = plugins; +	p->name = plugin_name; +	plugins = p; + +	deps = dlsym(handle, "plugin_deps"); +	if ((error = dlerror()) != NULL) +		deps = NULL; + + +	strncpy(path, "plugin_", PATHSIZE); +	strncat(path, plugin_name, PATHSIZE); +	strncat(path, "_init", PATHSIZE); + +	init_plugin = dlsym(handle, path); +	if ((error = dlerror()) != NULL) { +		printf("error: %s\n", error); +		exit(1); +	} + +	if (deps) { +		int i = 0; +		char *walk = deps[0]; +#ifdef DEBUG_PLUGINS +		printf("\nPlugin %s dependencies:", plugin_name); +#endif +		while (walk) { +			printf(" %s", walk); +			if (!is_loaded(walk)) { +#ifdef DEBUG_PLUGINS +				printf("(loading)\n"); +#endif +				load_plugin(walk); +			} +#ifdef DEBUG_PLUGINS +			else { +				printf("(loaded)"); +			} +#endif +			walk = deps[++i]; +		} +	} + +	printf("\n"); +#if DEBUG +	printf("Initializing module:\n"); +#endif + +	return init_plugin(); + +	// We don't dlclose the handle here since +	// we want to keep our symbols for later use. +} + +int main(void) +{ +	iorange_t *r; + +	// load_plugin("kbd"); +	// load_plugin("pci"); +	load_plugin("qt"); + +	printf("\nRegistered IO Ranges:\n"); +	r = ioranges; +	while (r) { +		printf("  %s: %x-%x\n", r->name, r->start, r->end); +		r = r->next; +	} + +	sleep(10); +	return 0; +} diff --git a/roms/openbios/arch/unix/plugins/plugin_pci/Makefile b/roms/openbios/arch/unix/plugins/plugin_pci/Makefile new file mode 100644 index 00000000..e46a6cda --- /dev/null +++ b/roms/openbios/arch/unix/plugins/plugin_pci/Makefile @@ -0,0 +1,7 @@ + +include			../../../../config/Makefile.top + +PLUGINS			= plugin_pci.so + +include			../Rules.plugin +include			$(rules)/Rules.make diff --git a/roms/openbios/arch/unix/plugins/plugin_pci/Makefile.old b/roms/openbios/arch/unix/plugins/plugin_pci/Makefile.old new file mode 100644 index 00000000..10d0555d --- /dev/null +++ b/roms/openbios/arch/unix/plugins/plugin_pci/Makefile.old @@ -0,0 +1,21 @@ +# tag: Makefile for OpenBIOS PCI plugin +# +# Copyright (C) 2003 Stefan Reinauer +# +# See the file "COPYING" for further information about +# the copyright and warranty status of this work. +# + +PLUGIN_SOURCES = plugin_pci.c +PLUGIN_NAME    = plugin_pci.so + +INCLUDES := -I$(TOPDIR)/include -I$(BUILDDIR) -I.. +VPATH    := $(VPATH):. + +all: $(PLUGIN_NAME) + +$(PLUGIN_NAME): $(PLUGIN_SOURCES) +	$(CC) -shared -Wall -Os -fPIC $(INCLUDES) $< -o $(BUILDDIR)/$@ + +clean: +	rm -f plugin_*.so diff --git a/roms/openbios/arch/unix/plugins/plugin_pci/plugin_pci.c b/roms/openbios/arch/unix/plugins/plugin_pci/plugin_pci.c new file mode 100644 index 00000000..586ea2aa --- /dev/null +++ b/roms/openbios/arch/unix/plugins/plugin_pci/plugin_pci.c @@ -0,0 +1,221 @@ +/* tag: openbios pci plugin + * + * Copyright (C) 2003 Stefan Reinauer + * + * See the file "COPYING" for further information about + * the copyright and warranty status of this work. + */ + +#include <stdio.h> +#include <stdlib.h> +#include "unix/plugins.h" +#include "unix/plugin_pci.h" + +#define DEBUG + +u32 pci_conf_addr = 0; +pci_dev_t *pci_devices = NULL; + +static pci_dev_t *find_device(u32 conf_addr) +{ +	pci_dev_t *devs = pci_devices; +	unsigned bus = (conf_addr >> 16) & 0xff; +	unsigned dev = (conf_addr >> 11) & 0x1f; +	unsigned fn = (conf_addr >> 8) & 0x7; + +	// printf("Looking for device %x\n",conf_addr); + +	while (devs) { +		if (devs->bus == bus && devs->dev == dev && devs->fn == fn) +			return devs; +		devs = devs->next; +	} +	return NULL; +} + +/* + * IO functions. These manage all the magic of providing a PCI + * compatible interface to OpenBIOS' unix version of the kernel. + */ + +static u8 pci_inb(u32 reg) +{ +	u32 basereg = (reg & 0xfffc); +	u32 basepos = (reg & 0x03); +	pci_dev_t *dev; + +	if (basereg == 0xcf8) { +		return (pci_conf_addr >> (basepos << 3)); +	} + +	/* still here? so we're 0xCFC */ +	dev = find_device(pci_conf_addr); +	if (!dev || !dev->config) +		return 0xff; + +	return dev->config[(pci_conf_addr + basepos) & 0xff]; +} + +static u16 pci_inw(u32 reg) +{ +	u32 basereg = (reg & 0xfffc); +	u32 basepos = (reg & 0x02); +	pci_dev_t *dev; + +	if (basereg == 0xcf8) { +		return (pci_conf_addr >> (basepos << 3)); +	} + +	/* still here? so we're 0xCFC */ +	dev = find_device(pci_conf_addr); +	if (!dev || !dev->config) +		return 0xffff; + +	return *(u16 *) (dev->config + ((pci_conf_addr + basepos) & 0xff)); +} + +static u32 pci_inl(u32 reg) +{ +	u32 basereg = (reg & 0xfffc); +	pci_dev_t *dev; + +	if (basereg == 0xcf8) { +		return pci_conf_addr; +	} + +	/* still here? so we're 0xCFC */ +	dev = find_device(pci_conf_addr); +	if (!dev || !dev->config) +		return 0xffffffff; + +	return *(u32 *) (dev->config + (pci_conf_addr & 0xff)); +} + +static void pci_outb(u32 reg, u8 val) +{ +	u32 basereg = (reg & 0xfffc); +	u32 basepos = (reg & 0x03); +	pci_dev_t *dev; + +	if (basereg == 0xcf8) { +		pci_conf_addr &= (~(0xff << (basepos << 3))); +		pci_conf_addr |= (val << (basepos << 3)); +		return; +	} + +	/* still here? so we're 0xCFC */ +	dev = find_device(pci_conf_addr); +	if (!dev || !dev->config) +		return; + +	dev->config[pci_conf_addr & 0xff] = val; +} + +static void pci_outw(u32 reg, u16 val) +{ +	u32 basereg = (reg & 0xfffc); +	u32 basepos = (reg & 0x02); +	pci_dev_t *dev; + +	if (basereg == 0xcf8) { +		pci_conf_addr &= (~(0xffff << (basepos << 3))); +		pci_conf_addr |= (val << (basepos << 3)); +		return; +	} + +	/* still here? so we're 0xCFC */ +	dev = find_device(pci_conf_addr); +	if (!dev || !dev->config) +		return; + +	*(u16 *) (dev->config + (pci_conf_addr & 0xff)) = val; +} + +static void pci_outl(u32 reg, u32 val) +{ +	u32 basereg = (reg & 0xfffc); +	pci_dev_t *dev; + +	if (basereg == 0xcf8) { +		pci_conf_addr = val; +		return; +	} + +	/* still here? so we're 0xCFC */ +	dev = find_device(pci_conf_addr); +	if (!dev || !dev->config) +		return; + +	*(u32 *) (dev->config + (pci_conf_addr & 0xff)) = val; +} + +static io_ops_t pci_io_ops = { +      inb:pci_inb, +      inw:pci_inw, +      inl:pci_inl, +      outb:pci_outb, +      outw:pci_outw, +      outl:pci_outl +}; + +/* + * Functions visible to modules depending on this module. + */ + +int pci_register_device(unsigned bus, unsigned dev, unsigned fn, +			u8 * config) +{ +	pci_dev_t *newdev; +	u32 caddr = (1 << 31) | (bus << 16) | (dev << 11) | (fn << 8); + +	if (find_device(caddr)) { +		printf("Error: pci device %02x:%02x.%01x already exists\n", +		       bus, dev, fn); +		return -1; +	} + +	newdev = malloc(sizeof(pci_dev_t)); + +	if (!newdev) { +		printf("Out of memory\n"); +		return -1; +	} + +	newdev->bus = bus; +	newdev->dev = dev; +	newdev->fn = fn; +	newdev->config = config; +	newdev->next = pci_devices; + +	pci_devices = newdev; + +	return 0; +} + +/* + * Initialization is really simple. We just grab the + * PCI conf1 io range for our emulation functions. + */ +extern int plugin_pci_init( void ); + +int plugin_pci_init(void) +{ +#ifdef DEBUG +	printf("Plugin \"pci\" initializing... "); +#endif +	register_iorange("pci", &pci_io_ops, 0xcf8, 0xcff); +#ifdef DEBUG +	printf("done.\n"); +#endif +	return 0; +} + +/* plugin meta information available for the plugin loader */ +PLUGIN_AUTHOR       ("Stefan Reinauer <stepan@openbios.org>") +PLUGIN_DESCRIPTION  ("Generic PCI Device Emulation") +PLUGIN_LICENSE      ("GPL v2") + +/* This plugin has no dependencies. Otherwise the following + * macro would be uncommented: + * PLUGIN_DEPENDENCIES ("this", "that") + */ diff --git a/roms/openbios/arch/unix/plugins/plugin_qt/Makefile b/roms/openbios/arch/unix/plugins/plugin_qt/Makefile new file mode 100644 index 00000000..371dc2f0 --- /dev/null +++ b/roms/openbios/arch/unix/plugins/plugin_qt/Makefile @@ -0,0 +1,37 @@ + +include		../../../../config/Makefile.top + +PLUGINS		= plugin_qt.so + +QMAKE		= qmake +PLUGINDIR	= $(shell cd .. ; pwd ) +TOPDIR		= $(shell cd $(top_srcdir) ; pwd) +ABSOINC		= $(shell cd $(ARCHINCLUDES) 2> /dev/null ; pwd ) + +export PLUGINDIR TOPDIR ABSOINC + +qt_rom.fc: qt_rom.fs +	$(TOKE) -v qt_rom.fs + +fcode.h: qt_rom.fc +	@echo "static const u8 qt_fcode[] = {" > $@ +	@cat $< | hexdump -ve '1/0 "\t" 8/1 "0x%02x, " 1/0 "\n"' \ +		| sed 's/0x  ,//g' >> $@ +	@echo "};" >> $@ + +$(ODIR)/makefile.qmake: plugin_qt.pro Makefile +	@test -d $(ODIR) || $(INSTALL) -d $(ODIR) +	@test -d $(ODIR)/qbuild || $(INSTALL) -d $(ODIR)/qbuild +	@cp plugin_qt.pro $(ODIR)/ +	cd $(ODIR) ; $(QMAKE) -o makefile.qmake + +$(ODIR)/plugin_qt.so: fcode.h $(ODIR)/makefile.qmake $(wildcard *.cpp) +	cd $(ODIR) ; $(MAKE) -f makefile.qmake +	@ln -f $(ODIR)/qbuild/plugin_qt.so $@ + +clean-local: +	@rm -f $(ODIR)/makefile.qmake +	@rm -rf $(QBUILDDIR) $(ODIR)/*.fc $(ODIR)/fcode.h + +include		../Rules.plugin +include		$(rules)/Rules.make diff --git a/roms/openbios/arch/unix/plugins/plugin_qt/logo.xpm b/roms/openbios/arch/unix/plugins/plugin_qt/logo.xpm new file mode 100644 index 00000000..9e2ac60b --- /dev/null +++ b/roms/openbios/arch/unix/plugins/plugin_qt/logo.xpm @@ -0,0 +1,132 @@ +/* This logo was created by Stephan Lau, + * created to xpm by Stefan Reinauer + */ +static char *logo[] = { +/* columns rows colors chars-per-pixel */ +"300 80 44 1", +"  c #010101", +". c #070709", +"X c #0B0B0B", +"o c #0F0F11", +"O c #121212", +"+ c #1B1B1B", +"@ c #1F1F21", +"# c #232323", +"$ c #262628", +"% c #2B2B2C", +"& c #2E2E30", +"* c #333333", +"= c #373739", +"- c #3B3B3B", +"; c #434343", +": c #464648", +"> c #4B4B4B", +", c #4E4E50", +"< c #535353", +"1 c #5B5B5B", +"2 c #5E5E60", +"3 c #646464", +"4 c #666668", +"5 c #6B6B6B", +"6 c #747474", +"7 c #767678", +"8 c #7B7B7B", +"9 c #838383", +"0 c #8A8A8A", +"q c #939394", +"w c #979799", +"e c #9B9B9B", +"r c #A3A3A3", +"t c #ABABAB", +"y c #B4B4B4", +"u c #BBBBBB", +"i c #C3C3C3", +"p c #CBCBCB", +"a c #D3D3D3", +"s c #DBDBDB", +"d c #E3E3E3", +"f c #EBEBEB", +"g c #F3F3F3", +"h c #FEFEFE", +/* pixels */ +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh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fgghhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfdsapuytrwq0986555554455555555555555555555555555555555555555555555555555555555555555555555555556790qertyiuuuafhhhfpiishhhhfipidhhhhfiiidhhhhdiiifhhhhsiiifhhhhsiipghhhhaiipghhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgfdaiuttq0976555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555558iuue5579wuuuuiasfduuishhhhduuudhhhhduuudhhhhsuuufhhhhauuughhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfdaittw086555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555558yuur55549uuiw55569uuutyiadsuuudhhhhsuuudhhhhsuuufhhhhauuughhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgfapyrw975555555555555555555555555555555555555555555555555555555555555555555555555555555554555555555555555555554455555555555555555555558uuue54559uuuw55559uuuq55550uiutypafduuufhhhhsuuufhhhhsuuufhhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgdautw965555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555679qqerttuuppaasdddffgghghhhhhhhhhghhggfduuupaappuuuuyeq090uuuq55559uyi05555quuuuadghsuuufhhhhauuufhhhhauuighhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfsite0655555555555555555555555555555555555555555555555555555555555555555555555455555555555555555690wrtiiaddghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfuuuahhhhfuuushhhhfuuuaaiittuuuq55550uuu95560tuuudhhhhsuuughhhhauuufhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhhhhgsite955555555555555555555555555455555555555555555555555555555555555555555555555545555555555570wryiadfhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhhhhhhhhhhguuuahhhhfuuuahhhhfuuushhhhduuudfsaiuuuuq5555qiuu99etipuuifhhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgaut0655555555555555555555555555555555555555555555556555555555555555555555555555555555554559qruisfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgdsdfhhhhgdddfhhhhfddsfhhhhgdddfhhhhfddsffspyteeq755559qetisfhgfdddghhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgsir065555555555555555555555555555455555555555555555554555555555555555555555555555555555580rupsghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhsuudhhhhhhhhhhhhfuuphhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgspyt085555560tudghhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgaue9555555555555555554<----=---=---==-==<555555---:3:--=--=-*--==--<55555545<;------==->135890phhhhhy009tfq0009009090909wshhhhhhg<;;:;;;:<9fhhhhhhhf$    rhhhhhs3#    ;phhhhhhhf0#    Owghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhdpue0655559wuaghhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgsue855555455555555555555:O.                  *5455-   *.                &44555>O                   6ghhh+   5O                ehghhh9        . Xighhhhh9    -gfggf3        +sddffd8O        rddffffffffgffffgffffffffggffffffffgffffgffdaute09868eusghhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfpr955555555555555555555555%  .%=************&   +2555o   +=************%   +3343%  X-<3568888787884.  ;dggq.  O19888888888888,   8fgghsO      .    1fggghsO    ysdfiO          9ttuu>      .   1rtuyuuuuuuuuuuuuiuuuuuuuuuuuuuuuuuuuuuuuuuuuiiuuuut06449rpdhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhduw85555555555555555555555555*  .,111<1111111111<   #113-   #<<111111111111<   #123-  Xtssaaaaaaaaaaaaa   <sdf@  Otaaaaasaaaaaaaae   9sdgg,            =sdggh<    2ipa0            7etr#           <etttuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuighfauw857wudhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhfie7555555555555555555555554555:   =1<<<<<<<<<<<<<<&   -<<3X  X<<><<<<1,,<<<<<&   ;7e8   9apiiiiiipiiiiii6   0ia9   8uuuiipipiiiiiii>  oyisdt    X%%      2iadgy    Xrty6    @69&    X90e;    *3%     49wttuuuuuuuuuuuuuuuuuuuuuuuuuuuyuyyyuuyuuuuuuuuuuihhhhhhgayw86eifhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhar8555555555555555555555555555543.  +<,>>>,>><>>>>,,:.  O;:<&   -:;>>><>,,<><>,:.  $eytO  -puuyuuuuuuuuuiutX  %rytO  *ytrtyuuiuuuuuuu9   1ruis%.   108- .   8tisd%    <qw9X   #tre>    *59,    -86*    O47qetuuuuuuuuuuuuuuuuuuuuuuuuuuuiasddsaiuuuuuuuuuuighhhhhhhhhgatq9tahhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhgiq55555555555555555555555555555555-   ;>:>:,<<<,<<<<<<# . %-;: . O:;;;>>,<<>,,<38;   5qr3   eutttuuiiiipiiii1   5wr<   qreeryuiipiiipii$  X0wru8    O976&    +9wya0    O999O    qeq9O    >3<    +751.    &159wtyuuuuuuuuuuuuuuuuuuuuuuuuisfhhhhhhgdpuuuuuiuuihhhhhhhhhhhhhhdierighhhhhhh", +"hhhhhhhhhhhhhhhhhfi05555555555555555555555555555555552   #>;;:,,<<<11<11<>   +--;+   ;;--;><<1116qtpy   -009   ,ttrrtuppaaaaaaay   -q09   ;ewqrtupaaaaaaap9   10qrtX   .3754X  . >60tuX    387%    3w09:    +3<O.   153%    O:159wtyuuuuiuuuuuuuuuuuuuuuuuuaghhhhhhhhhhhdiuuuuuuighhhhhhhhhhhhhhhhfaupghhhhh", +"hhhhhhhhhhhhhhhhiq55555555555555555555555555555555555+  X;:;;><<112311212+  .---&   $;-;;><138eusddd-  X000%  oerrrtuaadsdddddd-  o090$  Xwqqetypadddsddsao .%q9qr3    $856-    +160t5    $761    X9097X    ;1&    &54<     *;159wtyuuuuuuuuuuuuuuuuuuuuuushhhhhhhhhhhhhhdpyuuuuihhhhhhhhhhhhhhhhhhhhgsdhhhh", +"hhhhhhhhhhhhhhsr555555545555555555555555555555555555,   %;;-:><123333535>   %---O  .;--;;<5wifgfgfgt   1w04   2ewerupsffgffggft   1w05   1wqqeyasffgfgggg9   7q0wq     6665     ,360w     666O    <999=    %32.  . <31+.   +>>160rtuuuuuuuuuuuuuuuuuuuuuyshhhhhhhhhhhhhhhhfuuuuuighhhhhhhhhhhhhhhhhhhhhhhghh", +"hhhhhhhhhhhhhi05555555555555555555555555555555555555o .X;;-::<1335555454X  X:--$   &:--,6rsfghhghgh#  Orq0O   <<<<156999090999#  +rqqO  +qqqetisgghhghhha   >rqqe*    >867#    *358e*    >76;    #9994  . .44-    o2<>++++O>><48qrtuuuuuuuuuuuuiuuuuuuuuphhhhhhhhhhhhhhhhhhsyuiuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhu65555555555555555555555555555555555555-   *;-->>1355555554-   *;--.  O;-<5rpdfhhhhhhh9   7rq<                       6eq,   5w0wtisdgghhhhhh<  Oqwqw8    X7773    X45608    X666.    3779%    ;55X.   %<1356651<<369etyuuuuuuuuuuuuuuuuuuuuudhhhhhhhhhhhhhhhhhhgpyuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhi755555555555555555555555555555555555553.  +;--;><2555555553.  O:--$   *16qtiafhghhhhhgO  *rq9X  @,>:><356787888787653rq9X  %wqqryadfghhhhhhy   3rqqrO    <669O    >569q+    <66*    =8781    O953     &<24698533359qryuuuuuuuuuuuiuuuuuuuuuphhhhhhhhhhhhhhhhhhhhsyuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhs955555555555555555555555555555555555555%   -;;;><1335555555$   -;;*   %9wweypdfhhhhhhh4   eeq-   90990rtupaaaaaaaapiutee-   9qqerusfhhhhhhhh#  +twqr1    @868=    $867q1    @873    o5689O    166;     &<36999865690etyyuuuuuuuuuuuuuuuuuuuudhhhhhhhhhhhhhhhhhhhhfiuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhy55555555555555555555555555555555555555<   #;--:,<3355555551   #;;-+  Xqwqetisfhghhhhhp   1eq7   >q999qrtuuipipuippuytrr8   :wqqruadfhhhhhhh9   6ewweX    363%    #6689qX    276#    >769,    $867*     +13800q9999qrtyuuuuuuuuuuuuuuuuuuuuuufhhhhhhhhhhhhhhhhhhhhhpuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhh955555555555555555555555555555555555555@  .:-;;:<1335555554+  .;:-*   1wqqrupfghhhhhhh;  Oeeq$ ..q0990qrtuuuuuuuuuuuuttr&  XqqqetpdfghhhhhhfO  *tewe>            %8869q<    *76<    O6687X    4669$    .X159qeeeqqqrryuuuuuuuuuuuuuuuuuuuiuuighhhhhhhhhhhhhhhhhhhhhpyuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhh55555555555555555555555555555555555555:   $;-;;,<335555554:   $:-2+  +qqqeyidgghhhhhhr   1rq3   1q000rryuipiiipiiiiiuuu7   1wqwtuadghhhhhhh6   qwww0           =20979q9    X566X    <679= .  -8680-    . >69errtrrrtyyuuuuuuuuuuuuuuuuuuuuuuihhhhhhhhhhhhhhhhhhhhhhpyuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhh95555555555555555555555555555555555555O  X:--;><2355555553O  O:162   3eqerusdghhhhhhf#  $tqqO  +qqqwrtipaaaaaaaaaaaaapp+  Oeqqetpsgghhhhhhs   >ewqr&.         ;q0998qe*    >86;    #7685    O6680e1      *50ettyyyyyuuuuuuuuuuuuuuuuuuuuuuuuuhhhhhhhhhhhhhhhhhhhhhhpuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhht655555555555555555555555555555555555:   %;-;:<1335555555&  .:500X  +eqerypsghhhhhhh6  Oqeq3   1qqwryiasddddddddddddsd7   8wqqtuafghhhhhhh;  Oreqw7            -999qw7.   +665X    4679@    :789wt6      O50etyyuuuuuuuuuuuuuuuuuuuuuuuuuiuuughhhhhhhhhhhhhhhhhhhhhpyuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhs955555555555555555555555555555555555%   --;;>1135555553-   ,0eq>   =wqerisfghhhhhf9   8rwq-   9qqetpsdffgfgffgfdttgfa   *rqqryadghhhhhhhq   4rqwrO    *-@      79qeu+    ,76*  . *7681    O8680ruy      X49etyuuuuuuuuuuuuuuuuuuuuiuuuuuuuuudhhhhhhhhhhhhhhhhhhhhgiuuuhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhu65555555555555555555555555555555554#                    .4eew9   X                 Oqteww=                     #dgg;   9wqwtisfghhhhhhfX  Xewqe3    %63<     @70ey5    #961    X6678X    3679ruip&      48wryuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuphhhhhhhhhhhhhhhhhhhhduuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhu7555555555555555554555555555555545,@X     .         .+>qyrre&  X8O             O-7utreer9=X                   ufg5   +ewqruadghhhhhhf;   >eqweX .  451>     -6qyyO    366#    ;769<    $769wtpaa3     O36qrtuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuighhhhhhhhhhhhhhhhhhhpyuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhp95455555555555555555555555555555331:;---;><1111111117tutre8   1q999wtipaaasssaaaiutrrrruyrq09qruiasasasasassssddddaitrwetisfhghhhhhhgfautewr;    -654%    o56eu<    =86:  . O8687     6669ruada4     @160ryuuuuuuuuuuuuuuuuuuiuuuuuuuuuuuuahhhhhhhhhhhhhhhhhhsuuuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhde555555555555555555555555555555331,;---;;,<<<<<1<<8tutrtt+  Or099qwtuipppppppiiuytrtyiiiteq0qryupppppppppppppssdspurreriafghhhhhhhhgdaueee8    X665<     ;38e9    X765X    1679%    >669wyadfd5     *150rtuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuushhghhhhhhhhhhhhhgiyuuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhiq555555555555555555555555555533<<:;-;;>>,>,>,,,6ttyttt3   5q9990rttuuuuuuyuuyyttyupaapurewertyyuuuuuuuuuuuipasaputttypsgghhhhhhhggsautrt*    ,667#   .+159e*    >86;.   $6695    .8680tisfgd3    X:160rtuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuudhhhhhhhhhhhhhhgiuiuuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhfi055555555555555555555555555332<>>:;:>>>,<>,>6tuuuiiuX  *eq00wrryyuuuuyuuuuuyuiiasdsaputrtttuuyuyuuuuyyuupaassaiuyupsfghhhhhhhhhgdaiuy6    O967<     146q3    O865     5679O    ,769wuafggfX    #:150rtuuuuuuuuuuuuuuuuuuuuuuiuuuuuuuuuuushhhhhhhhhhhhfiuuuuuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhfiq5555555555555555555554555431<<<,<<<<<<<15tippppa<.  0wqqetyippppppppppippaasdfgfdsapiipipppppppppppppaadddsaapasfghhhhhhhhhggfsapi+    1678O    -5589+    176%    -679,    +85O    rgg0    X-,36qrtuuuuuuuuuuuuiuuuuuuuuuuuuuuuuiuuuuupfghhhhhhhfauuuuuuuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhat85555555555555555555555433221111111113tsssssdr   >eqqetupaasaaasaasssasddfgggggfdssasassaassasaasssddffffddddfgghhhhhhhhhhhgfdd8    $878>    X55601    $761    X5788o    37-    -dfd@    &>,39qryuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuypsdffdspuuuuuuuuuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhfiw6555555555555555555555333332322331efffdffs+   qqwetiadfffdfddfffdfffffgghhhgggfffdfdffdfdfdfdfdfffggfggfggghhhhhhhhhhhhggggp     6666     >6699     676+    >679-    =73    .yss8   .O,,159etyuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuyuyuuuuuuuuuuuuihhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhfiw7545555555555555555555545353350dgggghg4   -rqqruadfggghghhggghgghhhhhhhhhhghghhghgghghghghghghhhhhhhhghghhhhhhhhhhhhhhhg<    ;669&    +666q*    -76,  . O8686    X66$    <uiuO  . -><57qryuuuuuuuuuuuuuuuuuuuuuuuuuiuuuuuuuuiuuuuuuuuuuuuuuuuuuuuuughhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhdir955555555555555555555555555uhhhhhhhgfsuteqrtpdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhu    X7764 .   15696    .766# .  <679$.   <7<    oqty-    %<<149etyuuuuuuuuuuuuuiuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuiuuuuuighhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhsue85555455555555555555559dhhhhhhhgfauteeriadghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh*    >865X    -667q#    >765     668=    =86%    -0q1    +4357qtiasdddddddddddddddsdddddddsddddddsddddddddddddsddddddddddddshhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfaue755555555555555555ehhhhhhhhgdautrtuadghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhq     ;-%     +76703    O868:   . >>%    +975     %2*    X6669wuadghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhsit06553555555555phhhhhhhggfaiuuupsfghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfO .          +76680X    3869- .         %986>     . .   X5877qtpsgghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgaur065455555dhhhhhhhhgfdaapadfghghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh6 .          -8767q>    *7699*  .    .  -0989;          +98669qusfggfffghhhhgfffghhhhgfffghhhhgdfdghhhhgfffghhhhgfffghhhhdfffghhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgspte955fhhhhhhhhggfddddfghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhs       .   O3987800     5760e4        O3099997        X;996136qpdfhfuuuahhhhduuushhhhduuudhhhhduuufhhhhsuuufhhhhauuughhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhfahhhhhhhhhhggffggghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh-        X%>688780r&    ,869qry<     #;89999qwr3o    O=58887559rdghhguuushhhhfuuishhhhduuudhhhhduuufhhhhsuuufhhhhauuufhhhhauuighhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgdauq841<15566890ryupute9880ruuur3<;1156889qrtyyr41>,145670979qyfgghfuuuahhhhfuuushhhhdiuudhhhhduuudhhhhsuuufhhhhauiughhhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhggdptq8433356789qrupaaite990ruppitq85345790wtypiitw84335680qe0qrugghhfuuushhhhfuuushhhhduuudhhhhsuuudhhhhauuufhhhhsuuufhhhhpuuighhhhhhhhhhhhhghhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhg7-&508666880qrtipssaiyeqqrtpsspue076699qetipsaaurq866790ettwrtphhhhfuuuahhhhfuuudhhhhduuudhhhhduuidhhhhsuuufhhhhauuifsfhhauuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhg9O550eqq0qwertuisdffsauyttupsddsayrqqqqrtupaddfdpureq0qeryiprtyahhhhfuuushhhhfuuushhhhfuuudhhhhduuudhhhhsuuufhhhhauuug;0hhauuighhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh;8saiuuttuyuipaddgggfsaiiiasffgfaaiytyuupaddgggfdpuuyyuupadauuuahhhhfiuiahhhhfiuudhhhhduuidhhhhduuufhhhhsiiufhhhhauuug>0hhpiuughhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhO   ysaaaOt3  4dggp%  %usssu&  *ifssaaaasdffghOpggsOtaat-  -ufggXahhpOfggOp7 .5fgfgghhhgggf9    6gggOphhhXigg9    6gggX    9gggi*  *pghhO; 4@+dhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhp*4tgffdf %&er phh+;yu&&gfg+:uu*%hgffddfffghhh uhgd tdd@%yy:+hhh uhhu hhh **tr ahhhhhhhhhhh 0uut<hhh uhhf uhh 0uut<hhhp*4uufhhh$;uu**hhh *0 7*0hhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh:9hhgghg 3ggh<shh uhhu hgh uhhu hghggghgghhhh<5hhwOggg uhhy hhh thhu hhh 4hhh<shhhhhhhhhhh4 5uhhhhh<5hheOhhh4 5uhhhhhh;0hhhhhh uhhu hhh uu h;0hhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh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hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh" +}; diff --git a/roms/openbios/arch/unix/plugins/plugin_qt/pciconfig.h b/roms/openbios/arch/unix/plugins/plugin_qt/pciconfig.h new file mode 100644 index 00000000..88b0e1aa --- /dev/null +++ b/roms/openbios/arch/unix/plugins/plugin_qt/pciconfig.h @@ -0,0 +1,42 @@ +/* tag: pci config space dump for qt plugin's pci device. + * + * Copyright (C) 2003 Stefan Reinauer + * + * See the file "COPYING" for further information about + * the copyright and warranty status of this work. + */ + +static unsigned char pci_config_space[256]={ +  0x02, 0x10, 0x36, 0x43, 0x87, 0x02, 0xb0, 0x02, +  0x00, 0x00, 0x00, 0x03, 0x10, 0x42, 0x00, 0x00, +  0x08, 0x00, 0x00, 0xf0, 0x01, 0xb0, 0x00, 0x00, +  0x00, 0x00, 0x50, 0xe8, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x34, 0x17, 0x0a, 0x10, +  0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x05, 0x01, 0x08, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x34, 0x17, 0x0a, 0x10, +  0x01, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x00, +  0x02, 0x50, 0x20, 0x00, 0x07, 0x02, 0x00, 0x2f, +  0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/roms/openbios/arch/unix/plugins/plugin_qt/plugin_qt.cpp b/roms/openbios/arch/unix/plugins/plugin_qt/plugin_qt.cpp new file mode 100644 index 00000000..07234dc0 --- /dev/null +++ b/roms/openbios/arch/unix/plugins/plugin_qt/plugin_qt.cpp @@ -0,0 +1,128 @@ +/* tag: qt plugin framebuffer class + * + * Copyright (C) 2003 Stefan Reinauer + * + * See the file "COPYING" for further information about + * the copyright and warranty status of this work. + */ + +#include "plugin_qt.h" +#include "logo.xpm" + +#include <iostream> + +static const int sizex=640; +static const int sizey=480; +static const int depth=8; + +static unsigned char color[256][3]={ +	{ 0x00, 0x00, 0x00 }, +	{ 0x00, 0x00, 0xaa }, +	{ 0x00, 0xaa, 0x00 }, +	{ 0x00, 0xaa, 0xaa }, +	{ 0xaa, 0x00, 0x00 }, +	{ 0xaa, 0x00, 0xaa }, +	{ 0xaa, 0x55, 0x00 }, +	{ 0xaa, 0xaa, 0xaa }, +	{ 0x55, 0x55, 0x55 }, +	{ 0x55, 0x55, 0xff }, +	{ 0x55, 0xff, 0x55 }, +	{ 0x55, 0xff, 0xff }, +	{ 0xff, 0x55, 0x55 }, +	{ 0xff, 0x55, 0xff }, +	{ 0xff, 0xff, 0x55 }, +	{ 0xff, 0xff, 0xff }, +}; + +FrameBufferWidget::FrameBufferWidget(QWidget *parent, const char * name) +: QWidget(parent, name, Qt::WType_TopLevel) +{ +	setCaption ("OpenBIOS"); +	setIcon(QPixmap(logo)); + +	QPopupMenu *file = new QPopupMenu (this); + +	file->insertItem( "E&xit",  this, SLOT(quit()), CTRL+Key_Q ); + +	QPopupMenu *help = new QPopupMenu( this ); +	help->insertItem("&About OpenBIOS", this, SLOT(about()), CTRL+Key_H ); +	help->insertItem( "About &Qt", this, SLOT(aboutQt()) ); + +	menu = new QMenuBar( this ); +	Q_CHECK_PTR( menu ); +	menu->insertItem( "&File", file ); +	menu->insertSeparator(); +	menu->insertItem( "&Help", help ); +	menu->setSeparator( QMenuBar::InWindowsStyle ); + +	setFixedSize(sizex,sizey+menu->heightForWidth(sizex)); + +	buffer.create(sizex, sizey, depth, 256); + +	for (int i=16; i < 256; i++) { +		color[i][0]=i; +		color[i][1]=i; +		color[i][2]=i; +	} + +	for (int i=0; i< 256; i++) +		buffer.setColor(i, qRgb(color[i][0], color[i][1], color[i][2])); + +	buffer.fill( 0 ); + +	updatetimer=new QTimer(this); +	connect( updatetimer, SIGNAL(timeout()), this, SLOT(update()) ); +	updatetimer->start(200,FALSE); + +	setMouseTracking( TRUE ); +} + +unsigned char * FrameBufferWidget::getFrameBuffer(void) +{ +	return buffer.bits(); +} + +void FrameBufferWidget::paintEvent ( QPaintEvent * ) +{ +	QPainter p( this ); +	p.drawImage(0,menu->heightForWidth(sizex),buffer, 0,0, sizex, sizey); +} + +void FrameBufferWidget::about() +{ +	QMessageBox::about( this, "About OpenBIOS", +			  "              Welcome to OpenBIOS 1.01\n" +			  "  IEEE 1275-1994 Open Firmware implementation\n\n" +			  "written by Stefan Reinauer <stepan@openbios.org>\n\n" +			  "                http://www.openbios.org/\n"); +} + +void FrameBufferWidget::aboutQt() +{ +	QMessageBox::aboutQt( this, "OpenBIOS" ); +} + +void FrameBufferWidget::quit() +{ +	extern volatile int gui_running; +	extern volatile int interruptforth; + +	gui_running=0; +	interruptforth=1; + +	qApp->quit(); +} + +void FrameBufferWidget::update() +{ +	QPainter p( this ); +	p.drawImage(0,menu->heightForWidth(sizex),buffer, 0,0, sizex, sizey); +} + +void FrameBufferWidget::keyPressEvent(QKeyEvent * e) +{ +	int a=e->ascii(); +	if (a) { +		std::cout << " key '" << e->text() << "' pressed" << std::endl; +	} +} diff --git a/roms/openbios/arch/unix/plugins/plugin_qt/plugin_qt.h b/roms/openbios/arch/unix/plugins/plugin_qt/plugin_qt.h new file mode 100644 index 00000000..a1ed76fe --- /dev/null +++ b/roms/openbios/arch/unix/plugins/plugin_qt/plugin_qt.h @@ -0,0 +1,44 @@ +/* tag: qt plugin framebuffer class description + * + * Copyright (C) 2003 Stefan Reinauer + * + * See the file "COPYING" for further information about + * the copyright and warranty status of this work. + */ + +#ifndef __framebufferwidget_h +#define __framebufferwidget_h + +#include <qapplication.h> +#include <qwidget.h> +#include <qimage.h> +#include <qpainter.h> +#include <qmenubar.h> +#include <qpopupmenu.h> +#include <qmessagebox.h> +#include <qstatusbar.h> +#include <qtimer.h> + +class FrameBufferWidget : public QWidget { +	Q_OBJECT +	public: +		FrameBufferWidget(QWidget *parent=0, const char *name=0); +		unsigned char *getFrameBuffer(void); + +	public slots: +		void quit(); +		void about(); +		void aboutQt(); +		void update(); + +	private: +		QImage     buffer; +		QMenuBar   *menu; +		QStatusBar *status; +		QTimer     *updatetimer; +		void paintEvent ( QPaintEvent * ); +	protected: +		void keyPressEvent(QKeyEvent * e); +}; + +#endif diff --git a/roms/openbios/arch/unix/plugins/plugin_qt/plugin_qt.pro b/roms/openbios/arch/unix/plugins/plugin_qt/plugin_qt.pro new file mode 100644 index 00000000..96accd36 --- /dev/null +++ b/roms/openbios/arch/unix/plugins/plugin_qt/plugin_qt.pro @@ -0,0 +1,18 @@ +# tag: qmake project file for OpenBIOS QT plugin +# +# Copyright (C) 2003 Stefan Reinauer +# +# See the file "COPYING" for further information about +# the copyright and warranty status of this work. +# + +TEMPLATE    = app +CONFIG     += qt thread warn_on release +LIBS	    = -shared +INCLUDEPATH = qbuild $(ABSOINC) $(TOPDIR)/include $(PLUGINDIR)/plugin_pci +DESTDIR     = qbuild +OBJECTS_DIR = qbuild +MOC_DIR     = qbuild +TARGET      = plugin_qt.so +HEADERS	    = $(PLUGINDIR)/plugin_qt/plugin_qt.h +SOURCES	    = $(PLUGINDIR)/plugin_qt/plugin_qt.cpp $(PLUGINDIR)/plugin_qt/qt_main.cpp diff --git a/roms/openbios/arch/unix/plugins/plugin_qt/qt_main.cpp b/roms/openbios/arch/unix/plugins/plugin_qt/qt_main.cpp new file mode 100644 index 00000000..ea558d31 --- /dev/null +++ b/roms/openbios/arch/unix/plugins/plugin_qt/qt_main.cpp @@ -0,0 +1,102 @@ +/* tag: openbios qt plugin skeleton + * + * Copyright (C) 2003 Stefan Reinauer + * + * See the file "COPYING" for further information about + * the copyright and warranty status of this work. + */ + + +extern "C" { +#include <pthread.h> +#include <unistd.h> +#include "unix/plugins.h" +#include "unix/plugin_pci.h" +} +#include "plugin_qt.h" +#include "pciconfig.h" +#include "fcode.h" + +#define DEBUG + +volatile unsigned char * fb=0; +volatile int gui_running=0; + +typedef struct { +	int argc; +	char **argv; +} threaddata; + +void *gui_thread(void *ptr) +{ +	threaddata *td=(threaddata *)ptr; + +	QApplication a(td->argc, td->argv); +	FrameBufferWidget w; + +	a.setMainWidget(&w); +	w.show(); + +	fb=w.getFrameBuffer(); + +	gui_running=-1; +	a.exec(); +	gui_running=0; + +	return 0; +} + +extern "C" { +extern int plugin_qt_init(void); +int plugin_qt_init(void) +{ +	pthread_t mythread; +	char *args[]={ "plugin_qt" }; +	threaddata mytd = { 1, args }; + +#ifdef DEBUG +	printf("Initializing \"framebuffer\" plugin..."); +#endif +	pthread_create(&mythread, NULL, gui_thread, &mytd); +	while (!fb) +		usleep(20); + +	/* now we have the framebuffer start address. +	 * updating pci config space to reflect this +	 */ +#if (BITS > 32) +	*(u32 *)(pci_config_space+0x14)=(u32)((unsigned long)fb>>32); +#else +	*(u32 *)(pci_config_space+0x14)=0; +#endif +	*(u32 *)(pci_config_space+0x10)=(u32)((unsigned long)fb&0xffffffff); + +	/* next is to write the rom address. We write that at a random +	 * address in pci config space for now. +	 */ +#if (BITS > 32) +	*(u32 *)(pci_config_space+0x34)=(u32)((unsigned long)qt_fcode>>32); +#else +	*(u32 *)(pci_config_space+0x34)=0; +#endif +	*(u32 *)(pci_config_space+0x30)=(u32)((unsigned long)qt_fcode&0xffffffff); + +	/* FIXME: we need to put the fcode image for this +	 * device to the rom resource, once it exists +	 */ + +	/* register pci device to be available to beginagain */ +	pci_register_device(0, 2, 0, pci_config_space); + +#ifdef DEBUG +	printf("done.\n"); +#endif +	return 0; +} + +PLUGIN_AUTHOR("Stefan Reinauer <stepan@openbios.org>") +PLUGIN_DESCRIPTION("QT gui plugin emulating framebuffer device") +PLUGIN_LICENSE("GPL v2") +PLUGIN_DEPENDENCIES("pci") + +} diff --git a/roms/openbios/arch/unix/plugins/plugin_qt/qt_rom.fs b/roms/openbios/arch/unix/plugins/plugin_qt/qt_rom.fs new file mode 100644 index 00000000..1879c365 --- /dev/null +++ b/roms/openbios/arch/unix/plugins/plugin_qt/qt_rom.fs @@ -0,0 +1,85 @@ +\ tag: Property management +\  +\ this code implements an IEEE 1275-1994 fcode driver +\ for the OpenBIOS qt interface +\  +\ Copyright (C) 2003 Stefan Reinauer +\  +\ See the file "COPYING" for further information about +\ the copyright and warranty status of this work. +\  + +hex + +tokenizer[ 1002 4336 0300 23 ]tokenizer ( -- vid did classid revision ) + +pci-revision + +pci-header + +fcode-version2 +headers + +" dev /pci" evaluate +new-device + +  " ATY,QTEMU" device-name +  " display"   device-type +   +  " iso8859-1" encode-string +  " character-set" property + +  true encode-int +  " iso6429-1983-colors" property + +  : qt-open +    \ [..] +    ." opening framebuffer device." cr +    10 10 " pci-l@" evaluate +    /n 8 = if +      10 14 " pci-l@" evaluate +      20 << or +    then +    ." framebuffer pointer is at 0x" dup . cr +    to frame-buffer-adr +    default-font set-font +    d# 640 d# 480 d# 80 d# 30 fb8-install +    true +    ; + +  : qt-close +    ." QT Interface closed." cr +    0 to frame-buffer-adr +    ; +    +  : qt-selftest +    ." QT Interface selftest" cr +    0 +    ; + +  ['] qt-open     is-install +  ['] qt-close    is-remove +  ['] qt-selftest is-selftest + +  external + +\ the following words will be defined by fb8-install +\  +   +\  : open  ( -- true ) +\    ; +   +\  : write ( addr len -- actual ) +\    ; +   +\  : draw-logo ( line# addr width height -- ) +\    ; +   +\  : restore ( -- ) +\    ; +     +finish-device + +fcode-end + +pci-end diff --git a/roms/openbios/arch/unix/tree.fs b/roms/openbios/arch/unix/tree.fs new file mode 100644 index 00000000..a7529b00 --- /dev/null +++ b/roms/openbios/arch/unix/tree.fs @@ -0,0 +1,116 @@ +:noname  +  ."   Type 'help' for detailed information" cr +  ; DIAG-initializer + +" /" find-device + +new-device +  " memory" device-name +  \ 12230 encode-int " reg" property +  external +  : open true ; +  : close ; +  \ claim ( phys size align -- base ) +  \ release ( phys size -- ) +finish-device + +new-device +  " cpus" device-name +  1 " #address-cells" int-property +  0 " #size-cells" int-property + +  external +  : open true ; +  : close ; +  : decode-unit parse-hex ; + +finish-device + +: make-openable ( path ) +  find-dev if +    begin ?dup while +      \ install trivial open and close methods +      dup active-package! is-open +      parent +    repeat +  then +; + +: preopen ( chosen-str node-path ) +  2dup make-openable +     +  " /chosen" find-device +  open-dev ?dup if +    encode-int 2swap property +  else +    2drop +  then +; +  +:noname +  set-defaults +; SYSTEM-initializer +   + +\ preopen device nodes (and store the ihandles under /chosen) +:noname +  " memory" " /memory" preopen +  " mmu" " /cpus/@0" preopen +  " stdout" " /builtin/console" preopen +  " stdin" " /builtin/console" preopen +  device-end +; SYSTEM-initializer + +\ use the tty interface if available +:noname +  " /builtin/console" find-dev if drop +    " /builtin/console" " input-device" $setenv +    " /builtin/console" " output-device" $setenv +  then +; SYSTEM-initializer +	     +:noname +  " keyboard" input +; CONSOLE-IN-initializer + +dev / + +\ node suitable for non-PCI devices  +new-device +  " unix" device-name +	0 encode-int " #address-cells" property +	0 encode-int " #size-cells" property +	 +	external +  : open true ; +  : close ; + +\ block device node +new-device +  " block" device-name +  " unix-block" device-type +	1 " #address-cells" int-property +	0 " #size-cells" int-property +	 +	external +  : open true ; +  : close ; +  : decode-unit parse-hex ; + +\ testnode +\ new-device +\   " kappa" device-name +\  +\   1 encode-int " reg" property +\   external +\   : open true ; +\   : close ; +\ finish-device + +finish-device +finish-device + +dev /aliases +" /unix/block/disk" encode-string " hd" property + +device-end diff --git a/roms/openbios/arch/unix/unix.c b/roms/openbios/arch/unix/unix.c new file mode 100644 index 00000000..1f628eb7 --- /dev/null +++ b/roms/openbios/arch/unix/unix.c @@ -0,0 +1,611 @@ +/* tag: hosted forth environment, executable code + * + * Copyright (C) 2003-2005 Patrick Mauritz, Stefan Reinauer + * + * See the file "COPYING" for further information about + * the copyright and warranty status of this work. + */ + +#include <stdio.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <signal.h> +#define __USE_LARGEFILE64 +#include <fcntl.h> +#include <unistd.h> +#include <termios.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <stdarg.h> + +#ifdef __GLIBC__ +#define _GNU_SOURCE +#include <getopt.h> +#endif + +#include "sysinclude.h" +#include "mconfig.h" +#include "config.h" +#include "kernel/kernel.h" +#include "dict.h" +#include "kernel/stack.h" +#include "arch/unix/plugins.h" +#include "libopenbios/bindings.h" +#include "libopenbios/console.h" +#include "libopenbios/openbios.h" +#include "openbios-version.h" + +#include "blk.h" +#include "libopenbios/ofmem.h" + +#define MEMORY_SIZE	(4*1024*1024)	/* 4M ram for hosted system */ +#define DICTIONARY_SIZE	(256*1024)	/* 256k for the dictionary   */ + +#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS==64) +#define lseek lseek64 +#define __LFS O_LARGEFILE +#else +#define __LFS 0 +#endif + +/* prototypes */ +static void exit_terminal(void); +void boot(void); + +unsigned long virt_offset = 0; + +/* local variables */ + +static ucell *memory; + +static int diskemu; + +static int segfault = 0; +static int verbose = 0; + +#if defined(CONFIG_PPC) || defined(CONFIG_SPARC64) +unsigned long isa_io_base; +#endif + +int errno_int;	/* implement for fs drivers, needed to build on Mac OS X */ + +ucell ofmem_claim(ucell addr, ucell size, ucell align) +{ +    return 0; +} + +#ifdef CONFIG_PPC +extern void flush_icache_range(char *start, char *stop); + +void flush_icache_range(char *start, char *stop) +{ +} +#endif + +#ifdef CONFIG_PPC +/* Expose system level is_machine helpers to make generic code easier */ + +#include "drivers/drivers.h" +int is_apple(void) +{ +    return 0; +} + +int is_oldworld(void) +{ +    return 0; +} + +int is_newworld(void) +{ +    return 0; +} +#endif + +#if 0 +static void write_dictionary(char *filename) +{ +	FILE *f; +	xt_t initxt; + +	initxt = findword("initialize-of"); +	if (!initxt) +		printk("warning: dictionary needs word called initialize-of\n"); + +	f = fopen(filename, "w"); +	if (!f) { +		printk("panic: can't open dictionary.\n"); +		exit_terminal(); +		exit(1); +	} + +	fwrite(DICTID, 16, 1, f); +	fwrite(dict, dicthead, 1, f); + +	/* Write start address and last to relocate on load */ +	fwrite(&dict, sizeof(ucell), 1, f); +	fwrite(&last, sizeof(ucell), 1, f); + +	fclose(f); + +#ifdef CONFIG_DEBUG_DICTIONARY +	printk("wrote dictionary to file %s.\n", filename); +#endif +} +#endif + +static ucell read_dictionary(char *fil) +{ +	int ilen; +	ucell ret; +	char *mem; +	FILE *f; +	struct stat finfo; + +	if (stat(fil, &finfo)) +		return 0; + +	ilen = finfo.st_size; + +	if ((mem = malloc(ilen)) == NULL) { +		printk("panic: not enough memory.\n"); +		exit_terminal(); +		exit(1); +	} + +	f = fopen(fil, "r"); +	if (!f) { +		printk("panic: can't open dictionary.\n"); +		exit_terminal(); +		exit(1); +	} + +	if (fread(mem, ilen, 1, f) != 1) { +		printk("panic: can't read dictionary.\n"); +		fclose(f); +		exit_terminal(); +		exit(1); +	} +	fclose(f); + +	ret = load_dictionary(mem, ilen); + +	free(mem); +	return ret; +} + + +/* + * functions used by primitives + */ + +static int unix_availchar(void) +{ +	int tmp = getc(stdin); +	if (tmp != EOF) { +		ungetc(tmp, stdin); +		return -1; +	} +	return 0; +} + +static int unix_putchar(int c) +{ +	putc(c, stdout); +	return c; +} + +static int unix_getchar(void) +{ +	return getc(stdin); +} + +static struct _console_ops unix_console_ops = { +	.putchar = unix_putchar, +	.availchar = unix_availchar, +	.getchar = unix_getchar +}; + +u8 inb(u32 reg) +{ +#ifdef CONFIG_PLUGINS +	io_ops_t *ior = find_iorange(reg); +	if (ior) +		return ior->inb(reg); +#endif + +	printk("TRAP: io byte read @0x%x", reg); +	return 0xff; +} + +u16 inw(u32 reg) +{ +#ifdef CONFIG_PLUGINS +	io_ops_t *ior = find_iorange(reg); +	if (ior) +		return ior->inw(reg); +#endif + +	printk("TRAP: io word read @0x%x", reg); +	return 0xffff; +} + +u32 inl(u32 reg) +{ +#ifdef CONFIG_PLUGINS +	io_ops_t *ior = find_iorange(reg); +	if (ior) +		return ior->inl(reg); +#endif + +	printk("TRAP: io long read @0x%x", reg); +	return 0xffffffff; +} + +void outb(u32 reg, u8 val) +{ +#ifdef CONFIG_PLUGINS +	io_ops_t *ior = find_iorange(reg); +	if (ior) { +		ior->outb(reg, val); +		return; +	} +#endif + +	printk("TRAP: io byte write 0x%x -> 0x%x", val, reg); +} + +void outw(u32 reg, u16 val) +{ +#ifdef CONFIG_PLUGINS +	io_ops_t *ior = find_iorange(reg); +	if (ior) { +		ior->outw(reg, val); +		return; +	} +#endif +	printk("TRAP: io word write 0x%x -> 0x%x", val, reg); +} + +void outl(u32 reg, u32 val) +{ +#ifdef CONFIG_PLUGINS +	io_ops_t *ior = find_iorange(reg); +	if (ior) { +		ior->outl(reg, val); +		return; +	} +#endif +	printk("TRAP: io long write 0x%x -> 0x%x", val, reg); +} + +/* + * terminal initialization and cleanup. + */ + +static struct termios saved_termios; + +static void init_terminal(void) +{ +	struct termios termios; + +	tcgetattr(0, &saved_termios); +	tcgetattr(0, &termios); +	termios.c_lflag &= ~(ICANON | ECHO); +        termios.c_cc[VMIN] = 1; +        termios.c_cc[VTIME] = 3; // 300 ms +	tcsetattr(0, 0, &termios); +} + +static void exit_terminal(void) +{ +	tcsetattr(0, 0, &saved_termios); +} + +/* + *  segmentation fault handler. linux specific? + */ + +static void +segv_handler(int signo __attribute__ ((unused)), +	     siginfo_t * si, void *context __attribute__ ((unused))) +{ +	static int count = 0; +	ucell addr = 0xdeadbeef; + +	if (count) { +		printk("Died while dumping forth dictionary core.\n"); +		goto out; +	} + +	count++; + +	if (PC >= (ucell) dict && PC <= (ucell) dict + dicthead) +		addr = *(ucell *) PC; + +	printk("panic: segmentation violation at %x\n", (ucell)si->si_addr); +	printk("dict=0x%x here=0x%x(dict+0x%x) pc=0x%x(dict+0x%x)\n", +	       (ucell)dict, (ucell)dict + dicthead, dicthead, PC, PC - (ucell) dict); +	printk("dstackcnt=%d rstackcnt=%d instruction=%x\n", +	       dstackcnt, rstackcnt, addr); + +#ifdef CONFIG_DEBUG_DSTACK +	printdstack(); +#endif +#ifdef CONFIG_DEBUG_RSTACK +	printrstack(); +#endif +#if 0 +	printk("Writing dictionary core file\n"); +	write_dictionary("forth.dict.core"); +#endif + +      out: +	exit_terminal(); +	exit(1); +} + +/* + *  Interrupt handler. linux specific? + *  Restore terminal state on ctrl-C. + */ + +static void +int_handler(int signo __attribute__ ((unused)), +            siginfo_t * si __attribute__ ((unused)), +            void *context __attribute__ ((unused))) +{ +    printk("\n"); +    exit_terminal(); +    exit(1); +} + +/* + * allocate memory and prepare engine for memory management. + */ + +static void init_memory(void) +{ +	memory = malloc(MEMORY_SIZE); +	if (!memory) { +		printk("panic: not enough memory on host system.\n"); +		exit_terminal(); +		exit(1); +	} + +	memset (memory, 0, MEMORY_SIZE); +	/* we push start and end of memory to the stack +	 * so that it can be used by the forth word QUIT +	 * to initialize the memory allocator +	 */ + +	PUSH((ucell) memory); +	PUSH((ucell) memory + MEMORY_SIZE); +} + +void exception(__attribute__((unused)) cell no) +{ +	/* +	 * this is a noop since the dictionary has to take care +	 * itself of errors it generates outside of the bootstrap +	 */ +} + +static void +arch_init( void ) +{ +	openbios_init(); +	modules_init(); +	if(diskemu!=-1) +		blk_init(); + +	device_end(); +        bind_func("platform-boot", boot); +} + +int +read_from_disk( int channel, int unit, int blk, unsigned long mphys, int size ) +{ +	// channels and units not supported yet. +	unsigned char *buf=(unsigned char *)mphys; + +	if(diskemu==-1) +		return -1; + +	//printk("read: ch=%d, unit=%d, blk=%ld, phys=%lx, size=%d\n", +	//		channel, unit, blk, mphys, size); + +	lseek(diskemu, (ducell)blk*512, SEEK_SET); +	read(diskemu, buf, size); + +	return 0; +} + +/* + * main loop + */ + +#define BANNER	"OpenBIOS core. (C) 2003-2006 Patrick Mauritz, Stefan Reinauer\n"\ +		"This software comes with absolutely no warranty. "\ +		"All rights reserved.\n\n" + + +#define USAGE   "usage: %s [options] [dictionary file|source file]\n\n" + +int main(int argc, char *argv[]) +{ +	struct sigaction sa; +#if 0 +	unsigned char *dictname = NULL; +#endif +	int c; + +	const char *optstring = "VvhsD:P:p:f:?"; + +	while (1) { +#ifdef __GLIBC__ +		int option_index = 0; +		static struct option long_options[] = { +			{"version", 0, NULL, 'V'}, +			{"verbose", 0, NULL, 'v'}, +			{"help", 0, NULL, 'h'}, +//			{"dictionary", 1, NULL, 'D'}, +			{"segfault", 0, NULL, 's'}, +#ifdef CONFIG_PLUGINS +			{"plugin-path", 1, NULL, 'P'}, +			{"plugin", 1, NULL, 'p'}, +#endif +			{"file", 1, NULL, 'f'} +		}; + +		c = getopt_long(argc, argv, optstring, long_options, +				&option_index); +#else +		c = getopt(argc, argv, optstring); +#endif +		if (c == -1) +			break; + +		switch (c) { +		case 'V': +                        printk(BANNER "Version " OPENBIOS_VERSION_STR "\n"); +			return 0; +		case 'h': +		case '?': +                        printk(BANNER "Version " OPENBIOS_VERSION_STR "\n" +                               USAGE, argv[0]); +			return 0; +		case 'v': +			verbose = 1; +			break; +		case 's': +			segfault = 1; +			break; +#if 0 +		case 'D': +			printk("Dumping final dictionary to '%s'\n", optarg); +			dictname = optarg; +			break; +#endif +#ifdef CONFIG_PLUGINS +		case 'P': +			printk("Plugin search path is now '%s'\n", optarg); +			plugindir = optarg; +			break; +		case 'p': +			printk("Loading plugin %s\n", optarg); +			load_plugin(optarg); +			break; +#endif +		case 'f': +			diskemu=open(optarg, O_RDONLY|__LFS); +			if(diskemu!=-1) +				printk("Using %s as harddisk.\n", optarg); +			else +				printk("%s not found. no harddisk node.\n", +						optarg); +			break; +		default: +			return 1; +		} +	} + +	if (argc < optind + 1) { +		printk(USAGE, argv[0]); +		return 1; +	} + +	/* Initialise console */ +	init_console(unix_console_ops); + +	if ((dict = (unsigned char *) malloc(DICTIONARY_SIZE)) == NULL) { +		printk("panic: not enough memory.\n"); +		return 1; +	} + +	dictlimit = DICTIONARY_SIZE; +	memset(dict, 0, DICTIONARY_SIZE); + +	if (!segfault) { +		if (verbose) +			printk("Installing SIGSEGV handler..."); + +		sa.sa_sigaction = segv_handler; +		sigemptyset(&sa.sa_mask); +		sa.sa_flags = SA_SIGINFO | SA_NODEFER; +		sigaction(SIGSEGV, &sa, NULL); + +		if (verbose) +			printk("done.\n"); +	} + +	/* set terminal to do non blocking reads */ +	init_terminal(); + +        if (verbose) +            printk("Installing SIGINT handler..."); + +        sa.sa_sigaction = int_handler; +        sigemptyset(&sa.sa_mask); +        sa.sa_flags = SA_SIGINFO | SA_NODEFER; +        sigaction(SIGINT, &sa, NULL); + +        if (verbose) +            printk("done.\n"); + +	read_dictionary(argv[optind]); +	forth_init(); + +	PUSH_xt( bind_noname_func(arch_init) ); +	fword("PREPOST-initializer"); + +	PC = (cell)findword("initialize-of"); +	if (PC) { +		if (verbose) { +			if (optind + 1 != argc) +				printk("Warning: only first dictionary used.\n"); + +			printk("dictionary loaded (%d bytes).\n", dicthead); +			printk("Initializing memory..."); +		} +		init_memory(); + +		if (verbose) { +			printk("done\n"); + +			printk("Jumping to dictionary..."); +		} + +		enterforth((xt_t)PC); +#if 0 +		if (dictname != NULL) +			write_dictionary(dictname); +#endif + +		free(memory); + +	} else {		/* input file is not a dictionary */ +		printk("not supported.\n"); +	} + +	exit_terminal(); +	if (diskemu!=-1) +		close(diskemu); + +	free(dict); +	return 0; +} + +#undef printk +int +printk( const char *fmt, ... ) +{ +	int i; + +	va_list args; +	va_start( args, fmt ); +	i = vprintf(fmt, args ); +	va_end( args ); +	return i; +}  | 
