R.I.P Terry (merak etme baba bende gelecem yanına)

ZIP indir
0
main
1 dal
git@carbon4code.com:ozsipahi/NakedOS.git
Ömer Özsipahi feature: C kernel
9 commit
vga.h 1.2 KB
#ifndef VGA_H
#define VGA_H

#include "kernel.h"

#define VGA_BASE_ADDR  ((volatile uintptr_t *) 0xB8000)
#define VGA_DEFAULT_SS 80 * 25


#define SCREEN_SIZE 80 * 25

/*
    VGA COLOR MODES
*/

#define VGA_CM_BG_BLACK 0x0 // default bg color (black) for VGA

#define VGA_CM_BBLUE VGA_CM_BG_BLACK | 0x01
#define VGA_CM_BGREEN VGA_CM_BG_BLACK | 0x02
#define VGA_CM_BCYAN VGA_CM_BG_BLACK | 0x03
#define VGA_CM_BRED VGA_CM_BG_BLACK | 0x04
#define VGA_CM_BMAGENTA VGA_CM_BG_BLACK | 0x05
#define VGA_CM_BBROWN VGA_CM_BG_BLACK | 0x06

/*
    for gui mod IBM_VGA_MANUAL page 59 register ports and their mods(R/W)
*/


/*
    Mode attribute byte is a 8 bit byte. for coloring first 4-bit represent to Background eg. BG, and the second 4-bit represents for text-color

    EGA   VGA
    0x0   0x00  Black
    0x1   0x01  Blue
    0x2   0x02  Green
    0x3   0x03  Cyan
    0x4   0x04  Red
    0x5   0x05  Magenta
    0x6   0x14  Brown
    0x7   0x07  Light Gray
    0x8   0x38  Gray
    0x9   0x39  Light Blue
    0xA   0x3A  Light Green
    0xB   0x3B  Light Cyan
    0xC   0x3C  Light Red
    0xD   0x3D  Light Magenta
    0xE   0x3E  Light Yellow
    0xF   0x3F  White
*/


/*
    FUNTION DEFINES
*/

void    vga_putchar(const uint8_t c);
void    clear_screen_vga(void);

#endif