1 / 180

e cs150 Spring 2014 : Operating System #1: OS Architecture, Kernel, & Process

e cs150 Spring 2014 : Operating System #1: OS Architecture, Kernel, & Process. Dr. S. Felix Wu Computer Science Department University of California, Davis http://www.facebook.com/sfelixwu/ http://dsl.cs.ucdavis.edu/~wu/ecs150/. Operating Systems. ….where applications meet Hardware!!!.

eavan
Download Presentation

e cs150 Spring 2014 : Operating System #1: OS Architecture, Kernel, & Process

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. ecs150 Spring 2014:Operating System#1: OS Architecture, Kernel, & Process Dr. S. Felix Wu Computer Science Department University of California, Davis http://www.facebook.com/sfelixwu/ http://dsl.cs.ucdavis.edu/~wu/ecs150/ ecs150 Spring 2014

  2. Operating Systems ecs150 Spring 2014

  3. ….where applications meet Hardware!!! Applications…….. OS Hardware: CPUs/Memory/HDs/DVD/Wireless/Internet… ecs150 Spring 2014

  4. VM/MVS, DOS, Win95/98/ME/2000/XP, Freebsd/Linux, MacOS-10, Mach, Minix, PalmOS, uCOS, TinyOS, … ecs150 Spring 2014

  5. ecs150 Spring 2014

  6. ecs150 Spring 2014

  7. OS OS ecs150 Spring 2014

  8. OS OS TCP/IP, VPN, SSL/TLS/SSH ecs150 Spring 2014

  9. Realtime Hadoop Cluster Scribe MidTier Web Servers Scribe Writers MySQL Oracle RAC Hadoop Hive Warehouse http://hadoopblog.blogspot.com/2009/06/hdfs-scribe-integration.html ecs150 Spring 2014 9/9/2014

  10. OS OS OS TCP/IP, VPN, SSL/TLS/SSH ecs150 Spring 2014

  11. FB Friendship OS OS OS TCP/IP, VPN, SSL/TLS/SSH ecs150 Spring 2014

  12. 3rd Party Applications & Services (e.g. SINCERE.se) SIN API Social-aware OS Kernel Social Informatics CITRON crawler Application Plugins GENI API ecs150 Spring 2014

  13. ….where applications meet Hardware!!! Applications…….. OS Hardware: CPU/Memory/HD/DVD/Wireless… ecs150 Spring 2014

  14. ….where applications meet Hardware!!! Applications…….. OS Hardware: CPU/Memory/HD/DVD/Wireless… Multi-cores/Racks, Energy, Mobility, Social Informatics ecs150 Spring 2014

  15. FB-connect ecs150 Spring 2014

  16. ecs150 Spring 2014

  17. ecs150 Spring 2014

  18. Farmville and Facebook FB friends: 790+ FV neighbors: 30+ Justin neighbor Eric Felix The “Add me please” push!!! friend ecs150 Spring 2014

  19. This quarter (s2014+)…. • Internals of OS • design principles of OS • Modifying/implementing an OS • Map Reduce • Real-Time System • Social-aware OS ecs150 Spring 2014

  20. About the Instructor • S. Felix Wu • http://www.facebook.com/sfelixwu • Office: 2109 Watershed Science • Phone: 530-754-7070 • Office Hours: • 2-3 p.m. on Monday and Friday • by appointments ecs150 Spring 2014

  21. ecs150 Spring 2014

  22. ecs150 Spring 2014

  23. http://www.facebook.com/groups/ecs150/http://www.facebook.com/group.php?gid=72351301465http://www.facebook.com/groups/ecs150/http://www.facebook.com/group.php?gid=72351301465 ecs150 Spring 2014

  24. TA #1 • Darren Yuxi Hu darrenyxhu@gmail.com • Office Hours: TBA • Discussion: Fri 2:10~3:00 • 226 Wellman • TA office: TBA ecs150 Spring 2014

  25. TA #2 • Chun-Ming Tim Lai • Office Hours: TBA • Discussion: Fri 2:10~3:00 • 226 Wellman • TA office: TBA ecs150 Spring 2014

  26. TA #3 • Teng Jason Wang wangtengthu@gmail.com • Office Hours: TBA • Discussion: Fri 2:10~3:00 • 226 Wellman • TA office: TBA ecs150 Spring 2014

  27. about Web site • http://dsl.cs.ucdavis.edu/~wu/ecs150/ • the Facebook group • all lectures, notes, announcements, homework assignments, tools, papers will be there. ecs150 Spring 2014

  28. Textbook Reading this book itself may be a major challenge. But, you really learn when you go through this process! "The Design and Implementation of the FreeBSD Operating Systems" by Marshall Kirk McKusick and George V. Neville-NeilAddison Wesley Professional, 2005, ISBN 0-201-70245-2. http://www.freebsd.org/ ecs150 Spring 2014

  29. Prerequisites • Programming Languages: C and assembly (ecs50) • Date Structure (ecs110) and basic Computer Architecture (ecs154a/eec70). • ecs40 • Please talk to me if you have any concern. ecs150 Spring 2014

  30. Syllabus • Process/Kernel • File Systems • Midterm (May 1st, 2014) • Memory Systems • “Others” • Final (June, 2014) ecs150 Spring 2014

  31. OS Principles/Concepts • What is “kernel”? • What is the difference between a process and a thread? • What is the difference between user-level and kernel-level threads? • What is the difference between a system call and a library function call? • What are SJF, RR, Lottery, LRU, TLB, Second Chance? • How to do Mutual Exclusion? • What is the difference between deadlock prevention and avoidance? • What are the differences among hardware interrupt, hardware trap, and software trap? ecs150 Spring 2014

  32. OS • Let’s examine OS concepts in a realistic context: “FreeBSD” • Then, we can re-think those concepts…. • And, maybe you will realize later that some of the concepts are either “misleading” or “irrelevant” in certain context. ecs150 Spring 2014

  33. Principles vs. Practice • Ideas and Theories first, then we will go over some FreeBSD code segments. • You will need to learn FreeBSD internals for programming assignments!! • The first few discussion sessions will be dedicated to FreeBSD internals. • Most of the discussion sessions are very important and they will appear in the exams and homeworks. ecs150 Spring 2014

  34. Course Requirements • 50%: Programming Assignments • teamwork: 1~2 students (no more than 2!) • 4 Assignments (10%, 18%, 8%, 14%) • HW#1 and #2 out already • 16%: In-class open-book midterm • 32%: open-book final • 02%: Participation of Lectures and Discussion sessions. • Deducted if missed more than TWO sessions. ecs150 Spring 2014

  35. Grading • I will give +/- grades. • possible grading : • A: >= 92 A-: >= 89 B+: >= 85 • B: >= 82 B-: >= 79 C+: >= 75 • C: >= 72 C-: >= 69 D+: >= 65 • D: >= 62 D-: >= 59 ecs150 Spring 2014

  36. Grading • I will give +/- grades. • possible grading : • A: >= 90 A-: >= 87 B+: >= 83 • B: >= 80 B-: >= 77 C+: >= 73 • C: >= 70 C-: >= 67 D+: >= 63 • D: >= 60 D-: >= 57 ecs150 Spring 2014

  37. FreeBSD 5.4 • VMware HD image available: • http://dsl.cs.ucdavis.edu/~wu/FreeBSD_5.4/ ecs150 Spring 2014

  38. virtualization Unmodified Applications Unmodified OS (XP, Linux, Solaris, or, FreeBSD) Standard Full Virtualization Hardware ecs150 Spring 2014

  39. ecs150 Spring 2014

  40. Homeworks • Adding new system calls (KLD) • Process ID, FB ID, scheduling mode • Social-aware Lottery Scheduling • Intercepting File System calls • Also, IP address and FB identifiers • Enhancing Bit Torrent (Interactive Grading) ecs150 Spring 2014

  41. The Structure of OS • The Kernel • Processes and Threads • The System Call Interface ecs150 Spring 2014

  42. What is “kernel”? ecs150 Spring 2014

  43. Kernel • The basic OS services • Which services? What is it doing? • Let’s check a couple examples ecs150 Spring 2014

  44. ….what are the basic services? OS ecs150 Spring 2014

  45. FreeBSD Kernel: Services • Timer/clock, descriptor, process • Memory Management: paging/swapping • I/O control and terminal • File System • Inter-process communication • Networking ecs150 Spring 2014

  46. ecs150 Spring 2014

  47. Kernel of SVR2 of AT&T Unix User programs Libraries user trap System Call Interface File subsys Process Control Subsys. Inter-Process Communication Buffer cache kernel Scheduler Character block device drivers Memory Management Hardware Control hardware ecs150 Spring 2014

  48. Kernel & Processes • The concept of “application process” ecs150 Spring 2014

  49. Kernel and User Space Memory space for this process Process FOO program System call (or trap into the kernel) conceptually Process FOO in the Kernel System Call Kernel Resources (disk or IO devices) ecs150 Spring 2014

  50. Processes > ps PID TTY TIME CMD 2910 pts/4 0:00 tcsh > ps -ef UID PID PPID C STIME TTY TIME CMD root 0 0 0 Sep 25 ? 0:01 sched root 1 0 0 Sep 25 ? 0:00 /etc/init - root 2 0 0 Sep 25 ? 0:00 pageout root 3 0 0 Sep 25 ? 0:01 fsflush root 223 1 0 Sep 25 ? 0:00 /usr/lib/utmpd root 179 1 0 Sep 25 ? 0:00 /usr/sbin/cron root 273 1 0 Sep 25 ? 0:00 /usr/lib/saf/sac -t 300 root 56 1 0 Sep 25 ? 0:00 /usr/lib/devfsadm/devfseventd root 58 1 0 Sep 25 ? 0:00 /usr/lib/devfsadm/devfsadmd root 106 1 0 Sep 25 ? 0:00 /usr/sbin/rpcbind root 197 1 0 Sep 25 ? 0:01 /usr/sbin/nscd root 108 1 0 Sep 25 ? 0:00 /usr/sbin/keyserv root 168 1 0 Sep 25 ? 0:00 /usr/sbin/syslogd root 118 1 0 Sep 25 ? 0:00 /usr/lib/netsvc/yp/ypbind root 159 1 0 Sep 25 ? 0:00 /usr/lib/autofs/automountd ecs150 Spring 2014

More Related