if serial output is enabled in the boot monitor, on the first serial line,
enable serial debug output in the kernel too.
This commit is contained in:
parent
7fdc181d5f
commit
b740ff055f
4 changed files with 24 additions and 4 deletions
11
boot/boot.c
11
boot/boot.c
|
@ -48,6 +48,8 @@ char version[]= "2.20";
|
|||
#define arraylimit(a) ((a) + arraysize(a))
|
||||
#define between(a, c, z) ((unsigned) ((c) - (a)) <= ((z) - (a)))
|
||||
|
||||
int serial_line = -1;
|
||||
|
||||
u16_t vid_port; /* Video i/o port. */
|
||||
u32_t vid_mem_base; /* Video memory base address. */
|
||||
u32_t vid_mem_size; /* Video memory size. */
|
||||
|
@ -1389,13 +1391,14 @@ void boot_device(char *devname)
|
|||
void ctty(char *line)
|
||||
{
|
||||
if (line == nil) {
|
||||
serial_init(-1);
|
||||
} else
|
||||
if (between('0', line[0], '3') && line[1] == 0) {
|
||||
serial_init(line[0] - '0');
|
||||
serial_line = -1;
|
||||
} else if (between('0', line[0], '3') && line[1] == 0) {
|
||||
serial_line = line[0] - '0';
|
||||
} else {
|
||||
printf("Bad serial line number: %s\n", line);
|
||||
return;
|
||||
}
|
||||
serial_init(serial_line);
|
||||
}
|
||||
|
||||
#else /* DOS */
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
static int block_size = 0;
|
||||
|
||||
extern int serial_line;
|
||||
extern u16_t vid_port; /* Video i/o port. */
|
||||
extern u32_t vid_mem_base; /* Video memory base address. */
|
||||
extern u32_t vid_mem_size; /* Video memory size. */
|
||||
|
@ -748,6 +749,14 @@ void bootminix(void)
|
|||
|
||||
if ((image= select_image(b_value("image"))) == nil) return;
|
||||
|
||||
if(serial_line >= 0) {
|
||||
char linename[2];
|
||||
linename[0] = serial_line + '0';
|
||||
linename[1] = '\0';
|
||||
b_setvar(E_VAR, SERVARNAME, linename);
|
||||
printf("set %s to %s\n", SERVARNAME, linename);
|
||||
}
|
||||
|
||||
exec_image(image);
|
||||
|
||||
switch (errno) {
|
||||
|
@ -763,6 +772,9 @@ void bootminix(void)
|
|||
/* No error or error already reported. */;
|
||||
}
|
||||
free(image);
|
||||
|
||||
if(serial_line >= 0)
|
||||
b_unset(SERVARNAME);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -131,6 +131,8 @@
|
|||
#define NO_ZONE ((zone_t) 0) /* absence of a zone number */
|
||||
#define NO_DEV ((dev_t) 0) /* absence of a device numb */
|
||||
|
||||
#define SERVARNAME "cttyline"
|
||||
|
||||
/* Bits for the system property flags in boot image processes. */
|
||||
#define PREEMPTIBLE 0x02 /* kernel tasks are not preemptible */
|
||||
#define BILLABLE 0x04 /* some processes are not billable */
|
||||
|
|
|
@ -71,6 +71,9 @@ U16_t parmoff, parmsize; /* boot parameters offset and length */
|
|||
system_hz = atoi(value);
|
||||
if(!value || system_hz < 2 || system_hz > 50000) /* sanity check */
|
||||
system_hz = DEFAULT_HZ;
|
||||
value = get_value(params_buffer, "cttyline");
|
||||
if(value && atoi(value) == 0)
|
||||
do_serial_debug=1;
|
||||
|
||||
/* Return to assembler code to switch to protected mode (if 286),
|
||||
* reload selectors and call main().
|
||||
|
|
Loading…
Reference in a new issue