2013年11月10日 星期日

[IOS] Ch6 Synchronization #1


A cooperating process is one that can affect or be affected by other processes executing in the system. Cooperating processes can either directly share a logical address space (that is, both code and data) or be allowed to share data only through files or messages. The former case is achieved through the use of threads, discussed in Chapter 4. Concurrent access to shared data may result in data inconsistency, however. In this chapter, we discuss various mechanisms to ensure the orderly execution of cooperating processes that share a logical address space, so that data consistency is maintained.

2013年11月9日 星期六

[IOS] Ch5 Process scheduling

Basic concept

  • In a single-processor system, only one process can run at a time
    • Any others must wait until the CPU is free and can be rescheduled.
  • Multiprogramming is to have some process running at all times to maximize CPU utilization. 
    • A process is executed until it must wait, typically for the completion of some I/O request. 
    • Several processes are kept in memory at one time, when one process has to wait, the operating system takes the CPU away from that process and gives the CPU to another process. 
    • Every time one process has to wait, another process can take over use of the CPU.
    • Scheduling of this kind is a fundamental operating-system function.
    • Almost all computer resources are scheduled before use. The CPU is, of course, one of the primary computer resources. Thus, its scheduling is central to operating-system design.

2013年11月8日 星期五

[IOS] Ch4 Multithreaded Programming


  • A thread is a basic unit of CPU utilization
  • Comprises
    • a thread ID
    • a program counter
    • a register set
    • a stack. 
  • Shares with other threads belonging to the same process
    • code section
    • data section
    • other operating-system resources(such as open files and signals)
  • A traditional (or heavyweight) process has a single thread of control.
  • If a process has multiple threads of control, it can perform more than one task at a time.
  • multiprocess 的 overhead 比 multithreaded 大

2013年11月7日 星期四

[IOS] Ch3 Process Concept


Process Concept

  • An operating system executes a variety of programs: 
    • Batch system – jobs
    • Time-shared systems – user programs or tasks
  • Textbook uses the terms job and process almost interchangeably
  • Process – a program in execution; process execution must progress in sequential fashion

2013年11月6日 星期三

[IOS] Ch2 System Structures #3


Virtual Machines

  • A virtual machine takes the layered approach to its logical conclusion. It treats hardware and the operating system kernel as though they were all hardware
  • A virtual machine provides an interface identical to the underlying bare hardware
  • The operating system host creates the illusion that a process has its own processor and (virtual memory)
  • Each guest provided with a (virtual) copy of underlying computer

2013年11月5日 星期二

[IOS] Ch2 System Structures #2

 

Types of System Calls

  • Process control
    • end, abort
    • load, execute
    • create process, terminate process
    • get process attributes, set process attributes
    • wait for time
    • wait event, signal event
    • allocate and free memory
  • File management
    • create file, delete file
    • open, close
    • read, write, reposition
    • get file attributes, set file attributes
  • Device management
    • request device, release device
    • read, write, reposition
    • get device attributes, set device attributes
    • logically attach or detach devices
  • Information maintenance
    • get time or date, set time or date
    • get system data, set system data
    • get process, file, or device attributes
    • set process, file, or device attributes
  • Communications
    • create, delete communication connection
    • send, receive messages
    • transfer status information
    • attach or detach remote devices
  • Protection

[IOS] Ch2 System Structures #1


       We can view an operating system from several vantage points. One view
focuses on the services that the system provides; another, on the interface that it makes available to users and programmers; a third, on its components and their interconnections. In this chapter, we explore all three aspects of operating systems, showing the viewpoints of users, programmers, and operating-system designers. We consider what services an operating system provides, how they are provided, how they are debugged, and what the various methodologies are for designing such systems. Finally, we describe how operating systems are created and how a computer starts its operating system.


-- Operating System Concepts 8th, by Silberschatz, Galvin, Gagne


2013年11月2日 星期六

[SA] Hw2 ftp

SA HW2 DEMO 流程說明

===================
注意: 先在下列位置事先放置檔案供 demo 測試
-----------------------------------------
/home/ftp/public/
/home/ftp/hidden/
/home/ftp/hidden/treasure

使用的 ftp 是 proftpd,FreeBSD 9.2-RELEASE

ZFS

ZFS on /home/ftp
Create a zfs file system with mirror
Do zfs snapshot
Do zfs rollback
Set compression
Reboot and everything is fine (zfs still mount)