/* kernelio.h copyrighted (c) by Collin Lally of Project OS/C (Polytech Industries). This file is covered under the GNU General Public License, and may be redistributed and/or modified by the end-user as long as the end-result remains under the GPL and is free to the public. */

/* Conditional definition statements */

/* #include "k_config.h" */
/* #include "sched_osc.h" */

#include "video.h"
#include "kernelio.h"

setregs(regs1, regs2, regs3, regs4)
{
	reg.ax = (int*)&regs1;
	reg.bx = (int*)&regs2;
	reg.cx = (int*)&regs3;
	reg.dx = (int*)&regs4;
	asm("mov $regs1,%ax 
		mov $regs2,%bx 
		mov $regs3,%cx
		mov $regs4,%dx
	");
};

set_kfield(field_num, value)
int *field_num;
int *value;
{
	if(value != FLAG_ON && value != FLAG_OFF){
		kprint("Fatal error at: _k_field\n");
		setregs(0x13, NULL, NULL, NULL);
	}else{
		if(field_num == 1){
			kernel_com._k_field1 = &value;
		};
		if(field_num == 2){
			kernel_com._k_field2 = &value;
		};
		if(field_num == 3){
			kernel_com._k_field3 = &value;
		};
		if(field_num == 4){
			kernel_com._k_field4 = &value;
		};
	};
};