Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
25_26_27_28 (1).docx
Скачиваний:
0
Добавлен:
01.05.2025
Размер:
32.57 Кб
Скачать
  1. Protection & File System Implementation

Protection

• The OS must allow users to control sharing of their files => control access to files

• Grant or deny access to file operations depending on protection information

• Access lists and groups (Windows NT)

– Keep an access list for each file with user name and type of access

– Lists can become large and tedious to maintain

• Access control bits (UNIX)

– Three categories of users (owner, group, world)

– Three types of access privileges (read, write, execute)

– Maintain a bit for each combination (111101000 = rwxr-x---)

File System Implementation

File systems store several important data structures on the disk:

• A boot-control block, the boot block in UNIX or the partition boot sector in Windows contains information about how to boot the system off of this disk. This will generally be the first sector of the volume if there is a bootable system loaded on that volume, or the block will be left vacant otherwise.

• A volume control block, the master file table in UNIX or the superblock in Windows, which contains information such as the partition table, number of blocks on each file system, and pointers to free blocks and free FCB blocks.

• A directory structure, containing file names and pointers to corresponding FCBs. UNIX uses inode numbers, and NTFS uses a master file table.

• The File Control Block, FCB, ( per file ) containing details about ownership, size, permissions, dates, etc. UNIX stores this information in in odes, and NTFS in the master file table as a relational database structure.

Экзаменационный билет № 28

1. Scheduling : Shortest Job First (SJF)

2. Paging : a page fault, how does the OS know it needs to take one, and what does the OS do when a page fault occurs?

3. How Disks Work. Disk Overheads

  1. Scheduling : Shortest Job First (sjf)

Shortest Job First (SJF). Shortest Job First (SJF) is a scheduling policy that selects the waiting process with the smallest execution time to execute next. Shortest job first is advantageous because it minimizes the average wait time. However, it is generally not possible to know exactly how much CPU time a job has remaining so it must be estimated.

SJF scheduling is rarely used except in specialized environments where accurate estimations of the runtime of all processes are possible. This scheduler also has the potential for process starvation for processes which will require a long time to complete if short processes are continually added. A variant of this scheduler is Shortest Remaining Time First (SRTF) which is for jobs which may perform I/O. The SRTF scheduler brings task back to the run queue based on the estimated time remaining to run after an I/O activity.

Advantage: Minimizes average waiting time. Works for preemptive and non-preemptive schedulers Disadvantage: Cannot know how much time a job has remaining. Long running jobs can be starved for CPU.

  1. Paging : a page fault, how does the os know it needs to take one, and what does the os do when a page fault occurs?

Page Faults

  • For pages in the backing store, clear the exists bit in the page table entries.

  • If exists is not set, then a reference to the page causes a trap to the operating system.

  • These traps are called page faults.

When the CPU tries to access a program location from a page that is not present in memory, we say that a page fault occurs.

When page fault occurs, the operating system:

  • Finds a free page frame in memory

  • Reads the page in from backing store to the page frame

  • Updates the page table entry, setting exists

  • Resumes execution of the thread

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]