Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [operating-systems]

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

2
votes
1answer
17 views

How does hashed inverted page table work?

I understand hash function and inverted page table, but then the book I read describes something called hashed inverted page table (use hash to accelerate the finding because IPT is large), with TLB ...
0
votes
0answers
9 views

Why is it difficult to differentiate between system and user CPU time?

In the book, Computer Organization and Design, Fifth Edition, by D. Paterson, it is stated that Differentiating between system and user CPU time is difficult to do accurately, because it is often ...
0
votes
0answers
9 views

If the number of pages exceeds the number of frames, how can the process finish using Virtual Memory?

Mapping is not for paging, is it? For instance if we have 12 pages and 8 frames. If 7 out of these 12 pages are loaded into the main memory, how can the process terminate?
-4
votes
0answers
28 views

Operating systems question [closed]

I am asking for help for a few OS questions. Can you provide pointers to where to look up information? Thanks for your help. No need to downvote or close the question, I am not asking for full answers....
0
votes
0answers
7 views

Strict Alternation Solution

I am aware of the solution strict alteration to the critical section problem which satisfies mutual exclusion , bounded waiting but not progress. My doubt is : If P1 executed and gave chance to P2 ...
0
votes
0answers
15 views

Can mutex locks be implemented in software without hardware support? [duplicate]

Wikipedia mentions some software solutions but not sure whether these solutions will work for SMP, preemptive systems or for more than 2 processes.
1
vote
0answers
16 views

How is switching among user-level threads realised in the user space?

This is with respect to user-level threads where the kernel only knows about the process as a whole, and threads are created and maintained in the user space. Each thread has its PC, registers, stack ...
1
vote
0answers
21 views

pool of free page frames OS

I read that in a paging scheme memory management, some os's have a paging daemon that wakes up periodically to inspect the memory of the RAM. This is to ensure that modified pages can be scheduled to ...
1
vote
1answer
20 views

How can we compute how many processes should be in memory at a time to make CPU utilization max?

From the given formula, we can compute the CPU utilization: CPU Utilization = 1 - P^n Where p is the probability of I/O and n is the total number of processes. E.g, If we were to find CPU ...
0
votes
0answers
8 views

Some Questions About Polling

I'm trying to understand the section 13.2.1 polling[https://www.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/13_IOSystems.html] I don't understand two parts in the link: Is that the ["]4. The ...
0
votes
1answer
41 views

Determining the linear address

So I am working on a question that requires me to find the linear address. Here's some information: Main memory size is 8GB, which translates to $2^{3} * 2^{30} = 2^{33}$. Block size is 16KB each, ...
0
votes
0answers
11 views

Program behavior when running on user level threads vs on kernel threads?

With respect to load and store instructions, will a program behave differently when running on user-level threads vs when on kernel threads? If yes, how? The only difference I know is that on user-...
0
votes
1answer
25 views

Mutual Exclusion by disabling interrupt

I am reading William Stallings operating system book which gives this pseudo-Code for disabling interrupt to achieve Mutual Exclusion ...
0
votes
0answers
15 views

Longest Remaining Time first with Non-preemption

Below is a question from a quiz I attempted(for preparing for a competitive exam), I found the solution to be bit confusing and wanted to clear my concept. Below was the solution given I have a ...
0
votes
1answer
39 views

Which Peterson’s Solution is right?

I have seen two different Peterson’s Solution to mutual exclusion, one is from Modern Operating Systems: ...
2
votes
2answers
52 views

Why does the operating system switch an active process to different cores?

When running a single-threaded application that is 'always busy', on a multi-core computer, modern operating systems will typically switch the process from one core to another from time to time. Even ...
0
votes
0answers
40 views

Compile time and load time address binding vs Execution time address binding

The address generated by CPU is called logical address and the address seen by the memory unit is called virtual address. The compile and load time address binding scheme results in an environment ...
1
vote
1answer
24 views

Are space allocated to C/C++ variables in secondary storage also in Compiled file?

Are data segments,heap,stack etc also present in secondary memory with compiled code then later mapped by OS to RAM when I open it?
0
votes
1answer
23 views

How can a user process even try to access a memory location its not allowed to when it doesn't have access to page table?

So is it even possible for a user process to even try to access a physical memory location that does not belong to it and therefore getting an error by operating system? because for example with a 32 ...
0
votes
0answers
17 views

Process PCB vs PEB

I would like to know the difference between the PCB and the PEB of a process, I understood the process control block to store information about how to process a particular process. I still do not have ...
0
votes
1answer
168 views

How pictures and videos are usually loaded in Memory? [closed]

Lets assume I'm talking about Jpeg and Mp4 and a general video player(not sure if different ones load it differently, if they do please tell) So do video players (process) usually load the entire ...
1
vote
1answer
57 views

Can a safe state in Banker's Algorithm cause deadlock eventually?

I know that unsafe state does not always mean deadlock. That is a situation that banker's algorithm does not detect deadlock accurately. I am just wondering if there is any example of a safe state ...
0
votes
0answers
50 views

What is the difference between a trap and an exception?

I thought I know the difference between an exception and an interrupt, but I came across the term "trap" and it seems relatively the same as an exception. Even wikipedia explains it as an exception: ...
0
votes
1answer
44 views

Page Replacement optimal verses MRU

A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the access sequence THRICE. ...
1
vote
1answer
29 views

Fork() execution and number of processes

If a process executes the following code fork(); fork(); fork(); The total number of child processes created is given as 7 by a text book. But how does that ...
0
votes
0answers
11 views

How a process is changed from waiting state to ready state after system call?

I heard that a process which was blocked because of I/O operation (even though it is also a part of system call) is changed to the ready state by a device driver. (In this post) Then how about ...
1
vote
0answers
31 views

Software and hardware communications [closed]

When you install an OS on a piece of hardware such as a Macbook, what is happening logically? In other words, how does the software "talk" to the hardware? Is it the same logical process with every OS ...
4
votes
1answer
72 views

Are multiple interrupts generated when I hold down a key on my keyboard?

When I hold down a key on my keyboard, a continuous stream of characters is generated and is displayed on the text editor, Now since pressing a key is a hardware interrupt, so does holding down a key ...
0
votes
1answer
59 views

Processor pipelining question: number of instructions per second

A question from the textbook Modern Operating Systems by A. S. Tanenbaum reads as follows: A computer has a pipeline with four stages. Each stage takes the same time to do its work, namely, 1 nsec. ...
1
vote
0answers
261 views

What is the real advantage of Google's new Fuchsia operating system kernel?

Google's new in-production OS which it desires to replace not only Android but many other devices utilizes a completely new kernel: The code differs from Android and Chrome OS due to its being ...
1
vote
1answer
30 views

What is the mathematical principle of buddy algorithm?

The buddy algorithm is: The buddy for any block of size $2^k$ is another block of the same size, and with the same page frame number except that the kth bit is ...
4
votes
1answer
105 views

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 ...
1
vote
1answer
38 views

Can a process run if there's not enough space for minimum pages?

I'm studying OS and I came up with this scenario where the OS works with a paging scheme and virtual memory, and a process wants to start running, but in memory, there's not enough space to allocate ...
1
vote
0answers
36 views

How is context switching disabled in a process?

By what provision is context switching disabled in a process ? Or is it the case that if a process is in in kernel mode , context switching is disabled by default ?
-2
votes
1answer
26 views

OS process management

Assume a process execution interrupted at the middle and CPU started executing a different process.How does the OS handle this situation?
-1
votes
1answer
54 views

why do we run out of heap space even if we have virtual memory?

Whenever we try to get space in heap(using malloc or new) we can get out of heap space error if it exceeds the limit. But, we have virtual memory so why can't OS allocate that much space and then do ...
0
votes
1answer
83 views

Peterson Algorithm for process synchronisation

Consider Peterson's algorithm for mutual exclusion between two concurrent processes i and j. The program executed by process is shown below. repeat ...
0
votes
1answer
145 views

What is hardware trap?

Since it's called a trap I consider it caused by software, so why it's called a hardware trap? And how does it work?
1
vote
0answers
12 views

Operating System: Redundancy of implement a monitor using semaphores in my textbook?

Why the part highlighted the following picture is need? I've been trying to follow to logic flow of it as follow: Imaging a Situation: Two processes enter/call F, first A, second B: Process A: <...
2
votes
0answers
26 views

Operating System: Busy waiting is not eliminated with semaphore?

Why the busy waiting is not eliminated even after we put the current process into the process list and "block()"ed it? So even if the process is in waiting state we still call it "busy waiting"? I'm ...
0
votes
0answers
15 views

Operating System: Confusion about scheduler activation?

According to the highlighted text followed, a new virtual process is created and it will save the state of the blocking thread, then the upcall handler schedules another thread that is eligible to run ...
3
votes
1answer
85 views

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 ...
0
votes
1answer
32 views

Operating System: replace the process's memory space with a new program

What does it mean that "replace the process's memory space with a new program"? So who's memory space will be replaced by whom?
3
votes
1answer
121 views

How do modern Operating Systems detect process starvation?

So first off do the modern operating systems like windows and linux have a method for detecting starvation? if not, why? and if they do, then how are they going to detect starvation of a process? (...
0
votes
0answers
32 views

Notion of CPU burst in Time Sharing Operating Systems

As far as I understand OS calculates the CPU burst of a process based on its historical values and then may use algorithms like SJF etc for scheduling. But what if the OS is time sharing, where the "...
0
votes
0answers
56 views

Effective memory access time in case of multi-level paging with virtual memory

In multi-level paging with virtual memory, If I am using local page replacement algorithm (which I think is practically used), then there is no priority followed and pages at higher level can be ...
1
vote
0answers
26 views

Why isn't a process's PCB present in its memory?

I checked wikipedia PCB and its written that - Since PCB contains the critical information for the process, it must be kept in an area of memory protected from normal user access. In some operating ...
2
votes
2answers
65 views

How is space from malloc allocated?

Whenever we load a process (which consists of object code, static and global variables, stack and heap space) into main memory it would be of fixed size. But, the program doesn't know in advance how ...
0
votes
3answers
76 views

Is it 100% OK to say “All software doesn't need to know the system lower than the architecture level”?

Most of you know this diagram. If this diagram is true, all software is free to not know the levels lower than ISA. But it's not true. Softwares like performance-critical programs or system softwares ...
0
votes
1answer
31 views

Linux OS/HW VM cooperation

From what i've learned, the HW is responsible for setting the accessed and dirty bits in the PTE of a process, and the OS is responsible for turning them off. My question is why? The first part, i ...