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
5
votes
1 answer

readdir returning dirent with d_type == DT_UNKNOWN for directories . and

I have the following code that mimicks ls: #include #include char* dirent_type_to_str(unsigned char dirent_type) { switch (dirent_type) { case DT_DIR: return "Dir "; case DT_REG: return "File"; } …
James Ko
  • 32,215
  • 30
  • 128
  • 239
5
votes
1 answer

What happens when an unligned write crosses a page boundary and a fault is triggered?

Let's say a 32-bit value is written to a memory location which spans 2 pages. For the sake of the argument let's assume 2 bytes end up in the first page and 2 more in the second one. The first page is writable, but the second page is unmapped.…
alexp
  • 811
  • 4
  • 10
5
votes
2 answers

How to detect the active application using C/java?

I want to record the active application and save a history of my active applications. I say active application because if I run an application and It's minimized, etc I would not count it as an active application. In order to make my question more…
Amiri
  • 2,417
  • 1
  • 15
  • 42
5
votes
4 answers

Java - use of volatile only makes sense in multiprocessor systems?

Use of volatile only makes sense in multiprocessor systems. is this wrong? i'm trying to learn about thread programming, so if you know any good articles/pdfs ... i like stuff that mentions a bit about how the operating system works as well not just…
fabio
  • 2,269
  • 5
  • 22
  • 34
5
votes
2 answers

What happens to open files which are not properly closed?

What happens if I do not close a file after writing to it? Let us assume we got an too many open files error and due to that the program crashes. Does the OS handle that for me? And if this damages the not-closed files, how do I notice that they…
Michael Dorner
  • 17,587
  • 13
  • 87
  • 117
5
votes
2 answers

In Python, without using the /proc filesystem, how do I tell if a given PID is running?

Say I have a PID, like 555. I want to see if that pid is running or has completed. I can check /proc/ but I don't have access to that in my production environment. What's the best way to do this, short of something hackish like opening a pipe to…
Ken Kinder
  • 12,654
  • 6
  • 50
  • 70
5
votes
3 answers

How to set ss and sp registers correctly in i386

I am currently writing a bootloader and have begun to run out of space in my 512B, so I have begun writing more code outside the 512B and intend to use the bootloader to read it into memory. I have added to the end of my code: stack_start: resb…
WORD_559
  • 331
  • 1
  • 14
5
votes
1 answer

Assembly instructions to switch the CPU to user mode and to kernel mode?

Based on my understanding, when an interrupt is fired, the CPU will switch to kernel mode, and when the interrupt is handled, the operating system will switch the CPU back to user mode. Now my questions are: How did the operating system switch the…
rony_t
  • 413
  • 4
  • 9
5
votes
1 answer

Interprocess communication via Pipes

It is known that during Interprocess Communication in Linux, the processes communicate with each other through a special file named as "Pipe". It is also known that the the operations performed on that file is write by one process and read by one…
HarshitMadhav
  • 4,769
  • 6
  • 36
  • 45
5
votes
2 answers

What do PGROUNDUP and PGROUNDDOWN in xv6 mean?

In xv6 mmu.h file, there are these 2 lines of code #define PGROUNDUP(sz) (((sz)+PGSIZE-1) & ~(PGSIZE-1)) #define PGROUNDDOWN(a) (((a)) & ~(PGSIZE-1)) What do they do?
K.Wu
  • 3,553
  • 6
  • 31
  • 55
5
votes
1 answer

Why java is also a system/OS name(help doc in python)?

I'm searching a method in python to show me the platform details. So I find platform.system(), but I got shock when I saw the help doc: system() Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'. Any idea on why 'Java' is listed there…
Yarco
  • 763
  • 9
  • 18
5
votes
2 answers

Java's or C#'s Threads are based on User-Space Threads or Kernel-Space Threads?

Are Java's and C#'s Threads based on User-Space Threads or Kernel-Space Threads?
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
5
votes
4 answers

python bytecode, the interpreter and virtual machine

This is a really vast question and I'm mostly looking for resources where I can learn more about the following. I know the python interpreter is written in C and produces bytecode to be run on the python virtual machine also written in C (right?).…
Falmarri
  • 47,727
  • 41
  • 151
  • 191
5
votes
7 answers

understanding the need for compilers for different platforms

I am trying to learn how the whole build chain works so I can better understand what goes on when I do build/link/compile etc. One point I am having trouble with is this: If the compiler turns the source into native assembly, why can't the same…
Baruch
  • 20,590
  • 28
  • 126
  • 201
5
votes
1 answer

What is the difference between routine and process

I am studying memory management in operating system and in general context i just want to know is there any difference between routine and process. Thanks in advance