IMPORTANT: The JSUS shell uses the Chrome web browser's V8 engine, which "compiles" JavaScript into machine code for a limited set of processor types. Currently, we only support 64-bit Intel processors and will be adding 64-bit ARM support in the near future. Earlier, we provided a 32-bit version of JSUS but we feel 64-bit addressing is necessary for our memory-mapped database management system. As different package files become available for download they will be listed below, identified by architecture and OS. A recent version of V8 is statically linked into each package, which is then dynamically linked to the local runtime libraries. We usually update to a newer version of V8 at the same time we build a new JSUS package version, or sooner if there is a significant change. If there is no download link for your environment this means it cannot be successfully installed at this time. On the other hand, if any download link is broken, it simply means we are in the process of upgrading that package to the latest version. Please be patient and try again later.
The JavaScript Unix Shell (JSUS) and the V8 engine are both released under a BSD style open source license. The current version of JSUS is 1.16.3. Recent changes can be found in the change log document.
Installing (or updating) the JSUS shell is very simple, but requires root privileges. It is (barely) possible to install JSUS into a user directory, but its functionality would be severely limited and it would not be practical to execute JavaScript programs automatically and seamlessly. It really only makes sense to install JSUS if it is going to be used, in principle, by all users on the system. If you do not have root privileges yourself, you will have to ask your system administrator to install the package for you. However, you can still download and evaluate JSUS, as an ordinary user, as shown below.
Root privileges are required because JSUS should be installed SUID root. JSUS needs this on start up to create a secure execution environment (including a shared memory object, which is not accessible from JavaScript code). It also permits execution of SUID JavaScript programs, but ONLY if they are located in directories where only root has write permissions. Otherwise, root privieges are dropped before the JavaScript code is even loaded or compiled.
The first step is to download one of the following package files into a directory on the target system:
JSUS for X64 based Linux systems.
Next, in the download directory, de-compress the package file with a command such as:
tar -xzf jsus.x64.tar.gz
Enter the expanded installation directory, which will contain the main jsus executable; an install program (written in JavaScript); some sub-directories with additional JavaScript code; and a doc sub-directory containing the web based manual. At this point, before actually installing the program, it is possible to read the manual by opening your web browser to the local file: doc/index.html. It is also possible to run many JavaScript programs, from the command line, using the downloaded jsus executable. For example, there is a traditional "hello world" program in the test subdirectory. This "test" will show whether jsus actually works on your system and can be run with:
./jsus ./test/hello
If hello works, it is a pretty safe bet that everything else will, as well. But please feel free to try other programs in the test, util and other sub-directories until you are satisfied. If nothing works, it almost certainly means that jsus and, more specifically, the V8 JavaScript engine does not support your processor. Or perhaps you downloaded the wrong package file?
Once you are satisfied, you (or your administrator) can install (or update) the executables, the manual and some JavaScript library code using the install program (which is itself written in JavaScript and runs via the JSUS binary in the install directory). On most Linux systems you can run this, as root, by typing:
sudo ./install
This installs (or updates) the executable as /sbin/jsus, with a symbolic link from /bin/jsus. The (online) manual is installed in /usr/share/doc/jsus/; key JavaScript libraries are installed in /lib/jsus/; and utility programs are installed in /usr/bin/. The program will not install any of these files if they are older than more recent versions already installed on your system. Since the new files will be younger, updating to the latest version is simply a matter of re-installing over the old version. If necessary, the -f flag may be used to force installation of all files, over any existing files (use -h for more help).
The last step of install possibly adds a command to the beginning of /etc/rc.local to register the JSUS magic number (////) with the binfmt_misc file system. This file system is normally loaded during boot-up of every Linux operating system and allows various "script" files to be executed as normal executable programs. The command is not added if install detects the magic number is already registered. Thus, while the default behavior is appropriate for most users, administrators for large systems can arrange to execute the necessary commands wherever they see fit. If needed, the relevant administrator commands are as follows:
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
echo ':JSUS:M::////::/sbin/jsus:' > /proc/sys/fs/binfmt_misc/register
TIP: It is a good idea for all JavaScript programmers to create a browser bookmark to file:///usr/share/doc/jsus/index.html, for local access to the manual.