# tty.c File Reference

`#include <ubixos/tty.h>`
`#include <ubixos/kpanic.h>`
`#include <ubixos/spinlock.h>`
`#include <lib/kprintf.h>`
`#include <lib/kmalloc.h>`
`#include <sys/io.h>`
`#include <string.h>`

Include dependency graph for tty.c:

Go to the source code of this file.

## Functions

int | tty_change (uInt16 tty)
tty_term * | tty_find (uInt16 tty)
int | tty_init ()
int | tty_print (char *string, tty_term *term)

## Variables

static tty_term * | terms = 0x0
tty_term * | tty_foreground = 0x0
static spinLock_t | tty_spinLock = SPIN_LOCK_INITIALIZER

## Function Documentation

int tty_change | ( | uInt16 | tty | ) |

Definition at line 87 of file tty.c.

References kpanic(), memcpy(), outportByte(), terms, tty_termNode::tty_buffer, tty_foreground, TTY_MAX_TERMS, tty_termNode::tty_pointer, tty_termNode::tty_x, and tty_termNode::tty_y.

Referenced by keyboardHandler().

Here is the call graph for this function:

tty_term* tty_find | ( | uInt16 | tty | ) |

Definition at line 170 of file tty.c.

References terms.

Referenced by execFile(), kprint(), and systemTask().

int tty_init | ( |  | ) |

Definition at line 42 of file tty.c.

References inportByte(), kmalloc(), kpanic(), kprintf(), outportByte(), terms, tty_termNode::tty_buffer, tty_termNode::tty_colour, tty_foreground, TTY_MAX_TERMS, tty_termNode::tty_pointer, tty_termNode::tty_x, and tty_termNode::tty_y.

Here is the call graph for this function:

int tty_print | ( | char * | string,
|  | tty_term * | term |
| ) |  |  |

Definition at line 118 of file tty.c.

References outportByte(), spinLock(), spinUnlock(), tty_termNode::tty_colour, tty_foreground, tty_termNode::tty_pointer, tty_spinLock, tty_termNode::tty_x, tty_termNode::tty_y, and x20.

Referenced by kprint(), and sysFwrite().

Here is the call graph for this function:

## Variable Documentation

tty_term* terms = 0x0`[static]`

Definition at line 38 of file tty.c.

Referenced by tty_change(), tty_find(), and tty_init().

tty_term* tty_foreground = 0x0

Definition at line 39 of file tty.c.

Referenced by backSpace(), getch(), keyboardHandler(), kpanic(), kprint(), sysFgetc(), tty_change(), tty_init(), and tty_print().

spinLock_t tty_spinLock = SPIN_LOCK_INITIALIZER`[static]`

Definition at line 40 of file tty.c.

Referenced by tty_print().