cynix

x86 UNIX-like OS
git clone git://git.2f30.org/cynix
Log | Files | Refs | README | LICENSE

tty.h (1203B)


      1 #ifndef __TTY_H__
      2 #define __TTY_H__
      3 
      4 #include <stdint.h>
      5 #include <sys/types.h>
      6 #include <tss.h>
      7 
      8 enum vga_defs {
      9 	FRAMEBUFFER_ADDR = 0xb8000,
     10 	BUF_HEIGHT = 25,
     11 	BUF_WIDTH = 80
     12 };
     13 
     14 enum vga_colours {
     15 	BLACK,
     16 	BLUE,
     17 	GREEN,
     18 	CYAN,
     19 	RED,
     20 	MAGENTA,
     21 	BROWN,
     22 	LIGHT_GREY,
     23 	DARK_GREY,
     24 	LIGHT_BLUE,
     25 	LIGHT_GREEN,
     26 	LIGHT_CYAN,
     27 	LIGHT_RED,
     28 	LIGHT_MAGENTA,
     29 	LIGHT_BROWN,
     30 	WHITE
     31 };
     32 
     33 extern unsigned short cursor_x;
     34 extern unsigned short cursor_y;
     35 extern volatile unsigned char *framebuffer;
     36 extern enum vga_colours curr_col;
     37 
     38 extern void ccurr_col(enum vga_colours bg, enum vga_colours fg);
     39 extern void clear_scr(void);
     40 extern void gotoxy(unsigned short newy, unsigned short newx);
     41 extern void scroll(void);
     42 extern void erase_line(int y);
     43 extern void blink(void);
     44 extern void update_cursor(uint16_t row, uint16_t col);
     45 extern int tty_putchar(int c);
     46 extern ssize_t tty_read(void *buf, size_t count);
     47 extern int raw_tty_read(void);
     48 extern void *tty_get_sleep_chan(void);
     49 extern void attach_tty(struct task_t *ctask);
     50 extern void tty_suspend(void);
     51 extern void tty_resume(void);
     52 extern int is_ctrl_task(struct task_t *ctask);
     53 extern struct task_t *tty_get_ctrl_task(void);
     54 extern int is_tty_attached(void);
     55 
     56 #endif
     57