"operating system"
Course design task book
Guidance teacher: Liu Gang
Designer:
class:
student ID:
Shandong Institute of Architecture School Computer System Software Technical Research
Operating system curriculum design topic
I. File space management in mixed index mode
Design requirements:
Write a program to simulate the file system in the form of a mixed index. You can receive commands for establishment, delete, read, write, and query attributes, and operate in analog file system.
example:
CREATE A1.DOC 8000 // Establish a file with a length of 8,000 bytes, file name is A1.DOC
Earse a1.doc // Remove files
Read A1.DOC 17 3 // Starting from the 17th byte of the A1.Doc file, display 3 bytes of content
Write a1.doc 8 'Test' // Start with the 8th byte of the A1.Doc file, write the 'Test' string
ask A1.DOC // Displays file properties file name, i node number, type, length, time, etc.
Establish a file:
Get the file name from the command, get the file length of the file, create a file;
Find an idle index node from the analog airline index mesh file, fill in the corresponding information;
Find an empty disk block table file, assign an idle disk block, and write the assigned idle disk block number into the address item of the application index node (note the mixed index mode); the index block will be generated (if any The content, content of the file (such as '_'), etc., write into analog disk mirror file;
Create a directory entry, fill in the file name and the index node number of the file name and the application;
. . .
Delete Files
Recycle the space occupied by the file, modify the simulated idle disk block table file;
Recycle index nodespace, modify the simulated idle index node table file;
Modify the analog catalog table file.
. . .
Read file content
. . .
Write file content
. . .
Display file properties
. . .
4 files in the analog file system to simulate the corresponding system environment:
Analog disk space file à analog file system disk 16 byte a piece of capacity: 100K content contains only data and index disk blocks.
Example: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ XYZ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Analog idle disk block table file -> Analog Bit Chart Act indicated by 1 byte representing a disk block expression: 6400 disk block
Example: 00110100
Analog i node table file
Capacity: 100 index nodes 42
Structure of each I node: 1 - number; 1 - Type; 4 - File length; 14 - File establishment / final modification time (YYYYMMDDHMMMS); 22 - physical address (8 direct links, 1 level, 1 Secondary, 1 three-level link);
Example: 3a ....20030420101010 ...
Analog catalog table file
Capacity: 100
Each structure: 11 - File name; 1 - The number of allocated I nodes.
Example: _ _ _ _ _ _ a1docx
Requirements: 1. Analysis, solution
2. Execute each instruction must have a specific prompt content
3. Picture of the basic structural block diagram of the program and flow chart
4. There must be a detailed design and analysis instructions for each part of the program, indicating the principles used by the design implementation, the data structure adopted
5, detailed description of each function (such as creating a process, destruction process, etc.)
6, source code format specification, not less than one-third
7. There must be results in the results of operation.
8, the problem encountered in the design, the designed experience
9, reference materials
10. Development tools are not limited
Two: Process Scheduling Simulation
Design requirements:
Write a program that can create several virtual processes and scheduling a number of virtual processes, and the scheduling policy is a time slice.
Description of the virtual program:
Format of virtual instructions: Operation command operation time
Among them, the operational commands have the following:
l C: Indicates the calculation on the CPU
l i: indicates input
l o: Indicates the output
l W: means waiting
l h: indicates the end of the process
How long does the operation time represent the action command to do?
Suppose the number of I / O devices is not limited
I, O, W The three instructions do not occupy the CPU. If these three instructions should be put into the corresponding waiting queue (INPUT wait queue, Output waiting queue, Wait waiting queue)
Example has a virtual program P1.prc as follows:
C 30
O 12
C 9
i 14
H 0
The meaning of the virtual program is: first calculate 30 seconds on the CPU, then output 12 seconds on the output device, calculate 9 seconds, enter 14 seconds on the input device, and the program ends.
experimental method:
Firstly write three virtual programs with a text editor, you can name P1.PRC P2.PRC P3.PRC, respectively. Then edit the process scheduler, create these three virtual programs into processes, and perform and schedulize according to the instructions of each virtual process. With a text file, only one integer can be placed, indicating a time factor, and is used to adjust the execution speed of the design program OS.exe.
Run results requirements:
You are required to display a row prompt information when each thread is created, occupying a processor, start output, start input, and end operation, respectively, to determine all processing compliance with the corresponding process schedule rules.
Claim:
Design analysis, solution
2. Creating the process To create a process control block (you can refer to the design of the process control block of UINX, requires the necessary information for progress)
3. To have a run queue, ready queue, input waiting queue, Output waiting queue, wait waiting queue
4. The context conversion process when there is a process switching
5. To dynamically display the current status and instruction execution of each process, dynamically display the current state of each queue
6. Draw the basic structural block diagram of the program and flow chart
7. There must be a detailed design and analysis instructions for each part of the program, indicating the principles used by the design implementation, the data structure adopted
8. Detailed description of the various operation functions of the process (such as creating processes, destruction process, etc.)
9. Source code format specification, not less than one-third
10. There must be results in the result of the result.
11. The problems encountered in the design, the experience of designing
12. Reference
13. Development tools are not limited