shutdown message

I looked in sys/procmsg.h and such, could not find the
shutdown message. Could someone be kind enough to share
the message type and structure to send to proc.

TIA,
Tom

Mritunjai wrote:
ill the younger ones first!

For rebooting after doing the fore-mentioned things, you call
sysmgr_reboot() to reboot the system (which in turn probably calls real mode
interrupt 19h iirc)

Well I’ll be, there’s actually an API call for it. This sort of thing
could spoil a guy…

Rennie

Anyone?

Surely the shutdown message to proc can’t be a secret?

regards,
Tom

Hi Thomas

hope this helps

from lib/c/services/sysmgr_reboot.c

#include <unistd.h>
#include <errno.h>
#include <sys/neutrino.h>
#include <sys/sysmsg.h>

int sysmgr_reboot(void) {
sys_cmd_t msg;

msg.i.type = _SYS_CMD;
msg.i.cmd = _SYS_CMD_REBOOT;

return MsgSendnc(SYSMGR_COID, &msg.i, sizeof msg.i, 0, 0);
}

To shutdown the system there isn’t really a call. You just kill off
the processes (by sending SIGPWR) and then while(1) { do_nothing(); }.

Be careful, the order of killing the processes is critical. You should
actually kill childs first and then the parents and then among siblings
kill the younger ones first!

For rebooting after doing the fore-mentioned things, you call
sysmgr_reboot() to reboot the system (which in turn probably calls real mode
interrupt 19h iirc)


Keep Smiling
Regards

  • mritunjai

http://www.me.iitb.ac.in/~mritun
http://mritun.qnx.org.ru
http://www.qnxzone.com/~mritun