COMP 3000 2012 Week 3 Notes

From Soma-notes
Revision as of 21:09, 20 September 2012 by Sdp (talk | contribs) (proper mediawiki footnote reference)

Shell

  • useful command line programs
    • bc -l
      • command line calculator
    • cal
      • command line calendar
    • uniq
      • filters out duplicate lines
    • sort
      • takes input on STDIN, sorts lines, prints to STDOUT
  • vmlinux is the linux kernel with virtual memory [vmlinux]
    • vmlinuz is the same but compressed
  • bash runs on vmlinux
    • most programs run on bash
    • ls/cd also run on vmlinux
    • ls runs as a child process of bash
  • to get rid of a misbehaving child
    • the parent must kill it
    • waits for child to die
    • an unreaped child becomes a zombie
    • zombies can't be killed, must be reaped
    • to kill a zombie, must kill parent
    • orphans become a child of init (ward of state)
    • init is good at reaping children

job control

  • job is a process
    • term comes from batch processing
  • Useful control sequences
    • Ctrl-C
      • terminate job
    • Ctrl-Z
      • stop job
  • To start a stopped job in the foreground
    • fg %n
      • where n is the job number
  • To start a stopped job in the background
    • bg %n
  • To determine jobs that are running
    • jobs
  • Who manages jobs?
    • the shell
    • built on kernel functionality

Why we're studying unix

  • all operating systems have basically the same architecture
  • windows is just a variation on unix
  • windows comes from vms
    • increment(vms) -> wnt

References

^ : https://en.wikipedia.org/wiki/Vmlinux