Operating System Concepts Essentials 2nd - Chapter 2 - Exercises

2.4 What are the three major activities of an operating system with regard to secondary-storage management?

  • Free storage space management
  • Appropriate storage allocation
  • Disk scheduling

2.6 What system calls have to be executed by a command interpreter or shell in order to start a new process?

  • Take FreeBSD (derived from Berkeley UNIX) as an example, to start a new process, the shell executes a fork() system call. Then, the selected program is loaded into memory via an exec() system call, and the program is executed.

2.9 List five services provided by an operating system, and explain how each creates convenience for users. In which cases would it be impossible for user-level programs to provide these services? Explain your answer.

  • Program execution
    The operating system loads the contents or sections of a file into memory and begins its execution. A user-level program couldn’t be trusted to properly allocate CPU time.
  • I/O operations
    The user needs only specify the device and the operation to perform on it. User-level programs cannot be trusted to access only devices they should have access to and to access them only when they are otherwise unused.
  • File-system manipulation
    The details in operations related to file, like creation, deletion, allocation, and so on, which users should not have to perform. User programs could neither be trusted to allocate only free blocks and deallocate blocks on file deletion nor ensure the protection of files.
  • Communications
    There are communications like massage sending or receiving existing between two processes or more. So packet ordering and data correction must take place, which is not ensured by user programs as they might receive wrong packets.
  • Error detection
    Error detection occurs at both the hardware and software levels. When an error occurs, there must be a global program to handle all levels of error, something that users cannot do.

2.13 Describe three general methods for passing parameters to the operating system.

  • Pass the parameters in registers.
  • Registers pass the address of blocks of parameters.
  • Parameters can be placed, or pushed, onto the stack by the program, and popped off the stack by the operating system.

2.16 What are the advantages and disadvantages of using the same systemcall interface for manipulating both files and devices?

  • Due to the great similarity between I/O devices and files, it is a facility to use the same set of system calls on both files and devices. But it may cause the loss of functionality and performance.

2.23 How are iOS and Android similar? How are they different?

  • Similarity
    Both are layered stack of software that provides a rich set of frameworks for developing mobile applications.
    Both are based on based on existing kernels.
  • Difference
    iOS only for apple devices while Android for a variety of mobile platforms.
    iOS is closed-source while Android is open-source.
    iOS applications are developed in Objective-C, Android in Java.
    iOS executes code natively while Android uses a virtual machine.

2.24 Explain why Java programs running on Android systems do not use the standard Java API and virtual machine.

  • It is because the standard API and virtual machine are designed for desktop and server systems, not mobile devices. Android chooses to use a self-designed API provided by Google and Dalvik virtual machine which is optimized for mobile devices.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值