aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@cc.helsinki.fi>1993-12-16 12:27:40 +0000
committerNicolas Pitre <nico@cam.org>2007-08-19 14:19:23 -0400
commitfb11be238769030d3e880b6cad3fc9e5e593495c (patch)
tree92f5a67c6f98342880c5d5e6a83e56b58a4e004d
parent59fa0b1fd08fe53a8a9294460c89dda09ee0255d (diff)
downloadarchive-fb11be238769030d3e880b6cad3fc9e5e593495c.tar.gz
ALPHA-pl14f
-rw-r--r--Makefile13
-rw-r--r--README27
-rw-r--r--drivers/FPU-emu/fpu_entry.c4
-rw-r--r--drivers/net/Makefile4
-rw-r--r--include/linux/ldt.h5
-rw-r--r--include/linux/major.h2
-rw-r--r--include/linux/sched.h4
-rw-r--r--include/linux/sys.h8
-rw-r--r--kernel/Makefile9
-rw-r--r--kernel/exit.c2
-rw-r--r--kernel/fork.c6
-rw-r--r--kernel/ldt.c16
-rw-r--r--kernel/sched.c9
-rw-r--r--kernel/signal.c7
-rw-r--r--kernel/traps.c114
-rw-r--r--mm/memory.c6
16 files changed, 122 insertions, 114 deletions
diff --git a/Makefile b/Makefile
index 767776a..020b99c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION = 0.99
PATCHLEVEL = 14
-ALPHA = e
+ALPHA = f
all: Version zImage
@@ -44,16 +44,17 @@ ROOT_DEV = CURRENT
# The number is the same as you would ordinarily press at bootup.
#
-SVGA_MODE= -DSVGA_MODE=3
-
-# Special options.
-#OPTS = -pro
+SVGA_MODE= -DSVGA_MODE=NORMAL_VGA
#
# standard CFLAGS
#
-CFLAGS = -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer -pipe # -x c++
+CFLAGS = -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer -pipe
+
+ifdef CONFIG_CPP
+CFLAGS := $(CFLAGS) -x c++
+endif
ifdef CONFIG_M486
CFLAGS := $(CFLAGS) -m486
diff --git a/README b/README
index 0929c2c..c8d3523 100644
--- a/README
+++ b/README
@@ -87,6 +87,33 @@ COMPILING the kernel:
- keep a backup kernel handy in case something goes wrong.
+ - In order to boot your new kernel, you'll need to copy the kernel
+ image (found in /usr/src/linux/zImage after compilation) to the place
+ where your regular bootable kernel is found.
+
+ For some, this is on a floppy disk, in which case you can "cp
+ /usr/src/linux/zImage /dev/fd0" to make a bootable floppy.
+
+ If you boot Linux from the hard drive, chances are you use LILO uses
+ the kernel image as specified in the file /etc/lilo/config. The
+ kernel image file is usually /vmlinux, or /Image, or /etc/Image. To
+ use the new kernel, copy the new image over the old one (save a
+ backup of the original!). Then, you MUST REINSTALL LILO!! If you
+ don't, you won't be able to boot the new kernel image.
+
+ Reinstalling LILO is usually a matter of running /etc/lilo/install.
+ You may wish to edit /etc/lilo/config to specify an entry for your
+ old kernel image (say, /vmlinux.old) in case the new one does not
+ work. See the LILO docs for more information.
+
+ After reinstalling LILO, you should be all set. Shutdown the system,
+ reboot, and enjoy!
+
+ If you ever need to change the default root device, video mode,
+ ramdisk size, etc. in the kernel image, use the 'rdev' program (or
+ alternatively the LILO boot options when appropriate). No need to
+ recompile the kernel to change these parameters.
+
- reboot with the new kernel and enjoy.
IF SOMETHING GOES WRONG:
diff --git a/drivers/FPU-emu/fpu_entry.c b/drivers/FPU-emu/fpu_entry.c
index d511a1f..0498a1a 100644
--- a/drivers/FPU-emu/fpu_entry.c
+++ b/drivers/FPU-emu/fpu_entry.c
@@ -282,6 +282,8 @@ do_another_FPU_instruction:
}
RE_ENTRANT_CHECK_OFF;
+ current->tss.trap_no = 16;
+ current->tss.error_code = 0;
send_sig(SIGFPE, current, 1);
return;
}
@@ -611,6 +613,8 @@ static int valid_prefix(unsigned char byte)
void __math_abort(struct info * info, unsigned int signal)
{
FPU_EIP = FPU_ORIG_EIP;
+ current->tss.trap_no = 16;
+ current->tss.error_code = 0;
send_sig(signal,current,1);
RE_ENTRANT_CHECK_OFF;
__asm__("movl %0,%%esp ; ret": :"g" (((long) info)-4));
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 2a958fd..51c1c8d 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -14,10 +14,10 @@ CPP := $(CPP) -I../../net/inet
# The point of the makefile...
all: net.a
-Space.o: Space.c /usr/include/linux/autoconf.h
+Space.o: Space.c ../../include/linux/autoconf.h
$(CC) $(CFLAGS) $(OPTS) $(DL_OPTS) -c $< -o $@
-net_init.o: /usr/include/linux/autoconf.h
+net_init.o: ../../include/linux/autoconf.h
ifdef CONFIG_WD80x3
NETDRV_OBJS := $(NETDRV_OBJS) net.a(wd.o)
diff --git a/include/linux/ldt.h b/include/linux/ldt.h
index 7ab13e8..3deed07 100644
--- a/include/linux/ldt.h
+++ b/include/linux/ldt.h
@@ -6,6 +6,11 @@
#ifndef _LINUX_LDT_H
#define _LINUX_LDT_H
+/* Maximum number of LDT entries supported. */
+#define LDT_ENTRIES 8192
+/* The size of each LDT entry. */
+#define LDT_ENTRY_SIZE 8
+
struct modify_ldt_ldt_s {
unsigned int entry_number;
unsigned long base_addr;
diff --git a/include/linux/major.h b/include/linux/major.h
index a37d7a5..2848f95 100644
--- a/include/linux/major.h
+++ b/include/linux/major.h
@@ -67,7 +67,7 @@
#define SCSI_GENERIC_MAJOR 21
/* unused: 22 */
#define MITSUMI_CDROM_MAJOR 23
-#define SONY535_CDROM_MAJOR 24
+#define CDU535_CDROM_MAJOR 24
/*
* Tests for SCSI devices.
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4ea4e25..df6bfd9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -145,7 +145,7 @@ struct tss_struct {
unsigned short trace, bitmap;
unsigned long io_bitmap[IO_BITMAP_SIZE+1];
unsigned long tr;
- unsigned long cr2;
+ unsigned long cr2, trap_no, error_code;
union i387_union i387;
};
@@ -277,7 +277,7 @@ struct task_struct {
_LDT(0),0, \
0, 0x8000, \
/* ioperm */ {~0, }, \
- _TSS(0), 0, \
+ _TSS(0), 0, 0,0, \
/* 387 state */ { { 0, }, } \
} \
}
diff --git a/include/linux/sys.h b/include/linux/sys.h
index 401f11c..b0f4ff0 100644
--- a/include/linux/sys.h
+++ b/include/linux/sys.h
@@ -139,6 +139,7 @@ extern int sys_create_module();
extern int sys_init_module();
extern int sys_delete_module();
extern int sys_get_kernel_syms(); /* 130 */
+extern int sys_quotactl();
/*
* These are system calls that will be removed at some time
@@ -156,6 +157,13 @@ extern int sys_get_kernel_syms(); /* 130 */
#define sys_ssetmask sys_old_syscall /* sig_sigprocmask */
#endif
+/*
+ * These are system calls that haven't been implemented yet
+ * but have an entry in the table for future expansion..
+ */
+
+#define sys_quotactl sys_ni_syscall
+
typedef int (*fn_ptr)();
#ifdef __cplusplus
diff --git a/kernel/Makefile b/kernel/Makefile
index 49a1914..c4a9adc 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -34,11 +34,14 @@ sys_call.o: sys_call.s
sched.o: sched.c
$(CC) $(CFLAGS) $(PROFILING) -fno-omit-frame-pointer -c $<
-ksyms.o: ksyms.S ksyms.sh /usr/include/linux/autoconf.h
+ksyms.lst: ksyms.S ../include/linux/autoconf.h
$(CPP) $(CFLAGS) ksyms.S > ksyms.lst
- sh ksyms.sh > ksyms.s
- $(AS) -o ksyms.o ksyms.s
+ksyms.s: ksyms.lst ksyms.sh
+ sh ksyms.sh > ksyms.s
+
+ksyms.o: ksyms.s
+
dep:
$(CPP) -M *.c > .depend
diff --git a/kernel/exit.c b/kernel/exit.c
index 9bc7316..62e9fdd 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -385,7 +385,7 @@ fake_volatile:
}
if (current->ldt) {
- free_page((unsigned long) current->ldt);
+ vfree(current->ldt);
current->ldt = NULL;
for (i=1 ; i<NR_TASKS ; i++) {
if (task[i] == current) {
diff --git a/kernel/fork.c b/kernel/fork.c
index 44d6e01..48589f5 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -20,6 +20,7 @@
#include <linux/segment.h>
#include <linux/ptrace.h>
#include <linux/malloc.h>
+#include <linux/ldt.h>
#include <asm/segment.h>
#include <asm/system.h>
@@ -182,8 +183,9 @@ asmlinkage int sys_fork(struct pt_regs regs)
p->exit_signal = clone_flags & CSIGNAL;
p->tss.ldt = _LDT(nr);
if (p->ldt) {
- if ((p->ldt = (struct desc_struct*) __get_free_page(GFP_KERNEL)) != NULL)
- memcpy(p->ldt, current->ldt, PAGE_SIZE);
+ p->ldt = (struct desc_struct*) vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE);
+ if (p->ldt != NULL)
+ memcpy(p->ldt, current->ldt, LDT_ENTRIES*LDT_ENTRY_SIZE);
}
p->tss.bitmap = offsetof(struct tss_struct,io_bitmap);
for (i = 0; i < IO_BITMAP_SIZE+1 ; i++) /* IO bitmap is actually SIZE+1 */
diff --git a/kernel/ldt.c b/kernel/ldt.c
index 5d9f514..f014cdc 100644
--- a/kernel/ldt.c
+++ b/kernel/ldt.c
@@ -20,7 +20,7 @@ static int read_ldt(void * ptr, unsigned long bytecount)
if (!ptr)
return -EINVAL;
- size = PAGE_SIZE;
+ size = LDT_ENTRIES*LDT_ENTRY_SIZE;
if (!address) {
address = &default_ldt;
size = sizeof(default_ldt);
@@ -49,7 +49,7 @@ static int write_ldt(void * ptr, unsigned long bytecount)
memcpy_fromfs(&ldt_info, ptr, sizeof(ldt_info));
- if (ldt_info.contents == 3 || ldt_info.entry_number >= 512)
+ if (ldt_info.contents == 3 || ldt_info.entry_number >= LDT_ENTRIES)
return -EINVAL;
limit = ldt_info.limit;
@@ -64,16 +64,22 @@ static int write_ldt(void * ptr, unsigned long bytecount)
if (!current->ldt) {
for (i=1 ; i<NR_TASKS ; i++) {
if (task[i] == current) {
- if (!(current->ldt = (struct desc_struct*) get_free_page(GFP_KERNEL)))
+ if (!(current->ldt = (struct desc_struct*) vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE)))
return -ENOMEM;
- set_ldt_desc(gdt+(i<<1)+FIRST_LDT_ENTRY, current->ldt, 512);
+ set_ldt_desc(gdt+(i<<1)+FIRST_LDT_ENTRY, current->ldt, LDT_ENTRIES);
load_ldt(i);
}
}
}
lp = (unsigned long *) &current->ldt[ldt_info.entry_number];
- *lp = ((ldt_info.base_addr & 0x0000ffff) << 16) |
+ /* Allow LDTs to be cleared by the user. */
+ if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
+ *lp = 0;
+ *(lp+1) = 0;
+ return 0;
+ }
+ *lp = ((ldt_info.base_addr & 0x0000ffff) << 16) |
(ldt_info.limit & 0x0ffff);
*(lp+1) = (ldt_info.base_addr & 0xff000000) |
((ldt_info.base_addr & 0x00ff0000)>>16) |
diff --git a/kernel/sched.c b/kernel/sched.c
index cbf7234..17eca1b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -103,6 +103,11 @@ struct {
extern "C" {
#endif
+int sys_ni_syscall(void)
+{
+ return -EINVAL;
+}
+
fn_ptr sys_call_table[] = { sys_setup, sys_exit, sys_fork, sys_read,
sys_write, sys_open, sys_close, sys_waitpid, sys_creat, sys_link,
sys_unlink, sys_execve, sys_chdir, sys_time, sys_mknod, sys_chmod,
@@ -126,8 +131,8 @@ sys_syslog, sys_setitimer, sys_getitimer, sys_newstat, sys_newlstat,
sys_newfstat, sys_uname, sys_iopl, sys_vhangup, sys_idle, sys_vm86,
sys_wait4, sys_swapoff, sys_sysinfo, sys_ipc, sys_fsync, sys_sigreturn,
sys_clone, sys_setdomainname, sys_newuname, sys_modify_ldt,
-sys_adjtimex, sys_mprotect, sys_sigprocmask,
-sys_create_module, sys_init_module, sys_delete_module, sys_get_kernel_syms };
+sys_adjtimex, sys_mprotect, sys_sigprocmask, sys_create_module,
+sys_init_module, sys_delete_module, sys_get_kernel_syms, sys_quotactl };
/* So we don't have to do any more manual updating.... */
int NR_syscalls = sizeof(sys_call_table)/sizeof(fn_ptr);
diff --git a/kernel/signal.c b/kernel/signal.c
index 4ed60cd..9616297 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -268,8 +268,8 @@ static void setup_frame(struct sigaction * sa, unsigned long ** fp, unsigned lon
put_fs_long(regs->edx, frame+11);
put_fs_long(regs->ecx, frame+12);
put_fs_long(regs->eax, frame+13);
- put_fs_long(0, frame+14); /* trapno - not implemented */
- put_fs_long(0, frame+15); /* err - not implemented */
+ put_fs_long(current->tss.trap_no, frame+14);
+ put_fs_long(current->tss.error_code, frame+15);
put_fs_long(eip, frame+16);
put_fs_long(regs->cs, frame+17);
put_fs_long(regs->eflags, frame+18);
@@ -407,6 +407,7 @@ asmlinkage int do_signal(unsigned long oldmask, struct pt_regs * regs)
oldmask |= sa->sa_mask;
}
regs->esp = (unsigned long) frame;
- regs->eip = eip; /* "return" to the first handler */
+ regs->eip = eip; /* "return" to the first handler */
+ current->tss.trap_no = current->tss.error_code = 0;
return 1;
}
diff --git a/kernel/traps.c b/kernel/traps.c
index 420ff31..03ddea5 100644
--- a/kernel/traps.c
+++ b/kernel/traps.c
@@ -22,6 +22,17 @@
#include <asm/segment.h>
#include <asm/io.h>
+#define DO_ERROR(trapnr, signr, str, name, tsk) \
+asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
+{ \
+ tsk->tss.error_code = error_code; \
+ tsk->tss.trap_no = trapnr; \
+ if (signr == SIGTRAP && current->flags & PF_PTRACED) \
+ current->blocked &= ~(1 << (SIGTRAP-1)); \
+ send_sig(signr, tsk, 1); \
+ die_if_kernel(str,regs,error_code); \
+}
+
#define get_seg_byte(seg,addr) ({ \
register char __res; \
__asm__("push %%fs;mov %%ax,%%fs;movb %%fs:%2,%%al;pop %%fs" \
@@ -83,37 +94,20 @@ asmlinkage void alignment_check(void);
do_exit(SIGSEGV);
}
-asmlinkage void do_double_fault(struct pt_regs * regs, long error_code)
-{
- send_sig(SIGSEGV, current, 1);
- die_if_kernel("double fault",regs,error_code);
-}
-
-asmlinkage void do_general_protection(struct pt_regs * regs, long error_code)
-{
- send_sig(SIGSEGV, current, 1);
- die_if_kernel("general protection",regs,error_code);
-}
-
-asmlinkage void do_alignment_check(struct pt_regs * regs, long error_code)
-{
- send_sig(SIGSEGV, current, 1);
- die_if_kernel("alignment check",regs,error_code);
-}
-
-asmlinkage void do_divide_error(struct pt_regs * regs, long error_code)
-{
- send_sig(SIGFPE, current, 1);
- die_if_kernel("divide error",regs,error_code);
-}
-
-asmlinkage void do_int3(struct pt_regs * regs, long error_code)
-{
- if (current->flags & PF_PTRACED)
- current->blocked &= ~(1 << (SIGTRAP-1));
- send_sig(SIGTRAP, current, 1);
- die_if_kernel("int3",regs,error_code);
-}
+DO_ERROR( 0, SIGFPE, "divide error", divide_error, current)
+DO_ERROR( 3, SIGTRAP, "int3", int3, current)
+DO_ERROR( 4, SIGSEGV, "overflow", overflow, current)
+DO_ERROR( 5, SIGSEGV, "bounds", bounds, current)
+DO_ERROR( 6, SIGILL, "invalid operand", invalid_op, current)
+DO_ERROR( 7, SIGSEGV, "device not available", device_not_available, current)
+DO_ERROR( 8, SIGSEGV, "double fault", double_fault, current)
+DO_ERROR( 9, SIGFPE, "coprocessor segment overrun", coprocessor_segment_overrun, last_task_used_math)
+DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS, current)
+DO_ERROR(11, SIGSEGV, "segment not present", segment_not_present, current)
+DO_ERROR(12, SIGSEGV, "stack segment", stack_segment, current)
+DO_ERROR(13, SIGSEGV, "general protection", general_protection, current)
+DO_ERROR(15, SIGSEGV, "reserved", reserved, current)
+DO_ERROR(17, SIGSEGV, "alignment check", alignment_check, current)
asmlinkage void do_nmi(struct pt_regs * regs, long error_code)
{
@@ -126,6 +120,8 @@ asmlinkage void do_debug(struct pt_regs * regs, long error_code)
if (current->flags & PF_PTRACED)
current->blocked &= ~(1 << (SIGTRAP-1));
send_sig(SIGTRAP, current, 1);
+ current->tss.trap_no = 1;
+ current->tss.error_code = error_code;
if((regs->cs & 3) == 0) {
/* If this is a kernel mode trap, then reset db7 and allow us to continue */
__asm__("movl $0,%%edx\n\t" \
@@ -138,54 +134,6 @@ asmlinkage void do_debug(struct pt_regs * regs, long error_code)
die_if_kernel("debug",regs,error_code);
}
-asmlinkage void do_overflow(struct pt_regs * regs, long error_code)
-{
- send_sig(SIGSEGV, current, 1);
- die_if_kernel("overflow",regs,error_code);
-}
-
-asmlinkage void do_bounds(struct pt_regs * regs, long error_code)
-{
- send_sig(SIGSEGV, current, 1);
- die_if_kernel("bounds",regs,error_code);
-}
-
-asmlinkage void do_invalid_op(struct pt_regs * regs, long error_code)
-{
- send_sig(SIGILL, current, 1);
- die_if_kernel("invalid operand",regs,error_code);
-}
-
-asmlinkage void do_device_not_available(struct pt_regs * regs, long error_code)
-{
- send_sig(SIGSEGV, current, 1);
- die_if_kernel("device not available",regs,error_code);
-}
-
-asmlinkage void do_coprocessor_segment_overrun(struct pt_regs * regs, long error_code)
-{
- send_sig(SIGFPE, last_task_used_math, 1);
- die_if_kernel("coprocessor segment overrun",regs,error_code);
-}
-
-asmlinkage void do_invalid_TSS(struct pt_regs * regs,long error_code)
-{
- send_sig(SIGSEGV, current, 1);
- die_if_kernel("invalid TSS",regs,error_code);
-}
-
-asmlinkage void do_segment_not_present(struct pt_regs * regs,long error_code)
-{
- send_sig(SIGSEGV, current, 1);
- die_if_kernel("segment not present",regs,error_code);
-}
-
-asmlinkage void do_stack_segment(struct pt_regs * regs,long error_code)
-{
- send_sig(SIGSEGV, current, 1);
- die_if_kernel("stack segment",regs,error_code);
-}
-
/*
* Allow the process which triggered the interrupt to recover the error
* condition.
@@ -212,6 +160,8 @@ void math_error(void)
}
env = &last_task_used_math->tss.i387.hard;
send_sig(SIGFPE, last_task_used_math, 1);
+ current->tss.trap_no = 16;
+ current->tss.error_code = 0;
__asm__ __volatile__("fnsave %0":"=m" (*env));
last_task_used_math = NULL;
stts();
@@ -227,12 +177,6 @@ asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code)
math_error();
}
-asmlinkage void do_reserved(struct pt_regs * regs, long error_code)
-{
- send_sig(SIGSEGV, current, 1);
- die_if_kernel("reserved (15,17-47) error",regs,error_code);
-}
-
void trap_init(void)
{
int i;
diff --git a/mm/memory.c b/mm/memory.c
index 98ef0d8..8b57ac5 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -633,6 +633,8 @@ void do_wp_page(unsigned long error_code, unsigned long address,
if (!(page & PAGE_COW)) {
if (user_esp && tsk == current) {
current->tss.cr2 = address;
+ current->tss.error_code = error_code;
+ current->tss.trap_no = 14;
send_sig(SIGSEGV, tsk, 1);
return;
}
@@ -660,8 +662,6 @@ int verify_area(int type, void * addr, unsigned long size)
return -EFAULT;
if (wp_works_ok || type == VERIFY_READ || !size)
return 0;
- if (!size)
- return 0;
size--;
size += start & ~PAGE_MASK;
size >>= PAGE_SHIFT;
@@ -879,6 +879,8 @@ void do_no_page(unsigned long error_code, unsigned long address,
return;
}
tsk->tss.cr2 = address;
+ current->tss.error_code = error_code;
+ current->tss.trap_no = 14;
send_sig(SIGSEGV,tsk,1);
return;
}