| CD Shell 2.0 Beta Test Guide | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| There are many differences between Boot Scriptor
1.2 and CD Shell 2.0. The following list of items are new or have
changed from Boot Scriptor 1.2, and override the current
documentation available at www.bootscriptor.org. As CD Shell
2.0 gets closer to final release, this information will be
integrated into the web documentation. Remember this is a beta release, so bugs are expected. If you encounter a bug (or any kind of unexpected result, for that matter), please report it to me. This way when I release the final version of CD Shell 2.0, it will be as stable and bug-free as possible. Thanks, and enjoy the new CD Shell! |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Differences from Boot Scriptor 1.2 Web-based Documentation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. Program name changed and version updated. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Boot Scriptor is now called CD Shell. At times I
have disliked the name Boot Scriptor, and now that the more powerful
features described below are in place, the program really is a lot
like a *nix shell. It is still the same program, however, so I don't
feel a need to restart the version numbering. This release will be
version 2.0, partly because of the powerful new features available,
but mainly because I've broken compatibility with 1.x series
scripts. As the name of the program changed, so have some other things as well. The CD Shell files should go in a folder called /cdsh in the root of your disk image. The startup script is now called cdshell.ini, and the splash screen is now called cdsh.bmp or cdsh.csi. The bitmap convert tool now takes the options -bmp2csi and -csi2bmp. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2. Comment character is now '#'. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The end-of-line comment character has been changed from the semicolon to the hash symbol. This is more in line with other scripting languages, and makes it possible for me to use the semicolon in a better way -- as a command separator. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3. Multiple commands per line are now supported. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You can now type more than one command on a
single line, both in scripts and at the shell prompt. Commands are
separated using the semicolon, and cannot span multiple lines. There
is no need to use a semicolon after the last command on the line,
but you can do so without penalty if you wish. Example:
When errors are reported in scripts, you will see something like [Line:15.3]. This means that the error occured in the third command on the fifteenth line. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4. Variables are now supported. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| A. Setting and creating variables (writing). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| One of the most powerful new features is variable
support. You can set the value of a variable using the set command.
If the variable doesn't exist when you set it, then it will be
created. Valid variable names contain only the characters a-z, A-Z,
0-9, and _. There are two forms of the set command: set <variable> = [string] set <variable> = [expression] The first form sets the variable to a string. The string must be delimited by quotes, but you can use the backslash to escape a character if needed. Examples:
The second form basically evaluates a mathmatical expression
(I'll go into greater depth about expressions later in this file)
and then stores the result into the variable. All variables are
represented internally as strings, so this essentially just
calculates the result of the expression and then converts the number
into a string.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| B. Using variables (reading). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| When you want the value of a variable, you use
the dollar sign. Examples:
The dollar sign also has the ability to escape characters, so $$,
$;, and $# can be used to get '$', ';', and '#' without CD Shell
thinking you are ending a command or starting a comment, etc.. Also
the special symbol $< can be used, which is sort of like a
backspace, or a separator.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C. Built-in variables. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Modules can define their own variables as well.
Some of these module-defined variables actually take the place of
commands previously found in Boot Scriptor, such as the color
command. Whereas all user-defined variables are both readable and
writable, the built-in ones may be read-only or write-only. Also
whereas all user-defined variable names are case-sensitive, most of
the modules' variable names are not. Below is a list of all built-in
variables.
And more to come :) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5. If/then/else conditional commands added. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Three new commands have been added: if, then, and
else. The 'if' command simply takes an expression as its only
parameter. The 'then' command takes a command as its parameter, and
executes it if the result of the last 'if' command was true
(nonzero). The 'else' command will execute its parameter if the
result of the previous 'if' command was false (zero). You can
execute multiple then or else commands following an if command, but
you can't nest if commands. Examples:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6. Expressions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Mathmatical expressions in CD Shell are very much
like those in C. Most of the standard C operators are available, and
you can even use functions to return a value in the middle of an
expression. Below is a list of supported operators, grouped
according to precedence. All operations are carried out with a
precision of 32-bits. Oh yeah, and it's all integer math -- no
floats allowed. :)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7. Functions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Anywhere you would normally use a value in an expression, you can also use a function. Functions take the form 'name[parameters]'. Below is a list of supported functions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. Boot Check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The bootCheck function checks a drive to see if it appears bootable.
If this function returns 0, then the device doesn't appear bootable.
If it returns 1, then the device has a bootable boot-sector. If it
returns 2, then the Master Boot Record contains a bootable
partition. If it returns 3, then the bootable partition has a
bootable boot-sector. Examples:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2. Compare/iCompare | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The compare function compares two strings to see
if they are the same. It returns 1 if they are the same, and 0 if
they are different. The icompare function is exactly the same, only
it is case-insensitive. Examples:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3. Defined | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The defined function checks to see if a given
variable exists. It returns 1 if the variable exists, and 0 if it
does not. Examples:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4. Key | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The key function returns the keycode of its
parameter. The given paramter can be either a single-character key,
or a one-word description of the key (for special keys). These
descriptions are the same ones used for the onkey/setkey commands
from Boot Scriptor, with the following changes: there is no 'semi'
key (just use '$;'), and there is now a 'bracket' key, which is the
close bracket ']'. Examples:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5. File | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The file function check for the existence of the
file specified by its parameter. If the file is present, then the
function returns 1. If the file is not found, then the function
returns 0. Files are checked for in the current directory. Examples:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||