Ask your own question, for FREE!
Computer Science 77 Online
OpenStudy (s3a):

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).

OpenStudy (s3a):

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!

OpenStudy (anonymous):

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.

OpenStudy (anonymous):

Another example is the windows api: http://en.wikipedia.org/wiki/Windows_api_function_list

OpenStudy (anonymous):

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.

OpenStudy (anonymous):

Link to the primitives in Assembler language: http://www.jegerlehner.ch/intel/IntelCodeTable.pdf

OpenStudy (anonymous):

Using these you can make up code that makes things simplified and "higher-level" as they say. Not sure about it.

OpenStudy (s3a):

Thanks to everyone. You've all said something useful but agdgdgdgwngo's answer hit the fundamental issue of the problem I was having.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!