Questions tagged [operating-system]

An operating System (OS) is a software program whose role is to be an abstract layer between software requisitions for resources and the hardware available, manage input/output, memory allocation/deallocation, file systems, among other basic tasks a device (not necessarily a computer) should do.

An operating system (OS) is a basic software whose role is to be an abstract layer between software requisitions for resources and the hardware available. The basic components of an operational system can be listed as:

  • Boot loader

Although some may say it is not part of the OS, it's the starting point where the hardware after doing booting routines transfers the control to a small procedure that will bring up the entire system

  • User interface

Can be graphical or text-based, is the central point of communication between the user and the OS

  • Kernel

The core of the OS that manages all the resources of the hardware according to the requisitions. Kernels can be either a micro kernel or a monolithic kernel. Both types include the following functionality:

  • Process management (scheduling, multitasking, pseudo-parallelism, and so on)
  • Memory (and virtual memory) management
  • Inter-process communications (IPC)
  • Interrupt management

Monolithic kernels include these additional features:

  • File system and disk access organization
  • Device management (with the aid of device drivers, plug-and-play routines, dynamic modules, and so on)

These features are not included directly in a micro-kernel, but are instead implemented in tasks. One example of a fairly widely used micro-kernel is QNX. As well, many hypervisors are micro kernel designs. A major argument for micro-kernels is that their small size makes them easier to analyze and more secure.Tanenbaum

Most well known operating systems are monolithic. In fact, the majority of commercial and Open source OS's are monolithic. Generally they allow faster hardware response.

Book : Operating System Concepts by Abraham Silberschatz

Recommended preliminary reading before posting a question: OSDev Wiki

See also: .

13710 questions
156
votes
11 answers

What is an OS kernel ? How does it differ from an operating system?

I am not able to understand the difference between a kernel and an operating system. I do not see any difference between them. Is the kernel an operating system?
Xinus
  • 29,617
  • 32
  • 119
  • 165
154
votes
13 answers

How are everyday machines programmed?

How are everyday machines (not so much computers and mobile devices as appliances, digital watches, etc) programmed? What kind of code goes into the programming of a Coca-Cola vending machine? How does my coffee maker accept a pre-programmed time…
Josh Leitzel
  • 15,089
  • 13
  • 59
  • 76
152
votes
18 answers

python: get directory two levels up

Ok...I dont know where module x is, but I know that I need to get the path to the directory two levels up. So, is there a more elegant way to do: import os two_up = os.path.dirname(os.path.dirname(__file__)) Solutions for both Python 2 and 3 are…
jramm
  • 6,415
  • 4
  • 34
  • 73
151
votes
7 answers

C/C++ maximum stack size of program on mainstream OSes

I want to do DFS on a 100 X 100 array. (Say elements of array represents graph nodes) So assuming worst case, depth of recursive function calls can go upto 10000 with each call taking upto say 20 bytes. So is it feasible means is there a possibility…
avd
  • 13,993
  • 32
  • 78
  • 99
141
votes
6 answers

When to use os.name, sys.platform, or platform.system?

As far as I know, Python has 3 ways of finding out what operating system is running on: os.name sys.platform platform.system() Knowing this information is often useful in conditional imports, or using functionality that differs between platforms…
ztangent
  • 1,811
  • 2
  • 14
  • 11
139
votes
6 answers

What are the differences between virtual memory and physical memory?

I am often confused with the concept of virtualization in operating systems. Considering RAM as the physical memory, why do we need the virtual memory for executing a process? Where does this virtual memory stand when the process (program) from the…
131
votes
3 answers

What is the difference between the operating system and the kernel?

I do not understand the difference between operating system and kernel. Can someone please explain it?
gani
  • 1,327
  • 2
  • 9
  • 3
131
votes
11 answers

Spinlock versus Semaphore

What are the basic differences between a semaphore & spin-lock? When would we use a semaphore over a spin-lock?
Ankit Singh
  • 2,602
  • 6
  • 32
  • 44
130
votes
12 answers

Determining Whether a Directory is Writeable

What would be the best way in Python to determine whether a directory is writeable for the user executing the script? Since this will likely involve using the os module I should mention I'm running it under a *nix environment.
illuminatedtiger
  • 1,531
  • 3
  • 12
  • 8
130
votes
7 answers

What is the difference between user and kernel modes in operating systems?

What are the differences between User Mode and Kernel Mode, why and how do you activate either of them, and what are their use cases?
Alex
  • 75,813
  • 86
  • 255
  • 348
130
votes
3 answers

How to check if file is a symlink in Python?

In Python, is there a function to check if a given file/directory is a symlink? For example, for the below files, my wrapper function should return True. # ls -l total 0 lrwxrwxrwx 1 root root 8 2012-06-16 18:58 dir -> ../temp/ lrwxrwxrwx 1 root…
Bandicoot
  • 3,811
  • 7
  • 35
  • 39
119
votes
9 answers

How to reliably detect os/platform in Go

Here's what I'm currently using, which I think gets the job done, but there's got to be a better way: func isWindows() bool { return os.PathSeparator == '\\' && os.PathListSeparator == ';' } As you can see, in my case all I need to know is how…
Michael Whatcott
  • 5,603
  • 6
  • 36
  • 50
119
votes
7 answers

Which is more efficient, basic mutex lock or atomic integer?

For something simple like a counter if multiple threads will be increasing the number. I read that mutex locks can decrease efficiency since the threads have to wait. So, to me, an atomic counter would be the most efficient, but I read that…
Matt
  • 1,199
  • 2
  • 8
  • 3
116
votes
20 answers

How can I build a small operating system on an old desktop computer?

This might be in vain, as I know writing an operating system is unbearably complicated (especially by oneself). I don't expect to build the next linux, or windows. I know it will be horrible, and buggy, and won't work, but that's fine. I want to…
Carson Myers
  • 37,678
  • 39
  • 126
  • 176
111
votes
16 answers

How do I check CPU and Memory Usage in Java?

I need to check CPU and memory usage for the server in java, anyone know how it could be done?
Johnny Bou
  • 1,123
  • 2
  • 8
  • 6