/*********************************************************** * TODO: Fill in this area and delete this line * Name of program: * Authors: * Description: **********************************************************/ /* These are the included libraries. You may need to add more. */ #include #include #include #include #include #include #include #include #include /* Put any symbolic constants (defines) here */ #define True 1 /* C has no booleans! */ #define False 0 #define MAX_CMD 80 /* This is the main function of your project, and it will be run * first before all other functions. */ int main(int argc, char *argv[]) { char cmd_line[MAX_CMD]; /* Parse args and open our image file */ /* Parse boot sector and get information */ /* Get root directory address */ //printf("Root addr is 0x%x\n", root_addr); /* Main loop. You probably want to create a helper function for each command besides quit. */ while(True) { bzero(cmd_line, MAX_CMD); printf("/]"); fgets(cmd_line,MAX_CMD,stdin); /* Start comparing input */ if(strncmp(cmd_line,"info",4)==0) { printf("Going to display info.\n"); } else if(strncmp(cmd_line,"volume",6)==0) { printf("Going to run volume!\n"); } else if(strncmp(cmd_line,"stat",4)==0) { printf("Going to stat!\n"); } else if(strncmp(cmd_line,"cd",2)==0) { printf("Going to cd!\n"); } else if(strncmp(cmd_line,"ls",2)==0) { printf("Going to ls.\n"); } else if(strncmp(cmd_line,"read",4)==0) { printf("Going to read!\n"); } else if(strncmp(cmd_line,"quit",4)==0) { printf("Quitting.\n"); break; } else printf("Unrecognized command.\n"); } /* Close the file */ return 0; /* Success */ }