{"id":21553408,"url":"https://github.com/cbebe/os-rust","last_synced_at":"2025-03-18T02:35:29.549Z","repository":{"id":217059857,"uuid":"435107256","full_name":"cbebe/os-rust","owner":"cbebe","description":"My attempts to rewrite my Operating Systems course assignments (written in C) in Rust","archived":false,"fork":false,"pushed_at":"2022-07-01T23:33:28.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T10:08:23.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/cbebe.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}},"created_at":"2021-12-05T07:59:59.000Z","updated_at":"2024-01-14T02:27:16.000Z","dependencies_parsed_at":"2024-01-14T10:57:12.179Z","dependency_job_id":null,"html_url":"https://github.com/cbebe/os-rust","commit_stats":null,"previous_names":["cbebe/os-rust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbebe%2Fos-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbebe%2Fos-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbebe%2Fos-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbebe%2Fos-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbebe","download_url":"https://codeload.github.com/cbebe/os-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244144741,"owners_count":20405513,"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-11-24T07:10:40.256Z","updated_at":"2025-03-18T02:35:29.529Z","avatar_url":"https://github.com/cbebe.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OS Concepts Assignments in Rust\n\nMy attempts to rewrite my Operating Systems course assignments (written in C)\nin Rust\n\n## Why?\n\nI've tried countless of times to get into Rust because of all the hype\nsurrounding it, but always found it too hard :P\n\nI also had no projects that called for its use and always opted for\nJavaScript/TypeScript because of its familiarity and it was always good enough.\nThis made me less motivated to learn Rust and never touched it again for a long\ntime.\n\nThen comes my Operating Systems course, which required C/C++ for assignments.\nIt was almost impossible at first with a lot of C and systems programming\npitfalls but I eventually got the hang of it by the third assignment. These are\nthe kinds of things that Rust is supposed to fix, so it was the perfect\napplications for learning Rust.\n\n## Shell - Thoughts\n\nRust is hard :'(\n\n### Cons\n\n- I have to handle every single error that can happen, which makes error\n  handling messy. I will probably have to try creating my own custom `Result`\n  types and stop spamming `Result\u003c(), Box\u003cdyn Error\u003e\u003e` everywhere.\n\n- Dealing with string types was also difficult. While C only has `char *`\n  (sometimes with `const`), I have to use `str`, `String`, `Vec\u003cu8\u003e`, and call\n  whatever conversions between those types to get it to compile.\n\n### Pros\n\n- Everything (almost) went smoothly when it did compile. Aside from logical\n  errors that came up because of differences in string methods and the deadlock\n  happening with the signal handler, there were no other runtime errors. This\n  might be because I already wrote this program, though, and I might already\n  have smoothed out any problems I would have encountered before.\n\n- Still better error handling than C. The `?` operator kind of reminds me of\n  the `await` construct in Javascript, passing the error handling to the\n  caller. I've leveraged that a lot in this application.\n\n## Producer-Consumer - Thoughts\n\nActually pretty surprised by this one\n\n### Cons\n\n- Using shared memory in the C way is pretty difficult to do in Rust, making me\n  use `unsafe` to access that one variable. Maybe if I wrote this in more\n  idiomatic Rust, it wouldn't be this bad, but I am writing this months after I\n  finished this part.\n\n### Pros\n\n- I was expecting this to be a bit slower than my C code, but to my surprise,\n  it actually matched the performance of my original code.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbebe%2Fos-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbebe%2Fos-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbebe%2Fos-rust/lists"}