1/24
Flashcards summarizing key concepts about memory layout in x86-64 systems.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is the role of the Memory Management Unit (MMU) in virtual memory?
The MMU uses the Translation Lookaside Buffer (TLB) to translate virtual addresses to physical addresses.
What is the typical page size for x86 architectures?
4 KB
List the main memory regions in a virtual memory layout.
OS Kernel, STACK, HEAP, BSS, DATA, and TEXT.
What is the purpose of the STACK memory region?
It stores data needed by function calls, including arguments and local variables (stack frames).
What is stored in the HEAP memory region?
Dynamically allocated memory for variables whose size is known at runtime.
What is the difference between BSS and DATA memory regions?
BSS stores global variables initialized to zero or without explicit initialization, while DATA stores initialized global variables.
What does the TEXT memory region contain?
Binary executable instructions of a program.
What does the Stack Pointer (SP) points to?
Lowest address of the stack for the current frame (top of stack).
What does the Frame Pointer (FP) points to?
Reference address of the previous frame.
What does the Saved Instruction Pointer (IP) points to?
Address that the function will return to.
Why are parameter values pushed in reverse order onto the stack?
So that the first parameter will be at a fixed offset from the BP regardless of the number of parameters.
How to display information about the CPU architecture?
Using the command 'lscpu'.
What is function of the command 'gcc -c SCC131_example.c'?
Compile C program to generate object file.
What is function of the command 'size SCC131_example.o'?
List the size (in bytes) of each section of the object file.
What is the theoretical maximum addressable memory for a 64-bit microprocessor?
2^64 bytes
What is GDB?
A debugger used to examine code execution and memory.
What does the command 'gcc -g SCC131example2.c -o SCC131example2' do?
It compiles the C code, including debug information, and creates an executable file.
What does the 'break' command do in GDB?
Sets a breakpoint at a specific line of code.
How can you display the call stack in GDB?
Use the command 'info stack' or 'backtrace'.
What is the purpose of the 'info frame' command in GDB?
Displays information about a specific stack frame.
What is Little Endian?
Least significant byte first.
What is Big Endian?
Most significant byte first.
In the x86-64 architecture, how are the first six function parameters passed?
In registers.
What are the purpose of the commands 'disass func1' and 'disass main' in GDB?
Disassemble the code for specified functions.
What does the command 'x/28xw $sp' do in GDB?
Look at the memory and display (x) the 28 words (w) [note: a word contains 32 bits] in hexadecimal format (x) located just below the top of the stack, specified by the stack pointer ($sp).