From 342c7225e352036894716e923317e28aaa0eda08 Mon Sep 17 00:00:00 2001 From: jazzy1902 <124528548+jazzy1902@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:11:02 +0530 Subject: [PATCH] init --- lab3/Makefile | 6 ++++++ lab3/process1.dat | 11 +++++++++++ lab3/process2.dat | 22 ++++++++++++++++++++++ lab3/process3.dat | 16 ++++++++++++++++ lab3/scheduler.cpp | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 lab3/Makefile create mode 100644 lab3/process1.dat create mode 100644 lab3/process2.dat create mode 100644 lab3/process3.dat create mode 100644 lab3/scheduler.cpp diff --git a/lab3/Makefile b/lab3/Makefile new file mode 100644 index 0000000..5b24bac --- /dev/null +++ b/lab3/Makefile @@ -0,0 +1,6 @@ +scheduler.out: scheduler.cpp + g++ scheduler.cpp -o scheduler.out + +run_sched: scheduler.out + ./scheduler.out $(WORKLOAD_FILE) $(SCHEDULING_ALGORITHM) + diff --git a/lab3/process1.dat b/lab3/process1.dat new file mode 100644 index 0000000..ee1996a --- /dev/null +++ b/lab3/process1.dat @@ -0,0 +1,11 @@ + + +
+0 100 2 90 2 80 3 70 2 60 2 10 -1
+2 80 2 80 2 50 3 70 2 40 2 10 -1
+3 70 2 70 2 40 3 70 2 20 2 10 -1
+4 10 2 60 2 30 3 70 2 10 2 10 -1
+5 3 2 3 2 3 -1
+6 5 -1
+10 200 2 3 -1
+
diff --git a/lab3/process2.dat b/lab3/process2.dat new file mode 100644 index 0000000..578ad3b --- /dev/null +++ b/lab3/process2.dat @@ -0,0 +1,22 @@ + + +
+0 5 -1
+1 3 2 3 2 3 -1
+6 10 2 60 2 30 3 70 2 10 2 10 -1
+23 3 2 3 2 3 -1
+24 70 2 70 2 40 3 70 2 20 2 10 -1
+25 3 2 3 2 3 -1
+26 80 2 80 2 50 3 70 2 40 2 10 -1
+27 3 2 3 2 3 -1
+28 25 2 10 -1
+29 3 2 3 2 3 -1
+31 3 2 3 2 3 -1
+33 3 2 3 2 3 -1
+35 3 2 3 2 3 -1
+40 3 2 3 2 3 -1
+40 3 2 3 2 3 -1
+42 3 2 3 2 3 -1
+43 3 2 3 2 3 -1
+45 3 2 3 2 3 -1
+
diff --git a/lab3/process3.dat b/lab3/process3.dat new file mode 100644 index 0000000..0098fa1 --- /dev/null +++ b/lab3/process3.dat @@ -0,0 +1,16 @@ + + +
+0 15 2 5 2 15 2 5 2 15 2 5 2 15 2 5 2 15 2 5 2 15 2 5 2 15 2 5 2 15 2 5 2 5 2 15 2 5 2 5 -1
+2 100 2 180 2 10 -1
+5 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15  2 15 2 15 2 15 2 15 2 15 2 15 2 15 -1
+8 50 6 100 2 10 -1
+12 15 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5  2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 -1
+20 80 2 80 2 201 2 15 -1
+30 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15  2 15 2 15 2 15 -1
+35 6 -1
+36 8 50 2 -1
+37 100 -1
+38 5 2 2 -1
+40 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15  2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 2 15 -1
+
diff --git a/lab3/scheduler.cpp b/lab3/scheduler.cpp new file mode 100644 index 0000000..c5e7271 --- /dev/null +++ b/lab3/scheduler.cpp @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include + +using namespace std; + +void fifo() { + +} + +int main(int argc, char **argv) { + + if(argc != 3) + { + cout <<"usage: ./scheduler.out \nprovided arguments:\n"; + for(int i = 0; i < argc; i++) + cout << argv[i] << "\n"; + return -1; + } + + char *file_to_search_in = argv[1]; + char *scheduler_algorithm = argv[2]; + + ifstream file(file_to_search_in, ios::binary); + string buffer; + // buffer.resize(); + // file.read(&buffer[0], len2); + while(getline(file, buffer)) { + cout << buffer << endl; + } + + return 0; +} \ No newline at end of file