-
Notifications
You must be signed in to change notification settings - Fork 25
Description
There are a few details relating to firmware modules which are a bit unclear which I think it would be helpful to document.
In no particular order the ones that I can bring to mind:
RESERVEPAGE argument
F_reservepage in pagealloc.asm searches for a free SRAM page and allocates it for the requesting code. That file contains the following comment block indicating that modules should pass their ROM ID or 0xFF:
;---------------------------------------------------------------------------
; F_reservepage
; Reserves a page. On entry, pass the ROM ID that is making the request in A.
; Pass 0xFF if it's just a general program, and not a module.
However in the filesystem example the module passes its flash page:
;Claim a page of SRAM for our sysvars.
ld a, (v_pgb) ; Who are we?
call RESERVEPAGE ; Reserve a page of static RAM.
I have written modules using page number based on the filesystem example. Is the value stored in the page table important or is any non-zero value ok (i.e. either ROM ID, page number, or 0xFF)?
ROM and config section IDs
Have I overlooked a list of assigned IDs, or are these not publicly available? (I appreciate that you may not wish to publish a list as it encourages people to look for free values and use them without being assigned one)
Can I check that I was actually formally assigned the one which I'm using (0x03)? 😄
I mentioned some time back that some of the IDs for system modules don't match their code comments, and there is ambiguity on which generic values should be used when a code module doesn't require a unique ID (I believe this can usually be 0x00 as used in your allram module?).
The ftpfs module assigns 0xFF with the comment for a filesystem only. (this is the value I used in my filesystem modules)
The filesystem example module uses 0xFE with the comment ID 0xFE (generic filesystem ID). That collides with the Config module.