- remove unused bootdelay feauture

- only print a line for every boot process if 'verbose' variable set to
   nonzero; reason: with serial output, the long output
   significantly slows down frequent reboots, and causes 'scroll damage'
   that in some cases is pretty bad. also the verbose output doesn't tell
   you the one thing you might want to know about a process: how much memory
   is it using? or how much memory is everything using?
 - short format does print out total memory allocated for processes
This commit is contained in:
Ben Gras 2009-09-21 14:23:47 +00:00
parent 8a54d267f0
commit ba91b3b7d2

View file

@ -422,11 +422,10 @@ static void restore_screen(void)
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;
u32_t vsec, addr, limit, aout, n;
u32_t vsec, addr, limit, aout, n, totalmem = 0;
struct process *procp; /* Process under construction. */
long a_text, a_data, a_bss, a_stack;
int banner= 0;
@ -435,13 +434,18 @@ void exec_image(char *image)
char *console;
char params[SECTOR_SIZE];
extern char *sbrk(int);
char *verb;
int verbose = 0;
/* The stack is pretty deep here, so check if heap and stack collide. */
(void) sbrk(0);
if ((verb= b_value("verbose")) != nil && a2l(verb) > 0)
verbose = 1;
printf("\nLoading ");
pretty_image(image);
printf(".\n\n");
printf(".\n");
vsec= 0; /* Load this sector from image next. */
addr= mem[0].base; /* Into this memory block. */
@ -456,6 +460,8 @@ void exec_image(char *image)
/* Read the many different processes: */
for (i= 0; vsec < image_size; i++) {
u32_t startaddr;
startaddr = addr;
if (i == PROCESS_MAX) {
printf("There are more then %d programs in %s\n",
PROCESS_MAX, image);
@ -499,7 +505,7 @@ void exec_image(char *image)
hdr.process.a_syms= addr;
raw_copy(aout + i * A_MINHDR, mon2abs(&hdr.process), A_MINHDR);
if (!banner) {
if (!banner && verbose) {
printf(" cs ds text data bss");
if (k_flags & K_CHMEM) printf(" stack");
putch('\n');
@ -549,14 +555,14 @@ void exec_image(char *image)
/* Make space for bss and stack unless... */
if (i != KERNEL_IDX && (k_flags & K_CLAIM)) a_bss= a_stack= 0;
printf("%07lx %07lx %8ld %8ld %8ld",
if(verbose) {
printf("%07lx %07lx %8ld %8ld %8ld",
procp->cs, procp->ds,
hdr.process.a_text, hdr.process.a_data,
hdr.process.a_bss
);
if (k_flags & K_CHMEM) printf(" %8ld", a_stack);
printf(" %s\n", hdr.name);
);
}
if ((k_flags & K_CHMEM) && verbose) printf(" %8ld", a_stack);
/* Note that a_data may be negative now, but we can look at it
* as -a_data bss bytes.
@ -583,6 +589,15 @@ void exec_image(char *image)
/* Process endpoint. */
procp->end= addr;
if(verbose)
printf(" %s\n", hdr.name);
else {
u32_t mem;
mem = addr-startaddr;
printf("%s ", hdr.name);
totalmem += mem;
}
if (i == 0 && (k_flags & K_HIGH)) {
/* Load the rest in extended memory. */
addr= mem[1].base;
@ -590,6 +605,9 @@ void exec_image(char *image)
}
}
if(!verbose)
printf("(%dk)\n", totalmem/1024);
if ((n_procs= i) == 0) {
printf("There are no programs in %s\n", image);
errno= 0;
@ -613,11 +631,6 @@ void exec_image(char *image)
}
#endif
/* Do delay if wanted. */
if((delayvalue = b_value("bootdelay")) != nil > 0) {
delay(delayvalue);
}
/* Run the trailer function just before starting Minix. */
if (!run_trailer()) { errno= 0; return; }