Sunday, 15 July 2012

steps to make zimage, uimage

Here we attempt to create zimage and uimage associated with linux kernel required
to port linux on arm9

First download the kernel in our case,linux-2.6.24-rc8, from kernel.org.
Then extract the file.
Then type the following in terminal:
First make a directory

$ mkdir cs-e9302
$ cd cs-e9302
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/v2.6.24/linux-2.6.24-rc8.tar.bz2
$ wget http://dev.ivanov.eu/projects/cs-e9302/linux-2.6.24-rc8_ep93xx_mmc.patch.gz
$ tar -xjf linux-2.6.24-rc8.tar.bz2
$ cd linux-2.6.24-rc8
$ zcat ../linux-2.6.24-rc8_ep93xx_mmc.patch.gz | patch -p1
$ cp cs-e9302_kernel_config .config


$ cd linux-2.6.24-rc8
$ nano Makefile

in the makefile change:
ARCH? =arm
CROSS_COMPILE=arm-linux-gnueabi-


Then save the changes in the Makefile.
After that

$ cd linux-2.6.24-rc8
$ make oldconfig
$ make menuconfig

In the menuconfig file
Make sure your system type is "EP93xx-based" and "Support Cirrus Logic EDB9302" platform:
And for more functions check "Root file system on NFS" and SMB file system support".

after making these changes just write the make command:
$ make
we will get the kernel in the arch/arm/boot directory.




Now for creating the uImage:
We will need to install mkimage in the PC.
$ sudo apt-get install uboot-mkimage

After this to get the uImage:
$ mkimage -A arm -O linux -T kernel -C none -a 30008000 -e 30008000 -n \linux-2.6.24-rc8

This would create the uImage in the same directory as the zImage.(in  linux-2.6.24-rc8/arch/arm/boot)




Making a Facebook App

For making a facebook application you need access to server where your code operates,you can however carry on with app development by using your system as the server,localhost.

Facebook accepts only https or secure http so make sure your server can support the same.

To begin with,login to your facebook account and in a different tab open this ,this being a portal for facebook developers.You can later start working by using their tutorial

For now click the create new app tab at the top right corner.An ajax alert like window opens,
Provide an app name,and you have to then provide a unique name in name space which is then used to identify your app.Also in case you do not have hosting facilities,you can sign up for the free hosting at heroku.

Pass the subsequent security check to prove your not a bot.

Then if you encounter "You've been blocked from creating apps because we haven't been able to verify your account" , this means you have to verify yourself by going here the verification requires a government issued id with name, date of birth and photo .Once verified you will be good to start your apps.

Upon success you will be given app id and secret key.

Now in a text editor compose your app code,Then go to app on facebook tab,in the canvas url provide your code file name which you have created in the default localhost folder,The secure canvas requires you to just replace http with https.
Save the changes.

Then visit https://apps.facebook.com/your-app-namespace. viola its your app!!

To develop the app in localhost check out this

Arduino tutorial

we intend to dump small codes onto arduino in linux,

We will use roboduino which is similar to arduino

Start by Downloading the IDE for Arduino boards, namely Arduino 1.0.1 from
http://arduino.cc/en/Main/Software

Open the IDE

Connect the Arduino Board using the USB cable provided with the
board


Go to Tools Serial Port to make sure that the Board has been recog-
nised. Select the appropriate port from the list. Also select the right
board from Tools Board. Roboduino uses Arduino Duemilanove. The
board given to us was Arduino Duemilanove with ATMega328 proces-
sor (If you are using any other board with different processor then all you have to do is choose the appropriate one from the list).

Go to File Examples 1.Basics Blink . This will open the blink pro-
gram from the list of sample programs provided with the IDE

Compile the program either by going to Sketch Verify/Compile or by
pressing Ctrl+R . Correct any errors that may appear. Since this is a
preloaded example program, it should compile without errors.

Go to File Upload to upload the program to the board or press
Ctrl+U.


Arduino led blink code

int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);
// turn the LED on (HIGH is the voltage level)
delay(1000);
// wait for a second
digitalWrite(led, LOW);
// turn the LED off by making the voltage LOW
delay(1000);
// wait for a second
}

Code transfered to arduino board.

Monday, 2 July 2012

system crash recovery

I had mistakenly used the killer command dd on dev/sda.Which caused my grub to obliterate and the partition table as well completely disappeared ,hence i was unable to boot my system ,i had windows as well as ubuntu running on separate partition;fearing the worst i searched for ways to recover data on web.
I hence state here the complete method to recover data from your system in case you face the same problem.
To begin with you have to use a live CD or live USB ,the live indicates that the OS can be booted from them.This also ensures that you do not overwrite any data on your hard disk as you are using a bootable usb or cd.
Plugin the Live USB or insert the Live CD and restart your system ,you may have to press f12 or any equivalent key to provide booting priority.
We shall be using the Ubuntu OS .Once the OS boots up ,open a terminal and type:

$ sudo su 
 This makes you a super user.
then type:

$ sudo apt-get install testdisk

The testdisk checks for partitions on the harddisk and the detected partition can then be saved and once rebooted with the Live CD/USB the partitions are then visible and can be mounted which then can allow the user to access the data from the harddisk,itself.

upon downloading the testdisk ,start it by the command
$ testdisk

This starts the programme ,you can choose to create a new log file.
As the next step choose from the list your hard disk,observe the size of the media presented and determine your harddisk from its size.
After choosing your harddisk proceed ,you then have to select the partition table type,the software will choose the most probable partition table type,however you can be extra careful and determine the same from other sources.

Then select analyze which will start scanning your harddisk for any information on partition, After some time when it is done with scanning it provides a list of partition,you can recollect the partition of your system ,if it matches select write,which causes the partition to be saved.If however the provided partition does not match then select deeper search ,which forces the software to search for the partition information .

Once it is done reboot your system and then observe that your drives have been mounted and you can access the data!!

If the deleted data needs to be recovered then use photorec
download it by 
$ sudo apt-get install photorec
and use it by

$ photorec

You then have to provide the appropriate file type you are searching for and viola it finds all the deleted files of the indicated type for you in the chosen destination folder.

  Also there may be possibility of recovering the grub or bootloader it self,but for the provided steps please use extreme caution before using them.

If you have windows and linux partitions on the same machine,and if the bootloader or grub has been missing then you may recover by using the following steps .
use $ fdisk -l
To check the partition on your system,identify the dev/sdx which corresponds to the linux partition x may be 1,2,3, and so on.
Once you have identified ,you have to mount it onto the live cd/usb by using
$ sudo mount /dev/sdx /mnt

lets mount the boot as well

$ sudo mount /dev/sdx /mnt/boot

and then we can use bind to make a mirror image of the linux partition on the live cd/usb by using 
$ sudo mount --bind /dev /mnt/dev


now you can access all your data on the linux partition as the /mnt will replicate the root of your linux.


we will now switch root to /mnt
$ sudo chroot /mnt


we will install grub here by
$ sudo grub-install /dev/sda


Reboot the system and viola !! the purple screen greets us with our favorite OS's.

Wednesday, 16 May 2012

Latex tutorial,sample code included

Latex is a really pretty tool used for creating all sort of document viewing format mainly pdf's .Yes there exists tools for converting MS word to pdf but its not as flexible as Latex ,By latex you have total control on just everything.

Latex can be used in linux OS ,for that you may have to install kile .
Kile provides gui tools so that you can just click and the corresponding codes are incorporated into the latex.

Generally another counterpart of kile is dia diagram editor ,using which you can just do any diagrams with built in symbols to assist you ,so again it has gui help for the user.

I will not dwell into deeper waters as the web is filled with ubiquitous help for latex and dia.
Latex can also be used for making ppt slides .

A sample latex format for presentation slides are provided here

A ieee latex format is provided here

If you encounter any errors when using this format,that may be because you may not have IEEEtran.cls in your working directory , download from here