Crunch Time Flashcards
C build process: purpose of the Preprocesspr?
takes .c file, outputs .i preprocessed file
strips comments
makes substitutions for # (expand macros)
parse c code into pure c code with no preprocessor directives
C build process: what is the purpose of the compiler?
takes .i file, outputs .s or .asm file
tests for semantic errors
decompose/split operations into assembly operations
Front End:
- parse/tokenize keyworse, identifiers, operators and literals.
- checks for compiler syntax errors
- checks for semantic error (undeclared variable usage, incompatible types, variable out of scope)
- uses symbol table to confirm which symbols are legal to use, when used
Back End:
- Optimization
- generates assembly code from pure C code
C Build process: what is the purpose of the Assembler?
takes .asm file, outputs .o file (containing opcodes and data sections)
adds the following to object file:
- sections for static variables,
- symbol table, to store variable names and attributes
- debug info, maps source code and information needed by debugger
- export section; global symbols/functions/variables
- imports section, containing symbol names needed from other object files
C build process: what is the purpose of the Linker?
takes .o file, outputs relocatable file
Symbol Resolution
- resolves external references (that were marked by assembler), throws “unresolved reference to variable” if not found.
Relocation
- changes addresses assigned to labels because Section Merging and Section Placement
Section Merging:
- merges sections from input files into sections of output file
Section Placement
- assembled program assumes each section starts from address 0; if not, these need to be moved to reflect that
C Build Process: what is the purpose of the Locator?
takes relocateable file and linker script file, into executeable file
memory layout information - (flash/sram, placement of different program regions) -
is provided by linker script file, locator performs conversion to generate single, executeable binary image
Internet
Infranet
globally linked computer netowrk using TCP/IP protocol to communicate
privately owned/controlled network, usually on a client/server platform to share files/data locally
OSI Model
First standard model for network communication:
Application
Presentation
Session
Transport
Network
Data Link
Physical
IPV4,
Exhaustioned solutions
IPv4 was built for roughly 4.29 billion IPv4 addresses… and we are running out.
solutions:
Network Interface Card NIC
uses physical layer circuitry to communicate with data-link layer to provide a computer with a connection to the/a network
Ethernet
tech that connects devices in a LAN or WAN. enabled device comunication within a protocol
Hub
Broadcasts data to every computer/Ethernet based device connected to it.
Switch (Filtering, Forwarding)
smart switch; implements forwarding ro known destination MAC addresses, and filters packets
ARP
Address Resolution Protocol maps IP address to MAC addresses
Network types (LAN, WAN)
…really..?
IP addresses (Net ID, Host ID, subnet mask)
identifies device on network.
Net id identifies the host’s network,
host ID identifies the host’s TCP/IP network
subnet mask divides an IP address into two parts:
IP Address Classes
A: first 8 leading bits
B: first 16 leading bits
C: first 24 leading bits
D: for multitask aplications
E: undefined, for testing or illegal