Saturday, October 24, 2009

Linux: To Compile X.org Server 1.6.5 on Debian 5.0 Lenny

I compiled X.org server 1.6.5 on Debian 5.0 Lenny because Lenny's X Windows couldn't run optimally on my Toshiba NB205 netbook's 1024x600 screen. To prepare for compilation, I installed the following packages:



  • bison
  • g++-4.3 or g++-3.4
  • libexpat1-dev
  • libpciaccess-dev
  • libssl-dev
  • libxdamage-dev
  • libxfont-dev
  • libxi-dev
  • libxkbfile-dev
  • libxmu-dev
  • libxxf86vm-dev
  • make
  • x11proto-bigreqs-dev
  • x11proto-composite-dev
  • x11proto-gl-dev
  • x11proto-render-dev
  • x11proto-resource-dev
  • x11proto-scrnsaver-dev
  • x11proto-video-dev
  • x11proto-xcmisc-dev
  • x11proto-xf86dga-dev
  • x11proto-xf86dri-dev
  • x11proto-xinerama-dev
  • xkb-data


g++-3.4 can be found in Debian Etch. I will put my compiled X.org 1.6.5 and dependencies in /usr/local to avoid any conflict with Debian packages:



Compiling Pixman and libDRM


  1. First, I downloaded pixman_0.16.2.orig.tar.gz from Debian Sid's libpixman-1-dev page and compiled pixman as follows:


    tar xzf pixman_0.16.2.orig.tar.gz
    cd pixman-0.16.2/
    ./configure
    make install

    The following files are created:


    /usr/local/include/pixman-1/

    /usr/local/lib/libpixman-1.a

    /usr/local/lib/libpixman-1.la

    /usr/local/lib/libpixman-1.so.0

    /usr/local/lib/libpixman-1.so.0.16.2

    /usr/local/lib/libpixman-1.so

    /usr/local/lib/pkgconfig/pixman-1.pc


  2. I downloaded libdrm_2.4.15.orig.tar.gz from Debian Sid's libdrm-dev page and compiled libdrm2 like this:


    tar xzf libdrm_2.4.14.orig.tar.gz
    cd libdrm-2.4.14/
    ./configure
    make install


    This creates the following files:


    /usr/local/include/drm/

    /usr/local/include/intel_bufmgr.h

    /usr/local/include/xf86drm.h

    /usr/local/include/xf86drmMode.h

    /usr/local/lib/libdrm.la

    /usr/local/lib/libdrm.so

    /usr/local/lib/libdrm.so.2

    /usr/local/lib/libdrm.so.2.4.0

    /usr/local/lib/libdrm_intel.la

    /usr/local/lib/libdrm_intel.so

    /usr/local/lib/libdrm_intel.so.1

    /usr/local/lib/libdrm_intel.so.1.0.0

    /usr/local/lib/pkgconfig/libdrm.pc

    /usr/local/lib/pkgconfig/libdrm_intel.pc



Installing X Protocol Headers


  1. Then, I downloaded x11proto-dri2_2.1.orig.tar.gz from Debian Sid's x11proto-dri2-dev page and compiled dri2proto like this:


    tar xzf x11proto-dri2_2.1.orig.tar.gz
    cd dri2proto-2.1/
    ./configure
    make install

    This installs the following files:


    /usr/local/include/X11/extensions/dri2proto.h

    /usr/local/include/X11/extensions/dri2tokens.h

    /usr/local/lib/pkgconfig/dri2proto.pc


  2. I downloaded x11proto-core_7.0.16.orig.tar.gz from x11proto-core-dev and installed xproto:


    tar xzf x11proto-core_7.0.15.orig.tar.gz
    cd xproto-7.0.15
    ./configure
    make install


    I downloaded x11proto-xext_7.0.4.orig.tar.gz from Debian Sid's x11proto-xext-dev page and installed xextproto:


    tar xzf x11proto-xext_7.0.4.orig.tar.gz
    cd xextproto-7.0.4
    ./configure
    make install

    The following files are created.


    /usr/local/lib/pkgconfig/xproto.pc
    /usr/local/lib/pkgconfig/xextproto.pc
    /usr/local/include/X11/extensions/dpms.h
    /usr/local/include/X11/extensions/dpmsstr.h
    /usr/local/include/X11/extensions/extutil.h
    /usr/local/include/X11/extensions/ge.h
    /usr/local/include/X11/extensions/geproto.h
    /usr/local/include/X11/extensions/Xge.h
    /usr/local/include/X11/extensions/lbxbuf.h
    /usr/local/include/X11/extensions/lbxbufstr.h
    /usr/local/include/X11/extensions/lbxdeltastr.h
    /usr/local/include/X11/extensions/lbximage.h
    /usr/local/include/X11/extensions/lbxopts.h
    /usr/local/include/X11/extensions/lbxstr.h
    /usr/local/include/X11/extensions/lbxzlib.h
    /usr/local/include/X11/extensions/MITMisc.h
    /usr/local/include/X11/extensions/mitmiscstr.h
    /usr/local/include/X11/extensions/multibuf.h
    /usr/local/include/X11/extensions/multibufst.h
    /usr/local/include/X11/extensions/security.h
    /usr/local/include/X11/extensions/securstr.h
    /usr/local/include/X11/extensions/shape.h
    /usr/local/include/X11/extensions/shapestr.h
    /usr/local/include/X11/extensions/shmstr.h
    /usr/local/include/X11/extensions/sync.h
    /usr/local/include/X11/extensions/syncstr.h
    /usr/local/include/X11/extensions/Xag.h
    /usr/local/include/X11/extensions/Xagstr.h
    /usr/local/include/X11/extensions/Xcup.h
    /usr/local/include/X11/extensions/Xcupstr.h
    /usr/local/include/X11/extensions/Xdbe.h
    /usr/local/include/X11/extensions/Xdbeproto.h
    /usr/local/include/X11/extensions/XEVI.h
    /usr/local/include/X11/extensions/XEVIstr.h
    /usr/local/include/X11/extensions/Xext.h
    /usr/local/include/X11/extensions/XLbx.h
    /usr/local/include/X11/extensions/XShm.h
    /usr/local/include/X11/extensions/xtestext1.h
    /usr/local/include/X11/extensions/XTest.h
    /usr/local/include/X11/extensions/xteststr.h
    /usr/local/include/X11/Xfuncproto.h
    /usr/local/include/X11/Xpoll.h
    /usr/local/include/X11/ap_keysym.h
    /usr/local/include/X11/DECkeysym.h
    /usr/local/include/X11/HPkeysym.h
    /usr/local/include/X11/keysymdef.h
    /usr/local/include/X11/keysym.h
    /usr/local/include/X11/Sunkeysym.h
    /usr/local/include/X11/Xalloca.h
    /usr/local/include/X11/Xarch.h
    /usr/local/include/X11/Xatom.h
    /usr/local/include/X11/Xdefs.h
    /usr/local/include/X11/XF86keysym.h
    /usr/local/include/X11/Xfuncs.h
    /usr/local/include/X11/X.h
    /usr/local/include/X11/Xmd.h
    /usr/local/include/X11/Xosdefs.h
    /usr/local/include/X11/Xos.h
    /usr/local/include/X11/Xos_r.h
    /usr/local/include/X11/Xproto.h
    /usr/local/include/X11/Xprotostr.h
    /usr/local/include/X11/Xthreads.h
    /usr/local/include/X11/Xw32defs.h
    /usr/local/include/X11/XWDFile.h
    /usr/local/include/X11/Xwindows.h
    /usr/local/include/X11/Xwinsock.h


  3. I downloaded x11proto-input_1.5.0.orig.tar.gz from Debian Sid's x11proto-input-dev page and installed inputproto:


    tar xzf x11proto-input_1.5.0.orig.tar.gz
    cd inputproto-1.5.0/
    ./configure
    make install

    The following files are copied to the system.


    /usr/local/include/X11/extensions/XI.h

    /usr/local/include/X11/extensions/XInput.h

    /usr/local/include/X11/extensions/XIproto.h

    /usr/local/lib/pkgconfig/inputproto.pc


  4. I downloaded x11proto-randr_1.3.1.orig.tar.gz from Debian Sid's x11proto-randr-dev page and installed randrproto like this:


    tar xzf x11proto-randr_1.3.0.orig.tar.gz
    cd randrproto-1.3.0/
    ./configure
    make install

    This installs the following files:


    /usr/local/include/X11/extensions/randr.h

    /usr/local/include/X11/extensions/randrproto.h

    /usr/local/lib/pkgconfig/randrproto.pc

    /usr/local/share/doc/randrproto/randrproto.txt


  5. I downloaded xtrans_1.2.5.orig.tar.gz from Debian Sid's xtrans-dev page and installed xtrans like this:


    tar xzf xtrans_1.2.4.orig.tar.gz
    cd xtrans-1.2.4
    ./configure
    make install

    The following files are installed:


    /usr/local/include/X11/Xtrans/

    /usr/local/lib/pkgconfig/xtrans.pc

    /usr/local/share/aclocal/xtrans.m4



Compiling Mesa 3D Library


Then, I downloaded mesa_7.6.orig.tar.gz from Debian and compiled Mesa 7.6 as follows:


tar xzf mesa_7.6.orig.tar.gz
cd mesa-7.6/
./configure
make
make install

The following files are installed:


/usr/local/include/GL/GLwDrawA.h

/usr/local/include/GL/GLwDrawAP.h

/usr/local/include/GL/GLwMDrawA.h

/usr/local/include/GL/GLwMDrawAP.h

/usr/local/include/GL/dmesa.h

/usr/local/include/GL/ggimesa.h

/usr/local/include/GL/gl.h

/usr/local/include/GL/gl_mangle.h

/usr/local/include/GL/glew.h

/usr/local/include/GL/glext.h

/usr/local/include/GL/glfbdev.h

/usr/local/include/GL/glu.h

/usr/local/include/GL/glu_mangle.h

/usr/local/include/GL/glut.h

/usr/local/include/GL/glutf90.h

/usr/local/include/GL/glx.h

/usr/local/include/GL/glx_mangle.h

/usr/local/include/GL/glxew.h

/usr/local/include/GL/glxext.h

/usr/local/include/GL/internal/dri_interface.h

/usr/local/include/GL/mesa_wgl.h

/usr/local/include/GL/mglmesa.h

/usr/local/include/GL/osmesa.h

/usr/local/include/GL/svgamesa.h

/usr/local/include/GL/vms_x_fix.h

/usr/local/include/GL/wglew.h

/usr/local/include/GL/wglext.h

/usr/local/include/GL/wmesa.h

/usr/local/lib/dri/EGL_i915.so

/usr/local/lib/dri/ffb_dri.so

/usr/local/lib/dri/i810_dri.so

/usr/local/lib/dri/i915_dri.so

/usr/local/lib/dri/i965_dri.so

/usr/local/lib/dri/mach64_dri.so

/usr/local/lib/dri/mga_dri.so

/usr/local/lib/dri/r128_dri.so

/usr/local/lib/dri/r200_dri.so

/usr/local/lib/dri/r300_dri.so

/usr/local/lib/dri/r600_dri.so

/usr/local/lib/dri/radeon_dri.so

/usr/local/lib/dri/s3v_dri.so

/usr/local/lib/dri/savage_dri.so

/usr/local/lib/dri/sis_dri.so

/usr/local/lib/dri/swrast_dri.so

/usr/local/lib/dri/tdfx_dri.so

/usr/local/lib/dri/trident_dri.so

/usr/local/lib/dri/unichrome_dri.so

/usr/local/lib/libEGL.so

/usr/local/lib/libEGL.so.1

/usr/local/lib/libEGL.so.1.0

/usr/local/lib/libGL.so

/usr/local/lib/libGL.so.1

/usr/local/lib/libGL.so.1.2

/usr/local/lib/libGLU.so

/usr/local/lib/libGLU.so.1

/usr/local/lib/libGLU.so.1.3.070600

/usr/local/lib/libGLw.so

/usr/local/lib/libGLw.so.1

/usr/local/lib/libGLw.so.1.0.0

/usr/local/lib/libglut.so

/usr/local/lib/libglut.so.3

/usr/local/lib/libglut.so.3.7.1

/usr/local/lib/pkgconfig/dri.pc

/usr/local/lib/pkgconfig/gl.pc

/usr/local/lib/pkgconfig/glu.pc

/usr/local/lib/pkgconfig/glut.pc

/usr/local/lib/pkgconfig/glw.pc


Compiling X.org Server


Then, I downloaded xorg-server_1.6.5.orig.tar.gz from Debian and compiled X.org server. The X.org server depends on libpciaccess0 library, so be sure to install libpciaccess-dev before building a X.org server.


tar xzf xorg-server_1.6.5.orig.tar.gz

cd xorg-server-1.6.5/

./configure --sysconfdir=/etc --localstatedir=/var --with-xkb-path=/usr/share/X11/xkb --with-xkb-output=/var/tmp

make

make install

The following files are installed:


/usr/local/bin/X
/usr/local/bin/Xnest
/usr/local/bin/Xorg
/usr/local/bin/Xvfb
/usr/local/bin/cvt
/usr/local/bin/gtf
/usr/local/include/xorg/BT.h
/usr/local/include/xorg/IBM.h
/usr/local/include/xorg/TI.h
/usr/local/include/xorg/XIstubs.h
/usr/local/include/xorg/bstore.h
/usr/local/include/xorg/bstorestr.h
/usr/local/include/xorg/bt829.h
/usr/local/include/xorg/cfb8_16.h
/usr/local/include/xorg/closestr.h
/usr/local/include/xorg/closure.h
/usr/local/include/xorg/colormap.h
/usr/local/include/xorg/colormapst.h
/usr/local/include/xorg/compiler.h
/usr/local/include/xorg/cursor.h
/usr/local/include/xorg/cursorstr.h
/usr/local/include/xorg/damage.h
/usr/local/include/xorg/damagestr.h
/usr/local/include/xorg/dbestruct.h
/usr/local/include/xorg/dgaproc.h
/usr/local/include/xorg/dix.h
/usr/local/include/xorg/dixaccess.h
/usr/local/include/xorg/dixevents.h
/usr/local/include/xorg/dixfont.h
/usr/local/include/xorg/dixfontstr.h
/usr/local/include/xorg/dixgrabs.h
/usr/local/include/xorg/dixstruct.h
/usr/local/include/xorg/dri.h
/usr/local/include/xorg/dri2.h
/usr/local/include/xorg/dristruct.h
/usr/local/include/xorg/edid.h
/usr/local/include/xorg/exa.h
/usr/local/include/xorg/exevents.h
/usr/local/include/xorg/extension.h
/usr/local/include/xorg/extinit.h
/usr/local/include/xorg/extnsionst.h
/usr/local/include/xorg/fb.h
/usr/local/include/xorg/fbdevhw.h
/usr/local/include/xorg/fboverlay.h
/usr/local/include/xorg/fbrop.h
/usr/local/include/xorg/fi1236.h
/usr/local/include/xorg/fourcc.h
/usr/local/include/xorg/gc.h
/usr/local/include/xorg/gcstruct.h
/usr/local/include/xorg/geext.h
/usr/local/include/xorg/geint.h
/usr/local/include/xorg/globals.h
/usr/local/include/xorg/glyphstr.h
/usr/local/include/xorg/hotplug.h
/usr/local/include/xorg/i2c_def.h
/usr/local/include/xorg/input.h
/usr/local/include/xorg/inputstr.h
/usr/local/include/xorg/mi.h
/usr/local/include/xorg/mibank.h
/usr/local/include/xorg/mibstore.h
/usr/local/include/xorg/micmap.h
/usr/local/include/xorg/micoord.h
/usr/local/include/xorg/mifillarc.h
/usr/local/include/xorg/mifpoly.h
/usr/local/include/xorg/migc.h
/usr/local/include/xorg/miline.h
/usr/local/include/xorg/mipict.h
/usr/local/include/xorg/mipointer.h
/usr/local/include/xorg/mipointrst.h
/usr/local/include/xorg/misc.h
/usr/local/include/xorg/miscstruct.h
/usr/local/include/xorg/mispans.h
/usr/local/include/xorg/mistruct.h
/usr/local/include/xorg/miwideline.h
/usr/local/include/xorg/mizerarc.h
/usr/local/include/xorg/msp3430.h
/usr/local/include/xorg/opaque.h
/usr/local/include/xorg/os.h
/usr/local/include/xorg/picture.h
/usr/local/include/xorg/picturestr.h
/usr/local/include/xorg/pixmap.h
/usr/local/include/xorg/pixmapstr.h
/usr/local/include/xorg/privates.h
/usr/local/include/xorg/property.h
/usr/local/include/xorg/propertyst.h
/usr/local/include/xorg/ptrveloc.h
/usr/local/include/xorg/randrstr.h
/usr/local/include/xorg/region.h
/usr/local/include/xorg/regionstr.h
/usr/local/include/xorg/registry.h
/usr/local/include/xorg/renderedge.h
/usr/local/include/xorg/resource.h
/usr/local/include/xorg/rgb.h
/usr/local/include/xorg/rrtransform.h
/usr/local/include/xorg/sarea.h
/usr/local/include/xorg/screenint.h
/usr/local/include/xorg/scrnintstr.h
/usr/local/include/xorg/selection.h
/usr/local/include/xorg/servermd.h
/usr/local/include/xorg/shadow.h
/usr/local/include/xorg/shadowfb.h
/usr/local/include/xorg/shmint.h
/usr/local/include/xorg/site.h
/usr/local/include/xorg/swaprep.h
/usr/local/include/xorg/swapreq.h
/usr/local/include/xorg/tda8425.h
/usr/local/include/xorg/tda9850.h
/usr/local/include/xorg/tda9885.h
/usr/local/include/xorg/uda1380.h
/usr/local/include/xorg/validate.h
/usr/local/include/xorg/vbe.h
/usr/local/include/xorg/vbeModes.h
/usr/local/include/xorg/vgaHW.h
/usr/local/include/xorg/wfbrename.h
/usr/local/include/xorg/window.h
/usr/local/include/xorg/windowstr.h
/usr/local/include/xorg/xaa.h
/usr/local/include/xorg/xaaWrapper.h
/usr/local/include/xorg/xaalocal.h
/usr/local/include/xorg/xaarop.h
/usr/local/include/xorg/xf86.h
/usr/local/include/xorg/xf86Crtc.h
/usr/local/include/xorg/xf86Cursor.h
/usr/local/include/xorg/xf86DDC.h
/usr/local/include/xorg/xf86Modes.h
/usr/local/include/xorg/xf86Module.h
/usr/local/include/xorg/xf86Opt.h
/usr/local/include/xorg/xf86Optrec.h
/usr/local/include/xorg/xf86Parser.h
/usr/local/include/xorg/xf86Pci.h
/usr/local/include/xorg/xf86PciInfo.h
/usr/local/include/xorg/xf86Priv.h
/usr/local/include/xorg/xf86Privstr.h
/usr/local/include/xorg/xf86RAC.h
/usr/local/include/xorg/xf86RamDac.h
/usr/local/include/xorg/xf86RandR12.h
/usr/local/include/xorg/xf86Rename.h
/usr/local/include/xorg/xf86Resources.h
/usr/local/include/xorg/xf86Xinput.h
/usr/local/include/xorg/xf86_OSlib.h
/usr/local/include/xorg/xf86_OSproc.h
/usr/local/include/xorg/xf86cmap.h
/usr/local/include/xorg/xf86fbman.h
/usr/local/include/xorg/xf86i2c.h
/usr/local/include/xorg/xf86int10.h
/usr/local/include/xorg/xf86sbusBus.h
/usr/local/include/xorg/xf86str.h
/usr/local/include/xorg/xf86xv.h
/usr/local/include/xorg/xf86xvmc.h
/usr/local/include/xorg/xf86xvpriv.h
/usr/local/include/xorg/xisb.h
/usr/local/include/xorg/xkbfile.h
/usr/local/include/xorg/xkbrules.h
/usr/local/include/xorg/xkbsrv.h
/usr/local/include/xorg/xkbstr.h
/usr/local/include/xorg/xorg-server.h
/usr/local/include/xorg/xorgVersion.h
/usr/local/include/xorg/xserver-properties.h
/usr/local/include/xorg/xvdix.h
/usr/local/include/xorg/xvmcext.h
/usr/local/lib/X11/Options
/usr/local/lib/pkgconfig/xorg-server.pc
/usr/local/lib/xorg/modules/extensions/libdbe.la
/usr/local/lib/xorg/modules/extensions/libdbe.so
/usr/local/lib/xorg/modules/extensions/libdri.la
/usr/local/lib/xorg/modules/extensions/libdri.so
/usr/local/lib/xorg/modules/extensions/libdri2.la
/usr/local/lib/xorg/modules/extensions/libdri2.so
/usr/local/lib/xorg/modules/extensions/libextmod.la
/usr/local/lib/xorg/modules/extensions/libextmod.so
/usr/local/lib/xorg/modules/extensions/libglx.la
/usr/local/lib/xorg/modules/extensions/libglx.so
/usr/local/lib/xorg/modules/libexa.la
/usr/local/lib/xorg/modules/libexa.so
/usr/local/lib/xorg/modules/libfb.la
/usr/local/lib/xorg/modules/libfb.so
/usr/local/lib/xorg/modules/libint10.la
/usr/local/lib/xorg/modules/libint10.so
/usr/local/lib/xorg/modules/libshadow.la
/usr/local/lib/xorg/modules/libshadow.so
/usr/local/lib/xorg/modules/libshadowfb.la
/usr/local/lib/xorg/modules/libshadowfb.so
/usr/local/lib/xorg/modules/libvbe.la
/usr/local/lib/xorg/modules/libvbe.so
/usr/local/lib/xorg/modules/libvgahw.la
/usr/local/lib/xorg/modules/libvgahw.so
/usr/local/lib/xorg/modules/libwfb.la
/usr/local/lib/xorg/modules/libwfb.so
/usr/local/lib/xorg/modules/libxaa.la
/usr/local/lib/xorg/modules/libxaa.so
/usr/local/lib/xorg/modules/libxf8_16bpp.la
/usr/local/lib/xorg/modules/libxf8_16bpp.so
/usr/local/lib/xorg/modules/linux/libfbdevhw.la
/usr/local/lib/xorg/modules/linux/libfbdevhw.so
/usr/local/lib/xorg/modules/multimedia/bt829_drv.la
/usr/local/lib/xorg/modules/multimedia/bt829_drv.so
/usr/local/lib/xorg/modules/multimedia/fi1236_drv.la
/usr/local/lib/xorg/modules/multimedia/fi1236_drv.so
/usr/local/lib/xorg/modules/multimedia/msp3430_drv.la
/usr/local/lib/xorg/modules/multimedia/msp3430_drv.so
/usr/local/lib/xorg/modules/multimedia/tda8425_drv.la
/usr/local/lib/xorg/modules/multimedia/tda8425_drv.so
/usr/local/lib/xorg/modules/multimedia/tda9850_drv.la
/usr/local/lib/xorg/modules/multimedia/tda9850_drv.so
/usr/local/lib/xorg/modules/multimedia/tda9885_drv.la
/usr/local/lib/xorg/modules/multimedia/tda9885_drv.so
/usr/local/lib/xorg/modules/multimedia/uda1380_drv.la
/usr/local/lib/xorg/modules/multimedia/uda1380_drv.so
/usr/local/lib/xorg/protocol.txt
/usr/local/share/X11/xkb/compiled/README.compiled
/usr/local/share/aclocal/xorg-server.m4
/usr/local/share/man/man1/Xnest.1
/usr/local/share/man/man1/Xorg.1
/usr/local/share/man/man1/Xserver.1
/usr/local/share/man/man1/Xvfb.1
/usr/local/share/man/man1/cvt.1
/usr/local/share/man/man1/gtf.1
/usr/local/share/man/man4/exa.4
/usr/local/share/man/man4/fbdevhw.4
/usr/local/share/man/man5/xorg.conf.5


Compiling X.org Keyboard and Mouse Driver


Then, I downloaded xserver-xorg-input-keyboard_1.4.0.orig.tar.gz from Debian Sid's xserver-xorg-input-kbd page. Also, I downloaded xserver-xorg-input-mouse_1.5.0.orig.tar.gz from Debian Sid's xserver-xorg-input-mouse page. The keyboard and mouse drivers are compiled as follows.


tar xzf xserver-xorg-input-keyboard_1.3.2.orig.tar.gz
cd xf86-input-keyboard-1.3.2/
./configure
make
make install
cd ..
tar xzf xserver-xorg-input-mouse_1.4.0.orig.tar.gz
cd xf86-input-mouse-1.4.0/
./configure
make
make install


Compiling Intel Video Driver


Then, I downloaded xf86-video-intel-2.9.1.tar.bz2 from intellinuxgraphics.org and compiled it.


tar xzf xf86-video-intel-2.9.1.tar.bz2
cd xf86-video-intel-2.9.1
./configure
make
make install

The following files are installed after compilation:


/usr/local/lib/xorg/modules/drivers/ch7017.la
/usr/local/lib/xorg/modules/drivers/ch7017.so
/usr/local/lib/xorg/modules/drivers/ch7xxx.la
/usr/local/lib/xorg/modules/drivers/ch7xxx.so
/usr/local/lib/xorg/modules/drivers/intel_drv.la
/usr/local/lib/xorg/modules/drivers/intel_drv.so
/usr/local/lib/xorg/modules/drivers/ivch.la
/usr/local/lib/xorg/modules/drivers/ivch.so
/usr/local/lib/xorg/modules/drivers/sil164.la
/usr/local/lib/xorg/modules/drivers/sil164.so
/usr/local/lib/xorg/modules/drivers/tfp410.la
/usr/local/lib/xorg/modules/drivers/tfp410.so
/usr/local/share/man/man4/intel.4


List of Produced Files


The following is the list of all files created in /usr/local:


/usr/local/bin/X
/usr/local/bin/Xnest
/usr/local/bin/Xorg
/usr/local/bin/Xvfb
/usr/local/bin/cvt
/usr/local/bin/gtf
/usr/local/include/GL/GLwDrawA.h
/usr/local/include/GL/GLwDrawAP.h
/usr/local/include/GL/GLwMDrawA.h
/usr/local/include/GL/GLwMDrawAP.h
/usr/local/include/GL/dmesa.h
/usr/local/include/GL/ggimesa.h
/usr/local/include/GL/gl.h
/usr/local/include/GL/gl_mangle.h
/usr/local/include/GL/glew.h
/usr/local/include/GL/glext.h
/usr/local/include/GL/glfbdev.h
/usr/local/include/GL/glu.h
/usr/local/include/GL/glu_mangle.h
/usr/local/include/GL/glut.h
/usr/local/include/GL/glutf90.h
/usr/local/include/GL/glx.h
/usr/local/include/GL/glx_mangle.h
/usr/local/include/GL/glxew.h
/usr/local/include/GL/glxext.h
/usr/local/include/GL/internal
/usr/local/include/GL/internal/dri_interface.h
/usr/local/include/GL/mesa_wgl.h
/usr/local/include/GL/mglmesa.h
/usr/local/include/GL/osmesa.h
/usr/local/include/GL/svgamesa.h
/usr/local/include/GL/vms_x_fix.h
/usr/local/include/GL/wglew.h
/usr/local/include/GL/wglext.h
/usr/local/include/GL/wmesa.h
/usr/local/include/X11/DECkeysym.h
/usr/local/include/X11/HPkeysym.h
/usr/local/include/X11/Sunkeysym.h
/usr/local/include/X11/X.h
/usr/local/include/X11/XF86keysym.h
/usr/local/include/X11/XWDFile.h
/usr/local/include/X11/Xalloca.h
/usr/local/include/X11/Xarch.h
/usr/local/include/X11/Xatom.h
/usr/local/include/X11/Xdefs.h
/usr/local/include/X11/Xfuncproto.h
/usr/local/include/X11/Xfuncs.h
/usr/local/include/X11/Xmd.h
/usr/local/include/X11/Xos.h
/usr/local/include/X11/Xos_r.h
/usr/local/include/X11/Xosdefs.h
/usr/local/include/X11/Xpoll.h
/usr/local/include/X11/Xproto.h
/usr/local/include/X11/Xprotostr.h
/usr/local/include/X11/Xthreads.h
/usr/local/include/X11/Xtrans
/usr/local/include/X11/Xtrans/Xtrans.c
/usr/local/include/X11/Xtrans/Xtrans.h
/usr/local/include/X11/Xtrans/Xtransint.h
/usr/local/include/X11/Xtrans/Xtranslcl.c
/usr/local/include/X11/Xtrans/Xtranssock.c
/usr/local/include/X11/Xtrans/Xtranstli.c
/usr/local/include/X11/Xtrans/Xtransutil.c
/usr/local/include/X11/Xtrans/transport.c
/usr/local/include/X11/Xw32defs.h
/usr/local/include/X11/Xwindows.h
/usr/local/include/X11/Xwinsock.h
/usr/local/include/X11/ap_keysym.h
/usr/local/include/X11/extensions/MITMisc.h
/usr/local/include/X11/extensions/XEVI.h
/usr/local/include/X11/extensions/XEVIstr.h
/usr/local/include/X11/extensions/XI.h
/usr/local/include/X11/extensions/XInput.h
/usr/local/include/X11/extensions/XIproto.h
/usr/local/include/X11/extensions/XLbx.h
/usr/local/include/X11/extensions/XShm.h
/usr/local/include/X11/extensions/XTest.h
/usr/local/include/X11/extensions/Xag.h
/usr/local/include/X11/extensions/Xagstr.h
/usr/local/include/X11/extensions/Xcup.h
/usr/local/include/X11/extensions/Xcupstr.h
/usr/local/include/X11/extensions/Xdbe.h
/usr/local/include/X11/extensions/Xdbeproto.h
/usr/local/include/X11/extensions/Xext.h
/usr/local/include/X11/extensions/Xge.h
/usr/local/include/X11/extensions/dpms.h
/usr/local/include/X11/extensions/dpmsstr.h
/usr/local/include/X11/extensions/dri2proto.h
/usr/local/include/X11/extensions/dri2tokens.h
/usr/local/include/X11/extensions/extutil.h
/usr/local/include/X11/extensions/ge.h
/usr/local/include/X11/extensions/geproto.h
/usr/local/include/X11/extensions/lbxbuf.h
/usr/local/include/X11/extensions/lbxbufstr.h
/usr/local/include/X11/extensions/lbxdeltastr.h
/usr/local/include/X11/extensions/lbximage.h
/usr/local/include/X11/extensions/lbxopts.h
/usr/local/include/X11/extensions/lbxstr.h
/usr/local/include/X11/extensions/lbxzlib.h
/usr/local/include/X11/extensions/mitmiscstr.h
/usr/local/include/X11/extensions/multibuf.h
/usr/local/include/X11/extensions/multibufst.h
/usr/local/include/X11/extensions/randr.h
/usr/local/include/X11/extensions/randrproto.h
/usr/local/include/X11/extensions/security.h
/usr/local/include/X11/extensions/securstr.h
/usr/local/include/X11/extensions/shape.h
/usr/local/include/X11/extensions/shapestr.h
/usr/local/include/X11/extensions/shmstr.h
/usr/local/include/X11/extensions/sync.h
/usr/local/include/X11/extensions/syncstr.h
/usr/local/include/X11/extensions/xtestext1.h
/usr/local/include/X11/extensions/xteststr.h
/usr/local/include/X11/keysym.h
/usr/local/include/X11/keysymdef.h
/usr/local/include/drm/drm.h
/usr/local/include/drm/drm_mode.h
/usr/local/include/drm/drm_sarea.h
/usr/local/include/drm/i915_drm.h
/usr/local/include/drm/mach64_drm.h
/usr/local/include/drm/mga_drm.h
/usr/local/include/drm/nouveau_drm.h
/usr/local/include/drm/r128_drm.h
/usr/local/include/drm/r300_reg.h
/usr/local/include/drm/radeon_drm.h
/usr/local/include/drm/savage_drm.h
/usr/local/include/drm/sis_drm.h
/usr/local/include/drm/via_3d_reg.h
/usr/local/include/drm/via_drm.h
/usr/local/include/drm/xgi_drm.h
/usr/local/include/intel_bufmgr.h
/usr/local/include/pixman-1/pixman-version.h
/usr/local/include/pixman-1/pixman.h
/usr/local/include/xf86drm.h
/usr/local/include/xf86drmMode.h
/usr/local/include/xorg/BT.h
/usr/local/include/xorg/IBM.h
/usr/local/include/xorg/TI.h
/usr/local/include/xorg/XIstubs.h
/usr/local/include/xorg/bstore.h
/usr/local/include/xorg/bstorestr.h
/usr/local/include/xorg/bt829.h
/usr/local/include/xorg/cfb8_16.h
/usr/local/include/xorg/closestr.h
/usr/local/include/xorg/closure.h
/usr/local/include/xorg/colormap.h
/usr/local/include/xorg/colormapst.h
/usr/local/include/xorg/compiler.h
/usr/local/include/xorg/cursor.h
/usr/local/include/xorg/cursorstr.h
/usr/local/include/xorg/damage.h
/usr/local/include/xorg/damagestr.h
/usr/local/include/xorg/dbestruct.h
/usr/local/include/xorg/dgaproc.h
/usr/local/include/xorg/dix.h
/usr/local/include/xorg/dixaccess.h
/usr/local/include/xorg/dixevents.h
/usr/local/include/xorg/dixfont.h
/usr/local/include/xorg/dixfontstr.h
/usr/local/include/xorg/dixgrabs.h
/usr/local/include/xorg/dixstruct.h
/usr/local/include/xorg/dri.h
/usr/local/include/xorg/dri2.h
/usr/local/include/xorg/dristruct.h
/usr/local/include/xorg/edid.h
/usr/local/include/xorg/exa.h
/usr/local/include/xorg/exevents.h
/usr/local/include/xorg/extension.h
/usr/local/include/xorg/extinit.h
/usr/local/include/xorg/extnsionst.h
/usr/local/include/xorg/fb.h
/usr/local/include/xorg/fbdevhw.h
/usr/local/include/xorg/fboverlay.h
/usr/local/include/xorg/fbrop.h
/usr/local/include/xorg/fi1236.h
/usr/local/include/xorg/fourcc.h
/usr/local/include/xorg/gc.h
/usr/local/include/xorg/gcstruct.h
/usr/local/include/xorg/geext.h
/usr/local/include/xorg/geint.h
/usr/local/include/xorg/globals.h
/usr/local/include/xorg/glyphstr.h
/usr/local/include/xorg/hotplug.h
/usr/local/include/xorg/i2c_def.h
/usr/local/include/xorg/input.h
/usr/local/include/xorg/inputstr.h
/usr/local/include/xorg/mi.h
/usr/local/include/xorg/mibank.h
/usr/local/include/xorg/mibstore.h
/usr/local/include/xorg/micmap.h
/usr/local/include/xorg/micoord.h
/usr/local/include/xorg/mifillarc.h
/usr/local/include/xorg/mifpoly.h
/usr/local/include/xorg/migc.h
/usr/local/include/xorg/miline.h
/usr/local/include/xorg/mipict.h
/usr/local/include/xorg/mipointer.h
/usr/local/include/xorg/mipointrst.h
/usr/local/include/xorg/misc.h
/usr/local/include/xorg/miscstruct.h
/usr/local/include/xorg/mispans.h
/usr/local/include/xorg/mistruct.h
/usr/local/include/xorg/miwideline.h
/usr/local/include/xorg/mizerarc.h
/usr/local/include/xorg/msp3430.h
/usr/local/include/xorg/opaque.h
/usr/local/include/xorg/os.h
/usr/local/include/xorg/picture.h
/usr/local/include/xorg/picturestr.h
/usr/local/include/xorg/pixmap.h
/usr/local/include/xorg/pixmapstr.h
/usr/local/include/xorg/privates.h
/usr/local/include/xorg/property.h
/usr/local/include/xorg/propertyst.h
/usr/local/include/xorg/ptrveloc.h
/usr/local/include/xorg/randrstr.h
/usr/local/include/xorg/region.h
/usr/local/include/xorg/regionstr.h
/usr/local/include/xorg/registry.h
/usr/local/include/xorg/renderedge.h
/usr/local/include/xorg/resource.h
/usr/local/include/xorg/rgb.h
/usr/local/include/xorg/rrtransform.h
/usr/local/include/xorg/sarea.h
/usr/local/include/xorg/screenint.h
/usr/local/include/xorg/scrnintstr.h
/usr/local/include/xorg/selection.h
/usr/local/include/xorg/servermd.h
/usr/local/include/xorg/shadow.h
/usr/local/include/xorg/shadowfb.h
/usr/local/include/xorg/shmint.h
/usr/local/include/xorg/site.h
/usr/local/include/xorg/swaprep.h
/usr/local/include/xorg/swapreq.h
/usr/local/include/xorg/tda8425.h
/usr/local/include/xorg/tda9850.h
/usr/local/include/xorg/tda9885.h
/usr/local/include/xorg/uda1380.h
/usr/local/include/xorg/validate.h
/usr/local/include/xorg/vbe.h
/usr/local/include/xorg/vbeModes.h
/usr/local/include/xorg/vgaHW.h
/usr/local/include/xorg/wfbrename.h
/usr/local/include/xorg/window.h
/usr/local/include/xorg/windowstr.h
/usr/local/include/xorg/xaa.h
/usr/local/include/xorg/xaaWrapper.h
/usr/local/include/xorg/xaalocal.h
/usr/local/include/xorg/xaarop.h
/usr/local/include/xorg/xf86.h
/usr/local/include/xorg/xf86Crtc.h
/usr/local/include/xorg/xf86Cursor.h
/usr/local/include/xorg/xf86DDC.h
/usr/local/include/xorg/xf86Modes.h
/usr/local/include/xorg/xf86Module.h
/usr/local/include/xorg/xf86Opt.h
/usr/local/include/xorg/xf86Optrec.h
/usr/local/include/xorg/xf86Parser.h
/usr/local/include/xorg/xf86Pci.h
/usr/local/include/xorg/xf86PciInfo.h
/usr/local/include/xorg/xf86Priv.h
/usr/local/include/xorg/xf86Privstr.h
/usr/local/include/xorg/xf86RAC.h
/usr/local/include/xorg/xf86RamDac.h
/usr/local/include/xorg/xf86RandR12.h
/usr/local/include/xorg/xf86Rename.h
/usr/local/include/xorg/xf86Resources.h
/usr/local/include/xorg/xf86Xinput.h
/usr/local/include/xorg/xf86_OSlib.h
/usr/local/include/xorg/xf86_OSproc.h
/usr/local/include/xorg/xf86cmap.h
/usr/local/include/xorg/xf86fbman.h
/usr/local/include/xorg/xf86i2c.h
/usr/local/include/xorg/xf86int10.h
/usr/local/include/xorg/xf86sbusBus.h
/usr/local/include/xorg/xf86str.h
/usr/local/include/xorg/xf86xv.h
/usr/local/include/xorg/xf86xvmc.h
/usr/local/include/xorg/xf86xvpriv.h
/usr/local/include/xorg/xisb.h
/usr/local/include/xorg/xkbfile.h
/usr/local/include/xorg/xkbrules.h
/usr/local/include/xorg/xkbsrv.h
/usr/local/include/xorg/xkbstr.h
/usr/local/include/xorg/xorg-server.h
/usr/local/include/xorg/xorgVersion.h
/usr/local/include/xorg/xserver-properties.h
/usr/local/include/xorg/xvdix.h
/usr/local/include/xorg/xvmcext.h
/usr/local/lib/X11/Options
/usr/local/lib/dri/EGL_i915.so
/usr/local/lib/dri/ffb_dri.so
/usr/local/lib/dri/i810_dri.so
/usr/local/lib/dri/i915_dri.so
/usr/local/lib/dri/i965_dri.so
/usr/local/lib/dri/mach64_dri.so
/usr/local/lib/dri/mga_dri.so
/usr/local/lib/dri/r128_dri.so
/usr/local/lib/dri/r200_dri.so
/usr/local/lib/dri/r300_dri.so
/usr/local/lib/dri/r600_dri.so
/usr/local/lib/dri/radeon_dri.so
/usr/local/lib/dri/s3v_dri.so
/usr/local/lib/dri/savage_dri.so
/usr/local/lib/dri/sis_dri.so
/usr/local/lib/dri/swrast_dri.so
/usr/local/lib/dri/tdfx_dri.so
/usr/local/lib/dri/trident_dri.so
/usr/local/lib/dri/unichrome_dri.so
/usr/local/lib/libEGL.so
/usr/local/lib/libEGL.so.1
/usr/local/lib/libEGL.so.1.0
/usr/local/lib/libGL.so
/usr/local/lib/libGL.so.1
/usr/local/lib/libGL.so.1.2
/usr/local/lib/libGLU.so
/usr/local/lib/libGLU.so.1
/usr/local/lib/libGLU.so.1.3.070600
/usr/local/lib/libGLw.so
/usr/local/lib/libGLw.so.1
/usr/local/lib/libGLw.so.1.0.0
/usr/local/lib/libdrm.la
/usr/local/lib/libdrm.so
/usr/local/lib/libdrm.so.2
/usr/local/lib/libdrm.so.2.4.0
/usr/local/lib/libdrm_intel.la
/usr/local/lib/libdrm_intel.so
/usr/local/lib/libdrm_intel.so.1
/usr/local/lib/libdrm_intel.so.1.0.0
/usr/local/lib/libglut.so
/usr/local/lib/libglut.so.3
/usr/local/lib/libglut.so.3.7.1
/usr/local/lib/libpixman-1.a
/usr/local/lib/libpixman-1.la
/usr/local/lib/libpixman-1.so
/usr/local/lib/libpixman-1.so.0
/usr/local/lib/libpixman-1.so.0.16.2
/usr/local/lib/pkgconfig/dri.pc
/usr/local/lib/pkgconfig/dri2proto.pc
/usr/local/lib/pkgconfig/gl.pc
/usr/local/lib/pkgconfig/glu.pc
/usr/local/lib/pkgconfig/glut.pc
/usr/local/lib/pkgconfig/glw.pc
/usr/local/lib/pkgconfig/inputproto.pc
/usr/local/lib/pkgconfig/libdrm.pc
/usr/local/lib/pkgconfig/libdrm_intel.pc
/usr/local/lib/pkgconfig/pixman-1.pc
/usr/local/lib/pkgconfig/randrproto.pc
/usr/local/lib/pkgconfig/xextproto.pc
/usr/local/lib/pkgconfig/xorg-server.pc
/usr/local/lib/pkgconfig/xproto.pc
/usr/local/lib/pkgconfig/xtrans.pc
/usr/local/lib/xorg/modules/drivers/ch7017.la
/usr/local/lib/xorg/modules/drivers/ch7017.so
/usr/local/lib/xorg/modules/drivers/ch7xxx.la
/usr/local/lib/xorg/modules/drivers/ch7xxx.so
/usr/local/lib/xorg/modules/drivers/intel_drv.la
/usr/local/lib/xorg/modules/drivers/intel_drv.so
/usr/local/lib/xorg/modules/drivers/ivch.la
/usr/local/lib/xorg/modules/drivers/ivch.so
/usr/local/lib/xorg/modules/drivers/sil164.la
/usr/local/lib/xorg/modules/drivers/sil164.so
/usr/local/lib/xorg/modules/drivers/tfp410.la
/usr/local/lib/xorg/modules/drivers/tfp410.so
/usr/local/lib/xorg/modules/extensions/libdbe.la
/usr/local/lib/xorg/modules/extensions/libdbe.so
/usr/local/lib/xorg/modules/extensions/libdri.la
/usr/local/lib/xorg/modules/extensions/libdri.so
/usr/local/lib/xorg/modules/extensions/libdri2.la
/usr/local/lib/xorg/modules/extensions/libdri2.so
/usr/local/lib/xorg/modules/extensions/libextmod.la
/usr/local/lib/xorg/modules/extensions/libextmod.so
/usr/local/lib/xorg/modules/extensions/libglx.la
/usr/local/lib/xorg/modules/extensions/libglx.so
/usr/local/lib/xorg/modules/input/kbd_drv.la
/usr/local/lib/xorg/modules/input/kbd_drv.so
/usr/local/lib/xorg/modules/input/mouse_drv.la
/usr/local/lib/xorg/modules/input/mouse_drv.so
/usr/local/lib/xorg/modules/libexa.la
/usr/local/lib/xorg/modules/libexa.so
/usr/local/lib/xorg/modules/libfb.la
/usr/local/lib/xorg/modules/libfb.so
/usr/local/lib/xorg/modules/libint10.la
/usr/local/lib/xorg/modules/libint10.so
/usr/local/lib/xorg/modules/libshadow.la
/usr/local/lib/xorg/modules/libshadow.so
/usr/local/lib/xorg/modules/libshadowfb.la
/usr/local/lib/xorg/modules/libshadowfb.so
/usr/local/lib/xorg/modules/libvbe.la
/usr/local/lib/xorg/modules/libvbe.so
/usr/local/lib/xorg/modules/libvgahw.la
/usr/local/lib/xorg/modules/libvgahw.so
/usr/local/lib/xorg/modules/libwfb.la
/usr/local/lib/xorg/modules/libwfb.so
/usr/local/lib/xorg/modules/libxaa.la
/usr/local/lib/xorg/modules/libxaa.so
/usr/local/lib/xorg/modules/libxf8_16bpp.la
/usr/local/lib/xorg/modules/libxf8_16bpp.so
/usr/local/lib/xorg/modules/linux/libfbdevhw.la
/usr/local/lib/xorg/modules/linux/libfbdevhw.so
/usr/local/lib/xorg/modules/multimedia/bt829_drv.la
/usr/local/lib/xorg/modules/multimedia/bt829_drv.so
/usr/local/lib/xorg/modules/multimedia/fi1236_drv.la
/usr/local/lib/xorg/modules/multimedia/fi1236_drv.so
/usr/local/lib/xorg/modules/multimedia/msp3430_drv.la
/usr/local/lib/xorg/modules/multimedia/msp3430_drv.so
/usr/local/lib/xorg/modules/multimedia/tda8425_drv.la
/usr/local/lib/xorg/modules/multimedia/tda8425_drv.so
/usr/local/lib/xorg/modules/multimedia/tda9850_drv.la
/usr/local/lib/xorg/modules/multimedia/tda9850_drv.so
/usr/local/lib/xorg/modules/multimedia/tda9885_drv.la
/usr/local/lib/xorg/modules/multimedia/tda9885_drv.so
/usr/local/lib/xorg/modules/multimedia/uda1380_drv.la
/usr/local/lib/xorg/modules/multimedia/uda1380_drv.so
/usr/local/lib/xorg/protocol.txt
/usr/local/share/X11/xkb/compat
/usr/local/share/X11/xkb/compat.dir
/usr/local/share/X11/xkb/compiled/README.compiled
/usr/local/share/X11/xkb/geometry
/usr/local/share/X11/xkb/geometry.dir
/usr/local/share/X11/xkb/keycodes
/usr/local/share/X11/xkb/keycodes.dir
/usr/local/share/X11/xkb/keymap
/usr/local/share/X11/xkb/keymap.dir
/usr/local/share/X11/xkb/rules
/usr/local/share/X11/xkb/semantics
/usr/local/share/X11/xkb/semantics.dir
/usr/local/share/X11/xkb/symbols
/usr/local/share/X11/xkb/symbols.dir
/usr/local/share/X11/xkb/types
/usr/local/share/X11/xkb/types.dir
/usr/local/share/aclocal/xorg-server.m4
/usr/local/share/aclocal/xtrans.m4
/usr/local/share/doc/randrproto/randrproto.txt
/usr/local/share/man/man1/Xnest.1
/usr/local/share/man/man1/Xorg.1
/usr/local/share/man/man1/Xserver.1
/usr/local/share/man/man1/Xvfb.1
/usr/local/share/man/man1/cvt.1
/usr/local/share/man/man1/gtf.1
/usr/local/share/man/man4/exa.4
/usr/local/share/man/man4/fbdevhw.4
/usr/local/share/man/man4/intel.4
/usr/local/share/man/man4/kbd.4
/usr/local/share/man/man4/mousedrv.4
/usr/local/share/man/man5/xorg.conf.5


Post Compilation


After compilation, I typed the following command:


ldconfig

You can remove the following packages if you are to use the self-compiled X.org server.


  • libgl1-mesa-dri
  • libglu1-mesa
  • x11proto-core-dev
  • x11proto-input-dev
  • x11proto-xext-dev
  • xserver-xorg-core
  • xtrans-dev

I edited the configuration file of my display manager SLiM so that SLiM will start the new X server at /usr/local/bin/Xorg.

Thursday, October 22, 2009

To Compile Linux Kernel 2.6.18.8

I restored my old backup of Debian Linux to a JFS partition on my Toshiba NB205 netbook. Then, I wanted to build a kernel optimized for my netbook. However, the latest version of Linux kernel seems to be unstable. So I compiled Linux kernel 2.6.18.8 which I believe is still usable and stable, though a bit outdated. Before compiling a Linux kernel, some packages should be installed.



  • binutils
  • gcc-3.4
  • libglade2-dev
  • make
  • module-init-tools
  • patch

libglade2-dev is needed to compile and run a kernel configuration tool with the command “make gconfig”. I downloaded the source for Linux kernel 2.6.18.8 from the kernel.org FTP server and unpacked it.


tar xzf linux-2.6.18.8.tar.gz
cd linux-2.6.18.8

I am going to add the following features to the kernel:



  • unionfs is a pseudo-filesystem that implements a transparent multi-layer filesystem that's made up of real filesystems. I use it to make a live Linux CD-ROM. The patch for kernel 2.6.18.8 is unionfs-2.5.3_for_2.6.18.8.diff.gz.
  • squashfs is a compressed read-only filesystem. I'll use it for my Web-only Linux system.
  • ndiswrapper will be used to set up network interface cards with Windows drivers. The latest version 1.55 will be used.

Then, I patched the kernel source with unionfs and squashfs:



gzip -dc unionfs-2.5.3_for_2.6.18.8.diff.gz | patch -p1 -l
tar xzf squashfs3.4.tar.gz
patch -p1 -l < squashfs3.4/kernel-patches/linux-2.6.18/squashfs3.4-patch


Then, I copied the config file of an older or running kernel to the kernel source folder.


gzip -dc /proc/config.gz > .config

Then I typed the following command to start a graphical kernel configurator:


make gconfig

I compiled the kernel with the following commands:


make bzImage
make install
make modules
make modules_install

“make modules” took more than an hour to finish. I went to the /boot directory and typed the following commands:


cd /boot
rdev vmlinuz-2.6.18.8 1,0
ramsize vmlinuz-2.6.18.8 2048

The commands above will set the default root device to ramdisk /dev/ram0 and limit the ramdisk size to 2048KB.


Then, I went ahead to create an initrd image for booting with the new kernel. After rebooting with the new kernel, I compiled ndiswrapper and squashfs tools. If you get a ntoskrnl error when compiling ndiswrapper 1.55, apply the following patch:


diff -urN ndiswrapper-1.55-orig/driver/ntoskernel.h ndiswrapper-1.55/driver/ntoskernel.h
--- ndiswrapper-1.55-orig/driver/ntoskernel.h 2009-06-28 16:09:27.000000000 -1000
+++ ndiswrapper-1.55/driver/ntoskernel.h 2009-10-10 21:11:16.363610279 -1000
@@ -875,7 +875,7 @@
#define u64_low_32(x) ((u32)x)
#define u64_high_32(x) ((u32)(x >> 32))

-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+//#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
static inline u64 cmpxchg8b(volatile u64 *ptr, u64 old, u64 new)
{
u64 prev;
@@ -887,7 +887,7 @@
: "A" (old), "b" (u64_low_32(new)), "c" (u64_high_32(new)));
return prev;
}
-#endif
+//#endif

/* slist routines below update slist atomically - no need for
* spinlocks */

I used the following commands to compile ndiswrapper and squashfs tools.


cd squashfs3.4/squashfs-tools
make
cp mksquashfs unsquashfs /usr/local/bin
cd ../../ndiswrapper-1.55
make uninstall
make
make install

Thus a linux kernel 2.6.18.8 has been compiled. The following files and folders are created after this.


/boot/System.map-2.6.18.8
/boot/config-2.6.18.8
/boot/vmlinuz-2.6.18.8
/lib/modules/2.6.18.8/
/sbin/loadndisdriver
/usr/local/bin/mksquashfs
/usr/local/bin/unsquashfs
/usr/man/man8/loadndisdriver.8
/usr/man/man8/ndiswrapper.8
/usr/sbin/ndiswrapper
/usr/sbin/ndiswrapper-buginfo


Related Posts


Wednesday, October 21, 2009

Linux: Tweaking Moblin 2.0 on Toshiba NB205

I installed Moblin 2.0 on my Toshiba NB205 netbook. Since Moblin is a Linux distro targeted for netbooks and still in early development, it doesn't yet have many applications I hoped for. Thus, I need to customize Moblin and compile or install application packages on Moblin. This post chronicles my on-going customization of Moblin.




  1. Setting Up Internet Connection


    Moblin has a simple interface to set up a network connection. Just click the top right corner of the screen and a network manager will appear. I noticed Moblin has a problem keeping a reliable wireless connection. The network manager is too simple to set up a complex wireless connection. For example, you cannot assign WEB keys other than the first one.



    Moblin Network Manager

  2. Adding PATH line to /root/.bashrc


    One of the first things I did was to launch a Terminal and explore the Moblin inside. I became root using the su command but couldn't run many commands because those commands were not found in the PATH. So I had to insert a PATH line into /root/.bashrc:


    # .bashrc

    PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'



  3. Installing Software Packages on Moblin


    The default Moblin installation has just enough applications to browse the Internet, read e-mail, enjoy your movies and pictures, twitter and IM with your friends, and manage your schedule. Well, I guess that's probably enough for everyone's daily netbook use. But I noticed that Moblin was missing a word processor and spreadsheet. My favorite is OpenOffice.org, but I couldn't find it in Moblin's package repository. So I installed AbiWord and Gnumeric instead. First, I started the Application Manager.


    Moblin Settings

    I opened the System menu and selected “Refresh package lists&rdquo just to be sure. Then, I chose &ldquoAll packages&rdquo from the left pane and selected from the package list on the right: Abiword, AdobeReader_enu, and Gnumeric. Then, I clicked the Apply button.


    Moblin_Add_Software

    Moblin check the dependencies and shows you a confirmation dialog. When I clicked the Install button, Moblin downloaded and installed the applications.


    Moblin_Downloading_Software

    Now the Office section of Applications area has new icons for Abiword, Gnumeric and Adobe Reader.


    Moblin Office

Trying Pardus Linux 2009

I wanted to have a usable Linux distro installed on my Toshiba NB205 netbook. So far I tried Moblin, Pardus Linux and Hymera Linux. Moblin is a netbook-specific distro with little options to customize and install additional packages. Hymera had problem using the keyboard, so I removed Hymera without a trial.



Compared to other Linux distros that I tried so far, I am enjoying Pardus Linux very much. Maybe it's the beauty and easiness of KDE4 that make the experience of using Pardus Linux delightful. Although KDE4 doesn't run smoothly on old and slow computers, KDE4 runs fine on my netbook that has Intel Atom N280 processor. I can see all the visual effects and transparency without a noticeable pause.



Kopete in Pardus KDE4

One of the first things I did after installing Pardus Linux is to set up a wireless connection. Luckily, Pardus detected and installed a driver for the Atheros AR9285 wlan chip in my netbook. I used the Network Manager which can be opened from the KDE4's Applications, System menu.



Network Manager in Pardus Linux

After I got wireless connection, I started Firefox. Firefox in Pardus works fine except that it can't display some obscure languages, such as the Indian, Thai and Khmer scripts. In addition, Firefox didn't include an English spell-checker, which is a minor annoyance.



Firefox in Pardus Linux

One thing that's been bugging me is that the sound doesn't work yet. My netbook has two 2 audio chips, Intel High Definition Audio and Realtek High Definition Audio as seen in Windows. Typing lsmod in Konsole showed me that the module snd-hda-intel is loaded but it doesn't play any sound as in Windows. Perhaps I'll have to load a module for Realtek HDA.



Pardus Linux installs many useful applications by default and so far I am happy with the default setup. The application I use a lot is OpenOffice. OpenOffice is not provided by Moblin, but Moblin provides AbiWord through update which is not as full-fledged as OpenOffice.



OpenOffice.org in Pardus Linux

Another thing that I enjoy using in Pardus Linux is its file manager Dolphin which looks sleek and lets me access data in other Windows and Linux partitions. One glitch I found with Dolphin is that Dolphin freezes when I open a folder that has a 800MB PDF file.



Dolphin File Manager in Pardus Linux

I like Pardus Linux very much and think I'll stick with it for a long time. I'd like to join an English-speaking Pardus usergroup but haven't found one yet. Pardus Linux is a Linux distro developed by Turks and it hasn't found popularity on a global scale. Perhaps I will join a Turkish forum and hopefully find someone who can help me in English.

Sunday, October 18, 2009

Setting Up Windows 7 on Compaq Presario V5306US

I installed Windows 7 Home Premium on my old Compaq Presario V5306US notebook. Installation went without a problem, but 3 hardware components were not detected. They are:


  • ATI Mobility RADEON XPRESS X200M Series

  • In-Build Conexant ATI AC '97 Modem

  • HP Quick Launch Buttons


Since both of the built-in Ethernet and wireless network adapters are detected by Windows 7, I started Windows Update and installed the display driver through Windows Update. Drivers for the modem and quick launch buttons can be downloaded from HP/Compaq support site. For the quick launch buttons, extract the package with 7-zip and only install the driver.

The following pictures are taken from the device manager that list devices available in Compaq Presario V5306US.








Tuesday, October 13, 2009

Disabling Office Genuine Advantage

To Uninstall OGA


Microsoft has released Office Genuine Advantage notification though Windows Update that displays an annoying message every time you start an Office application. The message says that the installed copy of Microsoft Office is not genuine. To get rid of this annoying thing, follow the steps below:



  1. Start the Windows registry editor from the Start menu. To find the Windows registry editor, type regedit into the Search box.

    Start_Windows_Registry
  2. Go to the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall in the left pane. Press Ctrl+F or select Find... from the Edit menu. In the Find dialog, type OGA and press Enter.

    Find_OGA_Registry_Key
  3. You'll be taken to the registry key for the OGA installer. In the right pane, double-click UninstallString. Select the value data and copy it by pressing Ctrl+C.

    OGA_Uninstall_String
  4. Open the Start menu. Start the Command Prompt from the Accessories menu as administrator.

    Start Command Prompt as Administrator
  5. Paste the UninstallString above into the Command Prompt.

    Paste_in_Command_Prompt
  6. Run the command. Typically the command looks like:

    MsiExec.exe /X{B2544A03-10D0-4E5E-BA69-0362FFC20D18}

Sunday, October 11, 2009

Linux: Atheros AR9285 Driver for Toshiba NB205

My Toshiba netbook NB205 was pre-installed with Windows XP. After extensive manipulation of partitions, the original Windows XP installation was gone. I booted my old Linux from a USB thumb drive but couldn't go online for lack of a Linux driver for the built-in Atheros AR9285 wireless card. So I looked for the AR9285 Windows driver because my Linux kernel has ndiswrapper support. I found a working driver (x600_wlan785_x_nb.zip) at the MSI support site.



After I downloaded x600_wlan785_x_nb.zip, I unzipped it. A new directory XP_7.7.0.348_20090701 is created.


unzip x600_wlan785_x_nb.zip

There you'll find two drivers, athw.sys and athwx.sys. Go to the ndis5x directory.


cd XP_7.7.0.348_20090701/ndis5x/

Install the Windows driver to be used with ndiswrapper.


ndiswrapper -i netathw.inf

The ndiswrapper tool will copy the Windows driver to a folder in /etc/ndiswrapper. To check your ndiswrapper installation, run the following command:


ndiswrapper -l

If you haven't, load the ndiswrapper kernel module.


modprobe ndiswrapper

Then, use your favorite Wireless configuration tool to connect to your wireless network.

Sunday, October 4, 2009

Setting Up Linux on Toshiba Mini NB205

I am setting up Linux on my Toshiba Mini NB205. If you use a user-friendly Linux distro, such as Pardus Linux, difficult tasks like driver installation and X.org setup are easily done with the help of Linux installer. However, I found it hard to set up my Debian system on Toshiba NB205 which I had previously run from my USB flash drive.



Running pcimodules


I booted my Linux BootCD with kernel 2.6.25.15 and issued the command “pcimodules”



r8169
i2c-i801
ahci
ata_generic
ata_piix
pata_acpi
intel-rng
iTCO-wdt
ehci-hcd
uhci-hcd
snd-hda-intel
intel-agp


With Linux kernel 2.6.18.8, pcimodules displayed the following results:


snd-hda-intel
uhci-hcd
ehci-hcd
intel-rng
generic
piix
ahci
i2c-i801


Creating initrd Image


Based on this information, I created a folder containing the following files:


bin/dash
bin/mount
etc/modprobe.d
lib/ld-linux.so.2
lib/libblkid.so.1
lib/libc.so.6
lib/libdevmapper.so.1.02.1
lib/libdl.so.2
lib/libpthread.so.0
lib/libselinux.so.1
lib/libsepol.so.1
lib/libuuid.so.1
lib/modules/2.6.18.8/kernel/drivers/ide/ide-disk.ko
lib/modules/2.6.18.8/kernel/drivers/ide/pci/piix.ko
lib/modules/2.6.18.8/kernel/drivers/scsi/ahci.ko
lib/modules/2.6.18.8/kernel/drivers/scsi/libata.ko
lib/modules/2.6.18.8/kernel/drivers/scsi/scsi_mod.ko
lib/modules/2.6.18.8/kernel/drivers/scsi/sd_mod.ko
lib/modules/2.6.18.8/kernel/fs/jfs/jfs.ko
lib/modules/2.6.18.8/kernel/fs/nls/nls_base.ko
lib/modules/2.6.18.8/kernel/fs/nls/nls_utf8.ko
lib/modules/2.6.18.8/modules.dep
sbin/modprobe
sbin/pivot_root
usr/sbin/chroot

Then, inside this folder, I created etc folder and saved a file called init with the following contents.


#!/bin/dash
modprobe piix &&
modprobe ide-disk &&
modprobe ahci &&
modprobe sd_mod &&
mount -n -t jfs -o ro,iocharset=utf8 /dev/sda1 /mnt
cd /mnt
pivot_root . initrd
exec chroot . /sbin/init 5 dev/console 2>&1

Then, I ran the following commands inside the folder:


mkdir dev mnt tmp
cd dev; MAKEDEV std hda sda consoleonly

I created a cramfs image of this folder. Now I could boot into Linux with the following GRUB commands:


kernel (hd0,5)/26188.bin vga=0x314 video=vesa:mtrr
initrd (hd0,5)/initrd.bin

I succeeded in booting into Linux

Friday, October 2, 2009

To Compile GRUB with GFXBOOT and SLIC patch

I use GRUB 0.97 to boot multiple operating systems on my computer. While I was searching Yahoo! China, I found a patch called loadslic.patch. I wanted to use MinGW to compile GRUB with GFXBOOT and SLIC patch. But I received an error saying “GRUB requires a working absolute objcopy; upgrade your binutils.” So I switched to Linux and compiled GRUB. Below I show how I did it.




  1. I prepared my compiler environment by installing GCC 3.4. Then I downloaded the following files:





  2. Unpack the GRUB 0.97 source.


    tar xzvf grub-0.97.tar.gz
    cd grub-0.97


  3. Apply various patches.


    patch -p1 -l < ../040_all_grub-0.96-nxstack.patch
    patch -p1 -l < ../05-grub-0.97-initrdaddr.diff
    patch -p1 -l < ../i2o.patch
    patch -p1 -l < ../intelmac.patch
    patch -p1 -l < ../more-raid.patch
    patch -p1 -l < ../special-devices.patch
    patch -p1 -l < ../grub-0.97-pure64-1.patch


  4. Apply the GFXBOOT patch.


    cd ..
    tar xjvf gfxboot-4.1.19.tar.bz2
    cd ../grub-0.97
    patch -p0 -l < ../gfxboot-4.1.19/patches/grub-0.97.diff



  5. Apply the following patch which adds a feature to load an OEM SLIC table for Windows activation. I found this patch through Yahoo! China. Save it as loadslic.patch.


    --- grub-0.97/stage2/builtins.c 2005-02-16 05:58:23.000000000 +0800
    +++ grub-0.97.new/stage2/builtins.c 2009-08-11 22:37:26.000000000 +0800
    @@ -48,6 +48,7 @@
    #ifdef USE_MD5_PASSWORDS
    # include <md5.h>
    #endif
    +#include <defs.h>

    /* The type of kernel loaded. */
    kernel_t kernel_type;
    @@ -397,6 +398,180 @@
    "Print the contents of the file FILE."
    };

    +
    +/*
    + * Add by yangrz, 2009-08-11
    + */
    +#define SLIC_LENGTH 0x176
    +
    +typedef struct acpi_rsdp {
    + char signature[8]; /* RSDP signature "RSD PTR" */
    + u_char checksum; /* checksum of the first 20 bytes */
    + char oem_id[6]; /* OEM ID, "LXBIOS" */
    + u_char revision; /* 0 for APCI 1.0, 2 for ACPI 2.0 */
    + u_int rsdt_address; /* physical address of RSDT */
    + u_int length; /* total length of RSDP (including extended part) */
    + unsigned long long xsdt_address; /* physical address of XSDT */
    + u_char ext_checksum; /* chechsum of whole table */
    + u_char reserved[3];
    +} __attribute__((packed)) acpi_rsdp_t;
    +
    +typedef struct acpi_table_header /* ACPI common table header */
    +{
    + char signature [4]; /* ACPI signature (4 ASCII characters) */\
    + u_int length; /* Length of table, in bytes, including header */\
    + u_char revision; /* ACPI Specification minor version # */\
    + u_char checksum; /* To make sum of entire table == 0 */\
    + char oem_id [6]; /* OEM identification */\
    + char oem_table_id [8]; /* OEM table identification */\
    + u_int oem_revision; /* OEM revision number */\
    + char asl_compiler_id [4]; /* ASL compiler vendor ID */\
    + u_int asl_compiler_revision; /* ASL compiler revision number */
    +} __attribute__ ((packed)) acpi_header_t;
    +
    +/* RSDT */
    +typedef struct acpi_rsdt {
    + struct acpi_table_header header;
    + /* MCONFIG, HPET, FADT, SRAT, SLIT, MADT(APIC), SSDT, SSDTX, and SSDT for CPU pstate*/
    + u_int entry[1];
    +} __attribute__ ((packed)) acpi_rsdt_t;
    +
    +static u_char
    +acpi_checksum(u_char *table, u_int length)
    +{
    + u_char ret=0;
    + while (length--)
    + {
    + ret += *table;
    + table++;
    + }
    + return -ret;
    +}
    +
    +static acpi_rsdp_t *
    +acpi_find_rsdp(void)
    +{
    + acpi_rsdp_t *rsdp;
    +
    + //TODO: also search EBDA
    + for ( rsdp = (acpi_rsdp_t *)(RAW_ADDR(0xe0000));
    + rsdp < (acpi_rsdp_t *)(RAW_ADDR(0xfffff - 0x16));
    + rsdp = (acpi_rsdp_t *)((unsigned char *)rsdp + 16) )
    + {
    + if ( memcmp(rsdp->signature, "RSD PTR ", 8) == 0
    + && acpi_checksum((u_char *)rsdp, rsdp->length) == 0 )
    + {
    + return rsdp;
    + }
    + }
    +
    + return NULL;
    +}
    +
    +static acpi_header_t *
    +acpi_find_slic(acpi_rsdp_t *rsdp)
    +{
    + int i;
    + acpi_rsdt_t *rsdt;
    + acpi_header_t *slic;
    +
    + rsdt = (acpi_rsdt_t *)(rsdp->rsdt_address);
    + for ( i = 0;
    + i < (rsdt->header.length - sizeof(acpi_header_t))/4;
    + i++)
    + {
    + slic = (acpi_header_t *)(RAW_ADDR(rsdt->entry[i]));
    + if ( slic != NULL && memcmp(slic->signature, "SLIC", 4) == 0 )
    + {
    + return slic;
    + }
    + }
    +
    + return NULL;
    +}
    +
    +/*
    + * return value : success 0
    + * fail 1
    + */
    +static int
    +acpi_copy_memory(char *target, char *source, int len)
    +{
    + int i;
    +
    + for ( i = 0; i < len; i++ )
    + {
    + target[i] = source[i];
    + }
    + /* check data */
    + if ( memcmp(target, source, len) != 0 )
    + {
    + printf("modify memory fail: maybe address 0x%x write protect\n",
    + target);
    + return 1;
    + }
    + return 0;
    +}
    +
    +static int
    +acpi_add_slic(char *arg, int flags)
    +{
    + char *file = arg;
    + acpi_rsdp_t *rsdp;
    + acpi_header_t *slic;
    + char buf[SLIC_LENGTH];
    +
    + rsdp = acpi_find_rsdp();
    + if ( rsdp == NULL )
    + {
    + grub_printf("can not find rsdp\n");
    + return 1;
    + }
    + slic = acpi_find_slic(rsdp);
    + if ( slic == NULL )
    + {
    + grub_printf("can not find slic\n");
    + return 1;
    + }
    +
    + if ( slic->length != SLIC_LENGTH )
    + {
    + return 1;
    + }
    +
    + if ( !grub_open(file) )
    + {
    + printf("grub open %s fail\n", file);
    + return 1;
    + }
    + if ( grub_read (buf, SLIC_LENGTH) != SLIC_LENGTH )
    + {
    + printf("grub read fail\n");
    + grub_close();
    + return 1;
    + }
    + grub_close();
    +
    + if ( acpi_copy_memory((char *)slic, buf, SLIC_LENGTH) )
    + {
    + errnum = ERR_WONT_FIT;
    + return 1;
    + }
    +
    + errnum = ERR_NONE;
    + return 0;
    +}
    +
    +static struct builtin builtin_load_slic =
    +{
    + "loadslic",
    + acpi_add_slic,
    + BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
    + "loadslic FILE",
    + "load acpi slic form file"
    +};
    +/* end yangrz add */
    +

    /* chainloader */
    static int
    @@ -4835,6 +5010,8 @@
    &builtin_install,
    &builtin_ioprobe,
    &builtin_kernel,
    + /* Add by yangrz, 2009-08-08 */
    + &builtin_load_slic,
    &builtin_lock,
    &builtin_makeactive,
    &builtin_map,

    Apply this patch as follows:


    patch -p1 -l < ../loadslic.patch


  6. Compile GRUB.


    ./configure --prefix=/usr
    make
    make install

    The following files are installed:


    /usr/bin/mbchk
    /usr/info/multiboot.info
    /usr/lib/grub/i386-pc
    /usr/man/man1/mbchk.1
    /usr/man/man8/grub.8
    /usr/man/man8/grub-install.8
    /usr/man/man8/grub-md5-crypt.8
    /usr/man/man8/grub-terminfo.8
    /usr/sbin/grub
    /usr/sbin/grub-install
    /usr/sbin/grub-md5-crypt
    /usr/sbin/grub-set-default
    /usr/sbin/grub-terminfo

    To get my GRUB binaries, read this post.





Using GRUB to load SLIC


Note that the SLIC patch for GRUB only works on computers with BIOS that actually contain a SLIC table. To load SLIC with the patched GRUB, use the loadslic command at the GRUB prompt or in the menu.lst configuration file. For example, a menu.lst may contain a section like the following:


# GRUB Boot Menu
hiddenmenu

# By default, boot Windows Vista
default 0
timeout 0

# Boot Windows Vista Home Premium
title Windows Vista Home Premium
unhide (hd0,0)
hide (hd0,1)
loadslic (hd0,5)/boot/grub/slic.bin
chainloader (hd0,0)+1


For old computers with non-SLP BIOS, read this post.

Wednesday, September 30, 2009

VirtuaWin Settings

I found a useful virtual desktop manager called VirtuaWin on SoureForge. The following is my VirtuaWin settings.



VirtuaWin general settings

I use 4 desktops horizontally. Desktop wrapping is enabled so that going eastward from the fourth desktop will lead to the first desktop.


Virtuawin Hotkeys

Holding down Alt+Win and pressing F1, F2, F3, F4 will allow me to switch to the first, the second, the third and the fourth desktop respectively.


virtuawin_mouse

Holding Shift down and moving the mouse cursor against an edge of the screen will allow me to switch desktops.

Tuesday, September 29, 2009

GRUB: Booting and Activating Windows Vista/7

This post describes a way to activate Windows Vista/7 with Grub and SLIC loader. In order to successfully activate Windows Vista/7, you essentially need the following 3 things.



  • OEM SLIC code

    Every SLIC code is 374 bytes. It can be extracted from the BIOS by using the SLIC Dump ToolKit on a PC running legitimate Windows.
  • OEM Certificate (*.xrm-ms) that matches with the corresponding SLIC code
  • Valid 25-digit Windows key


Once these 3 things are obtained, you need a program to insert the SLIC code into memory to emulate OEM BIOS. I found an executable file called wow.exe whose job is to insert a SLIC code into BIOS. Also, GRUB.EXE is needed to find Windows partition and to boot Windows.



Because wow.exe and grub.exe are DOS executables, DOS should be booted first and run wow.exe and grub.exe in turn. grub.exe will chain-load Windows bootmgr, and then Windows will start. FreeDOS is preferred to MS-DOS because it works better with GRUB. Download a floppy image containing FreeDOS kernel and FreeCOM command processor below.




Inserting SLIC data into wow.exe with XVI32


wow.exe has a SLIC table embedded in itself beginning at $A58. Start XVI32 and open wow.exe. Start another XVI32 and open a SLIC table which should be 374 bytes.

With the XVI32 window showing a SLIC.table, open the Edit menu, click the beginning of file, select Block mark from the Edit menu, go to the end of file and select Block mark again. Open the Edit menu, open the Clipboard submenu and select Copy.

With the XVI32 window showing wow.exe, go to $A58, open the Edit window, select Block <n> chars..., enter 374 and click OK. Select Block delete from the Edit menu. Then, open the Edit menu, open the Clipboard submenu, and choose Paste. Go to $A38 and select Overwrite string... and enter the new 14-character OEM identifier which should match the string starting at $A62. Save the file wow.exe.


Open the FreeDOS floppy image with WinImage. Insert wow.exe into the floppy image. Create a batch file called AUTOEXEC.BAT with a text editor and put the following contents in it.


@ECHO OFF
WOW
GRUB

Save the file AUTOEXEC.BAT and insert in into FreeDOS floppy image.


Assuming that Windows 7 is installed, open a Command Prompt as administrator. Create an arbitrary file in C:\Boot, for example, with the filename win7. This file will be used to find the Windows partition (useful in mutiple-Windows environment).


copy nul C:\Boot\win7

Then, create a new text file MENU.LST with the following contents:


timeout 0
default 0
fallback 0
hiddenmenu

title Windows 7
find --set-root /boot/win7
chainloader /bootmgr

Save the file as MENU.LST and insert it into the floppy image with WinImage. Save the floppy image and quit WinImage.


With GRUB installed into MBR, type the following GRUB commands at boot time to boot Windows with BIOS-inserted SLIC code. Assume memdisk and freedos.flp is in the (hd0,3) partition.


kernel (hd0,3)/boot/grub/memdisk
initrd (hd0,3)/boot/grub/freedos.flp


Activating Windows


Once Windows has started, find the OEM certificate (*.xrm-ms) and 25-character Windows key that match the SLIC table just loaded into BIOS. Open a command prompt as administrator and type the following commands to activate Windows:


slmgr -ilc oemcert.xrm-ms
slmgr -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Hopefully, Windows will be activated.

Saturday, September 26, 2009

Setting Up Windows Recovery Environment with Bootmgr

After installing Windows 7, I found Winre.wim in C:\Recovery folder. I wanted to create a separate recovery partition and set it up so that it will boot to Windows Recovery Environment. So I created a new primary partition formatted in NTFS. I rebooted with Windows 7 DVD, chose “Repair Your Computer.” and opened a Command Prompt. I typed the following commands:


C:
bootrec /fixboot
copy D:\bootmgr C:\
robocopy D:\Boot C:\Boot /E
robocopy D:\Recovery C:\Recovery /E

D: is the Windows 7 partition. I used bcdedit in the following way to enable Windows Recovery Partition:


bcdedit /create /d "Windows Recovery Environment" /application osloader
bcdedit /set {13800a57...} device ramdisk=[C:]\Recovery\Winre.wim,{ramdiskoptions}
bcdedit /set {13800a57...} osdevice ramdisk=[C:]\Recovery\Winre.wim,{ramdiskoptions}
bcdedit /set {13800a57...} path \Windows\System32\winload.exe
bcdedit /set {13800a57...} systemroot \Windows
bcdedit /set {13800a57...} winpe yes
bcdedit /displayorder {13800a57...} /addlast

Here, the UUID's have been abbreviated. However, Windows Recovery Partition seemed to be loading for a few seconds, then crashed with blue screen.

Creating a Bootable USB Thumb Drive

Most modern computers allow booting from a USB thumb drive. However, creating a bootable USB drive can be a tricky task because different BIOS may assign different hexadecimal designators for a USB drive, depending on computers and situations. For example, my laptop assigns 0x80 to the internal hard drive and 0x81 to a USB drive when the computer boots from the internal hard drive as usual. However, if I choose to boot from my USB thumb drive at the BIOS boot menu after pressing Esc, the BIOS assigns 0x80 to the USB drive and 0x81 to the hard drive.


Booting from external storage, such as a USB drive or SDHC card, allows one to start an operating system externally, freeing oneself from the limitations of an internel hard drive. In this post, I show heterogenous methods to create a bootable USB drive.



Partitioning a USB drive


Most USB thumb drives have only one partition. If you are happy with just one partition, that's fine. But if you want to slice your USB drive into multiple partitions, I recommend you to use GParted. To download and use GParted, get a bootable ISO from the following links and burn it with CD burning software, such as CDBurnerXP.



I partition my USB drive in order to install Linux on it. Usually, I make 2 partitions (one FAT16 partition and one EXT2 partition). Sometimes, I create another partition that I format as Linux swap. Here's my typical partition layout for USB thumb drives.



/dev/sdb1 FAT16 or FAT32
/dev/sdb2 EXT2, EXT3 or JFS
/dev/sdb3 Linux Swap


Installing MBR


Setting up MBR (short for master boot record) correctly is crucial in creating a bootable USB drive. In this post, I use the Debian/Ubuntu mbr package to set up MBR on my USB thumb drive.


Use the install-mbr command from the mbr package to install a functional master boot record.


install-mbr /dev/sdc -v --drive 0x80 --enable +12


Making FAT partitions bootable



FreeDOS kernel and FreeCOM


Originally, my 256MB USB thumb drive has only one primary partition formatted in FAT16. Since it's not feasible to install Windows on USB thumb drives, I installed a FreeDOS kernel on my USB thumb drive. I downloaded FreeDOS kernel and FreeCom command shell. I booted FreeDOS using a FreeDOS floppy. Then, I installed kernel.sys and command.com just to have a bootable DOS.


sys D /update /oem:fd
copy command.com D:

Restart your computer with the USB thumb drive still plugged in. Press the key for displaying the BIOS boot menu. This key may be Esc or F12. Select your USB drive from the menu. Hopefully, you'll reach the FreeDOS command prompt.



Syslinux


Syslinux can be installed on either FAT or EXT2 partition. Syslinux provides a versatile multi-boot functionality, comparable to GRUB. In Linux, I used the following command to make the FAT partition bootable with syslinux.


syslinux /dev/sdb1

This command copies ldlinux.sys to the FAT partition.

Monday, September 21, 2009

To Create Windows Vista/7 Boot Floppy

Windows Vista and Windows 7 are overly complicated pieces of software, and thus bring a bunch of boot problems with them. In preparation for such problems, it is wise to create a boot floppy for Windows Vista or Windows 7. Floppy drives are hard to find in new computers, and are being phased out in favor of USB thumb drives. If your computer doesn't have a built-in floppy drive, you can get a USB floppy drive and use it to create a boot floppy. If you don't have a floppy drive, download a floppy image from the links below and use it with a bootloader, such as GRUB.


To create a Windows Vista/7 boot floppy, follow these steps:


  1. Insert a blank floppy diskette into your floppy drive. If your floppy drive is a USB type, connect it to your computer.
  2. Click Computer in the Start menu. This opens Computer in Windows Explorer.
  3. Right-click on Floppy Disk Drive (A:) and choose Format... from the menu.
  4. Click Start in the Format window.
  5. Copy C:\bootmgr to A:\. The file bootmgr is also located on Windows Vista/7 installer CD. You may have to unhide bootmgr before copying it if it is hidden.
  6. Create a new folder A:\BOOT.
  7. Open a Command Prompt and run the following commands to copy C:\BOOT\BCD.

    bcdedit /export A:\BOOT\BCD

  8. Reboot your computer with the boot floppy. You'll be able to get back to Windows Vista/7.


For those who can't create their own boot floppy for lack of a floppy drive, here's my boot floppy image:



You can use it with GRUB like this:


kernel (hd0,4)/boot/grub/memdisk bigraw
initrd (hd0,4)/boot/grub/vstaboot.bin
boot

memdisk is a part of Loadlin package. Note that this image is specific to my Vista installation. You must edit it with bcdedit before using it:


bcdedit /enum /store A:\Boot\BCD
bcdedit /store A:\Boot\BCD /set {bootmgr} device partition=C:
bcdedit /store A:\Boot\BCD /set {default} device partition=C:
bcdedit /store A:\Boot\BCD /set {default} osdevice partition=C:

Saturday, September 19, 2009

Linux: Building RipOff 0.8.3

I am building RipOff which is a GTK+ application that rips Audio CD's. RipOff depends on GTK+ 2.4 and up, libcdio, libcddb, libogg, libvorbis, Lame and FLAC. Let's first build RipOff dependencies:



  1. Install the following packages:


    • libcddb2-dev
    • libflac-dev
    • libgtk2.0-dev
    • libogg-dev
    • libvorbis-dev
    • libxml2-dev

  2. RipOff 0.8.3 requires glib 2.8 and up. If the version of glib is too old, you have to build glib yourself.

    ./configure --prefix=/usr --disable-shared --disable-debug
    make
    make install

  3. Download the libcdio source and compile it:

    tar xzvf libcdio-0.82.tar.gz
    cd libcdio-0.82
    ./configure --prefix=/usr --disable-shared
    make
    make install

  4. If libcddb2-dev package is not available, download the libcddb source and compile libcddb:
    tar xzvf Downloads/libcddb-1.3.2.tar.gz
    cd libcddb-1.3.2/
    ./configure --prefix=/usr --disable-shared
    make
    make install

  5. Compile LAME as follows:


    ./configure --prefix=/usr --disable-shared
    make
    make install

  6. Build RipOff as follows:


    ./configure --prefix=/usr
    make
    make install

    The following files are installed by RipOff:


    /usr/bin/ripoff
    /usr/include/ripoff/RipOff.h
    /usr/include/ripoff/RipOffConfigFile.h
    /usr/include/ripoff/RipOffPluginRawInterface.h
    /usr/include/ripoff/RipOffTrack.h
    /usr/include/ripoff/config.h
    /usr/lib/libripoff.a
    /usr/lib/libripoff.la
    /usr/lib/libripoff.so
    /usr/lib/libripoff.so.0
    /usr/lib/libripoff.so.0.0.0
    /usr/lib/ripoff/plugins/libflac.so
    /usr/lib/ripoff/plugins/liblame.so
    /usr/lib/ripoff/plugins/libvorbis.so
    /usr/lib/ripoff/plugins/libwav.so
    /usr/share/applications/ripoff.desktop
    /usr/share/pixmaps/ripoff.xpm

Thursday, September 17, 2009

Using GRUB To Boot Windows XP with a Floppy Image

I had trouble booting Windows XP installed in a logical partition. I guess the boot sector of the logical partition was damaged. I had to boot this installation of Windows XP by chainloading from another Windows XP on a primary partition. But without another Windows XP partition, I can boot Windows XP from a floppy diskette although floppy diskettes are not in much use nowadays.



I created a Windows XP boot floppy by following instruciton on this article on the Microsoft site. Then, I booted Linux and made an image file of the boot floppy.


dd if=/dev/fd0 of=ntboot.bin bs=512

Save the image file somewhere in your hard drive. Then, when you start the computer, use the following GRUB commands to boot Windows XP.


kernel (hd0,6)/boot/grub/memdisk bigraw
initrd (hd0,6)/boot/grub/ntboot.bin

memdisk is a part of the syslinux package.


Here's my XP boot image to be used with GRUB or syslinux: ntboot.bin. Before actually using it, make sure to edit BOOT.INI in it.

Wednesday, September 16, 2009

GRUB and NTFS boot sector

After messing with the hard disk partitions, Windows XP installations in logical partitions failed to bootstrap directly. However, I finally managed to boot Windows XP on a logical partition by chainloading from another XP on a primary partition. This required me to edit the file BOOT.INI on the primary XP partition.


I suppose the boot sector of the logical partition is broken. I booted Linux and extracted the boot sector from the primary partition containing Windows XP.


dd if=/dev/sda2 of=xpboot.bin bs=512 count=1

I experimented with this boot sector and GRUB. At boot time, I typed the following GRUB command.


chainloader (hd0,5)/xpboot.bin
boot

This allowed me to boot Windows XP. However, the XP boot sector apparently reads BOOT.INI from the primary partition. I will analyze the boot sector file with an Hexadecimal editor. By studying the NTFS boot sector, I will be able to solve Windows XP boot problems.

Linux: Installing Windows Vista/7 Wireless Driver for use with ndiswrapper

I booted Linux on my Toshiba Mini NB205 netbook. My Linux system is installed on a USB memory stick and I boot it by plugging it in and using GRUB to load the Linux kernel and a custom initrd image. My Linux system doesn't have network connection yet because it doesn't have the driver for Atheros AR9285 wireless LAN adapter. It can't start X Windows either because I haven't installed the X.org driver package for Intel chipsets yet. Once I set up my wireless connection, I'll update my system, install the Intel video driver, and then set up X Windows.



I tried to install the Windows driver for my Atheros Wireless LAN card which will be loaded by ndiswrapper. First, I had to mount the NTFS partition which is hosting my Windows 7 system.


fdisk -l /dev/sda
mount -t ntfs-3g /dev/sda1 /mnt

I changed my working directory to DriverStore/FileRepository.


cd /mnt/Windows/System32/DriverStore/FileReposity

I tried to find the Vendor ID and Device ID of my wireless LAN card by reading the output of lspci -nn.


lspci -nn

The command above gave me the following output.


03:00.0 Network Controller [0280]: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) [168c:002b]

In order to make it easy to find the driver for my wireless LAN card, I created a script file /usr/local/bin/findmydrv.sh with the following contents:


#!/bin/sh
FILETYPE=`file $1`
case "$FILETYPE" in
*UTF-16*)
iconv -f utf16 -t utf8 $1 | \
grep -i $2 | \
grep -iq $3 && \
echo "Found the driver for your device $2:$3 in $1"
;;
*)
grep -i $2 $1 | \
grep -iq $3 && \
echo "Found the driver for your device $2:$3 in $1"
;;
esac

Then, I used the following command.


find -type f -iname \*.inf -exec findmydrv.sh \{\} 168c 002b \;

The previous command will show the location of the .INF file that contains the driver setup information. Once I found the folder that contains the Atheros driver, I went there and installed the driver.


cd netathr.inf_x86_neutral_*
ls -l
ndiswrapper -i netathr.inf

I checked whether the driver was successfully installed by running:


ndiswrapper -l

This displayed the following.


netathr : driver installed
device (168C:002B) present

I tried the newly installed Windows driver.


modprobe ndiswrapper


Related Posts


Sunday, September 13, 2009

Booting Windows Vista/7 From a Logical Partition

It is possible for Windows Vista and Windows 7 to be installed on logical partitions. Windows Vista and Windows 7 use the new bootmgr bootloader to start themselves as opposed to ntldr used by old NT-based operating systems like Windows XP. Therefore, booting Windows Vista/7 from a logical partition takes a different approach from booting Windows XP from a logical partition.



Installing Windows Vista/7 onto a Logical Partition


Windows Vista/7 can be installed into a logical partition at the time of first installation. However, a new primary NTFS partition will be created. This partition is about 100 MB and only contains essential bootloader files, such as bootmgr and BCD. If you intend to remove this Vista/Win7 boot partition, be sure to copy its contents (especially bootmgr and BCD) to the logical partition containing Windows Vista/7 beforehand.

After that, reboot with Vista/Win7 installer CD, choose “Repair Your Computer” and proceed to invoke the Command Prompt. Type the following commands to enable Vista/Win7 to boot from a logical partition.


C:
bcdedit /enum /store C:\Boot\BCD
bcdedit /store C:\Boot\BCD /set {bootmgr} device partition=C:

Restart your computer. Put a CD into CD-ROM that has GRUB bootloader. Most Linux install CD's use GRUB these days. When you see the Grub boot menu, press C or Esc. You are now on the GRUB command line. To find which partition is your Windows partition, type root (hd0, and then press Tab. Windows partitions are mostly type 7. For example, if your Windows partition is (hd0,5), type the following commands to boot Windows.


root (hd0,5)
chainloader +1
boot

The reason why we want to remove the boot partition is most likely because we want to free a primary partition for use by another OS, such as OpenBSD or OpenSolaris. However, in order to boot Windows from a logical partiton, you need to set up a special bootloader, for example, GRUB.



Copying Windows Vista/7 from Primary to Logical Partition


If you installed Windows Vista/7 on a primary partition and want to move it to a logical parition, we need GParted to manipulate partitions. To get GParted, I recommend you to download one of the following ISO's:



Use GParted to copy Windows Vista/7 from a primary partition to a logical partition. Then, delete the original primary partition containing Windows Vista/7. Grab your Windows Vista/7 install DVD and reboot your PC with it. Click “Repair Your Compure” option and open a Command Prompt. Type the following commands to fix the C:\Boot\BCD file.


C:
bcdedit /enum /store C:\Boot\BCD
bcdedit /store C:\Boot\BCD /set {bootmgr} device partition=C:
bcdedit /store C:\Boot\BCD /set {default} device partition=C:
bcdedit /store C:\Boot\BCD /set {default} osdevice partition=C:

Reboot. Use the following GRUB commands to start Windows Vista/7. In this example, (hd0,5) is the logical partition that has Windows Vista/7.


root (hd0,5)
chainloader +1
boot


Validating the System Restore Drive


After booting Windows Vista/7, open the System Properties dialog and make sure that the Available Disks in System Protection tab are all valid.


System Protection Tab

Related Posts


Saturday, September 12, 2009

My Partitioning Strategy

Synopsis


  • Partitioning shall be done with Partition Magic, Acronis Disk Director or GParted. GParted is the preferred tool. However, compatibility of the partition table is important between different partitioning tools.
  • The current and the past partition layout must be kept on an external media at all time. This layout is produced by the command “fdisk -l -u /dev/[sh]d?” in Linux. The resulting file can be read by a text editor.
  • The MBR shall contain the boot code installed by Debian's mbr package.
  • The first primary partition shall be about 96MB in size, formatted FAT16 and installed with SYSLINUX bootloader and FreeDOS.
  • Another primary partition shall host OpenBSD or Windows XP.
  • One extended partition will be reserved to host any number of logical partitions containing OS, swap and data.
  • The first logical partition inside the extended partition will always be Linux swap for hibernation usage. The second logical partition will be Linux swap exclusively.
  • After Linux swap, the order of logical partitions shall be Linux partitions, Windows partitions and FAT16/FAT32 partitions containing personal data.


Limitation of PC partition table


As I expect to install and explore multiple OS on a single hard drive, I realize the difficulties caused by partitioning limitations. The major limitation is that we can only have up to 4 primary partitions. However, we need a single extended partition so that we can have more than 4 partitions — an extended partition can contain an infinite number of logical partitions in itself. Thus, my final partition layout would have 3 primary partitions and one extended partition.



Recovery Partition


Most manufactured computers have Windows pre-installed. The trend today is that PC vendors (HP, Compaq, Dell, Toshiba etc.) provide a system recovery partition so that users can restore their system back to the factory state in problematic occasions. I don't recommend anyone to remove or erase the System Recovery partition for any reason — even if he actually bought an expensive retail box of Microsoft Windows CD/DVD. Thus, with an intact System Recovery partition (which is a primary partition because it must boot up with a custom Windows installer), we can only have up to 2 primary partitions and one extended partition for our own use.



My Hard Drive Partition Layout

The vendor-provided Recovery partition shall never be removed, but it can contain custom boot codes (for example, GRUB). Assuming that the Recovery partition is formatted as FAT filesystem, you can install GRUB into the Recovery partition so that you can have a nice boot menu for you to choose an OS from when you turn on your PC. If the Recovery partition is formatted as NTFS, GRUB for DOS should be installed instead because the original GRUB cannot natively read NTFS. Alternatively, GRUB can be installed into a logical partition.



There's a way to create a custom Windows XP OEM CD from the System Recovery partition, as explained on howtohaven.com. Once you've created a Windows XP OEM CD, you may remove the Recovery partition at your own peril.



Extended Partition Layout

Allocation of Primary Partitions


Now, we have 2 precious primary partitions to allocate to demanding operating systems after we decided to keep one System Recovery partition and one extended partition. Such demanding OS's include Microsoft Windows and *BSD (i.e. NetBSD, OpenBSD, FreeBSD, etc). Since people using *BSD are very hard to find, I assume you'll use both of the two primary partitions for Windows installations, for example, one for Windows 7 and the other for Windows Vista. In my case, I will reserve one primary partition for OpenBSD and another for Windows Vista Home Premium since I use OpenBSD, though not as often as Linux.



My Partition Table

Space reserved for Vista/Win7 Boot Codes


When Vista is installed on a fresh new hard drive, the first NTFS partition is created starting at the 2048th sector. However, to reserve space for Vista boot codes, I will create the first primary partition beginning at the 96390th sector.



Extended Partition


The extended partition can contain an unlimited number of logical partitions. Therefore, inside the extended partition, I am free to install as many OS's as I wish if there's enough space. I can install Windows XP or a variety of Linux distributions on logical partitions. The first logical partition (/dev/sda5) should be a Linux swap partition because it is the place that should rarely change or move.



To Do


  • Write about shared User data partition for multiple Windows OS's
  • Setting up Read-only Linux partition and Changeable Linux partitions with the help of Unionfs

Installing and Booting Windows XP on a Logical Partition

WARNING: Although this post is about Windows, the instruction involves the use of Linux software, such as GParted partitioning tool and GRUB boot loader. If you are not familiar with these Linux tools, please be careful when following the instructions below. I'll add non-Linux instructions to this post later.


You can download Live CD's containing GParted from the following locations:




Copying Windows XP to a Logical Partition using GParted



It is possible to boot Windows XP from a logical partition. First, install Windows XP to a primary partition. Boot your PC with Parted Magic or SystemRescueCD. Start GParted and copy the Windows XP partition to an empty space in the extended partition. You may have to create an extended partition first and then reserve a space inside the extended partition large enough for the new logical partition.



Fixing BOOT.INI for the Windows XP logical partition


Don't reboot yet. Mount the new logical partition containing a copy of Windows XP. To do so, start an Xterm and type something like:


mount -t ntfs-3g /dev/sda5 /mnt
vim /mnt/boot.ini

The BOOT.INI file should be modified so that it points to the new logical partition. Read this article to learn about its format.


[boot loader]
timeout=0
default=multi(0)disk(0)rdisk(0)partition(5)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(5)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /noexecute=optin

Save the BOOT.INI file and reboot.



Changing the Drive Letters with Windows Registry


Reboot with the Parted Magic or SystemResueCD again. When you're at the GRUB boot menu, press C to exit the menu and manually enter GRUB commands. You need to boot to the XP logical partition:


root (hd0,4)
chainloader +1
boot

Right after entering the boot commands, press and hold the F8 key. You'll be shown the Windows XP boot menu. Choose "Safe Mode" to boot to the Windows safe mode. Once inside the safe mode, change the drive letters with the Windows registry editor (regedt32.exe). Reboot to the XP logical partition using GRUB, this time in the normal mode. Check if Windows XP works normally. You can make sure that you're really using the logical partition by reading the C:\BOOT.INI file.

Tuesday, September 8, 2009

Setting Up Windows Vista/7 on Toshiba Mini NB205

Toshiba NB205 comes pre-installed with Windows XP. I wiped out windows XP from the netbook and installed both Windows Vista Home Basic and Windows 7 Home Premium. I will use Windows Vista as my primary workspace and Windows 7 as my experimental workspace.



Installation of Windows Vista requires the SATA driver to be installed at the partition selection step (See the picture below). Download f6flpy3289 from Intel and unpack it onto a USB floppy or a USB thumb drive. Plug it into a USB port, click Load Driver and choose Intel(R) ICH7M/MDH SATA AHCI Controller. If you don't load the SATA driver, Vista will crash after reboot. This problem doesn't happen with Windows 7.



Load Driver for Widows Vista installation

This post serves as a journal I keep in order to keep track of the installed software and configuration. It'll ease the task of reinstalling Windows Vista or Windows 7.




  1. Drivers and Utilities






  2. Windows Update


    If you don't want to wait for Windows to update itself, download the following service packs and hotfixes.




  3. Applications






Related Posts


Wednesday, September 2, 2009

Flash Player 9.0.x For Slow CPU's and Windows 9x/ME

If you use an old computer and the Web seems too slow because of demanding flash videos, get Flash Player 9.0.x. Flash Plash 9.0.x is also the recommended version for Windows 98 and Windows ME. Filehippo provides download links for Flash Player 9.0.x.


About This Blog

KBlog logo This blog seeks to provide a collection of interesting pictures found on the Web. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

Powered By Blogger