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.

0
votes
1answer
14 views

Threads and Operating System

In a computer, the processor executes different threads and changes between them, the operating system is a program at the end that it´s being executed by the processor, there exists the posibility ...
0
votes
0answers
8 views

If the string of N requests is repeated many times, which of the following is/are true?

If the string of N requests is repeated many times, which of the following is/are true? I. The fewest page faults occur when M ≥ N. II. LRU (least-recently-used) and FIFO (first-in-first-out) will ...
0
votes
1answer
23 views

Round-Robin fashion exercise

In my Operating Systems class I have an exercise to sketch out how a round-robin algorithm would apply to a specific scenario, which is the following: Now the correction that I was provided with by ...
0
votes
0answers
24 views

Definition of multiprogramming [duplicate]

Which combination of the following features will suffice to characterize an OS as a multi-programmed OS? a. More than one program may be loaded into main memory at the same time for execution b. If ...
-2
votes
0answers
26 views

Which is the best scheme for memory management

For each of the four processes P1, P2, P3, and P4. The total size in kilobytes (KB) and the number of segments are given below. ...
0
votes
0answers
20 views

interrupts in operating system

Normally user programs are prevented from handling I/O directly by I/O instructions in them. For CPUs having explicit I/O instructions, such I/O protection is ensured by having the I/O instruction ...
0
votes
1answer
17 views

ARM STM instruction: page fault problem with MMIO

The ARM STM instruction is described here in the ARM manual. This instruction writes all or a subset of registers at memory locations starting from a base memory ...
0
votes
0answers
41 views

What do return 0,return 1 & return -1 mean and what they return to whom? [closed]

I have noticed that in main the function of c program return 0 , return 1 or return -1 is used. I searched for the same in internet and saw that return is equivalent to exit and 0 status means that ...
1
vote
1answer
36 views

Instructing operating system - Knowing it's functionalities

TL;DR: I would like to know how a programming language, the OS and drivers work together to perform a task. I (and we all) have used various softwares/modules/packages on the top of our OS which ...
-2
votes
0answers
15 views

Why is it so difficult to implement memory protection in AmigaOS/AROS? [closed]

The FAQ of AROS says: "This indicates that it's quite unlikely that the normal AmigaOS will never [sic] have MP like Unix or Windows NT.". Why is it so difficult to implement memory protection in ...
-1
votes
2answers
24 views

Who decides that process needs cpu time or not?

I wonder how does particular process gets CPU time or resources whenever it's required to execute some instructions? When a process is in the idle state or waiting for input, it's not occupying the ...
-1
votes
0answers
5 views

tlb hit/miss after page fault has serviced

when a system gets a tlb miss and the required page is not present in the memory therefore it will trigger a page fault. after the service of the required page fault. will now the request will hit in ...
0
votes
1answer
25 views

Is OS mode required for accessing general purpose registers

In which of the following cases a process executing in user model is required to enter into the OS mode? (a) Decreasing the value of unsigned integer value in a register to less than 0 (b) Accessing ...
3
votes
1answer
32 views

What should be the minimum value when the two threads are executed concurrently

int count=0; void *thfunc() { int ctr=0; for(ctr=0;ctr<100;ctr++) count++; } If *thfunc() is executed by two threads concurrently in a uniprocessor ...
0
votes
0answers
12 views

Relating L1 cache, TLB and main memory

Earlier while solving problems from computer organization book by Stallings, I came across the fact that $T_a=(H_{L1})(T_{C1})+(1-H_{L1})(T_{C1}+T_M)$ where, $T_a \rightarrow$ Average access ...
0
votes
0answers
16 views

How Does an Operating System/BIOS Determine Physical Addresses of Devices?

So I understand that in every computer, the Operating System, the BIOS, or both will determine the physical addresses of the hardware devices and then translate that into virtual addresses. What I don'...
1
vote
0answers
24 views

Deadlock vs “Progress” requirement of the solution to the critical section problem

I came across following problem: Consider following code: ...
0
votes
1answer
33 views

Cache and Main Memory

As we know that average access time is given by t=p*(tc)+(1-p)*(tc+tm) where t represent the average time, p is the hit ratio , tc is the time to access the data from the cache and tm is time to ...
1
vote
0answers
27 views

How can I implement locking a range of values in a sorted sequence?

I am trying to write a general purpose locking algorithm which allows me to lock a range of contiguous values in a sorted array. To start with, these could be exclusive locks - so two concurrent locks ...
0
votes
0answers
13 views

Number of memory cycles stolen for transferring one word

The storage area of a disk has the innermost diameter of 10 cm and outermost diameter of 20 cm. The maximum storage density of the disk is 1400 bits/cm. The disk rotates at a speed of 4200 RPM. The ...
1
vote
1answer
29 views

In a kernel, what are “global constructors”?

I am a beginner developing kernels (though I have developed several Hello World programs in C and C++). I frequently see reference being made to global constructors (e.g., osdev https://wiki.osdev.org/...
0
votes
2answers
58 views

Why are threads called the unit of dispatch?

Threads called the "unit of dispatch" but what does that mean? I was looking over the web and two operating systems books but I can't find the answer. It seems that processes are defined by two ...
2
votes
1answer
54 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
10 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
10 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?
0
votes
0answers
18 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
18 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
30 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
1answer
60 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, ...
-1
votes
0answers
12 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
48 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
55 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
53 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
83 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
25 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
28 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
1answer
212 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
82 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
63 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
53 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
30 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 ...
1
vote
0answers
32 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
79 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
90 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. ...
4
votes
1answer
664 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
32 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
151 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 ...