Commit 0b098c16 authored by Linus Torvalds's avatar Linus Torvalds

[PATCH] Linux-0.96b (June 21, 1992)

First cut at core-dumping.  Also, do more dynamic boottime memory
allocation, rather than allocating data structures statically.

Allocate task structures at run-time rather than having a big array of
them.

First "obsolete" system call.  The old "stat()" system call was too
limited, due to "struct stat" having various 16-bit fields etc (notably
inode numbers).  We make a new stat() function, and keep the old one
around as "old_stat()" for binary compatibility.

We also need a bigger "utsname" to hold real node names.

Whoo! NR_OPEN is now 32 rather than 20.

itimer() support driven by X11 adoption (Darren Senn).

gcc starts using fsqrt, so that gets added to the FP emulation.  We're
still basing that on my trivial code.

[Original changelog below]

0.96b is not a new major release: it's pretty close to 0.96a with all my
patches (1-4).  However, as there has been 4 patches already, I decided
it would be time for a full kernel release along with a bootimage, so
that people who don't feel confident with patching can use the new
features.

If you already have 0.96a patchlevel 4, 0.96b will offer you these new
features:

 - the math-emulation now handles fsqrt, as gcc-2.2.2 generates that
   inline.  I haven't tested the kernel code at all: I tested the
   algorithm in user space, but I'm lazy, so I never turned off my 387
   to do real testing.  I hope it works.
 - better vt100 terminal emulation thanks to Mika Liljeberg.
 - I removed a possible race-condition in the buffer-cache code.
 - minor fixes

The vt100 emulation should now be complete enough for almost everything
(including vt100 test suites): as a result the setterm utility had to be
changed (as the old setterm codes aren't compatible with the full vt100
codes).  setterm-0.96b.tar.Z contains the new setterm.

The soon-to-be-released gcc-2.2.2 will need the 0.96b kernel: (a) due to
the fsqrt emulation and (b) it uses the new stat() system call.  So
upgrading is a good idea.  (If you have a co-processor, (a) isn't used,
but (b) still stands)

If you have an unpatched 0.96a, the differences to 0.96b are roughly
(not counting the above-mentioned new things):

 - corrected the disk-buffer-list bug with read/write-errors
 - fixed read-ahead warning messages at end of disk
 - better support for text-mode restoration after running MGR and X
 - full core-dumping, attach/detach etc debugging features
 - 16550A support
 - less low 1MB memory used for kernel structures
 - various minor fixes

Note that the fact that new versions (pl4 and above) use more memory in
the 1M+ area means that linux will report less free memory (it's used
for buffer-cache instead).  This could concievably be a problem on 2MB
machines.  The standard kernel comes with only 4 pty's though, and if
you use the standard 80x25 text modes instead of svga modes, the VC
buffers will be smaller.  Please contact me if there are problems even
with this minimal setup.

0.96b does /not/ contain: the new scsi drivers, new filesystems or some
other patches I have gotten (ibm character set mode, loop-devices etc).
If you have sent me any other patch, you might want to remind me about
it.

                Linus
parent a5dcf393
......@@ -195,6 +195,6 @@ init/main.o : init/main.c include/stddef.h include/stdarg.h include/fcntl.h incl
include/time.h include/asm/system.h include/asm/io.h include/linux/config.h \
include/linux/config_rel.h include/linux/config_ver.h include/linux/config.dist.h \
include/linux/sched.h include/linux/head.h include/linux/fs.h include/sys/dirent.h \
include/limits.h include/linux/mm.h include/linux/kernel.h include/signal.h \
include/sys/param.h include/sys/time.h include/sys/resource.h include/linux/tty.h \
include/termios.h include/linux/unistd.h
include/limits.h include/sys/vfs.h include/linux/mm.h include/linux/kernel.h \
include/signal.h include/sys/param.h include/sys/time.h include/sys/resource.h \
include/linux/tty.h include/termios.h include/linux/unistd.h
This diff is collapsed.
......@@ -273,11 +273,9 @@ struct buffer_head * getblk(int dev,int block)
wait_on_buffer(bh);
if (bh->b_count)
goto repeat;
while (bh->b_dirt) {
if (bh->b_dirt) {
sync_buffers(bh->b_dev);
wait_on_buffer(bh);
if (bh->b_count)
goto repeat;
goto repeat;
}
/* NOTE!! While we slept waiting for this block, somebody else might */
/* already have added "this" block to the cache. check it */
......
......@@ -40,50 +40,55 @@ dep:
### Dependencies:
bitmap.o : bitmap.c ../../include/linux/string.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/types.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/minix_fs.h
../../include/sys/dirent.h ../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h \
../../include/linux/kernel.h ../../include/signal.h ../../include/sys/param.h \
../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h ../../include/linux/minix_fs.h
blkdev.o : blkdev.c ../../include/linux/sched.h ../../include/linux/head.h ../../include/linux/fs.h \
../../include/sys/types.h ../../include/sys/dirent.h ../../include/limits.h \
../../include/linux/mm.h ../../include/linux/kernel.h ../../include/signal.h \
../../include/sys/param.h ../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h \
../../include/linux/minix_fs.h ../../include/linux/tty.h ../../include/asm/system.h \
../../include/termios.h ../../include/errno.h ../../include/fcntl.h ../../include/sys/stat.h
../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/minix_fs.h ../../include/linux/tty.h \
../../include/asm/system.h ../../include/termios.h ../../include/linux/stat.h \
../../include/errno.h ../../include/fcntl.h
chrdev.o : chrdev.c ../../include/linux/sched.h ../../include/linux/head.h ../../include/linux/fs.h \
../../include/sys/types.h ../../include/sys/dirent.h ../../include/limits.h \
../../include/linux/mm.h ../../include/linux/kernel.h ../../include/signal.h \
../../include/sys/param.h ../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h \
../../include/linux/minix_fs.h ../../include/linux/tty.h ../../include/asm/system.h \
../../include/termios.h ../../include/errno.h ../../include/fcntl.h ../../include/sys/stat.h
dir.o : dir.c ../../include/errno.h ../../include/sys/stat.h ../../include/sys/types.h \
../../include/asm/segment.h ../../include/linux/fs.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/minix_fs.h
../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/minix_fs.h ../../include/linux/tty.h \
../../include/asm/system.h ../../include/termios.h ../../include/linux/stat.h \
../../include/errno.h ../../include/fcntl.h
dir.o : dir.c ../../include/errno.h ../../include/asm/segment.h ../../include/linux/fs.h \
../../include/sys/types.h ../../include/sys/dirent.h ../../include/limits.h \
../../include/sys/vfs.h ../../include/linux/minix_fs.h ../../include/linux/stat.h
file.o : file.c ../../include/errno.h ../../include/fcntl.h ../../include/sys/types.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/sys/stat.h ../../include/asm/segment.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/asm/segment.h \
../../include/asm/system.h ../../include/linux/sched.h ../../include/linux/head.h \
../../include/linux/fs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/minix_fs.h
inode.o : inode.c ../../include/linux/string.h ../../include/sys/stat.h ../../include/sys/types.h \
../../include/linux/sched.h ../../include/linux/head.h ../../include/linux/fs.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/linux/fs.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/minix_fs.h ../../include/asm/system.h
../../include/sys/resource.h ../../include/linux/minix_fs.h ../../include/linux/stat.h
inode.o : inode.c ../../include/linux/string.h ../../include/linux/stat.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/types.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h \
../../include/linux/kernel.h ../../include/signal.h ../../include/sys/param.h \
../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h ../../include/linux/minix_fs.h \
../../include/asm/system.h ../../include/asm/segment.h
namei.o : namei.c ../../include/linux/sched.h ../../include/linux/head.h ../../include/linux/fs.h \
../../include/sys/types.h ../../include/sys/dirent.h ../../include/limits.h \
../../include/linux/mm.h ../../include/linux/kernel.h ../../include/signal.h \
../../include/sys/param.h ../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h \
../../include/linux/minix_fs.h ../../include/asm/segment.h ../../include/linux/string.h \
../../include/fcntl.h ../../include/errno.h ../../include/const.h ../../include/sys/stat.h
symlink.o : symlink.c ../../include/errno.h ../../include/sys/stat.h ../../include/sys/types.h \
../../include/asm/segment.h ../../include/linux/sched.h ../../include/linux/head.h \
../../include/linux/fs.h ../../include/sys/dirent.h ../../include/limits.h ../../include/linux/mm.h \
../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/minix_fs.h ../../include/linux/string.h \
../../include/linux/stat.h ../../include/asm/segment.h ../../include/fcntl.h \
../../include/errno.h ../../include/const.h
symlink.o : symlink.c ../../include/errno.h ../../include/asm/segment.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/types.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h \
../../include/linux/kernel.h ../../include/signal.h ../../include/sys/param.h \
../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h ../../include/linux/minix_fs.h
../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h ../../include/linux/minix_fs.h \
../../include/linux/stat.h
truncate.o : truncate.c ../../include/linux/sched.h ../../include/linux/head.h \
../../include/linux/fs.h ../../include/sys/types.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/minix_fs.h ../../include/linux/tty.h \
../../include/asm/system.h ../../include/termios.h ../../include/errno.h ../../include/fcntl.h \
../../include/sys/stat.h
../../include/asm/system.h ../../include/termios.h ../../include/linux/stat.h \
../../include/errno.h ../../include/fcntl.h
#define UTS_RELEASE "0.96a-35"
#define UTS_RELEASE "0.96a-37"
#define UTS_VERSION "06/17/92"
#define UTS_VERSION "06/20/92"
......@@ -177,6 +177,10 @@ void fmul(const temp_real *, const temp_real *, temp_real *);
void fdiv(const temp_real *, const temp_real *, temp_real *);
/* sqrt.c */
void fsqrt(const temp_real *, temp_real *);
/* compare.c */
void fcom(const temp_real *, const temp_real *);
......
......@@ -183,7 +183,7 @@ extern long lp_init(long);
extern long con_init(long);
extern long tty_init(long);
extern void flush(struct tty_queue * queue);
extern void flush_input(struct tty_struct * tty);
extern int tty_ioctl(struct inode *, struct file *, unsigned int, unsigned int);
extern int is_orphaned_pgrp(int pgrp);
......
#ifndef _SYS_STAT_H
#define _SYS_STAT_H
#include <sys/types.h>
struct stat {
dev_t st_dev;
ino_t st_ino;
umode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
dev_t st_rdev;
off_t st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
};
#define S_IFMT 00170000
#define S_IFSOCK 0140000
#define S_IFLNK 0120000
#define S_IFREG 0100000
#define S_IFBLK 0060000
#define S_IFDIR 0040000
#define S_IFCHR 0020000
#define S_IFIFO 0010000
#define S_ISUID 0004000
#define S_ISGID 0002000
#define S_ISVTX 0001000
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
#define S_IRWXU 00700
#define S_IRUSR 00400
#define S_IWUSR 00200
#define S_IXUSR 00100
#define S_IRWXG 00070
#define S_IRGRP 00040
#define S_IWGRP 00020
#define S_IXGRP 00010
#define S_IRWXO 00007
#define S_IROTH 00004
#define S_IWOTH 00002
#define S_IXOTH 00001
extern int chmod(const char *_path, mode_t mode);
extern int fstat(int fildes, struct stat *stat_buf);
extern int mkdir(const char *_path, mode_t mode);
extern int mkfifo(const char *_path, mode_t mode);
extern int stat(const char *filename, struct stat *stat_buf);
extern mode_t umask(mode_t mask);
#endif
#ifndef _SYS_UTSNAME_H
#define _SYS_UTSNAME_H
#include <sys/types.h>
#include <sys/param.h>
struct utsname {
char sysname[9];
char nodename[MAXHOSTNAMELEN+1];
char release[9];
char version[9];
char machine[9];
};
extern int uname(struct utsname * utsbuf);
#endif
......@@ -60,54 +60,60 @@ dep:
### Dependencies:
exit.s exit.o : exit.c ../include/errno.h ../include/signal.h ../include/sys/types.h \
../include/sys/wait.h ../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h \
../include/sys/dirent.h ../include/limits.h ../include/linux/mm.h ../include/linux/kernel.h \
../include/sys/param.h ../include/sys/time.h ../include/time.h ../include/sys/resource.h \
../include/linux/tty.h ../include/asm/system.h ../include/termios.h ../include/asm/segment.h
../include/sys/dirent.h ../include/limits.h ../include/sys/vfs.h ../include/linux/mm.h \
../include/linux/kernel.h ../include/sys/param.h ../include/sys/time.h ../include/time.h \
../include/sys/resource.h ../include/linux/tty.h ../include/asm/system.h ../include/termios.h \
../include/asm/segment.h
fork.s fork.o : fork.c ../include/errno.h ../include/stddef.h ../include/linux/sched.h \
../include/linux/head.h ../include/linux/fs.h ../include/sys/types.h ../include/sys/dirent.h \
../include/limits.h ../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h \
../include/sys/param.h ../include/sys/time.h ../include/time.h ../include/sys/resource.h \
../include/asm/segment.h ../include/asm/system.h
../include/limits.h ../include/sys/vfs.h ../include/linux/mm.h ../include/linux/kernel.h \
../include/signal.h ../include/sys/param.h ../include/sys/time.h ../include/time.h \
../include/sys/resource.h ../include/asm/segment.h ../include/asm/system.h
ioport.s ioport.o : ioport.c ../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h \
../include/sys/types.h ../include/sys/dirent.h ../include/limits.h ../include/linux/mm.h \
../include/linux/kernel.h ../include/signal.h ../include/sys/param.h ../include/sys/time.h \
../include/time.h ../include/sys/resource.h ../include/errno.h
../include/sys/types.h ../include/sys/dirent.h ../include/limits.h ../include/sys/vfs.h \
../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h ../include/errno.h
itimer.s itimer.o : itimer.c ../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h \
../include/sys/types.h ../include/sys/dirent.h ../include/limits.h ../include/sys/vfs.h \
../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h ../include/asm/segment.h \
../include/errno.h
mktime.s mktime.o : mktime.c ../include/time.h
panic.s panic.o : panic.c ../include/linux/kernel.h ../include/linux/sched.h ../include/linux/head.h \
../include/linux/fs.h ../include/sys/types.h ../include/sys/dirent.h ../include/limits.h \
../include/linux/mm.h ../include/signal.h ../include/sys/param.h ../include/sys/time.h \
../include/time.h ../include/sys/resource.h
../include/sys/vfs.h ../include/linux/mm.h ../include/signal.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h
printk.s printk.o : printk.c ../include/stdarg.h ../include/stddef.h ../include/errno.h \
../include/asm/segment.h ../include/asm/system.h ../include/linux/sched.h ../include/linux/head.h \
../include/linux/fs.h ../include/sys/types.h ../include/sys/dirent.h ../include/limits.h \
../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h
../include/sys/vfs.h ../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h \
../include/sys/param.h ../include/sys/time.h ../include/time.h ../include/sys/resource.h
ptrace.s ptrace.o : ptrace.c ../include/linux/head.h ../include/linux/kernel.h ../include/linux/sched.h \
../include/linux/fs.h ../include/sys/types.h ../include/sys/dirent.h ../include/limits.h \
../include/linux/mm.h ../include/signal.h ../include/sys/param.h ../include/sys/time.h \
../include/time.h ../include/sys/resource.h ../include/errno.h ../include/asm/segment.h \
../include/asm/system.h ../include/sys/ptrace.h
../include/sys/vfs.h ../include/linux/mm.h ../include/signal.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h ../include/asm/segment.h \
../include/asm/system.h ../include/errno.h ../include/sys/ptrace.h
sched.s sched.o : sched.c ../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h \
../include/sys/types.h ../include/sys/dirent.h ../include/limits.h ../include/linux/mm.h \
../include/linux/kernel.h ../include/signal.h ../include/sys/param.h ../include/sys/time.h \
../include/time.h ../include/sys/resource.h ../include/linux/timer.h ../include/linux/sys.h \
../include/linux/fdreg.h ../include/asm/system.h ../include/asm/io.h ../include/asm/segment.h \
../include/errno.h
../include/sys/types.h ../include/sys/dirent.h ../include/limits.h ../include/sys/vfs.h \
../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h ../include/linux/timer.h \
../include/linux/sys.h ../include/linux/fdreg.h ../include/asm/system.h ../include/asm/io.h \
../include/asm/segment.h ../include/errno.h
signal.s signal.o : signal.c ../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h \
../include/sys/types.h ../include/sys/dirent.h ../include/limits.h ../include/linux/mm.h \
../include/linux/kernel.h ../include/signal.h ../include/sys/param.h ../include/sys/time.h \
../include/time.h ../include/sys/resource.h ../include/asm/segment.h ../include/sys/wait.h \
../include/errno.h
../include/sys/types.h ../include/sys/dirent.h ../include/limits.h ../include/sys/vfs.h \
../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h ../include/asm/segment.h \
../include/sys/wait.h ../include/sys/ptrace.h ../include/errno.h
sys.s sys.o : sys.c ../include/errno.h ../include/linux/sched.h ../include/linux/head.h \
../include/linux/fs.h ../include/sys/types.h ../include/sys/dirent.h ../include/limits.h \
../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h ../include/linux/tty.h \
../include/asm/system.h ../include/termios.h ../include/linux/config.h ../include/linux/config_rel.h \
../include/linux/config_ver.h ../include/linux/config.dist.h ../include/asm/segment.h \
../include/sys/times.h ../include/sys/utsname.h ../include/linux/string.h
../include/sys/vfs.h ../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h \
../include/sys/param.h ../include/sys/time.h ../include/time.h ../include/sys/resource.h \
../include/linux/tty.h ../include/asm/system.h ../include/termios.h ../include/linux/config.h \
../include/linux/config_rel.h ../include/linux/config_ver.h ../include/linux/config.dist.h \
../include/asm/segment.h ../include/sys/times.h ../include/linux/utsname.h ../include/linux/string.h
traps.s traps.o : traps.c ../include/linux/string.h ../include/linux/head.h ../include/linux/sched.h \
../include/linux/fs.h ../include/sys/types.h ../include/sys/dirent.h ../include/limits.h \
../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h ../include/asm/system.h \
../include/asm/segment.h ../include/asm/io.h ../include/errno.h
../include/sys/vfs.h ../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h \
../include/sys/param.h ../include/sys/time.h ../include/time.h ../include/sys/resource.h \
../include/asm/system.h ../include/asm/segment.h ../include/asm/io.h ../include/errno.h
vsprintf.s vsprintf.o : vsprintf.c ../include/stdarg.h ../include/linux/string.h
......@@ -48,29 +48,30 @@ dep:
### Dependencies:
floppy.s floppy.o : floppy.c ../../include/linux/sched.h ../../include/linux/head.h ../../include/linux/fs.h \
../../include/sys/types.h ../../include/sys/dirent.h ../../include/limits.h \
../../include/linux/mm.h ../../include/linux/kernel.h ../../include/signal.h \
../../include/sys/param.h ../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h \
../../include/linux/timer.h ../../include/linux/fdreg.h ../../include/linux/fd.h \
../../include/asm/system.h ../../include/asm/io.h ../../include/asm/segment.h \
../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/timer.h ../../include/linux/fdreg.h \
../../include/linux/fd.h ../../include/asm/system.h ../../include/asm/io.h ../../include/asm/segment.h \
../../include/errno.h blk.h
hd.s hd.o : hd.c ../../include/errno.h ../../include/linux/config.h ../../include/linux/config_rel.h \
../../include/linux/config_ver.h ../../include/linux/config.dist.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/types.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/timer.h ../../include/linux/hdreg.h \
../../include/asm/system.h ../../include/asm/io.h ../../include/asm/segment.h \
blk.h
../../include/sys/dirent.h ../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h \
../../include/linux/kernel.h ../../include/signal.h ../../include/sys/param.h \
../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h ../../include/linux/timer.h \
../../include/linux/hdreg.h ../../include/asm/system.h ../../include/asm/io.h \
../../include/asm/segment.h blk.h
ll_rw_blk.s ll_rw_blk.o : ll_rw_blk.c ../../include/errno.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/types.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/asm/system.h blk.h
../../include/sys/dirent.h ../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h \
../../include/linux/kernel.h ../../include/signal.h ../../include/sys/param.h \
../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h ../../include/asm/system.h \
blk.h
ramdisk.s ramdisk.o : ramdisk.c ../../include/linux/string.h ../../include/linux/config.h \
../../include/linux/config_rel.h ../../include/linux/config_ver.h ../../include/linux/config.dist.h \
../../include/linux/sched.h ../../include/linux/head.h ../../include/linux/fs.h \
../../include/sys/types.h ../../include/sys/dirent.h ../../include/limits.h \
../../include/linux/mm.h ../../include/linux/kernel.h ../../include/signal.h \
../../include/sys/param.h ../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h \
../../include/linux/minix_fs.h ../../include/asm/system.h ../../include/asm/segment.h \
../../include/asm/memory.h blk.h
../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/minix_fs.h ../../include/asm/system.h \
../../include/asm/segment.h ../../include/asm/memory.h blk.h
......@@ -112,7 +112,7 @@ void rd_load(void)
nblocks, rd_length >> BLOCK_SIZE_BITS);
return;
}
printk("Loading %d bytes into ram disk... 0000k",
printk("Loading %d bytes into ram disk\n",
nblocks << BLOCK_SIZE_BITS);
cp = rd_start;
while (nblocks) {
......@@ -127,12 +127,12 @@ void rd_load(void)
}
(void) memcpy(cp, bh->b_data, BLOCK_SIZE);
brelse(bh);
printk("\010\010\010\010\010%4dk",i);
if (!(nblocks-- & 15))
printk(".");
cp += BLOCK_SIZE;
block++;
nblocks--;
i++;
}
printk("\010\010\010\010\010done \n");
printk("\ndone\n");
ROOT_DEV=0x0101;
}
......@@ -48,7 +48,7 @@ dep:
### Dependencies:
console.s console.o : console.c ../../include/linux/sched.h ../../include/linux/head.h \
../../include/linux/fs.h ../../include/sys/types.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/timer.h ../../include/linux/tty.h \
../../include/asm/system.h ../../include/termios.h ../../include/linux/config.h \
......@@ -57,51 +57,51 @@ console.s console.o : console.c ../../include/linux/sched.h ../../include/linux/
../../include/errno.h ../../include/sys/kd.h vt_kern.h
keyboard.s keyboard.o : keyboard.c ../../include/linux/sched.h ../../include/linux/head.h \
../../include/linux/fs.h ../../include/sys/types.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/ctype.h ../../include/linux/tty.h \
../../include/asm/system.h ../../include/termios.h ../../include/asm/io.h
lp.s lp.o : lp.c ../../include/linux/sched.h ../../include/linux/head.h ../../include/linux/fs.h \
../../include/sys/types.h ../../include/sys/dirent.h ../../include/limits.h \
../../include/linux/mm.h ../../include/linux/kernel.h ../../include/signal.h \
../../include/sys/param.h ../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h \
../../include/linux/lp.h ../../include/errno.h ../../include/asm/io.h ../../include/asm/segment.h
../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/lp.h ../../include/errno.h \
../../include/asm/io.h ../../include/asm/segment.h
mem.s mem.o : mem.c ../../include/errno.h ../../include/sys/types.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/tty.h ../../include/asm/system.h \
../../include/termios.h ../../include/asm/segment.h ../../include/asm/io.h
pty.s pty.o : pty.c ../../include/linux/sched.h ../../include/linux/head.h ../../include/linux/fs.h \
../../include/sys/types.h ../../include/sys/dirent.h ../../include/limits.h \
../../include/linux/mm.h ../../include/linux/kernel.h ../../include/signal.h \
../../include/sys/param.h ../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h \
../../include/linux/tty.h ../../include/asm/system.h ../../include/termios.h \
../../include/asm/io.h
../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/tty.h ../../include/asm/system.h \
../../include/termios.h ../../include/asm/io.h
serial.s serial.o : serial.c ../../include/signal.h ../../include/sys/types.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/sys/param.h ../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h \
../../include/linux/timer.h ../../include/linux/tty.h ../../include/asm/system.h \
../../include/termios.h ../../include/asm/io.h
tty_io.s tty_io.o : tty_io.c ../../include/linux/ctype.h ../../include/errno.h ../../include/signal.h \
../../include/sys/types.h ../../include/unistd.h ../../include/sys/stat.h ../../include/sys/time.h \
../../include/time.h ../../include/sys/times.h ../../include/sys/utsname.h ../../include/sys/param.h \
../../include/sys/resource.h ../../include/utime.h ../../include/fcntl.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/linux/tty.h ../../include/asm/system.h ../../include/termios.h \
../../include/asm/io.h ../../include/asm/segment.h
tty_io.s tty_io.o : tty_io.c ../../include/errno.h ../../include/signal.h ../../include/sys/types.h \
../../include/fcntl.h ../../include/linux/sched.h ../../include/linux/head.h \
../../include/linux/fs.h ../../include/sys/dirent.h ../../include/limits.h ../../include/sys/vfs.h \
../../include/linux/mm.h ../../include/linux/kernel.h ../../include/sys/param.h \
../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h ../../include/linux/tty.h \
../../include/asm/system.h ../../include/termios.h ../../include/linux/ctype.h \
../../include/asm/io.h ../../include/asm/segment.h ../../include/sys/kd.h vt_kern.h
tty_ioctl.s tty_ioctl.o : tty_ioctl.c ../../include/errno.h ../../include/termios.h ../../include/sys/types.h \
../../include/linux/sched.h ../../include/linux/head.h ../../include/linux/fs.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/tty.h ../../include/asm/system.h \
../../include/asm/io.h ../../include/asm/segment.h
../../include/sys/dirent.h ../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h \
../../include/linux/kernel.h ../../include/signal.h ../../include/sys/param.h \
../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h ../../include/linux/tty.h \
../../include/asm/system.h ../../include/asm/io.h ../../include/asm/segment.h
vt.s vt.o : vt.c ../../include/errno.h ../../include/sys/types.h ../../include/sys/kd.h \
../../include/sys/vt.h ../../include/asm/io.h ../../include/asm/segment.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/linux/tty.h ../../include/asm/system.h \
../../include/termios.h vt_kern.h
../../include/termios.h ../../include/linux/timer.h vt_kern.h
This diff is collapsed.
......@@ -29,11 +29,14 @@
#define NO_META_BIT 0x80
unsigned char kapplic = 0;
unsigned char ckmode = 0;
unsigned char krepeat = 1;
unsigned char kmode = 0;
unsigned char kleds = NUMLED;
unsigned char ke0 = 0;
unsigned char kraw = 0;
unsigned char kbd_flags = KBDFLAGS;
unsigned char lfnlmode = 0;
extern void do_keyboard_interrupt(void);
extern void ctrl_alt_del(void);
......@@ -57,7 +60,9 @@ static unsigned int handle_diacr(unsigned int);
void do_keyboard(void)
{
static unsigned char rep = 0xff, repke0 = 0;
unsigned char scancode, x;
struct tty_struct * tty = TTY_TABLE(0);
scancode=inb_p(0x60);
x=inb_p(0x61);
......@@ -69,15 +74,48 @@ void do_keyboard(void)
if (kraw) {
put_queue(scancode);
do_keyboard_interrupt();
} else if (scancode == 0xe0)
return;
}
if (scancode == 0xe0) {
ke0 = 1;
else if (scancode == 0xe1)
return;
}
if (scancode == 0xe1) {
ke0 = 2;
else {
key_table[scancode](scancode);
do_keyboard_interrupt();
return;
}
/*
* The keyboard maintains its own internal caps lock and num lock
* statuses. In caps lock mode E0 AA precedes make code and E0 2A
* follows break code. In num lock mode, E0 2A precedes make
* code and E0 AA follows break code. We do our own book-keeping,
* so we will just ignore these.
*/
if (ke0 == 1 && (scancode == 0x2a || scancode == 0xaa)) {
ke0 = 0;
return;
}
/*
* Repeat a key only if the input buffers are empty or the
* characters get echoed locally. This makes key repeat usable
* with slow applications and unders heavy loads.
*/
if (rep == 0xff) {
if (scancode < 0x80) {
rep = scancode;
repke0 = ke0;
}
} else if (ke0 == repke0 && (scancode & 0x7f) == rep)
if (scancode & 0x80)
rep = 0xff;
else if (!(krepeat && (L_ECHO(tty) || (EMPTY(tty->secondary) &&
EMPTY(tty->read_q))))) {
ke0 = 0;
return;
}
key_table[scancode](scancode);
do_keyboard_interrupt();
ke0 = 0;
}
static void put_queue(int ch)
......@@ -167,10 +205,10 @@ static void unrshift(int sc)
static void caps(int sc)
{
if (!(kmode&CAPSDOWN)) {
kleds^=CAPSLED;
kmode^=CAPS;
kmode|=CAPSDOWN;
if (!(kmode & CAPSDOWN)) {
kleds ^= CAPSLED;
kmode ^= CAPS;
kmode |= CAPSDOWN;
set_leds();
}
}
......@@ -178,7 +216,7 @@ static void caps(int sc)
void set_leds(void)
{
if (kleds != old_leds) {
old_leds=kleds;
old_leds = kleds;
kb_wait();
outb(0xed, 0x60); /* set leds command */
kb_ack();
......@@ -190,16 +228,16 @@ void set_leds(void)
static void uncaps(int sc)
{
kmode&=(~CAPSDOWN);
kmode &= ~CAPSDOWN;
}
static void scroll(int sc)
{
if (kmode&(LSHIFT|RSHIFT))
if (kmode & (LSHIFT | RSHIFT))
show_mem();
else
show_state();
kleds^=SCRLED;
kleds ^= SCRLED;
set_leds();
}
......@@ -208,7 +246,7 @@ static void num(int sc)
if (kapplic)
applkey(0x50);
else {
kleds^=NUMLED;
kleds ^= NUMLED;
set_leds();
}
}
......@@ -217,7 +255,7 @@ static void applkey(int key)
{
char buf[] = { 0x1b, 0x4f, 0x00, 0x00 };
buf[2]=key;
buf[2] = key;
puts_queue(buf);
}
......@@ -747,27 +785,27 @@ static void do_self(int sc)
{
unsigned char ch;
if (kmode&ALTGR)
ch=alt_map[sc];
else if (kmode&(LSHIFT|RSHIFT|LCTRL|RCTRL))
ch=shift_map[sc];
if (kmode & ALTGR)
ch = alt_map[sc];
else if (kmode & (LSHIFT | RSHIFT | LCTRL | RCTRL))
ch = shift_map[sc];
else
ch=key_map[sc];
ch = key_map[sc];
if (ch == 0)
return;
if ((ch=handle_diacr(ch)) == 0)
if ((ch = handle_diacr(ch)) == 0)
return;
if (kmode&(LCTRL|RCTRL|CAPS)) /* ctrl or caps */
if ((ch>='a' && ch <='z') || (ch>=224 && ch<=254))
if (kmode & (LCTRL | RCTRL | CAPS)) /* ctrl or caps */
if ((ch >= 'a' && ch <= 'z') || (ch >= 224 && ch <= 254))
ch -= 32;
if (kmode&(LCTRL|RCTRL)) /* ctrl */
if (kmode & (LCTRL | RCTRL)) /* ctrl */
ch &= 0x1f;
if (kmode&ALT)
if (kbd_flags&NO_META_BIT) {
if (kmode & ALT)
if (kbd_flags & NO_META_BIT) {
put_queue('\033');
put_queue(ch);
} else
......@@ -910,7 +948,7 @@ static void cur(int sc)
buf[2]=cur_table[sc];
if (buf[2] < '9')
buf[3]='~';
if (kapplic)
if ((buf[2] >= 'A' && buf[2] <= 'D') ? ckmode : kapplic)
buf[1]='O';
puts_queue(buf);
}
......@@ -952,12 +990,13 @@ static void star(int sc)
static void enter(int sc)
{
if (ke0 != 1)
do_self(sc);
else if (kapplic)
if (ke0 == 1 && kapplic)
applkey('M');
else
do_self(sc);
else {
put_queue(13);
if (lfnlmode)
put_queue(10);
}
}
static void minus(int sc)
......
......@@ -70,16 +70,13 @@ static void send_intr(unsigned line, unsigned port, struct tty_struct * tty)
#define TIMER ((SER1_TIMEOUT-1)+line)
timer_active &= ~(1 << TIMER);
if (!tty->stopped) {
do {
if ((c = GETCH(tty->write_q)) < 0)
return;
outb(c,port);
i++;
} while ( port_table[line] == PORT_16550A && \
i < 14 && !EMPTY(tty->write_q) && \
!tty->stopped);
}
do {
if ((c = GETCH(tty->write_q)) < 0)
return;
outb(c,port);
i++;
} while ( port_table[line] == PORT_16550A &&
i < 14 && !EMPTY(tty->write_q));
timer_table[TIMER].expires = jiffies + 10;
timer_active |= 1 << TIMER;
if (LEFT(tty->write_q) > WAKEUP_CHARS)
......
......@@ -175,11 +175,13 @@ void copy_to_cooked(struct tty_struct * tty)
if ((INTR_CHAR(tty) != __DISABLED_CHAR) &&
(c==INTR_CHAR(tty))) {
kill_pg(tty->pgrp, SIGINT, 1);
flush_input(tty);
continue;
}
if ((QUIT_CHAR(tty) != __DISABLED_CHAR) &&
(c==QUIT_CHAR(tty))) {
kill_pg(tty->pgrp, SIGQUIT, 1);
flush_input(tty);
continue;
}
if ((SUSPEND_CHAR(tty) != __DISABLED_CHAR) &&
......
......@@ -42,7 +42,7 @@ static void change_speed(struct tty_struct * tty)
sti();
}
void flush(struct tty_queue * queue)
static void flush(struct tty_queue * queue)
{
if (queue) {
cli();
......@@ -52,6 +52,14 @@ void flush(struct tty_queue * queue)
}
}
void flush_input(struct tty_struct * tty)
{
flush(tty->read_q);
flush(tty->secondary);
tty->secondary->data = 0;
wake_up(&tty->read_q->proc_list);
}
static void wait_until_sent(struct tty_struct * tty)
{
while (!(current->signal & ~current->blocked) && !EMPTY(tty->write_q)) {
......@@ -250,8 +258,7 @@ int tty_ioctl(struct inode * inode, struct file * file,
case TCGETS:
return get_termios(tty,(struct termios *) arg);
case TCSETSF:
flush(tty->read_q);
flush(tty->secondary);
flush_input(tty);
if (other_tty)
flush(other_tty->write_q);
/* fallthrough */
......@@ -263,8 +270,7 @@ int tty_ioctl(struct inode * inode, struct file * file,
case TCGETA:
return get_termio(tty,(struct termio *) arg);
case TCSETAF:
flush(tty->read_q);
flush(tty->secondary);
flush_input(tty);
if (other_tty)
flush(other_tty->write_q);
/* fallthrough */
......@@ -299,15 +305,13 @@ int tty_ioctl(struct inode * inode, struct file * file,
return -EINVAL; /* not implemented */
case TCFLSH:
if (arg==0) {
flush(tty->read_q);
flush(tty->secondary);
flush_input(tty);
if (other_tty)
flush(other_tty->write_q);
} else if (arg==1)
flush(tty->write_q);
else if (arg==2) {
flush(tty->read_q);
flush(tty->secondary);
flush_input(tty);
flush(tty->write_q);
if (other_tty)
flush(other_tty->write_q);
......
......@@ -164,8 +164,7 @@ vt_ioctl(struct tty_struct *tty, int dev, int cmd, int arg)
}
else
return -EINVAL;
flush(tty->read_q);
flush(tty->secondary);
flush_input(tty);
return 0;
case KDGKBMODE:
verify_area((void *) arg, sizeof(unsigned long));
......
......@@ -23,7 +23,7 @@ CPP =cpp -nostdinc -I../../include
-c -o $*.o $<
OBJS = emulate.o error.o convert.o ea.o get_put.o \
add.o mul.o div.o compare.o
add.o mul.o div.o compare.o sqrt.o
math.a: $(OBJS)
$(AR) rcs math.a $(OBJS)
......@@ -42,44 +42,49 @@ dep:
### Dependencies:
add.s add.o : add.c ../../include/linux/math_emu.h ../../include/linux/sched.h ../../include/linux/head.h \
../../include/linux/fs.h ../../include/sys/types.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h
compare.s compare.o : compare.c ../../include/linux/math_emu.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/types.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h
../../include/sys/dirent.h ../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h \
../../include/linux/kernel.h ../../include/signal.h ../../include/sys/param.h \
../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h
convert.s convert.o : convert.c ../../include/linux/math_emu.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/types.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h
../../include/sys/dirent.h ../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h \
../../include/linux/kernel.h ../../include/signal.h ../../include/sys/param.h \
../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h
div.s div.o : div.c ../../include/linux/math_emu.h ../../include/linux/sched.h ../../include/linux/head.h \
../../include/linux/fs.h ../../include/sys/types.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h
ea.s ea.o : ea.c ../../include/stddef.h ../../include/linux/math_emu.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/types.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h ../../include/asm/segment.h
../../include/sys/dirent.h ../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h \
../../include/linux/kernel.h ../../include/signal.h ../../include/sys/param.h \
../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h ../../include/asm/segment.h
emulate.s emulate.o : emulate.c ../../include/signal.h ../../include/sys/types.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/sys/param.h ../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h
error.s error.o : error.c ../../include/signal.h ../../include/sys/types.h ../../include/linux/sched.h \
../../include/linux/head.h ../../include/linux/fs.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/sys/param.h ../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h
get_put.s get_put.o : get_put.c ../../include/signal.h ../../include/sys/types.h ../../include/linux/math_emu.h \
../../include/linux/sched.h ../../include/linux/head.h ../../include/linux/fs.h \
../../include/sys/dirent.h ../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/sys/param.h ../../include/sys/time.h ../../include/time.h ../../include/sys/resource.h \
../../include/asm/segment.h
../../include/sys/dirent.h ../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h \
../../include/linux/kernel.h ../../include/sys/param.h ../../include/sys/time.h \
../../include/time.h ../../include/sys/resource.h ../../include/asm/segment.h
mul.s mul.o : mul.c ../../include/linux/math_emu.h ../../include/linux/sched.h ../../include/linux/head.h \
../../include/linux/fs.h ../../include/sys/types.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h
sqrt.s sqrt.o : sqrt.c ../../include/linux/math_emu.h ../../include/linux/sched.h ../../include/linux/head.h \
../../include/linux/fs.h ../../include/sys/types.h ../../include/sys/dirent.h \
../../include/limits.h ../../include/sys/vfs.h ../../include/linux/mm.h ../../include/linux/kernel.h \
../../include/signal.h ../../include/sys/param.h ../../include/sys/time.h ../../include/time.h \
../../include/sys/resource.h
......@@ -126,10 +126,14 @@ static void do_emu(struct info * info)
return;
case 0x1ef:
math_abort(info,1<<(SIGILL-1));
case 0x1fa:
fsqrt(PST(0),&tmp);
real_to_real(&tmp,&ST(0));
return;
case 0x1f0: case 0x1f1: case 0x1f2: case 0x1f3:
case 0x1f4: case 0x1f5: case 0x1f6: case 0x1f7:
case 0x1f8: case 0x1f9: case 0x1fa: case 0x1fb:
case 0x1fd: case 0x1fe: case 0x1ff:
case 0x1f8: case 0x1f9: case 0x1fb: case 0x1fd:
case 0x1fe: case 0x1ff:
printk("%04x fxxx not implemented\n\r",code + 0xd800);
math_abort(info,1<<(SIGILL-1));
case 0x1fc:
......
......@@ -11,6 +11,6 @@
void math_error(void)
{
if (last_task_used_math)
last_task_used_math->signal |= 1<<(SIGFPE-1);
send_sig(SIGFPE,last_task_used_math,1);
__asm__("fnclex");
}
/*
* linux/kernel/math/sqrt.c
*
* (C) 1991 Linus Torvalds
*/
/*
* simple and stupid temporary real fsqrt() routine
*
* There are probably better ways to do this, but this should work ok.
*/
#include <linux/math_emu.h>
#include <linux/sched.h>
static void shift_right(int * c)
{
__asm__("shrl $1,12(%0) ; rcrl $1,8(%0) ; rcrl $1,4(%0) ; rcrl $1,(%0)"
::"r" ((long) c));
}
static int sqr64(unsigned long * a, unsigned long * b)
{
unsigned long tmp[4];
__asm__("movl (%0),%%eax ; mull %%eax\n\t"
"movl %%eax,(%1) ; movl %%edx,4(%1)\n\t"
"movl 4(%0),%%eax ; mull %%eax\n\t"
"movl %%eax,8(%1) ; movl %%edx,12(%1)\n\t"
"movl (%0),%%eax ; mull 4(%0)\n\t"
"addl %%eax,%%eax ; adcl %%edx,%%edx\n\t"
"adcl $0,12(%1) ; addl %%eax,4(%1)\n\t"
"adcl %%edx,8(%1) ; adcl $0,12(%1)"
::"b" ((long) a),"c" ((long) tmp)
:"ax","bx","cx","dx");
if (tmp[3] > b[3] ||
(tmp[3] == b[3] && (tmp[2] > b[2] ||
(tmp[2] == b[2] && (tmp[1] > b[1] ||
(tmp[1] == b[1] && tmp[0] > b[0]))))))
return 0;
return 1;
}
void fsqrt(const temp_real * s, temp_real * d)
{
unsigned long src[4];
unsigned long res[2];
int exponent;
unsigned long mask, *c;
int i;
exponent = s->exponent;
src[0] = src[1] = 0;
src[2] = s->a;
src[3] = s->b;
d->exponent = 0;
d->a = d->b = 0;
if (exponent) /* fsqrt(0.0) = 0.0 */
return;
if (!src[2] && !src[3])
return;
if (exponent & 0x8000) {
send_sig(SIGFPE,current,0);
return;
}
if (exponent & 1) {
shift_right(src);
exponent++;
}
exponent >>= 1;
exponent += 0x1fff;
c = res + 2;
mask = 0;
for (i = 64 ; i > 0 ; i--) {
if (!(mask >>= 1)) {
c--;
mask = 0x80000000;
}
res[0] = d->a; res[1] = d->b;
*c |= mask;
if (sqr64(res,src)) {
d->a = res[0];
d->b = res[1];
}
}
if (!d->a && !d->b)
return;
while (!(d->b & 0x80000000)) {
__asm__("addl %%eax,%%eax ; adcl %%edx,%%edx"
:"=a" (d->a),"=d" (d->b)
:"0" (d->a),"1" (d->b));
exponent--;
}
d->exponent = exponent;
}
......@@ -94,7 +94,7 @@ int sys_signal(int signum, long handler, long restorer)
return -EINVAL;
tmp.sa_handler = (void (*)(int)) handler;
tmp.sa_mask = 0;
tmp.sa_flags = SA_ONESHOT | SA_NOMASK;
tmp.sa_flags = SA_ONESHOT | SA_NOMASK | SA_INTERRUPT;
tmp.sa_restorer = (void (*)(void)) restorer;
handler = (long) current->sigaction[signum-1].sa_handler;
current->sigaction[signum-1] = tmp;
......@@ -135,16 +135,17 @@ int do_signal(long signr,struct pt_regs * regs)
current->pid, signr, regs->eax, regs->orig_eax,
sa->sa_flags & SA_INTERRUPT);
#endif
sa_handler = (unsigned long) sa->sa_handler;
if ((regs->orig_eax != -1) &&
((regs->eax == -ERESTARTSYS) || (regs->eax == -ERESTARTNOINTR))) {
if ((regs->eax == -ERESTARTSYS) && ((sa->sa_flags & SA_INTERRUPT)))
if ((sa_handler > 1) && (regs->eax == -ERESTARTSYS) &&
(sa->sa_flags & SA_INTERRUPT))
regs->eax = -EINTR;
else {
regs->eax = regs->orig_eax;
regs->eip = old_eip -= 2;
}
}
sa_handler = (unsigned long) sa->sa_handler;
if (sa_handler==1) {
/* check for SIGCHLD: it's special */
if (signr == SIGCHLD)
......
......@@ -489,7 +489,7 @@ int sys_sethostname(char *name, int len)
if ((thisname.nodename[i] = get_fs_byte(name+i)) == 0)
return 0;
}
thisname.nodename[__NEW_UTS_LEN] = 0;
thisname.nodename[i] = 0;
return 0;
}
......
......@@ -40,35 +40,19 @@ dep:
cp tmp_make Makefile
### Dependencies:
_exit.s _exit.o : _exit.c ../include/unistd.h ../include/sys/stat.h ../include/sys/types.h \
../include/sys/time.h ../include/time.h ../include/sys/times.h ../include/sys/utsname.h \
../include/sys/param.h ../include/sys/resource.h ../include/utime.h ../include/linux/unistd.h
close.s close.o : close.c ../include/unistd.h ../include/sys/stat.h ../include/sys/types.h \
../include/sys/time.h ../include/time.h ../include/sys/times.h ../include/sys/utsname.h \
../include/sys/param.h ../include/sys/resource.h ../include/utime.h ../include/linux/unistd.h
_exit.s _exit.o : _exit.c ../include/linux/unistd.h
close.s close.o : close.c ../include/linux/unistd.h
ctype.s ctype.o : ctype.c ../include/linux/ctype.h
dup.s dup.o : dup.c ../include/unistd.h ../include/sys/stat.h ../include/sys/types.h \
../include/sys/time.h ../include/time.h ../include/sys/times.h ../include/sys/utsname.h \
../include/sys/param.h ../include/sys/resource.h ../include/utime.h ../include/linux/unistd.h
dup.s dup.o : dup.c ../include/linux/unistd.h
errno.s errno.o : errno.c
execve.s execve.o : execve.c ../include/unistd.h ../include/sys/stat.h ../include/sys/types.h \
../include/sys/time.h ../include/time.h ../include/sys/times.h ../include/sys/utsname.h \
../include/sys/param.h ../include/sys/resource.h ../include/utime.h ../include/linux/unistd.h
execve.s execve.o : execve.c ../include/linux/unistd.h
itimer.s itimer.o : itimer.c ../include/linux/unistd.h ../include/sys/time.h ../include/time.h \
../include/sys/types.h
malloc.s malloc.o : malloc.c ../include/linux/kernel.h ../include/linux/mm.h ../include/linux/fs.h \
../include/sys/types.h ../include/sys/dirent.h ../include/limits.h ../include/signal.h \
../include/asm/system.h
open.s open.o : open.c ../include/unistd.h ../include/sys/stat.h ../include/sys/types.h \
../include/sys/time.h ../include/time.h ../include/sys/times.h ../include/sys/utsname.h \
../include/sys/param.h ../include/sys/resource.h ../include/utime.h ../include/linux/unistd.h \
../include/stdarg.h
setsid.s setsid.o : setsid.c ../include/unistd.h ../include/sys/stat.h ../include/sys/types.h \
../include/sys/time.h ../include/time.h ../include/sys/times.h ../include/sys/utsname.h \
../include/sys/param.h ../include/sys/resource.h ../include/utime.h ../include/linux/unistd.h
../include/sys/types.h ../include/sys/dirent.h ../include/limits.h ../include/sys/vfs.h \
../include/signal.h ../include/asm/system.h
open.s open.o : open.c ../include/linux/unistd.h ../include/stdarg.h
setsid.s setsid.o : setsid.c ../include/sys/types.h ../include/linux/unistd.h
string.s string.o : string.c ../include/linux/string.h
wait.s wait.o : wait.c ../include/unistd.h ../include/sys/stat.h ../include/sys/types.h \
../include/sys/time.h ../include/time.h ../include/sys/times.h ../include/sys/utsname.h \
../include/sys/param.h ../include/sys/resource.h ../include/utime.h ../include/linux/unistd.h \
../include/sys/wait.h
write.s write.o : write.c ../include/unistd.h ../include/sys/stat.h ../include/sys/types.h \
../include/sys/time.h ../include/time.h ../include/sys/times.h ../include/sys/utsname.h \
../include/sys/param.h ../include/sys/resource.h ../include/utime.h ../include/linux/unistd.h
wait.s wait.o : wait.c ../include/linux/unistd.h ../include/sys/wait.h ../include/sys/types.h
write.s write.o : write.c ../include/linux/unistd.h ../include/sys/types.h
......@@ -39,15 +39,15 @@ dep:
### Dependencies:
memory.o : memory.c ../include/signal.h ../include/sys/types.h ../include/asm/system.h \
../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h ../include/sys/dirent.h \
../include/limits.h ../include/linux/mm.h ../include/linux/kernel.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h
mmap.o : mmap.c ../include/sys/stat.h ../include/sys/types.h ../include/linux/sched.h \
../include/linux/head.h ../include/linux/fs.h ../include/sys/dirent.h ../include/limits.h \
../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h ../include/asm/segment.h \
../include/asm/system.h ../include/errno.h ../include/sys/mman.h
swap.o : swap.c ../include/errno.h ../include/sys/stat.h ../include/sys/types.h \
../include/linux/mm.h ../include/linux/fs.h ../include/sys/dirent.h ../include/limits.h \
../include/linux/kernel.h ../include/signal.h ../include/linux/string.h ../include/linux/sched.h \
../include/linux/head.h ../include/sys/param.h ../include/sys/time.h ../include/time.h \
../include/sys/resource.h
../include/limits.h ../include/sys/vfs.h ../include/linux/mm.h ../include/linux/kernel.h \
../include/sys/param.h ../include/sys/time.h ../include/time.h ../include/sys/resource.h
mmap.o : mmap.c ../include/linux/stat.h ../include/linux/sched.h ../include/linux/head.h \
../include/linux/fs.h ../include/sys/types.h ../include/sys/dirent.h ../include/limits.h \
../include/sys/vfs.h ../include/linux/mm.h ../include/linux/kernel.h ../include/signal.h \
../include/sys/param.h ../include/sys/time.h ../include/time.h ../include/sys/resource.h \
../include/asm/segment.h ../include/asm/system.h ../include/errno.h ../include/sys/mman.h
swap.o : swap.c ../include/errno.h ../include/linux/stat.h ../include/linux/mm.h \
../include/linux/fs.h ../include/sys/types.h ../include/sys/dirent.h ../include/limits.h \
../include/sys/vfs.h ../include/linux/kernel.h ../include/signal.h ../include/linux/string.h \
../include/linux/sched.h ../include/linux/head.h ../include/sys/param.h ../include/sys/time.h \
../include/time.h ../include/sys/resource.h
......@@ -565,7 +565,7 @@ static int share_page(struct inode * inode, unsigned long address)
struct task_struct ** p;
int i;
if (inode->i_count < 2 || !inode)
if (!inode || inode->i_count < 2)
return 0;
for (p = &LAST_TASK ; p > &FIRST_TASK ; --p) {
if (!*p)
......
......@@ -39,13 +39,14 @@ dep:
### Dependencies:
socket.o : socket.c ../include/signal.h ../include/sys/types.h ../include/errno.h \
../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h ../include/sys/dirent.h \
../include/limits.h ../include/linux/mm.h ../include/linux/kernel.h ../include/sys/param.h \
../include/sys/time.h ../include/time.h ../include/sys/resource.h ../include/asm/system.h \
../include/asm/segment.h ../include/sys/socket.h ../include/sys/stat.h ../include/fcntl.h \
../include/termios.h kern_sock.h socketcall.h
../include/limits.h ../include/sys/vfs.h ../include/linux/mm.h ../include/linux/kernel.h \
../include/sys/param.h ../include/sys/time.h ../include/time.h ../include/sys/resource.h \
../include/linux/stat.h ../include/asm/system.h ../include/asm/segment.h ../include/sys/socket.h \
../include/fcntl.h ../include/termios.h kern_sock.h socketcall.h
unix.o : unix.c ../include/signal.h ../include/sys/types.h ../include/errno.h \
../include/linux/string.h ../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h \
../include/sys/dirent.h ../include/limits.h ../include/linux/mm.h ../include/linux/kernel.h \
../include/sys/param.h ../include/sys/time.h ../include/time.h ../include/sys/resource.h \
../include/asm/system.h ../include/asm/segment.h ../include/sys/socket.h ../include/sys/un.h \
../include/sys/stat.h ../include/fcntl.h ../include/termios.h kern_sock.h
../include/sys/dirent.h ../include/limits.h ../include/sys/vfs.h ../include/linux/mm.h \
../include/linux/kernel.h ../include/sys/param.h ../include/sys/time.h ../include/time.h \
../include/sys/resource.h ../include/linux/stat.h ../include/asm/system.h ../include/asm/segment.h \
../include/sys/socket.h ../include/sys/un.h ../include/fcntl.h ../include/termios.h \
kern_sock.h
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment