This project is read-only.

Indroduction

EasyCLI is written in a combination of Assembler (CA65 format) and C using the CC65 cross-platform compiler suite. EasyCLI is organized into an EasyFlash cartridge which utilizes the EasyFS filesystem to store the dispatcher and commandlets.

Computer Organization

EasyCLI uses a custom memory configuration as follows:

$0000 - $07FF : (4k) Normal system
$0800 - $2BFF : (9k) Data & BSS RAM
$2C00 - $37FF : (3k) Fixed Buffers
$3800 - $57FF : (8k) Commandlet Code & RO-Data
$5800 - $7FFF : (10k) Dispatcher Code & RO-Data
$8000 - $9FFF : (8k) ROM-LOW - Startup code + C libraries and RO-Data when EasyFlash set to Bank 0.
$A000 - $BFFF : (8k) ROM-HIGH - EasyFS entries and EasyAPI when EasyFlash set to Bank 0
$C000 - $C2FF : (768 bytes) EAPI shadow RAM
$C300 - $CFFF : (3328 bytes) EasyFS Loader code
$D000 - $FFFF : (12k) Normal system IO & Kernal ROM

Tiers

EasyCLI is seperated into three tiers of functionality:
  • Startup Code & C Libraries
  • Dispatcher
  • Commandlets

Each tier represents a specific set of functionality.

Startup Code & C Libraries

This tier resides in the 8K of ROM representing the lower chip of BANK 0 of the EasyFlash image. This area includes all of the code to bootstrap EasyCLI, the EasyFS loading system, and the C libraries included in the project. Upon startup of the computer, this bank is detected by the Kernal as a cartridge and then the startup code is executed. The startup code follows this progression:
  1. Initialize the computer's normal startup routines since the kernal does not do thing when starting a cartridge.
  2. Copying the Data segment to the shared RAM segment
  3. Initialize the BSS segment
  4. Copy the EAPI from $A800 to $C000.
  5. Jump to the main function

When the main function is returned, the startup code finishes as such:
  1. Clean up the runtime library
  2. Call the reset vector

The main function performs the following steps:
  1. Copy the LOADER segment code and ro-data to $C300
  2. Copy the copyFile function from ROM to $CF00
  3. Load the dispatcher using eapi_load
  4. Execute the dispatcher

Dispatcher

The dispatcher for EasyCLI is the nervous center of the application. This is where devices are initialized and managed, commands are received and executed and scripting (planned) is performed. The Dispatcher resides in the 10K of RAM from $5800 to $7FFF and is embedded as the first file in the EasyFS banks of the EasyCLI cartridge. The dispatcher is always named "OVL.DISPATCHER" in the EasyCLI cartridge.

Device initialization

EasyCLI can use any device from device number 7 to device number 24. However, EasyCLI only has enough RAM to manage the first six (6) of the devices on the system.

Commandlets

The individual chunks of code that perform the work of EasyCLI are implemented as 8K commandlets. These commandlets are stored in the EasyFS banks of the EasyCLI cartridge and are loaded on demand by the dispatcher. You may write your own commandlets and submit them for inclusion in the official EasyCLI distribution, or you may place your commandlets on a drive and execute them from there (planned).

It is possible to create commandlets that incorporate all memory from $3800 to $7FFF for a total of 18K. Any commandlet that does so must reload the dispatcher into RAM before exiting.

Buffers

EasyCLI contains five distinct buffers which are global to the system. You are free to use the buffers, but be aware that they may be clobbered by the system.
  • buffer1 (256 bytes)
  • buffer2 (256 bytes)
  • buffer3 (256 bytes)
  • targetpath (256 bytes)
  • arguments (512 bytes)

In addition to these buffers, there are six drive definitions stored in an array. This means that when EasyCLI initializes the devices, it can store information about the first six devices it finds.

Last edited May 30, 2012 at 9:15 PM by plbyrd, version 5

Comments

plbyrd May 31, 2012 at 2:23 AM 
The first $7FF bytes are Zero Page, Screen RAM, Tape Buffer, and BASIC variables. EasyCLI does not change the meaning of any of this area.

cminter May 31, 2012 at 12:31 AM 
looks good so far. what does "normal system" mean in first memory block?