Changes for 1.1.8
This commit is contained in:
parent
6f6478031e
commit
ffc4f8892a
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
Fri Apr 22 11:10:18 BST 1994
|
||||
|
||||
* Updated the 1.1 kernel patch to be against 1.1.8. It won't
|
||||
work with anything less than 1.1.8 but then if you are
|
||||
playing with 1.1 you should be playing with the latest...
|
||||
This involves a change in the way sysfs() works. If you
|
||||
are using 1.0 and have applications that call sysfs()
|
||||
(practically none do) then you need to build with sysfs.c.old.
|
||||
-- Mike
|
||||
|
||||
* The Linux kernel 1.1.8 replaces the static file_systems
|
||||
table with a linked list ready for loadable file systems.
|
||||
Naturally, I was ready for this... :-(
|
||||
-- Mike
|
||||
|
||||
|
||||
Thu Apr 21 10:34:34 BST 1994
|
||||
|
||||
* sysfs.c should be including linux/string.h to get the
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
Patches to 1.1 to add support for the iBCS emulator.
|
||||
Patches to 1.1.8 to add support for the iBCS emulator.
|
||||
|
||||
These patches are largely the same as the 1.0 patches except for the
|
||||
change to ksyms. All should apply cleanly (but with fuzz in some cases)
|
||||
however the ksyms.c patch is against 1.1.2. Given the changes to ksyms
|
||||
over the range we are covering you shouldn't be surprised if this has
|
||||
to be edited in by hand. Sorry.
|
||||
These patches are largely the same as the 1.0 patches. All should apply
|
||||
cleanly (but with fuzz in some cases) but don't be surprised if you
|
||||
have to hand edit some things if you apply them to a kernel later
|
||||
than 1.1.8. If you are about to apply them to a kernel less than 1.1.8
|
||||
then *don't*. They won't apply cleanly and it may not be obvious what
|
||||
to do. Besides the 1.1 kernel is the alpha developers' version. If you
|
||||
are using it you should keep it up to date as critical bugs are likely
|
||||
to come and go regularly.
|
||||
|
||||
This moves the iBCS stuff clear of the standard kernel but allows the
|
||||
iBCS module to be loaded by a standard kernel.
|
||||
|
@ -267,32 +270,26 @@ diff -u linux/ibcs/emulate.c:1.1.1.1 linux/ibcs/emulate.c:1.1.1.1.8.1
|
|||
diff -u -r1.1 linux/kernel/ksyms.c
|
||||
--- 1.1 1994/04/08 08:48:00
|
||||
+++ linux/kernel/ksyms.c 1994/04/08 11:39:19
|
||||
@@ -8,18 +8,53 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/fs.h>
|
||||
@@ -10,6 +10,13 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/malloc.h>
|
||||
+#include <linux/binfmts.h>
|
||||
+#include <linux/mm.h>
|
||||
+#include <linux/malloc.h>
|
||||
+#include <linux/ptrace.h>
|
||||
+#include <linux/sched.h>
|
||||
+#include <linux/string.h>
|
||||
+#include <linux/sockfunc.h>
|
||||
+#include <linux/sys.h>
|
||||
+#include <linux/utsname.h>
|
||||
|
||||
-#define X(name) { (void *) &name, "_" #name }
|
||||
+
|
||||
+extern void *sys_call_table;
|
||||
|
||||
+#define X(name) { (void *) &name, "_" #name }
|
||||
+
|
||||
#ifdef CONFIG_FTAPE
|
||||
extern char * ftape_big_buffer;
|
||||
#define X(name) { (void *) &name, "_" #name }
|
||||
|
||||
@@ -18,10 +25,29 @@
|
||||
extern void (*do_floppy)(void);
|
||||
#endif
|
||||
|
||||
+#ifndef CONFIG_BINFMT_IBCS
|
||||
+extern struct file_system_type file_systems[];
|
||||
+extern struct file_system_type *file_systems;
|
||||
+
|
||||
+extern int do_execve(char * filename, char ** argv, char ** envp,
|
||||
+ struct pt_regs * regs);
|
||||
|
@ -314,23 +311,13 @@ diff -u -r1.1 linux/kernel/ksyms.c
|
|||
} symbol_table[] = {
|
||||
+ X(EISA_bus),
|
||||
+
|
||||
+ X(__get_free_pages),
|
||||
+ X(free_pages),
|
||||
+ X(kmalloc),
|
||||
+ X(kfree_s),
|
||||
+
|
||||
X(register_chrdev),
|
||||
X(unregister_chrdev),
|
||||
X(register_blkdev),
|
||||
@@ -34,12 +69,73 @@
|
||||
X(printk),
|
||||
X(schedule),
|
||||
/* process memory management */
|
||||
X(wp_works_ok),
|
||||
X(__verify_write),
|
||||
@@ -67,10 +93,62 @@
|
||||
X(sprintf),
|
||||
X(vsprintf),
|
||||
|
||||
+ X(getname),
|
||||
+ X(putname),
|
||||
+ X(sprintf),
|
||||
+ X(strcmp),
|
||||
+ X(strcpy),
|
||||
+ X(system_utsname),
|
||||
+
|
||||
+ X(sys_call_table),
|
||||
|
@ -339,8 +326,7 @@ diff -u -r1.1 linux/kernel/ksyms.c
|
|||
/* The next labels are needed for ftape driver. */
|
||||
X(ftape_big_buffer),
|
||||
X(do_floppy),
|
||||
#endif
|
||||
|
||||
+#endif
|
||||
+
|
||||
+#ifndef CONFIG_BINFMT_IBCS
|
||||
+/*
|
||||
|
@ -361,7 +347,6 @@ diff -u -r1.1 linux/kernel/ksyms.c
|
|||
+ X(copy_strings),
|
||||
+ X(create_tables),
|
||||
+ X(do_execve),
|
||||
+ X(do_mmap),
|
||||
+ X(flush_old_exec),
|
||||
+ X(formats),
|
||||
+ X(insert_vm_struct),
|
||||
|
@ -371,9 +356,6 @@ diff -u -r1.1 linux/kernel/ksyms.c
|
|||
+
|
||||
+ /* Miscellaneous access points */
|
||||
+ X(file_systems),
|
||||
+ X(iput),
|
||||
+ X(lnamei),
|
||||
+ X(namei),
|
||||
+ X(si_meminfo),
|
||||
+
|
||||
+ /* Functions from the net layers which need to be referenced
|
||||
|
@ -392,11 +374,9 @@ diff -u -r1.1 linux/kernel/ksyms.c
|
|||
+ X(sock_setsockopt),
|
||||
+ X(sock_socket),
|
||||
+ X(sock_connect),
|
||||
+#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
int symbol_table_size = sizeof (symbol_table) / sizeof (symbol_table[0]);
|
||||
|
||||
|
||||
=============================================================================
|
||||
|
||||
|
@ -787,6 +767,27 @@ diff -u linux/kernel/signal.c:1.1.1.1 linux/kernel/signal.c:1.1.1.1.8.1
|
|||
put_fs_long(regs->es, frame+4);
|
||||
|
||||
|
||||
=============================================================================
|
||||
|
||||
The table of file systems is now a list in 1.1.8 but the pointer
|
||||
to the head of the list needs to be global not static.
|
||||
|
||||
============================================================================
|
||||
|
||||
diff -u -r1.1.1.1.14.1 linux/fs/super.c
|
||||
--- 1.1.1.1.14.1 1994/04/22 09:27:52
|
||||
+++ linux/fs/super.c 1994/04/22 11:06:03
|
||||
@@ -35,7 +35,7 @@
|
||||
/* this is initialized in init/main.c */
|
||||
dev_t ROOT_DEV = 0;
|
||||
|
||||
-static struct file_system_type * file_systems = NULL;
|
||||
+struct file_system_type * file_systems = NULL;
|
||||
|
||||
int register_filesystem(struct file_system_type * fs)
|
||||
{
|
||||
|
||||
|
||||
|
||||
That's all, folks!
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
|
||||
*
|
||||
* $Id: sysfs.c,v 1.3 1994/04/21 10:49:19 mike Exp $
|
||||
* $Id: sysfs.c,v 1.4 1994/04/22 11:24:17 mike Exp $
|
||||
* $Source: /nfs4/sophia/home/mjagdis/src/ibcs.cvs/ibcs/iBCSemul/sysfs.c,v $
|
||||
*/
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
|||
#include <asm/system.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/sys.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#include <ibcs/ibcs.h>
|
||||
|
||||
|
@ -32,12 +31,8 @@
|
|||
#endif
|
||||
|
||||
|
||||
/* Declared in linux/fs/filesystems.c.
|
||||
* We rely on the table of filesystems being statically allocate as an
|
||||
* array at compile time. When (and if) we go to a modular system we will
|
||||
* have to change this code appropriately.
|
||||
*/
|
||||
extern struct file_system_type file_systems[];
|
||||
/* Declared in linux/fs/super.c. */
|
||||
extern struct file_system_type *file_systems;
|
||||
|
||||
|
||||
#define GETFSIND 1
|
||||
|
@ -61,7 +56,7 @@ int ibcs_sysfs(struct pt_regs * regs) {
|
|||
if (error)
|
||||
return (error);
|
||||
n_fs = 1;
|
||||
for (fs=file_systems; fs->name; fs++,n_fs++)
|
||||
for (fs=file_systems; fs; fs=fs->next,n_fs++)
|
||||
if (!strcmp(fs->name, kfsname)) {
|
||||
putname(kfsname);
|
||||
return (n_fs);
|
||||
|
@ -71,7 +66,7 @@ int ibcs_sysfs(struct pt_regs * regs) {
|
|||
}
|
||||
|
||||
n_fs = 0;
|
||||
for (fs=file_systems; fs->name; fs++,n_fs++);
|
||||
for (fs=file_systems; fs; fs=fs->next,n_fs++);
|
||||
|
||||
if (cmd == GETNFSTYP) {
|
||||
return (n_fs);
|
||||
|
@ -83,18 +78,21 @@ int ibcs_sysfs(struct pt_regs * regs) {
|
|||
char *p;
|
||||
|
||||
fs_ind = get_fs_long(((unsigned long *) regs->esp) + 2) - 1;
|
||||
if (fs_ind < 0 || fs_ind >= n_fs
|
||||
|| !file_systems[fs_ind].name)
|
||||
if (fs_ind < 0 || fs_ind >= n_fs)
|
||||
return (-EINVAL);
|
||||
|
||||
for (fs=file_systems; fs_ind && fs; fs=fs->next,fs_ind--);
|
||||
if (!fs)
|
||||
return (-EINVAL);
|
||||
|
||||
p = fs->name;
|
||||
|
||||
buf = (char *)get_fs_long(((unsigned long *) regs->esp) + 3);
|
||||
|
||||
error = verify_area(VERIFY_WRITE, buf,
|
||||
strlen(file_systems[fs_ind].name));
|
||||
error = verify_area(VERIFY_WRITE, buf, strlen(fs->name));
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
p = file_systems[fs_ind].name;
|
||||
do {
|
||||
put_fs_byte(*p, buf++);
|
||||
} while (*p++);
|
||||
|
|
112
sysfs.c.old
Normal file
112
sysfs.c.old
Normal file
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
* linux/ibcs/sysfs.c
|
||||
*
|
||||
* Copyright (C) 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
|
||||
*
|
||||
* $Id: sysfs.c.old,v 1.1 1994/04/22 11:24:17 mike Exp $
|
||||
* $Source: /nfs4/sophia/home/mjagdis/src/ibcs.cvs/ibcs/Attic/sysfs.c.old,v $
|
||||
*/
|
||||
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/segment.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/config.h>
|
||||
#include <linux/fcntl.h>
|
||||
|
||||
#include <asm/segment.h>
|
||||
#include <asm/system.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/sys.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#include <ibcs/ibcs.h>
|
||||
|
||||
#ifdef IBCS_TRACE
|
||||
#include <ibcs/trace.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Declared in linux/fs/filesystems.c.
|
||||
* We rely on the table of filesystems being statically allocate as an
|
||||
* array at compile time. When (and if) we go to a modular system we will
|
||||
* have to change this code appropriately.
|
||||
*/
|
||||
extern struct file_system_type file_systems[];
|
||||
|
||||
|
||||
#define GETFSIND 1
|
||||
#define GETFSTYP 2
|
||||
#define GETNFSTYP 3
|
||||
|
||||
|
||||
int ibcs_sysfs(struct pt_regs * regs) {
|
||||
int cmd;
|
||||
struct file_system_type *fs;
|
||||
int error;
|
||||
int n_fs;
|
||||
|
||||
cmd = get_fs_long(((unsigned long *) regs->esp) + 1);
|
||||
|
||||
if (cmd == GETFSIND) {
|
||||
char *fsname, *kfsname;
|
||||
|
||||
fsname = (char *)get_fs_long(((unsigned long *) regs->esp) + 2);
|
||||
error = getname(fsname, &kfsname);
|
||||
if (error)
|
||||
return (error);
|
||||
n_fs = 1;
|
||||
for (fs=file_systems; fs->name; fs++,n_fs++)
|
||||
if (!strcmp(fs->name, kfsname)) {
|
||||
putname(kfsname);
|
||||
return (n_fs);
|
||||
}
|
||||
putname(kfsname);
|
||||
return (-EINVAL);
|
||||
}
|
||||
|
||||
n_fs = 0;
|
||||
for (fs=file_systems; fs->name; fs++,n_fs++);
|
||||
|
||||
if (cmd == GETNFSTYP) {
|
||||
return (n_fs);
|
||||
}
|
||||
|
||||
if (cmd == GETFSTYP) {
|
||||
int fs_ind;
|
||||
char *buf;
|
||||
char *p;
|
||||
|
||||
fs_ind = get_fs_long(((unsigned long *) regs->esp) + 2) - 1;
|
||||
if (fs_ind < 0 || fs_ind >= n_fs
|
||||
|| !file_systems[fs_ind].name)
|
||||
return (-EINVAL);
|
||||
|
||||
buf = (char *)get_fs_long(((unsigned long *) regs->esp) + 3);
|
||||
|
||||
error = verify_area(VERIFY_WRITE, buf,
|
||||
strlen(file_systems[fs_ind].name));
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
p = file_systems[fs_ind].name;
|
||||
do {
|
||||
put_fs_byte(*p, buf++);
|
||||
} while (*p++);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef IBCS_TRACE
|
||||
if ((ibcs_trace & TRACE_API) || ibcs_func_p->trace) {
|
||||
printk(KERN_DEBUG "iBCS2 unsupported sysfs call %d\n", cmd);
|
||||
}
|
||||
#endif
|
||||
|
||||
return -EINVAL;
|
||||
}
|
Loading…
Reference in a new issue