{"id":15421286,"url":"https://github.com/mariasolos/os_shell","last_synced_at":"2025-03-18T02:24:37.458Z","repository":{"id":122982793,"uuid":"258022148","full_name":"MariaSolOs/OS_shell","owner":"MariaSolOs","description":"A simulation of a simple operating system","archived":false,"fork":false,"pushed_at":"2020-05-03T21:56:10.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T09:42:49.079Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MariaSolOs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-22T21:17:45.000Z","updated_at":"2020-05-03T21:56:12.000Z","dependencies_parsed_at":"2023-03-13T10:04:41.430Z","dependency_job_id":null,"html_url":"https://github.com/MariaSolOs/OS_shell","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":0.4,"last_synced_commit":"bab693ddc0a26daa5fa80d27fdda577bbb3ec3f5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MariaSolOs%2FOS_shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MariaSolOs%2FOS_shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MariaSolOs%2FOS_shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MariaSolOs%2FOS_shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MariaSolOs","download_url":"https://codeload.github.com/MariaSolOs/OS_shell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244142358,"owners_count":20404989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T17:34:15.102Z","updated_at":"2025-03-18T02:24:37.435Z","avatar_url":"https://github.com/MariaSolOs.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hi there :)\nHere's some stuff I think you should know about my shell. I've divided my \ncomments into sections (according to which file they refer to). \n\n### GENERAL\n1. Header files are included for all C files.\n2. For more information please look at the comments I included in each file.\n3. I include a nice makefile to compile this project. Make sure all C files and header \nfiles are in the same directory.\n4. You'll obtain error messages when you run my testfile. This is exactly what I want,\nI wish to how my shell won't break. \n\n### SHELL.C\n1. If the user writes no command and presses enter, the prompt is displayed again.\n2. If a file is passed as input through ./mykernel \u003c file.txt, the shell reads each\nline as input and exits at the end of the file.  \n3. Spaces between arguments are ignored. So \"set   x 2\" and \"   set x 2\" are \nequivalent valid commands. The proof that my shell can handle this is shown with my\ntestfile. \n4. In shellUI() I used freopen(\"/dev/tty\", \"r\", stdin) to redirect the input stream\nback to the terminal to deal with the end of piped input (and so when I reach the \nend of the file, the prompt is displayed again, unless there was a quit command).\n\n### SHELLMEMORY.C\n1. The size of the shell's memory array is 1000. If the user tries to set a new\nvariable and memory is full, the set is unsuccesful and the \"set failed.\" \nmessage is displayed. \n2. accessShellMemory is the public API for printing and setting variables in \nshell memory. clearShellMemory is used by the kernel at the end of the session. \n\n### INTERPRETER.C \n1. In exec(), either all the files are successfully executed or nothing runs at \nall. \n2. If a script contains the command \"quit\", then only the \nscript terminates, not the entire shell session.\n\n### KERNEL.C \n1. The ready queue, with a linked-list implementation, is in this C file. It made\nsense to me to have it here since the scheduler is in this file. Note that my\nhead and tail pointers aren't actual PCB pointers but RQNode (Ready Queue Node) \npointers.\n2. After a process runs its quanta, I also check if the quit command was executed. If so,\nI remove the program from the queue.\n3. Note that when a program terminates, I also add all the frames it was using to the\navailable frames queue. This helps to avoid the search for victim frames.\n\n### CPU.C \n1. runInCPU is the public function called by kernel.c. The run function coded\ninside cpu.c remains static (only accessible within this file). \n2. CPUavailable is used as a flag to test if the CPU is currently available. I \nalso use it as a \"mutex\" in runInCPU. \n\n### MEMORYMANAGER.C \n1. In order to keep track of which PCB is using which frame, I have the array of PCB\npointers called usingFrames.\n\nFinally, please appreciate my kernel. I put a lot of effort into it and I'm kind of proud \u003c3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariasolos%2Fos_shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariasolos%2Fos_shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariasolos%2Fos_shell/lists"}