]> Zhao Yanbai Git Server - minix.git/commitdiff
Added 'bootdelay' feature in boot monitor, it pauses a given number of ms
authorBen Gras <ben@minix3.org>
Mon, 30 May 2005 15:02:52 +0000 (15:02 +0000)
committerBen Gras <ben@minix3.org>
Mon, 30 May 2005 15:02:52 +0000 (15:02 +0000)
so the list of programs in the image and their sizes can be seen before the
kernel starts filling the screen.

Added some formatting fixes in installboot and boot monitor itself,
some of the segments were larger than the formatting allowed.

boot/boot.c
boot/bootimage.c
boot/installboot.c

index 3fbef84f526c422e5345af4d01d5deff5e7c7d00..af81a459fb8f88a647f151c1cb0d8b260f865003 100755 (executable)
@@ -1549,6 +1549,7 @@ void help(void)
                { "ramimagedev",        "RAM disk image if root is RAM" },
                { "ramsize",            "RAM disk size" },
                { "bootdev",            "Special name for the boot device" },
+               { "bootdelay",          "Delay after loading, before booting (ms)" },
                { "fd0, d0p2, c0d0p1s0",        "Devices (as in /dev)" },
                { "image",              "Name of the kernel image" },
                { "main",               "Startup function" },
index e29bf3b3d34dbed5dc6cc46bd9cafd53fbc4191d..5498f6a10c5a17000c9b50c4a7fa24af57c7f07f 100755 (executable)
@@ -377,6 +377,7 @@ int get_segment(u32_t *vsec, long *size, u32_t *addr, u32_t limit)
 void exec_image(char *image)
 /* Get a Minix image into core, patch it up and execute. */
 {
+       char *delayvalue;
        int i;
        struct image_header hdr;
        char *buf;
@@ -454,7 +455,7 @@ void exec_image(char *image)
                raw_copy(aout + i * A_MINHDR, mon2abs(&hdr.process), A_MINHDR);
 
                if (!banner) {
-                       printf("    cs      ds    text    data     bss");
+                       printf("     cs       ds     text     data      bss");
                        if (k_flags & K_CHMEM) printf("    stack");
                        putch('\n');
                        banner= 1;
@@ -497,7 +498,7 @@ void exec_image(char *image)
                        a_data+= a_text;
                }
 
-               printf("%06lx  %06lx %7ld %7ld %7ld",
+               printf("%07lx  %07lx %8ld %8ld %8ld",
                        procp->cs, procp->ds,
                        hdr.process.a_text, hdr.process.a_data,
                        hdr.process.a_bss
@@ -570,6 +571,11 @@ void exec_image(char *image)
        /* Run the trailer function just before starting Minix. */
        if (!run_trailer()) { errno= 0; return; }
 
+       /* Do delay if wanted. */
+       if((delayvalue = b_value("bootdelay")) != nil > 0) {
+               delay(delayvalue);
+       }
+
        /* Translate the boot parameters to what Minix likes best. */
        if (!params2params(params, sizeof(params))) { errno= 0; return; }
 
index 0a4b4e858f93fe0ea4d866009712326b3c451755..b0ca9a8947ff88b9590d598022cd08bc1e4116cf 100755 (executable)
@@ -128,12 +128,12 @@ void read_header(int talk, char *proc, FILE *procf, struct image_header *ihdr)
        }
 
        if (talk && !banner) {
-               printf("    text    data     bss     size\n");
+               printf("     text     data      bss      size\n");
                banner= 1;
        }
 
        if (talk) {
-               printf("%8ld%8ld%8ld%9ld  %s\n",
+               printf(" %8ld %8ld %8ld %9ld  %s\n",
                        phdr->a_text, phdr->a_data, phdr->a_bss,
                        phdr->a_text + phdr->a_data + phdr->a_bss, proc);
        }
@@ -259,8 +259,8 @@ void make_image(char *image, char **procv)
 
        if (fclose(imagef) == EOF) fatal(image);
 
-       printf("  ------  ------  ------  -------\n");
-       printf("%8ld%8ld%8ld%9ld  total\n",
+       printf("   ------   ------   ------   -------\n");
+       printf(" %8ld %8ld %8ld %9ld  total\n",
                total_text, total_data, total_bss,
                total_text + total_data + total_bss);
 }