home *** CD-ROM | disk | FTP | other *** search
- JLCFG.MMO 7/8/88
-
- In reading these notes, also look at the files:
-
- TESTCFG.ASM - illustrates CFG parameters
- RSXCFG.ASM - configures a vanilla RSX
- TESTRSX.ASM - very simple RSX
- OKDRIVES.ASM - simple RSX
-
-
- Current buffer limits:
-
- Any single source file: 8K
- Initialization buffer: 1K
- ID buffer: 1K
-
- Rough notes on CFG option with JetLDR.
-
- A configuration (CFG) module (in ZRL format) may be loaded as one
- file/member of the command-line list. The file is loaded to a buffer,
- and relocated to that address. The resulting code is then called
- at key points in the Jetload process, and may be used to customize
- the normal loading process.
-
- The CFG feature is intended to help automate the installation
- of system segments/modules that require special configuration.
- Examples would be: linking up DateStamper to a DOS, loading an
- RSX or BSX, loading a DOS requiring special patches, loading/relocating
- code into a new Z-COM patch area, and deinitializing/initializing
- an interrupt-driven bios module.
-
-
- For each file being loaded, JetLDR calls the CFG module at these
- points:
-
- 1. Before relocating a ZRL file on pass1. The CFG code can specify
- a custom set of relocation base labels and addresses. (PASS1_FN).
-
- 2. Before final relocation of a ZRL file on pass2. (PASS2_FN).
-
- 3. Before validating the final image of the absolute or relocated
- file. CFG can do its own supplementary or alternative
- checking here. (VALID_FN)
-
- 4. Before moving the final image to the system address. CFG
- can, instead, move the image to banked memory, write
- a system track, or whatever. It may have specified
- loading directly to the final address, in which case
- no move is needed. (MOVE_FN)
-
- 5. following completion of loading of the file. CFG can
- make any final patches here. (UPDATE_FN)
-
-
- ENTRY
-
- The entry parameters when JetLDR calls CFG are:
-
- A = package type (see below)
- C = JetLDR function number (1...5)
- HL = ptr to data structure (see below)
-
-
- EXIT
-
- CFG must:
- preserve ix, iy, af', bc', de', hl'
- return A = result code (see below)
-
- To specify an alternate relocation base when
- called at PASS1_FN and PASS2_FN, return
-
- hl -> common_name_table
- de -> load_table
- bc -> final_table
- a = ADDRESS_CODE
-
-
- Initialization Code
-
- For each module loaded (including CFG) JetLDR calls the "initbuf"
- code once, just before its UPDATE_FN call to CFG. It then replaces
- the code in initbuf with a dummy routine.
-
- Thus, any module may have initialization code, and this code will
- be executed after the module is relocated and moved to its final
- address. (For portability, the standard Z-System segments will
- not have, but they could, in principle; this feature is primarily
- for RSX, BSX, and other specialized modules).
-
- Put the initialization code in the _INIT_ named common. (The buffer
- is 1k). The code should return A = 0 if all is ok.
- To cancel the UPDATE_FN call to CFG, set A = ABORTCODE = 0FFh.
-
-
- ;------------------------------------
-
- Required structrue of a CFG module:
-
- name CFGxxx ; "CFG" required
-
- CSEG
- begin: jp cfgstart ; absolute jump to code
- db 'Z3CFG' ; exact signature
- ;....
- cfgstart:
-
- ;...
- ret
-
- ; optionally,
-
- include Z3COMMON.LIB
-
- ; to make system-segment references conveniently
- ; in the CFG code.
-
- ; optionally,
-
- common /_INIT_/
- ;
- ; note that this is not called until AFTER the CFG code
- ; has ALREADY been entered (with module type = C = CFGCODE)
- ;...
- ld a,0 ; ok to proceed, or
- ld a,ABORTCODE ; omit UPDATE_FN call to CFG
- ret
-
-
- ;-------------------------------------------
-
- ; (A) Package type value passed to cfg by JetLDR
- ;
- NOCODE equ 0
- ;
- ENVCODE equ 1 ; absolute
- TCAPCODE equ 2 ; "
- NDRCODE equ 3 ; "
- ;
- RCPCODE equ 4 ; the rest are ZRL/REL
- FCPCODE equ 5
- ;
- IOPCODE equ 6
- CCPCODE equ 7
- CP3CODE equ 8
- DOSCODE equ 9
- DO3CODE equ 10
- BIOCODE equ 11
- CFGCODE equ 12
- RSXCODE equ 13
- BSXCODE equ 14
- ;
- LASTCODE equ 14
- ;
- UNKNOWNCODE equ 0FFh ; none of the above was identified
- ;
- ;
- ; (C) function value passed to cfg
- ;
- PASS1_FN equ 1
- PASS2_FN equ 2
- VALID_FN equ 3
- MOVE_FN equ 4
- UPDATE_FN equ 5
-
- ; (A) code returned by cfg
- ;
- EXIT_CODE equ 0FEh ; exit immediately from JetLDR
- ABORT_CODE equ 0FFh ; abort loading this file, go to next file
- PROCEED_CODE equ 0 ; JL continues with the current function
- SLEEP_CODE equ 1 ; JL replaces CFG code with a dummy cfg
- SKIP_CODE equ 2 ; JL skips the current function
- ADDRESS_CODE equ 3 ; JL uses the CFG-supplied addresses
- ; for load/relocation
-
- ; (HL) pointer to this structure passed to cfg by JetLDR
- ;
- cfgstruct:
- jp pstr ; print nul-term. string at hl
- jp malloc ; allocate memory
- actfcb.:ds 2 ; ptr to fcb (or lbr directory entry)
- relname.:ds 2 ; ptr to name of REL module
- time.: ds 2 ; ptr to 4-byte time string (SLR only)
- dw idbuf ; ptr to _ID_ buffer
- dw initbuf ; ptr to _INIT_ buffer
- dw sourcebuf ; ptr to source buffer
- dw relbuf ; ptr to (relocated) code buffer
- dw cmnnametbl ; ptr to named-common structures
- dw loadtbl ; ptr to load buffer table
- dw finaltbl ; ptr to final bases
- dw sizetbl ; ptr to sizes of segments
- ;
- ; (A) code returned by cfg
- ;
- EXIT_CODE equ 0FEh ; exit immediately from JetLDR
- ABORT_CODE equ 0F