printf("\033[K\007\033[7;7m\033[5;5m SYSMON: \033[0;0m No privilege for attempted operation ! errno=%d \n",passerror);
if(logindi)
fprintf(lpp,"\033[K\007\033[7;7m\033[5;5m SYSMON: \033[0;0m No privilege for attempted operation ! errno=%d \n",passerror);
error_indi=TRUE;
}
else
{
gotoxy(1,23);
printf("\033[K\007\033[7;7m\033[5;5m SYSMON-ERROR: \033[0;0m No passwordfile found, can't switch to NAME-mode !\n");
if(logindi)
fprintf(lpp,"\033[K\007\033[7;7m\033[5;5m SYSMON-ERROR: \033[0;0m No passwordfile found, can't switch to NAME-mode !\n");
error_indi=TRUE;
}
}
}
goto Goon;
}
if(io_buff[0]=='H')
{
cursoroff();
error_indi=FALSE;
retstr=show_version();
if(!retstr)
{
retstr=inkey(0,"\033[7;7m Press any key or 'Q' for previous screen \033[0;0m");
if(!retstr)
{
helpuser();
retstr=inkey(0,
"\033[7;7m Press any key to continue ... \033[0;0m");
}
}
effect();
cls();
if(!mode_flag)
display_frame();
else
display_dframe();
goto Goon;
}
if(io_buff[0]=='X')
{
if(privileg) /* is user privileged ? */
{
if(reset_flag) /* reset allowed from source ? */
{
kha=checkadr(0x4); /* adress resetvector of CPU ! */
if(!kha)
{
retstr=inkey(15,"\033[K\007\033[7;7m\033[1;1m\033[5;5m WARNING: \033[0;0m THE SYSTEM WILL BE RESETTED ! \033[1;1m\033[5;5m ARE YOU SURE [Y/N] ???\033[0;0m\n");
switch(retstr)
{
case TRUE:
cls();
cursoron();
tsleep(10);
reseter();
switch_ctrl(RESTORE);
if(strncmp(portnam,"PKS",3)==0)
sleep(2);
exit(0);
break;
case TIMEOUT:
gotoxy(1,23);
printf("%s",timeoutstr);
if(logindi)
fprintf(lpp,"%s",timeoutstr);
error_indi=TRUE;
break;
default:
gotoxy(1,23);
printf("\033[K\n");
if(logindi)
fprintf(lpp,"\033[K\n");
error_indi=TRUE;
ret_disp=100;
break;
}
}
else
{
retstr=Permit(0,4096,3);
if(retstr==-1)
{
gotoxy(1,23);
printf("%s\n",mmu_errstr);
if(logindi)
fprintf(lpp,"%s",mmu_errstr);
error_indi=TRUE;
}
else
{
kha=checkadr(0x4); /* adress resetvector of CPU ! */
if(!kha)
{
retstr=inkey(15,"\033[K\007\033[7;7m\033[1;1m\033[5;5m WARNING: \033[0;0m THE MMU-SYSTEM WILL BE RESETTED ! \033[1;1m\033[5;5m ARE YOU SURE [Y/N] ???\033[0;0m\n");
switch(retstr)
{
case TRUE:
cls();
cursoron();
tsleep(10);
reseter();
switch_ctrl(RESTORE);
if(strncmp(portnam,"PKS",3)==0)
sleep(2);
exit(0);
break;
case TIMEOUT:
if(Protect(0,4096)!=0)
{
kha=errno;
cls();
cursoron();
tmode(0,1);
if(logindi)
{
fclose(lpp);
logindi=FALSE;
}
switch_ctrl(RESTORE);
if(strncmp(portnam,"PKS",3)==0)
sleep(2);
exit(kha);
}
gotoxy(1,23);
printf("%s",timeoutstr);
if(logindi)
fprintf(lpp,"%s",timeoutstr);
error_indi=TRUE;
break;
default:
if(Protect(0,4096)!=0)
{
kha=errno;
cls();
cursoron();
tmode(0,1);
if(logindi)
{
fclose(lpp);
logindi=FALSE;
}
switch_ctrl(RESTORE);
if(strncmp(portnam,"PKS",3)==0)
sleep(2);
exit(kha);
}
gotoxy(1,23);
printf("\033[K\n");
if(logindi)
fprintf(lpp,"\033[K\n");
error_indi=TRUE;
ret_disp=100;
break;
}
}
else
{
gotoxy(1,23);
printf("%s\n",mmu_errstr);
if(logindi)
fprintf(lpp,"%s\n",mmu_errstr);
error_indi=TRUE;
if(Protect(0,4096)!=0)
{
kha=errno;
cursoron();
tmode(0,1);
if(logindi)
{
fclose(lpp);
logindi=FALSE;
}
switch_ctrl(RESTORE);
if(strncmp(portnam,"PKS",3)==0)
sleep(2);
exit(kha);
}
}
}
}
}
else
{
gotoxy(1,23);
printf(
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m No privilege for attempted operation from this source ! errno=164 \n");
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m No privilege for attempted operation from this source ! errno=164 \n");
error_indi=TRUE;
}
}
else
{
gotoxy(1,23);
printf(
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m No privilege for attempted operation ! errno=164 \n");
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m No privilege for attempted operation ! errno=164 \n");
error_indi=TRUE;
}
goto Goon;
}
if(io_buff[0]=='L')
{
if(privileg)
{
momage=_getsys(D_MinPty,2);
if(momage>0)
{
if(suspendcount>0)
sprintf(messagebuf,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m ALL %d SUSPENDED PROCESSES WILL BE ENABLED ! \033[1;1m\033[5;5m ARE YOU SURE ? [Y/N] \033[0;0m\n",suspendcount);
else
sprintf(messagebuf,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m RESET MINAGE ? \033[1;1m\033[5;5m ARE YOU SURE ? [Y/N] \033[0;0m\n",suspendcount);
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m No privilege for attempted operation ! errno=164 \n");
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m No privilege for attempted operation ! errno=164 \n");
error_indi=TRUE;
}
goto Goon;
}
if(io_buff[0]=='G')
{
effect();
cls();
susy_flag=FALSE;
error_indi=FALSE;
lastcount=0;
mode_flag=0;
active_flag=0;
scc=1;
startc=0;
actualcount=0;
display_frame();
goto Goon;
}
if(io_buff[0]=='J')
{
gotoxy(1,23);
if(maxh_flag)
{
maxh_flag=FALSE;
printf("\033[K%s \n",maxhdstr);
if(logindi)
fprintf(lpp,"\033[K%s \n",maxhdstr);
error_indi=TRUE;
}
else
{
maxh_flag=TRUE;
printf("\033[K%s \n",maxhstr);
if(logindi)
fprintf(lpp,"\033[K%s \n",maxhstr);
}
for(i=0;i<MAXPROCS;maxprocent[i++]=0);
goto Goon;
}
if(io_buff[0]=='D')
{
gotoxy(1,23);
cursoroff();
error_indi=TRUE;
gotoxy(1,23);
printf(
"\033[K\033[7;7m SYSMON: \033[0;0m CURRENT DELAY: %2d sec. Change with [+/-] - keys. Set delay with [CR] !\n",delay);
if(logindi)
fprintf(lpp,
"\033[K\033[7;7m SYSMON: \033[0;0m CURRENT DELAY: %2d sec. Change with [+/-] - keys. Set delay with [CR] !\n",delay);
for(i=0;i<500;i++)
{
io_buff[0]=0;
ptaste=_gs_rdy(0);
if(ptaste!=-1)
{
i=0;
read(0,ptastbuff,ptaste);
if(ptastbuff[0]=='+' && delay<60)
delay++;
if(ptastbuff[0]=='-' && delay>mindelay)
delay--;
if(ptastbuff[0]==13)
break;
gotoxy(26,23);
printf("%2d\n",delay);
if(logindi)
fprintf(lpp,"%2d\n",delay);
}
if(ptaste==-1)
tsleep(5);
}
if(i>=500) /* timeout ??? */
{
gotoxy(1,23);
printf("%s",timeoutstr);
if(logindi)
fprintf(lpp,"%s",timeoutstr);
}
else
{
ret_disp=100;
gotoxy(1,23);
printf("\033[K\n");
if(logindi)
fprintf(lpp,"\033[K\n");
}
if(mode_flag)
{
gotoxy(1,23);
cursoron();
}
goto Goon;
}
if(io_buff[0]=='A' || io_buff[0]=='B' ||
io_buff[0]=='E' || io_buff[0]=='V')
{
effect();
cls();
error_indi=FALSE;
susy_flag=FALSE;
startc=0;
scc=1;
actualcount=0;
lastcount=0;
mode_flag=1;
active_flag=0;
switch(io_buff[0])
{
case 'A':
exmode=FALSE;
break;
case 'B':
exmode=TRUE;
break;
case 'E':
exmode=2;
break;
case 'V':
exmode=3;
break;
}
display_dframe();
goto Goon;
}
if(io_buff[0]=='U')
{
effect();
cls();
error_indi=FALSE;
susy_flag=FALSE;
scc=1;
startc=0;
lastcount=0;
actualcount=0;
mode_flag=1;
active_flag=1;
display_dframe();
goto Goon;
}
if(io_buff[0]=='S')
{
error_indi=FALSE;
if(privileg) /* is the user privileged ???? */
{
reference=FALSE; /* switch of reference */
if(mode_flag==1 && !active_flag) /* only in */
{ /*alpha mode ! */
if(!susy_flag)
{
susy_flag=TRUE;
watchy_flag=FALSE;
under_title();
}
else
{
susy_flag=FALSE;
under_title();
}
}
else
{
cls();
lastcount=0;
mode_flag=1;
scc=1;
startc=0;
actualcount=0;
active_flag=0;
susy_flag=TRUE;
display_dframe();
}
}
else
{
gotoxy(1,23);
printf(
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m No privilege for attempted operation ! errno=164 \n");
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m No privilege for attempted operation ! errno=164 \n");
error_indi=TRUE;
}
goto Goon;
}
if(io_buff[0]=='>')
{
if(susy_flag)
{
if(scc<(fa+fb))
{
scc++;
startc++;
selecta=TRUE;
}
else
{
if(actualcount<imax-15)
{
error_indi=FALSE;
actualcount+=16;
under_title();
startc=0;
scc++;
}
else
{
gotoxy(1,23);
printf("%s\n",reached_endstr);
if(logindi)
fprintf(lpp,"%s\n",reached_endstr);
error_indi=TRUE;
}
}
}
else
{
gotoxy(1,23);
printf(
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m SELECT-MODE not enabled. Use 'S' key to enable !\n");
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m SELECT-MODE not enabled. Use 'S' key to enable !\n");
error_indi=TRUE;
}
goto Goon;
}
if(io_buff[0]=='<')
{
if(susy_flag)
{
if(scc>fa+1)
{
selecta=TRUE;
scc--;
startc--;
}
else
{
if(actualcount>=16)
{
error_indi=FALSE;
actualcount-=16;
under_title();
scc--;
startc=15;
}
else
{
actualcount=0;
gotoxy(1,23);
printf("%s\n",reached_beginstr);
if(logindi)
fprintf(lpp,"%s\n",reached_beginstr);
error_indi=TRUE;
}
}
}
else
{
gotoxy(1,23);
printf(
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m SELECT-MODE not enabled. Use 'S' key to enable !\n");
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m SELECT-MODE not enabled. Use 'S' key to enable !\n");
error_indi=TRUE;
}
goto Goon;
}
if(io_buff[0]=='K' && imax>1)
{
error_indi=FALSE;
if(susy_flag)
{
if(markpr>1)
{
reference=FALSE;
refresh_flag=FALSE;
error_indi=FALSE;
killer=TRUE;
gotoxy(1,23);
if(markpr==ownuid)
{
printf(
"\033[K\007\033[7;7m SYSMON: \033[0;0m Kill own process '%s' ? \033[5;5m Are You quite sure [Y]es/[N]o ? \033[0;0m \n",killnam);
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m SYSMON: \033[0;0m Kill own process '%s' ? \033[5;5m Are You quite sure [Y]es/[N]o ? \033[0;0m \n",killnam);
suicid_flag=TRUE;
}
else
{
printf(
"\033[K\007\033[7;7m SYSMON: \033[0;0m Kill process '%s' ? \033[5;5m Are You sure [Y]es/[N]o ? \033[0;0m \n",killnam);
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m SYSMON: \033[0;0m Kill process '%s' ? \033[5;5m Are You sure [Y]es/[N]o ? \033[0;0m \n",killnam);
}
}
else
{
gotoxy(1,23);
printf("%s\n",kernstr);
if(logindi)
fprintf(lpp,"%s\n",kernstr);
error_indi=TRUE;
}
}
else
{
gotoxy(1,23);
printf(
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m Kill-option not enabled ! Use 'S' key to select process !\n");
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m Kill-option not enabled ! Use 'S' key to select process !\n");
error_indi=TRUE;
}
goto Goon;
}
if(io_buff[0]=='O' && imax>1)
{
error_indi=FALSE;
if(susy_flag)
{
if(markpr>1)
{
reference=FALSE;
refresh_flag=FALSE;
error_indi=FALSE;
spr_flag=SUSPEND;
gotoxy(1,23);
if(markprior>0)
{
if(markpr!=ownuid)
{
if(pid[ownuid-1]==markpr)
{
printf(
"\033[K\007\033[7;7m\033[1;1m\033[5;5m WARNING: \033[0;0m Suspend your parent process '%s' ? \033[5;5m Are You quite sure ? [Y/N] \033[0;0m \n",killnam);
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m WARNING: \033[0;0m Suspend your parent process '%s' ? \033[5;5m Are You quite sure ? [Y/N] \033[0;0m \n",killnam);
bell=ON;
}
else
{
printf(
"\033[K\007\033[7;7m SYSMON: \033[0;0m Suspend process '%s' ? \033[5;5m Are You sure ? [Y/N] \033[0;0m \n",killnam);
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m SYSMON: \033[0;0m Suspend process '%s' ? \033[5;5m Are You sure ? [Y/N] \033[0;0m \n",killnam);
}
}
else
{
printf(
"\033[K\007\033[7;7m\033[1;1m\033[5;5m WARNING: \033[0;0m Suspend your own process '%s' ? \033[5;5m Are You quite sure ? [Y/N] \033[0;0m \n",killnam);
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m WARNING: \033[0;0m Suspend your own process '%s' ? \033[5;5m Are You quite sure ? [Y/N] \033[0;0m \n",killnam);
bell=ON;
suicid_flag=TRUE;
}
}
else
{
printf(
"\033[K\007\033[7;7m SYSMON: \033[0;0m Enable process '%s' ? \033[5;5m Are You sure ? [Y/N] \033[0;0m \n",killnam);
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m SYSMON: \033[0;0m Enable process '%s' ? \033[5;5m Are You sure ? [Y/N] \033[0;0m \n",killnam);
}
}
else
{
gotoxy(1,23);
printf("%s\n",kernstr);
if(logindi)
fprintf(lpp,"%s\n",kernstr);
error_indi=TRUE;
}
}
else
{
gotoxy(1,23);
printf(
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m Suspend-option not enabled ! Use 'S' key to select process !\n");
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m Suspend-option not enabled ! Use 'S' key to select process !\n");
error_indi=TRUE;
}
goto Goon;
}
if(io_buff[0]=='T' && imax>1)
{
error_indi=FALSE;
if(susy_flag)
{
gotoxy(1,23);
cursoroff();
reference=FALSE;
refresh_flag=FALSE;
error_indi=FALSE;
if(ownuid==markpr && prillow==FALSE) /* if selected process is not the own ! */
{
gotoxy(1,23);
printf(
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m You can't change priority from this source !\n");
if(logindi)
fprintf(lpp,
"\033[K\007\033[7;7m\033[1;1m\033[5;5m SYSMON: \033[0;0m You can't change priority from this source !\n");