Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CS421

CSUEB

HW#1

Total 50 points (5 points each)

1.

What are the three main purposes of an operating system?

Resource management:

The OS manages the computer's resources, such as memory, CPU, and input/output devices, to ensure that applications has access to the resources.

Process management:

managing processes. It handles the creation, scheduling, and termination of processes, ensuring fair and efficient utilization of the CPU.

User interface:

The OS provides a user interface (UI) that enables users to interact with the computer and its applications.

The UI can be graphical or text-based, and it provides access to various applications.

2.

What is the main difficulty that a programmer must overcome in writing an operating system for a real-time environment?

The main difficulty in writing an operating system for a real-time environment is ensuring predictable and timely response to events and tasks within specific time constraints.

3.

How does the distinction between kernel mode and user mode function as a rudimentary form of protection (security) system?

A processor in a computer running Windows has two different modes: user mode and kernel mode.

The processor switches between the two modes depending on what type of code is running on the processor.

Applications run in user mode, and core operating system components run in kernel mode.

4.

Give two reasons why caches are useful. What problems do they solve?

What problems do they cause? If a cache can be made as large as the device for which it is caching (for instance, a cache as large as a disk), why not make it that large and eliminate the device?

Give two reasons why caches are usefu:

1.Caches are useful when two or more components need to exchange data,

2.the components perform transfers at differing speeds.

Caches solve the transfer problem by providing a buffer of intermediate speed between the components

What problems do they cause?

Caches are generally small stores of temporary memory.

If they get too large, they can cause performance to degrade.

They also can consume memory that other applications might need, negatively impacting application performance.

5.

Describe the differences between symmetric and asymmetric multiprocessing.

What are three advantages and one disadvantage of multiprocessor Systems?

In asymmetric multiprocessing, the processors are not treated equally. One master with slaves; Divided memory space; difficult to im

In symmetric multiprocessing, all the processors are treated equally. CPUs are all equal; share memo

Space; easy to implement;

Advantages:

Better performance and fault-talerance on calculating;

Capable of running paralleled tasks;

Less expense on supporting hardware;

Disadvantages:

Additional time spent on turning programs to run on.

6.

What is the purpose of interrupts? How does an interrupt differ from a trap? Can traps be generated intentionally by a user program? If so, for what purpose?

1) Interrupt is a signal from a hardware or a program that helps CPU figure out which task to perform next. Without interrupts applications with higher priority have to wait for in better control at all times. Interrupts can be Hardware or software or trap.

The main difference between interrupt and trap is that a trap is invoked by user program which is used to call O.S system routine(System Calls) or to catch a arithmetic error while a interrupt is triggered by a hardware or I/O device to allow processor to execute process corresponding to interrupt handler routine.

Yes Traps are generated by a user program for debugging purpose .

They are specially programmed for assistance as program is unable to handle that itself.

It passes system call so that program can find errors if any.

Examples of trap include i) catch arithmetic errors(division by zero) ii) invalid memory access.

Examples of interrupt include i) Key press by the user, e.g. CTRL ALT DEL ii) software error.

7.

Describe some of the challenges of designing operating systems for mobile devices compared with designing operating systems for traditional

PC

S.

The greatest challenges in designing mobile operating systems include:

● Less storage capacity means the operating system must manage memory carefully.

● The operating system must also manage power consumption carefully.

● Less processing power plus fewer processors mean the operating.

● Small screen sizes so there is need accommodate everything to lesser screen sizes.

● More security measures needed because of wireless connection and Mobile contains private information that could be misused.

8.

Identify several advantages and several disadvantages of open-source operating systems. Include the types of people who would find each aspect to be an advantage or a disadvantage.

Advantages of open source system:

1: It is free to use, distribute and modify. That is, there is no need to purchase license.

2: 100% safe and no integrated commercial software.

3: Companies won’t be able to track you.

4: Open Surce OS like linux unlocks large possibilities like web development, servers management that helps developers.

5: Most open source operating systems like linux are stable without any kind of problems.

6: you can make changes to OS and modify it to fit your needs.

7: less virus issues.

8: Web developers who play more with servers find this advantageous because its less prune to viruses and also freely available which could reduce some actual cost.

Disadvantages of Open source system:

1. Difficulty of use - Some open source applications may be tricky to set up and use. Others may lack user-friendly interfaces.

2: less technical support.

3. Compatibility issues -

4. Liabilities and warranties

9.

Some early computers protected the operating system by placing it in a memory partition that could not be modified by either the user or the operating system itself. Describe two difficulties that you think could arise with such a scheme.

The data required by the operating system (passwords, access controls, accounting information) would have to be stored in or passed through unprotected memory, since it would need to be changed occasionally. It mightthus be accessible to unauthorized users.

10. Keeping in mind the various definitions of operating system, Consider whether the operating system should include applications such as web browsers and mail programs. Argue both that it should and that it should not, and support your answers.

Arguments against embedding applications within the operating system: (1) the applications are applications - and not part of an operating system, (2) any performance benefits of running within the kernel are offset by security vulnerabilities, (3) it leads to a bloated operating system.(4)Competition and User Choice.