# Questions tagged [operating-systems]

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

590 questions
Filter by
Sorted by
Tagged with
41 views

### dining philosophers problem with deadlock

i have the following code: ...
14 views

### Process synchronization problem

The atomic fetch-and-set x,y instruction unconditionally sets the memory location x to 1 and fetches the old value of x in y without allowing any intervening access to the memory location x. Consider ...
23 views

### Hierarchical page tables with page size of 8 KB

Consider a machine with a physical memory of 8 GB, a page size of 8 KB, and a page table entry size of 4 bytes. How many levels of page tables would be required to map a 46-bit virtual address space ...
10 views

### What are the advantages and disadvantages of clock replacement algorithm [closed]

What are the advantages and disadvantages when it comes to clock replacement algorithm
32 views

### How to find a condition which leads to deadlock in non-reentrant locks

A multithreaded program P executes with x number of threads and uses y number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-...
34 views

### When is it best to use the second chance replacement algorithm?

I'm going through 'Operating Concepts' by Silberschatz, Galvin and Gagne (The Dinosaur Book) and it mentions the Second-Chance Algorithm (not enhanced) as an improvement on the FIFO replacement ...
54 views

### Why are special instructions used to implement system calls? Why not use normal subroutine calling instructions?

The transfer of control is often completed through some type of software interrupt instruction. These special instructions result in the CPU to save the current state of the machine and transfer ...
23 views

### Is physical pages zeroed out before it's mapped to a virtual page?

I don't how this works. According to me if the physical memory is not cleared then there is some security risk as there may be some sensitive information in it from the other processes. How does the ...
17 views

### Determine page number and offsets for address references

I'm working on learning operating systems and I've come across a strange question that I don't know how to answer. The question is: Assuming a 1-KB page size, what are the page numbers and offsets ...
65 views

### Difference between *device descriptor* and *device handler*

I am studying Computer Architecture, and am a bit confused about the difference between device descriptors and device handlers in operating systems. Am I correct in saying that a device handler is ...
55 views

### Calculating max file size

The question is "For a file system with 11 direct blocks, 5 indirect blocks, 2 secondary (double) indirect, 2 triple indirect blocks calculate the maximum file size allowed if block size is 2048 in a ...
42 views

### Questions regarding CPU scheduling algorithms ( Round Robin and Priority scheduling )

Consider the following processes : 1) My First Question is if we need to schedule them using preemptive priority scheduling with Round-Robin for equal processes priorities with a quantum of 3. Here ...
24 views

### NRU: Page fault on writing?

I am trying to understand the concept of NRU from the following link. I have got some problem in understanding the text below: NRU page replacement Algorithm If the hardware does not have these ...
24 views

### Making sense out of byte-order in text

I have stumbled about the way a text file is saved by the OS. I have typed: printf "ab" | hexdump and the output was: 6261 which are the letters in reversed ...
38 views

### How do computers really communicate with hard-drives on x86_64?

All of us have saved a file on our computers using a programming language. If I look down through the layers of abstraction, I usually get stuck at a kernel-level call or a C-call like ...
19 views

### Preemptive priority scheduling problem with same priority

So if T1(priority 3, arrived first) was preempted it is put back to the runqueue. If there is already T4(priority 3, arrived fourth) inside the runqueue, which one of these two will be handled first?! ...
92 views

### What is cold-start penalty ? What are some ways to reduce it?

when a new process is created using a fork() function, there is a cold start penalty, what is this and why does it happen?
37 views

### Spin-Lock and Busy-Wait

This question has been asked and the top answer https://stackoverflow.com/a/38173155/12862537 is not satisfactory. So, it would be nice if someone could specifically point out the similarities and ...
17 views

### Android apps IPC during navigation of activity

During navigation of activities in an Android app by clicking back button, the current activity is paused, the previous one is restarted and resumed and the former is stopped. How does activity ...
193 views

### Can a TLB hit lead to a page fault?

$Can$ $a$ $TLB$ $hit$ $lead$ $to$ $a$ $page$ $fault?$ My answer is yes, as say even after a TLB hit if the page in the memory is dirty and it will lead to Page fault. Other case can be that, it is ...
13 views

### Message passing inter process communication

I was reading a book on OS by Galvin. I well understood that blocking send will wait until it has loaded the message into the kernel buffer. In contrast, the non-blocking send system call will return ...
37 views

### How are Operating systems involved in execution of programs?

By my understanding, operating system is the abstraction layer above hardware. Which means that an operating system that supports two different CPU architectures can run the same code. But I still ...
16 views

### Another feasible way to implement multi-level page table?

The advantage of a multi-level page table is that we can swap the inner-level page tables to some secondary storage. If however we want quick access to the whole address space, we have to keep all ...
95 views

### what is the difference between an adapter and a controller?

1- why do have a USB controller but a display adapter ? 2- I have heard the terms network adapter and network controller being used, is there a differance between those ?
12 views

### working set bits in working set approximation

I am looking at the example pdf from Cornell found here: https://www.cs.cornell.edu/courses/cs4410/2016su/slides/lecture13.pdf Also reading OS Concepts 10e Chapter 10 but it does not go into detail. ...
18 views

### Operating System scheduling

I was reading a book on Operating System by Galvin and came across this : In the latest version of Solaris, scheduling is controlled by loadable tables. Depending on the table currently loaded, the ...
41 views

### Can the same machine word sometimes be data and sometimes be code?

I have a question about machine words. We have data and a code segment in the memory which is addressed. If we take a word from it and let's say it is a code (instruction), and another one is some ...
38 views

### Does Dekkers solutions to critical section problem ensure progress?

I was reading concurrency control section from Operating Systems book by William Stallings. In this book, he gives three attempts by Dekker to give solution to critical section problem: Attempt 1 <...
102 views

I had read about the various functionalities of system calls recently in one of my coursebooks and about how they are used to allocate memory for new processes. The book didn't specify whether it was ...
113 views

### What does this mean: “The compile-time and load-time address-binding methods generate identical logical and physical addresses”?

I read this in my Operating System textbook. Does it mean that the logical addresses generated by compile-time binding scheme are the same as the logical addresses generated by load-time binding? Or ...
21 views

### Operating System code suffers more cache misses than user code

I was going through the text of the book Computer Architecture: A Quantitative Approach. It has a section in Chapter 5 where it discusses the fact that OS code undergoes more cache misses as compared ...
36 views

### Why can't OS's keep audio and video recording in sync?

It seems every program that purports to record webcams fails to keep audio and video in sync. Moreover, there are probably man millenia being spent by people trying to correct for this during editing....
86 views

Consider we have two processes P1 and P2. There are also two semaphores M and N which are initialized to zero. Here's how they execute: ...
26 views

Deadlock can happen when two processes are waiting for resources held by each other. Here can the two processes know that they are waiting for each other to release resources?
78 views

### Why doesn't everyone use distributed operating systems?

As requested by a moderator, this question as been separated from my question about microkernel-based operating systems. In the 1980's, the team that developed C and Unix developed a distributed ...
253 views

### Why doesn't everyone use microkernel-based operating systems?

From what I have read on operating systems, the impression I have been receiving is that, for at least 30 years, "everybody has known" that microkernel-based operating systems are "better" than ...
25 views

### Is “capability-based security” vs “hierarchical-protection-domain based security” a false dichotomy?

The wikipedia page on capability-based security states: Capability-based security is to be contrasted with an approach that uses hierarchical protection domains. However, in order to implement ...
20 views

### Journey of a process from compilation to execution [closed]

I am reading operating system, and after reading some topics (Processes, Main Memory management) I got somewhat confused. I have knowledge about certain things but I am not able to combine and ...
28 views

### Deadlock in resource allocation graph

I am unsure if there is a deadlock in this particular graph. Not sure if P2 and R2 make a cycle. As well as P2 - R3 - P1 - R1 - P2. It seems there is a cycle, but not sure if there is a deadlock ...
39 views

### Is there a OSI model equivalent for describing the abstract layers present in performing a computation for an operating system?

In describing where a system vulnerability exists, I often find a need for a model that partitions a operating system and its components into abstraction layers. Similar to how the Open Systems ...
16 views

### Research papers related the Android OS's Adaptive Battery and Screen Brightness

I want to read the details of the Adaptive Battery Optimization and Adaptive Brightness techniques used in the Android operating systems as mentioned in this wired.co.uk article. I tried looking for ...
45 views

### Does pre-emption of a process occur when that process is busy waiting?

I was reading about Peterson's Solution for Synchronisation. Let's assume the two shared variables to be int bool flag[2] and ...
17 views

### External fragmentation of memory

Im trying to calculate the external fragmentation of a memory with the content UFFFUUFFUU where U is used, and F is free. Im confused as to how to do this, when i dont know the number that Used is ...
14 views

### How Are Segment Descriptors Used

I am following through James Molloy OS tutorials and I can't get my head around the GDT. I understand that it contains entries that describe segments, what I don't understand is,how are the segment ...
10k views

### Why do we need full-fledged workstations running massive OSes with massive software?

I've grown up with computers. While watching old computer TV programmes and documentaries and reading the news about constant issues with these modern systems -- everything from the sheer amount of ...
28 views

### Doubt in effective memory access time in case of n level paging + TLB

I am getting confused with calculation of EEMAT(Effective memory access time). I decided to close the book and think on my own and make an equation. Please see whther this is correct or not. I thought ...
55 views

### how worst fit better than best fit?

I am a beginner. I have recently started studying OS. In textbook, it is written as best fit is worse than worst fit. Reason - external fragmentation. IMO,in case of variable partionioning, best ...
33 views

### doubt in pipelining

I am not from cse but trying to learn computer architecture on my own. Please clarify the following. In case of pipelining, each stage or subcomponent or subtask is assumed to be done in 1 CPU ...