Skip to content
This repository has been archived by the owner on Feb 6, 2019. It is now read-only.

Sam Park #105

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Sprint Challenge: Operating Systems and Scheduling

## Short Answer Questions

Add your answers inline, below, with your pull request.

1. Name at least three things that a general-purpose operating system is responsible for handling.
Memory allocation, job scheduling, and input/output control.

2. Describe the job of the Scheduler in the OS in general.
Selects and processes from the queue and loads them into memory for execution.

3. Describe the benefits of the MLFQ over a plain Round-Robin scheduler.

3. Describe the benefits of the MLFQ over a plain Round-Robin scheduler.
Round robin has no priorty which means every process has equal priorty. Processes that are more important to the user are not treated as such by the scheduler. MLFQ on the other hand learns from past behaviour to predict the processes that should have higher priority. Usually this translates to a better overall user experience.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice answers...clearly you understand this material well

## Programming Exercise: The Lambda School Shell (`lssh`)

Important Safety Tip: Resist the urge to start coding until you:
Expand Down
29 changes: 26 additions & 3 deletions lssh/lssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

#include <errno.h>
#define PROMPT "lambda-shell$ "

#define MAX_TOKENS 100
Expand Down Expand Up @@ -100,9 +100,32 @@ int main(void)

#endif

/* Add your code for implementing the shell's logic here */

/* Add your code for implementing the shell's logic here */
if (strcmp(args[0], "cd") == 0) {
if (args_count != 2) {
printf("Incorrect args input\n");
continue;
} else {
if (chdir(args[1]) == -1) {
perror("chdir");
continue;
} else if (chdir(args[1]) == 0) {
chdir(args[1]);
}
continue;
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice clean code!..consider using comments.

int rc = fork();

if (rc < 0) {
printf("Fork failed\n");
exit(1);
} else if (rc == 0){
execvp(args[0], args);
printf("This should not be seen!");
}

}
return 0;
}