I'm proud to announce the release of SamaruX v1.00, my Unix-like shell project for CP/M.
Also, a new versión of MESCC has been released.
They can be downloaded from my website, source code included.
--
SamaruX
(c) Miguel I. Garcia Lopez / FloppySoftware
www.floppysoftware.es
cpm-connections.blogspot.comfloppysoftware@gmail.com
Overview
SamaruX is a Unix-like shell for the CP/M operating system & the Z80 CPU.
It has been developed with MESCC, my Small-C compiler version for CP/M and Z80.
Instead of write separate commands for each task as in real Unix, the shell has some built-in commands.
Of course, it's not at all a new idea (see BusyBox, for example), but I believe this scheme has a lot of advantages in a small environment like CP/M.
For example, we can save some bytes on disk by joining some commands in one file, instead of writing them as separated ones, because we don't have to repeat some shared code in each of them.
Obviously, SamaruX doesn't have all functionalities of Unix, but it has some nice and useful commands, to work in a Unix-like system, under our beloved CP/M operating system.
Some SamaruX functionalities are:
-Redirection of stdin and stdout with > and <.
-Piping with |.
-Environment with variables $TERM, $USER, etc.
-Command line history.
-Profiling for environment customization.
-Command aliasing.
-Batch processing with flow control and arguments passing.
-Complete on-line manual.
-Prompt customization.
-Built-in commands: cp, rm, mv, man, cat, more, grep ...
This document is not an exhaustive reference of SamaruX, but only an overview, in order to show some of its capabilities.
Please, refer to the manual for a complete description.
Execution modes
There are two execution modes:
-CP/M mode: The SamaruX shell will execute only a command and will return to CP/M.
-Interactive mode: The SamaruX shell will read and execute your commands from the keyboard, until you return to CP/M.
CP/M mode example:
A>sx echo Hello world!
Hello world!
A>
Interactive mode example:
A>sx
Samarux v1.00 / 29 Dec 2014 - (c) FloppySoftware, Spain
CP/M version 2.2
28 built-in commands
Hi FloppySoftware welcome to Samarux!
[FloppySoftware at B00:] $ env
TERM = vt52
USER = FloppySoftware
PROMPT = [%u at %w] %$
[FloppySoftware at B00:] $ exit
A>
Profiling
With profiling, you can customize your SamaruX environment.
Its use it's not compulsory, but highly recommended (and useful).
There are two files for profiling::
-profile.sx: For the CP/M mode.
-profcpm.sx: For the interactive mode.
An example of profiling in interactive mode:
# -------------------------- #
# SAMARUX START-UP PROFILE #
# -------------------------- #
env TERM vt52
env USER FloppySoftware
env PROMPT [%u at %w] %$
#
alias h history 0
alias logout exit
#
echo Hi $USER welcome to Samarux!
echo
Piping and redirection
With SamaruX, you can enter useful command lines like:
-cat letter.txt | more
-grep 'Gary Kildall' cpm.txt article.doc news.txt > refs.txt
-ls -l *.h *.c > cfiles.txt
-man cat | more
Command line
You can separate commands in the same line with the semicolon (;):
man cp > cp.txt ; clear ; cat cp.txt | more
You can include environment variables in your command lines:
env NAME Julius ; echo My name is $NAME
An argument can contain spaces if it is surrounded by single quotes ('):
env NAME 'Julius Smith' ; echo My name is $NAME
SamaruX has a command line history facility.
To see the history, just type:
history
And the history command will reply something like:
[FloppySoftware at B00:] $ history
0: cat manual.doc | more
1: ed letter.txt
2: ls *.c
3: man cat
To select a history command entry, just type its number:
history 2
And the shell will present a command line, ready to be edited and / or executed:
[FloppySoftware at B00:] $ ls *.c
Executing CP/M commands
You can execute CP/M commands by using the cpm command:
cpm PIP A:=M:*.COM
You will return to SamaruX, once the CP/M command had finished its work.
Aliases
You can make aliases for your most frequently used commands:
alias dirall ls -f
Then, you can enter the defined alias as a single word:
dirall
Small text editor
SamaruX has the ed command, a very humble text editor, but very useful to create and edit small text files in a fast way.
[FloppySoftware at B00:] $ ed profile.sx
File : profile.sx
Lines: 14/48
ed> print
0: # -------------------------- #
1: # SAMARUX START-UP PROFILE #
2: # -------------------------- #
3: # env HOME A00:
4: env TERM vt52
5: # env TEMP M00:
6: env USER FloppySoftware
7: env PROMPT [%u at %w] %$
8: #
9: alias h history 0
10: alias logout exit
11: #
12: echo Hi $USER welcome to Samarux!
13: echo
ed> edit 8
8: # This is a comment
Help!
SamaruX has a built-in command named man, to offer on-line help about commands an other topics.
The help contents is stored in the man.sx file.
As this file is an ordinary text file with a simple structure, you can even add or modify topics.
To see the available topics, just type:
man | more
To read about a topic in particular, say cat, just type:
man cat | more
In addition to this, SamaruX has a built-in command named builtin, that prints the name of all available built-in commands. Just type:
builtin
Batch processing and flow control
With the batch command, you can process files with commands as if they were typed on the keyboard.
Some other SamaruX commands will help you with flow control in batch processing:
-if
-goto
-read
-exit
An example:
# ----------- #
# TEST SCRIPT #
# ----------- #
#
echo Test Script
echo ===========
# Menu:
echo
echo 1 : Option One
echo 2 : Option Two
echo 0 : Exit
echo
echo -n Your choice:
read OP
echo
if $OP eq 1 goto One
if $OP eq 2 goto Two
if $OP eq 0 goto Exit
echo Bad choice, try again.
goto Menu
# One:
echo Your choice was Option One.
goto Menu
# Two:
echo Your choice was Option Two.
goto Menu
# Exit:
env OP
You can include arguments in batch processing.
If you have a file named write.sx with this contents:
echo $1 $2 $3
And you type:
batch write.sx How are you?
The system will reply with:
How are you?
License
Copyright (c) Miguel I. Garcia Lopez / FloppySoftware, Spain
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
This program 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. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
--
This is my blog dedicated to the world of the CP/M OS, the Z80 CPU, the AMSTRAD PCW computer and related subjects.
Monday, February 23, 2015
Sunday, January 4, 2015
Samarux, *nix shell for CP/M
I am working in my old project to build a *nix shell type for CP/M in MESCC.
Over the time, it has gain a lot of functionality and new commands.
It has now pipes, redirection, environment variables and aliases.
It has many built-in commands: cat, more, pwd, ls, rm, mv, echo, batch, man, etc. and it's able to execute CP/M programas too (well, by using the $$$.SUB trick).
It can execute a profile file to set-up the environment and aliases.
It can execute Samarux built-in commands directly from the CP/M CCP command line.
Samarux, (this is its name), can run on any computer running any CP/M version on a Z80 cpu.
My intention is to release the Samarux under the GLP license.
When?
Well, very soon, I hope.
Over the time, it has gain a lot of functionality and new commands.
It has now pipes, redirection, environment variables and aliases.
It has many built-in commands: cat, more, pwd, ls, rm, mv, echo, batch, man, etc. and it's able to execute CP/M programas too (well, by using the $$$.SUB trick).
It can execute a profile file to set-up the environment and aliases.
It can execute Samarux built-in commands directly from the CP/M CCP command line.
Samarux, (this is its name), can run on any computer running any CP/M version on a Z80 cpu.
My intention is to release the Samarux under the GLP license.
When?
Well, very soon, I hope.
Labels:
C Programming,
CP/M,
MESCC,
Small C,
Z80
Saturday, August 30, 2014
WTD / What To Do v1.0 - Released
WTD / What To Do v1.0, released under the GPL license, source code included.
WTD is a "to do list" manager for the CP/M operating system and the Z80 cpu.
It has been written in MESCC, and follows the format and rules of Gina Trapani and his todo.txt system.
You can download from my website.
By the way, it has been ported from MESCC to Pelles C for Windows in a hurry (more information on this soon).
WTD is a "to do list" manager for the CP/M operating system and the Z80 cpu.
It has been written in MESCC, and follows the format and rules of Gina Trapani and his todo.txt system.
You can download from my website.
By the way, it has been ported from MESCC to Pelles C for Windows in a hurry (more information on this soon).
Friday, August 22, 2014
WTD for CP/M - What To Do (to do list manager)
I am writting a new program for CP/M with MESCC.
Its name is WTD / What To Do, and is a "to do list manager".
I uses the same format as "todo.txt" system by Gina Trapani: http://todotxt.com/, simple but very effective.
My intention is to use WTD in my daily job tasks.
More information soon.
Its name is WTD / What To Do, and is a "to do list manager".
I uses the same format as "todo.txt" system by Gina Trapani: http://todotxt.com/, simple but very effective.
My intention is to use WTD in my daily job tasks.
More information soon.
Wednesday, August 6, 2014
UMMO - New game for the Amstrad PCW
I have developed a new game for the Amstrad PCW.
Its name is UMMO, and is a classical "kill the invaders" game, with some asteroids too.
It has been developed with MESCC, my own version of the Small C compiler, some libraries from SAMARUC, my GUI for the Amstrad PCW, and a game engine called TWO (The World Of) inspired in Greenfoot.
It runs from CP/M.
You can download from my website http://www.floppysoftware.es.
Sunday, July 20, 2014
Find that Mine! for CP/M & Z80
I have developed a version of my game Find that mine! for CP/M.
It is derived from the source code of the Amstrad PCW and my GUI Samaruc, and it should run on any Z80 computer running any version of CP/M.
It has been write with MESCC, my own version of Small C Compiler, and it has been released under the GNU General Public License, source code included.
And... yes, it's another clon of MineSweeper!
You can download from my website: www.floppysoftware.es
It is derived from the source code of the Amstrad PCW and my GUI Samaruc, and it should run on any Z80 computer running any version of CP/M.
It has been write with MESCC, my own version of Small C Compiler, and it has been released under the GNU General Public License, source code included.
And... yes, it's another clon of MineSweeper!
You can download from my website: www.floppysoftware.es
Labels:
C Programming,
CP/M,
Find That Mine!,
MESCC,
Small C,
Z80
Tuesday, February 4, 2014
CP/M: 40 años
CP/M cumple 40 años.
Para celebrarlo, el Institute of Electrical and Electronic Engineering (IEEE) de New York, instalará una placa conmemorativa en los alrededores de lo que fue el edificio de Digital Research Inc. en Pacific Grove, California, el próximo 25 de abril de 2014.
Fuente: https://www.facebook.com/KildallLegacy
Para celebrarlo, el Institute of Electrical and Electronic Engineering (IEEE) de New York, instalará una placa conmemorativa en los alrededores de lo que fue el edificio de Digital Research Inc. en Pacific Grove, California, el próximo 25 de abril de 2014.
Fuente: https://www.facebook.com/KildallLegacy
An IEEE Milestone plaque to commemorate Gary Kildall’s development of the first disk-based operating system for microcomputers to be dedicated on 4/25/14
Descripción
Gary Kildall's CP/M, the first disk-based operating system for microcomputers, kick-started the personal computer revolution in Pacific Grove, CA in the fall of 1974
An instructor in computer science at the Naval Postgraduate School in Monterey and a consultant to Intel Corporation, Dr. Gary A. Kildall founded Digital Research Inc. (DRI) in Pacific Grove, CA to commercialize CP/M that together with his Basic Input Output System (BIOS) concept kick-started the PC revolution. By 1980, Kildall had sold “millions of copies to manufacturers and end-users” and employed several hundred people in Pacific Grove. Sales continued to grow and expanded into other areas of computer software, including CD ROMs, educational tools, networking, and a video animation program that was purchased by a “little company called Pixar.” Towards the end of the decade DRI faltered and in 1991 Novell Inc. purchased the assets. Gary Kildall died following an accident in 1994 but the legacy of his work lives on as the forerunner of the operating systems that continue to power the majority of the world’s computers.
The Institute of Electrical and Electronic Engineering (IEEE), the New York-based “world’s largest professional organization for the advancement of technology”, Milestone program honors important events in electrical engineering and computing. Achievements such Thomas Edison’s electric light bulb, Marconi’s wireless communications, and Bell Labs first transistor are recognized with a commemorative plaque in an appropriate location. To coincide with the 40th anniversary year of the CP/M prototype, the IEEE will install a bronze Milestone plaque outside the former DRI headquarters at 801 Lighthouse Avenue, Pacific Grove, CA.
An instructor in computer science at the Naval Postgraduate School in Monterey and a consultant to Intel Corporation, Dr. Gary A. Kildall founded Digital Research Inc. (DRI) in Pacific Grove, CA to commercialize CP/M that together with his Basic Input Output System (BIOS) concept kick-started the PC revolution. By 1980, Kildall had sold “millions of copies to manufacturers and end-users” and employed several hundred people in Pacific Grove. Sales continued to grow and expanded into other areas of computer software, including CD ROMs, educational tools, networking, and a video animation program that was purchased by a “little company called Pixar.” Towards the end of the decade DRI faltered and in 1991 Novell Inc. purchased the assets. Gary Kildall died following an accident in 1994 but the legacy of his work lives on as the forerunner of the operating systems that continue to power the majority of the world’s computers.
The Institute of Electrical and Electronic Engineering (IEEE), the New York-based “world’s largest professional organization for the advancement of technology”, Milestone program honors important events in electrical engineering and computing. Achievements such Thomas Edison’s electric light bulb, Marconi’s wireless communications, and Bell Labs first transistor are recognized with a commemorative plaque in an appropriate location. To coincide with the 40th anniversary year of the CP/M prototype, the IEEE will install a bronze Milestone plaque outside the former DRI headquarters at 801 Lighthouse Avenue, Pacific Grove, CA.
Subscribe to:
Posts (Atom)
























