Skip to content

ghpk98/OS-Term-Project

Repository files navigation

OS-Term-Project

Korea Univ. 2022 Spring COSE341 Operating System_TEAM 3


Implement First Come First Served, Shortest Job First, Shortest Remaining Task First, Round Robin, Priority, Preemptive Priority, Non-preemptive Priority with Round Robin scheduling algorithm learned in class and derive Gantt chart, Waiting time, Response time and Turn around time.

Based on the results of each algorithm, the understanding of algorithm is improved. Furthermore, based on the output, the scheduling algorithm adopted by modern systems is understood centering on Linux's Complete Fair Scheduler (CFS).

Development environment

  • Scheduling algorithm : C
  • Evaluation Module : Python

image

Specification

Visualization of scheduling results and Gantt chart for the 7 algorithms below

  • First Come First Served
  • Shortest Job First
  • Shortest Remaining Time First
  • Round Robin
  • Non-Preemptive Priority
  • Preemptive Priority
  • Non-Preemptive Priority with RR

How to use

image image

  1. Download part1_final.exe and part2_final.exe to the same path.
    https://github.com/ghpk98/OS-Term-Project/tree/main/simulator

  2. Create a subfolder in the path where step 1 was performed, and create test data as a txt file in the created folder.
    (The most important thing in step 2 is that the name of the created subfolder and the name of the test data txt file should be the same.)

  3. Execute part1_final.exe and part2_final.exe sequentially. The first input of all executable files is the name of the subfolder(=name of the test data txt file) performed in steps 1 and 2.

Results for some test cases

C part_Shell output

image

NOTE: Results for the 7 scheduling algorithms are output to the shell in the format above.

C part_txt data file

image

NOTE: Results for 7 scheduling algorithms are saved with txt extension for use in Gantt chart visualization, evaluation module. NOTE: txt data file의 format은 #9 에 정리되어 있습니다

Python part_Gantt chart

image

image

test2_GanttChartAnimation

NOTE: Input data https://github.com/ghpk98/OS-Term-Project/blob/main/simulator/test2/test2.txt_

NOTE: The executable file, which is the output of this project, provides a Gantt chart of the PNG and GIF extensions.

Python part_Evaluation module

After the first input of part2_final.exe, the activated pyplot window must be closed to perform the next process. pyplot window The next step is to create an animation. The generated animation is created with a GIF extension in the folder where the test data is located. After creating the animation, output the menu and wait for user input. The menu provided is as follows.

image

image

image

image

Function diagram

final function diagram

NOTE: that all input/output data is processed with txt extension.

Features

Main idea

알고리즘별 스케줄링과 간트 차트 및 알고리즘 비교를 각각 C, Python으로 진행하였습니다. 수업시간에 배운 layering 개념을 활용해보았습니다. Layering은 운영체제의 복잡도를 낮추기 위한 방안 중 하나로 계층을 나누는 것입니다. 각 계층은 인접한 계층과 통신할 수 있습니다. 이를 통해 각 계층 사이의 interface와 semantics만 맞추면 개발과 유지 및 보수가 쉽고 언어에 따라 실행 파일을 분리함으로써 불필요한 자원을 회수할 수 있습니다. 예를 들어 간트 차트를 생성할 때는 스케줄링에 필요한 priority queue와 ready queue가 필요하지 않기 때문에 이러한 자료구조들은 더 이상 유지하지 않아도 됩니다. 즉, 메모리와 CPU 자원 사용 측면에서 유리합니다.

Features
1. 개발 진행 용이 알고리즘 구현 계층과 평가 모듈 구현 계층의 입출력 format(face between layer)만 맞춘다면 동시 개발이 가능합니다. 이 덕분에 실제 텀 프로젝트 동안 UI 팀이 알고리즘 팀의 코드를 기다리지 않고 주어진 기간을 십분 활용할 수 있었습니다. 즉, 알고리즘 구현 계층의 출력 형식을 엄격하게 지키면 이를 평가 모듈 구현 계층의 입력으로 사용하는 UI의 동시 개발이 가능합니다
2. 유지 보수 용이 계층 간 interface와 semantics만 맞추면 되기 때문에 추가 기능 구현이 용이합니다. 다른 추가적인 평가 모듈 확장을 원할 경우 알고리즘 구현 계층의 내부 동작방식을 모르더라도 출력 양식만 확인하여 개발이 가능합니다.
3. 계층별 최적의 프로그래밍 언어 선택 각 계층별 적합한 언어 선택이 가능했습니다. Computation 속도가 상대적으로 좋은 C언어로 알고리즘 계층을 구현하고 다양한 시각화 모듈을 지원하는 python을 평가 모듈 계층에 사용하였습니다.
4. 편리한 테스트 데이터 관리 각 테스트 데이터들을 개별 폴더로 관리할 수 있도록 하였습니다. 실행파일을 설치한 경로에 test data(txt file)을 test라는 폴더 내에 포함시키면 알고리즘 구현 계층에서 생성한 알고리즘별 스케줄링 결과(txt file)와 평가 모듈에서 생성한 간트차트(png, gif file)를 해당 폴더에 저장하도록 하였습니다. 사용자는 test data를 포함하는 폴더 이름만 프로그램에 입력하면 모든 기능을 사용할 수 있습니다.

Main issues discussed

Development Technical Documentation

  • Corner case : #10
  • Animation Ideas : #12
  • Python Part Executable File Excessive Execution Time Problem : #14

Meeting Record

  • 2nd BREAKOUT MEETING : #2
  • 3rd BREAKOUT MEETING : #5

Development Timeline

image

Contributor

Member Contributions Contact
손혜강
(Leader)
+ Function implementation (Python : Gantt chart image⦁animation and executable file generation)
+ Project scheduling and management [responsibility]
+ GitHub Management
+ Structural design and final report creation
oss67820@korea.ac.kr
박건호 + Write Skeleton code and create executable file
+ Algorithm implementation (C language : FCFS, SJF, RR, non-preemptive priority, non-preemptive priority with RR)
+ GitHub Management [responsibility]
+ Build testcase and write final report
조혜민 + Algorithm implementation (C language - SRTF, preemption priority)
+ Presentation planning (responsibility)
+ Final report preparation [responsibility]
홍지선 + Function implementation (Python – time table function and code collection)
+ Test plan management [responsibility]
+ Meeting management and final report creation

How to submit questions related to README.md

Contact the README.md author (team leader)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published