Saturday, March 26, 2011

OPERATING SYSTEM BASICS:10 VIRTUAL MEMORY

Virtual Memory

The term virtual memory is used to describe memory that isn’t what it appears to be. Virtual memory is actually the disk drive space that is manipulated to seem like RAM. Software creates virtual memory by swapping files between RAM and the disk drive, as shown in the following figure. This memory management technique effectively creates more total memory for the system’s applications. However, since there is a major transfer of information that involves the hard disk drive, an overall reduction in speed is encountered with virtual memory operations.

Virtual Memory Operations


Most operating systems since Windows 3.x, Windows 9x, Windows NT, Windows 2000, UNIX, and LINUX feature virtual memory operations. Within these systems, three types of swap files, temporary, permanent, and variable are used. Some operating systems will permit either a permanent or temporary swap file to be established on the system’s hard drive. A permanent swap file is always present and has a constant size. It is composed of contiguous clusters on the drive and cannot be established in the fragmented drive space. It also cannot be established on a compressed partition. The following list shows the types of swap files supported by various Microsoft operating systems:

·         Temporary swap files: Windows 3.x
·         Permanent swap files: Windows 3.x, NT, 2000
·         Variable swap files: Windows 9x


Great! Now we understand the basic and internal work of an Operating System.
Let us move forward key aspects of Information Technology: Networking, Database Programming and Office Tools Automation(Basic Programming).

Send us your feedback and may the real collaboration start!
Keep it up!

            

Friday, March 25, 2011

OPERATING SYSTEM BASICS:9 SYSTEM MEMORY

SYSTEM MEMORY MANAGEMENT
When the original PC was designed, there were certain decisions made in dividing up the 8088 system’s one megabyte of memory address space. These decisions were implemented by the original PC-DOS and MS-DOS operating systems. Due to compatibility issues, these decisions have carried over into the address allocations of all PC-compatibles, as shown in the following figure.



MS-DOS can recognize the following classifications of memory:
Conventional memory
Upper memory blocks
High memory area
Expanded memory
Extended memory
Virtual memory
·        Conventional Memory
Conventional memory (locations 00000h through 9FFFFh) is the standard memory area for all PC-compatible systems. It traditionally holds the operating system, interrupt vector tables, and relocated ROM BIOS tables. The remaining space in the conventional memory area is referred to as DOS Program Memory.

·        Upper Memory Area
The upper memory area (UMA) occupies the 384KB portion of the PC's address space
from A0000h to FFFFFh. This space is not normally considered as a part of the computer's total address space because programs cannot store information in this
area. Instead, the area is reserved to run segments of the system's hardware.
Address spaces from A0000h through BFFFFh are dedicated addresses set-aside for
the system's video display memory. The system's ROM BIOS occupies the address
space between locations FE000h and FFFFFh.
Between the video memory and system BIOS areas, addresses are reserved to hold
BIOS extension programs for add-on hardware adapters. Typical BIOS extensions
include those for hard drive adapters, advanced video adapters, and network adapters.

After BIOS extensions are in place, the typical UMA still has many unused memory areas that can have information mapped (copied) into them. This space is segmented into 64KB sections called upper memory blocks (UMBs). The primary use for these blocks is to hold installable device drivers and other memory resident programs moved out of the conventional memory area. By moving these programs out of the conventional memory area, more space is made available there for use by application programs.

PCs also use this area to incorporate a memory-usage scheme called Shadow RAM to
improve their overall performance. With this feature, the content of the system BIOS
and/or adapter BIOS are rewritten (shadowed) into faster extended memory RAM
locations. The operating system then remaps ROM addresses to the corresponding
RAM locations through unused portions of the UMA. Shadowing enables the system to
operate faster when application software makes use of any of the BIOS' CALL
routines.

·        Extended Memory
With the advent of newer microprocessors that employ protected operating mode, it
became possible to access physical memory locations beyond the 1-megabyte limit of
8088 system. Memory above this address is generally referred to as extended
memory. Modern operating systems can take full advantage of extended memory
through the Protected Addressing modes of the more advanced microprocessors. This
capability to manage higher memory enables the system to free more base memory
area for applications programs.
Flat Memory Models
Unlike MS-DOS, Windows 3.x, or Windows 9x, other operating systems, such as
Windows NT, Windows 2000, Windows XP, UNIX, and LINUX, do not employ address segmentation features of Intel microprocessors to divide the computer’s memory allocations. Because segments can overlap, memory usage errors can occur when an
application attempts to write data into a space being used by the operating system or
by another application.

Using the Flat Memory Model, the memory manager sections map each application’s
memory space into contiguous pages of physical memory. Using this method, each
application is mapped into a truly unique address space that cannot overlap any other
address space. The lack of segment overlap reduces the chances of applications
interfering with each other and helps to ensure data integrity by providing the
operating system and other processes with their own memory spaces.

The following figure shows the Flat Memory Model concept. In this example, the 32-
bit address produced by the microprocessor contains three parts dictated by the
operating system. The highest 10 bits of the address point to the Page Table
Directory.
This table sets the address boundaries for each page of memory in the
memory. This guarantees that there is only one method of entering the page space
through this table. Therefore, there is no chance for poorly written software to stray
into a page it has not been assigned. The lower 22 bits of the address are used to
access a particular page within the block of addresses specified in the Page Table
Directory (bits 12-21), and then to select a particular physical address within the
page (bits 0-11).



Next publication will focus on what a virtual memory is and how to configure it on MS-Windows Operating System.
Keep it  up
                   

OPERATING SYSTEM BASICS:8 . Command-line Shortcuts On MS-Windows

Command-line Shortcuts


Microsoft operating systems provide some command line shortcuts through the keyboard's function keys. Some of the most notable are the F1 and F3 function keys.

  • The F1 key will bring the previous command back from the command line buffer, one character at a time. 
  • Likewise, the F3 key will bring back the entire previous command through a single keystroke.

When using filenames in command line operations, the filename is displayed at the end of the directory path in the source and destination locations.
The [*] notation is called a wild card and allows operations to be performed with only partial source or destination information. Using the notation as [*.*] indicates the software to perform the designated command on any file found on the disk using any filename and extension.


A question mark [?] can be used as a wild card to represent a single character in a filename or extension. Multiple question marks can be used to represent multiple characters in a filename or extension.

Data from a command can be modified to fit a prescribed output format through the use of filter commands. The main filter commands are More, Find, and Sort. The filter command is preceded by a pipe symbol [ | ] on the command line, when output from another command is to be modified. For example, to view the content of a batch file that is longer than the screen display can present at a time, type Type
C:\xxx.bat|more.
If the information to be modified is derived from another file, the less than [<] symbol is used.

Hint:Memorize the command line wild card characters and be able to use their variations.
           

OPERATING SYSTEM BASICS:8 CREATING AND MANAGING FILES With CMD

CREATING AND MANAGING FILES USING COMMAND-LINE


Disk-based systems store and handle related pieces of information in groups called files. The system recognizes and keeps track of the different files in the system by their filenames. Therefore, each file in the system is required to have a filename that is different from that of any other file in the directory.

If two files having the same name were present within the same directory of the system, the computer becomes confused and fails to operate properly. This is because it cannot determine which version of the file is supposed to be worked on.

Each time a new file of information is created, it is necessary to give it a unique filename by which the operating system can identify and store it. Files are created through programming packages or by applications. 

In an MS-DOS environment, there are a few rules that you must remember when creating new filenames. As mentioned, the filename consists of two parts, a name and an extension. The filename is a combination of alphanumeric characters and is between one and eight characters in length. The extension is an optional addition to the name that begins with a period, and is followed by maximum of three characters.


As discussed earlier, extensions often prove useful in describing the content of a file,or in identifying different versions of the same file. If a filename that already exists is used to store another file, the computer will write the information in the new file over that of the old file, assuming that both of them are same. Therefore, only the new file will exist. The information in the old file will be lost.

Many software packages will automatically generate filename extensions for files they create. The software does this so that other parts of the program, which may work with the same file, will be able to identify where the file came from, or what form it is in.


In any event, you should remember the following seven items when assigning and using filenames:

  •  All files must have a filename.
  • All filenames must be different than any other filename in the system or on the disk presently in use.
  • DOS filenames are up to 8 characters long with an optional 3-character extension (separated from the basic filename by a period).
  • When using a filename in a command, you must also use its extension, if one exists.
  • Some special characters are not allowed in filenames. These are: [, ], :, ;, +, =, \, /, >, ? and ,.
  • When informing DOS where to carry out a command, you must indicate it on which disk drive the operation is to be performed. The drive must be specified by its letter name followed by a colon, for example A:, B:, or C:.
  •  The complete and proper way to specify a file is the drive specifier, filename, and the filename extension, in that order, for example B:filename.ext.
The following commands are used to carry out file-level operations.
1. COPY: The file copy command copies a specified file from one place, either disk or directory, to another. For example:
• C:\>COPY A:filename.ext B:filename.ext
• C:\>COPY A:filename.ext B: is used if the file is to have the same name in its new location. The second filename specifier can be omitted.

2. XCOPY: This command copies all files in a directory along with any subdirectories and their files. This command is particularly useful in copying files and directories among disks with different formats. For example from a 1.2-MB disk to a 1.44-MB disk. For example:
• C:\>XCOPY A: B: /s
This command would copy all files and directories from the disk in drive A: except hidden and system files to the disk in drive B:. The /s switch instructs the XCOPY command to copy directories and subdirectories.

3. DEL or ERASE: This command allows the user to remove unwanted files from the disk when typed in at the DOS prompt. For example:
• C:\>DEL filename.ext
• C:\>ERASE B:filename.ext
A great deal of care should be taken when using this command. If a file is erased accidentally, it may not be retrievable.

4. REN: Enables the user to change the name or extension of a filename. For example:
• C:\>REN A:filename.ext newname.ext
• C:\>COPY A:filename.ext B:newname.ext
Using this command changes only its name but not the content of the file. The original filename (but not the file) is deleted. If you wish to retain the original file and filename, a copy command, using different filenames, can be used.

5. TYPE: Shows the content of a designated file on the monitor screen. For example:
• C:\>TYPE AUTOEXEC.BAT will display the content of the
AUTOEXEC.BAT file

6. FC: This file-compare command compares two files to see if they are the same. This operation is normally performed after a file copy has been performed to ensure that the file was duplicated and located correctly. For example:
• C:\>FC A:filename.ext B:
If the filename is changed during the copy operation, the command should be typed as:
• C:\>FC A:filename.ext B:newname.ext

7. ATTRIB: Changes file attributes such as Read-only (+R or –R), Archive (+A or –A), System (+S or –S), and Hidden (+H or –H). The + and – signs are to add or subtract the attribute from the file. For example:
• C:\>ATTRIB +R C:\DOS\memos.doc
This command sets the file MEMOS.DOC as a read-only file. Read-only attributes protect the file from accidentally being overwritten. Similarly, one of the main reasons for giving a file a Hidden attribute is to prevent it from accidentally being erased. The System attribute is reserved by the operating system and marks the file as a system file.

Hint: A common error message encountered when working with command line operations is the bad command or the file name error message. This type of error message generally occurs when the path specified to the location of a file is incorrect or when the file is missing or misspelled.

Keep it up!

            

Thursday, March 24, 2011

OPERATING SYSTEM BASICS:7 Working With Directories

Working With Directories

In hard drive-based systems, it is common to organize related programs and data into areas called directories. This makes you easier to find and work with them since modern hard drives are capable of holding large amounts of information. Most directories can hold up to 512 directory or filename entries. Note that Microsoft directories can hold up to 512 directory or filename entries.
The following list of commands is used for directory-based operations in a Microsoft system.

DIR: Lists the files on the disk that is indicated by the drive specifier.
Some examples of the DIR command are:
C:\>DIR or DIR B: Displays the content of the specified drive indicated by the drive letter. If no drive letter is specified, the content of the drive indicated by the prompt will be displayed.
C:\>DIR/W: Displays the entire directory at a time across the width of the screen.
C:\>DIR/P: Displays the content of the directory one page at a time. You must press a key to advance to the next display page.

MKDIR (MD): Creates a new directory in an indicated spot in the directory tree structure.
C:\>MD C:\DOS\XXX will create a new subdirectory named XXX in the path that includes the ROOT directory (C:\) and the DOS directory.

CHDIR (CD): Changes the location of the active directory to a position specified with the command.
C:\>CD, C:\DOS will change the working directory from the C: root directory to the C:\>DOS directory.

RMDIR (RD): Erases the directory specified in the command.
You cannot remove a directory until it is empty and you cannot remove the directory if it is currently active. For example:
C:\>RD C:\DOS\forms would remove the DOS subdirectory forms, provided it was empty.

PROMPT: Changes the appearance of the DOS prompt.
C:\>PROMPT $P$G will cause the form of the prompt to change from simply C: to C:\ and will cause the complete path from the main directory to the current directory to be displayed at the DOS prompt.
TREE: Lists all directory and subdirectory names on a specified disk.
C:\>TREE C will display a graphical representation of the organization of the C hard drive.

DELTREE: Removes a selected directory and all files and subdirectories below it.
C:\>DELTREE C:\DOS\DRIVER\MOUSE will delete the subdirectory
Mouse and any subdirectories it may have.
In this video you will see an example on how to work on directories.


           

OPERATING SYSTEM BASICS:6

Managing Drives and Disks With Command-Line


In a Microsoft-based system, each disk drive is identified by a single-letter name, such as A:. This name must be specified when giving system commands, so that they are carried out using the proper drive. The format for specifying the drive that will perform a command-line function is the drive’s identifier letter in the command, followed by a colon, for example, A: or C:.

The following figure shows how various disk drives are viewed by a typical, standalone system. Microsoft operating systems reserve the letters A: and B: for the first and second floppy drives. Multiple hard disk drive units can be installed in the system unit, along with floppy drives. Microsoft operating systems recognize a single hard disk unit in the system as drive C:. Disk management utilities can be used to partition a single physical hard disk drive into two or more volumes that the system recognizes as logical drives C: or D:.

System's Disk Drives


Hint: The figure shows a CD-ROM drive as drive D: since this is the most common PC configuration. In the case of networked systems, logical drive letters may be extended to define up to Z drives. These drives are actually the hard drives located in remote computers. The operating system in the local computer handles them as additional logical drives,such as F: or G:.


Conversely, a second hard disk drive can be added to the system and set up as logical drive D:
 It may also be partitioned into smaller logical drives that the system recognizes as drives E: or F:. Some command-line operations are simplified by allowing the system to choose the location for the command to be carried out through the use of default settings, which are special predetermined settings that are automatically used by the system when no specific directions are given to change the setting.

These settings are stored in the operating system and used by the system when the operator does not specify a particular location for events to occur. The default setting in your system is the A: drive. In systems with two or more drives, it is imperative that the user specifies exactly where the specified action is to occur.

Drive-Level DOS Operations




The following command line functions pertain to drive-level operations. They must be typed at the command prompt, and they carry out the instruction along with any drive modifiers given.

1.  FORMAT: This command is used to prepare a new disk to use with an operating system. Actual data locations are marked off on the disk for tracks and sectors, and bad sectors are marked. In addition, the directory is created on the disk. New diskettes must be formatted before they can be used. Following are some of the applications of the FORMAT command:


  • C:\>FORMAT A creates the track, sector, and the file system structure on the specified disk (in this case the A: floppy drive).


  • C:\>FORMAT A:/S causes three system files to be copied into the root directory of the disk after it has been formatted. The new diskette will now boot up without a DOS disk.


  • C:\>FORMAT A:/Q causes the system to perform a quick format operation on the disk. This amounts to removing the FAT and root directory from the disk.


2.SETVER: This command sets the operating system version number that the system reports to an application. Programs designed for earlier DOS versions may not operate correctly under later versions unless the version has been set correctly. The syntax of the SETVER command is:


  • C:\>SETVER C:

This entry will cause all files on the C: drive to be listed in the operating system version table. Note that the SETVER command must be enabled by loading it in the CONFIG.SYS file before it can be used from the command
line.

3. VER: If the current operating system version is not known, typing VER at the command prompt will display it on the screen. These commands are particularly useful in networking operations where multiple computers are connected together to share information. In these applications, several versions of operating systems may exist on different machines attached to the network. The syntax for the VER command is:

  • C:\>VER


Next Lesson we will be working with directories.
Keep it up!
              

OPERATING SYSTEM BASICS:5

All Dos Commands 


      All Dos Commands With Their Description
    
      ADDUSERS Add or list users to/from a CSV file
      ARP Address Resolution Protocol
      ASSOC Change file extension associations
      ASSOCIAT One step file association
      AT Schedule a command to run at a later time
      ATTRIB Change file attributes

      BOOTCFG Edit Windows boot settings
      BROWSTAT Get domain, browser and PDC info

      CACLS Change file permissions
      CALL Call one batch program from another
      CD Change Directory - move to a specific Folder
      CHANGE Change Terminal Server Session properties
      CHKDSK Check Disk - check and repair disk problems
      CHKNTFS Check the NTFS file system
      CHOICE Accept keyboard input to a batch file
      CIPHER Encrypt or Decrypt files/folders
      CleanMgr Automated cleanup of Temp files, recycle bin
      CLEARMEM Clear memory leaks
      CLIP Copy STDIN to the Windows clipboard.
      CLS Clear the screen
      CLUSTER Windows Clustering
      CMD Start a new CMD shell
      COLOR Change colors of the CMD window
      COMP Compare the contents of two files or sets of files
      COMPACT Compress files or folders on an NTFS partition
      COMPRESS Compress individual files on an NTFS partition
      CON2PRT Connect or disconnect a Printer
      CONVERT Convert a FAT drive to NTFS.
      COPY Copy one or more files to another location
      CSVDE Import or Export Active Directory data

      DATE Display or set the date
      Dcomcnfg DCOM Configuration Utility
      DEFRAG Defragment hard drive
      DEL Delete one or more files
      DELPROF Delete NT user profiles
      DELTREE Delete a folder and all subfolders
      DevCon Device Manager Command Line Utility
      DIR Display a list of files and folders
      DIRUSE Display disk usage
      DISKCOMP Compare the contents of two floppy disks
      DISKCOPY Copy the contents of one floppy disk to another
      DNSSTAT DNS Statistics
      DOSKEY Edit command line, recall commands, and create macros
      DSADD Add user (computer, group..) to active directory
      DSQUERY List items in active directory
      DSMOD Modify user (computer, group..) in active directory

      ECHO Display message on screen
      ENDLOCAL End localisation of environment changes in a batch file
      ERASE Delete one or more files
      EXIT Quit the CMD shell
      EXPAND Uncompress files
      EXTRACT Uncompress CAB files

      FC Compare two files
      FDISK Disk Format and partition
      FIND Search for a text string in a file
      FINDSTR Search for strings in files
      FOR Conditionally perform a command several times
      FORFILES Batch process multiple files
      FORMAT Format a disk
      FREEDISK Check free disk space (in bytes)
      FSUTIL File and Volume utilities
      FTP File Transfer Protocol
      FTYPE Display or modify file types used in file extension associations

      GLOBAL Display membership of global groups
      GOTO Direct a batch program to jump to a labelled line

      HELP Online Help
      HFNETCHK Network Security Hotfix Checker

      IF Conditionally perform a command
      IFMEMBER Is the current user in an NT Workgroup
      IPCONFIG Configure IP

      KILL Remove a program from memory

      LABEL Edit a disk label
      LOCAL Display membership of local groups
      LOGEVENT Write text to the NT event viewer.
      LOGOFF Log a user off
      LOGTIME Log the date and time in a file

      MAPISEND Send email from the command line
      MEM Display memory usage
      MD Create new folders
      MODE Configure a system device
      MORE Display output, one screen at a time
      MOUNTVOL Manage a volume mount point
      MOVE Move files from one folder to another
      MOVEUSER Move a user from one domain to another
      MSG Send a message
      MSIEXEC Microsoft Windows Installer
      MSINFO Windows NT diagnostics
      MSTSC Terminal Server Connection (Remote Desktop Protocol)
      MUNGE Find and Replace text within file(s)
      MV Copy in-use files

      NET Manage network resources
      NETDOM Domain Manager
      NETSH Configure network protocols
      NETSVC Command-line Service Controller
      NBTSTAT Display networking statistics (NetBIOS over TCP/IP)
      NETSTAT Display networking statistics (TCP/IP)
      NOW Display the current Date and Time
      NSLOOKUP Name server lookup
      NTBACKUP Backup folders to tape
      NTRIGHTS Edit user account rights

      PATH Display or set a search path for executable files
      PATHPING Trace route plus network latency and packet loss
      PAUSE Suspend processing of a batch file and display a message
      PERMS Show permissions for a user
      PERFMON Performance Monitor
      PING Test a network connection
      POPD Restore the previous value of the current directory saved by PUSHD
      PORTQRY Display the status of ports and services
      PRINT Print a text file
      PRNCNFG Display, configure or rename a printer
      PRNMNGR Add, delete, list printers set the default printer
      PROMPT Change the command prompt
      PsExec Execute process remotely
      PsFile Show files opened remotely
      PsGetSid Display the SID of a computer or a user
      PsInfo List information about a system
      PsKill Kill processes by name or process ID
      PsList List detailed information about processes
      PsLoggedOn Who's logged on (locally or via resource sharing)
      PsLogList Event log records
      PsPasswd Change account password
      PsService View and control services
      PsShutdown Shutdown or reboot a computer
      PsSuspend Suspend processes
      PUSHD Save and then change the current directory

      QGREP Search file(s) for lines that match a given pattern.

      RASDIAL Manage RAS connections
      RASPHONE Manage RAS connections
      RECOVER Recover a damaged file from a defective disk.
      REG Read, Set or Delete registry keys and values
      REGEDIT Import or export registry settings
      REGSVR32 Register or unregister a DLL
      REGINI Change Registry Permissions
      REM Record comments (remarks) in a batch file
      REN Rename a file or files.
      REPLACE Replace or update one file with another
      RD Delete folder(s)
      RDISK Create a Recovery Disk
      RMTSHARE Share a folder or a printer
      ROBOCOPY Robust File and Folder Copy
      ROUTE Manipulate network routing tables
      RUNAS Execute a program under a different user account
      RUNDLL32 Run a DLL command (add/remove print connections)

      SC Service Control
      SCHTASKS Create or Edit Scheduled Tasks
      SCLIST Display NT Services
      ScriptIt Control GUI applications
      SET Display, set, or remove environment variables
      SETLOCAL Begin localisation of environment changes in a batch file
      SETX Set environment variables permanently
      SHARE List or edit a file share or print share
      SHIFT Shift the position of replaceable parameters in a batch file
      SHORTCUT Create a windows shortcut (.LNK file)
      SHOWGRPS List the NT Workgroups a user has joined
      SHOWMBRS List the Users who are members of a Workgroup
      SHUTDOWN Shutdown the computer
      SLEEP Wait for x seconds
      SOON Schedule a command to run in the near future
      SORT Sort input
      START Start a separate window to run a specified program or command
      SU Switch User
      SUBINACL Edit file and folder Permissions, Ownership and Domain
      SUBST Associate a path with a drive letter
      SYSTEMINFO List system configuration

      TASKLIST List running applications and services
      TIME Display or set the system time
      TIMEOUT Delay processing of a batch file
      TITLE Set the window title for a CMD.EXE session
      TOUCH Change file timestamps
      TRACERT Trace route to a remote host
      TREE Graphical display of folder structure
      TYPE Display the contents of a text file

      USRSTAT List domain usernames and last login

      VER Display version information
      VERIFY Verify that files have been saved
      VOL Display a disk label

      WHERE Locate and display files in a directory tree
      WHOAMI Output the current UserName and domain
      WINDIFF Compare the contents of two files or sets of files
      WINMSD Windows system diagnostics
      WINMSDP Windows system diagnostics II
      WMIC WMI Commands

      XCACLS Change file permissions
      XCOPY Copy files and folders

This is just a descriptive lesson on Microsoft Windows Command available. In the followings publication we will use some of them to show you how useful they are for network administrators.
Keep in Touch!