KERNEL: Implementing VMM & cleaning up
Folders now are alll lower case Started working on the implementation of the Virtual memory manager. Implemented allocate and free page funtionality for as far as I can atm. Implemented the
This commit is contained in:
41
source/kernel/drivers/vga/VBE.h
Normal file
41
source/kernel/drivers/vga/VBE.h
Normal file
@ -0,0 +1,41 @@
|
||||
|
||||
#define VBE_DISPI_IOPORT_INDEX 0x01CE
|
||||
#define VBE_DISPI_IOPORT_DATA 0x01CF
|
||||
|
||||
/* VBE index values*/
|
||||
#define VBE_DISPI_INDEX_ID 0x0
|
||||
#define VBE_DISPI_INDEX_XRES 0x1
|
||||
#define VBE_DISPI_INDEX_YRES 0x2
|
||||
#define VBE_DISPI_INDEX_BPP 0x3
|
||||
#define VBE_DISPI_INDEX_ENABLE 0x4
|
||||
#define VBE_DISPI_INDEX_BANK 0x5
|
||||
#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
|
||||
#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
|
||||
#define VBE_DISPI_INDEX_X_OFFSET 0x8
|
||||
#define VBE_DISPI_INDEX_Y_OFFSET 0x9
|
||||
|
||||
/* BGA Version */
|
||||
#define VBE_DISPI_ID5 0xB0C5
|
||||
#define VBE_DISPI_ID4 0xB0C3
|
||||
#define VBE_DISPI_ID3 0xB0C2
|
||||
#define VBE_DISPI_ID2 0xB0C1
|
||||
#define VBE_DISPI_ID1 0xB0C0
|
||||
|
||||
|
||||
/* BGA BIT DEPTH */
|
||||
#define VBE_DISPI_BPP_4 0x04
|
||||
#define VBE_DISPI_BPP_8 0x08
|
||||
#define VBE_DISPI_BPP_15 0x0F
|
||||
#define VBE_DISPI_BPP_16 0x10
|
||||
#define VBE_DISPI_BPP_24 0x18
|
||||
#define VBE_DISPI_BPP_32 0x20
|
||||
|
||||
|
||||
/*unsigned short BGAReadRegister(unsigned short IndexValue){
|
||||
// outpw(VBE_DISPI_IOPORT_INDEX, IndexValue);
|
||||
// return inpw (VBE_DISPI_IOPORT_DATA);
|
||||
}
|
||||
|
||||
int BGAIsAvailable (){
|
||||
return (BGAReadRegister(VBE_DISPI_INDEX_ID) == VBE_DISPI_ID5);
|
||||
}*/
|
19
source/kernel/drivers/vga/colors.h
Normal file
19
source/kernel/drivers/vga/colors.h
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
enum vga_color {
|
||||
VGA_COLOR_BLACK = 0,
|
||||
VGA_COLOR_BLUE = 1,
|
||||
VGA_COLOR_GREEN = 2,
|
||||
VGA_COLOR_CYAN = 3,
|
||||
VGA_COLOR_RED = 4,
|
||||
VGA_COLOR_MAGENTA = 5,
|
||||
VGA_COLOR_BROWN = 6,
|
||||
VGA_COLOR_LIGHT_GREY = 7,
|
||||
VGA_COLOR_DARK_GREY = 8,
|
||||
VGA_COLOR_LIGHT_BLUE = 9,
|
||||
VGA_COLOR_LIGHT_GREEN = 10,
|
||||
VGA_COLOR_LIGHT_CYAN = 11,
|
||||
VGA_COLOR_LIGHT_RED = 12,
|
||||
VGA_COLOR_LIGHT_MAGENTA = 13,
|
||||
VGA_COLOR_LIGHT_BROWN = 14,
|
||||
VGA_COLOR_WHITE = 15,
|
||||
};
|
Reference in New Issue
Block a user