Friday, October 5, 2007

Default drive, Internal commands and External commands

Some concepts one must keep in mind when working with DOS are the notion of the default drive, internal commands and external commands. The default drive is the drive that is being focused on by the computer and the DOS expects to find the programs and files that you refer to in this drive. A drive is represented by a letter followed by a colon ex: “C:”. In DOS the drive waiting for a command would read as “C:\>-”. The “\” backslash refers to the root directory and the “>” is just a symbol to show what drive you are using. The blinking “_” is the cursor waiting for you to type information in the screen, Any command issued without specifically referring to a drive goes to the default drive i.e. the last drive that was referred to on the computer. One can change the current drive from for example C: to D: since while sitting on drive C: type in “D:” and the computer now responds with the “D:\>” drive as the current drive. In order to go back in history press the up arrow key. In order to go forward in the history of actions press the down arrow key.
A good analogy to remember how internal and external commands work is the analogies of different doctors. When you need to go to a doctor for a cold, you go and see a generalized practitioner. When you need to see the doctor for a brain aneurysm, you see a specialist doctor for the brain. Well internal commands are like the generalized practitioner in the sense that the commands are contained in command.com and are part of the DOS program itself and are basic file commands that are inputted in by you in the DOS window after a drive such as “DIR” which lists the files in the directory, “TYPE” which displays file contents on the monitor, “DATE” which changes the system date, “RENAME” which renames disk files, “COPY” which copies one or more files, “ERASE” which erases one or more files and “TIME” which changes the time for the system. A general practitioner has to know a little bit of everything medically speaking, just like the internal commands need to be there since they are the basic files required. External commands function like the specialist doctor and are commands that are not contained in the program command.com. Each time that DOS needs to execute them, it must first load them from a disk for example by typing in “CHKDSK” you check the status of a disk and prepare the status report, “DISKCOPY” copies a complete diskette and “FORMAT” prepares the disk for use and internalizes the disk so that DOS can store information on it. Formatting a disk writes tracks and sectors on the disk and puts important files on it like the operating system files. Just remember that formatting will erase all of the information on a disk if there was any information there and to be usable a disk needs to be formatted. Format command also examines that particular disk for any defective sectors and stores the information in FAT(file allocation table), initializes the directory, sets up space for FAT and records the boot program in the boot record.
In DOS when you type in a command it must be spelled correctly but it doesn’t matter if it’s capitalized or not. Also if something is in brackets [ ] that means it’s an optional part of the command. When you are doing any command, you always need a drive where this command will take place and if you don’t specify the drive, the default drive is assumed. Every time you see “/” as part of a command, that is called a switch and it turns the mechanism on for that part of the command that you have typed after it for example if you type FORMAT [d:] [/s] [/v] you are saying to format the drive (whenever you see [d:] it means the description of the drive/directory you are working with in my examples to find a file) and are causing the operating system files to be transferred to the new disk (s stands for system and once added to the disk it can store information on it and it’s bootable so this allows the disk to be a recovery/rescue disk) and allows you to specify a volume label to identify the disk( the /v command part did this).

No comments: