enable serial debug output in the kernel too.
#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. */
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 */
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. */
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) {
/* No error or error already reported. */;
}
free(image);
+
+ if(serial_line >= 0)
+ b_unset(SERVARNAME);
}
/*
#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 */
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().