Sunday, November 15, 2009

weekend ends...

Another weekend going by... I always end the Friday thinking I will do something exciting this weekend, learn something new, just anything that could help me widen the supposed-to-be "eyes of the mind". However, it always remains a mystery how the weekend goes by. So what did I do this weekend. I do not know..read a few random technical articles which tickled a nerve or two in the brain to be settled again as it was. Hmmm... well yeah, I saw Taare Zameen Par(TZP famously)
for a third time. The magnitude of tears being the same everytime I have seen it. It was shown on the local cable channel courtesy Children's day. The only message I get from the film is "Stop forcing your children to perform. Just encourage them and they will perform on their own."-a very important one. Even today a play was telecast called "Shyamchi Mummy"-a similar topic but showcasing a very opposite view. It must be a 6-7 years old play, when HSC exams were very critical for further admission.In this play, what happens is that the guy who is studying for the HSC is bullied badly by his mom who is bent on wanting to have him in the list of merit rankers. He hates doing all this, following schedules etc.. There's hell lot of jokes in the middle of how he tries to relax but ends up getting caught by his mom. But in the end, everything is happy since he tops the merit list. The messages from both these media quite clash and they only highlight the fact that it is the competition that is killing. I remember how when in school, getting the top rank was important...to me. It was only because of the importance that I attached with that position which made me frantic about getting it. I do not know how it became important for me. Maybe it was because of the praise that I was subjected to in school and at home whenever I scored it, that made me go for it everytime. But just out of school and going for IIT coaching and then juniour and engineering college proved to me how all these marks stand no value, especially in an Indian education system. I found out how I had forgotten sharpening my skills while running in the very local competition of the school. I found out that there were many more students coming from other schools who have scored maybe a below 10th rank but are truly talented and have nurtured their talents instead of running in the race and that is very important. I struggled to find out my interests after SSC, which would not have been the case had I considered many years ago. In fact I would have been much confident in the course that I enrolled, because till then the thought that it is the goal of life would have made a far greater impact in my mindscape. This is what I have learnt from my schooling years and wish to share with everyone. I feel the competition is important, but currently the competition is about something superficial, something tangible. What would be of much more help is if the competition is about bettering oneself internally, strengthening oneself internally, about making principles clear. And that, that would be a competition of oneself with oneself. This is what I have been telling whoever I meet, whoever I know who is yet to experience all this. And even if you have already lost all these crucial years like me, better late than never. Start it today, now. Strive for self betterment, strive for others to be better too...and then let people connect like systems....as the IBM ad goes....when systems connect the world gets smarter.

Thursday, November 12, 2009

I M BAK!!

My thoughts really seem to have gained some inertia....a long time since i wrote something..Anyways, it's been such a strange transition from the college days to the ones in my first job. Having this inertial mind as is, now a days, it's always filled of things about office. Back in college, it used to be about friends, family and studies. Quite literally. Just few weeks back, I realised that this has changed. And the thing to trigger this realisation was the fact that I had forgotten the birthday of my best friend....sad...indeed...But this is not always the case.. weekends is when nostalgia strikes and it strikes badly and yet you can do nothing more than chatting or a mail to dress it superficially.

Monday, June 15, 2009

FAT filesystem

In this post I have tried not to mention a lot of specifics, giving only an overview of the FAT filesystem. I know it's not very well written, but please bear...promise to get better with time.
The FAT file system actually refers to a family of filesystems consisting of the VFAT, FAT12,FAT16,FAT32, the numbers indicating the number of bits used to indicate the cluster number(FAT32 is an exception). The name comes from the logical structure that the file system uses-the File Allocation Table. This filesystem was used by DOS on the first IBM PCs and became a standard for the PCs that followed. The file allocation table provides information about allocation units. Now where did they come up? Well, generally, we think of files to be referred by the number of sectors of size 512 bytes on the disk. However one can imagine the performance issues that will be encountered when keeping track of big files in terms of the sectors. Hence the idea to group sectors into bigger chunks called clusters. The process by which clusters are assigned to files is called allocation. Hence clusters are called allocation units ranging from sizes of 4 to 64 sectors.
Every file must be allocated an integer number of clusters. This means that if a volume uses clusters that contain 8,192 bytes, an 8,000 byte file uses one cluster (8,192 bytes on the disk) but a 9,000 byte file uses two clusters (16,384 bytes on the disk). This is why cluster size is an important consideration in making sure you maximize the efficient use of the disk--larger cluster sizes result in more wasted space because files are less likely to fill up an integer number of clusters. The cluster size is determined primarily by the size of the disk volume after partition: generally speaking, larger volumes use larger cluster sizes.
The structure of a volume that is formatted using FAT filesystem has the structure as shown:

| Partition Boot Sector | FAT 1 | FAT 2(Copy) | Root folder | Other folders and files |


The Partition Boot sector:
The Partition boot sector is the first sector on a logical volume. A logical volume may be a primary partition, or a logical volume within an extended partition or a composite of two or more partitions. This file system boot sector is different from the master boot record(MBR). MBR is the first sector on the whole hard disk, while the partition boot sector is the first sector on a particular partition within the disk. During the boot process, after the POST is performed, the BIOS first finds a boot device, then loads the boot sector of the device. For a hard disk,this is the MBR. The control is passed on to the MBR code. The MBR code helps to load the boot sector of the active primary partition. Upto this point the boot process remains independent of the file system or the operating system used.
Now in case of FAT volumes that have Windows NT installed, the FAT boot sector is responsible for identifying the location of the file "NTLDR" on the volume, loading it into memory, and transferring control to it. Since execution control is passed on to the boot sector, there is need for an executable to be present at its first location. This is generally a JUMP instruction that serves to jump over the following "non-executable" locations. Then comes the OEM id that identifies the operating system that formatted the volume. Following the OEM id, there is a structure known as the BIOS parameter block that provides enough information to the executable part to find the NTLDR. It consists of info like sectors per cluster, sector size, number of FATs(including the multiple copies), root entries etc. On a bootable or non-bootable volume, the BIOS parameter block is followed by execuable code. The last 2 bytes in any boot sector are always 0x55, 0xAA.

The File Allocation Table:
The file allocation table contains the following types of information about each cluster on the volume :

* Unused (0x0000)
* Cluster in use by a file
* Bad cluster (0xFFF7)
* Last cluster in a file (0xFFF8-0xFFFF)

To protect the volume, two copies of the table are kept, in case one becomes damaged. In addition, the file allocation tables must be stored in a fixed location so that the files needed to start the system can be correctly located.
There is no organization to the FAT folder structure, and files are given the first available location on the volume. The starting cluster number is the address of the first cluster used by the file. Each cluster contains a pointer to the next cluster in the file, or an indication (0xFFFF) that this cluster is the end of the file.

The Root Folder:
The root folder contains entries for each file and folder on the root. In the conventional FAT system, the root directory is fixed in place after the 2 FATs. The file system hierarchy is thus anchored at the root directory. Even the size of the root directory has a limit. It can a hold a maximum of 512 entries in case of an hard disk. This is in contrast to the regular directory that can be placed anywhere and can have a variable size. One of the improvements introduced in the FAT32 version of the FAT file system was to remove these restrictions on the root directory. Under FAT32, the root directory is treated much more like a regular directory, and can be relocated and expanded in size like any other. An entry in the root directory contains information like name, attribute, time and date when created, last accessed date, last modified date and time, starting cluster number in the FAT and the file size. A FAT file has four attributes that can be turned on or off by the user-system file, archive file, read-only and hidden.

The root folder is followed by the storage of the other files and folders.

FAT32:
FAT32 is a derivative of the File Allocation Table (FAT) file system that supports drives with over 2GB of storage. Because FAT32 drives can contain more than 65,526 clusters, smaller clusters are used than on large FAT16 drives. This method results in more efficient space allocation on the FAT32 drive. The FAT32 file system includes four bytes per cluster within the file allocation table. However, the high 4 bits of the 32-bit values in the FAT32 file allocation table are reserved and are not part of the cluster number.

Ref: http://www.ntfs.com/fat-systems.htm

Adding Categories to Blogs

In case you are wondering how I have got categories on my blog plage, just read this one. I was dying to write on different topics but the thought of putting technical things juxtaposed to travel ones or others made me think of starting another blog for a different topic. But I thought of googling...and bang...some guru has done it already..http://makemoneywithkassper.blogspot.com/2007/06/how-to-add-categories-to-blogger.html

To explain the process in brief, I will tell you how I did it. First make this html script ready in any text editor. For me the script is:

<h2 class="sidebar-title">Categories</h2>
<u1>
<li><a href="http://e-nertia.blogspot.com/search/label/Introduction">Introduction</a></li>
<li><a href="http://e-nertia.blogspot.com/search/label/Technical">Technical</a></li>
<li><a href="http://e-nertia.blogspot.com/search/label/Travel">Travel</a></li>
</u1>

Replace the "http://........blogspot.com" with your blog homepage link and change the names of the topics as you wish(for me they are Introduction, Technical..). Make sure that the term in the link and the actual label are the same.
Now go to the Layout Page. It must be showing a skeleton of your blog page. The part of it that shows your blog archive and profile must also be having a link "Add a Gadget". Click on the link . In the new window that opens, click on the HTML/Java script option. Paste the HTML script that you have written in the text editor into the content box. No title is required. Save the changes. Done.
Now whenever you are writing a post that belongs to a particular topic, write in the box for the label the exact category that you have made for it. So for this post i wrote the label as Technical.
Happy Organisation!!
The challenge I faced during writing of this blog was printing the HTML script as text to show you the script. I hardly have any idea of HTML scripts. I saw the page sources of sites that have showed examples of HTML scripts. So, as a piece of information, i have replaced all the > with &gt; and < with &lt;