Skip to content

GongHening/Introduction-to-Computer-System-2025-Fall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to Computer System

This is the repository of my labs in Introduction to Computer System course, 2025 Fall.

Overview

This repository contains implementations and solutions for the CS:APP (Computer Systems: A Programmer's Perspective) labs from Carnegie Mellon University, which have been modified by Peking University. These labs are designed to help students understand the fundamental concepts of computer systems, including data representation, machine-level programming, processor architecture, program optimization, memory hierarchy, and network programming.

Labs

1. Data Lab

Topic: Bit Manipulation and Integer/Floating-Point Operations

  • Implement various bit-level operations and integer/floating-point manipulations
  • Understand two's complement representation and IEEE 754 floating-point format
  • Practice with bitwise operators and logical operations

2. Bomb Lab

Topic: Reverse Engineering and Assembly Language

  • Defuse a "binary bomb" by analyzing assembly code
  • Understand x86-64 assembly language and calling conventions
  • Practice with debugging tools (GDB) and reverse engineering techniques

3. Attack Lab

Topic: Buffer Overflow and Code Injection Attacks

  • Understand stack-based buffer overflow vulnerabilities
  • Implement code injection attacks
  • Learn about return-oriented programming (ROP) techniques
  • Understand stack protection mechanisms

4. Cache Lab

Topic: Cache Memory Hierarchy and Optimization

  • Implement a cache simulator
  • Optimize matrix transpose operations for cache performance
  • Understand cache organization, associativity, and replacement policies
  • Analyze cache hit/miss patterns

5. Arch Lab

Topic: Processor Architecture and Y86-64 Instruction Set

  • Implement Y86-64 instruction set architecture
  • Build a pipelined processor simulator
  • Understand instruction execution stages and pipeline hazards
  • Optimize processor performance

6. Shell Lab

Topic: Process Control and Signal Handling

  • Implement a Unix shell with job control
  • Handle process creation, termination, and signal management
  • Implement foreground/background job execution
  • Understand process groups and terminal control

7. Malloc Lab

Topic: Dynamic Memory Allocation

  • Implement a dynamic memory allocator (malloc, free, realloc)
  • Design and implement explicit or implicit free list allocators
  • Optimize for throughput and memory utilization
  • Handle heap fragmentation

8. Proxy Lab

Topic: Network Programming and Concurrent Web Proxy

  • Implement a concurrent HTTP/1.0 web proxy server
  • Handle multiple concurrent connections using threads
  • Implement LRU (Least Recently Used) cache for web objects
  • Parse and forward HTTP requests and responses
  • Support binary data and proper error handling

Getting Started

Each lab directory contains:

  • Lab handout files (PDF instructions)
  • Source code and skeleton files
  • Test scripts and drivers
  • README files with specific instructions

To work on a lab:

  1. Navigate to the lab directory
  2. Read the lab PDF for detailed instructions
  3. Implement the required functionality
  4. Test using provided test scripts
  5. Submit according to course requirements

Technologies & Tools

  • Languages: C, x86-64 Assembly, Y86-64 Assembly
  • Tools: GCC, GDB, Valgrind, Make
  • Concepts:
    • Bit manipulation
    • Assembly language
    • Process control
    • Memory management
    • Network programming
    • Concurrent programming
    • Cache optimization

Notes

  • All code follows the CS:APP textbook conventions
  • Solutions are implemented from scratch based on lab requirements
  • Code includes proper error handling and robustness considerations
  • Some labs may include additional optimizations beyond basic requirements

License

See LICENSE file for details.

Acknowledgments

  • Course: Introduction to Computer System, Peking University, 2025 Fall
  • Textbook: Computer Systems: A Programmer's Perspective (3rd Edition)
  • Labs: Peking University ICS Labs

Special Thanks

I would like to express my sincere gratitude to:

  • Instructors: Junlin Lu - for his excellent teaching and guidance throughout the course
  • Teaching Assistants: Enbo Wang - for his patient help, detailed feedback, and support during the labs

Their dedication and expertise have been invaluable in helping me understand the fundamental concepts of computer systems.


Last updated: 2025

About

Labs of ICS course.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors