Skip to content

About

RANDDRV.SYS random number driver for RNG-810 or similar hardware

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

RANDDRV.SYS - RNG-810 hardware random number driver

Version 1.01 (original 1.00a, 1994)

OS/2 device driver for the CALNET (Newbridge) RNG-810 hardware random number generator, a small ISA card that returns a random byte from a Johnson-noise source on every read of its I/O port. Open the device \DEV\$RANDOM$ and read random bytes.

Status

Builds clean with Open Watcom 2 (bin\randdrv.sys, 2.8 KB). Loads and works on the ArcaOS Dev VM (open, read, blocking, two readers at once). Not tested on real hardware (no RNG-810 is available); see "Tested on".

Tested on

  • Build: ArcaOS Dev VM (VirtualBox), Open Watcom 2.0 (wcc, wasm, wlink, wmake), 2026-11-14.
  • Run: ArcaOS 5.1.1 Dev VM (VirtualBox, no RNG-810 card, so the port returns 0xFF): the driver loads, the boot messages are as described, \DEV\$RANDOM$ opens, reads of 16, 100 and 2 x 40 bytes (two readers at the same time) complete, 100 bytes in 3.6 s (about 28 bytes per second on this VM: one byte per timer tick). All bytes were 0xFF as expected without a card. This tests the driver mechanics only, not the randomness.
  • Real RNG-810 hardware: not tested.

License

GNU General Public License version 2 or later (see LICENSE), as chosen by the original author. Two files also carry a Sirius Software notice that says "placed in the public domain": see doc\PROVENANCE.md.

Authors

  • Paul Elliott (driver, 1994)
  • Greg Smith, Sirius Software (sample OS/2 driver framework the driver was started from, 1991-1993)
  • Open Watcom 2 port and boot messages: Martin Iturbide (with Claude), 2026

Original source

https://github.com/OS2World/DRV-MISC-RNG-810 (version 1.00a, February 1994, upload template doc\original\rng-810.txt). The unmodified state is tagged upstream-original; the old Borland build files and release checksums are in doc\original\.

Build tools

  • Open Watcom 2.0: wcc (16-bit C), wasm, wlink, wmake, and wcc386 for the test program
  • tee (C:\usr\bin) for the build log

The original needed Borland C++ 3.0, TASM, the Borland runtime source and sed; none of that is used any more.

Build

Run from the project root on ArcaOS:

compile_wat.cmd          build, writes compile.log, result bin\randdrv.sys and bin\rand.exe
compile_wat.cmd clean    remove bin\

or directly: wmake -f Makefile.wat

Compile flags: small model, 286, no stack checks, -zu (SS is not DS in a device driver), packed structures, no C library. Link: system os2 dll, protected mode, CODE segment IOPL, DOSCALLS imports from os2.lib; c0.obj is linked first (device header at offset 0 of the data) and codend.obj last (end-of-resident markers).

Install

  1. Set the jumpers of the card to one of the ports 0x300, 0x302, 0x304 or 0x306.

  2. Copy randdrv.sys somewhere and add to CONFIG.SYS (any position):

    DEVICE=C:\RNG\RANDDRV.SYS 0x300
    

    The number is the I/O port. Without it the port is 0x300.

Parameters (DEVICE= line)

Option Meaning
<port> I/O port of the card, for example 0x300 (hex with 0x) or decimal; default 0x300
(none) quiet: only errors are shown
/V verbose: banner with the version, device name, port, buffer size
/Q no messages at all (not even errors)
/W wait for a key after the messages
/AA audible alert (beep) when the driver is loaded

Every line starts with RANDDRV: ; long messages are word-wrapped at 79 columns with the prefix on each line. (The old driver always printed a GPL banner with the copyright and license; the new one prints no copyright or license text. Those are in the source files, LICENSE and this README.)

How it works

The card must not be read faster than once per 40 microseconds or the bytes are not independent. The driver therefore reads one byte per kernel timer tick (about 18.2 times per second) into a 512 byte ring buffer; a read request copies bytes from the buffer and blocks when it is empty. The timer runs only while the device is open. So the generator delivers one byte per tick (18 per second on the classic timer, about 28 per second measured on the Dev VM), far below what the card can do (see doc\original\00readme.txt for the author's notes on faster ways).

Sample / test

  • sample\rand.c (built to bin\rand.exe): rand <file> <bytes> reads random bytes from \DEV\$RANDOM$ into a file.
  • test\config.sys.sample: the CONFIG.SYS line. test\smoke.cmd: reads 16 bytes and shows the file size.

Known issues

  • Only one byte per timer tick (18 to about 30 bytes per second).
  • Written for single-CPU OS/2 in 1994. The kernel timer handler and the read routine share the buffer with simple interrupt flag control (CLI/STI); on an SMP kernel this is not a real lock. Not tested on SMP.
  • Not tested on real RNG-810 hardware.
  • The status IOCTL example of the old source was never active and has been removed.

Links

  • Original upload information: doc\original\rng-810.txt

Changelog

  • 1.01 (2026-11-14) Open Watcom 2 port (C and WASM instead of Borland C++ and TASM), boot messages and options /V /Q /W /AA, BLDLEVEL signature, IBM-derived definitions replaced (see doc\PROVENANCE.md).
  • 1.00a (1994) Original release by Paul Elliott.

About

RANDDRV.SYS random number driver for RNG-810 or similar hardware

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages