lkml.org 
[lkml]   [1997]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectPatches for 2.1.40
Date
Hello,

here are some new patches against the 2.1.40 Kernel:
- support for AMD-K5
- colored printk messages according to message level
(you will see how many developers don't care about the message level :-(
- too lazy to specify KERN_INFO -
I hope that changes.... - at least because of this patch ;-)
Tell me if it also works properly on non i386 architectures
- misc. bugfixes like:
- "NE2000/NE1000 support" configuration belongs before "Other ISA cards"
because there IS a PCI version
- <linux/autoconf.h> should only be included in <linux/config.h>

Many patches are still not published, but better these few, than nothing....

Hope you like it,
Wolfram

PS: If this patch fails, it might be corrupted on the way to you.
You will find the correct patch on my web page.
But I hope it will be completely included in 2.1.41 anyway.


diff -u --recursive --new-file linux-2.1.40/arch/i386/Makefile linux/arch/i386/Makefile
--- linux-2.1.40/arch/i386/Makefile Tue May 20 15:00:40 1997
+++ linux/arch/i386/Makefile Tue May 20 15:00:40 1997
@@ -41,6 +41,10 @@
CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686
endif

+ifdef CONFIG_MK5
+CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=K5
+endif
+
ifdef SMP
CFLAGS := $(CFLAGS) -D__SMP__
endif
diff -u --recursive --new-file linux-2.1.40/arch/i386/config.in linux/arch/i386/config.in
--- linux-2.1.40/arch/i386/config.in Thu Apr 10 06:30:30 1997
+++ linux/arch/i386/config.in Tue May 20 15:00:40 1997
@@ -42,7 +42,9 @@
"386 CONFIG_M386 \
486 CONFIG_M486 \
Pentium CONFIG_M586 \
- PPro CONFIG_M686" Pentium
+ PPro CONFIG_M686 \
+ AMD-K5 CONFIG_MK5" 386
+
bool 'Video mode selection support' CONFIG_VIDEO_SELECT

tristate 'Parallel port support' CONFIG_PNP_PARPORT
@@ -53,10 +55,6 @@

source drivers/block/Config.in

-if [ "$CONFIG_NET" = "y" ]; then
- source net/Config.in
-fi
-
mainmenu_option next_comment
comment 'SCSI support'

@@ -68,6 +66,8 @@
endmenu

if [ "$CONFIG_NET" = "y" ]; then
+ source net/Config.in
+
mainmenu_option next_comment
comment 'Network device support'

diff -u --recursive --new-file linux-2.1.40/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
--- linux-2.1.40/arch/i386/kernel/irq.c Tue May 20 15:00:40 1997
+++ linux/arch/i386/kernel/irq.c Tue May 20 15:00:40 1997
@@ -222,7 +222,7 @@
math_error();
}

-static struct irqaction irq13 = { math_error_irq, 0, 0, "math error", NULL, NULL };
+static struct irqaction irq13 = { math_error_irq, 0, 0, "FPU math error", NULL, NULL };

/*
* IRQ2 is cascade interrupt to second interrupt controller
diff -u --recursive --new-file linux-2.1.40/drivers/char/rtc.c linux/drivers/char/rtc.c
--- linux-2.1.40/drivers/char/rtc.c Tue May 20 15:00:40 1997
+++ linux/drivers/char/rtc.c Tue May 20 15:00:40 1997
@@ -536,11 +536,11 @@
{
unsigned long flags;

- printk("Real Time Clock Driver v%s\n", RTC_VERSION);
- if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL))
+ printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION);
+ if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "Real Time Clock", NULL))
{
/* Yeah right, seeing as irq 8 doesn't even hit the bus. */
- printk("rtc: IRQ %d is not free.\n", RTC_IRQ);
+ printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
return -EIO;
}
misc_register(&rtc_dev);
@@ -802,4 +802,3 @@
rtc_irq_data = 0;
restore_flags(flags);
}
-
diff -u --recursive --new-file linux-2.1.40/drivers/isdn/isdn_audio.c linux/drivers/isdn/isdn_audio.c
--- linux-2.1.40/drivers/isdn/isdn_audio.c Wed Feb 26 02:12:50 1997
+++ linux/drivers/isdn/isdn_audio.c Tue May 20 15:00:40 1997
@@ -247,7 +247,7 @@
{'*', '0', '#', 'D'}
};

-#if ((CPU == 386) || (CPU == 486) || (CPU == 586))
+#ifdef __i386__
static inline void
isdn_audio_tlookup(const void *table, void *buff, unsigned long n)
{
diff -u --recursive --new-file linux-2.1.40/drivers/net/Config.in linux/drivers/net/Config.in
--- linux-2.1.40/drivers/net/Config.in Tue May 20 15:00:40 1997
+++ linux/drivers/net/Config.in Tue May 20 15:00:40 1997
@@ -40,6 +40,7 @@
fi
tristate 'SMC 9194 support' CONFIG_SMC9194
fi
+ tristate 'NE2000/NE1000 support' CONFIG_NE2000
bool 'Other ISA cards' CONFIG_NET_ISA
if [ "$CONFIG_NET_ISA" = "y" ]; then
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
@@ -59,7 +60,6 @@
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'ICL EtherTeam 16i/32 support' CONFIG_ETH16I
fi
- tristate 'NE2000/NE1000 support' CONFIG_NE2000
tristate 'NI5210 support' CONFIG_NI52
tristate 'NI6510 support' CONFIG_NI65
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
diff -u --recursive --new-file linux-2.1.40/include/asm-i386/pgtable.h linux/include/asm-i386/pgtable.h
--- linux-2.1.40/include/asm-i386/pgtable.h Tue May 20 15:00:40 1997
+++ linux/include/asm-i386/pgtable.h Tue May 20 15:00:40 1997
@@ -36,7 +36,7 @@
#define __flush_tlb() \
do { unsigned long tmpreg; __asm__ __volatile__("movl %%cr3,%0\n\tmovl %0,%%cr3":"=r" (tmpreg) : :"memory"); } while (0)

-#ifdef CONFIG_M386
+#if defined(CONFIG_M386) || defined(CONFIG_MK5)
#define __flush_tlb_one(addr) flush_tlb()
#else
#define __flush_tlb_one(addr) \
diff -u --recursive --new-file linux-2.1.40/include/asm-i386/uaccess.h linux/include/asm-i386/uaccess.h
--- linux-2.1.40/include/asm-i386/uaccess.h Tue May 20 15:00:40 1997
+++ linux/include/asm-i386/uaccess.h Tue May 20 15:00:40 1997
@@ -6,6 +6,9 @@
*/
#include <linux/sched.h>
#include <asm/segment.h>
+#ifdef __KERNEL__
+#include <linux/config.h>
+#endif

#define VERIFY_READ 0
#define VERIFY_WRITE 1
@@ -43,7 +46,7 @@

extern int __verify_write(const void *, unsigned long);

-#if CPU > 386
+#if !defined(CONFIG_M386)
#define __access_ok(type,addr,size) \
(__kernel_ok || __user_ok(addr,size))
#else
diff -u --recursive --new-file linux-2.1.40/include/linux/config.h linux/include/linux/config.h
--- linux-2.1.40/include/linux/config.h Tue May 20 15:00:40 1997
+++ linux/include/linux/config.h Tue May 20 15:00:40 1997
@@ -1,7 +1,9 @@
#ifndef _LINUX_CONFIG_H
#define _LINUX_CONFIG_H

+#ifdef __KERNEL__
#include <linux/autoconf.h>
+#endif

/*
* Defines for what uname() should return
diff -u --recursive --new-file linux-2.1.40/init/main.c linux/init/main.c
--- linux-2.1.40/init/main.c Tue May 20 15:00:40 1997
+++ linux/init/main.c Tue May 20 15:00:40 1997
@@ -584,7 +584,7 @@

loops_per_sec = (1<<12);

- printk("Calibrating delay loop.. ");
+ printk(KERN_INFO "Calibrating delay loop: ");
while (loops_per_sec <<= 1) {
/* wait for "start of" clock tick */
ticks = jiffies;
@@ -615,7 +615,7 @@
/* finally, adjust loops per second in terms of seconds instead of clocks */
loops_per_sec *= HZ;
/* Round the value and print it */
- printk("ok - %lu.%02lu BogoMIPS\n",
+ printk("%lu.%02lu BogoMIPS\n",
(loops_per_sec+2500)/500000,
((loops_per_sec+2500)/5000) % 100);
}
diff -u --recursive --new-file linux-2.1.40/kernel/printk.c linux/kernel/printk.c
--- linux-2.1.40/kernel/printk.c Tue May 20 15:00:40 1997
+++ linux/kernel/printk.c Tue May 20 15:00:40 1997
@@ -10,6 +10,9 @@
* elsewhere, in preparation for a serial line console (someday).
* Ted Ts'o, 2/11/93.
* Modified for sysctl support, 1/8/97, Chris Horn.
+ *
+ * Colored printk messages according to message level 1997-05-22, Wolfram Kleff
+ *
*/

#include <stdarg.h>
@@ -26,9 +29,14 @@
#include <linux/smp_lock.h>
#include <linux/console.h>
#include <linux/init.h>
+#include <linux/config.h>

#include <asm/uaccess.h>

+#ifdef CONFIG_VT_CONSOLE
+#include "../drivers/char/console_struct.h"
+#endif
+
#define LOG_BUF_LEN 8192

static char buf[1024];
@@ -171,7 +179,6 @@
return error;
}

-
asmlinkage int printk(const char *fmt, ...)
{
va_list args;
@@ -181,6 +188,11 @@
static signed char msg_level = -1;
long flags;

+#ifdef CONFIG_VT_CONSOLE
+ unsigned char s_attr;
+ int currcons=0;
+#endif
+
__save_flags(flags);
__cli();
va_start(args, fmt);
@@ -221,11 +233,36 @@
}
if (msg_level < console_loglevel && console_drivers) {
struct console *c = console_drivers;
+
+#ifdef CONFIG_VT_CONSOLE
+ s_attr = attr;
+ switch (msg_level) {
+ case 0:
+ case 1:
+ attr = 0x74 | 0x08 | 0x80; /* red on white, "bold", blink */
+ break;
+ case 2:
+ attr = 0x74 | 0x08; /* red on white, "bold" */
+ break;
+ case 3:
+ attr = 0x04 | 0x08; /* red on black, "bold" */
+ break;
+ case 4:
+ attr = 0x04; /* red on black */
+ break;
+ case 5:
+ attr = 0x07 | 0x08; /* white on black, "bold" */
+ break;
+ }
+#endif
while(c) {
if (c->write)
c->write(msg, p - msg + line_feed);
c = c->next;
}
+#ifdef CONFIG_VT_CONSOLE
+ attr = s_attr;
+#endif
}
if (line_feed)
msg_level = -1;
diff -u --recursive --new-file linux-2.1.40/include/asm-i386/bugs.h linux/include/asm-i386/bugs.h
--- linux-2.1.40/include/asm-i386/bugs.h Tue May 20 15:00:40 1997
+++ linux/include/asm-i386/bugs.h Tue May 20 15:00:40 1997
@@ -49,8 +49,8 @@

if (!hard_math) {
#ifndef CONFIG_MATH_EMULATION
- printk("No coprocessor found and no math emulation present.\n");
- printk("Giving up.\n");
+ printk(KERN_ERR "No coprocessor found and no math emulation present.\n");
+ printk(KERN_ERR "Giving up.\n");
for (;;) ;
#endif
return;
@@ -64,7 +64,7 @@
* So the irq13 will happen eventually, but the exception 16
* should get there first..
*/
- printk("Checking 386/387 coupling... ");
+ printk(KERN_INFO "Checking 386/387 coupling...");
timer_table[COPRO_TIMER].expires = jiffies+50;
timer_table[COPRO_TIMER].fn = copro_timeout;
timer_active |= 1<<COPRO_TIMER;
@@ -77,7 +77,7 @@
if (fpu_error)
return;
if (!ignore_irq13) {
- printk("Ok, fpu using old IRQ13 error reporting\n");
+ printk("OK, FPU using old IRQ13 error reporting\n");
return;
}
__asm__("fninit\n\t"
@@ -92,7 +92,7 @@
: "=m" (*&fdiv_bug)
: "m" (*&x), "m" (*&y));
if (!fdiv_bug) {
- printk("Ok, fpu using exception 16 error reporting.\n");
+ printk("OK, FPU using exception 16 error reporting.\n");
return;

}
@@ -101,13 +101,13 @@

static void check_hlt(void)
{
- printk("Checking 'hlt' instruction... ");
+ printk(KERN_INFO "Checking 'hlt' instruction...");
if (!hlt_works_ok) {
printk("disabled\n");
return;
}
__asm__ __volatile__("hlt ; hlt ; hlt ; hlt");
- printk("Ok.\n");
+ printk("OK\n");
}

static void check_tlb(void)
@@ -118,8 +118,8 @@
* They will fault when they hit an invlpg instruction.
*/
if (x86 == 3) {
- printk("CPU is a 386 and this kernel was compiled for 486 or better.\n");
- printk("Giving up.\n");
+ printk(KERN_EMERG "CPU is a 386 and this kernel was compiled for 486 or better.\n");
+ printk(KERN_EMERG "Giving up.\n");
for (;;) ;
}
#endif

\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.172 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site