______ In-class notes for 08/28/2020 (CS 273 (OS), Fall 2020)
Home
>>     < >




In-class notes for 08/28/2020

CS 273 (OS), Fall 2020

Submitted questions on assignments and technology

  • Use this form to submit questions for a future class meeting

Programming with system calls (mopen)

Selected Linux system calls

Selected Linux system calls

  • More file-related system calls

    dup(), pipe(), etc.

    • Each process has a kernel file descriptor array, with file descriptor as index and pointer to open-file data structures as values.

  • System calls for file systems, i.e., OS components that contain files and directories

    mount(), umount(), etc.

Other components of an OS besides file system

  • Devices

    • ioctl(), for setting parameters for an I/O (input-output) device (will return for code illustration)

    • Berkeley socket calls, for network I/O (will return later)

    • Specialized device calls, e.g., time-related calls for interacting with clock device (will return)

  • Memory management

    • brk(), sbrk(), for adjusting how much main memory is allocated to a process.

  • Process management system calls

    • fork(), execve(), exit(), wait(), waitpid()

    • Example code: ~rab/os/egs/forkeg.c

      (fork(), execve(), and wait() implement the key ideas in the Linux strategy for starting new programs.)

    • zombie process -- process called exit(), but its parent hasn't called wait() for it to collect its exit status, so that exited process continues to take up OS resources.

Process diagrams for describing system calls

  • Inclass examples:

    1. uniq file.out > myfile2
      
    2. uniq < file.out > myfile2
      
    3. sort myfile | uniq  > myfile2
      
    4. sort < myfile | uniq  >> myfile2
      

Shell project assignment

Reading questions




< >