feat(v4.0.0): the system boots from a nucleus and loads its capsules
One boot, v4/system/boot.c, for both products: it starts the nucleus image, finds each capsule in the baked capsule directory, recomputes its hash, checks its signature, gives its blocks to the node a line at a time, and prints PARITY:V4_NUCLEUS, PARITY:V4_CAPSULE and PARITY:OK before the prompt. A line the node does not accept ends the boot with the capsule, block and line named. docs/v4.0.0/NUCLEUS.md. - hosted Linux product for amd64, aarch64 and riscv64 (make -C v4 hosted); make -C v4 hosted-check boots all three and requires identical output - the kernel's v4 entry (STARFORTH_V4=1) calls the same boot - capsules/v4/forth79.4th, block 6000: no definitions yet - mkimage builds the nucleus only; no FORTH source is compiled at build time - capsule_blocks.c: the Block-header parse, free of any VM, for every loader Verified: make -C v4 test passes; hosted-check passes on the three ISAs with the same hashes; the kernel compiles with STARFORTH_V4=1 on the three. Not verified: no bare-metal boot of v4 has been run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
903321e548
commit
294e69463a
@@ -0,0 +1,21 @@
|
||||
/* capsule_blocks.h -- the block format of a .4th capsule payload.
|
||||
*
|
||||
* A .4th capsule is text: "Block <num>" header lines, each followed by that
|
||||
* block's content lines (tools/mkcapsule.c, validate_forth_blocks). This is
|
||||
* the one place that says what a header line is. It depends on no VM, so
|
||||
* every loader of capsules can use it: the kernel's and the hosted v4
|
||||
* system's (docs/v4.0.0/NUCLEUS.md 5.3).
|
||||
*/
|
||||
#ifndef STARKERNEL_CAPSULE_BLOCKS_H
|
||||
#define STARKERNEL_CAPSULE_BLOCKS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Is the line that starts at p a "Block <num>" header? If so, returns 1
|
||||
* with the number in *out_num and the start of the next line in *out_after;
|
||||
* otherwise returns 0 and changes nothing. `end` is one past the payload's
|
||||
* last byte. */
|
||||
int capsule_block_header(const uint8_t *p, const uint8_t *end,
|
||||
uint32_t *out_num, const uint8_t **out_after);
|
||||
|
||||
#endif /* STARKERNEL_CAPSULE_BLOCKS_H */
|
||||
@@ -0,0 +1,13 @@
|
||||
/* sk_v4.h -- StarForth v4 on bare metal: one host node at a prompt.
|
||||
*
|
||||
* Built only with STARFORTH_V4=1 (Kconfig.kernel).
|
||||
*/
|
||||
#ifndef STARKERNEL_V4_SK_V4_H
|
||||
#define STARKERNEL_V4_SK_V4_H
|
||||
|
||||
/* Start one StarForth v4 host node from the capsule image linked into the
|
||||
* kernel, with its console on the kernel's console, and run it. Does not
|
||||
* return. */
|
||||
void sk_v4_run(void);
|
||||
|
||||
#endif /* STARKERNEL_V4_SK_V4_H */
|
||||
Reference in New Issue
Block a user