{"id":171,"date":"2020-08-18T19:23:47","date_gmt":"2020-08-18T20:23:47","guid":{"rendered":"http:\/\/www.linux-tutorial.info\/?page_id=77"},"modified":"2020-08-22T19:26:17","modified_gmt":"2020-08-22T20:26:17","slug":"this-is-the-page-title-toplevel-5","status":"publish","type":"page","link":"http:\/\/www.linux-tutorial.info\/?page_id=171","title":{"rendered":"Operating System Layers"},"content":{"rendered":"\n<title>Operating System Layers<\/title>\n<p>\nConceptually, the Linux <glossary>operating system<\/glossary>\nis similar to an onion. It consists of many layers, one on top of the other. At the very core is the\ninterface with the hardware.  The operating system must know how to communicate with the hardware or\nnothing can get done. This is the most privileged aspect of the operating system.\n<\/p>\n<question id=\"18\" text=\"Linux accesses hardware through\" \/>\n<question id=\"475\" text=\"Because a device driver needs to be sure that it has properly completed its task, it cannot quit until it has finished.\" \/>\n<concept id=\"214\" description=\"Because a device driver needs to be sure that it has properly completed its task, it usually cannot quit until it has finished.\" \/>\n<p>\nBecause it needs to access the hardware directly, this part of the <glossary>operating system<\/glossary>\nis the most powerful as well as the most dangerous. What accesses the hardware is a set of\nfunctions within the operating system itself (the kernel) called <em>device drivers<\/em>. If it does\nnot behave correctly, a <glossary>device driver<\/glossary> has the potential of wiping out data on\nyour hard disk  or &#8220;crashing&#8221; your system. Because a device driver needs to be sure that it has\nproperly completed its task (such as accurately writing or reading from the hard disk), it cannot\nquit until it has finished. For this reason, once a driver has started, very little can get it to\nstop. We&#8217;ll talk about what can stop it in the section on the <glossary>kernel<\/glossary>.\n<\/p>\n<p>\nAbove the <glossary>device driver<\/glossary>\nlevel is what is commonly thought of when talking about the <glossary>operating system<\/glossary>,\nthe management functions. This is where the decision is made about what gets run and when, what\nresources are given to what process, and so on.\n<\/p>\n<p>\nIn our <tutorial id=3>previous discussion on processes<\/tutorial>, we\ntalked about having several different processes all in memory at the same time. Each gets a turn\nto run and may or may not get to use up its <glossary>time slice<\/glossary>.  It is at this level that the\n<glossary>operating system<\/glossary>\ndetermines who gets to run next when your time slice runs out, what should be done when an\n<glossary>interrupt<\/glossary> comes in, and where it keeps track of the events on which a sleeping\nprocess may be waiting. It&#8217;s even the alarm clock to wake you up when you&#8217;re sleeping.\n<\/p>\n<question id=\"476\" text=\"What functions are typically considered 'the operating system'.\" \/>\n<p>\nThe actual processes that the <glossary>operating system<\/glossary>\nis managing are at levels above the operating system itself. Generally, the first of these levels is\nfor programs  that interact directly with the operating system, such as the various shells. These\ninterpret the commands and pass them along to the operating system for execution. It is from the\n<glossary>shell<\/glossary> that you usually start\n<glossary>application<\/glossary> programs such as\nword processors, databases, or compilers. Because these often rely on other programs that interact\ndirectly with the operating system, these are often considered a separate level. This is how the\ndifferent levels (or layers) might look like graphically:<\/p>\n<p>\n<a onclick=\"opennew('{3f0b0cf5c640d99e599990c4a720721a04ec3a009b1323dd81fc335ceb655a63}{3f0b0cf5c640d99e599990c4a720721a04ec3a009b1323dd81fc335ceb655a63}CURRENT_DIRECTORY{3f0b0cf5c640d99e599990c4a720721a04ec3a009b1323dd81fc335ceb655a63}{3f0b0cf5c640d99e599990c4a720721a04ec3a009b1323dd81fc335ceb655a63}\/oslayera.gif',253,665)\" >\n<img loading=\"lazy\" decoding=\"async\" src=\"oslayerc.gif\" width=\"665\" height=\"253\" border=\"0\" usemap=\"#oslayer_map\">\n<\/a>\n<map name=oslayer_map>\n<area shape=\"RECT\" coords=\"257,88,400,136\" href=\"popup#OS layers#At the lowest level is the physical hardware.\">\n<area shape=\"RECT\" coords=\"184,70,463,170\" href=\"popup#OS layers#Device drivers talk directly to the physical hardware.\">\n<area shape=\"RECT\" coords=\"141,54,497,202\" href=\"popup#OS layers#The shell, as well as many applications talk to the device drivers, but not directly to the hardware.\">\n<area shape=\"RECT\" coords=\"3,2,662,247\" href=\"popup#OS layers#Although started by the shell or the operating system itself, applications, commands, system daemons and so forth do not talk directly to the hardware.\">\n<\/map>\n<p>\n<icaption>Image &#8211; Operating system layers. (<b>interactive<\/b>)<\/icaption>\n<\/p>\n<p>\nIf you are running Linux with a graphical interface (e.g. the <glossary>X<\/glossary>\nWindowing System), you have an additional layer. Your <glossary>shell<\/glossary>\nmight start the graphical interface, which then\nstarts the other programs and applications as we discussed.\n<\/p>\n<p>\nUnder Linux, there are many sets of programs that serve\ncommon functions. This includes things like mail or printing.\nThese groups of related programs are referred to as &#8220;System Services&#8221;,\nwhereas individual programs such as vi or fdisk are referred to as utilities.\nPrograms that perform a single function such as ls or date are typically\nreferred to as commands.\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Operating System Layers Conceptually, the Linux operating system is similar to an onion. It consists of many layers, one on top of the other. At the very core is the interface with the hardware. The operating system must know how &hellip; <a href=\"http:\/\/www.linux-tutorial.info\/?page_id=171\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-171","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=171"}],"version-history":[{"count":1,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/171\/revisions"}],"predecessor-version":[{"id":644,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/171\/revisions\/644"}],"wp:attachment":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}