Sample programs

Samples

  • Getting started in x86_64

    • hello.asm (printing a null-terminated string in x86_64 assembly language)
    • gdb_test.c (a recursive function to support gdb experimentation)
  • environment.c (two ways to access environment variables in C)
  • Process-related samples for command-shell assignment

  • Race conditions

    • race.c (shared memory and a simple race condition)
    • race_with_lock.c (a failed attempt to protect shared memory with a shared lock)
    • norace.c (protecting shared memory with a semaphore)