Pointers in C

November 15, 2011 3 comments

Greeting to all!!!

Hope you all are having a great time. But for “C” lovers, the time is going to become more better. C language is the most simplest of programming languages with just 32 keywords defined. But still, the tricks a C program can contain has unlimited possibilities. Here we unravel one such part.

Most of the typical question asked in any technical exams with “C and Data Structures” as its course comprise of Pointers and Trees. With Pointers as the building blocks of such data structures, problem often get complex when actually they are not.
So here, lets brush up the concept of Pointers, and see whether those problems are really that hard or not.

Note: While writing this article, I have considered that you all already know about primitive variable declarations in C.

Pointers are just a variable, with a special property that it saves the reference of other objects in the program.

Syntax for declaration of a pointer variable:
<datatype> * <pointer_name>;

Ex.   int *p;
float *q;

Pictorially, these statements are nothing more than this:

image          image

And since references are nothing but memory addresses, so all pointers irrespective of the datatype specified with them, they stores similar kind of data( a memory addresses which are in form of unsigned integer type). And sizeof() for all pointer variables return equal value, again irrespective of the datatype specified. That is, even though the variable of character and integer require different size of memory block to store data, pointer variable of both datatype require equal amount.

So what is the need of specifying data type in pointer declaration??

The datatype provided with pointer declaration serves two purposes:

  1. To specify the base of pointer variable used during the arithmetic operation performed on them, usually increment/decrement operations.
  2. Secondly, it is used during the resolution of the data pointed by the pointer. How many block of memory to read, to correctly fetch the data.
    Before we go further in details of pointers, you need to get familiar with two operators and two terms as well.

The operators are * and &.

      1. * Operator – It has two uses. Firstly, it is used in declarations to specify that the variable being declared is a pointer variable. Secondly, when used with a variable in an expression it is used to fetch the data stored at the memory location specified by the variable.
      2. & operator- It is also called address operator, as it is used to fetch the memory address associated with the variable specified.
        E.g.  int x=6;  //declares a block on integer in memoryassignment of pointer variables occurs as
        int *p;
        p=&x;   // returns the address of the block named ‘x

        now to print the value of x,either of the two can be used
        printf(“%d”,x);  or  printf(“%d”,*p);

This operation can be pictorially shown as:

image

The two term that need to be get familiar with are

  1. Lvalue  –  Those values which are only permitted on the left side of the assignment operator( =). Such values have the property to be resolved to some memory block or placeholders for storing data. Permitted values are variables.
    In reference to the following declarations,
    int x;
    int *p;

correct statements:
x=6;
*p=29;

These statements as these are incorrect:
2=x;    //  incorrect. “compiler error : lvalue required”. constants are not lvalues.
&x=29; // same as above. as “&x” is resolved to memory address of x, a constant value.

  • Rvalue –  These values are permitted to exist on the right hand side of assignment operator( =). Valid Rvalue are constants and memory references.

    Thus it can be said that with any variable there are two kinds of values associated, an lvalue and a rvalue.

    Considering a memory tape, and variable as a memory blocks

 

image

When the variable is present on the right hand side of the assignment operator( =) it is resolved to its lvalue to accept( or store) the value returned. And when the variable appears on the right hand side of the assignment operator( =) it is resolved for its rvalue.

Pointer variables are used to store lvalues.

Lets get hands on some codes.lets take a look at how pointers are actually used.
(The codes written here are written, with the parts of program not relevant with the concept described here, but must be included while execution.)

Pointer Representation in memory


Consider this piece of code:

int a=6;
int *b;
b=&a;
*b=10;

So,what are the values of a, b, &a, &b, *b, *a?

To answer this problem, lets take a visual look of the process going on here
Step 1: “int a=6;” declares a variable named “a” at memory location 500(assumed).

image

Step 2: “int *b;” declares a pointer variable of integer type named “b” at memory location 600(assumed).

image

Step 3: “b=&a;” resolves the memory address of block “a” and stores it in “b”.

image

Step 4: “*b=10;” now since “b” is a pointer variable pointing to “a” the value is stored at memory block pointed by “b”” that is “a” is modified to store new value.

The situation was like this”:

image

and now it becomes:

image

Again, a look at the question:

what are the values of a, b, &a, &b, *b, *a?

Answer:

a=6            //value assigned to a
b=500       //memory address of a(it was assigned)
&a=500     //memory address of a(resolved. its not an assignment statement)
&b=600     // memory address of b(resolved)
*a             // invalid statement. a is not a pointer variable.
*b=10       //value stored at memory block pointed by b.

You can also modify value stored in “a” using pointer “b” with a statement like
*b = (*b) + 10;
*b= (*b) * 2;       // this statement uses *- unary operator foe dereferencing as
//well as *- binary operator for multiplication.

 

(*) is a unary operator and requires an lvalue to operate. Similarly (&) is an unary operator that requires a non-constant value to operate upon. An object that has an lvalue associated with it.

The statements like *2 and  &5 are invalid. Dereferencing(*) operator used with a variable of primitive datatype is also an invalid operation.

 

Operations on pointers


While declaring the pointer we have to mention a datatype, but what all pointer variable does is store a memory address. What’s with the datatype then?

The answer to the above question can only be understood when you consider operations on pointer variables.

When we assign a block’s memory address to a pointer variable, only the address of the first memory block gets stored in pointer variable. So for character variable the memory block allocated is o block. 2 memory block together forms an integer variable. 4 memory block form a float variable. So when we dereference a pointer variable using (*) operator, these datatypes helps compiler to understand how many blocks of memory to read, to correctly read the data stored.

Increment and Decrement operators also behave differently for pointers. The actual increment in the value of pointer variable is determined by the datatypes provided. Increment and decrement is done in terms of next or previous memory blocks of similar datatype to point to.

for example, considering sizeof(int)=2.
if int *b;

and b has a value stored(say 500) then
statements:
(b+1)    // returns 502.
(b-2)     // returns 496.
(b++)    // changes the value of b to 502.
(b—)     // changes the value of b to 498.

This is all that was needed to understand the pointers.

Some more details


Lets take a look at a few more concepts using the similar concepts but worth mentioning.

There are several types of Pointers:

  • Pointers to a variable of primitive Data type.
    e.g. int *p;
  • Pointer to an array(single dimensional/ multidimensional).
    e.g. int *p=&a                              // “a” is an array variable
    int (*p) [num_row]                //  “p” is pointer to pointer array
  • Pointer to a structure
    e.g. struct node *ptr=&node1;   // “node1” is a variable of struct node type
  • Pointers to a function.
    e.g. int (*fp)(int,int)=add;     // “fp” stores the return address of the function
  • Void pointers.
    e.g. void *vp=(int *)&i;
  • Pointer to a pointer.
    e.g.  int **p;                         // “p” is a pointer to a pointer of integer type.

Void pointers are special pointers with no datatype specified. It can store address of any datatypes but arithmetic operations like increment/decrement operations are not allowed on void pointers. Neither (*) operators are permitted to operate on Void pointers

Void pointers are used to pass references to functions. or store some references temporarily for other operations.

Pointers to pointers are special pointers which points to other pointers

      . Such pointers often

comes in handy when dealing with array of pointers

    . So conceptually its even possible to declare a pointer to pointer to pointer to an int. and 4 levels. and even more.

C compiler puts a limitation on the number of dereferencing operation performed in a single statements to 12 operations.

This limitation is only because of performance issues and for no other issues.

Some Example codes and Explanations :


Code 1:

#include<stdio.h>
void main()
{
char *p=”hai friends”,*p1;
p1=p;
while(*p!=”) ++*p++;
printf(“%s %s”,p,p1);
}

Answer:
                 ibj!gsjfoet

Explanation:

++*p++ will be parse in the given order

  • 1. *p that is value at the location currently pointed by p will be taken
  • ++*p the retrieved value will be incremented
  • when ; is encountered the location will be incremented that is p++ will be executed

Code 2:

#include<stdio.h>
void main()
{
static char names[5][20]= {“pascal”,”ada”,”cobol”,”fortran”,”perl”};
int i;
char *t;
t=names[3];
names[3]=names[4];
names[4]=t;
for (i=0;i<=4;i++)
printf(“%s”,names[i]);
}

Answer:
Compiler error: Lvalue required in function main

Explanation:

Array names are pointer constants. So it cannot be modified. The reason being when you declare an array a block of memory is allocated that very instant, which need not be changed through out the program.

 

Code 3:

#include<stdio.h>
void main()
{
void *v;
int integer=2;
int *i=&integer;
v=i;
printf(“%d  %d”, *i ,*v);
}

Answer:
Compiler Error. We cannot apply indirection on type void*.

Explanation:

Void pointer is a generic pointer type. No pointer arithmetic operation can be performed on it. Void pointers are normally used for,

  • Passing generic pointers to functions and returning such pointers.
  • As a intermediate pointer type.
  • Used when the exact pointer type will be known at a later point of
    time.

Code 4:

#include<stdio.h>
void main()
{
int i=5;
printf(“%d”,++i++);
}

Answer:
Compiler error: Lvalue required in function main

Explanation:

++i yields an rvalue. For postfix ++ to operate an lvalue is required.

 

Code 5:

1. const char *a;
2. char* const a;
3. char const *a;

-Differentiate the above three declarations.

Answer:

  • ‘const’ applies to char * rather than ‘a’ ( pointer to a constant char )
    *a=’F’ : illegal
    a=”Hi” : legal
  • ‘const’ applies to ‘a’ rather than to the value of a (constant pointer to char )
    *a=’F’ : legal
    a=”Hi” : illegal
  • Same as 1.

Now, that was interesting, wasn’t that. I am sure for those who already knew Pointers must have discovered some new facts and those who were afraid of Pointers, now know, Pointers aren’t really that hard.
Solve more problems because with each new problem you solve, you improve the understanding of the concepts you have.( That’s a key to everything out there, to learn ).

So get yourself geared up, because I am definitely sure that now you will be able to solve half of the questions from any C aptitude paper. More than half the questions are from  pointers.
Do Try some more problems!!

Crap!! End-Semesters knocking…

Have a nice time, you all.
signing off for now!!

Kr. Abhishek

Advertisements
Categories: Programming

Starting with Linux: Where to get help!!!

November 8, 2011 2 comments

Hello friends!!!
Warm Greeting to you all.

It was my Campus Placements(got one at Samsung India). Exams(not quite good). My own Lectures sessions on C and DS(Simply Awesome!).

It was defiantly a long pause.But now it really feels great to be back, writing again….

The talk is about Linux and how it has become an important tool for every IT Professional and even Consumers to IT Products. But still many of us are unaware of this great resource at a compass so close.

Many of us don’t even realize as we move more and more into the new era of computing and digitization, Linux is becoming attached to everyone’s lives, from small embedded systems like music players to a Web servers all are running Linux Based Operating Systems.

But the most important is our Personal Computing needs, Linux being an open source project has been evolving ever since Linus Torvalds made it open and free. Many Corporation took up the project and a little customization and we have a huge number of distributions. Some of the widely used distributions being RHEL,Fedora Project, Ubuntu, OpenSUSE, Debian, FreeBSD, but the list doesn’t ends there.

The best thing about Linux based Operating Systems is that,except for a few,

They are free to download and open for distribution.

The Linux Kernel is also open and available at www.kernel.org free to download and open for any independent developer to modify it to suit his requirement and even come up with their own version of distribution.

When something this powerful is this close, why not to get start with it. Though Linux is powerful and resourceful, but still not that easy to get comfortable with at once.
For this the Linux community has a made available a lot of offline and online help for the new users joining. Online forums and mailing lists have been made available in thick.

It isn’t possible for one to provide complete guidance in this technology(it’s really vast). But better to tell where to get help from when struck.

Here is a list of resources to get help from when you are stuck:

Manual Pages


These are made available with every distribution of Linux and are a concise description of individual commands, drivers, file-formats or library routines.

These can be read by “man” command followed by command name. Man pages makes a largest contribution in providing help to beginners as well as professionals for its availability.
Man pages have been categorized into 9 sections according to their contents:

Section

Contents

1

User- Level commands and applications

2

System calls and Kernel error codes

3

Library calls

4

Device drivers and Network Protocols

5

Standard file formats

6

Games and demonstrations

7

Miscellaneous files and documents

8

System administration commands

9

Obscure kernel specification and interfaces

Calling man title  formats a specific manual page and sends it to the terminal, where title is usually a command, device or a filename.

Notes :   Man pages are gzip compressed documents kept in directory “/usr/share/man/”. “man” command uncompresses them on the fly to show the contained information and also creates a cache in “/var/cache/man/” for further use.

Texinfo Documents-


These are a secondary source of information invented by GNU folks in response to man pages by AT&T. GNU packages provides help documents in Texinfo files rather than man pages.
Texinfo documents related to any package can be read by using  “info” command in terminal.
Much similar to  man  command, info command is also passed with a title to fetch help on the topic.

HOWTOs-


These are short notes and guides made available on various topics/subjects and is maintained by The Linux Documentation Project, at http://tldp.org/. It is a central repository for all sorts of useful Linux information.

A centralized system for Linux related documents and these are made available in various languages, irrespective of the language limitation of the developer.

These documents are available for reading, download and anybody could contribute to TLDP.

Notes  :  The documentation are maintain for each projects, projects often go outdated in  a very short span. Its necessary to check the time stamp for the document. Also check for the original source of information for any changes as Linux software base and documents are mostly maintained by a third parties like Internet Systems Consortiums and Apache Software Foundation.

Distribution-Specific Documentation-


With every release the enterprise often provide with the implementation notes and guidebook for the particular line of distributions and for each version available. These documents can easily be found on the installation media or on the websites of the Enterprise.

Some of the popular ones are :

http://fedoraproject.org/
http://www.FreeBSD.org/
http://www.redhat.com/rhel/
http://www.ubuntu.com/
http://www.opensuse.org/

Apart from these the software project specific pages also provides a good documentation. Some of which are:

http://www.gnu.org
http://www.gnome.org
http://www.kde.org
http://www.sourceforge.net

Its not possible to name each and everyone of them. But to add to the list there are thousands more.

Other Helps-


The best thing about Linux, there is a great big Linux-loving world out providing help.

Many User Groups and even small developers independently providing documentation to help new users join the ever increasing community. Subscriptions to news letters available free of cost. Dedicated Blogs and webpages for the users, forums for discussion.

Some of them can be listed as

linux.slashhdot.org               – a Linux-specific arm of tech news giant Slashdot.
lwn.net                                        – Linux and open Source news aggregator.
freecode.com                           – Large index of Linux and Unix software.
www.linux.org                         – Linux information clearing house (unofficial).
www.linux.com                       – Linux information clearing house (unofficial).
www.linuxhq.com                  – Compilation of Kernel-related info and patches.
www.linuxworld.com           – Online magazine from the Computerworld.
www.tucows.com                   – Multiplatform software archive.
www.linuxfoundation.org  – Dedicated to promotion and development of Linux.

That is a lot of help and support for Linux Users, isn’t it!

The Linux community has a lot to offer. None other platforms is provided with this range of online support and resources for users and developers. It just requires your one step towards this vast area in IT and there are thousands to help you.

With many MNC preferring its employees being familiar with any of the Linux version for working, the reason being its free, its powerful and contain infinite possibilities as its open source.

So improve your chances in the professional world!
Start with Linux, and if you get stuck anywhere, you now know where to get help from.
With this to conclude, or better say to start a series of posts.

aloha!
Kumar Abhishek.

Categories: Linux

Getting to know GRUB

July 16, 2011 5 comments

Hey Everyone!!!
Nice to be with you all again. So today its going to be the multiboot menu, since many of us run multiple OS on our system.

When I first installed Linux a couple of years back, mine first was FEDORA and since then I am in love with it. Currently I am riding F-14(that another beauty of FEDORA) and when I look at the multi boot menu, I feel why can’t we do something about it there are a lots of menu options, the count down timer, then there is this a blue colored background image (though blue is one of by favorite colors).

Many of us do not require to use all the options provided and selecting those options even by mistake is a sigh of trouble.(Reboot the system. well, you can fast forward turn off the system,not recommended though.)

Firstly, What is GRUB?

GRUB stands for GRand Unified Bootloader. A bootloader is a program that is the first one to be loaded in the memory. It’s the one that checks your hard drive for OS installations and loads the KERNEL in the memory. When we do a OS installation the process adds an entry to the Master Boot Record(MBR). Bootloader is the one to fetch the data along with the partition location for the OS installed.

There are other bootloaders available as well. Another famous bootloader program is LInux LOader(LILO). LILO was the default bootloader in the starting years multiboot systems. But now a days GRUB is becoming the default bootloader. Both allows you to modify the entries and the countdown timer. But GRUB has some remarkable advantages over LILO and they are :

  1. you can practically add unlimited entries in the bootloader where as with LILO you are limited to sixteen entries.
  2. now GRUB come with a graphical interface, rather than a black and white screen, you can have a more presentable screen.
  3. GRUB provides support for Command Line where you can read practically any file on the hard disk.

Here we are going to learn how we can customize the GRUB menu on a Fedora System. For this you need to learn about one file located in the directory “/boot/grub/”, grub.conf. This file contains all the details regarding the basic settings available with the GRUB menu.

To get to this file you need to do follow these steps:

  1. Login to any user account.
  2. Open console and gain elevated privileges by logging in as “su”.
  3. change the active directory to “/boot/grub/”.
  4. open “grub.conf” in any editor( gedit in my case).

Screenshot-1

The file just looks like as shown.

image

(click to magnify)

The image shows the default configuration file content. Each line in this configuration file hold information regarding different behavior of GRUB menu.

Lets look into each in details.

option_comments

This section is marked with pound sign denotes the comments.this bear no meaning to the BIOS, but to the user. The section contains the basic information about the GRUB installed on the system.

Anaconda is the name of the Fedora installer.

Each time you start your system the GRUB loads settings from this file so if you want to change any settings unlike LILO, you don’t have to install GRUB again and again. The other details mentioned in this section are the self explanatory and straight forward.

Line:“default=0”

This is the section which tell the GRUB which option to load as default OS in case the user does not explicitly selects the option. This follows a zero based index sequence. Change this value to the option number you want to make as default OS.

Line:“timeout=15”

This option is the “timeout” part. The time allowed to the user to select an option from the bootloader list before the default option is loaded. the default value is 15 sec. and more depending upon the distribution you use. Set this to suit your comforts for fast startup of the system.

Line:“splashimage=(hd0,4)/grub/splash.xpm.gz”

GRUB support for a graphical interface, allows the support for a background image to the GRUB menu. This option specifies the location of the splash image to be shown as background image. Again, the location is specified relative to the “/boot/“ directory. (More on this later in this post).

Line:“hiddenmenu”

This option “hiddenmenu” tells the GRUB to initially hide the list from the user. A different screen is displayed to the with a few ever details(the default option name and the count down timer). And on interruption, the GRUB list is displayed.

The menu options in GRUB:

option f

This section(shown in the picture) is the real deal for the GRUB. It stores the details of each option in the grub menu like the partition on which the corresponding OS is installed, Kernel location. “title” specifies the name to appear in the list. “root” is the partition of harddisk in which the OS installed. “kernel” specifies the location of the kernel image on the harddrive. “initrd” is an image file for the sequence for preparing the system for the kernel to be loaded and provide kernel with details of hardware on the system.”rootnoverify” is used with the operating systems which cannot be loaded directly, that is , no kernel file is specified for the same. It is taken that the kernel will be found on the specified partition and loaded. Since these OS cannot be loaded directly so the are done via method called “chainloader”. This is a method to pass the control to another bootloader from GRUB to one located on the specified partition pointed by the menu entry.


So now you know “grub.conf” file and are all set to edit the settings according to your preferences.

The first thing I would suggest you to edit is the “default” option. Remember it follows a zero based index, so set the option to the OS you work on default.

Next is the “timeout” option. No one wants to wait for 15 long seconds while booting. That’s eternity. Please do some thing about it!!

Next is the “splashimage”. This is some fancy stuff where you can put the image of your choice. But to do that you need to know something about the image you select. The image specified with an extension xpm (XBitMap), a way to store image in ASCII format.

XPixMap (XPM) consists of an ASCII image format and a C library. The format defines how to store color images (XPixMap) in a portable and powerful way. The library provides a set of functions to store and retrieve images to and from XPM format data.

To specify an image of your own, follow the following steps.

Select an image and open it in any editor(I used KolourPaint). Transform the image to size 640×480 and change the color scheme to 8-bit color(256 colors). Save the image in XPM format.Compress the image to “.gz” archive format and copy it to the folder “/boot/grub/”. Now change the name of file from “splash” to one specified by you(“spin” in my case) and you are done.

The following images specifies the process in sequence:

(Transform the image)

Screenshot-2

(apply color scheme from image effects)

Screenshot-4

(store the file under the name “grubindex” with the extension “.xpm”)

Screenshot-6

(add the image to “.gz” archive )

Screenshot7

(With “su” login use mv command to move the file spin.xpm.gz to the directory “/boot/grub/” and modify the file grub.conf)

Screenshot8

The next are the OS on the system listed in the GRUB. “title” is any valid string, so you can change it to some thing more meaningful. Like “Windows7” sound to me more meaningful than “other” and “Fedora (2.6.33…fc13.i686…)” would still mean “Fedora 13”. You can also add or remove any entry to the list from this section.


Some important notations:

sda-specifies the primary hard drive.

sba- denotes any removable storage devices.

(hd?,?)-denotes the primary storage, that is, hard drive(hd?) and the partition number on the storage

i386/i686-Compilation of OS for various processors.
The packages are built (optimized) for the:
i386 – Intel 386 processor
i486 – Intel 486 processor
i586 – Intel Pentium early AMD
i686 – Intel Pentium Pro and beyond


Well for now that already quite a stuff. Not to make this really long and boring, I leave you to make your multiboot menu some more interesting.

See you very soon, with yet some interesting stuff.

aloha!!

Kumar Abhishek.
(“m@rcus”)

Customizing System Startup

July 5, 2011 3 comments

Hello Everyone!!
Told you I’ll be back very soon and this mark the beginning for a lot to come!!

This is by far the most obvious asked question and a very ill handled problem among most of the students and even some non-technical users.

Why has my system become slow??

And the most common solution is format the system.But doing that you are wasting a hell lot of time. You just lost all your settings in various innocent application and a hell of a time formatting, reinstalling the OS, the applications you had. And now you would stress your brain cell remembering the settings you applied to each of them because you didn’t made a written note of the settings coz you perfected them over a time.

Well it certainly freaks me out!!

Well the problem is,

any Computing Device whether Windows or Linux based when it boots up has to perform all the task that you gave to it!

Yes, you do appoint many task to the Operating System in terms of startup programs and services each time you install a new program. All of them should be initialized loaded into primary memory to be at your reach. Now the point is, you often do not need all the applications, all at once. So why waste the precious “System Resources”, memory and computing power coz they are limited. There is one more thing that does not occur coz you system is slow but makes you wait. That is the timeout at different stages of Startup.

So lets get started.

Step 1:

when you boot your System the first step is BIOS initialization. Can’t do tweaks with that.
But what’s with the blinking cursor that stays on the screen for quite a time.

Yes here you  can do the tricks. your BIOS is configured to check a few devices and load the OS kernel found on the first device. By default this is configured in the following order:

  • Disk drives,
  • Removable devices,
  • Hard disk,
  • Network

That not quite like the perfect one. Yes you recognized it.

Well I know my OS is on my hard drive.

Yes do it. Go into BIOS and change the boot order.
I prefer the order as:

  • Hard drive,
  • Removable devices,
  • Disk disk,
  • Network

(NOTE: OS installation through removable devices ,like flash drive,External hard drive is also possible and is quite fast)

And here you just saved 5 seconds of startup time.


Step 2: Optional on many computers. This is the part were you meet with multiboot menu on system running more than one Operating Systems. Most general case is a Linux installation parallel to Microsoft Windows. This is were we get into Linux my personal favorite. You can do a lot with the Grub/LILO loader menu.and that I will be discussing in my next post.


Step 3:

[For Windows System]
Finally I get to see the login screen. Well here is the thing. A compromise between speed and time. Ask your self

Is this my personal System?
Do all the users know the password to my System?

If your answer is “yes” and no body has access to your system without your permission or your password is a “public property” but still you have to tell your secret Girlfriend’s name to everybody around you just qualified to save some more time.

Login to the account yeah wait a minute just another and yet another..
yeah now you see your desktop.

        1. Goto Start->Run (press Win+R).
        2. type “control userpasswords2” (obviously without quotes).

(NOTE:This is quite a powerful dialog box you got. So handle the option carefully,especially XP users. You may end up deleting the only user you have and thus the customization you did)

The trick is a small check box you see

User Accounts
Go ahead and uncheck the box. You will be asked your password to confirm the action.Now you saved the time to enter the password at the login screen and you are directly taken to Desktop the next time you login.This saves your few seconds you could have used for manual typing and the cost of typing errors.And as a bonus you also kept your girlfriend’s name a secret. The good thing is your account is still password protected. and when you leave your system to get yourself a cup of coffee just press Win+L and lock your desktop.


Step 4:

Here is the part where each one is for himself. What I mean is, our need differs in ways.
And that should define what programs we keep in startup and the services we run in background.

Take for example, I use Photoshop very often, do c and c# coding, so its logical for me to keep Adobe Bridge running.
But keep running a Mat LAB thread and IIS server running in background doesn’t makes sense.

Yes that what I am talking about. Again,

  1. Reach for Run dialog box (remember, WIN+R).
  2. type “msconfig.msc”

Again a powerful toolbox.

(NOTE: Do not mess up with the option you are not sure about. You may end up loosing track of your OS installation from Master Boot Record(MBR).)

Here our job is to configure startup tab and services tab.

Services under System Configuration

Here you see a bunch of services running that you can do away with. As for example, I certainly would not need FAX services on my PC. Do not worry if you disabled any important services, you know where to enable to from. Windows doesn’t allows you to disable any critical services and child services in hierarchy. So explore your needs.

Startup under System Configuration

Customizing Startups is again your needs and your demands. There are certainly a few threads I like to disable. And I often keep a check on the startup programs. Some programs just don’t get it “They are not NEEDED here” and of course my mood changes and the application I work on for a time frame.

Just toggle the check boxes and click apply.

And here you saved some more seconds and made some free space available for your application to use.

NOW grab a stop watch as when you click OK, the system demands reboot. If you read this article in whole I take it, you  must have taken the stopwatch reading earlier. Time to see the improvements.

(KEY: Start your watch on boot up, coz you performed a hell of customization saving them will take time.)


Some more Facts:

Apart from all the settings, tweaks you applied there are a few thing you should know:

Try not to install loads of program and do remove programs not required in recent future. It just increases the job of OS.

Try to keep your Windows Directory used space minimum as possible, use other drives for storing data. In case you have less primary memory, OS uses a apart of system directory as paging memory and you would want to make sure its available.

Do remove temporary files  periodically, as with the amount of data the response rate of applications also increases.

Defragment your Hard Drive periodically, less the fragmentation better the response.

Some more help available:

A number of tools are available free as well as commercially to help you take care of the job at hand.

CCleaner, TuneUP, Process Explorer, O & O Defrag,Ultra Defrag.
But use the Windows in-build tools to do the job as explained and you do get better results.


I hope this is useful to you all as it has been for me. So now hold your collar tight coz your pc got a performance boost over the guy sitting next to you.

That’s it for the day!
OMG its 4’oclock morning.

See you all very soon coz I have a lot to say(write) and even more to share.
signing off!!

Kumar Abhishek.
(“m@rcus”)

Categories: System Configuration

Greetings Everyone!!


I have been into computers, coding logic since 11…
and now when i am into my 3rd year of Computer Science,

But that’s not why we are here…
The point is that where will this take you all…
I have been helping out friends and other people around me…
but….

Knowledge must have no limits right..

So here I am with my own space where I can post facts, trick n tweaks and if possible share codes with u all over topics like
Data Structures
Linux tweaks
Assembly Language
language like C,C#,SQl
Photo Editing
Photography

and some new technologies and tools available.

sometimes i may go non-technical sharing snaps,sometimes crap!!
I hope u all who are going to be with me, will bear with me..

i think that was much of “hello world!”.
For the next time there is something important for you all on my cards…

signing off!!

Kumar Abhishek
(“m@rcus”)

Categories: Uncategorized