The shell edits the line it is given

Three different things used to do this job, and which one you got depended on
where the machine was running. On a terminal the host held the line and did the
echoing and the backspacing; behind a window the console's own gatherer did it;
from a file nothing did it at all. One job, three implementations, none of them
in the system - which is why there was no way to move about in a line and
nowhere for a history to live.

So editLine does it. Key mode while a line is being read and line mode straight
after, so nothing else in the system and no program calling osReadLine notices
anything changed. Left and Right, Home and End, Backspace for the character
before the cursor and Delete for the one under it, and anything typed goes in
where the cursor is with the rest of the line moving along.

Ctrl-D means the end of input again, on an empty line, because that was a thing
the terminal did while it was holding the line and it is not holding it now.
Same trade as the echoing.

MOST KEYSTROKES DRAW NOTHING BUT THEMSELVES. A character typed at the end of a
line needs no cursor moved: printing it is the whole change, and a backspace
there is three ordinary bytes. That matters beyond speed - moving the cursor by
hand is what a terminal is TOLD about, in an escape sequence, so redrawing on
every keypress would fill every recorded transcript in this suite with them.
The line is only reprinted when something happened in the middle of it.

Where the line STARTS is worked out backwards from where printing ended, rather
than trusted from what was remembered. That is what makes it survive the screen
scrolling: a line printed on the bottom row moves everything up by one, and a
remembered row would be one too low from then on.

The command line holds 127 characters, up from 63. The limit started to be felt
the moment a line could be moved about in.

58 recordings changed, and every one of them by the echo. THE PROOF IS NOT A
HEURISTIC: a CosmOS built with the echo silenced reproduces 187 of the 188
recordings byte for byte. The one exception is cosmosTyped, the backspace test,
where the rub-out marks now come from the shell instead of from the console's
gatherer - same marks, different author.

cosmosEditKeys is the new test, and every line in it is typed wrong and then
corrected with a different key. Its last line is eighty six characters at a
prompt in column two on an eighty column screen, so the line runs onto the row
below and the shell has to find the start of something it can no longer see;
breaking either half of that arithmetic fails it.

Also: agree.sh looked for "> the same", anchored to a prompt that no longer
precedes what a command prints.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
Anachronaut
2026-08-31 23:01:55 -04:00
co-authored by Claude Opus 5
parent b3726c950a
commit 736037462e
62 changed files with 1220 additions and 291 deletions
+31
View File
@@ -283,6 +283,37 @@ facility and as a test that CosmOS correctly restores its Stack and vector table
every run; and `load` is how the monitor puts an arbitrary file in front of itself, which every run; and `load` is how the monitor puts an arbitrary file in front of itself, which
is a thing typing a name deliberately cannot do. is a thing typing a name deliberately cannot do.
### Typing A Line:
The shell reads what you type a key at a time and edits the line itself, which is why the
line can be moved about in at all.
| Key | What it does |
| -- | -- |
| Left, Right | Move a character. |
| Home, End | Go to the start of the line or the end of it. |
| Backspace | Take out the character before the cursor. |
| Delete | Take out the one under it. |
| Return | Finish the line, wherever the cursor happens to be sitting. |
Anything typed goes in where the cursor is, so a word left out of the middle of a line is
put back by moving there and typing it, and the rest of the line moves along.
**This used to be three different things depending on where the machine was running.** On a
terminal the host held the line and did the echoing and the backspacing; behind a window the
console's own gatherer did it; from a file nothing did it at all. One job, three
implementations, and none of them here - which is why there was no way to move about in a
line, and nowhere for a history to live. Now the console delivers keys and says nothing
about what they mean, the same way it reports what a drive is and says nothing about what
should be on it, and the shell decides.
The line holds 127 characters. It held 63 until the shell could edit one, which is when the
limit started to be felt: a copy between two disks with a directory on each is most of the
way there before anything has been said.
Everything else that reads a line - an application calling `osReadLine`, the editor - is
unchanged and still gets a plain line with no editing in it.
### Paths: ### Paths:
Everywhere CosmOS takes a filename it will take a path: names with `/` between them, Everywhere CosmOS takes a filename it will take a path: names with `/` between them,
+546 -5
View File
@@ -188,7 +188,7 @@ promptWhere:
; ;
; So shellReadLine says it. It is the one place that knows. ; So shellReadLine says it. It is the one place that knows.
SETD.0 CommandLine SETD.0 CommandLine
INIB 0d63 INIB 0d127
CALL shellReadLine CALL shellReadLine
; Running out of typing is how this ends. It is not the same as an empty line, which is ; Running out of typing is how this ends. It is not the same as an empty line, which is
@@ -389,7 +389,7 @@ shellReadQuiet:
shellReadTyped: shellReadTyped:
CALL sayPrompt CALL sayPrompt
CALL readLine CALL editLine
RET RET
; ---- The same, for a caller that prints a prompt of its own ---- ; ---- The same, for a caller that prints a prompt of its own ----
@@ -411,7 +411,512 @@ shellReadRaw:
shellReadRawQuiet: shellReadRawQuiet:
RET RET
shellReadRawTyped: shellReadRawTyped:
CALL readLine CALL editLine
RET
; ---- The line the person at the keyboard is typing ----
;
; THREE DIFFERENT THINGS USED TO DO THIS JOB and which one you got depended on where the
; machine was running. On a terminal the host held the line and did the echoing and the
; backspacing; behind a window the console's own gatherer did it; from a file nothing did it
; at all. One job, three implementations, and none of them here - which is why there was no
; way to move about in a line and nowhere for a history to live.
;
; So the shell does it. The console delivers keys and says nothing about what they mean, the
; same way the disk says what a drive is and nothing about what should be on it. Where the
; cursor goes and what the line looks like afterwards are decisions, and decisions belong to
; whoever is reading.
;
; DP0 names a buffer and B says how many characters it holds, not counting the zero byte
; that ends it. Q is how long the line turned out to be. That is readLine's bargain exactly,
; so this drops in where that was called.
;
; ConsoleEndOfInput is set if the console ran out instead of a line being finished, which is
; readLine's other promise and the one the shell uses to know when to stop.
;
; ---- Why most keystrokes draw nothing but themselves ----
;
; A character typed at the END of a line needs no cursor moved: printing it is the whole of
; the change. That is the case almost every keystroke is, and it matters beyond speed -
; moving the cursor by hand means writing the console's cursor registers, which a terminal
; is told about in an escape sequence. Redrawing on every keypress would fill every recorded
; transcript in the test suite with them. So the cheap path is the common one, and the line
; is only reprinted when something happened in the middle of it.
editLine:
SETD.1 EditBase
STD.0.1
SETD.1 EditRoom
STB.1
RSTA
SETD.1 EditLength
STA.1
SETD.1 EditAt
STA.1
SETD.1 ConsoleEndOfInput
STA.1
; Where the line begins, ASKED rather than assumed. The prompt has just been printed and
; only the console knows where it left off.
INA 0x03
SETD.1 EditRow
STA.1
INA 0x04
SETD.1 EditColumn
STA.1
; How wide the screen is, which is what decides where a long line carries on. A machine
; with nothing on that port answers zero, and a width of zero would make the walking below
; never finish, so it is taken as the width this system asks for at boot.
INA 0x32
BNA editWidthKnown
INIA 0d80
editWidthKnown:
SETD.1 EditWidth
STA.1
; Key mode, with the cursor the shell keeps. Nothing echoes from here on: everything that
; appears below is put there by this routine.
INIA 0x05
OUTA 0x02
editKey:
INA 0x00
SETD.1 EditChar
STA.1
; The ways out first, since they leave rather than change anything. XOR leaves the answer
; in Q and A alone, so one read stands for the whole ladder.
INIB 0x0A
XOR
BRQ editDone
INIB 0x0D
XOR
BRQ editDone
INIB 0xFF
XOR
BRQ editEnded
; ---- And the key that means there is no more ----
;
; Ctrl-D, which the terminal used to turn into the end of input all by itself and cannot any
; more: that is a thing a terminal does while it is holding the line, and it is not holding
; it now. So the shell does it, which is the same trade as the echoing and the backspacing.
;
; ONLY ON AN EMPTY LINE, which is the rule everywhere else it appears. In the middle of
; something typed it means neither "stop" nor a character, so it means nothing.
INIB 0x04
XOR
BNQ editNotEnd
SETD.1 EditLength
LDB.1
BRB editEnded
editNotEnd:
INIB 0x08
XOR
BRQ editBack
INIB 0x86
XOR
BRQ editDelete
INIB 0x82
XOR
BRQ editLeft
INIB 0x83
XOR
BRQ editRight
INIB 0x84
XOR
BRQ editHome
INIB 0x85
XOR
BRQ editEnd
; Anything else is a character if it is printable and nothing at all if it is not. The
; console's own keys that this shell has no use for land here and are ignored rather than
; typed, which is the whole reason they are above ASCII.
INIB 0x20
CCF
SUB
BRC editKey
INIB 0x7F
CCF
SUB
BNC editKey
; ---- Putting a character in ----
editInsert:
SETD.1 EditLength
LDA.1
SETD.1 EditRoom
LDB.1
CCF
SUB
BNC editKey ; Full. The zero byte on the end is not counted in the room.
; A hole at the insertion point, made from the top down so nothing is overwritten before
; it has been moved.
SETD.1 EditLength
LDA.1
SETD.1 EditAt
LDB.1
CCF
SUB
MVQB ; How many characters are above the insertion point.
SETD.1 EditBase
LDD.0.1
SETD.1 EditLength
LDA.1
DPUA.0 ; One past the last character.
editInsertShift:
BRB editInsertPut
DECD.0
LDA.0
INCD.0
STA.0
DECD.0
DECB
BRI editInsertShift
editInsertPut:
SETD.1 EditChar
LDA.1
STA.0
SETD.1 EditLength
LDA.1
INCA
STA.1
SETD.1 EditAt
LDA.1
INCA
STA.1
; At the end of the line, printing it IS the change.
SETD.1 EditLength
LDB.1
CCF
SUB
BNQ editInsertRedraw
SETD.1 EditChar
LDA.1
OUTA 0x00
BRI editKey
editInsertRedraw:
CALL editRedraw
BRI editKey
; ---- Taking one out ----
;
; Backspace and Delete are different keys doing different things: one takes the character
; BEFORE the insertion point, the other the one under it. They meet at editTakeOut, which is
; the only part they share.
editBack:
SETD.1 EditAt
LDA.1
BRA editKey ; Nothing before it. Rubbing out past the start of the line
; would eat the prompt, which belongs to whoever printed it.
DECA
STA.1
; Whether that was the last character decides how it disappears, and it has to be asked
; before the buffer shortens under it.
SETD.1 EditLength
LDB.1
DECB
CCF
SUB
BNQ editBackMiddle
CALL editTakeOut
; Rubbed out where it stands, which is what a terminal has always done for a backspace: no
; cursor moved by hand, and so nothing said to the terminal but three ordinary bytes.
INIA 0x08
OUTA 0x00
INIA 0x20
OUTA 0x00
INIA 0x08
OUTA 0x00
BRI editKey
editBackMiddle:
CALL editTakeOut
CALL editRedraw
BRI editKey
editDelete:
SETD.1 EditAt
LDA.1
SETD.1 EditLength
LDB.1
CCF
SUB
BRQ editKey ; Nothing under the cursor at the end of a line.
CALL editTakeOut
CALL editRedraw
BRI editKey
; Takes the character at the insertion point out of the buffer and shortens it. Draws
; nothing: what that should look like is the caller's business and the two callers disagree.
editTakeOut:
SETD.1 EditBase
LDD.0.1
SETD.1 EditAt
LDA.1
DPUA.0
SETD.1 EditLength
LDA.1
SETD.1 EditAt
LDB.1
CCF
SUB
MVQB
DECB ; One of those is the character going.
editTakeOutShift:
BRB editTakeOutDone
INCD.0
LDA.0
DECD.0
STA.0
INCD.0
DECB
BRI editTakeOutShift
editTakeOutDone:
SETD.1 EditLength
LDA.1
DECA
STA.1
RET
; ---- Moving about in it ----
;
; Nothing on the screen changes, so nothing on the screen is redrawn: only the cursor moves.
editLeft:
SETD.1 EditAt
LDA.1
BRA editKey
DECA
STA.1
BRI editShow
editRight:
SETD.1 EditAt
LDA.1
SETD.1 EditLength
LDB.1
CCF
SUB
BRQ editKey ; Already at the end.
SETD.1 EditAt
LDA.1
INCA
STA.1
BRI editShow
editHome:
RSTA
SETD.1 EditAt
STA.1
BRI editShow
editEnd:
SETD.1 EditLength
LDA.1
SETD.1 EditAt
STA.1
editShow:
SETD.1 EditAt
LDA.1
CALL editPlace
BRI editKey
; ---- The end of a line, and the end of the typing ----
editEnded:
INIA 0x01
SETD.1 ConsoleEndOfInput
STA.1
; AND NO NEWLINE. Nobody pressed Return, so there is no line to end: the console simply
; stopped having anything to say. Printing one here pushes whatever is said next down a row
; for a reason nobody could see, which is what it did until this line was written.
BRI editFinish
editDone:
; The newline belongs after the whole line, not after wherever the cursor was left sitting.
; Asked first, because a line finished at its end - which is almost every line - needs no
; cursor moved and so says nothing to the terminal.
SETD.1 EditAt
LDA.1
SETD.1 EditLength
LDB.1
CCF
SUB
BRQ editDoneEnd
LDA.1
CALL editPlace
editDoneEnd:
CALL newLine
editFinish:
; Line mode, with the cursor still on: that is how boot left the console and how every
; program that knows nothing of any of this expects to find it.
INIA 0x04
OUTA 0x02
SETD.1 EditBase
LDD.0.1
SETD.1 EditLength
LDA.1
DPUA.0
RSTA
STA.0 ; The zero byte that ends it.
SETD.1 EditLength
LDA.1
RSTB
CCF
ADD ; Q is how long the line is.
RET
; ---- Putting the line back on the screen ----
;
; The whole of it, every time, rather than the part that changed. A hundred and twenty odd
; characters is nothing to this machine, and the alternative is four separate cases that all
; have to agree about what is already up there.
editRedraw:
SETD.1 EditRow
LDA.1
OUTA 0x03
SETD.1 EditColumn
LDA.1
OUTA 0x04
SETD.1 EditBase
LDD.0.1
SETD.1 EditLength
LDB.1
editRedrawNext:
BRB editRedrawTail
LDA.0
OUTA 0x00
INCD.0
DECB
BRI editRedrawNext
editRedrawTail:
; One space after it. A line that has just got shorter has a character left over on the
; end, and printing over it costs less than working out whether there is one.
INIA 0x20
OUTA 0x00
CALL editAnchor
SETD.1 EditAt
LDA.1
CALL editPlace
RET
; ---- Where the line starts, worked out backwards ----
;
; The console has just been told to print, so it knows where printing ENDED, and the line
; began that many characters before it. Asking afterwards rather than trusting what was
; remembered is what makes this survive the screen SCROLLING: a line printed on the bottom
; row moves everything up by one, and a remembered row would be one too low from then on.
editAnchor:
INA 0x03
SETD.1 EditWalkRow
STA.1
INA 0x04
SETD.1 EditWalkColumn
STA.1
SETD.1 EditLength
LDA.1
INCA ; The space was printed too.
SETD.1 EditWalkBack
STA.1
editAnchorWalk:
SETD.1 EditWalkColumn
LDA.1
SETD.1 EditWalkBack
LDB.1
CCF
SUB
BRC editAnchorRowUp ; Further back than this row goes.
MVQA
SETD.1 EditWalkColumn
STA.1
BRI editAnchorDone
editAnchorRowUp:
; Off the front of this row, so take what the row used and carry on along the one above.
SETD.1 EditWalkBack
LDA.1
SETD.1 EditWalkColumn
LDB.1
INCB ; The column itself, and the step onto it.
CCF
SUB
MVQA
SETD.1 EditWalkBack
STA.1
SETD.1 EditWidth
LDA.1
DECA
SETD.1 EditWalkColumn
STA.1
SETD.1 EditWalkRow
LDA.1
BRA editAnchorTop
DECA
STA.1
BRI editAnchorWalk
editAnchorTop:
; The line began off the top of the screen, which means more was scrolled away than the
; line is long. There is nothing sensible left to point at, so it starts in the corner.
RSTA
SETD.1 EditWalkColumn
STA.1
editAnchorDone:
SETD.1 EditWalkRow
LDA.1
SETD.1 EditRow
STA.1
SETD.1 EditWalkColumn
LDA.1
SETD.1 EditColumn
STA.1
RET
; A says how many characters along the line the cursor belongs. Puts it there, carrying onto
; the rows below when the line is longer than one row of the screen.
editPlace:
SETD.1 EditColumn
LDB.1
CCF
ADD
MVQA
SETD.1 EditWalkColumn
STA.1
SETD.1 EditRow
LDA.1
SETD.1 EditWalkRow
STA.1
editPlaceWrap:
SETD.1 EditWalkColumn
LDA.1
SETD.1 EditWidth
LDB.1
CCF
SUB
BRC editPlaceDone ; Inside the row.
MVQA
SETD.1 EditWalkColumn
STA.1
SETD.1 EditWalkRow
LDA.1
INCA
STA.1
BRI editPlaceWrap
editPlaceDone:
SETD.1 EditWalkRow
LDA.1
OUTA 0x03
SETD.1 EditWalkColumn
LDA.1
OUTA 0x04
RET RET
; ---- A command that did not work ---- ; ---- A command that did not work ----
@@ -4776,9 +5281,45 @@ DirSize:
WidthLeft: WidthLeft:
0x00 0x00
; Sixty three characters and the zero byte that ends them. ; ---- What a line being typed is made of ----
;
; All of it lives here rather than being passed about, because the routine that reads a line
; is a loop over keystrokes and there are four Data Pointers, two of which it needs for the
; buffer and the walking.
EditBase:
0x00 0x00
EditRoom:
0x00
EditLength:
0x00
EditAt:
0x00
EditRow:
0x00
EditColumn:
0x00
EditWidth:
0x00
EditChar:
0x00
; Where the counting up and down the rows has got to. Separate from EditRow and EditColumn,
; which are where the LINE starts: one of the two things that reads these is working out
; that very answer, and a walk that wrote its intermediate steps into its own starting point
; would be walking away from a moving mark.
EditWalkRow:
0x00
EditWalkColumn:
0x00
EditWalkBack:
0x00
; A hundred and twenty seven characters and the zero byte that ends them. It was sixty three
; until the shell learned to edit a line, which is when the limit started to be felt: a copy
; between two disks with a directory on each is most of the way there before anything has
; been said, and the line can now be moved about in, so a long one is worth having.
CommandLine: CommandLine:
#Reserve 0d64 #Reserve 0d128
#Vectors #Vectors
+1 -1
View File
@@ -79,7 +79,7 @@ from `make`, not from here.
### 1. Recorded output ### 1. Recorded output
`Tests/run.sh` assembles each program named in `Tests/manifest`, runs it, and compares `Tests/run.sh` assembles each program named in `Tests/manifest`, runs it, and compares
everything it printed against a file in `Tests/expected`. 188 tests, of which 126 run, 35 everything it printed against a file in `Tests/expected`. 189 tests, of which 127 run, 35
only assemble, 16 are expected to fail to assemble, and 11 boot from ROM with no image only assemble, 16 are expected to fail to assemble, and 11 boot from ROM with no image
given at all. given at all.
+4 -1
View File
@@ -169,7 +169,10 @@ if cmp -s toCopy.dat copiedBack.dat; then
else else
report FAIL "large native copy" "the host read back different bytes" report FAIL "large native copy" "the host read back different bytes"
fi fi
if grep -q '^> the same$' copied.txt; then # Not anchored to a prompt any more. The shell echoes the line it was given and then ends
# it, so what a command prints now starts at the beginning of a line instead of following
# the "> " that asked for it.
if grep -q '^the same$' copied.txt; then
report ok "native compare" "the streamed files agree" report ok "native compare" "the streamed files agree"
else else
report FAIL "native compare" "Compare did not call the copied files equal" report FAIL "native compare" "Compare did not call the copied files equal"
+9 -4
View File
@@ -2,15 +2,20 @@ stage two
no /System/Boot/missing.bin no /System/Boot/missing.bin
trying the fallback trying the fallback
CosmOS CosmOS
> saved it > Files
saved it
read it back, 22 bytes: read it back, 22 bytes:
a file kept by asking a file kept by asking
renamed it renamed it
deleted it deleted it
and it is gone and it is gone
finished finished
> made > mkdir Notes
> /Notes> 0 files made
/Notes> halted > cd Notes
/Notes> dir
0 files
/Notes> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+9 -4
View File
@@ -1,5 +1,6 @@
CosmOS CosmOS
> dir list what is on the disk > help
dir list what is on the disk
load <file> read a program off the disk load <file> read a program off the disk
run [words] start what was loaded, and tell it those words run [words] start what was loaded, and tell it those words
<name> [words] look where you are and then in /Apps, and start that <name> [words] look where you are and then in /Apps, and start that
@@ -14,7 +15,8 @@ rename <file> <to> call it something else
monitor look at memory, change it, and jump into it monitor look at memory, change it, and jump into it
help this help this
exit stop, or leave the monitor if you are in it exit stop, or leave the monitor if you are in it
> greeting.txt 17 > dir
greeting.txt 17
filler1.txt 8 filler1.txt 8
filler2.txt 8 filler2.txt 8
filler3.txt 8 filler3.txt 8
@@ -27,7 +29,10 @@ across.txt 700
empty.txt 0 empty.txt 0
aName22CharactersLong! 22 aName22CharactersLong! 22
12 files 12 files
> > I do not know: frobnicate >
> halted > frobnicate
I do not know: frobnicate
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+4 -2
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
no filesystem on the disk no filesystem on the disk
> no filesystem on the disk > dir
> halted no filesystem on the disk
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+6 -3
View File
@@ -1,6 +1,9 @@
CosmOS CosmOS
> drive: nothing this can read is in that drive > drive 1
> 0 drive: nothing this can read is in that drive
> halted > drive
0
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+6 -3
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> loaded, starting at 4000 > load Break.sbx
> two stops, and what the registers were at each loaded, starting at 4000
> run
two stops, and what the registers were at each
break at 4016 break at 4016
A 11 B 22 Q 00 status 00 A 11 B 22 Q 00 status 00
DP0 2030 DP1 2000 DP2 2037 DP3 4000 SP FFFF DP0 2030 DP1 2000 DP2 2037 DP3 4000 SP FFFF
@@ -11,6 +13,7 @@ DP0 2000 DP1 2037 DP2 2030 DP3 4000 SP FFF5
press a key press a key
carried on to the end carried on to the end
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+43 -20
View File
@@ -1,27 +1,50 @@
CosmOS CosmOS
> 0 files > dir
> made 0 files
> made > mkdir Apps
> made made
> Apps <dir> > mkdir Apps/Deep
made
> mkdir Notes
made
> dir
Apps <dir>
Notes <dir> Notes <dir>
0 files, 2 directories 0 files, 2 directories
> /Apps> Deep <dir> > cd Apps
/Apps> dir
Deep <dir>
0 files, 1 directory 0 files, 1 directory
/Apps> cannot make that: check the path, the name, and whether it is taken /Apps> mkdir Deep
/Apps> made cannot make that: check the path, the name, and whether it is taken
/Apps> /Notes> Deep <dir> /Apps> mkdir /Notes/Deep
made
/Apps> cd /Notes
/Notes> dir
Deep <dir>
0 files, 1 directory 0 files, 1 directory
/Notes> cannot remove that: it must be a directory, and empty /Notes> rmdir /Apps
/Notes> removed cannot remove that: it must be a directory, and empty
/Notes> that is a directory /Notes> rmdir /Apps/Deep
/Notes> removed removed
/Notes> > cannot make that: check the path, the name, and whether it is taken /Notes> delete /Apps
> cannot remove that: it must be a directory, and empty that is a directory
> cannot remove that: it must be a directory, and empty /Notes> rmdir /Notes/Deep
> removed removed
> removed /Notes> cd /
> 0 files > mkdir Apps/Deep/Inner
> halted cannot make that: check the path, the name, and whether it is taken
> rmdir Apps/Deep/Inner
cannot remove that: it must be a directory, and empty
> rmdir Apps/Deep
cannot remove that: it must be a directory, and empty
> rmdir Apps
removed
> rmdir Notes
removed
> dir
0 files
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+6 -3
View File
@@ -1,10 +1,13 @@
CosmOS CosmOS
> claiming more than was reserved was refused > Claim
claiming more than was reserved was refused
and the size it really came to was taken and the size it really came to was taken
finished finished
> Claim.sbx 580 > dir
Claim.sbx 580
claim.dat 266 claim.dat 266
2 files 2 files
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+28 -14
View File
@@ -1,30 +1,44 @@
CosmOS CosmOS
> copied > Copy /Input/empty.dat /Output/empty.dat
copied
finished finished
> the same > Compare /Input/empty.dat /Output/empty.dat
the same
finished finished
> copied > Copy /Input/exact.dat /Output/exact.dat
copied
finished finished
> the same > Compare /Input/exact.dat /Output/exact.dat
the same
finished finished
> copied > Copy /Input/tail.dat /Output/tail.dat
copied
finished finished
> the same > Compare /Input/tail.dat /Output/tail.dat
the same
finished finished
> copied > Copy /Input/large.dat /Output/large.dat
copied
finished finished
> the same > Compare /Input/large.dat /Output/large.dat
the same
finished finished
> different > Compare /Input/large.dat /Input/different.dat
different
finished finished
> copy: cannot find the source > Copy /Input/missing.dat /Output/missing.dat
copy: cannot find the source
finished finished
> compare: cannot find the second file > Compare /Input/large.dat /Input/missing.dat
compare: cannot find the second file
finished finished
> copy: give me a source and destination > Copy
copy: give me a source and destination
finished finished
> compare: give me two files > Compare /Input/large.dat
compare: give me two files
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+14 -6
View File
@@ -1,11 +1,18 @@
CosmOS CosmOS
> > copied > drive 1
> Copy 1:/twoblocks.txt 0:/crossed.txt
copied
finished finished
> 1 > drive
> it says: from drive one 1
> Say from drive one
it says: from drive one
finished finished
> 1 > drive
> > greet.sbx 211 1
> cd 0:/
> dir
greet.sbx 211
hello.sbx 53 hello.sbx 53
Life.sbx 1396 Life.sbx 1396
Snake.sbx 2164 Snake.sbx 2164
@@ -26,6 +33,7 @@ inner.script 44
loop.script 35 loop.script 35
crossed.txt 560 crossed.txt 560
19 files, 1 directory 19 files, 1 directory
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+42 -22
View File
@@ -1,36 +1,56 @@
CosmOS CosmOS
> Apps <dir> > dir
Apps <dir>
A <dir> A <dir>
B <dir> B <dir>
0 files, 3 directories 0 files, 3 directories
> /A> Say.sbx 53 > cd /A
/A> dir
Say.sbx 53
notes.txt 25 notes.txt 25
2 files 2 files
/A> these are the notes in A /A> Type notes.txt
finished
/A> /B> and these are the very different notes in B
finished
/B> it says: reached the one in Apps
finished
/B> /A> Hello, World!
finished
/A> > Apps <dir>
A <dir>
B <dir>
0 files, 3 directories
> /B> these are the notes in A
finished
/B> moved, and reading a bare name from there:
these are the notes in A these are the notes in A
finished finished
/B> and these are the very different notes in B /A> cd /B
/B> Type notes.txt
and these are the very different notes in B
finished finished
/B> no such file /B> Say reached the one in Apps
/B> that is not a directory it says: reached the one in Apps
/B> > Apps <dir> finished
/B> cd /A
/A> Say reached the one in A
Hello, World!
finished
/A> cd ..
> dir
Apps <dir>
A <dir> A <dir>
B <dir> B <dir>
0 files, 3 directories 0 files, 3 directories
> halted > cd /B
/B> Type ../A/notes.txt
these are the notes in A
finished
/B> Wander /A
moved, and reading a bare name from there:
these are the notes in A
finished
/B> Type notes.txt
and these are the very different notes in B
finished
/B> cd nosuchplace
no such file
/B> cd notes.txt
that is not a directory
/B> cd /
> dir
Apps <dir>
A <dir>
B <dir>
0 files, 3 directories
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+13 -2
View File
@@ -1,5 +1,14 @@
CosmOS CosmOS
> /abcdefghijklmnopqrst01> /abcdefghijklmnopqrst01/abcdefghijklmnopqrst02> /abcdefghijklmnopqrst01/abcdefghijklmnopqrst02/abcdefghijklmnopqrst03> /abcdefghijklmnopqrst01/abcdefghijklmnopqrst02/abcdefghijklmnopqrst03/abcdefghijklmnopqrst04> /abcdefghijklmnopqrst01/abcdefghijklmnopqrst02/abcdefghijklmnopqrst03/abcdefghijklmnopqrst04/abcdefghijklmnopqrst05> ...opqrst01/abcdefghijklmnopqrst02/abcdefghijklmnopqrst03/abcdefghijklmnopqrst04/abcdefghijklmnopqrst05/abcdefghijklmnopqrst06> ...opqrst02/abcdefghijklmnopqrst03/abcdefghijklmnopqrst04/abcdefghijklmnopqrst05/abcdefghijklmnopqrst06/abcdefghijklmnopqrst07> ...opqrst03/abcdefghijklmnopqrst04/abcdefghijklmnopqrst05/abcdefghijklmnopqrst06/abcdefghijklmnopqrst07/abcdefghijklmnopqrst08> dir list what is on the disk > cd abcdefghijklmnopqrst01
/abcdefghijklmnopqrst01> cd abcdefghijklmnopqrst02
/abcdefghijklmnopqrst01/abcdefghijklmnopqrst02> cd abcdefghijklmnopqrst03
/abcdefghijklmnopqrst01/abcdefghijklmnopqrst02/abcdefghijklmnopqrst03> cd abcdefghijklmnopqrst04
/abcdefghijklmnopqrst01/abcdefghijklmnopqrst02/abcdefghijklmnopqrst03/abcdefghijklmnopqrst04> cd abcdefghijklmnopqrst05
/abcdefghijklmnopqrst01/abcdefghijklmnopqrst02/abcdefghijklmnopqrst03/abcdefghijklmnopqrst04/abcdefghijklmnopqrst05> cd abcdefghijklmnopqrst06
...opqrst01/abcdefghijklmnopqrst02/abcdefghijklmnopqrst03/abcdefghijklmnopqrst04/abcdefghijklmnopqrst05/abcdefghijklmnopqrst06> cd abcdefghijklmnopqrst07
...opqrst02/abcdefghijklmnopqrst03/abcdefghijklmnopqrst04/abcdefghijklmnopqrst05/abcdefghijklmnopqrst06/abcdefghijklmnopqrst07> cd abcdefghijklmnopqrst08
...opqrst03/abcdefghijklmnopqrst04/abcdefghijklmnopqrst05/abcdefghijklmnopqrst06/abcdefghijklmnopqrst07/abcdefghijklmnopqrst08> help
dir list what is on the disk
load <file> read a program off the disk load <file> read a program off the disk
run [words] start what was loaded, and tell it those words run [words] start what was loaded, and tell it those words
<name> [words] look where you are and then in /Apps, and start that <name> [words] look where you are and then in /Apps, and start that
@@ -14,6 +23,8 @@ rename <file> <to> call it something else
monitor look at memory, change it, and jump into it monitor look at memory, change it, and jump into it
help this help this
exit stop, or leave the monitor if you are in it exit stop, or leave the monitor if you are in it
...opqrst03/abcdefghijklmnopqrst04/abcdefghijklmnopqrst05/abcdefghijklmnopqrst06/abcdefghijklmnopqrst07/abcdefghijklmnopqrst08> > halted ...opqrst03/abcdefghijklmnopqrst04/abcdefghijklmnopqrst05/abcdefghijklmnopqrst06/abcdefghijklmnopqrst07/abcdefghijklmnopqrst08> cd
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+17 -6
View File
@@ -1,9 +1,20 @@
CosmOS CosmOS
> /notes> 1 > cd 1:/notes
/notes> > 0 /notes> drive
> /2things> 1 1
/2things> > /2things> 1 /notes> cd 0:/
/2things> no such file > drive
/2things> halted 0
> cd 1:/2things
/2things> drive
1
/2things> cd /
> cd 2things
/2things> drive
1
/2things> cd 9:/
no such file
/2things> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+16 -5
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> 0 > drive
> greet.sbx 211 0
> dir
greet.sbx 211
hello.sbx 53 hello.sbx 53
Life.sbx 1396 Life.sbx 1396
Snake.sbx 2164 Snake.sbx 2164
@@ -20,12 +22,21 @@ outer.script 376
inner.script 44 inner.script 44
loop.script 35 loop.script 35
18 files, 1 directory 18 files, 1 directory
> > other.txt 28 > drive 1
> dir
other.txt 28
notes <dir> notes <dir>
2things <dir> 2things <dir>
twoblocks.txt 560 twoblocks.txt 560
2 files, 2 directories 2 files, 2 directories
> /notes> > /notes> > /notes> drive: this machine has no such drive > cd /notes
/notes> halted /notes> drive 0
> drive 1
/notes> drive 0
> drive 1
/notes> drive 3
drive: this machine has no such drive
/notes> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+8 -4
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> loaded, starting at 4000 > load Edit.sbx
> poem.txt, new file loaded, starting at 4000
> run poem.txt
poem.txt, new file
> : : : : > : : > 1: alpha > : : : : > : : > 1: alpha
2: INSERTED 2: INSERTED
3: beta 3: beta
@@ -10,12 +12,14 @@ CosmOS
3: beta 3: beta
> written, 22 bytes > written, 22 bytes
> finished > finished
> poem.txt, 3 lines > run poem.txt
poem.txt, 3 lines
> 1: CHANGED > 1: CHANGED
2: INSERTED 2: INSERTED
3: beta 3: beta
> there is no such line > there is no such line
> finished > finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+17
View File
@@ -0,0 +1,17 @@
CosmOS
> eco okecho ok 
ok
> Xecho okecho ok 
ok
> echo ok
ok
> echo okX 
ok
> echo kecho ok 
ok
> Xecho aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaecho aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa !
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!
> exit
halted
Execution halted.
[exit 0]
+12 -6
View File
@@ -1,14 +1,20 @@
CosmOS CosmOS
> hello.asm, 31 lines > Edit hello.asm
hello.asm, 31 lines
> finished > finished
> hello.asm, 31 lines > Edit hello.asm
hello.asm, 31 lines
> finished > finished
> the last program left 0, which is: it did what it was asked > Status
the last program left 0, which is: it did what it was asked
finished finished
> a line in it is longer than this can edit, so it has not been opened > Edit long.txt
a line in it is longer than this can edit, so it has not been opened
finished finished
> the last program left 1, which is: it did not > Status
the last program left 1, which is: it did not
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+18 -9
View File
@@ -1,17 +1,26 @@
CosmOS CosmOS
> one.txt 13 > dir
one.txt 13
two.txt 14 two.txt 14
2 files 2 files
> renamed > rename one.txt first.txt
> first.txt 13 renamed
> dir
first.txt 13
two.txt 14 two.txt 14
2 files 2 files
> gone > delete first.txt
> two.txt 14 gone
> dir
two.txt 14
1 file 1 file
> no such file > delete first.txt
> rename what to what? no such file
> there is no such file, or that name is taken > rename two.txt
> halted rename what to what?
> rename two.txt two.txt
there is no such file, or that name is taken
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+11 -5
View File
@@ -1,10 +1,15 @@
CosmOS CosmOS
> it says: before Grid > Say before Grid
it says: before Grid
finished finished
> finished > Grid
> > it says: after Grid finished
>
> Say after Grid
it says: after Grid
finished finished
> greet.sbx 211 > dir
greet.sbx 211
hello.sbx 53 hello.sbx 53
Life.sbx 1396 Life.sbx 1396
Snake.sbx 2164 Snake.sbx 2164
@@ -24,6 +29,7 @@ outer.script 376
inner.script 44 inner.script 44
loop.script 35 loop.script 35
18 files, 1 directory 18 files, 1 directory
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+8 -4
View File
@@ -1,9 +1,13 @@
CosmOS CosmOS
> loaded, starting at 4000 > load hello.sbx
> Hello, World! loaded, starting at 4000
> run
Hello, World!
finished finished
> Hello, World! > run
Hello, World!
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+24 -12
View File
@@ -1,22 +1,33 @@
CosmOS CosmOS
> it says: hello there > Say hello there
it says: hello there
finished finished
> it says: spelled out in full > Say.sbx spelled out in full
it says: spelled out in full
finished finished
> it says: once more > run once more
it says: once more
finished finished
> Say.sbx 156 > dir
Say.sbx 156
dir.sbx 156 dir.sbx 156
notes.txt 21 notes.txt 21
notes.sbx 21 notes.sbx 21
4 files 4 files
> not a program > notes
> not a program not a program
> I do not know: notes.txt > notes.sbx
> I do not know: nosuchprogram not a program
> I do not know: abcdefghijklmnopqr > notes.txt
> I do not know: abcdefghijklmnopqrs I do not know: notes.txt
> dir list what is on the disk > nosuchprogram
I do not know: nosuchprogram
> abcdefghijklmnopqr
I do not know: abcdefghijklmnopqr
> abcdefghijklmnopqrs
I do not know: abcdefghijklmnopqrs
> help
dir list what is on the disk
load <file> read a program off the disk load <file> read a program off the disk
run [words] start what was loaded, and tell it those words run [words] start what was loaded, and tell it those words
<name> [words] look where you are and then in /Apps, and start that <name> [words] look where you are and then in /Apps, and start that
@@ -31,6 +42,7 @@ rename <file> <to> call it something else
monitor look at memory, change it, and jump into it monitor look at memory, change it, and jump into it
help this help this
exit stop, or leave the monitor if you are in it exit stop, or leave the monitor if you are in it
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+17 -7
View File
@@ -1,19 +1,29 @@
CosmOS CosmOS
> loaded, starting at 4000 > load Keys.sbx
> keys, by interrupt. q stops. loaded, starting at 4000
> run
keys, by interrupt. q stops.
ab ab
the console has been handed back the console has been handed back
finished finished
> > keys, by interrupt. q stops. >
> run
keys, by interrupt. q stops.
cd cd
the console has been handed back the console has been handed back
finished finished
> > x examine, d disassemble, a assemble, s set, b bank, g go, exit leaves >
* bank 00 > monitor
* FE00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ x examine, d disassemble, a assemble, s set, b bank, g go, exit leaves
* b program
bank 00
* x fe00
FE00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
FE10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ FE10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
FE20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ FE20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
FE30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ FE30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
* > halted * exit
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+4 -2
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> loaded, starting at 4000 > load Life.sbx
>  # loaded, starting at 4000
> run
 #
# #
### ###
+6 -3
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> loaded, starting at 4000 > load Life.sbx
>  # loaded, starting at 4000
> run
 #
# #
### ###
@@ -19,7 +21,8 @@ CosmOS
stopped stopped
finished finished
> > >
>
halted halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+31 -15
View File
@@ -1,10 +1,16 @@
CosmOS CosmOS
> x examine, d disassemble, a assemble, s set, b bank, g go, exit leaves > monitor
* b <program|data|number> x examine, d disassemble, a assemble, s set, b bank, g go, exit leaves
* there is no such bank * b nonsense
* loaded, starting at 4000 b <program|data|number>
* bank 00 * b 9
* 4000 47 00 20 00 SETD.0 2000 there is no such bank
* load greet.sbx
loaded, starting at 4000
* b program
bank 00
* d 4000
4000 47 00 20 00 SETD.0 2000
4004 72 10 SWI 10 4004 72 10 SWI 10
4006 47 00 20 44 SETD.0 2044 4006 47 00 20 44 SETD.0 2044
400A 72 10 SWI 10 400A 72 10 SWI 10
@@ -12,23 +18,32 @@ CosmOS
4010 27 1F INIB 1F 4010 27 1F INIB 1F
4012 72 11 SWI 11 4012 72 11 SWI 11
4014 47 00 20 5D SETD.0 205D 4014 47 00 20 5D SETD.0 205D
* 4000 47 00 20 00 72 10 47 00 20 44 72 10 47 00 20 7A G. .r.G. Dr.G. z * x 4000
4000 47 00 20 00 72 10 47 00 20 44 72 10 47 00 20 7A G. .r.G. Dr.G. z
4010 27 1F 72 11 47 00 20 5D 72 10 47 00 20 7A 72 10 '.r.G. ]r.G. zr. 4010 27 1F 72 11 47 00 20 5D 72 10 47 00 20 7A 72 10 '.r.G. ]r.G. zr.
4020 47 00 20 65 72 10 20 72 12 00 00 00 00 00 00 00 G. er. r........ 4020 47 00 20 65 72 10 20 72 12 00 00 00 00 00 00 00 G. er. r........
4030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 4030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
* bank 01 * b data
* 2000 61 20 70 72 6F 67 72 61 6D 2C 20 6C 6F 61 64 65 a program, loade bank 01
* x 2000
2000 61 20 70 72 6F 67 72 61 6D 2C 20 6C 6F 61 64 65 a program, loade
2010 64 20 6F 66 66 20 61 20 64 69 73 6B 2C 20 72 75 d off a disk, ru 2010 64 20 6F 66 66 20 61 20 64 69 73 6B 2C 20 72 75 d off a disk, ru
2020 6E 6E 69 6E 67 20 6F 6E 20 74 68 65 20 73 79 73 nning on the sys 2020 6E 6E 69 6E 67 20 6F 6E 20 74 68 65 20 73 79 73 nning on the sys
2030 74 65 6D 20 74 68 61 74 20 6C 6F 61 64 65 64 20 tem that loaded 2030 74 65 6D 20 74 68 61 74 20 6C 6F 61 64 65 64 20 tem that loaded
* bank 02 * b 2
* 0000 01 FF 00 00 00 00 00 00 01 FF 00 00 00 00 00 00 ................ bank 02
* x 0
0000 01 FF 00 00 00 00 00 00 01 FF 00 00 00 00 00 00 ................
0010 03 FF 08 00 00 00 00 00 01 20 01 00 00 00 00 00 ......... ...... 0010 03 FF 08 00 00 00 00 00 01 20 01 00 00 00 00 00 ......... ......
0020 00 FF 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 ................ 0020 00 FF 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 ................
0030 00 FF 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 ................ 0030 00 FF 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 ................
* that bank will not be written * s 0 FF
* bank 00 that bank will not be written
* * 8000 26 48 INIA 48 * b program
bank 00
* s 8000 26 48 D1 00 26 0A D1 00 18 12
* d 8000
8000 26 48 INIA 48
8002 D1 00 OUTA 00 8002 D1 00 OUTA 00
8004 26 0A INIA 0A 8004 26 0A INIA 0A
8006 D1 00 OUTA 00 8006 D1 00 OUTA 00
@@ -36,7 +51,8 @@ CosmOS
8009 12 AND 8009 12 AND
800A 00 ? 800A 00 ?
800B 00 ? 800B 00 ?
* Fault: 0x00 at Program Address 0x800A is not an instruction. * g 8000Fault: 0x00 at Program Address 0x800A is not an instruction.
H H
Execution halted. Execution halted.
[exit 1] [exit 1]
+10 -5
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> loaded, starting at 4000 > load More.sbx
> first line loaded, starting at 4000
> run readable.txt
first line
second line second line
line 00: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 00: ABCDEFGHIJKLMNOPQRSTUVWXYZ
line 01: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 01: ABCDEFGHIJKLMNOPQRSTUVWXYZ
@@ -24,7 +26,8 @@ line 18: ABCDEFGHIJKLMNOPQRSTUVWXYZ
line 19: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 19: ABCDEFGHIJKLMNOPQRSTUVWXYZ
-- more -- -- more --
finished finished
> first line > run readable.txt
first line
second line second line
line 00: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 00: ABCDEFGHIJKLMNOPQRSTUVWXYZ
line 01: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 01: ABCDEFGHIJKLMNOPQRSTUVWXYZ
@@ -58,7 +61,8 @@ line 27: ABCDEFGHIJKLMNOPQRSTUVWXYZ
line 28: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 28: ABCDEFGHIJKLMNOPQRSTUVWXYZ
line 29: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 29: ABCDEFGHIJKLMNOPQRSTUVWXYZ
finished finished
> first line > run readable.txt
first line
second line second line
line 00: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 00: ABCDEFGHIJKLMNOPQRSTUVWXYZ
line 01: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 01: ABCDEFGHIJKLMNOPQRSTUVWXYZ
@@ -84,6 +88,7 @@ line 19: ABCDEFGHIJKLMNOPQRSTUVWXYZ
line 20: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 20: ABCDEFGHIJKLMNOPQRSTUVWXYZ
-- more -- -- more --
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+2 -1
View File
@@ -1,6 +1,7 @@
CosmOS CosmOS
no filesystem on the disk no filesystem on the disk
> no filesystem on the disk > dir
no filesystem on the disk
> >
halted halted
Execution halted. Execution halted.
+5 -2
View File
@@ -1,5 +1,6 @@
CosmOS CosmOS
> a line, then keys. q stops. > Press
a line, then keys. q stops.
61 62 63 64 61 62 63 64
keys: keys:
80 up 80 up
@@ -8,6 +9,8 @@ keys:
5A Z 5A Z
done done
finished finished
> > halted >
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+5 -2
View File
@@ -1,5 +1,6 @@
CosmOS CosmOS
> a line, then keys. q stops. > Press
a line, then keys. q stops.
61 62 63 64 61 62 63 64
keys: keys:
80 up 80 up
@@ -8,6 +9,8 @@ keys:
5A Z 5A Z
done done
finished finished
> > halted >
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+11 -5
View File
@@ -1,10 +1,16 @@
CosmOS CosmOS
> > 0 files > drive 1
> copied > dir
0 files
> Copy 0:/Say.sbx 1:/Say.sbx
copied
finished finished
> Say.sbx 156 > dir
Say.sbx 156
1 file 1 file
> 1 > drive
> halted 1
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+18 -9
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> nothing is loaded > run
> greet.sbx 211 nothing is loaded
> dir
greet.sbx 211
hello.sbx 53 hello.sbx 53
Life.sbx 1396 Life.sbx 1396
Snake.sbx 2164 Snake.sbx 2164
@@ -20,16 +22,23 @@ outer.script 376
inner.script 44 inner.script 44
loop.script 35 loop.script 35
18 files, 1 directory 18 files, 1 directory
> load what? > load
> no such file load what?
> not a program > load nosuch.sbx
> loaded, starting at 4000 no such file
> a program, loaded off a disk, running on the system that loaded it > load notes.txt
not a program
> load greet.sbx
loaded, starting at 4000
> run
a program, loaded off a disk, running on the system that loaded it
what should I call you? hello, Anachronaut. that is all I do. what should I call you? hello, Anachronaut. that is all I do.
finished finished
> a program, loaded off a disk, running on the system that loaded it > run
a program, loaded off a disk, running on the system that loaded it
what should I call you? hello, Claude. that is all I do. what should I call you? hello, Claude. that is all I do.
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+10 -5
View File
@@ -1,11 +1,16 @@
CosmOS CosmOS
> loaded, starting at 4000 > load Say.sbx
> nothing was said loaded, starting at 4000
> run
nothing was said
finished finished
> it says: notes.txt > run notes.txt
it says: notes.txt
finished finished
> it says: a longer thing with spaces > run a longer thing with spaces
it says: a longer thing with spaces
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+4 -2
View File
@@ -1,5 +1,6 @@
CosmOS CosmOS
> > echo saying what it is doing > do hi.script
> echo saying what it is doing
saying what it is doing saying what it is doing
> Say from a script > Say from a script
it says: from a script it says: from a script
@@ -9,6 +10,7 @@ finished
> Say and again > Say and again
it says: and again it says: and again
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+10 -5
View File
@@ -1,13 +1,18 @@
CosmOS CosmOS
> > Say before > do bad.script
> Say before
it says: before it says: before
finished finished
> nosuchcommand > nosuchcommand
I do not know: nosuchcommand I do not know: nosuchcommand
stopped: that line did not work stopped: that line did not work
> do: that is not a script - it wants #! on the first line > do plain.script
> do: cannot find it do: that is not a script - it wants #! on the first line
> do: give me the name of a script > do nothere.script
> halted do: cannot find it
> do
do: give me the name of a script
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+6 -3
View File
@@ -1,10 +1,13 @@
CosmOS CosmOS
> > Say across the block boundary > do cross.script
> Say across the block boundary
it says: across the block boundary it says: across the block boundary
finished finished
> > Say with no newline after me > do nonl.script
> Say with no newline after me
it says: with no newline after me it says: with no newline after me
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+6 -3
View File
@@ -1,5 +1,6 @@
CosmOS CosmOS
> > echo outer in block one > do outer.script
> echo outer in block one
outer in block one outer in block one
> do inner.script > do inner.script
> echo inner one > echo inner one
@@ -8,7 +9,8 @@ inner one
inner two inner two
> echo outer resumed in block one > echo outer resumed in block one
outer resumed in block one outer resumed in block one
> > echo self > do loop.script
> echo self
self self
> do loop.script > do loop.script
> echo self > echo self
@@ -22,6 +24,7 @@ self
> do loop.script > do loop.script
do: scripts are only four deep do: scripts are only four deep
stopped: that line did not work stopped: that line did not work
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+6 -3
View File
@@ -1,12 +1,15 @@
CosmOS CosmOS
> loaded, starting at 4000 > load Files.sbx
> saved it loaded, starting at 4000
> run
saved it
read it back, 22 bytes: read it back, 22 bytes:
a file kept by asking a file kept by asking
renamed it renamed it
deleted it deleted it
and it is gone and it is gone
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+4 -2
View File
@@ -1,8 +1,10 @@
CosmOS CosmOS
this is the fallback: what boot.cfg asks for did not start this is the fallback: what boot.cfg asks for did not start
> the disk says the last start did not arrive, so this is the fallback > Settle
the disk says the last start did not arrive, so this is the fallback
settled: the next start will use the configuration again settled: the next start will use the configuration again
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+4 -2
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> already settled: the next start will use the configuration > Settle
already settled: the next start will use the configuration
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+8 -4
View File
@@ -1,5 +1,6 @@
CosmOS CosmOS
> greet.sbx 211 > dir
greet.sbx 211
hello.sbx 53 hello.sbx 53
Life.sbx 1396 Life.sbx 1396
Snake.sbx 2164 Snake.sbx 2164
@@ -19,9 +20,12 @@ outer.script 376
inner.script 44 inner.script 44
loop.script 35 loop.script 35
18 files, 1 directory 18 files, 1 directory
> loaded, starting at 4000 > load Say.sbx
> it says: the disk took its time loaded, starting at 4000
> run the disk took its time
it says: the disk took its time
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+4 -2
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> loaded, starting at 4000 > load Snake.sbx
> +----------------+ loaded, starting at 4000
> run
+----------------+
| | | |
| | | |
| | | |
+6 -3
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> loaded, starting at 4000 > load readTest.sbx
> ; This is a basic hello world program for the SplitBit CPU. loaded, starting at 4000
> run hello.asm
; This is a basic hello world program for the SplitBit CPU.
; We'll create a loop that outputs each byte of our string to Output 0, the text console. ; We'll create a loop that outputs each byte of our string to Output 0, the text console.
#Program #Program
@@ -22,6 +24,7 @@ End:
"Hello, World!" "Hello, World!"
---- lines: 21 ---- lines: 21
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+5 -2
View File
@@ -4,7 +4,10 @@ CosmOS ready.
> echo and loud again > echo and loud again
and loud again and loud again
and quiet again at the end and quiet again at the end
> > typed by hand > clear
> halted > echo typed by hand
typed by hand
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+5 -2
View File
@@ -1,6 +1,9 @@
CosmOS CosmOS
startup.sh is there but does not begin with #!, so it was not run startup.sh is there but does not begin with #!, so it was not run
> > typed by hand > clear
> halted > echo typed by hand
typed by hand
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+14 -7
View File
@@ -1,16 +1,23 @@
CosmOS CosmOS
> it says: it worked > Say it worked
it says: it worked
finished finished
> the last program left 0, which is: it did what it was asked > Status
the last program left 0, which is: it did what it was asked
finished finished
> type: give me a file name > Type
type: give me a file name
finished finished
> the last program left 2, which is: it was asked wrongly > Status
the last program left 2, which is: it was asked wrongly
finished finished
> type: cannot find the file, error 2 > Type /nothing/here.txt
type: cannot find the file, error 2
finished finished
> the last program left 1, which is: it did not > Status
the last program left 1, which is: it did not
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+6 -3
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> loaded, starting at 4000 > load Stream.sbx
> big.txt is 329 blocks loaded, starting at 4000
> run
big.txt is 329 blocks
read 329 blocks, checksum 57368, stopped with 3 read 329 blocks, checksum 57368, stopped with 3
small.txt streamed is 15216, read whole is 15216 small.txt streamed is 15216, read whole is 15216
the same the same
@@ -11,6 +13,7 @@ the new name answers 0
a name that was never there answers 2 a name that was never there answers 2
a block past the end answers 3 a block past the end answers 3
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+6 -3
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> loaded, starting at 4000 > load tokenTest.sbx
> 4 keyword 0 [#Program] loaded, starting at 4000
> run hello.asm
4 keyword 0 [#Program]
6 label: 0 [Start:] 6 label: 0 [Start:]
7 instr 2 [LDA] 7 instr 2 [LDA]
8 instr 1 [BRA] 8 instr 1 [BRA]
@@ -20,6 +22,7 @@ CosmOS
20 string 14 [Hello, World!] 20 string 14 [Hello, World!]
---- no more tokens ---- no more tokens
finished finished
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+38 -19
View File
@@ -1,30 +1,49 @@
CosmOS CosmOS
> Apps <dir> > dir
Apps <dir>
rooted.txt 21 rooted.txt 21
1 file, 1 directory 1 file, 1 directory
> loaded, starting at 4000 > load /Apps/Say.sbx
> it says: the shallow one loaded, starting at 4000
> run the shallow one
it says: the shallow one
finished finished
> loaded, starting at 4000 > load /Apps/Deep/Say.sbx
> Hello, World! loaded, starting at 4000
> run the deep one
Hello, World!
finished finished
> loaded, starting at 4000 > load /Apps/./Deep/../Say.sbx
> it says: the shallow one again loaded, starting at 4000
> run the shallow one again
it says: the shallow one again
finished finished
> loaded, starting at 4000 > load /Apps/Deep/../../Apps/./Deep/Say.sbx
> Hello, World! loaded, starting at 4000
> run the deep one the long way round
Hello, World!
finished finished
> no such file > load /rooted.txt/Say.sbx
> no such file no such file
> that is a directory > load /Apps/Missing/Say.sbx
> no such file no such file
> no such file > load /Apps
> no such file that is a directory
> that is a directory > load /Apps/abcdefghijklmnopqrstuvw
> gone no such file
> Apps <dir> > load /
no such file
> load /Apps/Deep/../..
no such file
> delete /Apps
that is a directory
> delete /Apps/Deep/Say.sbx
gone
> dir
Apps <dir>
rooted.txt 21 rooted.txt 21
1 file, 1 directory 1 file, 1 directory
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+10 -5
View File
@@ -1,15 +1,20 @@
CosmOS CosmOS
> Folder <dir> > dir
Folder <dir>
Edit.sbx 2243 Edit.sbx 2243
1 file, 1 directory 1 file, 1 directory
> loaded, starting at 4000 > load Edit.sbx
> note.txt, new file loaded, starting at 4000
> run note.txt
note.txt, new file
> : : : > written, 67 bytes > : : : > written, 67 bytes
> finished > finished
> Folder <dir> > dir
Folder <dir>
Edit.sbx 2243 Edit.sbx 2243
note.txt 67 note.txt 67
2 files, 1 directory 2 files, 1 directory
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+12 -6
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> loaded, starting at 4000 > load Type.sbx
> first line loaded, starting at 4000
> run readable.txt
first line
second line second line
line 00: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 00: ABCDEFGHIJKLMNOPQRSTUVWXYZ
line 01: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 01: ABCDEFGHIJKLMNOPQRSTUVWXYZ
@@ -33,11 +35,15 @@ line 27: ABCDEFGHIJKLMNOPQRSTUVWXYZ
line 28: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 28: ABCDEFGHIJKLMNOPQRSTUVWXYZ
line 29: ABCDEFGHIJKLMNOPQRSTUVWXYZ line 29: ABCDEFGHIJKLMNOPQRSTUVWXYZ
finished finished
> finished > run empty.txt
> type: cannot find the file, error 2
finished finished
> type: give me a file name > run missing.txt
type: cannot find the file, error 2
finished finished
> halted > run
type: give me a file name
finished
> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+4 -2
View File
@@ -1,5 +1,6 @@
CosmOS CosmOS
> dir list what is on the disk > halp   melp    elp
dir list what is on the disk
load <file> read a program off the disk load <file> read a program off the disk
run [words] start what was loaded, and tell it those words run [words] start what was loaded, and tell it those words
<name> [words] look where you are and then in /Apps, and start that <name> [words] look where you are and then in /Apps, and start that
@@ -14,6 +15,7 @@ rename <file> <to> call it something else
monitor look at memory, change it, and jump into it monitor look at memory, change it, and jump into it
help this help this
exit stop, or leave the monitor if you are in it exit stop, or leave the monitor if you are in it
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+6 -3
View File
@@ -1,9 +1,12 @@
CosmOS CosmOS
> next start: /System/Boot/bare.bin, once > Once /System/Boot/bare.bin
next start: /System/Boot/bare.bin, once
finished finished
> System <dir> > dir /System/Boot
System <dir>
Apps <dir> Apps <dir>
0 files, 2 directories 0 files, 2 directories
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+4 -2
View File
@@ -1,6 +1,8 @@
CosmOS CosmOS
> starting again > Reboot
starting again
CosmOS CosmOS
> halted > exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+4 -2
View File
@@ -1,8 +1,10 @@
stage two stage two
CosmOS CosmOS
> next start: /System/Boot/bare.bin, once > Once /System/Boot/bare.bin
next start: /System/Boot/bare.bin, once
finished finished
> starting again > Reboot
starting again
stage two stage two
just this once: /System/Boot/bare.bin just this once: /System/Boot/bare.bin
bare metal: no system, just this bare metal: no system, just this
+9 -4
View File
@@ -1,14 +1,19 @@
stage two stage two
CosmOS CosmOS
> saved it > Files
saved it
read it back, 22 bytes: read it back, 22 bytes:
a file kept by asking a file kept by asking
renamed it renamed it
deleted it deleted it
and it is gone and it is gone
finished finished
> cannot make that: check the path, the name, and whether it is taken > mkdir Notes
> /Notes> 0 files cannot make that: check the path, the name, and whether it is taken
/Notes> halted > cd Notes
/Notes> dir
0 files
/Notes> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+9 -4
View File
@@ -1,14 +1,19 @@
stage two stage two
CosmOS CosmOS
> saved it > Files
saved it
read it back, 22 bytes: read it back, 22 bytes:
a file kept by asking a file kept by asking
renamed it renamed it
deleted it deleted it
and it is gone and it is gone
finished finished
> made > mkdir Notes
> /Notes> 0 files made
/Notes> halted > cd Notes
/Notes> dir
0 files
/Notes> exit
halted
Execution halted. Execution halted.
[exit 0] [exit 0]
+7
View File
@@ -0,0 +1,7 @@
eco ok„ƒƒh
Xecho ok„†
echo o„…k
echo okX
echo k‚o
Xecho aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa„†…!
exit
+1 -1
View File
@@ -16,7 +16,7 @@ Programs/CosmOS/Assembler/token.asm redundant-setd 2
Programs/CosmOS/Assembler/tokenTest.asm redundant-setd 1 Programs/CosmOS/Assembler/tokenTest.asm redundant-setd 1
Programs/CosmOS/Source/config.asm redundant-assignment 1 Programs/CosmOS/Source/config.asm redundant-assignment 1
Programs/CosmOS/Source/cosmos.asm redundant-assignment 1 Programs/CosmOS/Source/cosmos.asm redundant-assignment 1
Programs/CosmOS/Source/cosmos.asm redundant-setd 9 Programs/CosmOS/Source/cosmos.asm redundant-setd 10
Programs/CosmOS/Source/sbfs.asm branch-to-next 1 Programs/CosmOS/Source/sbfs.asm branch-to-next 1
Programs/CosmOS/Source/sbfs.asm redundant-assignment 4 Programs/CosmOS/Source/sbfs.asm redundant-assignment 4
Programs/CosmOS/Source/sbfs.asm redundant-setd 1 Programs/CosmOS/Source/sbfs.asm redundant-setd 1
+10
View File
@@ -305,6 +305,16 @@ cosmosPress | CosmOS/Source/cosmos.asm | run | cosmosPre
# end - the window's path through the gatherer - and it has its own copy of the line mode # end - the window's path through the gatherer - and it has its own copy of the line mode
# rule, so it needs its own test. The two recordings should agree, which is the point. # rule, so it needs its own test. The two recordings should agree, which is the point.
cosmosPressKeys | CosmOS/Source/cosmos.asm | run | - | - | disks/cosmos.img | cosmosPress.in cosmosPressKeys | CosmOS/Source/cosmos.asm | run | - | - | disks/cosmos.img | cosmosPress.in
# The shell editing the line it is being given, which is the whole reason the keys were
# made to arrive. Every line here is typed wrong and then corrected with a different key, and
# every one of them comes out as the same command - so the recording says both what the
# machine printed on the way and that the line the shell finally acted on was right.
#
# The escape sequences in it are the point rather than noise: moving the cursor by hand is
# what a terminal is TOLD about, and they are the only evidence of where the shell thinks it
# is. The last line is eighty five characters at a prompt in column two, so the cursor has to
# be found on the row below - the one case the arithmetic exists for.
cosmosEditKeys | CosmOS/Source/cosmos.asm | run | cosmosEditKeys.in | - | disks/cosmos.img
# The shell taking things off a disk and calling them something else, which is the last of # The shell taking things off a disk and calling them something else, which is the last of
# CosmOS's original four verbs to be built and the first time anything has changed a disk # CosmOS's original four verbs to be built and the first time anything has changed a disk
# from the shell. Its own image, because it changes what is on it: a fixture named with a # from the shell. Its own image, because it changes what is on it: a fixture named with a