Go to the documentation of this file.
47 kpanic(
"tty_init: Failed to allocate memory. File: %s, Line: %i\n", __FILE__, __LINE__);
52 if (terms[i].tty_buffer == 0x0)
53 kpanic(
"tty_init: Failed to allocate buffer memory. File: %s, Line: %i\n", __FILE__, __LINE__);
74 kprintf(
"tty0 - Initialized\n");
87 kpanic(
"Error: Changing to an invalid tty. File: %s, Line: %i\n", __FILE__, __LINE__);
93 memcpy((
char *) 0xB8000, terms[tty].tty_buffer, (80 * 60 * 2));
116 unsigned int bufferOffset = 0x0, character = 0x0, i = 0x0;
120 bufferOffset = term->
tty_y;
124 bufferOffset += term->
tty_x;
127 while ((character = *
string++)) {
130 bufferOffset = (bufferOffset / 160) * 160 + 160;
139 if (bufferOffset >= 160 * 25) {
140 for (i = 0; i < 160 * 24; i++) {
143 for (i = 0; i < 80; i++) {
152 term->
tty_x = (bufferOffset & 0xFF);
153 term->
tty_y = (bufferOffset >> 0x8);
168 return (&terms[tty]);
tty_term * tty_find(uInt16 tty)
int tty_change(uInt16 tty)
unsigned short int uInt16
void outportByte(unsigned int, unsigned char)
outputut one byte to specified port
void spinUnlock(spinLock_t *lock)
#define SPIN_LOCK_INITIALIZER
void kpanic(const char *fmt,...)
print panic message and halt system
void * memcpy(const void *dst, const void *src, size_t length)
void spinLock(spinLock_t *lock)
unsigned char inportByte(unsigned int)
input one byte from specified port
int tty_print(char *string, tty_term *term)
tty_term * tty_foreground
void * kmalloc(uInt32 len)
int kprintf(const char *,...)