{"id":20198072,"url":"https://github.com/o8vm/rust_dos","last_synced_at":"2025-04-10T10:46:08.575Z","repository":{"id":44416684,"uuid":"227969973","full_name":"o8vm/rust_dos","owner":"o8vm","description":"Rust DOS : Creating a DOS executable with Rust ","archived":false,"fork":false,"pushed_at":"2023-01-21T22:40:46.000Z","size":8782,"stargazers_count":168,"open_issues_count":6,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-24T09:38:42.722Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/o8vm.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}},"created_at":"2019-12-14T05:15:12.000Z","updated_at":"2025-02-23T23:22:38.000Z","dependencies_parsed_at":"2023-02-01T03:30:31.348Z","dependency_job_id":null,"html_url":"https://github.com/o8vm/rust_dos","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/o8vm%2Frust_dos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o8vm%2Frust_dos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o8vm%2Frust_dos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o8vm%2Frust_dos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/o8vm","download_url":"https://codeload.github.com/o8vm/rust_dos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248201346,"owners_count":21064102,"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-14T04:29:19.751Z","updated_at":"2025-04-10T10:46:08.548Z","avatar_url":"https://github.com/o8vm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust DOS (Creating a DOS executable with Rust)\n\nIt is possible to create a DOS executable or 1st stage bootloader with Rust.  \nThis is a quick demo of creating COM executable for DOS.\n\n## Building\nYou need a binutils and llvm-tools-preview.\n\n```shell\ncargo install cargo-binutils\nrustup component add llvm-tools-preview\n```\n\nThen you can build the project by running:\n\n```shell\ncargo build --release\n```\n\nTo create a COM executable for DOS, run:\n\n```shell\ncargo objcopy --release -- -O binary --binary-architecture=i386:x86 rust_dos.com\n```\n\n## Running\nYou can copy `rust_dos.com` to your DOS image.\n\nexamples on Linux\n\n```shell\n$ sudo partx -av freedos.img\npartition: none, disk: freedos.img, lower: 0, upper: 0\nTrying to use '/dev/loop1' for the loop device\n/dev/loop1: partition table type 'dos' detected\nrange recount: max partno=1, lower=0, upper=0\n/dev/loop1: partition #1 added\n$ sudo mount /dev/loop1p1 /mnt\n$ sudo cp rust_dos.com /mnt/\n$ sudo umount /mnt\n$ sudo partx -dv /dev/loop1\n```\n\nThen, you can test it using QEMU:\n\n```shell\nqemu-system-i386 freedos.img -boot c\n```\n\nYou can use the `println!` macro. \nBelow is an example of HelloWorld:\n\n![sample](https://github.com/o8vm/rust_dos/blob/images/rust_dos_hello.png)\n\n### Others\ndpkey module steals key input processing from DOS and converts scan code to ascii code.  \nabout scan code: see [PS/2 Keyboard - OSDev Wiki](https://wiki.osdev.org/PS/2_Keyboard).\n\n![sample2](https://github.com/o8vm/rust_dos/blob/images/dpkey.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo8vm%2Frust_dos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fo8vm%2Frust_dos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo8vm%2Frust_dos/lists"}