This was caused by a change in the shared driver code. Not log's fault.
Renamed #definitions of driver process numbers, e.g., TTY now is TTY_PROC_NR.
All known (special) processes now have consistent naming scheme. Kernel tasks
don't follow this scheme.
*/
if ((proc_nr = m->DIAG_PROC_NR) == SELF)
m->DIAG_PROC_NR = proc_nr = m->m_source;
- result = _sendrec(TTY, m);
+ result = _sendrec(TTY_PROC_NR, m);
/* Now also make a copy for the private buffer at the LOG server, so
* that the messages can be reviewed at a later time.
m.DIAG_BUF_COUNT = buf_count;
m.DIAG_PRINT_BUF = print_buf;
m.DIAG_PROC_NR = SELF;
- m.m_type = DIAGNOSTICS; /* request TTY to output this buffer */
- _sendrec(TTY, &m); /* if it fails, we cannot do better */
- buf_count = 0; /* clear buffer for next batch */
+ m.m_type = DIAGNOSTICS; /* request TTY to output this buffer */
+ _sendrec(TTY_PROC_NR, &m); /* if it fails, we give up */
+ buf_count = 0; /* clear buffer for next batch */
}
if (c != 0) {
print_buf[buf_count++] = c;
FORWARD _PROTOTYPE( int log_do_open, (struct driver *dp, message *m_ptr) );
FORWARD _PROTOTYPE( int log_cancel, (struct driver *dp, message *m_ptr) );
FORWARD _PROTOTYPE( int log_select, (struct driver *dp, message *m_ptr) );
+FORWARD _PROTOTYPE( void log_signal, (struct driver *dp, message *m_ptr) );
FORWARD _PROTOTYPE( int log_other, (struct driver *dp, message *m_ptr) );
FORWARD _PROTOTYPE( void log_geometry, (struct partition *entry) );
FORWARD _PROTOTYPE( void log_reply, (int code, int replyee, int proc, int status) );
log_transfer, /* do the I/O */
nop_cleanup, /* no need to clean up */
log_geometry, /* geometry */
- nop_signal, /* no need to clean up on shutdown */
+ log_signal, /* handle system signal */
nop_alarm, /* no alarm */
log_cancel, /* CANCEL request */
log_select, /* DEV_SELECT request */
return;
}
+/*============================================================================*
+ * log_signal *
+ *============================================================================*/
+PRIVATE void log_signal(dp, m_ptr)
+struct driver *dp;
+message *m_ptr;
+{
+ sigset_t sigset = m_ptr->NOTIFY_ARG;
+ if (sigismember(&sigset, SIGKMESS)) {
+ do_new_kmess(m_ptr);
+ }
+}
+
+
/*============================================================================*
* log_other *
*============================================================================*/
r = do_diagnostics(m_ptr);
break;
}
- case SYS_SIG: {
- sigset_t sigset = m_ptr->NOTIFY_ARG;
- if (sigismember(&sigset, SIGKMESS)) {
- do_new_kmess(m_ptr);
- }
- r = EDONTREPLY;
- break;
- }
case DEV_STATUS: {
do_status(m_ptr);
r = EDONTREPLY;
#define PM_PROC_NR 0 /* process manager */
#define FS_PROC_NR 1 /* file system */
#define SM_PROC_NR 2 /* system service manager */
-#define MEMORY 3 /* memory driver (RAM disk, null, etc.) */
+#define MEM_PROC_NR 3 /* memory driver (RAM disk, null, etc.) */
#define LOG_PROC_NR 4 /* log device driver */
-#define TTY 5 /* terminal (TTY) driver */
-#define AT_WINI 6 /* AT Winchester */
-#define BIOS_WINI 7 /* BIOS disk device */
+#define TTY_PROC_NR 5 /* terminal (TTY) driver */
+#define AT_PROC_NR 6 /* AT Winchester */
+#define BIOS_PROC_NR 7 /* BIOS disk device */
#define INIT_PROC_NR 8 /* init -- goes multiuser */
/* Number of processes contained in the system image. */
# define SYS_SIG NOTIFY_FROM(SYSTEM) /* system signal */
# define HARD_INT NOTIFY_FROM(HARDWARE) /* hardware interrupt */
# define NEW_KSIG NOTIFY_FROM(HARDWARE) /* new kernel signal */
-# define FKEY_PRESSED NOTIFY_FROM(TTY) /* function key press */
+# define FKEY_PRESSED NOTIFY_FROM(TTY_PROC_NR)/* function key press */
#define NOTIFICATION 0x800 /* flag for notifications */
# define DEV_SELECTED (NOTIFICATION | 5) /* select() notification */
* Directly sending it to TTY only displays the output. Sending it to the
* log driver will cause the diagnostics to be buffered and displayed.
*/
-#define PRINTF_PROC LOG_PROC_NR /* TTY or LOG_PROC_NR */
+#define OUTPUT_PROC_NR LOG_PROC_NR /* TTY_PROC_NR or LOG_PROC_NR */
/* NR_CONS, NR_RS_LINES, and NR_PTYS determine the number of terminals the
* system can handle.
#define SERV_M (~0)
#define SYST_M (~0)
#define USER_M (s(PM_PROC_NR)|s(FS_PROC_NR)|s(SM_PROC_NR))
-#define DRIV_M (USER_M | s(SYSTEM)|s(CLOCK)|s(LOG_PROC_NR)|s(TTY))
+#define DRIV_M (USER_M | \
+ s(SYSTEM)|s(CLOCK)|s(LOG_PROC_NR)|s(TTY_PROC_NR))
/* Sanity check to make sure the send masks can be set. */
extern int dummy[(BITCHUNK_BITS-NR_TASKS > INIT_PROC_NR) ? 1 : -1];
*/
if (how == RBT_PANIC) {
m.m_type = PANIC_DUMPS;
- if (nb_send(TTY, &m) == OK) /* don't block if TTY isn't ready */
+ if (nb_send(TTY_PROC_NR,&m)==OK) /* don't block if TTY isn't ready */
return; /* await sys_abort() from TTY */
}
{ PM_PROC_NR, 0, SERV_F, 16, 3, 0, SERV_T, SERV_M, "PM" },
{ FS_PROC_NR, 0, SERV_F, 16, 4, 0, SERV_T, SERV_M, "FS" },
{ SM_PROC_NR, 0, SERV_F, 16, 3, 0, SERV_T, SYST_M, "SM" },
- { TTY, 0, SERV_F, 16, 1, 0, SERV_T, SYST_M, "TTY" },
- { MEMORY, 0, SERV_F, 16, 2, 0, SERV_T, DRIV_M, "MEMORY" },
+ { TTY_PROC_NR, 0, SERV_F, 16, 1, 0, SERV_T, SYST_M, "TTY" },
+ { MEM_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, DRIV_M, "MEMORY" },
{ LOG_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, SYST_M, "LOG" },
#if ENABLE_AT_WINI
- { AT_WINI, 0, SERV_F, 16, 2, 0, SERV_T, DRIV_M, "AT_WINI" },
+ { AT_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, DRIV_M, "AT_WINI" },
#endif
#if ENABLE_BIOS_WINI
- { BIOS_WINI, 0, SERV_F, 16, 2, 0, SERV_T, SYST_M, "BIOS" },
+ { BIOS_PROC_NR, 0, SERV_F, 16, 2, 0, SERV_T, SYST_M, "BIOS" },
#endif
{ INIT_PROC_NR, 0, USER_F, 8, USER_Q, 0, USER_T, USER_M, "INIT" },
};
*
* This file contains the routines that take care of kernel messages, i.e.,
* diagnostic output within the kernel. Kernel messages are not directly
- * displayed on the console, because this must be done by the PRINT driver.
+ * displayed on the console, because this must be done by the output driver.
* Instead, the kernel accumulates characters in a buffer and notifies the
* output driver when a new message is ready.
*/
-#include <stdarg.h>
+#include <minix/com.h>
#include "kernel.h"
+#include <stdarg.h>
#include <unistd.h>
#include <stddef.h>
#include <stdlib.h>
#include <signal.h>
-#include <minix/com.h>
#include "proc.h"
#define END_OF_KMESS -1
int c; /* character to append */
{
/* Accumulate a single character for a kernel message. Send a notification
- * the to PRINTF_PROC driver if an END_OF_KMESS is encountered.
+ * the to output driver if an END_OF_KMESS is encountered.
*/
if (c != END_OF_KMESS) {
kmess.km_buf[kmess.km_next] = c; /* put normal char in buffer */
kmess.km_size += 1;
kmess.km_next = (kmess.km_next + 1) % KMESS_BUF_SIZE;
} else {
- send_sig(PRINTF_PROC, SIGKMESS);
+ send_sig(OUTPUT_PROC_NR, SIGKMESS);
}
}
m.FKEY_REQUEST = request;
m.FKEY_FKEYS = (fkeys) ? *fkeys : 0;
m.FKEY_SFKEYS = (sfkeys) ? *sfkeys : 0;
- s = _taskcall(TTY, FKEY_CONTROL, &m);
+ s = _taskcall(TTY_PROC_NR, FKEY_CONTROL, &m);
if (fkeys) *fkeys = m.FKEY_FKEYS;
if (sfkeys) *sfkeys = m.FKEY_SFKEYS;
return(s);
int c;
{
/* Accumulate another character. If 0 or buffer full, print it. */
-
static int buf_count; /* # characters in the buffer */
static char print_buf[80]; /* output is buffered here */
message m;
if ((c == 0 && buf_count > 0) || buf_count == sizeof(print_buf)) {
- /* Send the buffer to the PRINTF_PROC driver. */
+ /* Send the buffer to the OUTPUT_PROC_NR driver. */
m.DIAG_BUF_COUNT = buf_count;
m.DIAG_PRINT_BUF = print_buf;
m.DIAG_PROC_NR = SELF;
m.m_type = DIAGNOSTICS;
- (void) _sendrec(PRINTF_PROC, &m);
+ (void) _sendrec(OUTPUT_PROC_NR, &m);
buf_count = 0;
/* If the output fails, e.g., due to an ELOCKED, do not retry output
*/
struct dmap dmap[NR_DEVICES] = {
DT(1, no_dev, 0, 0, 0) /* 0 = not used */
- DT(1, gen_opcl, gen_io, MEMORY, 0) /* 1 = /dev/mem */
- DT(ENABLE_FLOPPY, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /* 2 = /dev/fd0 */
- DT(NR_CTRLRS >= 1, gen_opcl, gen_io, CTRLR(0),DMAP_MUTABLE) /* 3 = /dev/c0 */
- DT(1, tty_opcl, gen_io, TTY, 0) /* 4 = /dev/tty00 */
- DT(1, ctty_opcl,ctty_io,TTY, 0) /* 5 = /dev/tty */
+ DT(1, gen_opcl, gen_io, MEM_PROC_NR, 0) /* 1 = /dev/mem */
+ DT(ENABLE_FLOPPY, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /* 2 = /dev/fd0 */
+ DT(NR_CTRLRS >= 1, gen_opcl, gen_io, CTRLR(0),DMAP_MUTABLE) /* 3 = /dev/c0 */
+ DT(1, tty_opcl, gen_io, TTY_PROC_NR, 0) /* 4 = /dev/tty00 */
+ DT(1, ctty_opcl,ctty_io,TTY_PROC_NR, 0) /* 5 = /dev/tty */
DT(ENABLE_PRINTER, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /* 6 = /dev/lp */
#if (MACHINE == IBM_PC)
- DT(1, no_dev, 0, 0, DMAP_MUTABLE) /* 7 = /dev/ip */
- DT(NR_CTRLRS >= 2, gen_opcl, gen_io, CTRLR(1),DMAP_MUTABLE) /* 8 = /dev/c1 */
- DT(0, 0, 0, 0, DMAP_MUTABLE) /* 9 = not used */
- DT(NR_CTRLRS >= 3, gen_opcl, gen_io, CTRLR(2),DMAP_MUTABLE) /*10 = /dev/c2 */
- DT(0, 0, 0, 0, DMAP_MUTABLE) /*11 = not used */
- DT(NR_CTRLRS >= 4, gen_opcl, gen_io, CTRLR(3),DMAP_MUTABLE) /*12 = /dev/c3 */
- DT(ENABLE_SB16, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /*13 = /dev/audio */
- DT(ENABLE_SB16, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /*14 = /dev/mixer */
- DT(1, gen_opcl, gen_io, LOG_PROC_NR, 0) /* 15 = /dev/klog */
+ DT(1, no_dev, 0, 0, DMAP_MUTABLE) /* 7 = /dev/ip */
+ DT(NR_CTRLRS >= 2, gen_opcl, gen_io, CTRLR(1),DMAP_MUTABLE) /* 8 = /dev/c1 */
+ DT(0, 0, 0, 0, DMAP_MUTABLE) /* 9 = not used */
+ DT(NR_CTRLRS >= 3, gen_opcl, gen_io, CTRLR(2),DMAP_MUTABLE) /*10 = /dev/c2 */
+ DT(0, 0, 0, 0, DMAP_MUTABLE) /*11 = not used */
+ DT(NR_CTRLRS >= 4, gen_opcl, gen_io, CTRLR(3),DMAP_MUTABLE) /*12 = /dev/c3 */
+ DT(ENABLE_SB16, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /*13 = /dev/audio */
+ DT(ENABLE_SB16, gen_opcl, gen_io, NONE, DMAP_MUTABLE) /*14 = /dev/mixer */
+ DT(1, gen_opcl, gen_io, LOG_PROC_NR, 0) /*15 = /dev/klog */
#endif /* IBM_PC */
};
m_out.DEVICE = RAM_DEV;
m_out.REQUEST = MIOCRAMSIZE; /* I/O control to use */
m_out.POSITION = (ram_size_kb * 1024); /* request in bytes */
- if ((s=sendrec(MEMORY, &m_out)) != OK)
+ if ((s=sendrec(MEM_PROC_NR, &m_out)) != OK)
panic("FS","sendrec from MEM failed", s);
else if (m_out.REP_STATUS != OK) {
/* Report and continue, unless RAM disk is required as root FS. */
*/
m->m_type = FKEY_CONTROL;
m->FKEY_REQUEST = FKEY_EVENTS;
- if (OK != (s=sendrec(TTY, m)))
+ if (OK != (s=sendrec(TTY_PROC_NR, m)))
report("IS", "warning, sendrec to TTY failed", s);
/* Now check which keys were pressed: F1-F12. */
SIGEMT, SIGFPE, SIGUSR1, SIGSEGV, SIGUSR2 };
static char ign_sigs[] = { SIGCHLD };
static int protected[] = {PM_PROC_NR, FS_PROC_NR, SM_PROC_NR,
- TTY, AT_WINI, MEMORY};
+ TTY_PROC_NR, AT_PROC_NR, MEM_PROC_NR};
register struct mproc *rmp;
register char *sig_ptr;
phys_clicks total_clicks, minix_clicks, free_clicks;