I am trying to create a new system call in Minix 3.3. At first i just want to create simple printmsg() call that will write "Hello World" on screen.
I looked various tutorials on internet and still couldn't find out solution.
I defined my sys call number in callnr.h like this
#define PM_PRINTMSG (PM BASE + 48)
and i increased number of sys calls#define NR_PM_CALLS 49
.In table.c I added
CALL(PM_PRINTMSG) = doprintmsg
.In proto.h I described function prototype `int do_printmsg(void);
Function implementation is written in misc.c. I added
#include <stdio.h>
and made Hello World functionint do printmsg(){ printf("I am a system call"); return 0; }
When I test my system call in user program _syscall(PM_PROC_NR, PM_PRINTMSG, &m);
I don't get any errors but no printf is displayed.
So, is it possible to printf messages from system calls since i had to add <stdio.h>
myself in misc.c or i missed some steps. I forgot to mention that i go in /usr/src/releasetools and type make services
and make install
respectively to recompile kernel.