kernel and servers send diagnostic messages to IS; IS sends them to TTY

and the new log driver if enabled.

new usyslogd is started from /usr/etc/rc. New device created by
MAKEDEV.sh. /var/log created by etc/mtree/minix.tree (on root for
now). Made select() slightly more generic, with less code duplication.
This commit is contained in:
Ben Gras
2005-07-08 17:30:01 +00:00
parent dd31785aa6
commit 42050e39f8
12 changed files with 177 additions and 98 deletions

View File

@@ -14,13 +14,14 @@
*
* 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 TTY driver.
* displayed on the console, because this must be done by the PRINT driver.
* Instead, the kernel accumulates characters in a buffer and notifies the
* TTY driver when a new message is ready.
* PRINT driver when a new message is ready.
*/
#include "kernel.h"
#include <minix/com.h> /* need TTY process number */
#include <minix/com.h>
#define isdigit(c) ((unsigned) ((c) - '0') < (unsigned) 10)
#define END_OF_KMESS -1
@@ -151,7 +152,7 @@ PRIVATE void kputc(c)
int c; /* character to append */
{
/* Accumulate a single character for a kernel message. Send a notification
* the to TTY driver if an END_OF_KMESS is encountered.
* the to PRINTF_PROC driver if an END_OF_KMESS is encountered.
*/
message m;
if (c != END_OF_KMESS) {
@@ -161,7 +162,7 @@ int c; /* character to append */
kmess.km_next = (kmess.km_next + 1) % KMESS_BUF_SIZE;
} else {
m.NOTIFY_TYPE = NEW_KMESS;
lock_notify(TTY, &m);
lock_notify(PRINTF_PROC, &m);
}
}

View File

@@ -96,6 +96,7 @@ PUBLIC struct system_image image[] = {
#if ENABLE_DPETH
{ DPETH, 0, SYS_F, SYS_T, 2, 0, SYSTEM_CALL_MASK, ALLOW_ALL_MASK, "DPETH" },
#endif
{ LOG_PROC_NR, 0, SYS_F, SYS_T, 2, 0, SYSTEM_CALL_MASK, ALLOW_ALL_MASK, "LOG" },
{ INIT_PROC_NR, 0, USER_F, USER_T, USER_Q, 0, USER_CALL_MASK, USER_PROC_SENDMASK, "INIT" },
};