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
40
votes
3 answers

Try catch with locks in C++

In Java: Lock lock = new ReentrantLock(); try{ lock.lock(); someFunctionLikelyToCauseAnException(); } catch(e){...} finally { lock.unlock(); } My question is with this above example we know that the lock WILL always get unlocked because…
Brijendar Bakchodia
  • 1,567
  • 1
  • 9
  • 15
40
votes
3 answers

When should the option RemainAfterExit needs to be set true when creating new systemd services?

I am trying to write a few services. Some of them have 'type' option set to oneshot. But i am still confused when the option 'RemainAfterExit' needs to be set true. (not just that service needs to be active even after exiting).
Aditya Vardhan
  • 531
  • 1
  • 4
  • 7
40
votes
9 answers

Difference between physical/logical/virtual memory address

I am a little confused about the terms physical/logical/virtual addresses in an Operating System(I use Linux- open SUSE) Here is what I understand: Physical Address- When the processor is in system mode, the address used by the processor is…
gst
  • 1,251
  • 1
  • 14
  • 32
39
votes
3 answers

Is there a Python equivalent to the 'which' command

Put another way, is there a cross-platform way of knowing which file will be executed by subprocess.Popen(file) without first executing it?
Joe
  • 16,328
  • 12
  • 61
  • 75
39
votes
1 answer

Data structures used to build file systems?

What Data Structure is best to use for file organization? Are B-Trees the best or is there another data structure which obtains faster access to files and good organization? Thanks
Bernice
  • 2,552
  • 11
  • 42
  • 74
39
votes
12 answers

What parts of Linux kernel can I read for fun?

Programming isn't my main job, though I enjoy it and sometimes get paid for it. For many years now I've been hearing about Linux and my friends have shown to me many *nixes (or *nici?), though I stick with Mac OS. Do you think there are any parts of…
ilya n.
  • 18,398
  • 15
  • 71
  • 89
38
votes
8 answers

How come a file doesn't get written until I stop the program?

I'm running a test, and found that the file doesn't actually get written until I control-C to abort the program. Can anyone explain why that would happen? I expected it to write at the same time, so I could read the file in the middle of the…
Marvin K
  • 437
  • 1
  • 5
  • 11
38
votes
7 answers

jQuery/Javascript to detect OS without a plugin?

I am looking for a way to detect the OS for a downloads page using jQuery or Javascript to recommend specific files for Mac vs Windows. I was hoping to do it without adding another plugin to my page.
Tim Withers
  • 12,072
  • 5
  • 43
  • 67
38
votes
9 answers

Are there any macros to determine if my code is being compiled to Windows?

I would like to detect whether the OS I'm compiling on is Windows. Is there a simple macro I can check to verify that?
batty
  • 7,528
  • 9
  • 31
  • 30
38
votes
6 answers

What's the difference between operating system "swap" and "page"?

What is the difference between these 2 terms in Operating System: swap and page?
user188276
38
votes
17 answers

Create file but if name exists add number

Does Python have any built-in functionality to add a number to a filename if it already exists? My idea is that it would work the way certain OS's work - if a file is output to a directory where a file of that name already exists, it would append a…
Parham
  • 3,157
  • 4
  • 31
  • 44
37
votes
5 answers

Can't understand Belady's anomaly

So Belady's Anomaly states that when using a FIFO page replacement policy, when adding more page space we'll have more page faults. My intuition says that we should less or at most, the same number of page faults as we add more page space. If we…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
37
votes
4 answers

Historical reason behind different line ending at different platforms

Why did DOS/Windows and Mac decide to use \r\n and \r for line ending instead of \n? Was it just a result of trying to be "different" from Unix? And now that Mac OS X is Unix (-like), did Apple switch to \n from \r?
Imran
  • 87,203
  • 23
  • 98
  • 131
37
votes
3 answers

How do sites like codepad.org and ideone.com sandbox your program?

I need to compile and run user-submitted scripts on my site, similar to what codepad and ideone do. How can I sandbox these programs so that malicious users don't take down my server? Specifically, I want to lock them inside an empty directory and…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
37
votes
4 answers

Why do we need virtual memory?

So my understanding is that every process has its own virtual memory space ranging from 0x0 to 0xFF....F. These virtual addresses correspond to addresses in physical memory (RAM). Why is this level of abstraction helpful? Why not just use the direct…
Collin
  • 1,777
  • 4
  • 26
  • 42