JNode Shell

The JNode command shell enables simple commands to be executed.

The command shell (or more accurately, the keyboard interpreter) supports the following keyboard events:

<SHIFT>+<UP ARROW> Scroll the console up a line
<SHIFT>+<DOWN-ARROW> Scroll the console down a line
<SHIFT>+<PAGE-UP> Scroll the console up a page
<SHIFT>+<PAGE-DOWN> Scroll the console down a page
<ALT>+<F1> Switch to the main command console
<ALT>+<F2> Switch to the second command console
<ALT>+<F7> Switch to the Log console (read only)
<TAB> Command / input completion
<UP-ARROW> Go to previous history entry
<DOWN-ARROW> Go to next history entry
<LEFT-ARROW> Move cursor left
<RIGHT-ARROW> Move cursor right
<BACKSPACE> Delete character to left of cursor
<DELETE> Delete character to right of cursor
<CTRL>+<C> Interrupt command
<CTRL>+<D> Soft EOF
<CTRL>+<Z> Suspend command
<CTRL>+<L> Clear the console for text

A list of available commands can be found below.

To use command line completion in the shell, just type the <TAB> key on your keyboard.
To show the usage of a command, hit <TAB> after typing a "-" as a parameter, e.g.:

JNode /> if<TAB>

expands to

JNode /> ifconfig

and

JNode /> ifconfig -<TAB>

will show the usage of the ifconfig command and let you go on editing your commandline.

Commands:

Note: The following is old documentation. If a command is not listed below, refer to the JNode Commands page for the command's documentation.

<;tr>

fdisk
fdisk
Lists the available devices


fdisk <device-id>
Print the partition table of a device
device-id the device on which you want to change the partition

fdisk --initmbr <device-id>
Initialize the MBR of a device
device-id the device on which you want to change the partition
--initmbr initialize the Master Boot Record of the device

fdisk -d|-b|-m <partition number or description> <device-id>
Create / Delete / change bootable flag of a partition
partition number or description Targeted partition
device-id the device on which you want to change the partition
-d Delete a partition
-b Switch the bootable flag of a partition
-m Modify/create a partition

format
format -t fat16|fat12 <device-id>
Format a block device with a specified type
device-id the device to print informations about
-t Specify fs type
fat16 FAT 16 filesystem
fat12 FAT 12 filesystem

javac
javac
compiles Java source to Bytecode
jifs
jifs
Starts the Jnode Information FileSystem.

leed
leed
starts a simple textmode editor

netstat
netstat
Print the statistics of all network devices

play
play [<aaf>]
Plays a song
aaf Plays Advance Australia Fair

plugin
plugin
Print name and state of all loaded plugins

resolver
resolver
Print the dns servers


resolver add|del <dns server>
Add or remove a dns server
dns server the dns server IP address
add add a dns server
del delete a dns server

route
route
Print the routing table

route add|del <target> [-gw <gateway>] <device>
Add or remove a route
target the target network
gateway the gateway name or IP address
device the device to connect to the foreign network
add add a route
del delete a route
gw the gateway to access the target network

startawt
startawt
Start GUI mode from console and launches desktop set in the system property jnode.desktop. Currently the default JNode desktop is used.

It's good to see progress

It's good to see progress in the shell part of JNode. However I have a question. Why are the arguments converted to an array of strings before it is given to the shell command? It seems to me that information is "lost" in this conversion.

Austin Kaitlyn

It doesn't quite work that way.

Command's that are implemented "the JNode way" typically don't see argument strings at all. Rather, they get argument values delivered to them as objects (Integer, File, Device, etc) bound to Argument objects. If they want to, they can also get hold of the command line tokens (including the command alias used) via the CommandLine object passed to "execute".

You may be mislead by the "public static void main(String[])" methods. In general, those are only there for legacy reasons. A command is usually invoked by creating an instance and calling its "execute(CommandLine, InputStream, PrintStream, PrintStream)" method.

But this is still a work-in-progress. For example, the APIs don't yet capture the raw characters in the tokens (for completion), and there is currently no way to get back the token(s) that were turned into the value(s) bound to an Argument instance.

I don't think the application should need to to see what the original arguments were in most cases. It is the shell's job to deal with stuff like quoting and variable expansion, and that application has no need to know about it. File pattern arguments are less clear cut, but I tend to think that the shell should take care of them as well. Others disagree with me ... of course Smiling

Properties?

Where are the properties the set command changes actually stored in the filetree?
--
Robert "Exile In Paradise" Murphey

The properties are not persistent.

The set command is changing properties in JNode's system Properties object; i.e. System.getProperties(). These properties do not persist.

startawt is not documented

The startawt command for starting the GUI from console is not documented here. It is not clear if this command supports any options. The command could support an option to start in the plain VGA mode if the driver for the more advanced modes is not available or is not functioning properly with the current graphic card.

The command is now

The command is now included in this documentation.