Пример #1
0
short    SP_print_line(void) {
	char        output_line[400];
	char        temp[12];
	INT16       index;
	INT16       ind;
	INT16       pos;
	BOOL        mode_print_done;
	INT32       current_time;

	// print out the header
	SP_do_output(SP_HEADER_STRING);

	sprintf(output_line, "%5d", SP_time);             /* Time         */
	if (SP_time == -1) {
		MEM_READ(Z502ClockStatus, &current_time);
		sprintf(output_line, "%5d", current_time % 100000);
	}

	sprintf(temp, " %3d ", SP_target_pid);            /* Target Pid   */
	if (SP_target_pid < 0)
		sprintf(temp, "%s", "     ");
	(void)strcat(output_line, temp);

	sprintf(temp, " %8s", SP_action);                 /* Action       */
	(void)strcat(output_line, temp);

	index = SP_RUNNING_MODE - SP_STATE_MODE_START;      /* Running proc.*/
	if (SP_number_of_pids[index] > 0)
		sprintf(temp, " %3d", SP_pid_states[index][0]);
	else
		sprintf(temp, "    ");
	(void)strcat(output_line, temp);

	index = SP_NEW_MODE - SP_STATE_MODE_START;          /* New proc.*/
	if (SP_number_of_pids[index] > 0)
		sprintf(temp, " %3d ", SP_pid_states[index][0]);
	else
		sprintf(temp, "    ");
	(void)strcat(output_line, temp);

	index = SP_TERMINATED_MODE - SP_STATE_MODE_START;   /* Done proc.*/
	if (SP_number_of_pids[index] > 0)
		sprintf(temp, "%3d ", SP_pid_states[index][0]);
	else
		sprintf(temp, "     ");
	(void)strcat(output_line, temp);
	SP_do_output(output_line);
	strcpy(output_line, "");

	mode_print_done = FALSE;
	for (ind = SP_READY_MODE; ind <= SP_TERMINATED_MODE; ind++) {
		index = ind - SP_STATE_MODE_START;
		if (SP_number_of_pids[index] > 0) {
			(void)strcat(output_line, mode_name[index]);
			for (pos = 0; pos < SP_number_of_pids[index]; pos++) {
				sprintf(temp, " %d", SP_pid_states[index][pos]);
				(void)strcat(output_line, temp);
			}
			mode_print_done = TRUE;
			(void)strcat(output_line, "\n");
			SP_do_output(output_line);
			strcpy(output_line, "                                 ");
		}                                               /* End of if */
	}                                                   /* End of for*/
	if (mode_print_done == FALSE)
		SP_do_output("\n");

	/*                  Initialize everything                           */

	SP_time = -1;
	strcpy(SP_action, "");
	SP_target_pid = -1;
	for (index = 0; index <= SP_NUMBER_OF_STATES; index++)
		SP_number_of_pids[index] = 0;
	return 0;
}                                               /* End of SP_print_line */
Пример #2
0
short    MP_print_line(void) {
	INT32   index;
	INT32   temp;
	char    output_line3[PHYS_MEM_PGS + 5];
	char    output_line4[PHYS_MEM_PGS + 5];
	char    output_line5[PHYS_MEM_PGS + 5];
	char    output_line6[PHYS_MEM_PGS + 5];
	char    output_line7[PHYS_MEM_PGS + 5];
	char    output_line8[PHYS_MEM_PGS + 5];

	//  Header Line 
	SP_do_output("\n                       PHYSICAL MEMORY STATE\n");

	//  First Line 
	SP_do_output("Frame 0000000000111111111122222222223333333333444444444455555555556666\n");

	//  Second Line 
	SP_do_output("Frame 0123456789012345678901234567890123456789012345678901234567890123\n");

	//  Third - Eighth Line
	strcpy(output_line3, "                                                                 \n");
	strcpy(output_line4, "                                                                 \n");
	strcpy(output_line5, "                                                                 \n");
	strcpy(output_line6, "                                                                 \n");
	strcpy(output_line7, "                                                                 \n");
	strcpy(output_line8, "                                                                 \n");

	for (index = 0; index < PHYS_MEM_PGS; index++) {
		if (MP_ft.entry[index].contains_data == TRUE) {
			output_line3[index] = (char)(MP_ft.entry[index].pid + 48);
			temp = MP_ft.entry[index].logical_page;
			output_line4[index] = (char)(temp / 1000) + 48;
			output_line5[index] = (char)((temp / 100) % 10) + 48;
			output_line6[index] = (char)((temp / 10) % 10) + 48;
			output_line7[index] = (char)((temp) % 10) + 48;
			output_line8[index] = (char)MP_ft.entry[index].state + 48;
		}
	}
	SP_do_output("PID   ");  SP_do_output(output_line3);
	SP_do_output("VPN   ");  SP_do_output(output_line4);
	SP_do_output("VPN   ");  SP_do_output(output_line5);
	SP_do_output("VPN   ");  SP_do_output(output_line6);
	SP_do_output("VPN   ");  SP_do_output(output_line7);
	SP_do_output("VMR   ");  SP_do_output(output_line8);
	MP_initialize();
	return 0;
}
Пример #3
0
void SP_print_header(void)
{
    SP_do_output(SP_HEADER_STRING);

} /* End of SP_print_header*/