diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2025-08-13 21:45:33 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2025-08-13 21:45:33 +0200 |
commit | 48095489b4e1b85f82d80adf69abd691f9bc1679 (patch) | |
tree | c20a6ad7fbe190bde92374a43f3018bf29a7be39 /README.md | |
parent | ceb5eba67fff7cc8f85cbb113a86e0c6f349d9db (diff) |
Update README and self-identification.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..c3e4638 --- /dev/null +++ b/README.md @@ -0,0 +1,109 @@ +# DOS-Like Shell (Zig) + +A small DOS-inspired shell implemented in Zig. It aims to reproduce the feel of classic MS-DOS utilities and behaviors, including 8.3 filename formatting, backslash paths, simple prompts, and a subset of built-in commands. + +This project is educational and intentionally simplified; it is not a full DOS emulator or a drop-in replacement for CMD. + +## Features + +- DOS-style prompt with basic variables: + - `$p` current path (formatted in DOS style) + - `$g` greater-than character (`>`) +- Path handling: + - Converts `/` to `\` and uppercases drive letters and names + - Formats individual path segments to 8.3-style names where applicable + - Defaults to `C:` when no drive is present +- Built-in commands (subset): + - `ECHO` (plain and text) + - `CLS` + - `EXIT` + - `VER` + - `DATE` and `TIME` (simplified calculations/formatting) + - `DIR` (lists files/directories with simplified date/time and sizes) + - `TYPE` (prints file contents with basic character handling) + - `SORT` (reads from redirected input and prints sorted lines) + - `CD`/`CHDIR` (change directory; basic cases like `..` and root) + - `COPY` (file copy; also supports `COPY CON destination` for interactive input until Ctrl+Z) + - `DEL`/`ERASE` (file removal; no wildcards yet) + - `MKDIR`/`MD` (make directory) +- Redirection: + - Input: `< file` + - Output overwrite: `> file` + - Output append: `>> file` +- External command execution: + - Executes programs in your environment when not matched by a built-in + +## Limitations + +- Simplified date/time and calendar calculations +- No full wildcard support (e.g., in `DEL`) +- Device names (`CON`, `PRN`, `LPTx`) are recognized in limited contexts +- Not a complete DOS environment; behavior is “DOS-like” rather than exact + +## Build + +Requirements: +- Zig (recent version) + +Build: + +``` +zig build +``` + +This produces an executable in `zig-out/bin`. + +## Run + +Start the shell: + +``` +zig-out/bin/dose +``` + +You’ll see a DOS-like prompt. Example interactions: + +``` +C:\> VER +DOSE Version 6.22 +C:\> DIR +... directory listing ... +C:\> COPY CON hello.txt +Hello world! +^Z + 1 File(s) copied +C:\> TYPE hello.txt +Hello world! +``` + +Redirection: + +``` +C:\> DIR > dir.txt +C:\> TYPE dir.txt +``` + +Change directory: + +``` +C:\> CD .. +C:\> DIR +``` + +## Development Notes + +- The shell uses a simple parser and a set of built-in command handlers. +- Paths shown to the user are normalized to DOS conventions (uppercase, backslashes, and 8.3-style segments). +- External commands are executed via the host OS process APIs; errors are reported in a DOS-like manner. + +## Roadmap + +- Wildcards for file operations +- More built-in commands and switches +- Improved date/time correctness +- Better device/file semantics +- Enhanced error messages and testing + +## License + +GNU AGPLv3. |