Questions tagged [operating-systems]

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

0
votes
0answers
23 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
12 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?
1
vote
0answers
33 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
145 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
26 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
121 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
vote
1answer
124 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
22 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 ...
1
vote
1answer
234 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
55 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 ...
1
vote
1answer
29 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
51 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 ...
1
vote
1answer
339 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
265 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
112 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
82 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
32 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 ...
5
votes
1answer
139 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
264 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
2k 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
38 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 ...
5
votes
1answer
471 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
41 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
95 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
27 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
65 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 ...
1
vote
1answer
468 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
468 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
18 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
157 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
18 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
143 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
41 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
256 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
39 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
100 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
29 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
74 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 ...
1
vote
3answers
117 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
32 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 ...
0
votes
1answer
455 views

How does the TLB identify a particular process?

I have read that the translation lookaside buffer (TLB) is implemented in hardware and stores the page numbers and the corresponding frame numbers for faster lookups. Now suppose there are two ...
3
votes
1answer
87 views

What is the benefit of using one to one thread mapping model instead of Many to Many or two level?

So in the silberschatz O.S book it says Windows uses one to one model (mapping user level threads to kernel level threads) but why? i thought many to many and two level models are much better, ...
4
votes
2answers
94 views

Why operating system needs interrupt stack, if it has process control block?

I'm reading about an operating system but some concept confuses me. What doesn't confuse me: When an interrupt or system call or processor exception occurs, it happens when user mode tries to ...
0
votes
1answer
453 views

What is the relation between Time Sharing operating systems and Round Robin CPU scheduler?

So i have asked this before, but i still didn't get my answer so I'll try to make my question more clear this time : Based on my O.S book, Time sharing operating systems switch between processes ...
0
votes
0answers
720 views

CPU scheduling Algorithm SJF VS SRTF average waiting time?

Let's say we have two CPU scheduling algorithm as SJF and SRTF and we have a arbitrary pool/set of processes with different ARRIVAL TIME and CPU BURST, then what CPU scheduling algorithm will result ...
2
votes
1answer
84 views

What are the recents topics of research that combine both systems research and theoretical computer science?

I am an undergraduate majoring in Computer Science and Mathematics. For my undergraduate research, I would like to work on something that lies in the overlap between systems research and theoretical ...
0
votes
1answer
112 views

NX Bit in x86 vs x86_64

I've been reading about how the kernel manages memory in x86 from this popular blog post(https://manybutfinite.com/post/how-the-kernel-manages-your-memory/) and had a few questions. There is a part ...
0
votes
0answers
130 views

Scheduling in multi core processor

I have an exercise. Let's say we have a system with two computing cores A and B. There are four processes P1(10,A), P2(5,A), P3(13,A), P4(2,B). The number is the next extinction in CPU and the letter ...
0
votes
1answer
33 views

How can segment be 60KB

I read that each segment is 64KB,but how? If you have address ABCD:EFGH , then 1 segment is 16B if it is addreses by bytes. How do they don't overlap? Example: 0000:0010 = 00010 0001:0000 = 00010 , ...