Sponsored Content
Operating Systems Linux Red Hat Adding our system call Fedora 18 -new syscall Post 302796925 by googz on Sunday 21st of April 2013 04:51:24 PM
Old 04-21-2013
If i have 64 btis system then i have still to edit this file: "unistd_32.h"?

---------- Post updated at 03:51 PM ---------- Previous update was at 10:35 AM ----------

I must add syscall in Fedora 18 kernel 3.8.2 32 or 64. I take 32 on virtual box.
First i tried this:

"
  • Upzip it with command ‘tar xvfj XXX” to a folder For example : /root/kernel tar xvfj linux-3.3.1.tar.bz2
  • Edit file “/root/kernel/linux-3.3.1/arch/x86/syscalls/syscall_64.tbl” Add new line
312 64 husky1 sys_husky1
  • Eidt file “/root/kernel/linux-3.3.1/include/linux/syscalls.h” Add new function declaration
asmlinkage long sys_husky1(int fd);
before the line “#endif”
  • Add a new c file under “/root/kernel/linux-3.3.1/arch/x86/kernel” (I am using x86 CPU) Example :
  • Edit “/root/kernel/linux-3.3.1/arch/x86/kernel/Makefile” Add a new line “obj-y += husky.o”
  • goto /root/kernel/linux-3.3.1 folder and run command “make –j8” "


but after make menuconfig
and then make
I got this warning: "warning: function declaration isn't a prototype"


this is my demosys.c file:


Code:
#include <linux/linkage.h> 
#include <linux/kernel.h>  
asmlinkage long sys_democall()
 {     
                        printk ("Hello world\n");   
  
                        return 0; 
}

and this is my declaration in linux-3.8.2/include/linux/syscalls.h
Code:
asmlinkage long sys_democall(void);

and linux-3.3.1/arch/x86/syscalls/syscall_32.tbl
351 i386 democall sys_democall


Is this method good to add system call?
Did this erorr interferes with something?
after end of compilation my syscall will work?
 

6 More Discussions You Might Find Interesting

1. Red Hat

Fedora - A confiusing operating system!!

I don't know why all these complicated stuff?! I have Fedora Core 3 installed on my Laptop. It has the apache 2.0 + php 4.3.0 installed on it. But for some reasons I need to remove them and install everything by myself. However, I don't see any way to remove a software from this silly oprating... (9 Replies)
Discussion started by: HSN
9 Replies

2. Shell Programming and Scripting

solaris and fedora core in one system

How can I keep Solaris 10 GA with Fedora core 3 in the same system.I have got IBM Netvista system with 40 gb hdd ,128mb ram,pentium 4 1.66 gb processor.Pls tell me in detail,otherwise provide me good Url. :) :eek: :confused: (1 Reply)
Discussion started by: xinubhaskar
1 Replies

3. UNIX for Advanced & Expert Users

solaris and fedora core in one system

How can I keep Solaris 10 GA and Fedora Core 3 In the same machine.I have got IBM netvista machine,with 40 gb hdd and 128 mb ram and 1.6 gzh pentium processor.Give me the step in detail.How do I pertition?How can I boot up both? :( :eek: :confused: (2 Replies)
Discussion started by: xinubhaskar
2 Replies

4. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

5. Programming

Adding custom ("Hello") system call: help

I'm trying to add a custom ("Hello world" :o) system call. In /usr/src/linux/hello/ I put simple hello.c ...#include "linux/linkage.h" // for linking a system call #include "linux/kernel.h" // for "printk" asmlinkage int sys_hello() { printk(KERN_ALERT "Hello!"); return 1; }... and in... (5 Replies)
Discussion started by: courteous
5 Replies

6. Emergency UNIX and Linux Support

Bad Address when adding system call

Hi guys. I have downloaded kernel 2.6.38-5 to add a system call. I did the following steps: 1. I have added my system call to system call table <src folder>/arc/x86/kernel/syscall_table_32.S .long sys_mycall 2. i have added the system cal number in <src... (5 Replies)
Discussion started by: majid.merkava
5 Replies
RAGG2(1)						    BSD General Commands Manual 						  RAGG2(1)

NAME
ragg2 -- radare2 utility to run programs in exotic environments SYNOPSIS
ragg2 [-a arch] [-b bits] [-k kernel] [-f format] [-o file] [-i shellcode] [-I path] [-e encoder] [-B hexpairs] [-c k=v] [-C file] [-d off:dword] [-D off:qword] [-w off:hexpair] [-p padding] [-FOLsrxvh] DESCRIPTION
ragg2 is a frontend for r_egg, compile programs into tiny binaries for x86-32/64 and arm. This tool is experimental and it is a rewrite of the old rarc2 and rarc2-tool programs as a library and integrated with r_asm and r_bin. Programs generated by r_egg are relocatable and can be injected in a running process or on-disk binary file. ragg2-cc is another tool that comes with r2 and it is used to generate shellcodes from C code. The final code can be linked with rabin2 and it is relocatable, so it can be used to inject it on any remote process. ragg2-cc is conceptually based on shellforge4, but only linux/osx x86-32/64 platforms are supported. DIRECTIVES
The rr2 (ragg2) configuration file accepts the following directives, described as key=value entries and comments defined as lines starting with '#'. -a arch set architecture x86, arm -b bits 32 or 64 -k kernel windows, linux or osx -f format select binary format (pe, elf, mach0) -o file output file to write result of compilation -i shellcode specify shellcode name to be used (see -L) -e encoder specify encoder name to be used (see -L) -B hexpair specify shellcode as hexpairs -c k=v set configure option for the shellcode encoder. The argument must be key=value. -C file include contents of file -d off:dword Patch final buffer with given dword at specified offset -D off:qword Patch final buffer with given qword at specified offset -w off:hexpairs Patch final buffer with given hexpairs at specified offset -p padding Specify generic paddings with a format string. -F autodetect native file format (osx=mach0, linux=elf, ..) -O use default output file (filename without extension or a.out) -I path add include path -s show assembler code -x execute (just-in-time) EXAMPLE
$ cat hi.r /* hello world in r_egg */ write@syscall(4); exit@syscall(1); main@global(128) { .var0 = "hi!0; write(1,.var0, 4); exit(0); } $ ragg2 -O -F hi.r $ ./hi hi! $ cat hi.c main() { write(1, "Hello0, 6); exit(0); } $ ragg2 hi.c $ ./hi.c.bin Hello SEE ALSO
radare2(1), rahash2(1), rafind2(1), rabin2(1), rafind2(1), ranal2(1), radiff2(1), rasm2(1), AUTHORS
pancake <pancake@nopcode.org> BSD
Oct 11, 2011 BSD
All times are GMT -4. The time now is 10:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy