Problems with DriverProgramming - the service is in loop

111 views
Skip to first unread message

Alessandro Teixeira

unread,
May 10, 2015, 9:44:01 AM5/10/15
to min...@googlegroups.com
Hi All,

I tried to make the hello.c, following the link:

but I create new folder and new file called hellosan at /usr/src/minix/drivers/examples

>>>> My Makefile:
# Makefile for the hello driver.
PROG=   hellosan
SRCS=   hellosan.c
 
DPADD+= ${LIBCHARDRIVER} ${LIBSYS}
LDADD+= -lchardriver -lsys
 
MAN=
 
.include <minix.service.mk>

>>>> My hellosan.c
#include <stdio.h>
#include <stdlib.h>
#include <minix/syslib.h>
 
int main(int argc, char **argv)
{
    sef_startup();
 
    printf("Hello San C Cool!!!");
    return EXIT_SUCCESS;
}

I run make clean, make, make install and No errors happpened.

>>>> I Configured /etc/system.conf:
service hellosan
{
        system
                UMAP            # 14
                IRQCTL          # 19
                DEVIO           # 21
        ;
        ipc
                SYSTEM PM RS LOG TTY DS VM VFS
                pci inet amddev
                ;
    uid 0;
};

When I execute the service up /service/hellosan, the message print in loop and I cannot stop the process,

I need to restart my VirtualBox.

Anyone help me, please!

Regards,

Alessandro

David van Moolenbroek

unread,
May 28, 2015, 9:46:59 AM5/28/15
to min...@googlegroups.com, alessandr...@gmail.com
Hello,


On Sunday, May 10, 2015 at 3:44:01 PM UTC+2, Alessandro Teixeira wrote:
When I execute the service up /service/hellosan, the message print in loop and I cannot stop the process,

In short, the problem is that your driver is terminating immediately. This causes the Reincarnation Server (RS) to think that something when wrong, and restart the driver - over and over again. Normally, a driver will have a message loop (e.g., the one implemented in chardriver_task), so that it will continue to run until it is shut down explicitly. Alternatively, if you really want your driver to run once, you can add the following parameter to your "service up" command: "-script /etc/rs.single" (see "man service" for details).

Regards,
David
Reply all
Reply to author
Forward
0 new messages