All Projects → SuperIlu → jSH

SuperIlu / jSH

Licence: other
A Javascript scripting engine for DOS

Programming Languages

c
50402 projects - #5 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jSH

monobit
Tools for working with monochrome bitmap fonts
Stars: ✭ 124 (+56.96%)
Mutual labels:  retro, retrocomputing, ms-dos
Cobalt
Cobalt is a FreeDOS distribution designed to be light, simple and easy to use.
Stars: ✭ 82 (+3.8%)
Mutual labels:  dos, ms-dos, freedos
V8Power
Putting the power of an 8-cylinder engine under the hood of DOS batch files.
Stars: ✭ 30 (-62.03%)
Mutual labels:  msdos, freedos
Dojs
A DOS JavaScript Canvas with sound
Stars: ✭ 237 (+200%)
Mutual labels:  dos, retro
dd86
No longer maintained. See URL.
Stars: ✭ 36 (-54.43%)
Mutual labels:  dos, ms-dos
retrogardens
16bit retro programming in DosBox with Borland C++ 3.1, Turbo Pascal 7 and TASM
Stars: ✭ 49 (-37.97%)
Mutual labels:  dos, retrocomputing
hoard-of-bitfonts
turns out I like bitmap fonts
Stars: ✭ 811 (+926.58%)
Mutual labels:  retro, retrocomputing
64tass
64tass - cross assembler for 6502 etc. microprocessors - by soci/singular - [git clone from the original sourceforge repo]
Stars: ✭ 19 (-75.95%)
Mutual labels:  retro, retrocomputing
dungeons-of-noudar
A first person dungeon-crawler for DOS, written in C++, using software rendering and fixed point math
Stars: ✭ 36 (-54.43%)
Mutual labels:  msdos, freedos
DIV
Reconstrucción y posible fork de DIV Games Studio 2.0
Stars: ✭ 41 (-48.1%)
Mutual labels:  dos, msdos
portfolio os
3DO M1 Opera Portfolio Operating System
Stars: ✭ 27 (-65.82%)
Mutual labels:  retro, retrocomputing
GW-BASIC
Assembling Microsoft GW-BASIC from 1983, with MASM or JWasm • "pre-release" binaries at https://github.com/tkchia/GW-BASIC/releases • source mirror at https://gitlab.com/tkchia/GW-BASIC • fork of https://github.com/dspinellis/GW-BASIC
Stars: ✭ 55 (-30.38%)
Mutual labels:  retrocomputing, msdos
ProTecT
ProTecT is an MS-DOS packer. While this packer is outdated, it uses a number of interesting anti-analysis techniques that are still relevant today.
Stars: ✭ 28 (-64.56%)
Mutual labels:  msdos, ms-dos
a80
Intel 8080/Zilog Z80 assembler written in D.
Stars: ✭ 23 (-70.89%)
Mutual labels:  retro, retrocomputing
dos.zig
Create DOS programs with Zig
Stars: ✭ 48 (-39.24%)
Mutual labels:  dos, retrocomputing
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 (-72.15%)
Mutual labels:  dos, retrocomputing
LittleSixteen
Commodore 16 schematics and PCB, redrawn in Kicad
Stars: ✭ 26 (-67.09%)
Mutual labels:  retro, retrocomputing
disc-elite-beebasm
Fully documented and annotated source code for the disc version of Elite on the BBC Micro
Stars: ✭ 19 (-75.95%)
Mutual labels:  retrocomputing
osnine-java
6809 and OS-9 emulator in Java
Stars: ✭ 17 (-78.48%)
Mutual labels:  retrocomputing
SimpleSqlExec
Lightweight command-line utility to execute queries on SQL Server in place of SQLCMD
Stars: ✭ 20 (-74.68%)
Mutual labels:  dos

jSH

jSH logo

A Javascript scripting engine for DOS

jSH is a script interpreter for DOS based operating systems like MS-DOS, FreeDOS or any DOS based Windows (like 95, 98, ME). The focus is on file io and text mode user interfaces.

jSH is a small side project to DOjS, a Javascript coding environment for MS-DOS supporting graphics, sound, etc. including a built in editor and much more

The following script e.g. renames all file extensions in a given directory:

if (args.length < 3) {
	Println("Usage:");
	Println("   jSH.exe renall.js <dir> <old ext> <new ext>");
	Exit(1);
}

var dir = args[0];
var oldExt = args[1].toUpperCase();
var newExt = args[2].toUpperCase();

var files = List(dir);
for (var i = 0; i < files.length; i++) {
	var oldName = files[i].toUpperCase();
	if (oldName.lastIndexOf(oldExt) != -1) {
		var baseName = oldName.substring(0, oldName.lastIndexOf(oldExt));
		var newName = baseName + newExt;
		Println(dir + "\\" + oldName + " => " + dir + "\\" + newName);
		Rename(dir + "\\" + oldName, dir + "\\" + newName);
	}
}
Println("All done...");

And can be run like this: JSH.EXE RENALL.JS SOMEDIR .FOO .BAR to rename all files ending in .FOO to .BAR.

jSH was only possible due to the work of these people/projects:

You can find me on Twitter if you want...

Download and quick start

You can find binary releases on the GitHub release page. Just extract the contents of the archive and run jSH.

jSH runs in Dosbox and on real hardware or a virtual machine with MS-DOS, FreeDOS or any DOS based Windows like Windows 95/98/ME.

If you run it on real hardware you need at least a 80386 with 4MB. I recommend a Pentium class machine with at least 8MB RAM.

The API is documented in the doc/html/ directory.

For now jSH comes only with a single bigger example: JsCommander. A minimal file manager in the style of the well known Norton Commander. jc screenshot

additional packages

jSH has a very simple integrated package manager (JPM). It can be started with JPM.BAT. A working packet driver is needed to connect to the package index and download packages using HTTPS. Packages (and the package index) are fetched from the DOjS/jSH package repository. Downloaded packages are put into JSBOOT.ZIP in the PACKAGE/ directory. Feel free to submit any packages you want to include in that repository using a pull request. DPM commands:

  • installed - list installed packages.
  • remove - remove package.
  • fetch - fetch package index from server.
  • install - install a package (and its dependencies) from package index.
  • list - list available packages in index.
  • setindex - set index URL (HTTP or HTTPS).
  • help - this help.;
  • quit - exit dpm.

Compilation

You can compile jSH on any modern Linux (the instructions below are for Debian based distributions) or on Windows 10 using Windows Subsystem for Linux (WSL). Setup Windows Subsystem for Linux (WSL) according to this guide (I used Ubuntu 18.04 LTS).

Preparation

Build and install DJGPP 7.2.0 according to this guide. I used the following command lines to update/install my dependencies:

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev g++ unzip htop screen git bash-completion build-essential npm python-yaml zip dos2unix python3
sudo npm install -g jsdoc
sudo npm install -g better-docs

And the following commands to build and install DJGPP to /home/ilu/djgpp.:

git clone https://github.com/andrewwutw/build-djgpp.git
cd build-djgpp
export DJGPP_PREFIX=/home/ilu/djgpp
./build-djgpp.sh 7.2.0

Make sure dxe3gen and dxe3res are installed as well and set DJPATH permanently to your installation directory of DJGPP.

Getting & Compiling jSH

Open a shell/command line in the directory where you want the source to reside.

Checkout jSH from Github:

git clone https://github.com/SuperIlu/jSH.git

Open the Makefile in a text editor and change the path to DJGPP according to your installation.

Now you are ready to compile jSH with make clean all. This might take some time as the dependencies are quite a large. make distclean will clean dependencies as well. make zip will create the distribution ZIP and make doc will re-create the HTML help.

Creating native libraries (DXEs)

Have a look at the example libraries in test.dxelib/ and test2.dxelib/. Some rules:

  • A library called foo must have the filename foo.dxe and must provide at least the function void init_foo(js_State *J). This function is called when the library is loaded and can then register global variables/objects/classes/function in the Javascript runtime.
  • The library may also provide the function void shutdown_foo(void) (this is completely optional). This will get called during shutdown and can perform cleanup.
  • All libraries in the sourcetree will be build by the make all target if their dir-name ends with .dxelib. The Makefile in the directory must provide the targets all, clean and distclean (see examples).
  • Libraries should use the Makefile.dxemk whenever possible.
  • In theory it should be possible to compile additional native libraries without re-compiling jSH.EXE if the same compiler is used (see above).
  • Native libraries may use all functions from mujs.h and all functions in dxetemplate.txt. If additional functions are needed these need to be included in the template and jSH.EXE must be recompiled!
  • When libraries are compiled the exports provided by jSH are checked against the used functions (see check_exports.py) and the build fails if there are symbols missing.
  • Feel free to provide your native libraries and/or changes to dxetemplate.txt for inclusion in the jSH GitHub repository (MIT license please)...

History

See the changelog for the projects history.

Licenses

jSH

All code from me is released under MIT license.

MuJS

MuJS is released under ISC license. See COPYING in the MuJS folder for details.

DZComm

DZComm serial library is release as gift-ware. See readme.txt in the dzcomm folder for details.

CWSDPMI.EXE

CWSDPMI DPMI host is licensed under GPL. The documentation states:

The files in this binary distribution may be redistributed under the GPL (with source) or without the source code provided.

zip code

zip is licensed by UNLICENSE

WATTCP

WATTCP - TCP/IP library routines

Copyright (c) 1990, 1991, 1992, 1993 Erick Engelke

Portions Copyright (c) 1993 Quentin Smart Portions Copyright (c) 1991 University of Waterloo Portions Copyright (c) 1990 National Center for Supercomputer Applications Portions Copyright (c) 1990 Clarkson University Portions Copyright (c) 1983, 1986, Imagen Corporation

This software is distributed in the hope that it will be useful,
but without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.

RESTRICTIONS You may freely use this library to produce programs which you may give away or sell in source format, or as compiled executables, or both.

You may not sell this library or a portion thereof or distribute modified versions the library code in either source or OBJect or LIBrary format without written permission from the author. The author still maintains copyright privileges and will assert the privileges of ownership for purposes of royalties such distributions.

Portions of this code were written or enhanced by others and offerred to me for distribution in WATTCP under my copyright. To my knowledge, all copyrights exercised are listed at the top of this file. If this is incorrect, please contact me so I can rectify the situation.

PCTIMER

PCTIMER is Freeware

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].