From: Ben Gras Date: Mon, 30 May 2005 15:02:52 +0000 (+0000) Subject: Added 'bootdelay' feature in boot monitor, it pauses a given number of ms X-Git-Tag: v3.1.0~802 X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch04.html?a=commitdiff_plain;h=5927788cdd66a79a56ca1a3dfdfc063ef59c0698;p=minix.git Added 'bootdelay' feature in boot monitor, it pauses a given number of ms 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. --- diff --git a/boot/boot.c b/boot/boot.c index 3fbef84f5..af81a459f 100755 --- a/boot/boot.c +++ b/boot/boot.c @@ -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" }, diff --git a/boot/bootimage.c b/boot/bootimage.c index e29bf3b3d..5498f6a10 100755 --- a/boot/bootimage.c +++ b/boot/bootimage.c @@ -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; } diff --git a/boot/installboot.c b/boot/installboot.c index 0a4b4e858..b0ca9a894 100755 --- a/boot/installboot.c +++ b/boot/installboot.c @@ -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); }