updates boot printfs

This commit is contained in:
Robert 2018-11-16 15:40:33 -08:00
parent bd78ea68d9
commit 1c97747e7c
4 changed files with 39 additions and 29 deletions

View File

@ -858,16 +858,16 @@ u3e_live(c3_o nuu_o, c3_c* dir_c)
/* Load any patch files; apply them to images.
*/
if ( 0 != (pat_u = _ce_patch_open()) ) {
printf("_ce_patch_apply\r\n");
printf("boot: _ce_patch_apply\r\n");
_ce_patch_apply(pat_u);
printf("_ce_image_sync\r\n");
printf("boot: _ce_image_sync\r\n");
_ce_image_sync(&u3P.nor_u);
_ce_image_sync(&u3P.sou_u);
printf("_ce_patch_delete\r\n");
printf("boot: _ce_patch_delete\r\n");
_ce_patch_delete();
printf("_ce_patch_free\r\n");
printf("boot: _ce_patch_free\r\n");
_ce_patch_free(pat_u);
}
@ -886,7 +886,7 @@ u3e_live(c3_o nuu_o, c3_c* dir_c)
perror("protect");
c3_assert(0);
}
printf("protected loom\r\n");
printf("boot: protected loom\r\n");
}
/* If the images were empty, we are logically booting.

View File

@ -42,7 +42,6 @@ u3v_jack(void)
fprintf(stderr, "jack: kernel %x\r\n", u3r_mug(u3A->ken));
cor = u3n_nock_on(0, u3k(u3A->ken));
fprintf(stderr, "jacked\r\n");
u3z(cor);
}

View File

@ -587,11 +587,22 @@ main(c3_i argc,
printf("~\n");
// printf("welcome.\n");
printf("urbit %s\n", URBIT_VERSION);
printf("urbit: home is %s\n", u3_Host.dir_c);
int mprint_i = 1000;
c3_c* abs_c = (c3_c *)malloc(mprint_i);
// allocates more memory as needed if the path is too large
//
while ( abs_c != getcwd(abs_c, mprint_i) ) {
free(abs_c);
mprint_i *= 2;
abs_c = (c3_c *)malloc(mprint_i);
}
printf("boot: home is %s/%s\n", abs_c, u3_Host.dir_c);
free(abs_c);
// printf("vere: hostname is %s\n", u3_Host.ops_u.nam_c);
if ( c3y == u3_Host.ops_u.dem && c3n == u3_Host.ops_u.bat ) {
printf("urbit: running as daemon\n");
printf("boot: running as daemon\n");
}
// Seed prng. Don't panic -- just for fuzz testing.

View File

@ -45,17 +45,17 @@ u3_sist_pack(c3_w tem_w, c3_w typ_w, c3_w* bob_w, c3_w len_w)
if ( -1 == lseek64(lug_u->fid_i, 4ULL * tar_d, SEEK_SET) ) {
perror("lseek");
uL(fprintf(uH, "sist_pack: seek failed\n"));
uL(fprintf(uH, "sist: seek failed\n"));
c3_assert(0);
}
if ( sizeof(lar_u) != write(lug_u->fid_i, &lar_u, sizeof(lar_u)) ) {
perror("write");
uL(fprintf(uH, "sist_pack: write failed\n"));
uL(fprintf(uH, "sist: write failed\n"));
c3_assert(0);
}
if ( -1 == lseek64(lug_u->fid_i, 4ULL * lug_u->len_d, SEEK_SET) ) {
perror("lseek");
uL(fprintf(uH, "sist_pack: seek failed\n"));
uL(fprintf(uH, "sist: seek failed\n"));
c3_assert(0);
}
#if 0
@ -68,7 +68,7 @@ u3_sist_pack(c3_w tem_w, c3_w typ_w, c3_w* bob_w, c3_w len_w)
#endif
if ( (4 * len_w) != write(lug_u->fid_i, bob_w, (4 * len_w)) ) {
perror("write");
uL(fprintf(uH, "sist_pack: write failed\n"));
uL(fprintf(uH, "sist: write failed\n"));
c3_assert(0);
}
lug_u->len_d += (c3_d)(lar_u.len_w + c3_wiseof(lar_u));
@ -433,8 +433,8 @@ _sist_fast(u3_noun pas, c3_l key_l)
u3_noun yek = u3dc("scot", 'p', pas);
c3_c* yek_c = u3r_string(yek);
printf("saving passcode in %s/.urb/code.%s\r\n", hom_c, gum_c);
printf("(for real security, write it down and delete the file...)\r\n");
printf("boot: saving passcode in %s/.urb/code.%s\r\n", hom_c, gum_c);
printf("boot: for real security, write it down and delete the file\r\n");
{
c3_i fid_i;
@ -487,7 +487,7 @@ _sist_staf(c3_l key_l)
u3z(say);
return 0;
}
uL(fprintf(uH, "loaded passcode from %s\n", ful_c));
uL(fprintf(uH, "boot: loaded passcode from %s\n", ful_c));
pas = u3k(u3t(u3t(u3t(say))));
u3z(say);
@ -532,7 +532,7 @@ _sist_zest()
if ( ((fid_i = open(ful_c, pig_i, 0600)) < 0) ||
(fstat(fid_i, &buf_b) < 0) )
{
uL(fprintf(uH, "can't create record (%s)\n", ful_c));
uL(fprintf(uH, "zest: can't create record (%s)\n", ful_c));
u3_lo_bail();
}
#ifdef F_NOCACHE
@ -613,7 +613,7 @@ _sist_rest_nuu(u3_ulog* lug_u, u3_uled led_u, c3_c* old_c)
c3_assert(led_u.mag_l == u3r_mug('f'));
if ( -1 == lseek64(fid_i, 4ULL * end_d, SEEK_SET) ) {
uL(fprintf(uH, "rest_nuu failed (a)\n"));
uL(fprintf(uH, "rest: rest_nuu failed (a)\n"));
perror("lseek64");
u3_lo_bail();
}
@ -800,7 +800,7 @@ _sist_rest()
u3_uled led_u;
if ( sizeof(led_u) != read(fid_i, &led_u, sizeof(led_u)) ) {
uL(fprintf(uH, "record (%s) is corrupt (a)\n", ful_c));
uL(fprintf(uH, "rest: record (%s) is corrupt (a)\n", ful_c));
u3_lo_bail();
}
@ -850,7 +850,7 @@ _sist_rest()
key = _sist_fatt(sal_l, pas);
if ( u3r_mug(key) != key_l ) {
uL(fprintf(uH, "incorrect passcode\n"));
uL(fprintf(uH, "rest: incorrect passcode\n"));
u3z(key);
pas = 0;
}
@ -875,7 +875,7 @@ _sist_rest()
if ( -1 == lseek64(fid_i, 4ULL * end_d, SEEK_SET) ) {
fprintf(stderr, "end_d %" PRIu64 "\n", end_d);
perror("lseek");
uL(fprintf(uH, "record (%s) is corrupt (c)\n", ful_c));
uL(fprintf(uH, "rest: record (%s) is corrupt (c)\n", ful_c));
u3_lo_bail();
}
@ -888,17 +888,17 @@ _sist_rest()
// uL(fprintf(uH, "rest: reading event at %" PRIx64 "\n", end_d));
if ( -1 == lseek64(fid_i, 4ULL * tar_d, SEEK_SET) ) {
uL(fprintf(uH, "record (%s) is corrupt (d)\n", ful_c));
uL(fprintf(uH, "rest: record (%s) is corrupt (d)\n", ful_c));
u3_lo_bail();
}
if ( sizeof(u3_ular) != read(fid_i, &lar_u, sizeof(u3_ular)) ) {
uL(fprintf(uH, "record (%s) is corrupt (e)\n", ful_c));
uL(fprintf(uH, "rest: record (%s) is corrupt (e)\n", ful_c));
u3_lo_bail();
}
if ( lar_u.syn_w != u3r_mug_d(tar_d) ) {
if ( c3n == rup ) {
uL(fprintf(uH, "corruption detected; attempting to fix\n"));
uL(fprintf(uH, "rest: corruption detected; attempting to fix\n"));
rup = c3y;
}
uL(fprintf(uH, "lar:%x mug:%x\n", lar_u.syn_w, u3r_mug_d(tar_d)));
@ -906,7 +906,7 @@ _sist_rest()
continue;
}
else if ( c3y == rup ) {
uL(fprintf(uH, "matched at %x\n", lar_u.syn_w));
uL(fprintf(uH, "rest: matched at %x\n", lar_u.syn_w));
rup = c3n;
}
@ -927,8 +927,8 @@ _sist_rest()
}
else {
if ( lar_u.ent_d != (ent_d - 1ULL) ) {
uL(fprintf(uH, "record (%s) is corrupt (g)\n", ful_c));
uL(fprintf(uH, "lar_u.ent_d %" PRIx64 ", ent_d %" PRIx64 "\n", lar_u.ent_d, ent_d));
uL(fprintf(uH, "rest: record (%s) is corrupt (g)\n", ful_c));
uL(fprintf(uH, "rest: lar_u.ent_d %" PRIx64 ", ent_d %" PRIx64 "\n", lar_u.ent_d, ent_d));
u3_lo_bail();
}
ent_d -= 1ULL;
@ -943,11 +943,11 @@ _sist_rest()
img_w = c3_malloc(4 * lar_u.len_w);
if ( -1 == lseek64(fid_i, 4ULL * end_d, SEEK_SET) ) {
uL(fprintf(uH, "record (%s) is corrupt (h)\n", ful_c));
uL(fprintf(uH, "rest: record (%s) is corrupt (h)\n", ful_c));
u3_lo_bail();
}
if ( (4 * lar_u.len_w) != read(fid_i, img_w, (4 * lar_u.len_w)) ) {
uL(fprintf(uH, "record (%s) is corrupt (i)\n", ful_c));
uL(fprintf(uH, "rest: record (%s) is corrupt (i)\n", ful_c));
u3_lo_bail();
}
@ -959,7 +959,7 @@ _sist_rest()
u3r_mug_both(u3r_mug(lar_u.tem_w),
u3r_mug(lar_u.typ_w))) )
{
uL(fprintf(uH, "record (%s) is corrupt (j)\n", ful_c));
uL(fprintf(uH, "rest: record (%s) is corrupt (j)\n", ful_c));
u3_lo_bail();
}