Questions tagged [operating-systems]

Questions about the principles of software that interfaces between hardware and applications.

782 questions
38
votes
7 answers

Does an Operating System inject its own machine code when you open a program?

I'm studying CPU's and I know how it reads a program from the memory and execute its instructions. I also understand that an OS separates programs in processes, and then alternate between each one so fast that you think that they're running at the…
Revering Sumoda
  • 457
  • 6
  • 8
20
votes
7 answers

Difference between bare metal hypervisor and operating system

I'm currently studying virtualization and while looking at hypervisors I realized that bare metal hypervisors are quite similar to operating systems. So while from an application standpoint they are different, can an operating system theoretically…
fipps omat
  • 301
  • 2
  • 3
18
votes
4 answers

How can the Operating System run on the same chip it is supposed to be managing?

From my readings about Operating Systems (reading the basic material on Wikipedia, tech sites, etc) I've learned that the Operating System is a program that allows programs and applications to interact with the hardware in an efficient and safe…
CodyBugstein
  • 2,957
  • 10
  • 30
  • 45
14
votes
2 answers

Do system calls always means a context switch?

When a system call takes place some kernel code must be executed. If some kernel code is being executed it means it can alter register values. So before this code gets executed the old process state must be saved. This is called context switch. Now…
Kishan Kumar
  • 705
  • 1
  • 8
  • 23
11
votes
4 answers

What's the difference between user registers and kernel registers?

I am reading Operating Systems: Three Easy Pieces, but I can't fully understand the following paragraph. It's from the 6th chapter of the book. I think it's self-contained, so I quote here. Note that there are two types of register saves/restores…
Bicheng
  • 225
  • 2
  • 7
6
votes
2 answers

Why can't I run a mac program natively on windows?

Basically, I believe that if you have something like a .dmg file the OS opens it with a certain program which takes the code behind it and does things to it. So why couldn't you then take the program that runs the .dmg file on Mac and put it on…
rajlego
  • 169
  • 1
  • 4
6
votes
2 answers

Why is copy speed periodic? (or seems to be)

When copying ~80Gb data from one USB 3.2 stick to another, i noticed that the GUI of the transfer speed had clear periodicity. Out of curiosity, what could be the reason for this? No other active programs were running that, to my awareness, should…
Paamand
  • 163
  • 5
5
votes
3 answers

Is Everything a Hardware Interrupt?

Just need a little help understanding hardware interrupts. As I understand (feel free to correct) a hardware interrupts occurs when hardware wants attention of the computer. In basic terms the hardware sends a message down the interrupt line which…
4
votes
2 answers

What's the difference between Process Context and Process Control Block?

I know that Process Context is something that is stored when a process is preempted, containing all the necessary info to restart the process at a later time. I also know that the Process Control Block(PCB) contains all the necessary attributes of…
Somenath Sinha
  • 345
  • 4
  • 11
4
votes
1 answer

Can starvation occur with interrupts?

The Computer Science text book I own describes how an interrupt is handled in an operating system: At some point at the end of an instruction the processor checks if there are any outstanding interrupts If there are, the priority of the present…
Dopa
  • 43
  • 3
4
votes
1 answer

How does an Operating System without kernel mode work?

Andrew S. Tanenbaum, in his book Modern Operating Systems (3rd Edition), states that the distinction between operating system software and normal (user mode) software can sometimes be blurred in embedded systems (which may not have a kernel…
Matti
  • 260
  • 2
  • 6
4
votes
1 answer

What does starvation freedom exactly mean?

Galvin offers the following definitions of starvation: Indefinite blocking, or starvation, a situation in which processes wait indefinitely within the semaphore. A major problem with priority scheduling algorithms is indefinite block-ing, or…
Yueor
  • 83
  • 1
  • 6
3
votes
1 answer

Operating System: About user thread and kernel thread?

Is that a "thread" consists of both "user thread" and "kernel thread" as two parts? And when I create a "thread", is that I create a "user thread" and another "kernel thread" is created "in the background" by OS also? I'm confused because of the…
Ning
  • 249
  • 1
  • 9
3
votes
2 answers

How does software detect if an interrupt has occurred if it cannot set it's own interrupt handlers?

I'm currently working on designing a relatively simple processor using a custom ISA . It will use interrupts for I/O . From what i know , once the interrupt controller issues an interrupt , the processor acknowledges it and set it's PC to the IVT ,…
3
votes
2 answers

How does one program crashing not crash the entire system?

In Windows, if you write a random assembly program that has a random jump to an address that doesn't exist, the program crashes and Windows says something went wrong with the program. Since each computer system is essentially a constant execution of…
Jerry
  • 31
  • 1
1
2 3
9 10