Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 3: Where are programs and data stored?. What kinds of memory are there? The main memory The main memory –ROM: Read-only memory Store permanently.

Similar presentations


Presentation on theme: "Chapter 3: Where are programs and data stored?. What kinds of memory are there? The main memory The main memory –ROM: Read-only memory Store permanently."— Presentation transcript:

1 Chapter 3: Where are programs and data stored?

2 What kinds of memory are there? The main memory The main memory –ROM: Read-only memory Store permanently instructions for system startup. Store permanently instructions for system startup. Its contents cannot be modified. Its contents cannot be modified. Its contents written by the manufacture Its contents written by the manufacture –RAM Transitory (volatile) memory – when the power is turned off, its contents is lost. Transitory (volatile) memory – when the power is turned off, its contents is lost. Applications and user data are temporarily stored here for processing. Applications and user data are temporarily stored here for processing. Contains operating system, programs being executed, and data being processed Contains operating system, programs being executed, and data being processed

3 What kinds of memory are there? Hard disks Hard disks –Permanent storage – its contents do not depend on power –Permanent, but not forever –Where applications are installed –Where user files are stored –Where virtual memory is located CDs CDs –Compact discs –Data are written to and read from using laser –Permanent storage –Read-only –Burn CDs – write once and read many

4 How hard disks work? Rigid circular steel platters with magnetic coating Rigid circular steel platters with magnetic coating Platters spin at high speed Platters spin at high speed Each surface is formatted into circular bands called tracks and each track is divided into segments called sectors Each surface is formatted into circular bands called tracks and each track is divided into segments called sectors Data are stored on the sectors Data are stored on the sectors Each surface has a read/write (R/W) head for reading and writing from/to the surface Each surface has a read/write (R/W) head for reading and writing from/to the surface To read from or write to a sector, the R/W head of each surface moves to the track and wait for the sector to spin under the R/W head and then read or write. To read from or write to a sector, the R/W head of each surface moves to the track and wait for the sector to spin under the R/W head and then read or write.

5 How hard disks work?

6 Read/Write heads

7 Virtual memory A technique for today’s computers to run many applications beyond the limit of the physical memory (RAM) A technique for today’s computers to run many applications beyond the limit of the physical memory (RAM) Virtual memory is part of the hard disk Virtual memory is part of the hard disk Often it uses the free space of the hard disk Often it uses the free space of the hard disk All programs that are being executed and data are being processed are all located in virtual memory. All programs that are being executed and data are being processed are all located in virtual memory.

8 Virtual memory Hard disk Data files And Applications Used space Free space Running programs and their data Virtual Memory

9 RAM and virtual memory Virtual memory You Workbench.limited space.hand reachable Workshop. Large. Has everything RAMCPU Your computer

10 When do data move? You want to use MS WORD to write a letter. You want to use MS WORD to write a letter. –MS Word and its application data are installed onto the hard disk –When you double-click the Word icon, Word is copied from the hard disk to virtual memory along with its application data –When you start using Word, part of Word is copied from virtual memory to RAM –The text you enter from keyboard is saved in RAM –When you save the letter, the text along with format info (bold, italic, etc) is saved into a file on the hard disk. –When Word exits, it is removed from RAM and virtual memory along all data related to it.

11 When do data move? What happens when no free space in RAM? What happens when no free space in RAM? –As you open more and more applications (multitasking) and/or enter more data, RAM may become all occupied –This is like your workbench is all covered by tools and materials. –The operating system moves some part of some applications to virtual memory to free up some RAM space –This is like you move some tools and materials from workbench to the walls of the workshop. –Now you can continue entering more data or opening more applications. –This is like you continue your work on workbench using newly freed space. –When you need a part of a program or a program that was moved to virtual memory, it may be swapped back in RAM with some part in RAM. –This is like you need a tool you moved to the walls earlier, you need to clear some space on workbench so you can move it back.

12 How much memory is enough? Virtual memory allows us to run applications that together need more than the available physical RAM Virtual memory allows us to run applications that together need more than the available physical RAM Virtual memory (hard disk) is much slower than main memory (RAM). Virtual memory (hard disk) is much slower than main memory (RAM). The more swapping between RAM and virtual memory, the slower of the system The more swapping between RAM and virtual memory, the slower of the system The more RAM (bigger workbench), the less likely swapping occurs The more RAM (bigger workbench), the less likely swapping occurs The more RAM, the faster the system The more RAM, the faster the system Stop applications that no longer needed, this frees the RAM space occupied by those applications  remove no longer needed tools from your workbench. Stop applications that no longer needed, this frees the RAM space occupied by those applications  remove no longer needed tools from your workbench.

13 Deleting a file vs. erasing it Deletion of a file Deletion of a file 1.Removes the record of the file from the corresponding directory 2.Marks that the various sectors of the file are now free Erasure of a file Erasure of a file 1.Writes over all information in the various sectors containing file data 2.Removes the record of the file from the corresponding directory 3.Marks that the various sectors of the file are now free Delete a file === throw it into a garbage can someone may steal it and read it someone may steal it and read it Erase a file === shred it no one can read it anymore no one can read it anymore

14 What is “defragment”

15 What are viruses? Unwanted and unanticipated programs Unwanted and unanticipated programs May damage a computer or degrade its performance May damage a computer or degrade its performance Viruses may appear: Viruses may appear: –As an email attachment –In another program –In user data files (MS Word Macros) –On disk in a place that is routinely activated.

16 How to detect viruses? Anti-virus programs compare each file against known viruses Anti-virus programs compare each file against known viruses A computer may be set up in such a way that no disk files can be accessed until virus scanning has been completed. A computer may be set up in such a way that no disk files can be accessed until virus scanning has been completed. A new virus may not be known by the anti- virus program until the virus information is available to the anti-virus program A new virus may not be known by the anti- virus program until the virus information is available to the anti-virus program Be proactive in getting information of new viruses for the anti-virus program Be proactive in getting information of new viruses for the anti-virus program

17 How to protect yourself? Be sure anti-virus software is running on your computer and keep the virus info up to date Be sure anti-virus software is running on your computer and keep the virus info up to date Do not execute (open) any program (file) downloaded from the Internet without first having it scanned for viruses. Do not execute (open) any program (file) downloaded from the Internet without first having it scanned for viruses. Be cautious before allowing your Web browser to run programs behind the scenes Be cautious before allowing your Web browser to run programs behind the scenes Save all your email attachments to hard disk and scan them for viruses before open them Save all your email attachments to hard disk and scan them for viruses before open them Do not run any macro in Word documents or Excel spreadsheets unless you know they are reliable Do not run any macro in Word documents or Excel spreadsheets unless you know they are reliable Install and configure firewalls if your computer is connected to the Web. Install and configure firewalls if your computer is connected to the Web.

18 Summary – chapter 3 ROM – fast, read only and permanent ROM – fast, read only and permanent RAM – fast, allow read and write, transitory/volatile RAM – fast, allow read and write, transitory/volatile Hard disks – permanent, very high capacity, slow compared to RAM/ROM Hard disks – permanent, very high capacity, slow compared to RAM/ROM –Tracks/sectors Virtual memory Virtual memory –Allow more applications beyond the limit of RAM –Located on the hard disk Deleting vs. erasing files Deleting vs. erasing files Disk fragmentation and defragmentation Disk fragmentation and defragmentation Viruses and anti-virus programs Viruses and anti-virus programs

19 Terminology RAM/ROM RAM/ROM Hard disks Hard disks –Tracks and sectors Virtual memory Virtual memory Transitory/volatile RAM Transitory/volatile RAM Permanent storage Permanent storage Fragmentation Fragmentation Defragmentation Defragmentation Deleting files Deleting files Erasing files Erasing files Virus Virus Anti-virus programs Anti-virus programs


Download ppt "Chapter 3: Where are programs and data stored?. What kinds of memory are there? The main memory The main memory –ROM: Read-only memory Store permanently."

Similar presentations


Ads by Google