Skip to content
Sasha Crofter edited this page Jun 5, 2012 · 5 revisions

The DASH Shell is essential to cubeOS's function. It acts as an interpreter for ASCII commands, which are passed to the package manager in order to directly execute subroutines, and also handles keyboard input.

Usage

At the prompt, which is of the form "CWD$", the user can use an attached Generic Keyboard to input ASCII and control characters.

Control Characters

Control + Delete

Restarts the DASH Shell by calling s.instance.

Subroutines

s.instance

Prepares a new terminal session at the root directory.

  1. Set env.cwds to "/ " in packed form (0x202F)
  2. Clears the screen
  3. Calls s.takeIn
  4. Calls s.parse
  5. Calls s.stdout with the argument being the cursor location when the user pressed enter
  6. Loops nonendingly to 3

s.takeIn (cursorPointer)

Writes a prompt to the screen using v.sPrompt and enters a loop to take ASCII input from the keyboard and write it to the screen at cursorPointer. It exits when the user presses enter.

returns the cursor location on exit

s.parse

It's not worth documenting this spaghetti code. It will be completely rewritten when package works.

s.drawPrompt (pointer)

Draws a prompt using env.cwds and v.sPrompt at pointer and sets v.promptLoc to the location following the prompt.

returns the location following the prompt

s.stdin (startPointer)

Performs a C-style copy from startPointer to v.stdin, replacing un-(single)quoted spaces with zeros.

s.stdin.escflag DAT 0 ;is 1 if "" was the most recent character s.stdin.args ;for handling arguments

s.stdout (outputPointer)

Does a C-style copy from v.stdout to outputPointer.

Clone this wiki locally