Messages in this thread | | | From | "Alexander Maryanchick" <> | Subject | "Interceptors" patch: I need help in porting. | Date | Tue, 22 Jun 1999 13:13:34 +0400 |
| |
Hi, I am now testing an "Interceptors" patch - i386 processor only :-(. It provides the two functions:
enum handler_type { HT_CHRDEV, HT_BLKDEV, HT_BLK_REQUEST, HT_SYSCALL, HT_FS, ... };
prev = register_interceptor( handler, type ); unregister_interceptor( handler, type );
i.e., provides _SAFE_ way to intercept device requests, syscalls, etc.
goals: - simple STREAMS replacement (with almost ZERO perfomance fee) - compressed, encrypted, ... drives, antivirus modules, etc. - many existing external patches may now be distributed as modules.
state: character device interceptors - testing block device interceptors - almost ready syscall interceptors - in progress FS and other possible types - stalled
I have some problems with portability:
1) Can anybody please help me to port the following code to non-i386 processors: /* include/asm-i386/snap.h */
#define SNAPPED_JMP_2P/* "jmp to double pointer" */ \ 0xB8, 0, 0, 0, 0, /* mov eax, ... */ \ 0xFF, 0x20 /* jmp [eax] */ #define SNAPPED_JMP_2P_SIZE 7 #define SNAPPED_JMP_2P_OPERAND 1
/* create "goto *pfunc" instruction in the buffer "dest" */ static void create_redir( char *dest, func_t **func ) { static char redir0[] = { SNAPPED_REDIR }; memcpy( dest, redir0, SNAPPED_REDIR_SIZE ); *((func_t***) (dest + SNAPPED_REDIR_OPERAND)) = func; }
2) Is the following code portable for Linux kernel? /* macros for scanning struct file_operation */ #define count_of_pointers(struc) sizeof(struc)/sizeof(func_t*) #define get_fop(fops,i) ((func_t**)fops)[i]
Thank you.
Best regards. Alexander.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |