Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

New Configure script (and some console patches)

350 views
Skip to first unread message

Raymond Chen

unread,
Jun 5, 1993, 4:23:30 PM6/5/93
to
This patch kit is really *THREE* patches in one.

1. A new Configure script, hopefully easier to use and more
flexible than the current one.

2. A kernel configuration switch to enable high-intensity
background in lieu of blinking foreground characters.

3. A kernel configuration switch to control the destination
of kernel trace messages (printk's).

WHAT IT DOES

1. The new Configure script

The current Configure script says, ``It's a fast hack - feel free to
do something better.'' So I took up the challenge. Actually, I *had*
to take it up, because the current Configure script couldn't handle
the third part to this patch.

See the comment block in Configure for a description of the new
configuration file format. (What? Documentation?)

2. High-intensity background

I prefer black-on-white characters, but linux didn't permit white as a
background color; the closest you could get was grey. Now you can get
white, but it'll cost you the loss of blinking characters. In my mind,
that's a better-than-even trade. (Does *anybody* use blinking characters?)

3. Kernel trace messages

Kernel traces (printk's) had been sent to the current VC. This clutters
up the VC and screws up your screen if you were using a fullscreen editor.
(It's also particularly annoying when you're trying to debug the console
driver.)

A new configuration switch allows you to choose either to retain the current
behavior of sending printk's to the current VC, or to force all printk's
to a certain VC. I've configured my kernel to send all printk's to VC7.

INSTALLATION

0. If you have not applied the SELECTION patches, the patch kit below
will fail because the line numbers will be too far off. You'll have
to apply the patches by hand.

1. BACK UP YOUR CURRENT config.in AND Configure FILES!

2. Delete your current config.in and Configure files.

3. Apply the patch file. (This will create new Configure and config.in files.)

4. `make config' anew. Make sure to answer the questions correctly.
Refer to your old config.in. (You *did* save it, right?)

5. Rebuild your kernel.

Thanks.
--
Raymond (just another linux hacker) Chen

*** /dev/null Sat Aug 29 21:48:28 1992
--- Configure Sat Jun 5 09:48:34 1993
***************
*** 0 ****
--- 1,239 ----
+ #! /bin/sh
+ #
+ # This script is used to configure the linux kernel.
+ #
+ # It was inspired by the challenge in the original Configure script
+ # to ``do something better'', combined with the actual need to ``do
+ # something better'' because the old configure script wasn't flexible
+ # enough.
+ #
+ # Please send comments / questions / bug fixes to raym...@microsoft.com.
+ #
+ # Each line in the config file is a command.
+ #
+ # # internal comment
+ #
+ # Lines beginning with a `#' are ignored.
+ #
+ # : message
+ #
+ # `:' causes the line to be echoed to the screen.
+ #
+ # * external comment
+ #
+ # `*' causes the line to be placed in the output
+ # configuration file as a comment as well as being
+ # echoed to the screen.
+ #
+ # if condition
+ # ... commands ...
+ # else
+ # ... commands ...
+ # fi
+ #
+ # This does the obvious thing. The `else' clause is
+ # optional. Conditionals can be nested.
+ #
+ # The `condition' can be any valid bash expression.
+ # They typically involve tests against environment
+ # variables set by configuration options. For example,
+ #
+ # if [ "$CONFIG_SCSI" = "y" ]
+ # ...More stuff...
+ # fi
+ #
+ # Note! That there is no `then' keyword.
+ #
+ # bool 'prompt' CONFIG_VARIABLE default
+ #
+ # This prompts the user for a boolean value.
+ # The prompt may not contain an apostrophe.
+ # `default' should be either `y' or `n'.
+ # The user's response is recorded in four places.
+ #
+ # In .config, if `y'
+ # CONFIG_VARIABLE = CONFIG_VARIABLE
+ # In .config, if `n'
+ # # CONFIG_VARIABLE is not set
+ #
+ # In autoconf.h, if `y'
+ # #define CONFIG_VARIABLE 1
+ # In autoconf.h, if `n'
+ # #undef CONFIG_VARIABLE
+ #
+ # In config.in, if `y'
+ # bool 'prompt' CONFIG_VARIABLE y
+ # In config.in, if `n'
+ # bool 'prompt' CONFIG_VARIABLE n
+ #
+ # In the environment of the Configure script, if `y'
+ # CONFIG_VARIABLE = y
+ # In the environment of the Configure script, if `n'
+ # CONFIG_VARIABLE = n
+ #
+ # The value is placed into the environment of the Configure
+ # script so that later parts of config.in can use the `if'
+ # command to inspect the results of previous queries.
+ #
+ # int 'prompt' CONFIG_VARIABLE default
+ #
+ # This prompts the user for an integer value.
+ # The prompt may not contain an apostrophe.
+ # `default' should be an integer.
+ #
+ # The response is recorded as follows.
+ #
+ # In .config
+ # CONFIG_VARIABLE = response
+ # In autoconf.h
+ # #define CONFIG_VARIABLE (response)
+ # In config.in
+ # int 'prompt' CONFIG_VARIABLE response
+ # In the environment of the Configure script
+ # CONFIG_VARIABLE = response
+ #
+
+ #
+ # Make sure we're really running bash.
+ #
+ # I would really have preferred to write this script in a language with
+ # better string handling, but alas, bash is the only scripting language
+ # that I can be reasonable sure everybody has on their linux machine.
+ #
+ [ -z "$BASH" ] && { echo "Configure requires bash" 1>&2; exit 1; }
+
+ # Disable filename globbing once and for all.
+ # Enable function cacheing.
+ set -f -h
+
+ #
+ # readln reads a line into $ans.
+ #
+ # readln prompt default
+ #
+ function readln () {
+ echo -n "$1"
+ IFS='' read ans </dev/tty || exit 1
+ [ -z "$ans" ] && ans=$2
+ }
+
+ # bool processes a boolean argument
+ #
+ # bool tail
+ #
+ function bool () {
+ # Slimier hack to get bash to rescan a line.
+ eval "set -- $1"
+ ans=""
+ while [ "$ans" != "y" -a "$ans" != "n" ]; do
+ readln "$1 ($2) [$3] " "$3"
+ done
+ if [ "$ans" = "y" ]; then
+ echo "$2 = $2" >>$CONFIG
+ echo "#define $2 1" >>$CONFIG_H
+ else
+ echo "# $2 is not set" >>$CONFIG
+ echo "#undef $2" >>$CONFIG_H
+ fi
+ raw_input_line="bool '$1' $2 $ans"
+ eval "$2=$ans"
+ }
+
+ # int processes an integer argument
+ #
+ # int tail
+ #
+ function int () {
+ # Slimier hack to get bash to rescan a line.
+ eval "set -- $1"
+ ans="x"
+ while [ $[$ans+0] != "$ans" ]; do
+ readln "$1 ($2) [$3] " "$3"
+ done
+ echo "$2 = $ans" >>$CONFIG
+ echo "#define $2 ($ans)" >>$CONFIG_H
+ raw_input_line="int '$1' $2 $ans"
+ eval "$2=$ans"
+ }
+
+ CONFIG=.config~
+ CONFIG_H=include/linux/autoconf.h
+
+ #
+ # Make sure we start out with a clean slate.
+ #
+ > config.new
+ echo "#" > $CONFIG
+ echo "# Automatically generated make config: don't edit" >> $CONFIG
+ echo "#" >> $CONFIG
+
+ echo "/*" > $CONFIG_H
+ echo " * Automatically generated C config: don't edit" >> $CONFIG_H
+ echo " */" >> $CONFIG_H
+
+ stack=''
+ branch='t'
+
+ while IFS='' read raw_input_line
+ do
+ # Slimy hack to get bash to rescan a line.
+ read cmd rest <<-END_OF_COMMAND
+ $raw_input_line
+ END_OF_COMMAND
+
+ if [ "$cmd" = "*" ]; then
+ if [ "$branch" = "t" ]; then
+ echo "$raw_input_line"
+ echo "# $rest" >>$CONFIG
+ if [ "$prevcmd" != "*" ]; then
+ echo >>$CONFIG_H
+ echo "/* $rest" >>$CONFIG_H
+ else
+ echo " * $rest" >>$CONFIG_H
+ fi
+ prevcmd="*"
+ fi
+ else
+ [ "$prevcmd" = "*" ] && echo " */" >>$CONFIG_H
+ prevcmd=""
+ case "$cmd" in
+ :) [ "$branch" = "t" ] && echo "$raw_input_line" ;;
+ int) [ "$branch" = "t" ] && int "$rest" ;;
+ bool) [ "$branch" = "t" ] && bool "$rest" ;;
+ if) stack="$branch $stack"
+ if [ "$branch" = "t" ] && eval "$rest"; then
+ branch=t
+ else
+ branch=f
+ fi ;;
+ else) if [ "$branch" = "t" ]; then
+ branch=f
+ else
+ read branch rest <<-END_OF_STACK
+ $stack
+ END_OF_STACK
+ fi ;;
+ fi) [ -z "$stack" ] && echo "Error! Extra fi." 1>&2
+ read branch stack <<-END_OF_STACK
+ $stack
+ END_OF_STACK
+ ;;
+ esac
+ fi
+ echo "$raw_input_line" >>config.new
+ done
+ [ "$prevcmd" = "*" ] && echo " */" >>$CONFIG_H
+
+ [ -z "$stack" ] || echo "Error! Untermiated if." 1>&2
+
+ mv config.in config.old
+ mv config.new config.in
+
+ echo
+ echo "The linux kernel is now hopefully configured for your setup."
+ echo "Check the top-level Makefile for additional configuration,"
+ echo "and do a 'make dep ; make clean' if you want to be sure all"
+ echo "the files are correctly re-made"
+ echo
+
+ exit 0
*** /dev/null Sat Aug 29 21:48:28 1992
--- config.in Sat Jun 5 09:49:38 1993
***************
*** 0 ****
--- 1,97 ----
+ #
+ # For a description of the syntax of this configuration file,
+ # see the Configure script.
+ #
+ *
+ * General setup
+ *
+ bool 'Kernel math emulation' CONFIG_MATH_EMULATION n
+ bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y
+ bool 'XT harddisk support' CONFIG_BLK_DEV_XD n
+ bool 'TCP/IP' CONFIG_TCPIP n
+ bool 'Kernel profiling support' CONFIG_PROFILE n
+ bool 'Limit memory to low 16MB' CONFIG_MAX_16M y
+ bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
+ *
+ * SCSI support
+ *
+ bool 'SCSI support?' CONFIG_SCSI n
+ if [ "$CONFIG_SCSI" = "n" ]
+ :
+ : Skipping SCSI configuration options...
+ :
+ else
+ *
+ * SCSI support type (disk, tape, CDrom)
+ *
+ bool 'Scsi disk support' CONFIG_BLK_DEV_SD n
+ bool 'Scsi tape support' CONFIG_BLK_DEV_ST n
+ bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR n
+ *
+ * SCSI low-level drivers
+ *
+ bool 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 n
+ bool 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 n
+ bool 'Future Domain SCSI support' CONFIG_SCSI_FUTURE_DOMAIN n
+ bool 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE n
+ bool 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR n
+ bool '7000FASST SCSI support' CONFIG_SCSI_7000FASST n
+ fi
+ *
+ * Filesystems
+ *
+ bool 'Mount root initially readonly' CONFIG_ROOT_RDONLY n
+ bool 'Standard (minix) fs support' CONFIG_MINIX_FS y
+ bool 'Extended fs support' CONFIG_EXT_FS y
+ bool 'Second extended fs support' CONFIG_EXT2_FS n
+ bool 'xiafs filesystem support' CONFIG_XIA_FS n
+ bool 'msdos fs support' CONFIG_MSDOS_FS y
+ bool '/proc filesystem support' CONFIG_PROC_FS y
+ bool 'NFS filesystem support' CONFIG_NFS_FS n
+ bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS y
+ bool 'Inheriting filesystem (IFS) support' CONFIG_IFS_FS n
+ *
+ * Keyboard
+ *
+ bool 'Keyboard meta-key sends ESC-prefix' CONFIG_KBD_META y
+ *
+ * Serial
+ *
+ bool 'Autoconfigure serial IRQ lines at bootup' CONFIG_AUTO_IRQ n
+ bool 'AST Fourport serial driver support' CONFIG_AST_FOURPORT n
+ bool 'Accent Async 4 serial support' CONFIG_ACCENT_ASYNC n
+ *
+ * Mouse
+ *
+ bool 'Logitech busmouse support' CONFIG_BUSMOUSE n
+ bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE n
+ bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n
+ bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
+ *
+ * Sound
+ *
+ bool 'Soundcard support (distributed separately)' CONFIG_SOUND n
+ *
+ * Console
+ *
+ : By enabling high-intensity background, you lose the ability to have
+ : blinking characters.
+ :
+ bool 'High-intensity background?' CONFIG_HI_INTENSITY_BACKGROUND y
+ :
+ : Select a destination for kernel traces (printk's)
+ : -1 = send to current foreground VC
+ : n = send to VCn always (n = 0, 1, 2, ...)
+ : VC0 = Alt+F1, VC1 = Alt+F2, etc.
+ :
+ int 'Send kernel traces where?' CONFIG_TRACE_VC 0
+ *
+ * Other configureable items:
+ *
+ * kernel/Makefile KEYBOARD
+ * kernel/Makefile ROOT_DEV
+ * kernel/Makefile SVGA_MODE
+ * kernel/Makefile RAMDISK
+ * include/linux/tty.h NR_CONSOLES
+ * kernel/chr_drv/Makefile SELECTION
+ *
*** boot/orig/setup.S Sat Jun 5 09:52:58 1993
--- boot/setup.S Mon May 31 16:26:37 1993
***************
*** 90,95 ****
--- 90,101 ----
mov [4],bx ! bh = display page
mov [6],ax ! al = video mode, ah = window width

+ #ifdef CONFIG_HI_INTENSITY_BACKGROUND
+ mov ax, #0x1003
+ xor bl, bl
+ int 0x10
+ #endif
+
! Get hd0 data

xor ax,ax ! clear ax
*** kernel/chr_drv/orig/console.c Mon May 31 14:40:40 1993
--- kernel/chr_drv/console.c Thu Jun 3 08:42:10 1993
***************
*** 592,603 ****
--- 592,613 ----
else if (intensity == 0)
attr = (attr & 0xf0) | halfcolor;
}
+ #ifdef CONFIG_HI_INTENSITY_BACKGROUND
+ /* We must apply -blink and -intensity *before* flipping the nibbles */
+ if (blink)
+ attr ^= 0x80;
+ if (intensity == 2)
+ attr ^= 0x08;
if (reverse ^ decscnm)
+ attr = (attr >> 4) | (attr << 4);
+ #else
+ if (reverse ^ decscnm)
attr = (attr & 0x88) | (((attr >> 4) | (attr << 4)) & 0x77);
if (blink)
attr ^= 0x80;
if (intensity == 2)
attr ^= 0x08;
+ #endif
if (!can_do_color) {
if (underline)
attr = (attr & 0xf8) | 0x01;
***************
*** 604,614 ****
--- 614,628 ----
else if (intensity == 0)
attr = (attr & 0xf0) | 0x08;
}
+ #ifdef CONFIG_HI_INTENSITY_BACKGROUND
+ video_erase_char = (attr << 8) | ' ';
+ #else
if (decscnm)
video_erase_char = ((color & 0x88) | (((color >> 4) |
(color << 4)) & 0x77) << 8) | ' ';
else
video_erase_char = (color << 8) | ' ';
+ #endif
}

static void default_attr(int currcons) {
***************
*** 747,753 ****
--- 761,771 ----

if (can_do_color)
for (p = (unsigned char *)origin+1; p < (unsigned char *)scr_end; p+=2)
+ #ifdef CONFIG_HI_INTENSITY_BACKGROUND
+ *p = (*p >> 4) | (*p << 4);
+ #else
*p = (*p & 0x88) | (((*p >> 4) | (*p << 4)) & 0x77);
+ #endif
else
for (p = (unsigned char *)origin+1; p < (unsigned char *)scr_end; p+=2)
*p ^= *p & 0x07 == 1 ? 0x70 : 0x77;
***************
*** 1683,1689 ****
--- 1701,1711 ----

void console_print(const char * b)
{
+ #if CONFIG_TRACE_VC == -1
int currcons = fg_console;
+ #else
+ #define currcons CONFIG_TRACE_VC
+ #endif
char c;

if (!printable || currcons<0 || currcons>=NR_CONSOLES)
***************
*** 1698,1708 ****
}
*(char *) pos = c;
*(char *) (pos+1) = attr;
! if (x == video_num_columns - 1) {
need_wrap = 1;
continue;
}
- x++;
pos+=2;
}
set_cursor(currcons);
--- 1720,1729 ----
}
*(char *) pos = c;
*(char *) (pos+1) = attr;
! if (++x >= video_num_columns) {
need_wrap = 1;
continue;
}
pos+=2;
}
set_cursor(currcons);
***************
*** 1717,1722 ****
--- 1738,1744 ----
timer_active |= 1<<BLANK_TIMER;
}
}
+ #undef currcons

/*
* All we do is set the write and ioctl subroutines; later on maybe we'll

0 new messages