From 52ddbb1c75a53d84589543af72c69c31705329a9 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 18 Jul 1990 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1990-07-18 --- port/devcons.c | 1 + power/dat.h | 13 +++++++++++++ power/fns.h | 2 ++ power/io.h | 2 +- power/main.c | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/port/devcons.c b/port/devcons.c index 9f8673b48cec576916d7874ce813150e3543c64c..606b9ea33fd695b6217652c4b09c60d53e0b7a6b 100644 --- a/port/devcons.c +++ b/port/devcons.c @@ -89,6 +89,7 @@ putstrn(char *str, int n) s = splhi(); lock(&printq); + syslog(str, n); while(n > 0){ if(*str == '\n') puts("\r", 1); diff --git a/power/dat.h b/power/dat.h index 0d6cf1429fdd924d731496eef3f98970b7cafb5f..c693ccecdcc3555346db63e4fb3312b4d3ce791e 100644 --- a/power/dat.h +++ b/power/dat.h @@ -37,6 +37,7 @@ typedef struct Seg Seg; typedef struct Stream Stream; typedef struct Ureg Ureg; typedef struct User User; +typedef struct Syslog Syslog; typedef int Devgen(Chan*, Dirtab*, int, int, Dir*); @@ -689,3 +690,15 @@ extern ulong initcode[]; extern Dev devtab[]; extern char devchar[]; extern FPsave initfp; + +/* + * kernel based system log, passed between crashes + */ +#define SYSLOG ((Syslog *)(0x80001B00)) +#define SYSLOGMAGIC 0x12345678 +struct Syslog +{ + ulong magic; + char *next; + char buf[16*1024]; +}; diff --git a/power/fns.h b/power/fns.h index e97966c6075bbc8c39e9a5d969d4e3a1f3151f04..9f30cc64beee1670374cc406bda092be0bb5c070 100644 --- a/power/fns.h +++ b/power/fns.h @@ -172,6 +172,8 @@ void streamopen(Chan*, Qinfo*); int streamparse(char*, Block*); long stringread(Chan*, void*, long, char*); long syscall(Ureg*); +void sysloginit(void); +void syslog(char*, int); void tlbinit(void); void touser(void *); void tsleep(Rendez*, int (*)(void*), void*, int); diff --git a/power/io.h b/power/io.h index c1a9b083c1b6a81196abb57e301297ccc0a0ee0f..10cec7bac0aa49bc38a2555b79a760d488cad533 100644 --- a/power/io.h +++ b/power/io.h @@ -77,4 +77,4 @@ struct INTVEC { #define IO2MASK IO2(ushort, 0xFE8000) #define MPBERR0 IO2(ulong, 0xF48000) #define MPBERR1 IO2(ulong, 0xF4C000) -#define SBEADDR ((ulong *)(UNCACHED|0x1f080000)) +#define SBEADDR ((ulong *)(UNCACHED|0x1F080000)) diff --git a/power/main.c b/power/main.c index b2a223685d56aa79c3c4200f8915dcb62cd46ec8..b44f348020b2563dc23044e6458bfcafc85bfd29 100644 --- a/power/main.c +++ b/power/main.c @@ -57,6 +57,7 @@ main(void) io2init(); chandevreset(); streaminit(); + sysloginit(); pageinit(); userinit(); launchinit();