mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 23:08:06 +11:00
Update shell/blkdev docs
This commit is contained in:
parent
95f1a8ddaf
commit
26e71ee580
@ -38,13 +38,13 @@ they should try to adhere to the convention, that is:
|
|||||||
|
|
||||||
## Shell usage
|
## Shell usage
|
||||||
|
|
||||||
`blockdev.asm` supplies 2 shell commands that you can graft to your shell thus:
|
`blockdev.asm` supplies 4 shell commands that you can graft to your shell thus:
|
||||||
|
|
||||||
[...]
|
[...]
|
||||||
SHELL_EXTRA_CMD_COUNT .equ 2
|
SHELL_EXTRA_CMD_COUNT .equ 4
|
||||||
#include "shell.asm"
|
#include "shell.asm"
|
||||||
; extra commands
|
; extra commands
|
||||||
.dw blkBselCmd, blkSeekCmd
|
.dw blkBselCmd, blkSeekCmd, blkLoadCmd, blkSaveCmd
|
||||||
[...]
|
[...]
|
||||||
|
|
||||||
### bsel
|
### bsel
|
||||||
@ -62,6 +62,18 @@ The device position is device-specific: if you seek on a device, then switch
|
|||||||
to another device and seek again, your previous position isn't lost. You will
|
to another device and seek again, your previous position isn't lost. You will
|
||||||
still be on the same position when you come back.
|
still be on the same position when you come back.
|
||||||
|
|
||||||
|
### load
|
||||||
|
|
||||||
|
`load` works a bit like `poke` except that it reads its data from the currently
|
||||||
|
active blockdev at its current position. If it hits the end of the blockdev
|
||||||
|
before it could load its specified number of bytes, it stops. It only raises an
|
||||||
|
error if it couldn't load any byte.
|
||||||
|
|
||||||
|
### save
|
||||||
|
|
||||||
|
`save` is the opposite of `load`. It writes the specified number of bytes from
|
||||||
|
memory to the active blockdev at its current position.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
Let's try an example: You glue yourself a Collapse OS with ACIA as its first
|
Let's try an example: You glue yourself a Collapse OS with ACIA as its first
|
||||||
@ -70,7 +82,7 @@ could do to copy memory around:
|
|||||||
|
|
||||||
> mptr d000
|
> mptr d000
|
||||||
D000
|
D000
|
||||||
> load 4 [device 0 is selected initially]
|
> poke 4
|
||||||
[enter "abcd"]
|
[enter "abcd"]
|
||||||
> peek 4
|
> peek 4
|
||||||
61626364
|
61626364
|
||||||
@ -83,7 +95,7 @@ could do to copy memory around:
|
|||||||
[returns immediately]
|
[returns immediately]
|
||||||
> peek 4
|
> peek 4
|
||||||
61626364
|
61626364
|
||||||
> seek 0002
|
> seek 00 0002
|
||||||
> load 2
|
> load 2
|
||||||
> peek 4
|
> peek 4
|
||||||
63646364
|
63646364
|
||||||
|
10
doc/shell.md
10
doc/shell.md
@ -19,7 +19,7 @@ smaller than `0x10`. Example calls:
|
|||||||
|
|
||||||
mptr 01ff
|
mptr 01ff
|
||||||
peek 4
|
peek 4
|
||||||
load 1f
|
poke 1f
|
||||||
call 00 0123
|
call 00 0123
|
||||||
|
|
||||||
All numbers printed by the shell are in hexadecimals form.
|
All numbers printed by the shell are in hexadecimals form.
|
||||||
@ -56,20 +56,16 @@ bytes we want to read. Example:
|
|||||||
> peek 2
|
> peek 2
|
||||||
ED56
|
ED56
|
||||||
|
|
||||||
## load
|
## poke
|
||||||
|
|
||||||
Puts the serial console in input mode and waits for a specific number of
|
Puts the serial console in input mode and waits for a specific number of
|
||||||
characters to be typed (that number being specified by a byte argument). These
|
characters to be typed (that number being specified by a byte argument). These
|
||||||
characters will be literally placed in memory, one after the other, starting at
|
characters will be literally placed in memory, one after the other, starting at
|
||||||
`memptr`.
|
`memptr`.
|
||||||
|
|
||||||
This command is, for now, of limited use because it's tied to the active
|
|
||||||
console, but a method for selecting I/O sources is planned and this command will
|
|
||||||
become much more useful.
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
> load 5
|
> poke 5
|
||||||
Hello
|
Hello
|
||||||
> peek 5
|
> peek 5
|
||||||
48656C6C6F
|
48656C6C6F
|
||||||
|
Loading…
Reference in New Issue
Block a user