Questions tagged [operating-systems]

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

Filter by
Sorted by
Tagged with
2
votes
2answers
144 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 ...
2
votes
3answers
165 views

What do CPUs do when a program aborts with an error?

If a very severe interrupt occurs, say a divide by zero, this will quit the program. How is this done, is there a special instruction in the processor or is it a software routine? And after quitting ...
2
votes
5answers
20k views

How to determine the maximum RAM capacity for an operating system?

I was curious to know what limits the max RAM capacity for an OS while reading about microprocessors being 32-bit and 64-bit. I know that limit for 32-bit OS is 4GB and for 64-bit OS is 16 Exabytes, ...
2
votes
1answer
2k views

what is the need for valid/invalid bit in paged memory technique?

How is the valid/invalid bit in paged memory useful? I am not able to understand the significance. Is it also somehow used to share the processes among different users.
2
votes
2answers
1k views

how can a program be OS-dependent?

I know the fact that you cannot run the same machine code on two different machines, so the software must be machine dependent (i.e Arm program cannot run on either powerpc or x86). but in reality ...
2
votes
2answers
4k views

Difference between virtual memory and job pool

Both virtual memory and job pools store the processes temporarily on disk and bring them to memory at some later stage, so what is the actual difference in between them? What I guess is that when a ...
2
votes
2answers
35k views

Size of address spaces (logical and physical)

Suppose a system in which addresses (physical and logical) occupy 32 bits, page size is 1024 bytes (210), and physical memory is of size 32MB. How many frames are in physical memory? Is the logical ...
2
votes
2answers
2k views

Is there a shell between the kernel and hardware

First and foremost, i know what a shell, kernel is. Now the dilemma. Today i had my systems viva in college. The examiner asked me is there a shell between the hardware and the kernel. Obviously, i ...
2
votes
4answers
9k views

Calculation of effective average instruction execution time in a 2-level paging system

System has a two level paging scheme Average CPU time for a instruction = 100ns Average number of memory accesses per instruction = 2 Regular memory access = 150 ns Page fault service time = ...
2
votes
1answer
202 views

Why is 2^32 in a 32-bit system = 4GiB and not 4Gib?

I was watching this video 32-Bit vs 64-Bit - The Advantage and at 1:19 (timestamp) the narrator mentioned the 4GB memory allocation for the 32-bit system. I later found out it should've been 4GiB but ...
2
votes
1answer
271 views

hardware interrupts and context switch

I have recently studied about interrupts and context switch i have read that the hardware interrupts cause the interrupt service subroutine to execute for this i read mixed articles saying that there ...
2
votes
1answer
673 views

Do modern operating systems use memory control blocks?

I was taught in my operating systems class that sections of memory in the heap are marked as free/occupied through the use of memory control blocks (MCB). The generalized definition of an MCB that was ...
2
votes
1answer
2k views

What are logical addresses and where do they actually reside?

While studying about memory management, paging and segmentation there is a lot of usage of phrases like CPU generates logical addresses and ...
2
votes
4answers
2k views

Operating System - CPU scheduling Decisions

I understand that CPU scheduling takes place on 4 circumstances listed below: When the process changes state from Running to Ready Changes state from Running to Waiting Changes state from Waiting to ...
2
votes
1answer
2k views

User level threads are transparent to the kernel?

Find whether given statement True or False? Explain. User level threads are transparent to the kernel? My attempt : False. Since, user level threads are managed by a user level library however, they ...
2
votes
1answer
2k views

Why do we use stacks and not queues on system-level?

From low OS-level function calls, to memory allocated to an application, all will primarily take a stack to perform LIFO operations. Why don't we use queues and FIFO operations? It's just a matter of ...
2
votes
2answers
513 views

Are device drivers state machines?

I know that device drivers are attached to device controllers, which have their own registers and some local buffer storage. I'm wondering if I can think of device drivers as little state machines -- ...
2
votes
2answers
2k views

How to implement mutex on single processor (single core) system other than using spinlock

How does one implement mutex on a single processor system without using spinlock mechanism. Mutex is to be implemented in user space (for any user level library like pthread lib for example).
2
votes
1answer
11k views

Hierarchical Paging

Suppose I have a system with 32-bit logical and 16-bit physical address spaces, and the page size is 512 bytes. For simplicity, ignore the valid/invalid bits in the page table. How many sections will ...
2
votes
2answers
93 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 ...
2
votes
1answer
320 views

How exactly does a CPU do process scheduling?

I know in theory how various scheduling algorithms work, such as round robin, where each process is given small time slices to run a few instructions, before the operating system passes execution onto ...
2
votes
2answers
68 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 ...
2
votes
1answer
997 views

Operating system maintains copy of page table for each process

I am quoting a paragraph in Operating System Concepts by Silberschatz, in paging chapter, In addition, the operating system must be aware that user processes operate in user space, and all ...
2
votes
2answers
902 views

Increment and Decrement on binary semaphores when their values are $1$ and $0$ respectively?

What happens if we increment binary semaphore $x$ when it is equal to $1$. E.g A process executes $V(x)$ when $x==1$; What are the possible cases then- Process would be blocked till $x$ becomes $0$. ...
2
votes
2answers
84 views

how the instructions are stored in relocatable format on disk

I understand how the instructions are kept in relocatable format in RAM. It is done so by keeping a base register and a limit register. Physical address = base register value + logical address. And ...
2
votes
1answer
388 views

Practical Page-Replacement Algorithms

Could anyone suggest other page replacement algorithms that are applicable to the real world aside from FIFO, Second Chance (Clock), Enhanced Second Chance and Random?
2
votes
1answer
68 views

Filing systems using index blocks

I know that a disadvantage of the index block system is that it can be wasteful of space if the files involved are mostly small in size, as index blocks are allocated from free space as required and ...
2
votes
2answers
1k views

Must a deadlock necessarily occur if the four conditions exist?

I understand the four necessary conditions, mutual exclusion, hold and wait, no preemption, and circular wait, for deadlock to occur. However, does there exist a situation where the four conditions ...
2
votes
3answers
73k views

How to work out physical address corresponding to logical address?

I am looking to calculate the physical address corresponding to a logical address in a paging memory management scheme. I just want to make sure I am getting the calculation right, as I fear I could ...
2
votes
1answer
70 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 ...
2
votes
2answers
43 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 ...
2
votes
1answer
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 ...
2
votes
1answer
2k views

Mapping between kernel-level thread and user-level thread

This is my understanding: There are two types of processes: user and kernel(OS). Each process can have single or multiple threads. The threads of a user process are called a user-level thread and the ...
2
votes
1answer
699 views

Is thread in operating system = thread function in programming languages?

I'm new to Operating System, just learnt about process and now is about to learn about threads. From what I understand, a program is an executable file, program code a process is a program in ...
2
votes
2answers
436 views

Characterize an OS as multiprogrammed OS

Which of the following features will characterize an OS as multiprogrammed OS? More than one program may be loaded into main memory at the same time. If a program waits for certain event another ...
2
votes
1answer
718 views

Is bounded waiting satisfied in the 2 Process Solution?

Suppose, There are $2$ processes $P1$ and $P2$. It is given that Mutual Exclusion and Progress are satisfied by these $2$ processes. Suppose, Programming protocol is designed such that CPU only ...
2
votes
2answers
3k views

Does a simple calculator require an operating system?

I don't mean a TI-84 type calculator, and I also do not mean a simple calculator app on your phone. Does a basic scientific calculator require an operating system?
2
votes
2answers
8k views

Bankers Algorithm-Is the system in safe state?

Could somebody please provide a step-through approach to solving the following problem using the Banker's Algorithm? A system contains 10 units of resource class Ru. The resource requirements of ...
2
votes
3answers
87 views

How can another process call $signal()$ when one process is executing $wait()$ in its busy waiting loop?

A semaphore is a variable that, apart from initialization is accessed through only two standard atomic operations wait(s) and signal(s). ...
2
votes
1answer
185 views

Operating Systems TestAndSet instruction

I was reading operating systems concurrency control topics where I came across TestAndSet() intruction. I first referred this book. But it has got very less ...
2
votes
1answer
4k views

When should you disable all interrupts in a program?

Consider a machine that has nested interrupts (a higher priority interrupt can interrupt a lower priority one, the current instruction's address is saved and later restored). Why would a programmer ...
2
votes
5answers
9k views

Deadlock and cycle in a resource allocation graph

Here is a resource allocation graph asked in my Operating Systems Theory midterm. The question is, "Is there a deadlock here? Explain your answer in detail" Ra and Rb are resource sets and every dot ...
2
votes
1answer
164 views

about scheduling in operation system

In FIFO: when process get cpu time and then go to IO. What happend in the time it is in IO? another process can run? After finishing IO it continue or "loss its turn"? Why FIFO give priority to cpu ...
2
votes
1answer
91 views

How can a 32bit CPU have an addressable memory size of 16TB?

Frequently, on a 32-bit CPU, each page-table entry is 4 bytes long, but that size can vary as well. A 32-bit entry can point to one of $2^{32}$ physical page frames. If frame size is 4 KB (212), ...
2
votes
1answer
452 views

Why do OS and DBMS have their own synchronisation mechanisms, when OS can alone do it and it sits at the bottom of DB?

I know that synchronization is important in the OS, but why do we need a separate topic synchronization and concurrency in the DBMS? The OS concentrates on program synchronization while the DBMS ...
2
votes
1answer
875 views

Appreciation of the 5 state process model

I'm starting out in an Operating Systems module. I have a few understanding questions to think about, which will not be gone through in class. A process state model is an abstraction (or model) which ...
2
votes
1answer
228 views

What does it mean " The outer level page table need not be page aligned?

The question is in context to multilevel page table. I was trying to solve numerical on multi-level paging and noticed that page size might not be same at all levels. I came across the point "Outer ...
2
votes
1answer
295 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/...
2
votes
1answer
345 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 ...
2
votes
1answer
75 views

Existence of Real-Time Multiprocessor Schedule

Does an algorithm exist to check for the existence of a Real-Time Multiprocessor Schedule for aperiodic hard tasks(all of which have the same Release time)? Assumptions: The processors are Uniform ...

1 2 3
4
5
13