All Projects → jayschwa → dos.zig

jayschwa / dos.zig

Licence: MIT license
Create DOS programs with Zig

Programming Languages

Zig
133 projects

Projects that are alternatives of or similar to dos.zig

mt32-pi-control
MT32-PI.EXE/MT32-PI.TTP/mt32-pi-ctl is a control program for the mt32-pi MIDI synthesizer available for DOS PCs, Atari ST and Amiga computers as well as modern systems running Linux and Windows.
Stars: ✭ 22 (-54.17%)
Mutual labels:  dos, retrocomputing
retrogardens
16bit retro programming in DosBox with Borland C++ 3.1, Turbo Pascal 7 and TASM
Stars: ✭ 49 (+2.08%)
Mutual labels:  dos, retrocomputing
jSH
A Javascript scripting engine for DOS
Stars: ✭ 79 (+64.58%)
Mutual labels:  dos, retrocomputing
Pcjs
The original IBM PC and other machine emulations in JavaScript
Stars: ✭ 171 (+256.25%)
Mutual labels:  dos
Hackers Tool Kit
Its a framework filled with alot of options and hacking tools you use directly in the script from brute forcing to payload making im still adding more stuff i now have another tool out called htkl-lite its hackers-tool-kit just not as big and messy to see updates check on my instagram @tuf_unkn0wn or if there are any problems message me on instagram
Stars: ✭ 211 (+339.58%)
Mutual labels:  dos
monobit
Tools for working with monochrome bitmap fonts
Stars: ✭ 124 (+158.33%)
Mutual labels:  retrocomputing
EightBall
The Eight Bit Algorithmic Language for Apple II, Commodore 64 and VIC20
Stars: ✭ 17 (-64.58%)
Mutual labels:  retrocomputing
Sharp
An anti-ARP-spoofing application software that use active and passive scanning methods to detect and remove any ARP-spoofer from the network.
Stars: ✭ 150 (+212.5%)
Mutual labels:  dos
dethrace
Reverse engineering the 1997 game "Carmageddon"
Stars: ✭ 271 (+464.58%)
Mutual labels:  dos
awesome-list
Awesome Lists of retrocomputing resources (6502, Apple 2, Atari, ...)
Stars: ✭ 38 (-20.83%)
Mutual labels:  retrocomputing
Docker-Swarm-DDOS
How to create a Denial of Service Attack through Docker Swarm.
Stars: ✭ 36 (-25%)
Mutual labels:  dos
Dojs
A DOS JavaScript Canvas with sound
Stars: ✭ 237 (+393.75%)
Mutual labels:  dos
doslinux
Run Linux programs on DOS
Stars: ✭ 1,272 (+2550%)
Mutual labels:  dos
Ansilove
ANSI and ASCII art to PNG converter in C
Stars: ✭ 207 (+331.25%)
Mutual labels:  dos
NTPDoser
NTP Doser is a NTP Amplification DoS/DDoS attack tool for penttesting
Stars: ✭ 96 (+100%)
Mutual labels:  dos
Div Games Studio
Complete cross platform games development package, originally for DOS but now available on modern platforms.
Stars: ✭ 168 (+250%)
Mutual labels:  dos
dd86
No longer maintained. See URL.
Stars: ✭ 36 (-25%)
Mutual labels:  dos
Burn-Byte
Burn Byte is a modern and powerful DDOS Toolkit
Stars: ✭ 37 (-22.92%)
Mutual labels:  dos
DDos-Attack-OVH-
Powerful DDoS Attack
Stars: ✭ 155 (+222.92%)
Mutual labels:  dos
basicdos
A new 8086-based reimagining of PC DOS and BASIC
Stars: ✭ 72 (+50%)
Mutual labels:  dos

DOS SDK for Zig

Write and cross-compile DOS programs with the Zig programming language. Programs run in 32-bit protected mode and require a resident DPMI host. CWSDPMI is bundled with the executable for environments that do not have DPMI available.

To comply with the CWSDPMI license, published programs must provide notice to users that they have the right to receive the source code and/or binary updates for CWSDPMI. Distributors should indicate a site for the source in their documentation.

This package is in a primordial state. It is a minimal demonstration of how to create a simple DOS program with Zig. Only basic file/terminal input/output are working, and does not include proper error handling. It will require hacking if you wish to adapt it for your own needs.

Quick Start

Install:

Run:

zig build run

Design

There are five main components of this package:

  • DOS API wrappers call the 16-bit real mode interrupt 21 routines (via DPMI) and implement operating system interfaces for the Zig standard library.
  • DPMI API wrappers manage extended memory blocks and segments.
  • A custom linker script produces DJGPP COFF executables.
  • The CWSDPMI stub loader enters protected mode and runs the COFF executable attached to it.
  • A small demo program exercises all of the above.

Roadmap

  • Proper error handling.
  • Parse environment data (command, variables) and hook into standard library abstractions.
  • Implement mprotect for stack guard and zero pages.
  • Implement a page_allocator for the standard library.
  • Add graphical demo program.

Questions and Answers

Can I just target 16-bit real mode rather than require DPMI?

It is technically possible, but not a goal of this package. Zig (via LLVM) can generate "16-bit" code using the code16 ABI target. In reality, this code is often 32-bit instructions with added prefixes that override the address or operand size. Using code16 actually produces larger binaries. Additionally, the oldest CPU that can be targeted is an Intel 80386, which supports 32-bit protected mode. It's guaranteed to be there and has a lot of advantages, so we might as well use it.

Why not integrate with an existing DOS toolchain like DJGPP?

This was attempted and had mixed results. DJGPP's object format (COFF) is subtly different from the one produced by modern toolchains such as Zig. Crude conversion scripts had to be used to get them to work together and it was not robust. While it would be nice to leverage DJGPP's C library, it ultimately felt like more trouble than it was worth. Not relying on a separate toolchain will make things easier in the long run.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].