Professional Documents
Culture Documents
MEMORY
CPU Registers Ideally memory should be :
• General registers - hold variables and
- Extremely fast No current technology
temporary results - Large satisfies all of these
• Special registers - Cheap goals
• Program counter - contains the memory
address of the next instruction to be fetched So we’re using different
• Stack pointer - points to the top of the current approach
stack in memory MEMORY HIERARCHY
• Program status word (PSW) - contains the
condition code bits
Primary storage -
Memory Hierarchy directly accessible to
the CPU, small
INCREASING COST capacity, fast, volatile
INCREASING SPEED DECREASING COST
DECREASING SIZE DECREASING SPEED
INCREASING SIZE Secondary storage - not
directly accessible by
the CPU. The computer
usually uses its
input/output channels
Non-volatile : Will retain the
stored information even if it is not
to access secondary
constantly supplied with electric storage and transfers
power the desired data using
Volatile : Requires constant intermediate area in
power to maintain the stored primary storage, slow,
information
large capacity, non-
volatile
Cache Memory
• Main memory is divided up into cache lines, typically
64 bytes, with addresses 0 to 63 in cache line 0,
addresses 64 to 127 in cache line 1, and so on
• Some machines have more than 1 caches (ex. L2
cache, L1 cache), each one slower and bigger than
the one before it
• When a program needs to read a memory word :
1. Cache hardware checks to see if the line needed
is in the cache
2. If it is cache hit (the request is satisfied from
the cache, no memory request is sent to the main
memory) faster
Main Memory INPUT / OUTPUT DEVICES
• Consists of 2 parts :
• Often called Random Access Memory • The controller – chips that physically control the
(RAM) device, accepts commands from operating
• All CPU requests that cannot be satisfied system and controls the device according to the
out of the cache go to main memory. commands.
• The device
• Capacity – currently have a gigabyte-level
capacity and a very fast speed • the actual control of the device is very
complicated and detailed, so it is the job of
the controller to present a simpler interface to
the operating system
• Memory Protection
• CPU Protection
Sharing system resources requires operating system All I/O instructions are privileged instructions.
to ensure that an incorrect program cannot cause
other programs to execute incorrectly.
Must ensure that a user program could never gain
control of the computer in monitor mode
Provide hardware support to differentiate between at
least two modes of operation:
1. User mode -- execution done on behalf of a user.
2. Monitor mode (supervisor/kernel/system mode) --
execution done on behalf of operating system.
Memory Protection Tugas / Homeworks
•Must provide memory protection at least for the interrupt 1. Tulis tentang sejarah sistem operasi / Write about history
vector and the interrupt service routines. of operating system
•To provide memory protection, add two registers that 2. Beri contoh dan jelaskan tentang bus yang ada sekarang
determine the range of legal addresses 0 a program may (cont. PCI Express, SATA, dll)/ Give examples and explain
address.
256000 about the current buses (ex. PCI Express, SATA, etc)
• Base Register - holds smallest legal physical
memory address. 3. Jelaskan istilah berikut / Explain these terms :
3000040
• Limit register - contains the size of the range. • Interrupt
•Memory outside the defined range 420940is protected.
• System call
• Dynamic RAM
880000 • Static RAM
• BIOS
1024000 • CMOS
• ROM