{"id":23452304,"url":"https://github.com/maxam2017/introduction-to-operating-systems","last_synced_at":"2025-04-10T16:55:48.917Z","repository":{"id":109005603,"uuid":"127111418","full_name":"maxam2017/Introduction-to-Operating-Systems","owner":"maxam2017","description":"NCTU / 作業系統概論 / 張立平","archived":false,"fork":false,"pushed_at":"2018-06-14T02:28:45.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T20:41:41.644Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxam2017.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-03-28T08:48:04.000Z","updated_at":"2018-12-20T10:43:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"6874f43a-ff17-4089-ab97-8c5d0343e9ba","html_url":"https://github.com/maxam2017/Introduction-to-Operating-Systems","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxam2017%2FIntroduction-to-Operating-Systems","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxam2017%2FIntroduction-to-Operating-Systems/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxam2017%2FIntroduction-to-Operating-Systems/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxam2017%2FIntroduction-to-Operating-Systems/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxam2017","download_url":"https://codeload.github.com/maxam2017/Introduction-to-Operating-Systems/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248257979,"owners_count":21073833,"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-12-24T01:14:50.338Z","updated_at":"2025-04-10T16:55:48.909Z","avatar_url":"https://github.com/maxam2017.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction-to-Operating-Systems\nNCTU / 作業系統概論 / 張立平\n\n### hw1\n* prevent zombie process when excuting in background\n* fork twice and kill the first one \n* the ppid of grandchild process is 1 (init) [adopted]\n\n### hw2\n* `ipcs -M` show shared memory size [shmmax] \u003cbyte\u003e\n* segment fault ==\u003e enlarge shared memory\n  * edit `/etc/sysctl.conf`\n  * setting `shmmax` twice larger than before\n    ```\n    kern.sysv.shmmax=16777216\n    kern.sysv.shmmin=1\n    kern.sysv.shmmni=128\n    kern.sysv.shmseg=32\n    kern.sysv.shmall=4096\n    ```\n* `ipcs -m` show the info of processes which take up shared memory\n* `ipcrm -m \u003cPID\u003e` clear the shared memory taken up by this process\n\n### hw3\n* compile\n  * -pthead\n  * -g : for gdb \u003cmulti-thread programming is difficult to debug\u003e\n* not fit requirement\n  * using T\u003csub\u003e0\u003c/sub\u003e to fulfill pthread_join\n  * this code using main function to recycle last 8 threads\n\n### hw4\n* using a semaphore[add] to restrict the dimension of thread pool\n  * this semaphore post once when the dimension of thread pool increment\n  * capacity = semaphore value\n* using a semaphore[work] to wait sorting\n  * post this semaphore when a task push into job list\n* using a semaphore[done] to wait last 8 threads(bubble sort)\n  * wait at main function (may not fulfill requirement)\n  \n### hw5\n* page replacement\n  \u003e use \u003cmap\u003e to implement hash [reference string to frame]\n  * FIFO\n  * LRU (least recently used)\n    * using double linked list to record LRU memory\n\n### hw6\n* \u003cgetopt.h\u003e for parsing argument more easily.\n* \u003cdirent.h\u003e use to open directory recursively.\n* \u003csys/stat.h\u003e get the metadata of file/directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxam2017%2Fintroduction-to-operating-systems","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxam2017%2Fintroduction-to-operating-systems","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxam2017%2Fintroduction-to-operating-systems/lists"}