What exactly are primitives in the context of an operating system? Here is the problem I am trying to figure out: "What are the two main functions of an operating system?" Here is the answer: "The two main functions of an operating system are managing system resources and providing application programs with a set of primitives that provide higher-level services." I can't find an explanation online because I think there are various usages of the same word. Also, I would appreciate if someone could give me several examples of primitives (in this context).
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I know that, for example, primitives in the Java programming language are the “axiomatic objects” or “quantized objects” to kind of use mathematical or scientific nomenclature. What I mean by the two terminologies I just used is that objects are composed of primitives but primitives are the lowest in the hierarchy so they just are themselves. Any input would be greatly appreciated! Thanks in advance!
The OS kernel also manages access to those system resources by applications. The so-called primitives provided by the OS are things like interfaces for system calls, like when a program calls `fopen()' it is invoking the OS's C library implementation.
Another example is the windows api: http://en.wikipedia.org/wiki/Windows_api_function_list
Not the answer you are looking for? Search for more explanations.
You may know this but lets me begin with the primitives of communication: SEND, RECEIVE. These primitives are the basics that tell the OS how to establish and use a connection. A programmer need not be bothered with the low level coding i.e ASM coding to define how the OS is supposed to do this. You simply can make use of the primitives provided to send/receive a file. Concept of primitives in java/c and primitives in an OS are a little different. Primitives in an OS are basically accessed via API's cause a primitive directly interacts with the hardware and uneducated use of primitives will be harmful to the system. The primitives of an OS in terms of memory management would technically be something like READ, WRITE. Within these primitives would be the code for the OS & Hardware specific instructions to access the memory cells. The primitives of an OS for Process Control would technically be something like: CREATE, SUSPEND, ACTIVATE, DESTROY but this is done by the kernel cause it's safer that way or you can say that these primitives are accessed by system calls (from the top of my head i'd say creating a handle for a process) but to reach this, we still need to go to the API of the OS. Providing programs with a set of primitives relieves the programmer from his duties of actually loading a program in memory, linking it with the kernel (for execution) and managing it (this would require complex logic and coding as well as making sure other resources remain secure) I'm sorry but i can't give an actual list of operating system primitives but this is what it is in a simple sense.
Link to the primitives in Assembler language: http://www.jegerlehner.ch/intel/IntelCodeTable.pdf
Using these you can make up code that makes things simplified and "higher-level" as they say. Not sure about it.
Thanks to everyone. You've all said something useful but agdgdgdgwngo's answer hit the fundamental issue of the problem I was having.