Tuesday, April 20, 2010
Upgrading ubuntu from alternate CD
I am currently using 9.04 and I want to upgrade to 9.10. Upgrading to Ubuntu Karmic Koala
I have downloaded alternate CD ubuntu-9.10-alternate-i386.iso. Now I have the image in the hard drive of my PC.
Mount the ISO as a drive.
sudo mount -o loop ~/Desktop/ubuntu-9.10-alternate-i386.iso /media/cdrom0
Ubuntu tells that it will start the upgrade automatically. For me it didn't happen. So I need to start from command.
gksu "sh /cdrom/cdromupgrade"
Better to have an internet connection opened.
Starts upgrading ubuntu to version 9.10
Saturday, April 17, 2010
PIC programming using Ubuntu
MPLAB is the IDE from Microchip who is the manufacturer of PIC microcontrollers. Problem with MPLab is that it is for windows.
For those who what to work on PIC from linux can think of using PIKLab. PIKLab expect the KDE environment. So if you are using GNOME environment you need to download kde libraries before installing PIKLab. I am using UBUNTU and UBUNTU is having GNOME as the default desktop environment.
KDE is written on Qt and GNONE on GTK+. So PIKLab is having a dependancy on Qt libraries as well.
Prerequisits
Installing Qt libraries in Ubuntu
sudo apt-get install libqt3-mt
Installing KDE libraries in Ubuntu
sudo apt-get install kdelibs
sudo apt-get install kdelibs4c2a
sudo apt-get install kdelibs-data
Install PIKLAB
Once Qt and KDE libraries were install you can install PIKLab. rpm package for PIKLab can be downloaded from the following link.
PIKLab rpm
In ubuntu you need a deb package to install. So you need to convert rmp to deb using alien.
Install alien if it is not present
sudo apt-get install alien
Generate deb from rpm
sudo alien piklab-0.3.2-1mdk.i586.rpm
Install piklab
sudo dpkg -i piklab_0.3.2-2_i386.deb
Resolving undefined symbols
After installing if you try to run piklab it may give some error because of some undefined symbols. In order to resolve this you need to create links to the expected libraries in the name piklab expects.
sudo apt-get install gputils libpcre3
sudo ln libpcreposix.so.3.12.1 libpcreposix.so.0
sudo ln libpcre.so.3.12.1 libpcre.so.0
sudo ln -s libpng12.so.0.27.0 libpng.so.3
sudo ln libexpat.so.1.5.2 libexpat.so.0
Now you can run piklab.
Thursday, October 9, 2008
ASCIIHEX to data
{
int Len = len/2;
unsigned char *src = (unsigned char *)inData;
unsigned char *dst = outData;
unsigned char hi, lo;
int i;
for (i = 0; i < Len; ++i)
{ hi = *src++;
hi -= (hi < 'A' ? '0' : 'A'-10);
lo = *src++; printf("%d\t",lo);
lo -= (lo < 'A' ? '0' : 'A'-10);
*dst++ = (hi << 4) (lo & 0x0F);
}
}
Thursday, November 22, 2007
Problems with iconv
undefined reference to `_libiconv_open'
undefined reference to `_libiconv'
undefined reference to `_libiconv_close
This is due to a file which includes iconv.h
How do I solve?
just add -liconv at the end of linking statement
Wednesday, August 15, 2007
Saturday, June 2, 2007
Memory segments
Code segment:- Binary code of program that is being executed.
Data segment:- Initialised global variables and datastructure
BSS(Block Started as Symbol):- unitialised global variable datastructure.
Stack segment:- Local variable return address
Memory is allocated in heap.
Saturday, April 21, 2007
Compiling
Prepocessor--> Removes comments, Interprets the preprocessor directives.
Compiler --> Source code to assemby code
Assembler --> Creates object code
Link Editor --> combines the function defined in other source files and creates executable from object code.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Lint
It is a unix utiliy to verify C program. It helps in type checking of variable, function assignments, efficiency, unreachable codes, memeory leaks etc.
lint program.c
Tuesday, March 27, 2007
UNIX V/s Linux
Sun's Solaris, HP's HP-UX and IBM's AIX are the most popular UNIX flavors available today. They are licensed versions of UNIX and are having a significant amount of cost. Technical support is also available. On the other hand Linux is a free software alternative to the commercial flavors of UNIX and are available without any cost. But do not have a standard technical support mechanism.
Commercial versions are standard considering the requirement, development, testing and support. So each release is consistent. But Linux is very inconsistent compared to UNIX.
UNIX flavors are targeted to particular hardware architecture. But Linux is supposed to be compatible as possible.
Source code of Linux kernel is available. UNIX flavors are available as binary only. They are not modular as Linux.
File system support is limited in UNIX. But Linux supports almost all file systems.
Core applications present in UNIX and Linux are similar. Most of the open source applications are available in Linux. And these are ported to UNIX as well. But enterprise-level applications and closed-source applications will not be present in Linux but can be in UNIX.
Friday, March 23, 2007
Symbian Class naming convensions
In symbian Prefixes lile T, C, M, R has been used
T Class
Built in types.
Must not have a destructor.
eg: TInt, TBool
C Classes
Derived from CBase
Objects of a C class must always be allocated on the heap.
M Classes
Abstract interface class.
It is used to define callback interfaces or observer classes.
It has no member data and no constructor.
Static Classes
Do not have a name prefix.
Member functions can be called using scope resolution operator.