From: Ruba Merza Date: Sun, 1 Dec 2013 01:23:39 +0000 (-0600) Subject: Guest-side test tools, config, and X11 stuff for PARAGRAPH graphics device X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=6bc36dbea509d599d3c6fdb42e1a9c67144f5023 Guest-side test tools, config, and X11 stuff for PARAGRAPH graphics device --- diff --git a/guest/README b/guest/README new file mode 100644 index 0000000..937e852 --- /dev/null +++ b/guest/README @@ -0,0 +1,2 @@ +This directory contains guest code that can interact with particular Palacios features. + diff --git a/guest/linux/paragraph/README b/guest/linux/paragraph/README new file mode 100644 index 0000000..791f9a7 --- /dev/null +++ b/guest/linux/paragraph/README @@ -0,0 +1,41 @@ +This directory contains guest side code to use the in-progress +PARAGRAPH paravirtualized graphics card within a Linux guest, either +directly from a command-line testing tool or via X11. + +It also contains information about how to build a minimal instance of +X11 and then run it within a minimal guest. This is desirable for +testing. + +README - this file + +write_paragraph - manipulate PARAGRAPH from guest without X11 + +x11.patch - modify X11 dummy driver and config files to + output to PARAGRAPH + +x11_modified_files/ - X11 files that have been added/altered for + configuring X with PARAGRAPH (basically all + the files touched by x11.patch) + +build_x11_minimal/ - how to actually build X11 without poking a + stick in your eye + +run_x11_minimal/ - how to run your X11 in a tiny guest + (microcore-based) + + +The level of functionality here is sufficient to bring up +a basic X11 session and launch xclocks and xterms. + +Note that some documentation refers to "x11/". This is the +built X11 image, which should be burned into a virtual disk: + +1. Use dd to create a disk file +2. Use mkfs to build a filessytem on it +3. Use loopback mount to attach disk and + copy your x11 setup and needed shared libraries to it. +4. Unmount +5. Use disk file in your Palacios guest (via FILEDISK). + +For NU folks, this image is also sitting in /v-test/paragraph. + diff --git a/guest/linux/paragraph/build_x11_minimal/README b/guest/linux/paragraph/build_x11_minimal/README new file mode 100644 index 0000000..fcc46c4 --- /dev/null +++ b/guest/linux/paragraph/build_x11_minimal/README @@ -0,0 +1,60 @@ +To build the X11 universe on this machine (Parkinson-11): + +cd /opt/x11/src +./doit.sh + +the file "mymods.txt" are the modules you want built +and the file "myautoresume.txt" is how far you've gotten up to this point + +I have set this up so that it compiles, and it currently is all +compiled. + + +To build the universe on some other machine: + +- you will find a copy of everything in /441/pdinda/x11, + which should be identical to that in /opt/x11 - this includes + my changes to make it work + +- if you compile from /441 on a parkinson machine, make + sure the files you create are actually owner root. + /etc/idmapd must contain: + +Nobody-User = root +Nobody-Group = nobody + +- you need to install the following tools: + +yum install llvm llvm-devel +yum install libudev libudev-devel +yum install mtdev mtdev-devel + +- use the general instructions in http://wiki.x.org/wiki/ModularDevelopersGuide + +- make sure that you skip xf86-video-newport xf86-video-sis and other + drivers that depend on xaa + +- remove include of mibstore.h for anything that includes it + +mkdir -p /opt/x11/src +cd /opt/x11/src +git clone git://anongit.freedesktop.org/git/xorg/util/modular util/modular + +cd /opt/x11/src +./util/modular/build.sh --clone --autoresume myautoresume.txt /opt/x11/build + +This will + - clone package repositories as needed + - resume execution on a build failure if you rerrun it + - put its output in /opt/x11/build + +Also of note: + +./util/modular/build.sh -L /opt/x11/build > mymods.txt + +This will give you a list of the available modules to build. You +can then edit this file (mymods.txt) and build just those modules i +you want using: + +./util/modular/build.sh --clone --autoresume myautoresume.txt --modfile mymods.txt /opt/x11/build + diff --git a/guest/linux/paragraph/build_x11_minimal/doit.sh b/guest/linux/paragraph/build_x11_minimal/doit.sh new file mode 100755 index 0000000..903d3bd --- /dev/null +++ b/guest/linux/paragraph/build_x11_minimal/doit.sh @@ -0,0 +1,2 @@ +CUR=`pwd` +./util/modular/build.sh --clone --modfile mymods.txt --autoresume myautoresume.txt $CUR/../build diff --git a/guest/linux/paragraph/build_x11_minimal/myautoresume.txt b/guest/linux/paragraph/build_x11_minimal/myautoresume.txt new file mode 100644 index 0000000..3eca06a --- /dev/null +++ b/guest/linux/paragraph/build_x11_minimal/myautoresume.txt @@ -0,0 +1,429 @@ +PASS: util/macros +PASS: font/util +PASS: doc/xorg-sgml-doctools +PASS: doc/xorg-docs +PASS: proto/bigreqsproto +PASS: proto/compositeproto +PASS: proto/damageproto +PASS: proto/dmxproto +PASS: proto/dri2proto +PASS: proto/fixesproto +PASS: proto/fontsproto +PASS: proto/glproto +PASS: proto/inputproto +PASS: proto/kbproto +PASS: proto/randrproto +PASS: proto/recordproto +PASS: proto/renderproto +PASS: proto/resourceproto +PASS: proto/scrnsaverproto +PASS: proto/videoproto +PASS: proto/x11proto +PASS: proto/xcmiscproto +PASS: proto/xextproto +PASS: proto/xf86bigfontproto +PASS: proto/xf86dgaproto +PASS: proto/xf86driproto +PASS: proto/xf86vidmodeproto +PASS: proto/xineramaproto +PASS: xcb/proto +PASS: util/makedepend +PASS: lib/libxtrans +PASS: lib/libXau +PASS: lib/libXdmcp +PASS: xcb/pthread-stubs +PASS: xcb/libxcb +PASS: xcb/util +PASS: xcb/util-image +PASS: xcb/util-keysyms +PASS: xcb/util-renderutil +PASS: xcb/util-wm +PASS: lib/libX11 +PASS: lib/libXext +PASS: lib/libdmx +PASS: lib/libfontenc +PASS: lib/libFS +PASS: lib/libICE +PASS: lib/libSM +PASS: lib/libXt +PASS: lib/libXmu +PASS: lib/libXpm +PASS: lib/libXaw +PASS: lib/libXfixes +PASS: lib/libXcomposite +PASS: lib/libXrender +PASS: lib/libXdamage +PASS: lib/libXcursor +PASS: lib/libXfont +PASS: lib/libXft +PASS: lib/libXi +PASS: lib/libXinerama +PASS: lib/libxkbfile +PASS: lib/libXrandr +PASS: lib/libXRes +PASS: lib/libXScrnSaver +PASS: lib/libXtst +PASS: lib/libXv +PASS: lib/libXvMC +PASS: lib/libXxf86dga +PASS: lib/libXxf86vm +PASS: lib/libpciaccess +PASS: pixman/ +PASS: mesa/drm +PASS: mesa/mesa +PASS: data/bitmaps +PASS: app/appres +PASS: app/bdftopcf +PASS: app/beforelight +PASS: app/bitmap +PASS: app/editres +PASS: app/fonttosfnt +PASS: app/fslsfonts +PASS: app/fstobdf +PASS: app/iceauth +PASS: app/ico +PASS: app/listres +PASS: app/luit +PASS: app/mkcomposecache +PASS: app/mkfontdir +PASS: app/mkfontscale +PASS: app/oclock +PASS: app/rgb +PASS: app/rendercheck +PASS: app/rstart +PASS: app/scripts +PASS: app/sessreg +PASS: app/setxkbmap +PASS: app/showfont +PASS: app/smproxy +PASS: app/twm +PASS: app/viewres +PASS: app/x11perf +PASS: app/xauth +PASS: app/xbacklight +PASS: app/xbiff +PASS: app/xcalc +PASS: app/xclipboard +PASS: app/xclock +PASS: app/xcmsdb +PASS: app/xconsole +PASS: app/xcursorgen +PASS: app/xdbedizzy +PASS: app/xditview +PASS: app/xdm +PASS: app/xdpyinfo +PASS: app/xdriinfo +PASS: app/xedit +PASS: app/xev +PASS: app/xeyes +PASS: app/xf86dga +PASS: app/xfd +PASS: app/xfontsel +PASS: app/xfs +PASS: app/xfsinfo +PASS: app/xgamma +PASS: app/xgc +PASS: app/xhost +PASS: app/xinit +PASS: app/xinput +PASS: app/xkbcomp +PASS: app/xkbevd +PASS: app/xkbprint +PASS: app/xkbutils +PASS: app/xkill +PASS: app/xload +PASS: app/xlogo +PASS: app/xlsatoms +PASS: app/xlsclients +PASS: app/xlsfonts +PASS: app/xmag +PASS: app/xman +PASS: app/xmessage +PASS: app/xmh +PASS: app/xmodmap +PASS: app/xmore +PASS: app/xprop +PASS: app/xrandr +PASS: app/xrdb +PASS: app/xrefresh +PASS: app/xscope +PASS: app/xset +PASS: app/xsetmode +PASS: app/xsetroot +PASS: app/xsm +PASS: app/xstdcmap +PASS: app/xvidtune +PASS: app/xvinfo +PASS: app/xwd +PASS: app/xwininfo +PASS: app/xwud +PASS: xserver/ +PASS: driver/xf86-input-evdev +PASS: driver/xf86-input-joystick +PASS: driver/xf86-input-vmmouse +PASS: driver/xf86-input-keyboard +PASS: driver/xf86-input-mouse +PASS: driver/xf86-input-synaptics +PASS: driver/xf86-input-void +PASS: driver/xf86-video-sisusb +PASS: driver/xf86-video-sunffb +PASS: driver/xf86-video-v4l +PASS: driver/xf86-video-xgixp +PASS: driver/xf86-video-i740 +PASS: driver/xf86-video-intel +PASS: driver/xf86-video-apm +PASS: driver/xf86-video-ark +PASS: driver/xf86-video-ast +PASS: driver/xf86-video-ati +PASS: driver/xf86-video-chips +PASS: driver/xf86-video-cirrus +PASS: driver/xf86-video-dummy +PASS: driver/xf86-video-fbdev +PASS: driver/xf86-video-glint +PASS: driver/xf86-video-i128 +PASS: driver/xf86-video-mach64 +PASS: driver/xf86-video-mga +PASS: driver/xf86-video-neomagic +PASS: driver/xf86-video-newport +PASS: util/macros +PASS: font/util +PASS: doc/xorg-sgml-doctools +PASS: doc/xorg-docs +PASS: proto/bigreqsproto +PASS: proto/compositeproto +PASS: proto/damageproto +PASS: proto/dmxproto +PASS: proto/dri2proto +PASS: proto/fixesproto +PASS: proto/fontsproto +PASS: proto/glproto +PASS: proto/inputproto +PASS: proto/kbproto +PASS: proto/randrproto +PASS: proto/recordproto +PASS: proto/renderproto +PASS: proto/resourceproto +PASS: proto/scrnsaverproto +PASS: proto/videoproto +PASS: proto/x11proto +PASS: proto/xcmiscproto +PASS: proto/xextproto +PASS: proto/xf86bigfontproto +PASS: proto/xf86dgaproto +PASS: proto/xf86driproto +PASS: proto/xf86vidmodeproto +PASS: proto/xineramaproto +PASS: xcb/proto +PASS: util/makedepend +PASS: lib/libxtrans +PASS: lib/libXau +PASS: lib/libXdmcp +PASS: xcb/pthread-stubs +PASS: xcb/libxcb +PASS: xcb/util +PASS: xcb/util-image +PASS: xcb/util-keysyms +PASS: xcb/util-renderutil +PASS: xcb/util-wm +PASS: lib/libX11 +PASS: lib/libXext +PASS: lib/libdmx +PASS: lib/libfontenc +PASS: lib/libFS +PASS: lib/libICE +PASS: lib/libSM +PASS: lib/libXt +PASS: lib/libXmu +PASS: lib/libXpm +PASS: lib/libXaw +PASS: lib/libXfixes +PASS: lib/libXcomposite +PASS: lib/libXrender +PASS: lib/libXdamage +PASS: lib/libXcursor +PASS: lib/libXfont +PASS: lib/libXft +PASS: lib/libXi +PASS: lib/libXinerama +PASS: lib/libxkbfile +PASS: lib/libXrandr +PASS: lib/libXRes +PASS: lib/libXScrnSaver +PASS: lib/libXtst +PASS: lib/libXv +PASS: lib/libXvMC +PASS: lib/libXxf86dga +PASS: lib/libXxf86vm +PASS: lib/libpciaccess +PASS: pixman/ +PASS: mesa/drm +PASS: mesa/mesa +PASS: data/bitmaps +PASS: app/appres +PASS: app/bdftopcf +PASS: app/beforelight +PASS: app/bitmap +PASS: app/editres +PASS: app/fonttosfnt +PASS: app/fslsfonts +PASS: app/fstobdf +PASS: app/iceauth +PASS: app/ico +PASS: app/listres +PASS: app/luit +PASS: app/mkcomposecache +PASS: app/mkfontdir +PASS: app/mkfontscale +PASS: app/oclock +PASS: app/rgb +PASS: app/rendercheck +PASS: app/rstart +PASS: app/scripts +PASS: app/sessreg +PASS: app/setxkbmap +PASS: app/showfont +PASS: app/smproxy +PASS: app/twm +PASS: app/viewres +PASS: app/x11perf +PASS: app/xauth +PASS: app/xbacklight +PASS: app/xbiff +PASS: app/xcalc +PASS: app/xclipboard +PASS: app/xclock +PASS: app/xcmsdb +PASS: app/xconsole +PASS: app/xcursorgen +PASS: app/xdbedizzy +PASS: app/xditview +PASS: app/xdm +PASS: app/xdpyinfo +PASS: app/xdriinfo +PASS: app/xedit +PASS: app/xev +PASS: app/xeyes +PASS: app/xf86dga +PASS: app/xfd +PASS: app/xfontsel +PASS: app/xfs +PASS: app/xfsinfo +PASS: app/xgamma +PASS: app/xgc +PASS: app/xhost +PASS: app/xinit +PASS: app/xinput +PASS: app/xkbcomp +PASS: app/xkbevd +PASS: app/xkbprint +PASS: app/xkbutils +PASS: app/xkill +PASS: app/xload +PASS: app/xlogo +PASS: app/xlsatoms +PASS: app/xlsclients +PASS: app/xlsfonts +PASS: app/xmag +PASS: app/xman +PASS: app/xmessage +PASS: app/xmh +PASS: app/xmodmap +PASS: app/xmore +PASS: app/xprop +PASS: app/xrandr +PASS: app/xrdb +PASS: app/xrefresh +PASS: app/xscope +PASS: app/xset +PASS: app/xsetmode +PASS: app/xsetroot +PASS: app/xsm +PASS: app/xstdcmap +PASS: app/xvidtune +PASS: app/xvinfo +PASS: app/xwd +PASS: app/xwininfo +PASS: app/xwud +PASS: xserver/ +PASS: driver/xf86-input-evdev +PASS: driver/xf86-input-joystick +PASS: driver/xf86-input-vmmouse +PASS: driver/xf86-input-keyboard +PASS: driver/xf86-input-mouse +PASS: driver/xf86-input-synaptics +PASS: driver/xf86-input-void +PASS: driver/xf86-video-sisusb +PASS: driver/xf86-video-sunffb +PASS: driver/xf86-video-v4l +PASS: driver/xf86-video-xgixp +PASS: driver/xf86-video-i740 +PASS: driver/xf86-video-intel +PASS: driver/xf86-video-apm +PASS: driver/xf86-video-ark +PASS: driver/xf86-video-ast +PASS: driver/xf86-video-ati +PASS: driver/xf86-video-chips +PASS: driver/xf86-video-cirrus +PASS: driver/xf86-video-dummy +PASS: driver/xf86-video-fbdev +PASS: driver/xf86-video-glint +PASS: driver/xf86-video-i128 +PASS: driver/xf86-video-mach64 +PASS: driver/xf86-video-mga +PASS: driver/xf86-video-neomagic +PASS: driver/xf86-video-nv +PASS: driver/xf86-video-rendition +PASS: driver/xf86-video-r128 +PASS: driver/xf86-video-s3 +PASS: driver/xf86-video-s3virge +PASS: driver/xf86-video-savage +PASS: driver/xf86-video-siliconmotion +PASS: driver/xf86-video-tdfx +PASS: driver/xf86-video-tga +PASS: driver/xf86-video-trident +PASS: driver/xf86-video-tseng +PASS: driver/xf86-video-vesa +PASS: driver/xf86-video-vmware +PASS: driver/xf86-video-voodoo +PASS: data/cursors +PASS: font/encodings +PASS: font/adobe-100dpi +PASS: font/adobe-75dpi +PASS: font/adobe-utopia-100dpi +PASS: font/adobe-utopia-75dpi +PASS: font/adobe-utopia-type1 +PASS: font/arabic-misc +PASS: font/bh-100dpi +PASS: font/bh-75dpi +PASS: font/bh-lucidatypewriter-100dpi +PASS: font/bh-lucidatypewriter-75dpi +PASS: font/bh-ttf +PASS: font/bh-type1 +PASS: font/bitstream-100dpi +PASS: font/bitstream-75dpi +PASS: font/bitstream-speedo +PASS: font/bitstream-type1 +PASS: font/cronyx-cyrillic +PASS: font/cursor-misc +PASS: font/daewoo-misc +PASS: font/dec-misc +PASS: font/ibm-type1 +PASS: font/isas-misc +PASS: font/jis-misc +PASS: font/micro-misc +PASS: font/misc-cyrillic +PASS: font/misc-ethiopic +PASS: font/misc-meltho +PASS: font/misc-misc +PASS: font/mutt-misc +PASS: font/schumacher-misc +PASS: font/screen-cyrillic +PASS: font/sony-misc +PASS: font/sun-misc +PASS: font/winitzki-cyrillic +PASS: font/xfree86-type1 +PASS: font/alias +PASS: util/cf +PASS: util/imake +PASS: util/gccmakedep +FAIL: util/lndir diff --git a/guest/linux/paragraph/build_x11_minimal/mymods.txt b/guest/linux/paragraph/build_x11_minimal/mymods.txt new file mode 100644 index 0000000..4cbc751 --- /dev/null +++ b/guest/linux/paragraph/build_x11_minimal/mymods.txt @@ -0,0 +1,243 @@ +util/macros +font/util +doc/xorg-sgml-doctools +doc/xorg-docs +proto/bigreqsproto +proto/compositeproto +proto/damageproto +proto/dmxproto +proto/dri2proto +proto/fixesproto +proto/fontsproto +proto/glproto +proto/inputproto +proto/kbproto +proto/randrproto +proto/recordproto +proto/renderproto +proto/resourceproto +proto/scrnsaverproto +proto/videoproto +proto/x11proto +proto/xcmiscproto +proto/xextproto +proto/xf86bigfontproto +proto/xf86dgaproto +proto/xf86driproto +proto/xf86vidmodeproto +proto/xineramaproto +xcb/proto +util/makedepend +lib/libxtrans +lib/libXau +lib/libXdmcp +xcb/pthread-stubs +xcb/libxcb +xcb/util +xcb/util-image +xcb/util-keysyms +xcb/util-renderutil +xcb/util-wm +lib/libX11 +lib/libXext +lib/libdmx +lib/libfontenc +lib/libFS +lib/libICE +lib/libSM +lib/libXt +lib/libXmu +lib/libXpm +lib/libXaw +lib/libXfixes +lib/libXcomposite +lib/libXrender +lib/libXdamage +lib/libXcursor +lib/libXfont +lib/libXft +lib/libXi +lib/libXinerama +lib/libxkbfile +lib/libXrandr +lib/libXRes +lib/libXScrnSaver +lib/libXtst +lib/libXv +lib/libXvMC +lib/libXxf86dga +lib/libXxf86vm +lib/libpciaccess +pixman/ +mesa/drm +mesa/mesa +data/bitmaps +app/appres +app/bdftopcf +app/beforelight +app/bitmap +app/editres +app/fonttosfnt +app/fslsfonts +app/fstobdf +app/iceauth +app/ico +app/listres +app/luit +app/mkcomposecache +app/mkfontdir +app/mkfontscale +app/oclock +app/rgb +app/rendercheck +app/rstart +app/scripts +app/sessreg +app/setxkbmap +app/showfont +app/smproxy +app/twm +app/viewres +app/x11perf +app/xauth +app/xbacklight +app/xbiff +app/xcalc +app/xclipboard +app/xclock +app/xcmsdb +app/xconsole +app/xcursorgen +app/xdbedizzy +app/xditview +app/xdm +app/xdpyinfo +app/xdriinfo +app/xedit +app/xev +app/xeyes +app/xf86dga +app/xfd +app/xfontsel +app/xfs +app/xfsinfo +app/xgamma +app/xgc +app/xhost +app/xinit +app/xinput +app/xkbcomp +app/xkbevd +app/xkbprint +app/xkbutils +app/xkill +app/xload +app/xlogo +app/xlsatoms +app/xlsclients +app/xlsfonts +app/xmag +app/xman +app/xmessage +app/xmh +app/xmodmap +app/xmore +app/xprop +app/xrandr +app/xrdb +app/xrefresh +app/xscope +app/xset +app/xsetmode +app/xsetroot +app/xsm +app/xstdcmap +app/xvidtune +app/xvinfo +app/xwd +app/xwininfo +app/xwud +xserver/ +driver/xf86-input-evdev +driver/xf86-input-joystick +driver/xf86-input-vmmouse +driver/xf86-input-keyboard +driver/xf86-input-mouse +driver/xf86-input-synaptics +driver/xf86-input-void +driver/xf86-video-sisusb +driver/xf86-video-sunffb +driver/xf86-video-v4l +driver/xf86-video-xgixp +driver/xf86-video-i740 +driver/xf86-video-intel +driver/xf86-video-apm +driver/xf86-video-ark +driver/xf86-video-ast +driver/xf86-video-ati +driver/xf86-video-chips +driver/xf86-video-cirrus +driver/xf86-video-dummy +driver/xf86-video-fbdev +driver/xf86-video-glint +driver/xf86-video-i128 +driver/xf86-video-mach64 +driver/xf86-video-mga +driver/xf86-video-neomagic +driver/xf86-video-nv +driver/xf86-video-rendition +driver/xf86-video-r128 +driver/xf86-video-s3 +driver/xf86-video-s3virge +driver/xf86-video-savage +driver/xf86-video-siliconmotion +driver/xf86-video-tdfx +driver/xf86-video-tga +driver/xf86-video-trident +driver/xf86-video-tseng +driver/xf86-video-vesa +driver/xf86-video-vmware +driver/xf86-video-voodoo +data/cursors +font/encodings +font/adobe-100dpi +font/adobe-75dpi +font/adobe-utopia-100dpi +font/adobe-utopia-75dpi +font/adobe-utopia-type1 +font/arabic-misc +font/bh-100dpi +font/bh-75dpi +font/bh-lucidatypewriter-100dpi +font/bh-lucidatypewriter-75dpi +font/bh-ttf +font/bh-type1 +font/bitstream-100dpi +font/bitstream-75dpi +font/bitstream-speedo +font/bitstream-type1 +font/cronyx-cyrillic +font/cursor-misc +font/daewoo-misc +font/dec-misc +font/ibm-type1 +font/isas-misc +font/jis-misc +font/micro-misc +font/misc-cyrillic +font/misc-ethiopic +font/misc-meltho +font/misc-misc +font/mutt-misc +font/schumacher-misc +font/screen-cyrillic +font/sony-misc +font/sun-misc +font/winitzki-cyrillic +font/xfree86-type1 +font/alias +util/cf +util/imake +util/gccmakedep +util/lndir +xkeyboard-config/ diff --git a/guest/linux/paragraph/run_x11_minimal/README b/guest/linux/paragraph/run_x11_minimal/README new file mode 100644 index 0000000..0f043af --- /dev/null +++ b/guest/linux/paragraph/run_x11_minimal/README @@ -0,0 +1,22 @@ +Notes: + - The compiled X11 directory contains a copy of all the libraries that my-microcore-con guest needs to run X. + These libraries are in x11/build/bin/ and x11/build/lib/ + If you're running a more "advanced" guest, you may not need the libraries and you should edit the setup script accordingly (remove the commands that copy libraries). + + - To test X11 on the microcore guest: + mount x11 as a FILEDISK device into the guest (x11.dat contains all the x11 source files and the setup script, see my-microcore-con.xml) + + In the host: + run the vncserver and client. + + In the guest: + type the following commands: + 1. mkdir new-x11/ + 2. sudo mount /dev/hdb/ new-x11/ + 3. source ./setup.sh + 4. cd x11/build/bin/ + 5. sudo ./startx -- -config xorg.conf & + xclock and 3 xterms should be visible in the vncclient window. + + + diff --git a/guest/linux/paragraph/run_x11_minimal/setup.sh b/guest/linux/paragraph/run_x11_minimal/setup.sh new file mode 100755 index 0000000..029e6bf --- /dev/null +++ b/guest/linux/paragraph/run_x11_minimal/setup.sh @@ -0,0 +1,11 @@ +sudo mkdir /lib64 +cd /opt +ln -s /home/tc/new-x11/x11 . +export LD_LIBRARY_PATH=/opt/x11/build/bin:/opt/x11/build/lib +export DISPLAY=:0 +sudo cp /opt/x11/build/bin/ld* /lib64 +export PATH=$PATH:/opt/x11/build/bin +sudo cp /opt/x11/build/bin/*.so* /lib64 +sudo cp /opt/x11/build/lib/libXmuu.so.1 /lib64 +sudo cp /opt/x11/build/lib/libxkbfile.so.1 /lib64 +sudo cp /opt/x11/build/bin/mcookie /usr/bin diff --git a/guest/linux/paragraph/write_paragraph/Makefile b/guest/linux/paragraph/write_paragraph/Makefile new file mode 100644 index 0000000..0958a29 --- /dev/null +++ b/guest/linux/paragraph/write_paragraph/Makefile @@ -0,0 +1,11 @@ +all: write_paragraph_devmem write_paragraph_sysfs + +write_paragraph_devmem: write_paragraph_devmem.c + gcc -static write_paragraph_devmem.c -o write_paragraph_devmem + +write_paragraph_sysfs: write_paragraph_sysfs.c + gcc -static write_paragraph_sysfs.c -o write_paragraph_sysfs + +clean: + rm -f write_paragraph_devmem write_paragraph_sysfs + diff --git a/guest/linux/paragraph/write_paragraph/write_paragraph.c b/guest/linux/paragraph/write_paragraph/write_paragraph.c new file mode 100644 index 0000000..bc39c06 --- /dev/null +++ b/guest/linux/paragraph/write_paragraph/write_paragraph.c @@ -0,0 +1,44 @@ +#include +#include +#include +#include + +#define PARAGRAPH_PADDR 0x80000000 +#define PARAGRAPH_LEN (640*480*4) + +int main(int argc, char *argv[]) +{ + int start; + + if (argc < 2) { + printf("Usage: write_paragraph start\n"); + return 0; + } + + start = atoi(argv[1]); + + int fd = open("/dev/mem", O_RDWR | O_SYNC); + + if (fd<0) { + perror("Cannot open /dev/mem"); + return -1; + } + + unsigned char *mem = mmap(NULL, PARAGRAPH_LEN, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, PARAGRAPH_PADDR); + + if (mem == NULL) { + perror("Can't map memory"); + return -1; + } else { + printf("Mapped to 0x%p (%d bytes)\n", mem, PARAGRAPH_LEN); + } + + int i; + for (i = 0; i < PARAGRAPH_LEN; ++i) { + mem[i] = i+start; + } + printf("Wrote %d bytes\n", PARAGRAPH_LEN); + + sleep(99999); + +} diff --git a/guest/linux/paragraph/write_paragraph/write_paragraph_devmem.c b/guest/linux/paragraph/write_paragraph/write_paragraph_devmem.c new file mode 100644 index 0000000..7184c2f --- /dev/null +++ b/guest/linux/paragraph/write_paragraph/write_paragraph_devmem.c @@ -0,0 +1,43 @@ +#include +#include +#include +#include + +#define PARAGRAPH_PADDR 0x80000000 +#define PARAGRAPH_LEN (1024*1024*4) + +int main(int argc, char *argv[]) +{ + int start; + + if (argc < 2) { + printf("Usage: write_paragraph_devmem start\n"); + return 0; + } + + start = atoi(argv[1]); + + int fd = open("/dev/mem", O_RDWR | O_SYNC); + + if (fd<0) { + perror("Cannot open /dev/mem"); + return -1; + } + + unsigned char *mem = mmap(NULL, PARAGRAPH_LEN, PROT_READ | PROT_WRITE, MAP_SHARED, fd, PARAGRAPH_PADDR); + + if (mem == MAP_FAILED) { + perror("Can't map memory"); + return -1; + } else { + printf("Mapped to 0x%p (%d bytes)\n", mem, PARAGRAPH_LEN); + } + + int i; + for (i = 0; i < PARAGRAPH_LEN; i++) { + *(mem+i) = i+start; + if (i<16) { printf("0x%p = %d\n", mem+i, *(mem+i)); } + } + printf("Wrote %d bytes\n", PARAGRAPH_LEN); + +} diff --git a/guest/linux/paragraph/write_paragraph/write_paragraph_sysfs.c b/guest/linux/paragraph/write_paragraph/write_paragraph_sysfs.c new file mode 100644 index 0000000..e0ef5c0 --- /dev/null +++ b/guest/linux/paragraph/write_paragraph/write_paragraph_sysfs.c @@ -0,0 +1,48 @@ +#include +#include +#include +#include + +#define PARAGRAPH_SYSFS_RESOURCE "/sys/devices/pci0000:00/0000:00:02.0/resource0" +#define PARAGRAPH_LEN (1024*1024*4) + +int main(int argc, char *argv[]) +{ + int start; + char *res; + + if (argc < 3) { + printf("Usage: write_paragraph_sysfs sysfsresource start\nyou probably want to use %s\n",PARAGRAPH_SYSFS_RESOURCE); + return 0; + } + + res = argv[1]; + start = atoi(argv[2]); + + int fd = open(res, O_RDWR | O_SYNC); + + if (fd<0) { + perror("Cannot open sysfs file"); + printf("sysfs file = %s\n", res); + return -1; + } + + unsigned char *mem = mmap(NULL, PARAGRAPH_LEN, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + + if (mem == MAP_FAILED) { + perror("Can't map memory"); + return -1; + } else { + printf("Mapped to 0x%p (%d bytes)\n", mem, PARAGRAPH_LEN); + } + + int i; + for (i = 0; i < PARAGRAPH_LEN; i++) { + *(mem+i) = i+start; + if (i<16) { printf("0x%p = %d\n", mem+i, *(mem+i)); } + } + printf("Wrote %d bytes\n", PARAGRAPH_LEN); + + sleep(99999); + +} diff --git a/guest/linux/paragraph/x11.patch b/guest/linux/paragraph/x11.patch new file mode 100644 index 0000000..2c97e1e --- /dev/null +++ b/guest/linux/paragraph/x11.patch @@ -0,0 +1,82 @@ +diff -rupN x11-original/build/bin/xorg.conf x11-new/build/bin/xorg.conf +--- x11-original/build/bin/xorg.conf 1969-12-31 18:00:00.000000000 -0600 ++++ x11-new/build/bin/xorg.conf 2013-06-07 17:07:35.000000000 -0500 +@@ -0,0 +1,40 @@ ++Section "Monitor" ++Identifier "Monitor0" ++HorizSync 28.0-80.0 ++VertRefresh 48.0-75.0 ++#Modeline "1280x800" 83.46 1280 1344 1480 1680 800 801 804 828 -HSync +Vsync ++# 1224x685 @ 60.00 Hz (GTF) hsync: 42.54 kHz; pclk: 67.72 MHz ++#Modeline "800x600" 67.72 800 848 936 1072 600 601 604 636 -HSync +Vsync ++Modeline "1024x1024" 67.72 1024 1072 1160 1296 1024 1072 1160 1296 -HSync +Vsync ++EndSection ++ ++Section "Device" ++Identifier "Card0" ++Option "NoDDC" "true" ++Option "IgnoreEDID" "true" ++Driver "dummy" ++EndSection ++ ++Section "Screen" ++DefaultDepth 24 ++Identifier "Screen0" ++Device "Card0" ++Monitor "Monitor0" ++ SubSection "Display" ++ Depth 24 ++ Virtual 1024 1024 ++ Modes "1024x1024" ++ EndSubSection ++EndSection ++ ++ ++Section "InputClass" ++ Identifier "system-setup-keyboard" ++ MatchIsKeyboard "on" ++ Option "XkbModel" "pc105+inet" ++ Option "XkbLayout" "us" ++# Option "XkbVariant" "(null)" ++ Option "XkbOptions" "terminate:ctrl_alt_bksp," ++EndSection ++ ++ +diff -rupN x11-original/src/driver/xf86-video-dummy/src/dummy_driver.c x11-new/src/driver/xf86-video-dummy/src/dummy_driver.c +--- x11-original/src/driver/xf86-video-dummy/src/dummy_driver.c 2013-06-07 14:51:15.000000000 -0500 ++++ x11-new/src/driver/xf86-video-dummy/src/dummy_driver.c 2013-06-07 17:07:20.000000000 -0500 +@@ -551,9 +551,32 @@ + dPtr = DUMMYPTR(pScrn); + DUMMYScrn = pScrn; + +- if (!(dPtr->FBBase = malloc(pScrn->videoRam * 1024))) +- return FALSE; ++ int fd = open("/dev/mem", O_RDWR | O_SYNC); + ++ if (fd<0) { ++ perror("Cannot open /dev/mem"); ++ return -1; ++ } ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "This is Ruba's driver \n"); ++ ++ unsigned char *mem = mmap(NULL, PARAGRAPH_LEN, PROT_READ | PROT_WRITE, MAP_SHARED, fd, PARAGRAPH_PADDR); ++ ++ if (mem == MAP_FAILED) { ++ perror("Can't map memory"); ++ return -1; ++ } else { ++ printf("Mapped to 0x%p (%d bytes)\n", mem, PARAGRAPH_LEN); ++ } ++ ++ if (pScrn->videoRam * 1024 > 1024 * 1024 * 4) { ++ perror("Error but keep going"); ++ ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "pScrn-> videoRAM is greater than 4MB but keep going\n"); ++ } ++ ++ dPtr->FBBase = mem; ++ ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FBBase is set to %p \n", dPtr->FBBase); + /* + * next we save the current state and setup the first mode + */ diff --git a/guest/linux/paragraph/x11_modified_files/dummy_driver.c b/guest/linux/paragraph/x11_modified_files/dummy_driver.c new file mode 100644 index 0000000..5e7b159 --- /dev/null +++ b/guest/linux/paragraph/x11_modified_files/dummy_driver.c @@ -0,0 +1,902 @@ + +/* + * Copyright 2002, SuSE Linux AG, Author: Egbert Eich + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +/* All drivers should typically include these */ +#include "xf86.h" +#include "xf86_OSproc.h" + +/* All drivers initialising the SW cursor need this */ +#include "mipointer.h" + +/* All drivers using the mi colormap manipulation need this */ +#include "micmap.h" + +/* identifying atom needed by magnifiers */ +#include +#include "property.h" + +#include "xf86cmap.h" + +#include "xf86fbman.h" + +#include "fb.h" + +#include "picturestr.h" + +#ifdef XvExtension +#include "xf86xv.h" +#include +#endif + +/* + * Driver data structures. + */ +#include "dummy.h" + +/* These need to be checked */ +#include +#include +#include "scrnintstr.h" +#include "servermd.h" + +#ifdef USE_DGA +#define _XF86DGA_SERVER_ +#include +#endif + +/* Mandatory functions */ +static const OptionInfoRec * DUMMYAvailableOptions(int chipid, int busid); +static void DUMMYIdentify(int flags); +static Bool DUMMYProbe(DriverPtr drv, int flags); +static Bool DUMMYPreInit(ScrnInfoPtr pScrn, int flags); +static Bool DUMMYScreenInit(SCREEN_INIT_ARGS_DECL); +static Bool DUMMYEnterVT(VT_FUNC_ARGS_DECL); +static void DUMMYLeaveVT(VT_FUNC_ARGS_DECL); +static Bool DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL); +static Bool DUMMYCreateWindow(WindowPtr pWin); +static void DUMMYFreeScreen(FREE_SCREEN_ARGS_DECL); +static ModeStatus DUMMYValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, + Bool verbose, int flags); +static Bool DUMMYSaveScreen(ScreenPtr pScreen, int mode); + +/* Internally used functions */ +static Bool dummyModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); +static void dummySave(ScrnInfoPtr pScrn); +static void dummyRestore(ScrnInfoPtr pScrn, Bool restoreText); +static Bool dummyDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, + pointer ptr); + + +/* static void DUMMYDisplayPowerManagementSet(ScrnInfoPtr pScrn, */ +/* int PowerManagementMode, int flags); */ + +#define DUMMY_VERSION 4000 +#define DUMMY_NAME "DUMMY" +#define DUMMY_DRIVER_NAME "dummy" + +#define DUMMY_MAJOR_VERSION PACKAGE_VERSION_MAJOR +#define DUMMY_MINOR_VERSION PACKAGE_VERSION_MINOR +#define DUMMY_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL + +#define DUMMY_MAX_WIDTH 32767 +#define DUMMY_MAX_HEIGHT 32767 + +#define PARAGRAPH_LEN (1024*1024*4) +#define PARAGRAPH_PADDR 0x80000000 +/* + * This is intentionally screen-independent. It indicates the binding + * choice made in the first PreInit. + */ +static int pix24bpp = 0; + + +/* + * This contains the functions needed by the server after loading the driver + * module. It must be supplied, and gets passed back by the SetupProc + * function in the dynamic case. In the static case, a reference to this + * is compiled in, and this requires that the name of this DriverRec be + * an upper-case version of the driver name. + */ + +_X_EXPORT DriverRec DUMMY = { + DUMMY_VERSION, + DUMMY_DRIVER_NAME, + DUMMYIdentify, + DUMMYProbe, + DUMMYAvailableOptions, + NULL, + 0, + dummyDriverFunc +}; + +static SymTabRec DUMMYChipsets[] = { + { DUMMY_CHIP, "dummy" }, + { -1, NULL } +}; + +typedef enum { + OPTION_SW_CURSOR +} DUMMYOpts; + +static const OptionInfoRec DUMMYOptions[] = { + { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE } +}; + +#ifdef XFree86LOADER + +static MODULESETUPPROTO(dummySetup); + +static XF86ModuleVersionInfo dummyVersRec = +{ + "dummy", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XORG_VERSION_CURRENT, + DUMMY_MAJOR_VERSION, DUMMY_MINOR_VERSION, DUMMY_PATCHLEVEL, + ABI_CLASS_VIDEODRV, + ABI_VIDEODRV_VERSION, + MOD_CLASS_VIDEODRV, + {0,0,0,0} +}; + +/* + * This is the module init data. + * Its name has to be the driver name followed by ModuleData + */ +_X_EXPORT XF86ModuleData dummyModuleData = { &dummyVersRec, dummySetup, NULL }; + +static pointer +dummySetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + static Bool setupDone = FALSE; + + if (!setupDone) { + setupDone = TRUE; + xf86AddDriver(&DUMMY, module, HaveDriverFuncs); + + /* + * Modules that this driver always requires can be loaded here + * by calling LoadSubModule(). + */ + + /* + * The return value must be non-NULL on success even though there + * is no TearDownProc. + */ + return (pointer)1; + } else { + if (errmaj) *errmaj = LDR_ONCEONLY; + return NULL; + } +} + +#endif /* XFree86LOADER */ + +static Bool +DUMMYGetRec(ScrnInfoPtr pScrn) +{ + /* + * Allocate a DUMMYRec, and hook it into pScrn->driverPrivate. + * pScrn->driverPrivate is initialised to NULL, so we can check if + * the allocation has already been done. + */ + if (pScrn->driverPrivate != NULL) + return TRUE; + + pScrn->driverPrivate = xnfcalloc(sizeof(DUMMYRec), 1); + + if (pScrn->driverPrivate == NULL) + return FALSE; + return TRUE; +} + +static void +DUMMYFreeRec(ScrnInfoPtr pScrn) +{ + if (pScrn->driverPrivate == NULL) + return; + free(pScrn->driverPrivate); + pScrn->driverPrivate = NULL; +} + +static const OptionInfoRec * +DUMMYAvailableOptions(int chipid, int busid) +{ + return DUMMYOptions; +} + +/* Mandatory */ +static void +DUMMYIdentify(int flags) +{ + printf("Identifying"); + xf86PrintChipsets(DUMMY_NAME, "Driver for Dummy chipsets", + DUMMYChipsets); +} + +/* Mandatory */ +static Bool +DUMMYProbe(DriverPtr drv, int flags) +{ + printf("Probe function starts"); + Bool foundScreen = FALSE; + int numDevSections, numUsed; + GDevPtr *devSections; + int i; + + if (flags & PROBE_DETECT) + return FALSE; + /* + * Find the config file Device sections that match this + * driver, and return if there are none. + */ + if ((numDevSections = xf86MatchDevice(DUMMY_DRIVER_NAME, + &devSections)) <= 0) { + return FALSE; + } + + numUsed = numDevSections; + + if (numUsed > 0) { + + for (i = 0; i < numUsed; i++) { + ScrnInfoPtr pScrn = NULL; + int entityIndex = + xf86ClaimNoSlot(drv,DUMMY_CHIP,devSections[i],TRUE); + /* Allocate a ScrnInfoRec and claim the slot */ + if ((pScrn = xf86AllocateScreen(drv,0 ))) { + xf86AddEntityToScreen(pScrn,entityIndex); + pScrn->driverVersion = DUMMY_VERSION; + pScrn->driverName = DUMMY_DRIVER_NAME; + pScrn->name = DUMMY_NAME; + pScrn->Probe = DUMMYProbe; + pScrn->PreInit = DUMMYPreInit; + pScrn->ScreenInit = DUMMYScreenInit; + pScrn->SwitchMode = DUMMYSwitchMode; + pScrn->AdjustFrame = DUMMYAdjustFrame; + pScrn->EnterVT = DUMMYEnterVT; + pScrn->LeaveVT = DUMMYLeaveVT; + pScrn->FreeScreen = DUMMYFreeScreen; + pScrn->ValidMode = DUMMYValidMode; + + foundScreen = TRUE; + } + } + } + + printf("Probe ends"); + return foundScreen; +} + +# define RETURN \ + { DUMMYFreeRec(pScrn);\ + return FALSE;\ + } + +/* Mandatory */ +Bool +DUMMYPreInit(ScrnInfoPtr pScrn, int flags) +{ + printf("dummy PrInit starts"); + ClockRangePtr clockRanges; + int i; + DUMMYPtr dPtr; + int maxClock = 230000; + GDevPtr device = xf86GetEntityInfo(pScrn->entityList[0])->device; + + if (flags & PROBE_DETECT) + return TRUE; + + /* Allocate the DummyRec driverPrivate */ + if (!DUMMYGetRec(pScrn)) { + return FALSE; + } + + dPtr = DUMMYPTR(pScrn); + + pScrn->chipset = (char *)xf86TokenToString(DUMMYChipsets, + DUMMY_CHIP); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Chipset is a DUMMY\n"); + + pScrn->monitor = pScrn->confScreen->monitor; + + if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb)) + return FALSE; + else { + /* Check that the returned depth is one we support */ + switch (pScrn->depth) { + case 8: + case 15: + case 16: + case 24: + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Given depth (%d) is not supported by this driver\n", + pScrn->depth); + return FALSE; + } + } + + xf86PrintDepthBpp(pScrn); + if (pScrn->depth == 8) + pScrn->rgbBits = 8; + + /* Get the depth24 pixmap format */ + if (pScrn->depth == 24 && pix24bpp == 0) + pix24bpp = xf86GetBppFromDepth(pScrn, 24); + + /* + * This must happen after pScrn->display has been set because + * xf86SetWeight references it. + */ + if (pScrn->depth > 8) { + /* The defaults are OK for us */ + rgb zeros = {0, 0, 0}; + + if (!xf86SetWeight(pScrn, zeros, zeros)) { + return FALSE; + } else { + /* XXX check that weight returned is supported */ + ; + } + } + + if (!xf86SetDefaultVisual(pScrn, -1)) + return FALSE; + + if (pScrn->depth > 1) { + Gamma zeros = {0.0, 0.0, 0.0}; + + if (!xf86SetGamma(pScrn, zeros)) + return FALSE; + } + + xf86CollectOptions(pScrn, device->options); + /* Process the options */ + if (!(dPtr->Options = malloc(sizeof(DUMMYOptions)))) + return FALSE; + memcpy(dPtr->Options, DUMMYOptions, sizeof(DUMMYOptions)); + + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, dPtr->Options); + + xf86GetOptValBool(dPtr->Options, OPTION_SW_CURSOR,&dPtr->swCursor); + + if (device->videoRam != 0) { + pScrn->videoRam = device->videoRam; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "VideoRAM: %d kByte\n", + pScrn->videoRam); + } else { + pScrn->videoRam = 4096; + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VideoRAM: %d kByte\n", + pScrn->videoRam); + } + + if (device->dacSpeeds[0] != 0) { + maxClock = device->dacSpeeds[0]; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Max Clock: %d kHz\n", + maxClock); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Max Clock: %d kHz\n", + maxClock); + } + + pScrn->progClock = TRUE; + /* + * Setup the ClockRanges, which describe what clock ranges are available, + * and what sort of modes they can be used for. + */ + clockRanges = (ClockRangePtr)xnfcalloc(sizeof(ClockRange), 1); + clockRanges->next = NULL; + clockRanges->ClockMulFactor = 1; + clockRanges->minClock = 11000; /* guessed §§§ */ + clockRanges->maxClock = 300000; + clockRanges->clockIndex = -1; /* programmable */ + clockRanges->interlaceAllowed = TRUE; + clockRanges->doubleScanAllowed = TRUE; + + /* Subtract memory for HW cursor */ + + + { + int apertureSize = (pScrn->videoRam * 1024); + i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, + pScrn->display->modes, clockRanges, + NULL, 256, DUMMY_MAX_WIDTH, + (8 * pScrn->bitsPerPixel), + 128, DUMMY_MAX_HEIGHT, pScrn->display->virtualX, + pScrn->display->virtualY, apertureSize, + LOOKUP_BEST_REFRESH); + + if (i == -1) + RETURN; + } + + /* Prune the modes marked as invalid */ + xf86PruneDriverModes(pScrn); + + if (i == 0 || pScrn->modes == NULL) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); + RETURN; + } + + /* + * Set the CRTC parameters for all of the modes based on the type + * of mode, and the chipset's interlace requirements. + * + * Calling this is required if the mode->Crtc* values are used by the + * driver and if the driver doesn't provide code to set them. They + * are not pre-initialised at all. + */ + xf86SetCrtcForModes(pScrn, 0); + + /* Set the current mode to the first in the list */ + pScrn->currentMode = pScrn->modes; + + /* Print the list of modes being used */ + xf86PrintModes(pScrn); + + /* If monitor resolution is set on the command line, use it */ + xf86SetDpi(pScrn, 0, 0); + + if (xf86LoadSubModule(pScrn, "fb") == NULL) { + RETURN; + } + + if (!dPtr->swCursor) { + if (!xf86LoadSubModule(pScrn, "ramdac")) + RETURN; + } + + /* We have no contiguous physical fb in physical memory */ + pScrn->memPhysBase = 0; + pScrn->fbOffset = 0; + +printf("preinit endsss"); + return TRUE; +} +#undef RETURN + +/* Mandatory */ +static Bool +DUMMYEnterVT(VT_FUNC_ARGS_DECL) +{ +printf("entervt startssss"); + SCRN_INFO_PTR(arg); + + /* Should we re-save the text mode on each VT enter? */ + if(!dummyModeInit(pScrn, pScrn->currentMode)) + return FALSE; + + DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); + +printf("entervt endsss"); + return TRUE; +} + +/* Mandatory */ +static void +DUMMYLeaveVT(VT_FUNC_ARGS_DECL) +{ +printf("leavevt starts"); + SCRN_INFO_PTR(arg); + dummyRestore(pScrn, TRUE); + +printf("leavevt ends"); +} + +static void +DUMMYLoadPalette( + ScrnInfoPtr pScrn, + int numColors, + int *indices, + LOCO *colors, + VisualPtr pVisual +){ + int i, index, shift, Gshift; + DUMMYPtr dPtr = DUMMYPTR(pScrn); + + switch(pScrn->depth) { + case 15: + shift = Gshift = 1; + break; + case 16: + shift = 0; + Gshift = 0; + break; + default: + shift = Gshift = 0; + break; + } + + for(i = 0; i < numColors; i++) { + index = indices[i]; + dPtr->colors[index].red = colors[index].red << shift; + dPtr->colors[index].green = colors[index].green << Gshift; + dPtr->colors[index].blue = colors[index].blue << shift; + } + +} + +static ScrnInfoPtr DUMMYScrn; /* static-globalize it */ + +/* Mandatory */ +static Bool +DUMMYScreenInit(SCREEN_INIT_ARGS_DECL) +{ +printf("screeninit startsssss"); + ScrnInfoPtr pScrn; + DUMMYPtr dPtr; + int ret; + VisualPtr visual; + + /* + * we need to get the ScrnInfoRec for this screen, so let's allocate + * one first thing + */ + pScrn = xf86ScreenToScrn(pScreen); + dPtr = DUMMYPTR(pScrn); + DUMMYScrn = pScrn; + + int fd = open("/dev/mem", O_RDWR | O_SYNC); + + if (fd<0) { + perror("Cannot open /dev/mem"); + return -1; + } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "This is Ruba's driver \n"); + + unsigned char *mem = mmap(NULL, PARAGRAPH_LEN, PROT_READ | PROT_WRITE, MAP_SHARED, fd, PARAGRAPH_PADDR); + + if (mem == MAP_FAILED) { + perror("Can't map memory"); + return -1; + } else { + printf("Mapped to 0x%p (%d bytes)\n", mem, PARAGRAPH_LEN); + } + + if (pScrn->videoRam * 1024 > 1024 * 1024 * 4) { + perror("Error but keep going"); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "pScrn-> videoRAM is greater than 4MB but keep going\n"); + } + + dPtr->FBBase = mem; + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FBBase is set to %p \n", dPtr->FBBase); +/* + * next we save the current state and setup the first mode + */ + dummySave(pScrn); + + if (!dummyModeInit(pScrn,pScrn->currentMode)) + return FALSE; + DUMMYAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Adjust Frame function called, frameX0 is %d, frame Y0 is %d\n", pScrn->frameX0, pScrn->frameY0); + /* + * Reset visual list. + */ + miClearVisualTypes(); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "miClearVisualTypes called\n"); + /* Setup the visuals we support. */ + + if (!miSetVisualTypes(pScrn->depth, + miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + + if (!miSetPixmapDepths ()) return FALSE; + + /* + * Call the framebuffer layer's ScreenInit function, and fill in other + * pScreen fields. + */ + ret = fbScreenInit(pScreen, dPtr->FBBase, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth, pScrn->bitsPerPixel); + + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FBBase before FBScreenInit is set to %p \n", dPtr->FBBase); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "pScreen depth is %d \n", pScrn->depth); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FBScreenInit is called\n"); + if (!ret) + return FALSE; + + if (pScrn->depth > 8) { + /* Fixup RGB ordering */ + visual = pScreen->visuals + pScreen->numVisuals; + while (--visual >= pScreen->visuals) { + if ((visual->class | DynamicClass) == DirectColor) { + visual->offsetRed = pScrn->offset.red; + visual->offsetGreen = pScrn->offset.green; + visual->offsetBlue = pScrn->offset.blue; + visual->redMask = pScrn->mask.red; + visual->greenMask = pScrn->mask.green; + visual->blueMask = pScrn->mask.blue; + } + } + } + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FBBase after fbScreenInit is set to %p \n", dPtr->FBBase); + /* must be after RGB ordering fixed */ + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FBBase before fbPictureInit is set to %p \n", dPtr->FBBase); + fbPictureInit(pScreen, 0, 0); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FBBase after fbPictureInit is set to %p \n", dPtr->FBBase); + xf86SetBlackWhitePixels(pScreen); + +#ifdef USE_DGA + DUMMYDGAInit(pScreen); +#endif + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FBBase before checking software cursor is set to %p \n", dPtr->FBBase); + if (dPtr->swCursor) + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using Software Cursor.\n"); + + { + + + BoxRec AvailFBArea; + int lines = pScrn->videoRam * 1024 / + (pScrn->displayWidth * (pScrn->bitsPerPixel >> 3)); + AvailFBArea.x1 = 0; + AvailFBArea.y1 = 0; + AvailFBArea.x2 = pScrn->displayWidth; + AvailFBArea.y2 = lines; + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FBBase before InitFBManager is set to %p \n", dPtr->FBBase); + xf86InitFBManager(pScreen, &AvailFBArea); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FBBase after InitFBManager is set to %p \n", dPtr->FBBase); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Using %i scanlines of offscreen memory \n" + , lines - pScrn->virtualY); + } + + xf86SetBackingStore(pScreen); + xf86SetSilkenMouse(pScreen); + + /* Initialise cursor functions */ + miDCInitialize (pScreen, xf86GetPointerScreenFuncs()); + + + if (!dPtr->swCursor) { + /* HW cursor functions */ + if (!DUMMYCursorInit(pScreen)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Hardware cursor initialization failed\n"); + return FALSE; + } + } + + /* Initialise default colourmap */ + if(!miCreateDefColormap(pScreen)) + return FALSE; + + if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, + DUMMYLoadPalette, NULL, + CMAP_PALETTED_TRUECOLOR + | CMAP_RELOAD_ON_MODE_SWITCH)) + return FALSE; + +/* DUMMYInitVideo(pScreen); */ + + pScreen->SaveScreen = DUMMYSaveScreen; + + + /* Wrap the current CloseScreen function */ + dPtr->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = DUMMYCloseScreen; + + /* Wrap the current CreateWindow function */ + dPtr->CreateWindow = pScreen->CreateWindow; + pScreen->CreateWindow = DUMMYCreateWindow; + + /* Report any unused options (only for the first generation) */ + if (serverGeneration == 1) { + xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); + } + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "FBBase before ScreenInit returns is set to %p \n", dPtr->FBBase); + return TRUE; +} + +/* Mandatory */ +Bool +DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL) +{ + SCRN_INFO_PTR(arg); + return dummyModeInit(pScrn, mode); +} + +/* Mandatory */ +void +DUMMYAdjustFrame(ADJUST_FRAME_ARGS_DECL) +{ + + xf86DrvMsg(0, X_INFO, "Adjust frame function starts\n"); + SCRN_INFO_PTR(arg); + int Base; + + Base = (y * pScrn->displayWidth + x) >> 2; + + /* Scale Base by the number of bytes per pixel. */ + switch (pScrn->depth) { + case 8 : + break; + case 15 : + case 16 : + Base *= 2; + break; + case 24 : + Base *= 3; + break; + default : + break; + } + + xf86DrvMsg(pScrn->depth, X_INFO, "Adjust frame function ends, base is %d\n", Base); +} + +/* Mandatory */ +static Bool +DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL) +{ + + xf86DrvMsg(0, X_INFO, "Close screen begins\n"); + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + DUMMYPtr dPtr = DUMMYPTR(pScrn); + + if(pScrn->vtSema){ + dummyRestore(pScrn, TRUE); + free(dPtr->FBBase); + } + + if (dPtr->CursorInfo) + xf86DestroyCursorInfoRec(dPtr->CursorInfo); + + pScrn->vtSema = FALSE; + pScreen->CloseScreen = dPtr->CloseScreen; + return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "close screen function ends\n"); +} + +/* Optional */ +static void +DUMMYFreeScreen(FREE_SCREEN_ARGS_DECL) +{ + + xf86DrvMsg(1, X_INFO, "free screen function begins\n"); + SCRN_INFO_PTR(arg); + DUMMYFreeRec(pScrn); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "free screen function ends\n"); +} + +static Bool +DUMMYSaveScreen(ScreenPtr pScreen, int mode) +{ + + xf86DrvMsg(2, X_INFO, "save screen function begins\n"); + ScrnInfoPtr pScrn = NULL; + DUMMYPtr dPtr; + + if (pScreen != NULL) { + pScrn = xf86ScreenToScrn(pScreen); + dPtr = DUMMYPTR(pScrn); + + dPtr->screenSaver = xf86IsUnblank(mode); + } + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "save screen function ends\n"); + return TRUE; +} + +/* Optional */ +static ModeStatus +DUMMYValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) +{ + + xf86DrvMsg(3, X_INFO, "valid mode function\n"); + return(MODE_OK); +} + +static void +dummySave(ScrnInfoPtr pScrn) +{ +} + +static void +dummyRestore(ScrnInfoPtr pScrn, Bool restoreText) +{ +} + +static Bool +dummyModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) +{ + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "mode init/ restore function beginss\n"); + dummyRestore(pScrn, FALSE); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, " mode init / function ends\n"); + return(TRUE); +} + +Atom VFB_PROP = 0; +#define VFB_PROP_NAME "VFB_IDENT" + +static Bool +DUMMYCreateWindow(WindowPtr pWin) +{ + + xf86DrvMsg(0, X_INFO, "create screen function begins\n"); + ScreenPtr pScreen = pWin->drawable.pScreen; + DUMMYPtr dPtr = DUMMYPTR(DUMMYScrn); + WindowPtr pWinRoot; + int ret; + + pScreen->CreateWindow = dPtr->CreateWindow; + ret = pScreen->CreateWindow(pWin); + dPtr->CreateWindow = pScreen->CreateWindow; + pScreen->CreateWindow = DUMMYCreateWindow; + + xf86DrvMsg(0, X_INFO, "ret value in create window is %d\n", ret); + if(ret != TRUE) + return(ret); + + if(dPtr->prop == FALSE) { +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 8 + pWinRoot = WindowTable[DUMMYScrn->pScreen->myNum]; +#else + pWinRoot = DUMMYScrn->pScreen->root; +#endif + if (! ValidAtom(VFB_PROP)) + VFB_PROP = MakeAtom(VFB_PROP_NAME, strlen(VFB_PROP_NAME), 1); + + ret = ChangeWindowProperty(pWinRoot, VFB_PROP, XA_STRING, + 8, PropModeReplace, (int)4, (pointer)"TRUE", FALSE); + if( ret != Success) + ErrorF("Could not set VFB root window property"); + dPtr->prop = TRUE; + + return TRUE; + } + return TRUE; +} + +#ifndef HW_SKIP_CONSOLE +#define HW_SKIP_CONSOLE 4 +#endif + +static Bool +dummyDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr) +{ + CARD32 *flag; + + switch (op) { + case GET_REQUIRED_HW_INTERFACES: + flag = (CARD32*)ptr; + (*flag) = HW_SKIP_CONSOLE; + return TRUE; + default: + return FALSE; + } +} diff --git a/guest/linux/paragraph/x11_modified_files/xorg.conf b/guest/linux/paragraph/x11_modified_files/xorg.conf new file mode 100755 index 0000000..6613a97 --- /dev/null +++ b/guest/linux/paragraph/x11_modified_files/xorg.conf @@ -0,0 +1,40 @@ +Section "Monitor" +Identifier "Monitor0" +HorizSync 28.0-80.0 +VertRefresh 48.0-75.0 +#Modeline "1280x800" 83.46 1280 1344 1480 1680 800 801 804 828 -HSync +Vsync +# 1224x685 @ 60.00 Hz (GTF) hsync: 42.54 kHz; pclk: 67.72 MHz +#Modeline "800x600" 67.72 800 848 936 1072 600 601 604 636 -HSync +Vsync +Modeline "1024x1024" 67.72 1024 1072 1160 1296 1024 1072 1160 1296 -HSync +Vsync +EndSection + +Section "Device" +Identifier "Card0" +Option "NoDDC" "true" +Option "IgnoreEDID" "true" +Driver "dummy" +EndSection + +Section "Screen" +DefaultDepth 24 +Identifier "Screen0" +Device "Card0" +Monitor "Monitor0" + SubSection "Display" + Depth 24 + Virtual 1024 1024 + Modes "1024x1024" + EndSubSection +EndSection + + +Section "InputClass" + Identifier "system-setup-keyboard" + MatchIsKeyboard "on" + Option "XkbModel" "pc105+inet" + Option "XkbLayout" "us" +# Option "XkbVariant" "(null)" + Option "XkbOptions" "terminate:ctrl_alt_bksp," +EndSection + +