10000 Clarification/documentation of API · Issue #19 · spectrumero/spectranet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Clarification/documentation of API #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ZXGuesser opened this issue Feb 17, 2022 · 1 comment
Open

Clarification/documentation of API #19

ZXGuesser opened this issue Feb 17, 2022 · 1 comment

Comments

@ZXGuesser
Copy link
Contributor

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.

@spectrumero
Copy link
Owner

Hmm. It'll take some digging, it feels like I wrote this code in a previous life :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0