Simulate fdisk command for allocating partitioning on a disk

Assignment Help Operating System
Reference no: EM131066615

Integrative Programming

Assignment- Simulating Linux FDISK in TCL

Objective:

To simulate the FDISK command for allocating partitioning on a disk.

Inputs:

- Input text file consisting of disk allocation information (device, starting location, ending location, block size, id, file system)
- User choice: (‘n'-Create a new partition, ‘d'-Delete a partition, ‘p'- Print the partition table, ‘w'-Write the partition table and exit, ‘q'-Quit without saving changes)

Output:

- Display of disk allocation information in a partition table
- Output text file consisting of disk allocation information (device, starting location, ending location, block size, id, file system)

Specification:

The program maintains disk partition allocation information among multiple logical devices.

Any user input should consist of:

(1) a visible prompt (requiring the use of: "flush stdout" after: puts -nonewline "prompt string"

(2) setting the user input to a new variable (requiring the use of: "set var [gets stdin]")

Each option should be implemented as a separate function, so that its function can be called using either a (i) switch or an (ii) if-elseif-else statement.

The disk partition allocation information will be loaded from an input file and stored in a list. The list will be passed as a parameter from the "main" portion of the script to the appropriate function in the file and updated according to the function. To search for a pattern within a list (for checking if a device label exists/doesn't exist), use: lsearch $list $pattern* which returns -1 if the pattern is not found, or the first instance of the pattern within the list if found.

Initially, the program prompts for an input text file to read from. If the file does not exist, it should be created. The program should then loop until the user chooses to quit (either selects choice as 'w' or ‘q'). If the user enters an illegal status, the program will prompt again for the status input. Upon quitting, the program prompts the user to save the list to an output file with the same name as the original input text file.

Attachment:- asmt3_Al.tcl

Reference no: EM131066615

Questions Cloud

Airline claims that the no-show rate for passengers : An airline claims that the no-show rate for passengers is less than 5%. In a sample of 420 randomly selected reservations, 19 were no-shows. Use the z-test for proportions and test the airline's claim. Use a = 0.01. Solution:
Complete a rough draft for the market research : You are to complete a rough draft for the "Market Research" in the GE Project (from the syllabus). Additionally, in your post, please also discuss who your main competitor is and why.
Effects of the insecticide ddt on wild birds : Assume that an ecologist is studying the effects of the insecticide DDT on wild birds in Sumatra. DDT sprayed on insects and vegetation subsequently eaten by female birds seems to affect the thickness of their eggshells and thus affects the protec..
Amount of baldwin cash flow from assets : During the year, the firm issued $45,000 in net new equity and paid off $16,000 in long-term debt. What is the amount of Baldwin's cash flow from assets?
Simulate fdisk command for allocating partitioning on a disk : To simulate the FDISK command for allocating partitioning on a disk. Output text file consisting of disk allocation information (device, starting location, ending location, block size, id, file system).
Building a new factory to produce aluminum baseball bats : (Net present value calculation) Dowling Sportswear is considering building a new factory to produce aluminum baseball bats. This project would require an initial cash outlay of $4,000,000 and would generate annual net cash inflows of $900,000 per ..
Computing the project internal rate of return : If you know that the project has a regular payback of 2.9 years, what is the project's internal rate of return?
Find the probability that the mean amount of time spent : The length of time sixth graders watch television each day is normally distributed with a mean = 118.3 minutes and standard deviation = 43.1 minutes. Use this information to answer the following:
Preparation of consolidated financial statements : 1) How are prime users considered in the preparation of Consolidated Financial Statements? (limit 200 words); 2) The differences that would arise in the consolidated financial statements of Springfield Ltd if the non- controlling interests were cl..

Reviews

Write a Review

Operating System Questions & Answers

  Subject of embedded operating systems

Review an article about the subject of embedded operating systems or embedded systems that appeared in a recent computing magazine or academic journal.

  Frequency definition of bandwidth

In data communication we often use term "bandwidth" when we refer to capacity of a link. Strictly speaking, however, bandwidth refers to range of frequencies that can be carried on a link.

  Explain the difference between the chkdsk and scandisk cmnds

Explain the difference between the Copy command and the Xcopy command

  Security is an essential element in modern operating system

Security is an essential element in modern operating system design. An open and unprotected TCP/IP port can present a significant network operating system vulnerability

  1 what factors affect storage speed2 what features should

1. what factors affect storage speed?2. what features should you look for in a printer? describe at least four in

  Propose the computing and data communications elements

Propose the computing and data communications elements needed to satisfy the system requirements defined in the given case. You must specify the criteria for evaluating the hardware, software and data communications requirements of your system.

  Disk requests arrive at the disk driver

Disk requests arrive at the disk driver for cylinders, 45, 97,21,43,11,69,81,8,55,14,78,74, and 7. A seek takes 5 milliseconds per cylinder moved. Assume that the arm starts initially at cylinder 50 and was moving downward.

  Different types of storage devices are optimal

Convenience and quality of output are important. Explain what method of output would be best for each of the following situations and explain why

  Challenges os faces-passing parameter among user-kernel mode

Write two challenges an OS faces when passing parameters between user and kernel mode. Describe how an OS can overcome them

  Discuss main reasons for it project failures

Discuss the main reasons for IT project failures? Are they because of problems with project management life cycle, product development life cycle,

  What is indexing and what are the different kind of indexing

What is indexing and what are the different kinds of indexing? What is system catalog or catalog relation? How is better known as?

  Identify various hardware components and network topologies

VaryNet Corporation wishes to create 4-individual offices across the globe. They wish to be able to connect these offices over the internet, and they want to make sure that each network is available to each other,

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd