Operating System - memory Management Part 6 - Notes, Study notes of Operating Systems

In this document description about Memory Management, Buddy system, File-System Interface, Access Methods, File Attributes, File Operations.

Typology: Study notes

2010/2011

Uploaded on 09/01/2011

visir66
visir66 🇮🇳

4.4

(74)

97 documents

1 / 87

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MEMORY MANAGEMENT
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57

Partial preview of the text

Download Operating System - memory Management Part 6 - Notes and more Study notes Operating Systems in PDF only on Docsity!

MEMORY MANAGEMENT

Buddy system

  • (^) The "buddy system" allocates memory from a fixed-size segment consisting of physically contiguous pages.
  • (^) Memory is allocated from this segment using a power- of-2 allocator, which satisfies requests in units sized as a power of 2 (4 KB, 8 KB, 16 KB, and so forth).
  • (^) A request in units not appropriately sized is rounded up to the next highest power of 2.
  • (^) For example, if a request for 11 KB is made, it is satisfied with a 16-KB segment.

Buddy system

  • (^) However, the next-highest power of 2 from 21 KB is 32 KB so either BL or BR is again divided into two 32-KB buddies, CL and CR.
  • (^) One of these buddies is used to satisfy the 21-KB request.

Buddy system

  • (^) The obvious drawback to the buddy system is that rounding up to the next highest power of 2 is very likely to cause fragmentation within allocated segments.
  • (^) For example, a 33-KB request can only be satisfied with a 64-KB segment. In fact, we cannot guarantee that less than 50 percent of the allocated unit will be wasted due to internal fragmentation.

FILE MANAGEMENT

Objectives

  • (^) To explain the function of file systems
  • (^) To describe the interfaces to file systems
  • (^) To discuss file-system design tradeoffs, including access methods, file sharing, file locking, and directory structures
  • (^) To explore file-system protection

File Concept

  • (^) Contiguous logical address space
  • (^) Types:
    • (^) Data
      • (^) numeric
      • (^) character
      • (^) binary
    • (^) Program

File Attributes

  • (^) Name – only information kept in human-readable form
  • (^) Identifier – unique tag (number) identifies file within file system
  • (^) Type – needed for systems that support different types
  • (^) Location – pointer to file location on device
  • (^) Size – current file size
  • (^) Protection – controls who can do reading, writing, executing
  • (^) Time, date, and user identification – data for protection, security, and usage monitoring
  • (^) Information about files are kept in the directory structure, which is maintained on the disk

File Operations

  • (^) File is an abstract data type
    • (^) Create
    • (^) Write
    • (^) Read
    • (^) Reposition within file
    • (^) Delete
    • (^) Truncate
    • Open(Fi) – search the directory structure on disk for entry Fi , and move the content of entry to memory
    • Close (Fi) – move the content of entry Fi in memory to directory structure on disk

Open File Locking

  • (^) Provided by some operating systems and file systems
  • (^) Mediates access to a file
  • (^) Mandatory or advisory:
    • (^) Mandatory – access is denied depending on locks held and requested
    • (^) Advisory – processes can find status of locks and decide what to do

File Types

Name,

Extension

Sequential-access File

Simulation of Sequential Access on a

Direct-access File