CS252: Systems Programming

21
CS252: Systems Programming Ninghui Li Final Exam Review

description

CS252: Systems Programming. Ninghui Li Final Exam Review. Topic 1. Understand pointer usage and arithmetic &, *( p+i ) Understand argument passing behavior (especially those involving pointers) 2d Array implementation - PowerPoint PPT Presentation

Transcript of CS252: Systems Programming

Page 1: CS252: Systems Programming

CS252: Systems Programming

Ninghui Li

Final Exam Review

Page 2: CS252: Systems Programming

Topic 1

Understand pointer usage and arithmetic&, *(p+i)

Understand argument passing behavior (especially those involving pointers)2d Array implementationUsing function pointers in generic functions that deal with data of different types

Page 3: CS252: Systems Programming

Topic 2

Static vs. shared libraryProgram sections: text, stack, heap, data, especially in the context of software security

Page 4: CS252: Systems Programming

Topic 3: Unix Systems OverviewHard link vs soft linkProcesses, setuid, how effective/real/saved uid changes

Page 5: CS252: Systems Programming

Topic 4: Regular ExpressionsUnderstand what kind of strings are matched by a regular

expression

Able to write a regular expression to match certain sets of strings

Page 6: CS252: Systems Programming

Topic 5: Unix Tools

Know the basic functionality of the UNIX commands in the slidesShell programming not required for final exam.

Page 7: CS252: Systems Programming

Topic 6: Flex/Bison

Nothing in particular required for final exam

Page 8: CS252: Systems Programming

Topic 7: Project 3Write grammar for YACC.

What is an open file object? What information does it include?What is the semantics for pipe, dup, dup2, especially how they affect the creation/deletion and reference count of open file object?How to implement pipe and redirection using pipe, dup, dup2?

Page 9: CS252: Systems Programming

Topic 8: Kernel Mode, System Calls, etc.User mode vs kernel mode

Poling (synchronous) vs asynchronous

Page 10: CS252: Systems Programming

Topic 9: Processes and Scheduling

What are non-preemptive scheduling and preemptive scheduling? What are the pros & cons of each? Which one is used in modern OS?

How does the round robin scheduling work? How response time and overhead are affected by

quantum length? What are factors for choosing quantum length?

Response time, overhead, CPU burst distribution

Page 11: CS252: Systems Programming

Topic 10: Threads

Why one wants to use multiple threads?What are the pros and cons of using threads vs. processes?What is an atomic section? Why does disabling interrupt ensure atomicity on a single CPU machine?What is a mutex lock? What is the semantics of lock and unlock calls on a mutex lock?How to use mutex locks to achieve atomicity?

Page 12: CS252: Systems Programming

Topic 11

How to implement recursive mutex locks (part of Project 4)?What is a race condition? (When given simple codes, should be able to come up with race condition scenario.)What happens when calling sem_wait(), sem_post? (Should be able to produce pseudo-code.)Different usage of semaphore when initiating it with different values. What are the key difference between binary semaphore and mutex lock?How to implement a synchronized list? Why we need both mutex and semaphore?

Page 13: CS252: Systems Programming

Topic 12

What are Condition Variables? What is the behavior of wait/signal on CV?How to implement semaphores using using CV and Mutex?How to implement bounded buffer using semaphores?What is a deadlock? How to prevent deadlocks by enforcing a global ordering of locks? Why this prevents deadlocks?

Page 14: CS252: Systems Programming

Topic 12

What are read/write locks? What is the behavior of read/write lock/unlock?How to implement R/W locks using semaphore?Why the implementation given in the slides can cause writer starvation?How to Implement a read/write lock where writer is preferred (i.e., when a writer is waiting, no reader can gain read lock and must wait until all writers are finished)?

Page 15: CS252: Systems Programming

Topic 13, 14

Nothing required for final exam

Page 16: CS252: Systems Programming

Topic 15

Packet switching networkingLayered architecture (application, transport, network, link)Addresses & translation services

MAC, IP, Domain namesARP and DNS

Additional services of UDP over IP: port numberAdditional services of TCP over IP: port number

Reliable (achieved using acknowledgement and retransmission), connection-oriented communication

Page 17: CS252: Systems Programming

Topic 16: Socket Programming

Server calls: socket, bind, listen, and acceptBehavior of accept, returns a new socket

Client calls: socket, connect

Page 18: CS252: Systems Programming

Topic 17: Project 5

Implementing five types of server concurrencyIterative ServerFork Process After RequestCreate New Thread After RequestPool of ThreadsPool of Processes

Page 19: CS252: Systems Programming

Topic 18: SQL

Writing basic SQL SELECT queriesSELECT … FROM … WHERE

Joining tables when neededUsing tuple variables when needed

No need for DISTINCT, ORDER BYGive query result when given query and tablesINSERT, DELETE not covered in exam

Page 20: CS252: Systems Programming

Topic 19: Software Security

Able to identify the following vulnerabilities in code, and necessary inputs to exploit them

Input validation, buffer overflow, format string, integer overflow

Understand stack overflow exploit that overwrite return address to point to injected shell code, and return-to-libc attacksUnderstand basic idea and limitation of non-executable stack

Page 21: CS252: Systems Programming

Topic 20: Computer Security Basics

Understand basic security goals: confidentiality, integrity, availability