Exemple #1
0
/*type tells what to do.  address1,2,3 are parameters - the values 
  passed in bx,cx, and dx */
void handleinterrupt21(char type, char* address1, char* address2, char* address3)
{
	if (type==1)
		bios_printstr(address1);
	else if (type==2)
		readstring(address1);
	else if (type==3)
		readfile(address1,address2);
	else if (type==4)
		writefile(address1,address2,address3);
	else if (type==5)
		delfile(address1);
	else if (type==6)
		executeprogram(address1,address2,0);
	else if (type==7)
		terminateprogram();	
	else if (type==8)
		executeprogram(address1,address2,1);
	else if (type==9)
		kill(address1);
	else if (type==10)
		makedir(address1,address2);
	else
		bios_printstr("ERROR: Invalid interrupt 21 code\r\n\0");
}
Exemple #2
0
void dokernel()
{
	/*placeholder for the shell*/
	char file[12800];

	/*some friendly startup messages*/
	bios_printstr("\r\nBuild an Operating System from Scratch Project\r\n\0");
	bios_printstr("Written by Michael Black, December, 2007\r\n\n\0");
	bios_printstr("Starting the kernel\r\n\0");

	/*make the process table*/ 
	initialize_process_table();
	bios_printstr("Process table is initialized\r\n\0");

	/*install the ISR for interrupt 21*/
	makeinterrupt21();

	int21(1,"Interrupt 21 is installed\r\n\0");

	int21(1,"Kernel set up is completed\r\n\0");
	int21(1,"Loading the shell into memory\r\n\0");

	/*start the shell*/
	/*load it into file[]*/
	int21(3,"SHELL\0",file);

	/*load it to memory and schedule it to be executed*/
	int21(6,file,12800,"SHELL\0");

	/*install an ISR for the timer - this will call the scheduler*/
	maketimerinterrupt();

	int21(1,"Timer interrupt is installed\r\n\0");

	int21(1,"\r\nThe shell is starting.  The kernel will stay in the background.\r\n\n\0");
}
Exemple #3
0
void showrunningprocess()
{
	bios_printstr("entra a la interrupcion en el kernel\r\n\0");
}