Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | /* Project: OSLib |
2 | * Description: The OS Construction Kit |
||
3 | * Date: 1.6.2000 |
||
4 | * Idea by: Luca Abeni & Gerardo Lamastra |
||
5 | * |
||
6 | * OSLib is an SO project aimed at developing a common, easy-to-use |
||
7 | * low-level infrastructure for developing OS kernels and Embedded |
||
8 | * Applications; it partially derives from the HARTIK project but it |
||
9 | * currently is independently developed. |
||
10 | * |
||
11 | * OSLib is distributed under GPL License, and some of its code has |
||
12 | * been derived from the Linux kernel source; also some important |
||
13 | * ideas come from studying the DJGPP go32 extender. |
||
14 | * |
||
15 | * We acknowledge the Linux Community, Free Software Foundation, |
||
16 | * D.J. Delorie and all the other developers who believe in the |
||
17 | * freedom of software and ideas. |
||
18 | * |
||
19 | * For legalese, check out the included GPL license. |
||
20 | */ |
||
21 | |||
22 | /* Console output functions */ |
||
23 | |||
24 | #ifndef __LL_I386_CONS_H__ |
||
25 | #define __LL_I386_CONS_H__ |
||
26 | |||
27 | #include <ll/i386/defs.h> |
||
28 | BEGIN_DEF |
||
29 | |||
30 | /* for reference only */ |
||
31 | extern int cons_columns; /* number of screen columns */ |
||
32 | extern int cons_rows; /* number of screen rows */ |
||
33 | |||
34 | |||
35 | /* X-dependent Console Output functions */ |
||
36 | /* Rememeber that console functions are NOT REENTRANT */ |
||
37 | /* The console must be considered a preemtable resource */ |
||
38 | /* File : Cons.C */ |
||
39 | |||
40 | void set_visual_page(int page); |
||
41 | void set_active_page(int page); |
||
42 | int get_visual_page(void); |
||
43 | int get_active_page(void); |
||
44 | void place(int x,int y); |
||
45 | void cursor(int start,int end); |
||
46 | void _clear(char c,char attr,int x1,int y1,int x2,int y2); |
||
47 | void clear(void); |
||
48 | void _scroll(char attr,int x1,int y1,int x2,int y2); |
||
49 | void scroll(void); |
||
50 | void bios_save(void); |
||
51 | void bios_restore(void); |
||
52 | void cputc(char c); |
||
53 | void cputs(char *s); |
||
54 | int cprintf(char *fmt,...) __attribute__((format(printf,1,2))); |
||
55 | |||
56 | /* These functions allow direct access to video RAM */ |
||
57 | /* Hence you can use it without the explicit use of */ |
||
58 | /* a resource manager */ |
||
59 | /* File : Cons.C */ |
||
60 | |||
61 | void putc_xy(int x,int y,char attr,char c); |
||
62 | char getc_xy(int x,int y,char *attr,char *c); |
||
63 | void puts_xy(int x,int y,char attr,char *s); |
||
64 | int printf_xy(int x,int y,char attr, char *fmt,...) __attribute__((format(printf,4,5))); |
||
65 | |||
66 | /* These are simple useful macro! */ |
||
67 | #define HOME() place(0,0); |
||
68 | #define CRSR_BLOB() cursor(0,15); |
||
69 | #define CRSR_OFF() cursor(16,16); |
||
70 | #define CRSR_STD() cursor(14,15); |
||
71 | #define NL() cputc('\n'); |
||
72 | |||
73 | /* Text mode color definitions */ |
||
74 | |||
75 | #define BLACK 0 |
||
76 | #define BLUE 1 |
||
77 | #define GREEN 2 |
||
78 | #define CYAN 3 |
||
79 | #define RED 4 |
||
80 | #define MAGENTA 5 |
||
81 | #define BROWN 6 |
||
82 | #define LIGHTGRAY 7 |
||
83 | #define DARKGRAY 8 |
||
84 | #define LIGHTBLUE 9 |
||
85 | #define LIGHTGREEN 10 |
||
86 | #define LIGHTCYAN 11 |
||
87 | #define LIGHTRED 12 |
||
88 | #define LIGHTMAGENTA 13 |
||
89 | #define YELLOW 14 |
||
90 | #define WHITE 15 |
||
91 | |||
92 | END_DEF |
||
93 | |||
94 | #endif |
||
95 |