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
44
votes
7 answers

Who decides the sizeof any datatype or structure (depending on 32 bit or 64 bit)?

Who decides the sizeof any datatype or structure (depending on 32 bit or 64 bit)? The compiler or the processor? For example, sizeof(int) is 4 bytes for a 32 bit system whereas it's 8 bytes for a 64 bit system. I also read that sizeof(int) is 4…
Vishal-L
  • 1,307
  • 1
  • 9
  • 16
44
votes
4 answers

Java Threads vs OS Threads

Looks like I have messed up with Java Threads/OS Threads and Interpreted language. Before I begin, I do understand that Green Threads are Java Threads where the threading is taken care of by the JVM and the entire Java process runs only as a single…
Geek
  • 23,089
  • 20
  • 71
  • 85
44
votes
6 answers

Time waste of execv() and fork()

I am currently learning about fork() and execv() and I had a question regarding the efficiency of the combination. I was shown the following standard code: pid = fork(); if(pid < 0){ //handle fork error } else if (pid == 0){ …
Dean Leitersdorf
  • 1,303
  • 1
  • 11
  • 22
44
votes
6 answers

Why are malloc() and printf() said as non-reentrant?

In UNIX systems we know malloc() is a non-reentrant function (system call). Why is that? Similarly, printf() also is said to be non-reentrant; why? I know the definition of re-entrancy, but I wanted to know why it applies to these functions. …
ultimate cause
  • 2,264
  • 4
  • 27
  • 44
43
votes
6 answers

How do system calls work?

I understand that a user can own a process and each process has an address space (which contains valid memory locations, this process can reference). I know that a process can call a system call and pass parameters to it, just like any other library…
xyz
  • 8,607
  • 16
  • 66
  • 90
42
votes
15 answers

Problem with virtualenv in Mac OS X

I've installed virtualenv via pip and get this error after creating a new environment: selenium:~ auser$ virtualenv new New python executable in new/bin/python ERROR: The executable new/bin/python is not functioning ERROR: It thinks…
gigimon
  • 1,443
  • 2
  • 13
  • 19
42
votes
4 answers

How to implement a very simple filesystem?

I am wondering how the OS is reading/writing to the hard drive. I would like as an exercise to implement a simple filesystem with no directories that can read and write files. Where do I start? Will C/C++ do the trick or do I have to go with a more…
the_drow
  • 18,571
  • 25
  • 126
  • 193
42
votes
5 answers

What is the difference between DMA and memory-mapped IO?

What is the difference between DMA and memory-mapped IO? They both look similar to me.
brett
  • 5,379
  • 12
  • 43
  • 48
42
votes
2 answers

Do modern OS's use paging and segmentation?

I was reading about memory architecture and I got a bit confused with the paging and segmentation. I read that modern OS systems use only paging to manage memory access but looking at a disassembled codes I can see segments like "ds" and "fs". Does…
Dan
  • 1,059
  • 1
  • 9
  • 11
42
votes
6 answers

How is sleep implemented at the OS level?

I am just interested how sleep(time in ms) is implemented in a C library or basically at the OS level... I am guessing... May be the based on the processor speed you do a while loop of nop's (I am not sure if the sleep time will be accurate)... Any…
FatDaemon
  • 766
  • 2
  • 8
  • 13
41
votes
4 answers

What is the correct way to detect if ruby is running on Windows?

What is the correct way to detect from within Ruby whether the interpreter is running on Windows? "Correct" includes that it works on all major flavors of Ruby, including 1.8.x, 1.9.x, JRuby, Rubinius, and IronRuby. The currently top ranked Google…
John
  • 29,546
  • 11
  • 78
  • 79
41
votes
1 answer

I/O concept flush vs sync

I have come across these two terms and my understanding of them seem to overlap with each other. Flush is used with buffers and sync is used to talk about persisting changes of file to disk. In C, fflush(stdin) makes sure that the buffer is cleared.…
smartnut007
  • 6,324
  • 6
  • 45
  • 52
41
votes
3 answers

ExitCodes bigger than 255, possible?

If yes, on which operating system, shell or whatever? Consider the following java program (I'm using java just as an example, any language would be good for this question, which is more about operation systems): public class ExitCode { public…
Davide
  • 17,098
  • 11
  • 52
  • 68
41
votes
13 answers

Why does a 32-bit OS support 4 GB of RAM?

Just reading some notes in a purdue lecture about OSs, and it says: A program sees memory as an array of bytes that goes from address 0 to 2^32-1 (0 to 4GB-1) Why 4 GB?
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
41
votes
4 answers

Is it possible to create an operating system using Python?

Is it possible to make a minimalistic operating system using Python? I really don't want to get into low-level code like assembly, so I want to use a simple language like Perl, Python. But how?
Navweb
  • 685
  • 2
  • 7
  • 11