Ejemplo n.º 1
0
int scrollDown( void )
{
  byte high, low;
  word address;
  int ret = 0;

  outByte( 0x3D4u, 0x0Cu );
  high = inByte( 0x3D5u );
  outByte( 0x3D4u, 0x0Du );
  low = inByte( 0x3D5u );

  address = (high << 8 | low );
  address += 0x50u;

  if( address > 0x3e80u )
  {
    address = 0;
    ret = 1;
  }

  outByte( 0x3D4u, 0x0Cu );
  outByte( 0x3D5u, address >> 8 );
  outByte( 0x3D4u, 0x0Du );
  outByte( 0x3D5u, address & 0xFFu );

  return ret;
}
Ejemplo n.º 2
0
void init_serial(void)
{
    outByte(combase + 3, inByte(combase + 3) | 0x80u); // Set DLAB for
                                                      // DLLB access
    outByte(combase, 0x03u);                           /* 38400 baud */
    outByte(combase + 1, 0u); // Disable interrupts
    outByte(combase + 3, inByte(combase + 3) & 0x7fu); // Clear DLAB
    outByte(combase + 3, 3u); // 8-N-1
}
Ejemplo n.º 3
0
void intHandler2e()
{
	inByte(REG_STATUS);
	outByte(0x20, 0xA0);
	isHardDiskReady = TRUE;
	return;
}
Ejemplo n.º 4
0
void putDebugChar(int ch)
{
    while (!(inByte(combase + 5) & 0x20u));
    outByte(combase, (byte) ch);
/*
if( ch == '\r' )
{
 sx=0;
 sy++;
 if( sy >= SCREEN_HEIGHT )
   scrollDown();
}
else if( ch == '\t' )
{
 sx +=8;
}
else
{
  putChar(ch,sx,sy);
  sx++;
}

if( sx >= SCREEN_WIDTH )
{
  sx=0;
  sy++;
  if( sy >= SCREEN_HEIGHT )
    scrollDown();
}
*/
}
Ejemplo n.º 5
0
void intHandler21()
{
	outByte(PIC0_OCW2, 0x61);
	u8 data = inByte(PORT_KEYDATA);
	putQueueBuffer(&systemBuffer, data+1024);
	return;
}
Ejemplo n.º 6
0
void waitKBCReady()
{
	while (TRUE) {
		if ((inByte(PORT_KEYSTAT) & KEYSTA_SEND_NOTREADY) == 0) {
			break;
		}
	}
	return;
}
Ejemplo n.º 7
0
void intHandler2c()
{
	u32 data;
	outByte(PIC1_OCW2, 0x64);
	outByte(PIC0_OCW2, 0x62);
	data = inByte(PORT_KEYDATA) + 2048;
	putQueueBuffer(&systemBuffer, data);
	switchKernelProcess();
}
Ejemplo n.º 8
0
bool waitForStatus(int mask, int val, int timeout) 
{
	long time = getTime();
	while((getTime() - time)<timeout) {
		if ((inByte(REG_STATUS) & mask) == val)	{
			return TRUE;	
		}
	}
	return FALSE;
}
Ejemplo n.º 9
0
void scrollUp( void )
{
  byte high, low;
  word address;

  outByte( 0x3D4u, 0x0Cu );
  high = inByte( 0x3D5u );
  outByte( 0x3D4u, 0x0Du );
  low = inByte( 0x3D5u );
  address = (high << 8 | low );

  if( address == 0 )
    address = 0x3fc0u;
  else
    address -= 0x50u;

  outByte( 0x3D4u, 0x0Cu );
  outByte( 0x3D5u, address >> 8 );
  outByte( 0x3D4u, 0x0Du );
  outByte( 0x3D5u, address & 0xFFu );
}
Ejemplo n.º 10
0
void disableIRQ( unsigned int irq )
{
  byte data;

  if( irq > 15 )
    return;

  if( irq < 8 )
  {
    data = inByte( (word)0x21 );
    ioWait();
    outByte( (word)0x21, data | (byte)(1u << irq));
    ioWait();
  }
  else
  {
    data = inByte( (word)0xA1 );
    ioWait();
    outByte( (word)0xA1, data | (byte)(1u << (irq-8)));
    ioWait();
  }
}
Ejemplo n.º 11
0
void enableIRQ( unsigned int irq )
{
  byte data;

  if( irq > 15 )
    return;

  if( irq < 8 )
  {
    data = inByte( (word)0x21u );
    ioWait();
    outByte( (word)0x21u, data & (byte)~(1u << irq));
    ioWait();
  }
  else
  {
    data = inByte( (word)0xA1u );
    ioWait();
    outByte( (word)0xA1u, data & (byte)~(1u << (irq-8)));
    ioWait();
  }
}
Ejemplo n.º 12
0
byte ser_read_intid(word port)
{
  return inByte(port + INT_ID);
}
Ejemplo n.º 13
0
byte ser_line_stat(word port)
{
  return inByte(port + LINE_STATUS);
}
Ejemplo n.º 14
0
void set_dlab(byte bit, word port)
{
  bit &= 1;
  outByte(LINE_CTRL + port, (inByte(LINE_CTRL + port) & 0x7F)
     | (bit << 7));
}
Ejemplo n.º 15
0
byte ser_read_buffer(word port)
{
  set_dlab(0, port);
  return inByte(port + RECEIVER_BUFF);
}
Ejemplo n.º 16
0
int getDebugChar(void)
{
    while (!(inByte(combase + 5) & 0x01u));
    return inByte(combase);
}