CPU Modes and Memory Flashcards
1
Q
What are the 3 IA-32 CPU Modes?
A
- Real mode
- Protected mode
- System management mode
2
Q
Which mode is the mode discussed in this course?
A
- Protected mode
3
Q
System Management Mode
A
- used for power management tasks
4
Q
Real Mode
A
- at power up or rest
- can only access 1 MB memory
- no memory protection
- privilege levels (kernel vs. user space) not possible
5
Q
Protected Mode
A
- Up to 4GB memory
- Memory protection
- Privilege level
- Multi-task
- Supports Virtual-8086 mode
- Used to operate outdated software
6
Q
Memory Models
A
- Flat memory model
- Segmented model
- Real-address mode model
7
Q
What model is this course primarily concerned with?
A
- flat memory model
8
Q
32-bit Linux CPU Model and Model
A
- Protected mode
- Flat memory model
- 4GB addressable space => 2^32
- Memory protection
- Privilege levels of code
- Segment registers point to segment descriptor tables
9
Q
What are the three types of Segment Descriptor Tables?
A
- Global Descriptor Table (GDT)
- Local Descriptor Table (LDT)
- Interrupt Descriptor Table (IDT)
10
Q
What are the levels of the Virtual Memory Model
A
- Kernel Space
- ——– USER SPACE (2-7) ——– - Stack: funtion args and local vars
- Shared libs and mappings
- Heap: dynamic memory
- BSS: uninitialized data
- Data: initialized data
- Text: program code
11
Q
How can you view process organization starting with ‘ps’?
A
- ps
- Get the PID
- cat /proc//maps
12
Q
How can you map a process with GDB?
A
- gdb /bin/bash
- break main
- run
- info proc mappings