46 lines
1.0 KiB
C
46 lines
1.0 KiB
C
|
#ifndef __SCREEN_H
|
||
|
#define __SCREEN_H
|
||
|
#define VIDEO_ADDRESS 0xb8000
|
||
|
#define GREEN_ON_BLACK 0x02
|
||
|
|
||
|
|
||
|
#define FB_COMMAND_PORT 0x3D4
|
||
|
#define FB_DATA_PORT 0x3D5
|
||
|
// The I/O port commands
|
||
|
#define FB_HIGH_BYTE_COMMAND 14
|
||
|
#define FB_LOW_BYTE_COMMAND 15
|
||
|
|
||
|
enum vga_colors {
|
||
|
BLACK = 0,
|
||
|
BLUE = 1,
|
||
|
GREEN = 2,
|
||
|
CYAN = 3,
|
||
|
RED = 4,
|
||
|
MAGENTA = 5,
|
||
|
BROWN = 6,
|
||
|
LIGHT_GREY = 7,
|
||
|
DARK_GREY = 8,
|
||
|
LIGHT_BLUE = 9,
|
||
|
LIGHT_GREEN = 10,
|
||
|
LIGHT_CYAN = 11,
|
||
|
LIGHT_RED = 12,
|
||
|
LIGHT_MAGENTA = 13,
|
||
|
LIGHT_BROWN = 14,
|
||
|
WHITE = 15,
|
||
|
|
||
|
};
|
||
|
|
||
|
extern void set_current_color(enum vga_colors color);
|
||
|
extern void printchar(const char character);
|
||
|
extern void print(const char string[]);
|
||
|
extern void handle_scrolling();
|
||
|
extern void clear();
|
||
|
extern void set_cursor(int row, int col);
|
||
|
extern void itoa(int num, char *string2);
|
||
|
extern void tohex(int val, char *string);
|
||
|
extern void kprintf(const char *string, ...); // simple printf style function
|
||
|
void zerostring(char *string); // zero out a string needs refactor
|
||
|
extern unsigned int strlen(const char *string);
|
||
|
// end funciton prototypes
|
||
|
#endif
|