Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

File and I/O Management, File Operations, File Allocation Methods, Introduction to Android, Study notes of Operating Systems

File and I/O Management, File Operations, File Allocation Methods, Introduction to Android Operating System, Android Development Framework, SmallApplication Development using Android Development Framework

Typology: Study notes

2024/2025

Available from 05/19/2025

raziya-shiak
raziya-shiak 🇮🇳

5 documents

1 / 23

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
OPERATING SYSTEM-5
File and I/O Management, OS
security : Directory Structure, File Operations, File Allocation
Methods, Device Management, Pipes, Buffer, Shared
Memory, Security Policy Mechanism, Protection,
Authentication and Internal Access Authorization Introduction
to Android Operating System, Android Development
Framework, Android Application Architecture, Android
Process Management and File System, Small Application
Development using Android Development Framework.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17

Partial preview of the text

Download File and I/O Management, File Operations, File Allocation Methods, Introduction to Android and more Study notes Operating Systems in PDF only on Docsity!

OPERATING SYSTEM- 5

File and I/O Management, OS

security : Directory Structure, File Operations, File Allocation

Methods, Device Management, Pipes, Buffer, Shared

Memory, Security Policy Mechanism, Protection,

Authentication and Internal Access Authorization Introduction

to Android Operating System, Android Development

Framework, Android Application Architecture, Android

Process Management and File System, Small Application

Development using Android Development Framework.

1.Explain Directory Structure? A Directory is the collection of the correlated files on the disk. In simple words, a directory is like a container which contains file and folder. In a directory, we can store the complete file attributes or some attributes of the file. There are various types of information which are stored in a directory:

  1. Name
  2. Type
  3. Location
  4. Size
  5. Position
  6. Protection
  7. Usage Name: - Name is the name of the directory, which is visible to the user. Type: - Type of a directory means what type of directory is present such as single-level directory, two-level directory, tree-structured directory, and Acyclic graph directory. Location: - Location is the location of the device where the header of a file is located. Size: - Size means number of words/blocks/bytes in the file.

1. Two-Level Directory Two-Level Directory is another type of directory structure. In this, it is possible to create an individual directory for each of the users. There is one master node in the two-level directory that include an individual directory for every user. At the second level of the directory, there is a different directory present for each of the users. Without permission, no user can enter into the other user’s directory. 2. Tree-Structured Directory In a tree directory structure, except root directory, every directory or file has only one parent directory. So, there is a total separation between the users which provide complete naming freedom. Here, if a user wishes to access another users file, it has to go through two or more directories. 3. Acyclic-Graph Directory Structure This problem can be solved by the acyclic-graph directory structure. As this directory structure allows a directory or a file to have many parent

directories. So, a shared file in a directory can be pointed by the other user directories who have access to that shared file using the links. In the diagram below you can see that the directory having file F7 and F8 have two parent directories.

2. Write about File Operations? A file is a collection of logically related data that is recorded on the secondary storage in the form of sequence of operations. 1. Create operation: This operation is used to create a file in the file system. It is the most widely used operation performed on the file system. To create a new file of a particular type the associated application program calls the file system. 2. Open operation: The user wants to open a file, it provides a file name to open the particular file in the file system. 3. Write operation: This operation is used to write the information into a file. 4. Read operation: This operation reads the contents from a file. A Read pointer is maintained by the OS, pointing to the position up to which the data has been read.

1. Contiguous File allocation In contiguous file allocation, the block is allocated in such a manner that all the allocated blocks in the hard disk are adjacent. Assuming a file needs 'n' number of blocks in the disk and the file begins with a block at position'x', the next blocks to be assigned to it will be x+1,x+2,x+3,...,x+n- 1 so that they are in a contiguous manner. Advantages - It is very easy to implement. - Memory access is faster. - It supports sequential as well as direct access. 2. Linked File Allocation The Linked file allocation overcomes the drawback of contiguous file allocation. Here the file which we store on the hard disk is stored in a scattered manner according to the space available on the hard disk.

Advantages

  • There is no external fragmentation.
  • The directory entry just needs the address of starting block.
  • Indexed File Allocation. The indexed file allocation is somewhat similar to linked file allocation as indexed file allocation also uses pointers but the difference is here all the pointers are put together into one location which is called index block. Example As shown in the diagram below block 19 is the index block which contains all the addresses of the file named text1. In order, the first storage block is 9, followed by 16, 1, then 10, and 25. The negative number - 1 here denotes the empty index block list as the file text1 is still too small to fill more blocks.

This system call would create a pipe for one-way communication i.e., it creates two descriptors, first one is connected to read from the pipe and other one is connected to write into the pipe.

5. What is Buffer? Types of Buffering? The buffer is an area in the main memory used to store or hold the data temporarily. In other words, buffer temporarily stores data transmitted from one place to another, either between two devices or an application. The act of storing data temporarily in the buffer is called buffering. 1. Single Buffer In Single Buffering, only one buffer is used to transfer the data between two devices. The producer produces one block of data into the buffer. After that, the consumer consumes the buffer. Only when the buffer is empty, the processor again produces the data. 2. Double Buffer In Double Buffering , two schemes or two buffers are used in the place of one. In this buffering, the producer produces one buffer while the consumer consumes another buffer simultaneously. So, the producer not needs to wait for filling the buffer. Double buffering is also known as buffer swapping. 3. Circular Buffer When more than two buffers are used, the buffers' collection is called a circular buffer. Each buffer is being one unit in the circular buffer. The data transfer rate will increase using the circular buffer rather than the double buffering.

How Buffering Works

6. What is Shared Memory? Shared memory is a memory shared between two or more processes. Shared memory is a memory shared between two or more processes. Each process has its own address space; if any process wants to communicate with some information from its own address space to other processes, then it is only possible with IPC (inter-process communication) techniques.

  • Authentication
  • One Time passwords
  • Program Threats
  • System Threats Authentication Authentication refers to identifying each user of the system and associating the executing programs with those users. Operating Systems generally identifies/authenticates users using following three ways −
  • Username / Password − User need to enter a registered username and password with Operating system to login into the system.
  • User card/key − User need to punch card in card slot, or enter key generated by key generator in option provided by operating system to login into the system.
  • User attribute - fingerprint/ eye retina pattern/ signature − User need to pass his/her attribute via designated input device used by operating system to login into the system. One Time passwords One-time passwords provide additional security along with normal authentication. In One-Time Password system, a unique password is required every time user tries to login into the system. Once a one-time password is used, then it cannot be used again. Program Threats Operating system's processes and kernel do the designated task as instructed. If a user program made these process do malicious tasks, then it is known as Program Threats. One of the common example of program threat is a program installed in a computer which can store and send user credentials via network to some hacker. System Threats System threats refers to misuse of system services and network connections to put user in trouble. System threats can be used to launch program threats on a complete network called as program attack. System threats creates such an environment that operating system resources/ user files are misused.

8. What is Authentication and Internal Access Authorization? Access Authorization Authorization is the process of giving someone permission to do or have something. In multi-user computer systems, a system administrator defines for the system which users are allowed access to the system and what privileges of use - Authorization is a process by which a server determines if the client has permission to use a resource or access a file. - The type of authentication required for authorization may vary; passwords may be required in some cases but not in others. - In some cases, there is no authorization; any user may be use a resource or access a file simply by asking for it. Most of the web pages on the Internet require no authentication or authorization. Most web security systems are based on a two-step process. The first step is authentication, which ensures about the user identity and the second stage is authorization, which allows the user to access the various resources based on the user's identity. Authentication in Operating System Authentication mechanism determines the users identity before revealing the sensitive information. It is very crucial for the system or interfaces where the user priority is to protect the confidential information. In the process, the user makes a provable claim about individual identity (his or her) or an entity identity. The credentials or claim could be a username, password, fingerprint etc.

Android Architecture android architecture or Android software stack is categorized into five parts:

  1. linux kernel
  2. native libraries (middleware),
  3. Android Runtime
  4. Application Framework
  5. Applications Linux Kernel The android uses the powerful Linux kernel and it supports a wide range of hardware drivers. The kernel is the heart of the operating system that manages input and output requests from the software. Libraries The on top of a Linux kennel there is a set of libraries including open-source web browsers such as WebKit, library libc. These libraries are used to play and record audio and video.

Android Runtime The android runtime provides a key component called Dalvik Virtual Machine which is a kind of java virtual machine. It is specially designed and optimized for android. The Dalvik VM is the process virtual machine in the android operating system. It is software that runs apps on android devices. Application Framework The application framework layer provides many higher-level services to applications such as windows manager, view system, package manager, resource manager, etc. Applications You will find all the android applications at the top layer and you will write your application and install it on this layer. Examples of such applications are contacts, books, browsers, services, etc. Each application performs a different role in the overall applications.

**10. Explain Android Development Framework? Top Android Frameworks For App Development

  1. Flutter Android Framework** Flutter is an open-source UI-based framework developed by Google in
  2. It is cross-platform, meaning a single codebase is required for iOS and Android. Flutter is a prevalent choice nowadays due to its productivity and efficiency. It helps to create a beautiful user interface that provides a native-like feel and has various widgets which can be personalized to create a beautiful front end. Which Companies Use the Flutter Framework? Companies like Alibaba, Google, CapitalOne, Tencent, and eBay have used the Flutter framework to create mobile applications, making it a trend on the rise. 2. Ionic Android Framework Released in 2015, Ionic is an open-source front-end framework based on technologies such as HTML, CSS, JavaScript, Angular, and Typescript. It

11. Explain Android Applications? Android Applications Android applications are usually developed in the Java language using the Android Software Development Kit. Once developed, Android applications can be packaged easily and sold out either through a store such as Google Play , SlideME , Opera Mobile Store , Mobango , F-droid and the Amazon Appstore. Android powers hundreds of millions of mobile devices in more than 190 countries around the world. It's the largest installed base of any mobile platform and growing fast. Every day more than 1 million new Android devices are activated worldwide. This tutorial has been written with an aim to teach you how to develop and package Android application. We will start from environment setup for Android application programming and then drill down to look into various aspects of Android applications. Categories of Android applications There are many android applications in the market. The top categories are −

12. Explain Android Process Management and File System?

  1. Every Android application runs in its own linux process.
  2. Every application consists of different components like activity, service and Broadcast receiver.
  3. The applications should use these components correctly, otherwise the system will kill the application processes. Process types
  4. foreground process
  5. isible process
  6. service process 4.Background process 5.Empty process File system The Android OS is a popular and universally used operating system for smartphones. Android’s user-visible file system is one of its advantages over iOS. It allows you to more easily work with files, opening them in any app of your choice as long as you know how. Like other modern operating systems, Android has a disk-based file system. There are two storage areas: internal and external. Internal storage refers to the built-in, non-volatile memory. Devices also can come with removable memory (like a SD card), which is referred to as external storage. The internal storage is also occasionally referred to as permanent storage. Files saved in internal storage are accessible only to your app by default. External storage can be removed at any time and files saved here can be accessible to everyone.