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.
13,901
questions
5663
votes
27
answers
3.7m
views
How do I create a directory, and any missing parent directories?
How do I create a directory at a given path, and also create any missing parent directories along that path? For example, the Bash command mkdir -p /path/to/nested/directory does this.
2018
votes
35
answers
1.4m
views
What is the difference between a process and a thread?
What is the technical difference between a process and a thread?
I get the feeling a word like 'process' is overused and there are also hardware and software threads. How about light-weight processes ...
990
votes
37
answers
676k
views
Difference between binary semaphore and mutex
Is there any difference between a binary semaphore and mutex or are they essentially the same?
957
votes
28
answers
522k
views
How to identify which OS Python is running on
What do I need to look at to see whether I'm on Windows or Unix, etc.?
631
votes
22
answers
472k
views
How do I programmatically determine operating system in Java?
I would like to determine the operating system of the host that my Java program is running programmatically (for example: I would like to be able to load different properties based on whether I am on ...
620
votes
13
answers
389k
views
What are file descriptors, explained in simple terms?
What would be a more simplified description of file descriptors compared to Wikipedia's? Why are they required? Say, take shell processes as an example and how does it apply for it?
Does a process ...
610
votes
28
answers
126k
views
What are some resources for getting started in operating system development? [closed]
One thing I've always wanted to do is develop my very own operating system (not necessarily fancy like Linux or Windows, but better than a simple boot loader which I've already done).
I'm having a ...
583
votes
4
answers
376k
views
What is private bytes, virtual bytes, working set?
I am trying to use the perfmon windows utility to debug memory leaks in a process.
This is how perfmon explains the terms:
Working Set is the current size, in bytes, of the Working Set of this ...
388
votes
36
answers
333k
views
Context.startForegroundService() did not then call Service.startForeground()
I am using Service Class on the Android O OS.
I plan to use the Service in the background.
The Android documentation states that
If your app targets API level 26 or higher, the system imposes ...
341
votes
12
answers
505k
views
What languages are Windows, Mac OS X and Linux written in?
I was just wondering who knows what programming languages Windows, Mac OS X and Linux are made up from and what languages are used for each part of the OS (ie: Kernel, plug-in architecture, GUI ...
338
votes
13
answers
235k
views
What resources are shared between threads?
Recently, I have been asked a question in an interview what's the difference between a process and a thread. Really, I did not know the answer. I thought for a minute and gave a very weird answer.
...
311
votes
4
answers
130k
views
How to run a program without an operating system?
How do you run a program all by itself without an operating system running?
Can you create assembly programs that the computer can load and run at startup, e.g. boot the computer from a flash drive ...
311
votes
18
answers
216k
views
How do I check OS with a preprocessor directive?
I need my code to do different things based on the operating system on which it gets compiled. I'm looking for something like this:
#ifdef OSisWindows
// do Windows-specific stuff
#else
// do Unix-...
290
votes
6
answers
214k
views
How do I check the operating system in Python?
I want to check the operating system (on the computer where the script runs).
I know I can use os.system('uname -o') in Linux, but it gives me a message in the console, and I want to write to a ...
288
votes
18
answers
419k
views
How to find the operating system details using JavaScript?
How can I find the OS name and OS version using JavaScript?
246
votes
6
answers
86k
views
Why is Linux called a monolithic kernel?
I read that Linux is a monolithic kernel. Does monolithic kernel mean compiling and linking the complete kernel code into an executable?
If Linux is able to support modules, why not break all the ...
223
votes
10
answers
240k
views
What is the difference between Trap and Interrupt?
What is the difference between Trap and Interrupt?
If the terminology is different for different systems, then what do they mean on x86?
213
votes
4
answers
130k
views
What specifically are wall-clock-time, user-cpu-time, and system-cpu-time in Unix?
I can take a guess based on the names, but what specifically are wall-clock-time, user-cpu-time, and system-cpu-time in Unix?
Is user-cpu time the amount of time spent executing user-code while kernel-...
203
votes
9
answers
109k
views
Programmatically get the cache line size?
All platforms welcome, please specify the platform for your answer.
A similar question: How to programmatically get the CPU cache page size in C++?
200
votes
5
answers
177k
views
What is the difference between user variables and system variables?
What is the difference between user variables such as PATH, TMP, etc. and system variables?
I accidentally deleted the user variable PATH. What am I supposed to do?
194
votes
18
answers
173k
views
Detect Windows version in .NET
How can I detect the Windows OS versions in .NET?
What code can I use?
190
votes
4
answers
28k
views
What happens when a computer program runs?
I know the general theory but I can't fit in the details.
I know that a program resides in the secondary memory of a computer. Once the program begins execution it is entirely copied to the RAM. Then ...
179
votes
5
answers
98k
views
How to get the PATH environment-variable separator in Python?
When multiple directories need to be concatenated, as in an executable search path, there is an os-dependent separator character. For Windows it's ';', for Linux it's ':'. Is there a way in Python ...
173
votes
13
answers
92k
views
PHP script - detect whether running under linux or Windows?
I have a PHP script that may be placed on a windows system or a linux system. I need to run different commands in either case.
How can I detect which environment I am in? (preferably something PHP ...
170
votes
13
answers
328k
views
How to detect my browser version and operating system using JavaScript?
I have tried using the code below but it only display results in Chrome and Mozilla not working in IE6.
<div id="example"></div>
<script type="text/javascript">
txt = "<p>...
170
votes
2
answers
247k
views
How do I set a Windows scheduled task to run in the background? [closed]
Does anyone know how to set a scheduled task to run in background using Windows Task Scheduler?
There doesn't seem to be any option to do this.
170
votes
5
answers
157k
views
How is TeamViewer so fast?
Sorry about the length, it's kinda necessary.
Introduction
I'm developing a remote desktop software (just for fun) in C# 4.0 for Windows Vista/7. I've gotten through basic obstacles: I have a robust ...
166
votes
16
answers
143k
views
What is the difference between the kernel space and the user space?
What is the difference between the kernel space and the user space? Do kernel space, kernel threads, kernel processes and kernel stack mean the same thing? Also, why do we need this differentiation?
160
votes
6
answers
29k
views
Why use Python's os module methods instead of executing shell commands directly?
I am trying to understand what is the motivation behind using Python's library functions for executing OS-specific tasks such as creating files/directories, changing file attributes, etc. instead of ...
160
votes
8
answers
119k
views
Conditional Variable vs Semaphore
When to use a semaphore and when to use a conditional variable?
156
votes
18
answers
206k
views
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(...
156
votes
11
answers
208k
views
What is an OS kernel ? How does it differ from an operating system? [closed]
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?
154
votes
7
answers
213k
views
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 ...
154
votes
13
answers
15k
views
How are everyday machines programmed? [closed]
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 ...
144
votes
6
answers
71k
views
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 ...
142
votes
6
answers
174k
views
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 ...
134
votes
12
answers
100k
views
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 ...
133
votes
3
answers
125k
views
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-...
133
votes
3
answers
119k
views
What is the difference between the operating system and the kernel? [closed]
I do not understand the difference between operating system and kernel. Can someone please explain it?
131
votes
11
answers
82k
views
Spinlock versus Semaphore
What are the basic differences between a semaphore & spin-lock?
When would we use a semaphore over a spin-lock?
130
votes
7
answers
239k
views
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?
125
votes
7
answers
103k
views
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 ...
123
votes
10
answers
117k
views
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 == ';'...
116
votes
20
answers
51k
views
How can I build a small operating system on an old desktop computer? [closed]
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 ...
111
votes
8
answers
194k
views
Get operating system info
I recently started wondering about sites like http://thismachine.info/ that get the user's operating system info. I have not been able to find out how to do that with PHP, and wanted to try to figure ...
111
votes
16
answers
293k
views
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?
102
votes
4
answers
64k
views
dup2 / dup - Why would I need to duplicate a file descriptor?
I'm trying to understand the use of dup2 and dup.
From the man page:
DESCRIPTION
dup and dup2 create a copy of the file descriptor oldfd. After successful return of dup or dup2, the old and new ...
99
votes
5
answers
93k
views
Call to operating system to open url?
What can I use to call the OS to open a URL in whatever browser the user has as default?
Not worried about cross-OS compatibility; if it works in linux thats enough for me!
98
votes
11
answers
44k
views
How can I find which operating system my Ruby program is running on?
I want my Ruby program to do different things on a Mac than on Windows. How can I find out on which system my program is running?
97
votes
1
answer
85k
views
What are atomic operations for newbies?
I am a newbie to operating systems and every answer I've found on Stackoverflow is so complicated that I am unable to understand. Can someone provide an explanation for what is an
atomic operation
...