Saturday, June 23, 2012

Linux-0.01 kernel building on ubuntu hardy

linux-0.01-rm-3.5 now builds ok on hardy but only on 32 bit version
The best way to try is to install hardy , or debian lenny in kvm-linux or virtualbox and then try the instructions bellow 

Official 0.0.1 project news and downloads are located here

You might need some packages first
$sudo apt-get install bin86 kvm qemu gcc build-essential


$wget http://ftp.be.debian.org/pub/linux/kernel/people/abdel/linux_0.01/sources/linux-0.01-rm-3.5.tar.gz

$tar -zxvf linux-0.01-rm-3.5.tar.gz
$cd linux-0.01-rm-3.5
$make

or time make

make[1]: Leaving directory `/home/mariuz/linux-0.01-rm-3.5/lib'
ld -s -x -M -Ttext 0 -e startup_32 boot/head.o init/main.o \
kernel/kernel.o mm/mm.o fs/fs.o \
lib/lib.a \
-o tools/system > System.map
(echo -n "SYSSIZE = (";stat -c%s tools/system \
| tr '\012' ' '; echo "+ 15 ) / 16") > tmp.s
cat boot/boot.s >> tmp.s
as86 -0 -o boot/boot.o tmp.s
00286 /*
00287 * This procedure turns off the floppy drive motor, so
00288 * that we enter the kernel in a known state, and
00289 * don't have to worry about it later.
00290 */
00286 /*
00287 * This procedure turns off the floppy drive motor, so
00288 * that we enter the kernel in a known state, and
00289 * don't have to worry about it later.
00290 */
rm -f tmp.s
ld86 -0 -s -o boot/boot boot/boot.o
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -fno-stack-protector \
-o tools/build tools/build.c
#chmem +65000 tools/build
objcopy -O binary -R .note -R .comment tools/system tools/system.bin
tools/build boot/boot tools/system.bin > Image
Boot sector 452 bytes.
System 89732 bytes.

real 0m4.512s
user 0m3.696s
sys 0m0.768s

then rename Image to linux0.01-3.5.img
qemu -hdb hd_oldlinux.img -fda linux0.01-3.5.img -boot a

you must use the hd image from here if you don't have it yet
wget http://draconux.free.fr/download/os-dev/linux0.01/Image/hd_oldlinux.img.zip
unzip hd_oldlinux.img.zip


Monday, June 18, 2012

PHP GD Bundled - Compilation Instructions for Ubuntu 12.04

I needed to recompile the gd in ubuntu 12.04 to work with gd bundled version Warning i don't use mysql but only firebird so your requirements may vary
  1. Open up a terminal.
  2. Become root by typing su and enter your root password when prompted.
  3. Download some packages we'll need for the install. Type apt-get install build-essential debhelper fakeroot dpkg-dev firebird2.5-dev 
  4. Change your current directory to your source one. cd /usr/src.
  5. Download the PHP 5 source code by typing apt-get source php5.
  6. We also need the PHP 5 dependencies. To download these, enter apt-get build-dep php5.
  7. Go into the downloaded PHP directory. cd php5-XXXX. just press after you've typed php5- to complete the folder name.
  8. Now we need to edit a config file to change it into the bundled version of GD. Type  editor debian/rules. (I have removed any reference to mysql in the cofigure lines )
  9. Locate the line that says --with-gd=shared,/usr --enable-gd-native-ttf \ and change it to --with-gd=shared --enable-gd-native-ttf \ by removing ,/usr. (Press ctrl+w to find something, if you search for gd, it is near the second occurrence). To save the file, we need to press ctrl+x then press y and then enter.
  10. Now we've done setting up we now need to compile it. Type dpkg-buildpackage -rfakeroot -d
  11. When it's done, you should have a load of .deb files in the parent directory. Find the one starting with php5-gd.
  12. Install it by double clicking on it, or from the terminal, type dpkg -i php5-gdXXXXXXX just press after you've typed php5-gd to complete the file name.

Sunday, June 10, 2012

Building Doom3 GPL code on #Ubuntu #Lubuntu 64 bits


As you might now doom3 source code is now open sourced
and it can be studied and forked and improved on github
https://github.com/TTimo/doom3.gpl
Here are the instructions to build it on Lubuntu / Debian sid 64

You might need the doom3 data from your legal sources :)
http://www.cyberciti.biz/faq/linux-install-doom3-game/


sudo apt-get install scons

apt-get install ia32-libs libc6-dev-i386 lib32gcc1 gcc-multilib  lib32stdc++6 g++-multilib lib32z1-dev

apt-get install libopenal-dev
apt-get install
apt-get install libglu-dev


apt-get install libX11-dev:i386 libXext-dev:i386 libxxf86vm-dev:i386

ln -s /usr/lib32/libz.a /usr/lib/libz.a

git clone https://github.com/TTimo/doom3.gpl.git

cd doom3.gpl
cd neo

scons NOCURL=1


build/debug/core/sys/scons/doom
DOOM 1.3.1.1304-debug linux-x86 Nov 26 2011 20:21:11
found interface lo - loopback
found interface wlan0 - 192.168.1.103/255.255.255.0
found interface virbr0 - 192.168.122.1/255.255.255.0
no 'base' directory in exe path /home/mariuz/work/doom3.gpl/neo/build/debug/core/sys/scons, skipping
no 'base' directory in cwd path /home/mariuz/work/doom3.gpl/neo, skipping
WARNING: using hardcoded default base path
------ Initializing File System ------
Current search path:
/home/mariuz/.doom3/base
/usr/local/games/doom3/base
game DLL: 0x0 in pak: 0x0
Addon pk4s:
file system initialized.
--------------------------------------
Unknown command 'vid_restart'
idRenderSystem::Shutdown()
Sys_Error: Couldn't load default.cfg

To build the doom3 with curl support there is already a pull request with the curl m32 fix
Update : The m32 curl fix is already applied



Building Linux Kernel 3.X.X-RC-X with an php script on Debian / Ubuntu

Install the prerequisite packages
$ sudo apt-get install kernel-package php5-cli git-core fakeroot ncurses-dev
$ sudo su
# git clone git://github.com/mariuz/kernelcompile.git
# cd kernelcompile
# php rc-kernel-compile.php
if all is ok you will be asked for kernel build option (menuconfig) (they are copied from your system config) after you have chosen the menu you can press exit and the build will continue and it will start compiling using all your available cpus

Here is what i usually change on the menu

Enable Preemptition Model for Low Latency (near realtime)

Processor Type and Features> Preemptiton Model (Preemtible Kernel(Low-Latency Desktop))

Please disable Xen

Processor Type and Features -> Paravirtualized Guest Support -> Xen

Proccessor Type and Features -> Timer frequency (1000HZ)
this is a for a desktop system

The latest deb package for kernel will be in /usr/src
you need to install it with

# dpkg -i linux-image*

Wednesday, June 06, 2012

upgrading from ubuntu 12.04 to debian testing or sid

A good idea is to install a light desktop manager like lxdm or xfce so at least you have a DM in case
gnome will not work out

Install debian keyring http://packages.debian.org/wheezy/all/debian-archive-keyring/download


modify /etc/apt/sources.list
delete all the lines and
add these ones 
deb http://ftp.us.debian.org/debian sid main contrib
deb-src http://ftp.us.debian.org/debian sid main contrib

apt-get update
apt-get -f -o Dpkg::Options::="--force-overwrite" dist-upgrade


there will be a lot of issues and it might bring your  machine unbootable
So be prepared with a testing debian stick or cd

Here are some of the issues that could happen while upgrading the machine there are many dpkg-new files in the /etc/init.d/ folder so here are some tips bellow

Init scripts and networking system
Get rid of upstart first. I had problems with sysv-rc and needed to force reconfiguration. Some init scripts were installed with "dpkg-new" in the name, I had to rename them. As with X, I tried few solutions, this is distilled but stil redundant version:
dpkg-reconfigure sysv-rc
cd /etc/init.d
mv acpid.dpkg-new acpid
mv anacron.dpkg-new anacron
mv atd.dpkg-new atd
mv cron.dpkg-new cron
mv dbus.dpkg-new dbus
mv module-init-tools.dpkg-new module-init-tools
mv procps.dpkg-new procps
mv rsyslog.dpkg-new rsyslog
mv udev-mtab udev
dpkg --purge --force-all base-files ifupdown initscripts netbase sysv-rc sysvinit sysvinit-utils
apt-get --reinstall install base-files ifupdown initscripts netbase sysv-rc sysvinit sysvinit-utils



http://virtually-a-machine.blogspot.ro/2010/09/live-migrating-ubuntu-to-debian-howto.html


Monday, June 04, 2012

The simplest VivaGraphJS graph test


Creating a graph in  VivaGraphJS with webgl

Create a graph with user id edges and for data
By definition, a Graph is a collection of nodes (vertices) and links (also called edges - identified pairs of nodes). In VivaGraph.JS nodes can be any object e.g. a string, a number, a function, another graph or object, and so on.

The graph g can be grown in two ways. You can add one node at a time:
g.addNode('1','User name 1');
g.addNode('2','User name 2');

Now graph g contains two nodes:1and 2. You can also use addLink()method to grow a graph. Calling this method with nodes which are not present in the graph creates them,If nodes already present in the graph 'addLink()' makes them connected
g.addLink('1', '2');

and at the end we add render loop

var renderer = Viva.Graph.View.renderer(g);
renderer.run();

here is the final output when loaded on the onload function for the html page , this is for the two users from above


we can add other nodes for example 3
g.addNode('3','User name 3');
and then create the links between them

g.addLink('2', '3');
g.addLink('3', '1');





Saturday, June 02, 2012

Here is is howto upgrade to the new FDB 0.8.0 driver

 The new driver is released FDB release 0.8.0 is out: http://pypi.python.org/pypi/fdb/0.8.0
 Highlights for this release:
 Support for Firebird Event Notifications (see KInterbasDB documentation for details)
 And as always, some bugs fixed.
 Target for next version: stream BLOB support (necessary for big BLOBs)
 Here is howto update it in ubuntu/debian , i love pip

sudo pip install --upgrade fdb 
Downloading/unpacking fdb
  Downloading fdb-0.8.0.tar.gz (164Kb): 164Kb downloaded
  Running setup.py egg_info for package fdb
    
Installing collected packages: fdb
  Found existing installation: fdb 0.7.2
    Uninstalling fdb:
      Successfully uninstalled fdb
  Running setup.py install for fdb
    
Successfully installed fdb
Cleaning up...