Enet4 / dos-rs

Proof of concept for building a Rust program for MS-DOS

Home Page:https://enet4.github.io/dos-rs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MS-DOS with Rust

ci pages-build-deployment

This is an attempt at building a Rust project to target MS-DOS in protected mode via DJGPP, supporting x86 CPUs architectures from i386 to i686.

To engage in the discussion to reach this goal, please check out this GitHub issue and this thread. After many different attempts, the one that seems the most promising right now is the conversion of ELF .o objects into DJGPP COFF32 objects.

This project also contains a few preliminary modules that grant easier access to DOS-specific capabilities, namely port I/O, calling interrupts, and VGA graphics.

Overview

In this repository you will find:

  • djgpp: a low-level library for interfacing with the libc and DJGPP API
  • dos_x: an experimental library to assist in the creation of DOS programs
  • examples/ferris: an example program that shows a picture
  • and instructions on how to make this all work.

Status

While there are not many stability and performance guarantees at the moment, the proofs of concept written so far appear to work as intended. There is no std support, but an allocator is available.

The development experience is also not as fluid as it could be. The Rust program exports a C main function, so it exists as a static C library. The compiled objects need to be converted before they are linked together using i686-pc-msdosdjgpp-gcc.

Known caveats:

  • Be aware of soundness issues in the compilation of floating point arithmetic against targets without SSE2. rust-lang/rust#114479 The use of f32 or f64 may be unreliable, so test carefully.

Requirements

Building

./build.sh
# or
./build.sh release

Some variables in the script can be tuned to your liking.

Running

Copy the resulting dos_rs.exe file into your DOS environment, with CWSDPMI.EXE alongside it. It should then be ready to run on a DOS machine, virtual machine, or emulator.

Related

Serentty/rusty-dos: a repository presenting a semi-successful attempt at compiling a Rust program running in 16-bit real mode DOS.

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Proof of concept for building a Rust program for MS-DOS

https://enet4.github.io/dos-rs/

License:Apache License 2.0


Languages

Language:Rust 92.8%Language:Shell 7.2%