1 / 20

Lecture 10: Processes II-C

Lecture 10: Processes II-C. Address Space Services Drivers. Address Space. Process is given: Executable Code Global Data Heap Stack This is referred to as the process’ “address space”. Executable Code. Contains our binary code Is typically static in content

hertz
Download Presentation

Lecture 10: Processes II-C

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 10: Processes II-C • Address Space • Services • Drivers

  2. Address Space • Process is given: • Executable Code • Global Data • Heap • Stack • This is referred to as the process’ “address space”

  3. Executable Code • Contains our binary code • Is typically static in content • Self-modifiable code is dangerous! • Also has fixed size

  4. Global Data • Contains both initialized and uninitialized data • inti = 42; • char c; • Has fixed size

  5. Heap • Grows/shrinks as needed • New/delete (C++) • Malloc/free (C)

  6. Stack • Grows/shrinks as needed • Stores “history” of function calls

  7. Services • There are tasks that need to run in the background: • HTTP server software • Remote desktop software • Print servers • Anti-virus software • Windows  services • Linux  daemons

  8. Services • Usually intended to run for the “duration of the boot” • Usually run with elevated privileges • Required due to the nature of what they do

  9. Services • They are essentially just programs • Require… • …CPU time • …memory • …IO ports (sometimes)

  10. Services • Typically 100+ services running at a time • How do we have resources to do any of “our” stuff? • Minimize the resources • Most services are just infinite loop • Listen for input, then react • Sleep in the middle

  11. Services • How do we identify them? • Windows • Services tool • Linux • Usually end in a ‘d’ • E.g., httpd is the HTTP daemon • When do they start? • Some on start-up • Some “on-demand”

  12. “init” process • It’s the first process • Process ID is 1 • Handles all of the start-up tasks • Makes use of other scripts to accomplish this • Stays around while OS is alive and kicking • Handles the shutdown

  13. “init” process • Checks integrity of file systems • Check for devices and enable them • Allow terminal/GUI login • Generally, make sure things behave • Shut down the OS • Ask processes to stop • Kill all who ignore

  14. “init” process • This is “extreme hand waving” • Check PIDs of “latest” process once you login • In Windows, I was in the 5,000s

  15. Drivers • They’re kinda processes • They’re kinda not • Invoking ps will not show them • They listen for IO to/from devices • Upon getting IO, they act upon it • There’s a lot of information here • We’re going to avoid going too far* into the weeds *This is subjective

  16. /proc/interrupts

  17. /proc/partitions

  18. lsmod

  19. ls -a /dev

  20. sudoblkid

More Related