Search This Blog

Saturday, August 8, 2009

An Introduction to GCC

Recently I am reading An Introduction to GCC. This is excellent book for learning GCC (at least for beginners). Author do not make any assumption about the person reading this book. If you are using Linux operating system then what you need to know before reading this book is probably only "gedit" or "vi/ vim" editor and you should have GCC installed on your Linux operating system.

This book teaches you different GCC options using some simple simple code samples. Just go through the table of contents of this book (left click on name of book on first line of this post).

If you are student then I will strongly recommend you to read this book and practice it on Linux. I have no doubt that learning C/ C++ using GCC will help you become a better programmer. Personally I really like Microsoft Visual Studio(I have used 6.0, 7.0, 8.0 and 9.0) but I think it is good to use GCC in the beginning.
I am bit doubtful at this stage whether I will keep liking Visual Studio in future or not, because of the powerful command prompt options available for GCC. Also if you hate/ fear command prompt then you can use GCC using some good IDE like eclipse.

I think the information given in this book is more than sufficient for beginner.

If you want to learn gcc on windows operating system, then you will need cygwin.Personally I find cygwin little difficult to use then bash shell in Linux. But for those who do not want to install Linux operating system - cygwin might be a possible option.

Jay Linux.

Friday, August 7, 2009

64 bit operating sytem my experience

I am not computer science person so I do not know the exact reasons why people think that 64 bit operating systems perform better than 32 bit.
What I understand that might be 64 bit operating systems is futuristic choice. At least on today's date one has to struggle a lot while using 64 bit operating system.


Some problems I have faced -

1. In greediness to have support for 4GB RAM (it was my misconception - actually support 32bit version can make use of 4GB RAM), I purchased 64 bit - Vista home premium (waste of money) with Dell Studio 15. It was showing video RAM as 256 MB when actually it was 512 MB. After about 30-40 mins discussion with Dell service person, he concluded that this is problem with 64 bit Vista.

2. For Ubuntu 9.04 32 bit Operating system, I got sound and video card drivers very quickly and it worked fine. When I tried Ubuntu 9.04 64bit edition I could not get video card drivers (I am not geek to write own video card drivers, or might be I should have tried more).

3. I am currently facing same sound and video card drivers problem with Fedora 11 64 bit operating system as well. On internet I could see support for 32 bit Fedora 11 for ATI Radeon graphics card but not for 64 bit (source code was not available as far as I remember). I am quite sure that sound problem must be easy to solve.

In addition to this all above problems - I have not seen any noticeable performance improvement in 64 bit operating systems.

I do not have any doubt that future belongs to 64 bit operating systems. But at least on today's date 32 bit Operating System is better option in my opinion.
Like many people even I had misconception that RAM higher than 4GB is not supported by 32 bit operating system. Follwoing article (again thanks to Yogeshwar) might be of help -
http://en.wikipedia.org/wiki/Physical_Address_Extension

I must mention few things before finishing this post
1. I am only talking (writing :)) here about operating systems. Please do not misinterpret with 64 bit architecture. If you want to buy new PC - better go for 64 bit hardware (but as per my experience 32 bit operating system)
2. Probably support for NVIDIA graphic cards is available for most of 64 bit Linux distros.

It is useless to have 64 bit architecture and multi-core processors unless the developers writing applications for these hardware make use of their capabilities.

For some people running 32 bit operating system on 64 bit architecture might look like running bullock cart on national highway, my problem is though the option of car is available I do not have guarantee that I will get fuel stations and shop to repair puncher on highway. So I will better drive car when these services are guaranteed.

Installing Fedora 11 on top of Ubuntu 9.04 be careful

Installed Fedora 11 (64 bit) on top of Vista (64 bit - pain in a**) and Ubuntu 9.04 (32 bit). Grub of Fedora removed the entry of Ubuntu and Vista from grub. (No surprise name of Fedora's grub is Anaconda!!).

I thought it will be easy to fix (With Yogeshwar's help), I tried to copy the entries from
sda\boot\grub\menu.lst to
sda\boot\grub\menu.lst

on reboot I could boot Vista (I dont use it for months so not of much use)

For Ubuntu it was showing me entries in grub but selecting any of 4 Ubuntu options (including repair ones) were giving me "Error15 file not found".

Some googling told me that I could try with entry root(hd, )

I tried with different combinations of x and y (actually not x because I have single hard disk for my Dell studio 15). For wrong y values I got error 17 :D and for probably right y - I got blank screen and cursor :].

It would have been great if I would have waited for some time and tried to find solution for this problem - I did some thing stupid in application called "Palimpsest Disk Utility" on Fedora and when I saw that Ubuntu partition is not bootablle I tried to make it bootable by checking the bootable check button (aah stupid thing)

Now my Ubuntu partition is not even detected by Fedora and I do not see any option but to reformat my machine.

So moral of the story ... if you are installing Fedora after Ubuntu better take care... (I will try to write what care if I could successfully install both)