-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
427 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "../library/program.h" | ||
#include "../library/textio.h" | ||
|
||
int main() { | ||
struct shell_data data; | ||
getShellData(&data); | ||
endl; | ||
putsc("cd <DEST>", COLOR_LIGHT_CYAN); | ||
puts("- Moves current working directory to destination path"); endl; | ||
putsc("ls", COLOR_LIGHT_CYAN); | ||
puts(" - Displays content of current directory"); endl; | ||
putsc("mv <FILE> <DEST_PATH>", COLOR_LIGHT_CYAN); | ||
puts(" - Moves a file to destination path"); endl; | ||
putsc("mkdir <DIR_NAME>", COLOR_LIGHT_CYAN); | ||
puts(" - Creates a new directory in current working directory"); endl; | ||
putsc("cat <FILE>", COLOR_LIGHT_CYAN); | ||
puts(" - Prints the content of a file"); endl; | ||
putsc("cp <FILE> <DEST_PATH> / <NEW_NAME>", COLOR_LIGHT_CYAN); | ||
puts(" - Copies a file to a path or to the same path with different name"); endl; | ||
endl; | ||
exit(&data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "../library/program.h" | ||
#include "../library/textio.h" | ||
#include "../library/string.h" | ||
|
||
int main() { | ||
struct shell_data data; | ||
bool is_valid = false; | ||
getShellData(&data); | ||
puts("i "); putsc("love", COLOR_LIGHT_RED); puts(" you, so "); putsc("much.", COLOR_LIGHT_GREEN); endl; | ||
puts("please be my "); putsc("angel", COLOR_LIGHT_MAGENTA); puts(", "); putsc("baby.", COLOR_LIGHT_BLUE); endl; | ||
while (!is_valid) { | ||
puts("your response: (yes/no) "); gets(data.cwd.input); endl; | ||
is_valid = strcmp(data.cwd.input, "yes") || strcmp(data.cwd.input, "no"); | ||
if (is_valid) { | ||
if (strcmp(data.cwd.input,"yes")) { | ||
puts("thank you "); putsc("<3", COLOR_LIGHT_MAGENTA); endl; | ||
} else { | ||
putsc("asge.", COLOR_LIGHT_RED); endl; | ||
} | ||
} else { | ||
putsc("invalid response.", COLOR_LIGHT_RED); endl; | ||
} | ||
} | ||
exit(&data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "../library/program.h" | ||
#include "../library/textio.h" | ||
|
||
int main() { | ||
struct shell_data data; | ||
getShellData(&data); | ||
putsc("====================================================", 0x0A); endl; | ||
putsc("|| _ _ _____ _____ _____ ||", 0x0A); endl; | ||
putsc("|| | \\ | | | _ / ___| / __ \\ ||", 0x0A); endl; | ||
putsc("|| | \\| | _____ _| | | \\ `--. ______| / \\/ ||", 0x0A); endl; | ||
putsc("|| | . ` |/ _ \\ \\ /\\ / / | | |`--. \\______| | ||", 0x0A); endl; | ||
putsc("|| | |\\ | __/\\ V V /\\ \\_/ /\\__/ / | \\__/\\ ||", 0x0A); endl; | ||
putsc("|| \\_| \\_/\\___| \\_/\\_/ \\___/\\____/ \\____/ ||", 0x0A); endl; | ||
putsc("|| v.3.0.0 ||", 0x0A); endl; | ||
putsc("====================================================", 0x0A); endl; | ||
putsc(" Made by three dudes: ", 0x0A); endl; | ||
putsc("- 13520103 - Amar Fadil", 0x0A); endl; | ||
putsc("- 13520124 - Owen Christian Wijaya", 0x0A); endl; | ||
putsc("- 13520139 - Fachry Dennis Heraldi", 0x0A); endl; | ||
endl;endl; | ||
exit(&data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef __STRUCT_LIB_H | ||
#define __STRUCT_LIB_H | ||
|
||
#include "constant.h" | ||
#include "std_type.h" | ||
|
||
struct parsed_arg { | ||
byte arg_cdir; | ||
byte arg_ldir; | ||
char name_res[14]; | ||
struct node_entry *node; | ||
bool is_traversed; // is traversed with apply path (absolute/relative) | ||
}; | ||
|
||
// 256 * 8 (2048 / 4 sector) args | ||
struct shell_arguments { | ||
char argv[MAX_ARGS][MAX_INPUT]; | ||
}; | ||
|
||
enum parser_retcode { | ||
INPUT_TRAIL = 0, | ||
INPUT_END = 1, | ||
UNCLOSED_STRING = 2, | ||
ARG_LIMIT = 3 | ||
}; | ||
|
||
// 256 + 1 + 2 + 2 (512/1 sector) input | ||
struct shell_cwd { | ||
char input[MAX_INPUT]; | ||
byte current_dir; | ||
int cur_inp_idx; | ||
int arg_count; | ||
int prog_count; | ||
enum parser_retcode parse_ret; | ||
}; | ||
|
||
// 256 + 1 + 2 + 2 (1 sector) + 4 sector arg + 4 sector hist | ||
// shell data starts from sector 0x120 | ||
struct shell_data { | ||
struct shell_cwd cwd; | ||
struct shell_arguments arg; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
c4bcf1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lancar jaya milestone 3-nya. Snakenya ngegas gan kalo ga di-throttle IPS-nya