-
Notifications
You must be signed in to change notification settings - Fork 3
ZLoader Commands
Summary of each of the (current) commands available in ZLoader 1.18.4
NOTE the current command set is somewhat obscure comprising short character codes, eg D
for dump memory DM
for dump memory block, DI
for disassemble. This worked when there were a limited number of functions however as it's grown the command set has become a bit of a pain to remember, also resulting in somewhat inefficient code. The (hopefully) next version will replace the command parser with a sensible word based system with an 'alias' mechanism so people can add their own short codes.
Table 1 shows commands available in the 'default' (on boot) mode, table 2 shows replacement/additional commands available in the debugger mode. To switch between the two modes use the T
command.
Command | Description | Notes |
---|---|---|
BO | Boot from Raspberry Pi. Loads the default image configured on the Pi. Download is via the block protocol. This is the fastest way to develop new code. | |
BO- | As BO but don't execute the code | |
BOS? | List executable images registered on the SDCard | 3 |
BOS [n] | Boot one of the SDCard images (default to the first image) | 4 |
BOS- [n] | As BOS but don't execute the loaded code | |
C | Show configuration parameters stored in the RTC NVRAM. See soft switches | |
C n=i | Set config parameter n to value i, which can be 0/1/YES/NO. See soft switches | |
CONS [0|1] | Switch to either SIO port A [0] or the Video Card/Omega [1] as console | |
DI [addr] | Disassemble from addr or next block if ommitted |
|
DM [addr] | Display memory block | |
DN | Display the NVRAM in the RTC chip | |
DT [datetime] | Display (set) the date/time from the RTC. Date/time format: See below | |
D | Dump the next memory block in the same mode as the last D command (DI/DM) | |
F add len val | Fill len bytes from address add with value val
|
|
FI | Display the ID of the onboard 512KB flash device | |
FP | Upgrade/update ZLoader USE WITH CARE | 5 |
FPC | Replace the flash character set (for video card) with the character set loaded from 0x8000 in application space. | 6 |
H | Clear screen | |
I p | Input value from port p
|
|
KBD map | Map can be either 'vt100' or 'wordstar'. Affects the key codes returned by the Omega keyboard scan code. Note: case senstive! | |
L | Load Intel Hex format code from the terminal. Not executed | |
LF | Load a binary from from the Raspberry Pi connected to SIO port 2 | |
LH | Load a Intel Hex formatted file from from the Raspberry Pi connected to SIO port 2 | |
M addr | Modify memory from address | |
O port=val | Output val to port , both values 8 bit hex |
|
P [blk=page] | Display and optionally change application memory page mapping. blk is 0-3, page is 0-FF (hex) |
|
SM | Display the current logical drive mappings. Each drive is 4MB and mapped to one of the logical drives A-P | |
SM drv=dsk | Map logical drv to dsk . drv is a letter from A-P, dsk is the drive number (4MB drives starting from 0) |
2 |
SD sadr | Dump sect sector (512 bytes) - see note 1 for description of SDCard addresses |
1 |
SW sadr | Write a sector (512 bytes) to an SDCard - see note 1 for description of SDCard addresses | 1 |
T | Toggle between command and debug modes | |
WI sadr strt end | Write data from application space to SDCard. The sadr is the location on the disk to which data is to be written. It's either an absolute address (32 bit hex number) or a relative address to a specific drive (eg 100:A). In both cases the address is a 512byte sector address. |
1 |
WB id DELETE | Delete the identified bootable image record | 4 |
WB id {desc} | Add an entry to the bootable image menu. See detailed description to understand {desc} and bootable images | 4 |
Note 1: sadr
is either an absolute sector address or a sector offset from a logical drive:
- Sector address: 32 bit hex number n the SDCard, eg
1F
addresses the 512 bytes from 3E00 to 3FFF. - Relative address:
sector:drive
where sector is the sector offset from the start of the mapped drive anddrive
is the mapped drive letter A-P
Note 2: ZLoader supports logical drives named A thru P. Each of these logical letters can be mapped to any 4MB 'page' on the SDCard. By default letter A addresses the second 4MB on the card, leter B the third 4MB etc and mapping can be changed via the SM
command.
Note 3: The first 4MB of space of the SDCard is generally reserved for use by ZLoader to store configuration data and things like boot tables. In practice only the first 369 bytes are used to store a boot table. For operating systems that want to take full control of the system environment (eg Fusix) SDCard space after the first 370 bytes may be used, however note that SDCard sector sizes are 512 bytes so care must be taken not to overwrite the ZLoader boot table.
Note 4: ZLoader maintains a bootable image table in the first 368 bytes of SDCard 0. the BOS?
command lists available images (referenced by ID) while the WI
command allows additional entries to be added to this table.
Note 5: ZLoader is capable of 'updating' itself in Flash. please make sure any attempts to update ZLoader is from a valid, production image. To update ZLoader obtain a valid RELEASE image and load it into ZLoader's application memory. You can either do this through the L
command to load an Intel hex file or via the bo-
command to load but not run the image from a Raspberry Pi attached to SIO port B. Once loaded issue the FP command. This will check that the image looks like a release build of ZLoader and if it is, and you confirm the command, will write it to Flash overwriting the image already there.
Table 2: Debug commands. In debug the following commands override the commands above:
Command | Description |
---|---|
B XXXX | Set a breakpoint at address XXXX |
G [addr] | Run until breakpoint, with optional start address |
N [n] | Execute the next n instructions, stepping over subroutines |
R RR=val | Set the value of a register. Both 8 and 16 bit registers are supported. Use an apostrophe to set one of the alternate registers. Eg r b'=44 to store 44h in the alternate B register |
S [n] | Execute the next n instructions (default 1), stepping into subroutines |