Apr 01, 2010 until this it worked fine. Then i wanted to add a second system call which will change the value of myglobal at os run time. I followed the same procedure with the firs one. I have put the.c files in the same directory. And modified makefile to - added the line: obj - y:=setmyglobal.o- anyway it gave me some errors, then i thought that i am making mistakes about defining global variables. Nov 20, 2010 - 解压自:xv6-rev0.tar.gz swish@Ubuntu:/Desktop/xv6$ make gcc -O -nostdinc -I.c bootmain.c gcc. Gcc -fno-builtin -O2 -Wall -MD -c -o syscall.o syscall.c. Printf.c:(.text+0xda): undefined reference to `stackchkfail'.
I'm trying to import new system call in the kernel 3.19. I've followed the tutorial given here!
This is my simple code to implement factorial calculation via system call.
I'm getting Undefined reference to sys_fact error when I try to compile the C code.The program in which I'm using this system call is as follows.
Output when tried to compile above code using gcc -v -c fact.c
My system is 64 bit ubuntu 14.04 and I've followed above mentioned tutorial according to my system.
Also, I've combined following commands while installing kernel, and I think this is the reason it did not gave error while installation of kernel.
Kernel installation took 2-3 hours, and I'm frustrated now.Please help!!
Palash Karmore
Palash KarmorePalash Karmore
Browse other questions tagged kernelc or ask your own question.
####xv6 setup - for a fresh copy
tar xvzf ~cs537-1/ta/xv6/xv6.tar.gz
make
to build the kernelssh -l nirmohi -X galapagos-24.cs.wisc.edu
to log into the same machine from another terminal so as to be able to kill the qemu emulatormake qemu-nox
to start the emulatorkillall qemu
to kill it from the second windowscp -r [email protected]:/u/n/i/nirmohi/private/P2/xv6 /Users/nirmohidevasthale/Desktop/Operating-Systems/P2
because i always need to look this up
####Testing
- make a testinggetprocs.c in the user folder
- add it to the
user/makefile.mk
in the list of userprogs - then
make
make qemu-nox
- then run the binary
testinggetprocs
- should get desired output
####User Side and & include
user/usys.S
add the system call likeSYSCALL(getprocs)
user/user.h
add function declaration likeint getprocs(void);
include/syscall.h
: #define the call like#define SYS_getprocs 22
####Kernel Side
kernel/sysfunc.h
add func declaration on kernel sideint sys_getprocs(void);
kernel/syscall.c
add to array of function pointers to handlers for all the syscalls like[SYS_getprocs] sys_getprocs
- I wrote the get procs function in
kernel/proc.c
. Can be written using header file inkernel/sysproc.c
- my version -