SLAE - 32 bit Linux Flashcards
What are the diff processors?
intel, ARM, MIPS
Intel Architecture
IA-32 and IA-64
What are the diff components of a CPU?
Control Unit > Execution Unit which uses Registers and Flags
What does the control unit do?
Retrieve/decode instructions, retrieve/store data in memory
What is the execution unit within the CPU?
Actual execution of instructions happens here
What is the purpose of registers and flags?
Registers are internal memory locations used as ‘variables’.
Flags are used to indicate various ‘events’ during execution.
What are the different IA-32 registers?
General purpose regs Segment regs Flags and EIP Floating Point Unit regs MMX regs XMM regs
There are 4 different general purpose regs in IA-32. What are they?
EAX (32 bits wide) Accumulator register and is used to store operand and result data EBX (32 bits wide) Base register which contains pointer to data ECX (32 bits wide) Counter register EDX (32 bits wide) Data register ESP (32 bits wide) Stack pointer register EBP (32 bits wide) Stack Data pointer register ESI (32 bits wide) Data pointer regs for memory locations EDI (32 bits wide) Data pointer regs for memory locations
Decompose the IA-32 general purpose regs.
EAX (32 bits) = AX (16 bits) = AL (0-7) and AH (8-15) EBX, ECX and EDX all work the same way. ESP (32 bits) = SP (0-15) (16 bits) EBP (32 bits) = BP (0-15) (16 bits) ESI (32 bits) = SI (0-15) (16 bits) EDI (32 bits) = DI (0-15) (16 bits)
What are the different segment registers?
They are all 16 bits wide! CS (Code) DS (Data) SS (Stack) ES (Data) FS (Data) GS (Data)
What are some examples of the different flag registers?
Parity flag
Zero flag
Carry flag
SIMD?
Single Instruction Multiple Data
MMX and XMM
MMX are carved out of FPU regs and are 64 bits wide.
XMM are 128 bits wide!
GDB syntax - 1
#shows all the register info info registers #to see all floating point registers info all-registers #print the value of EAX and AX registers display /x $eax display /x $ax #command to disassemble code disassemble $eip disassemble main #gdb assembly syntax #Default is att syntax in linux. Change that to intel syntax set disassembly-flavor intel
What are the diff CPU modes for IA-32?
Real mode (kernel and user priv levels not possible) Protected Mode (priv level possible) System management mode (used for power management tasks)