Archive for January 6th, 2007
Starting again, with MS-DOS
Thanks to NIIT’s ComputerDrome facility I was not forced to start practical session only after Theory sessions and had access to PC on the very first day. And the very first thing I started with was the MS-DOS.
Working with BBC Micro, I was only exposed to file access commands as LOAD, SAVE, LIST, PRINT# or LOADPICT in Logo etc. Now I had before me a machine which was extremely different that what I was aware of. A hard disk, a filesystem with Directories and a large number of commands to utilise all facilities provided by the DOS.
My earlier exposure allowed me to directly jump to using books as Sybex instant Reference series which were my first choice for learning any language I needed to learn be it DOS, dBase, AutoCAD or FoxPro (it came as Language Reference instead). Learning DOS took me no time and it was not long before I took to access the entire filesystem using tools as PCTools. These tools lost significane after Windows95 came along which denied supporting, for improving the security, the tools which directly accessed to filesystem.
Though now with FAT32 and NTFS taking over the FAT16 holds no significance, the floppy are still formatted using FAT and this is what you see if viewed through PCTools
Boot Sector (One Sector, 512bytes) : It contains information about the number of heads, sectors and cylinders on the disk, the sector size etc. and boot code which loads the rest of the operating system.
File Allocation Table (Several Sectors) : It maps the allocation of the various disk sectors to files. DOS contained two identical copies of FAT here. Each file/directory required 32 bytes of FAT for storing Name, Type, Starting address of Data, and size of file.
Root Directories : This stored the fies and directories that existed in the root and number was default 256. Decreasing the number of root directories (by tweaking the Boot Sector) allowed to increase the disk space and vice versa.
Data Blocks : This section stored all the data belonging to files and subdirectories. Since FAT16 could store only 2^16 (65536) addresses, the size of each data block (cluster) varied depending on size of hard disk/floppy. For a floppy the size of a cluster is 512 bytes and for hard disks it was 512*(2^n), n=0,1,2,3… As hard disks of larger sizes kept coming up, the size of cluster kept increasing resulting in waste of precious disk space (each file, even of 0 bytes, reserved space in multiple of clusters), FAT32 was deviced which allowed 2^32 (4294967296) addresses thus keeping size of cluster small.
My favourite prank with PCTools was hiding my project files, in floppies, from being accessed by my batchmates, by storing them into two folders which using PCTools I would rename to “.” and “..” in order. These two folders names were supposed to change to current folder and the parent folder, hence didnot allow access to my files using DOS Commands. Nobody ever seemed to recall the fact that these folders are never shown when directory listing for root folders are displayed, and my files remained far from access. The catch I knew was that if CHKDSK was performed on such a floppy all my files would get deleted, which thankfully nobody did.


