Operating system , synchronization

Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned. Method used by P1

while (S1 == S2);Critical Section S1 = S2;

Method used by P2while (S1 != S2);Critical SectionS2 = not(S1);

Which one of the following statements describes the properties achieved?

Mutual exclusion but not progress

Progress but not mutual exclusion

Neither mutual exclusion nor progress

Both mutual exclusion and progress

EDIT why in such codes we cannot preempt during executing while? is while an atomic expression here?

Operating systems memory management: help understanding a question related to segmentation

There is this question in my textbook (Operating Systems: Internals and Design Principles by William Stallings):

Write the binary translation of the logical address 0011000000110011 under the following hypothetical memory management schemes, and explain your answer:

a. A paging system with a 512-address page size, using a page table in which the frame number happens to be half of the page number.

b. A segmentation system with a 2K-address maximum segment size, using a segment table in which bases happen to be regularly placed at real addresses: segment# + 20 + offset + 4,096.

I am having trouble with understanding part b. I’m not a native English speaker. Initially, I assumed that “using a segment table in which bases happen to be regularly placed at real addresses” means that the segment number in the logical address is the number of the physical segment, but then I read this “segment# + 20 + offset + 4,096”, and I am not sure what to make of it. So does this mean that the base number in the segment table contains segment# (in the logical address) + 20 + offset (in the logical address) + 4,096?

Publicly Available PCAP dumps that associate IP addresses with Operating System?

I am currently working on a machine learning module to detect Operating Systems based on existing packet traffic in pcap file format. So far, I have generated some traffic of popular Operating Systems available. However, this process is very tedious.

I would like to know if there is any publicly available pcap files that associates data generated from a particular Operating System (e.g. pcap file that have a lot of traffic from Windows XP). I am aware that there are other similar questions asked regarding publicly available pcap files, however none of them seem to be focused on Operating Systems.

Thank you.

Do any programming language function calls internally call Operating system APIs?

To list directory content in Python we use os.listdir(), In Java we use Files.list(new File(dirName).toPath()). Like this we use a lot of functions calls, eg: For Network connectivity, Print in screen, Save to files.

In all operating systems do these all language-specific function calls ultimately call OS APIs (In Windows I think it will be Win32 APIs)?

ANything we can do without call OS APIs?

Are there any models of operating systems which don’t require rings of privileges, that are also secure?

I am working on a simple operating system in JavaScript and have noticed that there are two kinds of processes: the “main” process (or “kernel” process), and all the other processes. Basically they are implemented completely differently (which makes sense). But I’m wondering if you could reuse some of the logic and just have it all be one type of process. Do any operating systems do this? If so, what do they do? If not, why not?

Why are more and more websites increasingly operating subscription models?

[No idea if this is the right community so please forgive if not]

More and more I am noticing websites charging for subscription services, whereas years and years ago I suppose when less data was being sent and received [in the days of lower speeds etc.] most websites were free. Youtube is a particular example – now they are offering Youtube Premium whilst introducing inconveniences for free users. Amazon makes less sense to me as surely they profit enough serving as a shopfront, but they have also introduced features such as Amazon Prime.

Apart from the obvious – because who doesn’t want to make a profit – why is this? I would be interested to get some insight from people knowledgeable about this kind of thing as I am only a user and can only guess.