operating systems – Renaming of linear list directory

Consider a linear list-based directory implementation in a file system. Each directory is a list of nodes, where each node contains the file name along with the file metadata, such as the list of pointers to the data blocks. Consider a given directory foo.

Which of the following operations will necessarily require a full scan of foo for successful completion?

A.Creation of a new file in foo

B.Deletion of an existing file from foo

C.Renaming of an existing file in foo

D.Opening of an existing file in foo

Here I know that how the creation of a new file necessarily required a full scan. but I’m confused with how the renaming of the file necessarily requires a full scan?
plz, discuss how the renaming is done in the directory structure.

operating systems – Computing the number of Cylinder

For magnetic disks, there is a direct adressing scheme made of:

  • head (platter side),
  • cylinder (track number, independently of the platter) and
  • sector

It’s all well explained here on wikipedia. 20 tracks, means 20 cylinders. No more calculation. Combined with 200 heads (100 platter*2 sides) and 50 sectors, that’s 200 000 addressable blocks (sometimes ambiguously called sector)

For magnetic tapes, there are at most 2 heads, no cylinder, but a sequential structure of blocks that are similar to sectors in that they decompose the storage media into smaller pieces. There is by the way no direct access.

In consequence, the question is a trap: there are no cylinders on a tape.

Is there a “theory” of operating systems?

Is there a theory for Operating Systems?

That is, subfields of CS have theoretical parts; i.e. PL has type theory, ML has mathematical theorems, security has a lot of provable properties, etc.

There are certain “properties” in OS, like the optimality of SJF scheduling algorithm or the dining philosophers, but these seem like small examples.

I feel like most of OS is engineering — i.e. paging mechanisms, scheduling algorithms, thread management. Is there a “foundational theory” of Operating Systems?

dual boot – Can multiple operating systems share program installations and user profiles?

I’m new to Linux and trying multiple variants of Ubuntu (standard, Mint, Pop, etc.). Unfortunately, every OS is isolated on different partitions, with separate settings, user groups, etc. and programs have to be installed each time I install a new OS. I would like to have a primary OS (Ubuntu LTS) and then all subsequent OS’s refer to the primary OS for user profiles, program installations, etc. – Is this possible?

My purpose is twofold: 1) ease of trying new distros without hassling with setup/maintenance of multiple profiles and programs, and 2) save on disk space by reducing duplicate files.

I know how to access files and mount folders between each distro’s partition, but is there a way to trick the OS into thinking the primary partition is where it should be looking for everything?

I don’t mind trying things that are experimental, as this is a new system and I have no critical data on it yet.

How are kernels (and operating systems in general) written in C?

I’m trying to understand how you set about writing an OS in something like C.

I’ve always used C to write applications – using commands like malloc and fork and so on to request things from the OS. If these methods don’t exist when you’re programming the OS itself (or perhaps the Kernel in particular), how do you write them?

If I can summarise what I’m stuck on:

  • Am I right in thinking that fork, malloc, etc. are wrapper methods that call the Kernel?

  • Do the OS components’ code call the Kernel the same way you would call a library? Is it more like it’s a microservice you make calls to? When we say that Windows provides a ‘hosted’ implementation of C, is this what the methods are doing under the hood?

  • When you have a ‘freestanding’ implementation of C, are the standard libraries written in Assembler, but have C headers?

  • Are the freestanding components of a hosted C implementation implemented the same way they would be if they were freestanding?

  • How do you implement memory and process management in C, what is exposed to allows you to do this in the language? (what do you call to interact with memory / devices / interrupts?)

I can imagine this isn’t a small question, so I’m more than happy for an answer that includes some further reading but if you’d be able to summarise the main points related to each question that would be super handy for me!

Thanks in advance!

usability study – Studies on the impact of switching operating systems in corporate organizations

As I used to work as a user researcher on Office:Mac, I can tell you that there has been plenty of research on this very topic. However, I can’t share specific results, since that research is proprietary to Microsoft. With that in mind, I can share some things about conducting this sort of research in general.

The first is that the environment of the organization matters a great deal. Off the top of my head, here are some examples of barriers to change in the organization’s environment:

  • the organization relies on a lot of applications that aren’t available on the new platform
  • the organization uses a lot of websites that won’t work in the browsers available for the new platform
  • IT for the organization isn’t educated on and prepared to support the new platform

If there are barriers like this exist in the organization, then converting to the new platform will be somewhere between difficult and impossible. If the environment is more open and amenable to supporting multiple platforms, which we’re seeing more and more with the rise of BYOD (Bring Your Own Device) and now BYOL (Bring Your Own Laptop), such a conversion has lower barriers.

The second is that this isn’t so much a question of usability (which is about being able to complete tasks the first time you encounter the new product), but rather of usage (which includes usability, learnability, and other factors). No matter how well-designed a product is, if someone is used to using something else, switching to a new product is going to incur a cost because the user has a lot of expectations and habits that were formed using the previous product. These expectations and habits are likely to be broken, and cause initial pain as a result, in making this switch. The true test of the success of such a switch is measured a few months after the switch occurs. Back when I was working for Microsoft, I wrote a blog post about usability versus usage, considering the then-new iPhone, which has more details about the difference between them.

Overall, I don’t think that it’s possible to make a general statement about whether an operating system is better than another at the level of an organization. Different organizations have different needs, different tools, different goals, and different users with different behaviors, habits, and expectations. It’s a varied world out there, and there’s lots of great and valid reasons for that variability.

operating systems – Starvation and Livelock


I think Option C is false. Following is my thought process:

Starvation in general mean Process is waiting indefinitely for the resource or to get scheduled etc. (A/c to Galvin Book). So, here in this question, Any process needing any resource at any point can call the OWNRESOURCE function and process will surely get the resource it asked for. So, we can surely say that the process doesn’t have to wait indefinitely at any point. Hence we don’t have Starvation.

But, I have read that Livelock is a special kind of Starvation (Resource Starvation), Clearly the Scheme mentioned in the question suffers from Livelock. But it can’t possibly suffer from Starvation.


  1. Is my thought process correct about Why the scheme can’t make process suffer from starvation?
  2. Is it possible in the given scheme, to have Livelock but no Starvation?

Note: I have asked similar question(deleted now) but didn’t express my thoughts well and didn’t have any discussion. Now, I’m very specific about my doubts and I have articulated my thoughts as well.

operating systems – Representation of unsigned integer on a little endian, big endian computer

This is a GATE 2021 exam question.

If the numerical value of a 2-byte unsigned integer on a little endian computer is 255 more than that on a big endian computer, which of the following choices represent(s) the unsigned integer on a little endian computer?

A. 0x6665
B. 0×0001
C. 0×4243
D. 0×0100

According to me, answer should be A,D. But according to some of my colleagues, answer is B,C.

My logic for answer being A,D :

The question is asking “which of the following choices represent(s) the unsigned integer on a little endian computer?”

Take Option “0x6665” :

The question is saying that 0x6665 is the representation of some integer on a little endian computer, so, it means that the original number must have been 0x6566.

So, for the original number 0x6566 :

On little endian(LE) : 0x6665

On Big endian(BE) : 0x6566

Clearly, LE = 255 + BE

Similarly, for 0x0100.

Take 0x0100 :

He is saying that 0x0100 is the representation of some integer on a little endian computer, so, it means that the original number must have been 0x0001.

So, for the number 0x0001 :

On little endian(LE) : 0x0100

On Big endian(BE) : 0x0001

Clearly, LE = 255 + BE

Similarly for 0x4243 and 0x0001, They do not satisfy “LE = 255 + BE” condition , So, answer should be option A,D.

For Reference, Refer Slide 26 in the below article :