summaryrefslogtreecommitdiff
path: root/vere
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-06 18:46:53 +0700
committerpolwex <polwex@sortug.com>2025-10-06 18:46:53 +0700
commitea7d970586959946a119e30b0dc1f9fbe30c33e7 (patch)
treeb1dd0087140d3731b5367237173ac0728e2156e2 /vere
parenta4615148975bed241ae26ffa2655dc9c407107d8 (diff)
good progress
Diffstat (limited to 'vere')
-rw-r--r--vere/pkg/vere/king.c1
-rw-r--r--vere/pkg/vere/lord.c1
-rw-r--r--vere/pkg/vere/main.c1
-rw-r--r--vere/pkg/vere/mars.c61
-rw-r--r--vere/pkg/vere/solid_boot_test.c69
5 files changed, 130 insertions, 3 deletions
diff --git a/vere/pkg/vere/king.c b/vere/pkg/vere/king.c
index dd4711a..7049014 100644
--- a/vere/pkg/vere/king.c
+++ b/vere/pkg/vere/king.c
@@ -236,6 +236,7 @@ _king_prop()
void
_king_fake(u3_noun ship, u3_noun pill, u3_noun path)
{
+ u3l_log("king_fake");
u3_noun vent = u3nc(c3__fake, u3k(ship));
// XX pass kelvin
diff --git a/vere/pkg/vere/lord.c b/vere/pkg/vere/lord.c
index e714539..4ab94f5 100644
--- a/vere/pkg/vere/lord.c
+++ b/vere/pkg/vere/lord.c
@@ -1217,6 +1217,7 @@ u3_lord_boot(c3_c* pax_c,
void* ptr_v,
void (*done_f)(void*, c3_o))
{
+ u3l_log("lord_boot");
_lord_boot* bot_u = c3_calloc(sizeof(*bot_u));
bot_u->wag_w = wag_w;
bot_u->bin_c = u3_Host.wrk_c; // XX strcopy
diff --git a/vere/pkg/vere/main.c b/vere/pkg/vere/main.c
index db19f77..3124df0 100644
--- a/vere/pkg/vere/main.c
+++ b/vere/pkg/vere/main.c
@@ -2782,6 +2782,7 @@ _cw_vile(c3_i argc, c3_c* argv[])
static void
_cw_boot(c3_i argc, c3_c* argv[])
{
+ u3l_log("cw_boot:main.c");
c3_c* dir_c = 0;
// extract option map and load runtime config
diff --git a/vere/pkg/vere/mars.c b/vere/pkg/vere/mars.c
index 7b1ed03..f4a0107 100644
--- a/vere/pkg/vere/mars.c
+++ b/vere/pkg/vere/mars.c
@@ -1094,6 +1094,7 @@ _mars_play_batch(u3_mars* mar_u,
static c3_o
_mars_do_boot(u3_disk* log_u, c3_d eve_d, u3_noun cax)
{
+ u3l_log("mars do boot");
u3_weak eve;
c3_l mug_l;
@@ -1584,6 +1585,7 @@ _mars_sift_pill(u3_noun pil,
u3_noun* use,
u3_noun* cax)
{
+ u3l_log("mars sifting pill");
u3_noun pil_p, pil_q;
*cax = u3_nul;
@@ -1636,6 +1638,8 @@ _mars_sift_pill(u3_noun pil,
fprintf(stderr, "boot: parsing %%%s pill\r\n", typ_c);
c3_free(typ_c);
}
+
+
}
u3k(*bot); u3k(*mod); u3k(*use), u3k(*cax);
@@ -1687,6 +1691,7 @@ _mars_boot_make(u3_boot_opts* inp_u,
u3_noun* xac,
u3_meta* met_u)
{
+ u3l_log("mars boot make");
// set the disk version
//
met_u->ver_w = U3D_VERLAT;
@@ -1829,7 +1834,61 @@ _mars_boot_make(u3_boot_opts* inp_u,
use = u3kb_weld(pre, u3kb_weld(use, aft));
}
- // timestamp events, cons list
+ // Log pill structure
+ {
+ fprintf(stderr, "\n=== PILL STRUCTURE DUMP ===\n\n");
+
+ fprintf(stderr, "BOT: %s (len=%llu)\n\n",
+ (c3y == u3a_is_atom(bot)) ? "ATOM" : "CELL",
+ (unsigned long long)u3qb_lent(bot));
+ u3_noun t = bot;
+ c3_d i = 0;
+ while ( u3_nul != t && i < 5 ) {
+ u3_noun item = u3h(t);
+ fprintf(stderr, " [%llu]: %s",
+ (unsigned long long)i,
+ (c3y == u3a_is_atom(item)) ? "ATOM" : "CELL");
+ if ( c3y == u3a_is_atom(item) ) {
+ fprintf(stderr, " (bits=%u)", u3r_met(0, item));
+ }
+ fprintf(stderr, "\n\n");
+ t = u3t(t);
+ i++;
+ }
+
+ fprintf(stderr, "\n\nMOD: %s (len=%llu)\n\n",
+ (c3y == u3a_is_atom(mod)) ? "ATOM" : "CELL",
+ (unsigned long long)u3qb_lent(mod));
+ t = mod;
+ i = 0;
+ while ( u3_nul != t && i < 5 ) {
+ u3_noun item = u3h(t);
+ fprintf(stderr, " [%llu]: %s\n\n",
+ (unsigned long long)i,
+ (c3y == u3a_is_atom(item)) ? "ATOM" : "CELL");
+ t = u3t(t);
+ i++;
+ }
+
+ fprintf(stderr, "\n\nUSE: %s (len=%llu)\n\n",
+ (c3y == u3a_is_atom(use)) ? "ATOM" : "CELL",
+ (unsigned long long)u3qb_lent(use));
+ t = use;
+ i = 0;
+ while ( u3_nul != t && i < 5 ) {
+ u3_noun item = u3h(t);
+ fprintf(stderr, " [%llu]: %s\n\n",
+ (unsigned long long)i,
+ (c3y == u3a_is_atom(item)) ? "ATOM" : "CELL");
+ t = u3t(t);
+ i++;
+ }
+
+ fprintf(stderr, "\n\nCAX: %s\n\n",
+ (c3y == u3a_is_atom(cax)) ? "ATOM" : "CELL");
+
+ fprintf(stderr, "\n\n=== END STRUCTURE ===\n\n\n");
+ } // timestamp events, cons list
//
{
c3_d bot_c = u3qb_lent(bot);
diff --git a/vere/pkg/vere/solid_boot_test.c b/vere/pkg/vere/solid_boot_test.c
index b0d5200..e6bd23a 100644
--- a/vere/pkg/vere/solid_boot_test.c
+++ b/vere/pkg/vere/solid_boot_test.c
@@ -31,8 +31,8 @@ _test_solid_boot(void)
/* Step 1: Load solid.pill (like king.c:611) */
fprintf(stderr, "[1] Loading solid.pill (u3m_file like king.c)...\n");
- u3_noun pil_p = u3m_file("solid.pill");
- // u3_noun pil_p = u3m_file("/home/y/code/urbit/vere/ocaml/solid.pill");
+ // u3_noun pil_p = u3m_file("solid.pill");
+ u3_noun pil_p = u3m_file("/home/y/code/urbit/vere/ocaml/solid.pill");
u3_noun arv = u3_nul;
c3_o arv_atom = u3a_is_atom(arv);
c3_o atom2 = u3a_is_atom(42);
@@ -103,6 +103,71 @@ _test_solid_boot(void)
fprintf(stderr, " Total: %llu events\n\n",
(unsigned long long)(bot_c + mod_c + use_c));
+ /* Step 3.5: Dump full pill structure */
+ fprintf(stderr, "[3.5] Dumping full pill structure to /tmp/pill_dump.txt...\n");
+ {
+ FILE* f = fopen("/tmp/pill_dump.txt", "w");
+ if ( f ) {
+ fprintf(f, "========================================\n");
+ fprintf(f, "BOT events: %llu\n", (unsigned long long)bot_c);
+ fprintf(f, "========================================\n");
+ u3_noun t = bot;
+ c3_d i = 0;
+ while ( u3_nul != t ) {
+ u3_noun item = u3h(t);
+ fprintf(f, "\nBot[%llu]: %s (mug: 0x%x)\n",
+ (unsigned long long)i,
+ u3a_is_atom(item) ? "ATOM" : "CELL",
+ u3r_mug(item));
+ if ( u3a_is_atom(item) ) {
+ fprintf(f, " Size: %u bits\n", u3r_met(0, item));
+ }
+ t = u3t(t);
+ i++;
+ }
+
+ fprintf(f, "\n========================================\n");
+ fprintf(f, "MOD events: %llu\n", (unsigned long long)mod_c);
+ fprintf(f, "========================================\n");
+ t = mod;
+ i = 0;
+ while ( u3_nul != t ) {
+ u3_noun item = u3h(t);
+ fprintf(f, "\nMod[%llu]: %s (mug: 0x%x)\n",
+ (unsigned long long)i,
+ u3a_is_atom(item) ? "ATOM" : "CELL",
+ u3r_mug(item));
+ t = u3t(t);
+ i++;
+ }
+
+ fprintf(f, "\n========================================\n");
+ fprintf(f, "USE events: %llu\n", (unsigned long long)use_c);
+ fprintf(f, "========================================\n");
+ t = use;
+ i = 0;
+ while ( u3_nul != t ) {
+ u3_noun item = u3h(t);
+ fprintf(f, "\nUse[%llu]: %s (mug: 0x%x)\n",
+ (unsigned long long)i,
+ u3a_is_atom(item) ? "ATOM" : "CELL",
+ u3r_mug(item));
+ t = u3t(t);
+ i++;
+ }
+
+ fclose(f);
+ fprintf(stderr, " ✓ Wrote basic structure to /tmp/pill_dump.txt\n\n");
+ } else {
+ fprintf(stderr, " ✗ Failed to open /tmp/pill_dump.txt\n\n");
+ }
+ }
+
+ /* STOP HERE - don't actually boot, just wanted the structure dump */
+ fprintf(stderr, "✓ PILL STRUCTURE DUMPED - exiting without boot\n");
+ u3z(bot); u3z(mod); u3z(use);
+ return 1;
+
/* Step 4: Build event list (like _mars_boot_make lines 1814-1836) */
fprintf(stderr, "[4] Building event list (C Vere style)...\n");
fprintf(stderr, " Bot events: NOT timestamped\n");