Index: kernel/arch/ia32/src/boot/boot.S
===================================================================
--- kernel/arch/ia32/src/boot/boot.S	(revision 6aea2e00a9dff770535c546c162457a46e9fe11b)
+++ kernel/arch/ia32/src/boot/boot.S	(revision 5c8ba0560c7265268758fc38bc65760c0b301f98)
@@ -354,9 +354,10 @@
 #define VESA_INFO_SIZE 1024
 
+#define VESA_MODE_ATTRIBUTES_OFFSET 0
 #define VESA_MODE_LIST_PTR_OFFSET 14
+#define VESA_MODE_SCANLINE_OFFSET 16
 #define VESA_MODE_WIDTH_OFFSET 18
 #define VESA_MODE_HEIGHT_OFFSET 20
 #define VESA_MODE_BPP_OFFSET 25
-#define VESA_MODE_SCANLINE_OFFSET 16
 #define VESA_MODE_PHADDR_OFFSET 40
 
@@ -368,10 +369,8 @@
 #define VESA_GET_MODE_INFO 0x4f01
 #define VESA_SET_MODE 0x4f02
-
-#define CONFIG_VESA_BPP_a 255
+#define VESA_SET_PALETTE 0x4f09
 
 #if CONFIG_VESA_BPP == 24
-#undef CONFIG_VESA_BPP_a
-#define CONFIG_VESA_BPP_a 32
+#define CONFIG_VESA_BPP_VARIANT 32
 #endif
 
@@ -414,5 +413,5 @@
 	jnz 1b
 	
-	mov $CONFIG_VESA_HEIGHT,%ax
+	mov $CONFIG_VESA_HEIGHT, %ax
 	cmp VESA_MODE_HEIGHT_OFFSET(%di), %ax
 	jnz 1b
@@ -420,10 +419,13 @@
 	mov $CONFIG_VESA_BPP, %al
 	cmp VESA_MODE_BPP_OFFSET(%di), %al
+
+#ifdef CONFIG_VESA_BPP_VARIANT
 	jz 2f
 	
-	mov $CONFIG_VESA_BPP_a, %al
+	mov $CONFIG_VESA_BPP_VARIANT, %al
 	cmp VESA_MODE_BPP_OFFSET(%di), %al
+#endif
 	jnz 1b
-	
+
 2:
 	
@@ -437,4 +439,57 @@
 	cmp $VESA_OK, %al
 	jnz 0f
+
+#if CONFIG_VESA_BPP == 8
+	
+	# Set 3:2:3 VGA palette
+	
+	mov VESA_MODE_ATTRIBUTES_OFFSET(%di), %ax
+	push %di
+	mov $vga323 - vesa_init, %di
+	mov $0x100, %ecx
+	
+	bt $5, %ax							# Test if VGA compatible registers are present
+	jnc vga_compat
+		
+		# Try VESA routine to set palette
+		
+		mov $VESA_SET_PALETTE, %ax
+		xor %bl, %bl
+		xor %dx, %dx
+		int $0x10
+		
+		jmp vga_not_compat
+	
+	vga_compat:
+		
+		# Try VGA registers to set palette
+		
+		movw $0x3c6, %dx						# Set palette mask
+		movb $0xff, %al
+		outb %al, %dx
+		
+		movw $0x3c8, %dx						# First index to set
+		xor %al, %al
+		outb %al, %dx
+		
+		movw $0x3c9, %dx						# Data port
+		vga_loop:
+			movb %es:2(%di), %al
+			outb %al, %dx
+			
+			movb %es:1(%di), %al
+			outb %al, %dx
+			
+			movb %es:(%di), %al
+			outb %al, %dx
+			
+			addw $4, %di
+			loop vga_loop
+		
+	vga_not_compat:
+	
+	pop %di
+	
+#endif
 	
 	mov VESA_MODE_PHADDR_OFFSET(%di), %esi
@@ -478,5 +533,7 @@
 	xor %ax, %ax
 	jz 8b						# Force relative jump
-	
+
+vga323:
+#include "vga323.pal"
 
 .code32
@@ -510,3 +567,3 @@
 
 pse_msg:
-	.ascii "Page Size Extension not supported. System halted.\0"
+	.asciz "Page Size Extension not supported. System halted."
Index: kernel/arch/ia32/src/boot/vga323.pal
===================================================================
--- kernel/arch/ia32/src/boot/vga323.pal	(revision 5c8ba0560c7265268758fc38bc65760c0b301f98)
+++ kernel/arch/ia32/src/boot/vga323.pal	(revision 5c8ba0560c7265268758fc38bc65760c0b301f98)
@@ -0,0 +1,256 @@
+	.byte 0x00, 0x00, 0x00, 0x00
+	.byte 0x09, 0x00, 0x00, 0x00
+	.byte 0x12, 0x00, 0x00, 0x00
+	.byte 0x1b, 0x00, 0x00, 0x00
+	.byte 0x24, 0x00, 0x00, 0x00
+	.byte 0x2d, 0x00, 0x00, 0x00
+	.byte 0x36, 0x00, 0x00, 0x00
+	.byte 0x3f, 0x00, 0x00, 0x00
+	.byte 0x00, 0x15, 0x00, 0x00
+	.byte 0x09, 0x15, 0x00, 0x00
+	.byte 0x12, 0x15, 0x00, 0x00
+	.byte 0x1b, 0x15, 0x00, 0x00
+	.byte 0x24, 0x15, 0x00, 0x00
+	.byte 0x2d, 0x15, 0x00, 0x00
+	.byte 0x36, 0x15, 0x00, 0x00
+	.byte 0x3f, 0x15, 0x00, 0x00
+	.byte 0x00, 0x2a, 0x00, 0x00
+	.byte 0x09, 0x2a, 0x00, 0x00
+	.byte 0x12, 0x2a, 0x00, 0x00
+	.byte 0x1b, 0x2a, 0x00, 0x00
+	.byte 0x24, 0x2a, 0x00, 0x00
+	.byte 0x2d, 0x2a, 0x00, 0x00
+	.byte 0x36, 0x2a, 0x00, 0x00
+	.byte 0x3f, 0x2a, 0x00, 0x00
+	.byte 0x00, 0x3f, 0x00, 0x00
+	.byte 0x09, 0x3f, 0x00, 0x00
+	.byte 0x12, 0x3f, 0x00, 0x00
+	.byte 0x1b, 0x3f, 0x00, 0x00
+	.byte 0x24, 0x3f, 0x00, 0x00
+	.byte 0x2d, 0x3f, 0x00, 0x00
+	.byte 0x36, 0x3f, 0x00, 0x00
+	.byte 0x3f, 0x3f, 0x00, 0x00
+	.byte 0x00, 0x00, 0x09, 0x00
+	.byte 0x09, 0x00, 0x09, 0x00
+	.byte 0x12, 0x00, 0x09, 0x00
+	.byte 0x1b, 0x00, 0x09, 0x00
+	.byte 0x24, 0x00, 0x09, 0x00
+	.byte 0x2d, 0x00, 0x09, 0x00
+	.byte 0x36, 0x00, 0x09, 0x00
+	.byte 0x3f, 0x00, 0x09, 0x00
+	.byte 0x00, 0x15, 0x09, 0x00
+	.byte 0x09, 0x15, 0x09, 0x00
+	.byte 0x12, 0x15, 0x09, 0x00
+	.byte 0x1b, 0x15, 0x09, 0x00
+	.byte 0x24, 0x15, 0x09, 0x00
+	.byte 0x2d, 0x15, 0x09, 0x00
+	.byte 0x36, 0x15, 0x09, 0x00
+	.byte 0x3f, 0x15, 0x09, 0x00
+	.byte 0x00, 0x2a, 0x09, 0x00
+	.byte 0x09, 0x2a, 0x09, 0x00
+	.byte 0x12, 0x2a, 0x09, 0x00
+	.byte 0x1b, 0x2a, 0x09, 0x00
+	.byte 0x24, 0x2a, 0x09, 0x00
+	.byte 0x2d, 0x2a, 0x09, 0x00
+	.byte 0x36, 0x2a, 0x09, 0x00
+	.byte 0x3f, 0x2a, 0x09, 0x00
+	.byte 0x00, 0x3f, 0x09, 0x00
+	.byte 0x09, 0x3f, 0x09, 0x00
+	.byte 0x12, 0x3f, 0x09, 0x00
+	.byte 0x1b, 0x3f, 0x09, 0x00
+	.byte 0x24, 0x3f, 0x09, 0x00
+	.byte 0x2d, 0x3f, 0x09, 0x00
+	.byte 0x36, 0x3f, 0x09, 0x00
+	.byte 0x3f, 0x3f, 0x09, 0x00
+	.byte 0x00, 0x00, 0x12, 0x00
+	.byte 0x09, 0x00, 0x12, 0x00
+	.byte 0x12, 0x00, 0x12, 0x00
+	.byte 0x1b, 0x00, 0x12, 0x00
+	.byte 0x24, 0x00, 0x12, 0x00
+	.byte 0x2d, 0x00, 0x12, 0x00
+	.byte 0x36, 0x00, 0x12, 0x00
+	.byte 0x3f, 0x00, 0x12, 0x00
+	.byte 0x00, 0x15, 0x12, 0x00
+	.byte 0x09, 0x15, 0x12, 0x00
+	.byte 0x12, 0x15, 0x12, 0x00
+	.byte 0x1b, 0x15, 0x12, 0x00
+	.byte 0x24, 0x15, 0x12, 0x00
+	.byte 0x2d, 0x15, 0x12, 0x00
+	.byte 0x36, 0x15, 0x12, 0x00
+	.byte 0x3f, 0x15, 0x12, 0x00
+	.byte 0x00, 0x2a, 0x12, 0x00
+	.byte 0x09, 0x2a, 0x12, 0x00
+	.byte 0x12, 0x2a, 0x12, 0x00
+	.byte 0x1b, 0x2a, 0x12, 0x00
+	.byte 0x24, 0x2a, 0x12, 0x00
+	.byte 0x2d, 0x2a, 0x12, 0x00
+	.byte 0x36, 0x2a, 0x12, 0x00
+	.byte 0x3f, 0x2a, 0x12, 0x00
+	.byte 0x00, 0x3f, 0x12, 0x00
+	.byte 0x09, 0x3f, 0x12, 0x00
+	.byte 0x12, 0x3f, 0x12, 0x00
+	.byte 0x1b, 0x3f, 0x12, 0x00
+	.byte 0x24, 0x3f, 0x12, 0x00
+	.byte 0x2d, 0x3f, 0x12, 0x00
+	.byte 0x36, 0x3f, 0x12, 0x00
+	.byte 0x3f, 0x3f, 0x12, 0x00
+	.byte 0x00, 0x00, 0x1b, 0x00
+	.byte 0x09, 0x00, 0x1b, 0x00
+	.byte 0x12, 0x00, 0x1b, 0x00
+	.byte 0x1b, 0x00, 0x1b, 0x00
+	.byte 0x24, 0x00, 0x1b, 0x00
+	.byte 0x2d, 0x00, 0x1b, 0x00
+	.byte 0x36, 0x00, 0x1b, 0x00
+	.byte 0x3f, 0x00, 0x1b, 0x00
+	.byte 0x00, 0x15, 0x1b, 0x00
+	.byte 0x09, 0x15, 0x1b, 0x00
+	.byte 0x12, 0x15, 0x1b, 0x00
+	.byte 0x1b, 0x15, 0x1b, 0x00
+	.byte 0x24, 0x15, 0x1b, 0x00
+	.byte 0x2d, 0x15, 0x1b, 0x00
+	.byte 0x36, 0x15, 0x1b, 0x00
+	.byte 0x3f, 0x15, 0x1b, 0x00
+	.byte 0x00, 0x2a, 0x1b, 0x00
+	.byte 0x09, 0x2a, 0x1b, 0x00
+	.byte 0x12, 0x2a, 0x1b, 0x00
+	.byte 0x1b, 0x2a, 0x1b, 0x00
+	.byte 0x24, 0x2a, 0x1b, 0x00
+	.byte 0x2d, 0x2a, 0x1b, 0x00
+	.byte 0x36, 0x2a, 0x1b, 0x00
+	.byte 0x3f, 0x2a, 0x1b, 0x00
+	.byte 0x00, 0x3f, 0x1b, 0x00
+	.byte 0x09, 0x3f, 0x1b, 0x00
+	.byte 0x12, 0x3f, 0x1b, 0x00
+	.byte 0x1b, 0x3f, 0x1b, 0x00
+	.byte 0x24, 0x3f, 0x1b, 0x00
+	.byte 0x2d, 0x3f, 0x1b, 0x00
+	.byte 0x36, 0x3f, 0x1b, 0x00
+	.byte 0x3f, 0x3f, 0x1b, 0x00
+	.byte 0x00, 0x00, 0x24, 0x00
+	.byte 0x09, 0x00, 0x24, 0x00
+	.byte 0x12, 0x00, 0x24, 0x00
+	.byte 0x1b, 0x00, 0x24, 0x00
+	.byte 0x24, 0x00, 0x24, 0x00
+	.byte 0x2d, 0x00, 0x24, 0x00
+	.byte 0x36, 0x00, 0x24, 0x00
+	.byte 0x3f, 0x00, 0x24, 0x00
+	.byte 0x00, 0x15, 0x24, 0x00
+	.byte 0x09, 0x15, 0x24, 0x00
+	.byte 0x12, 0x15, 0x24, 0x00
+	.byte 0x1b, 0x15, 0x24, 0x00
+	.byte 0x24, 0x15, 0x24, 0x00
+	.byte 0x2d, 0x15, 0x24, 0x00
+	.byte 0x36, 0x15, 0x24, 0x00
+	.byte 0x3f, 0x15, 0x24, 0x00
+	.byte 0x00, 0x2a, 0x24, 0x00
+	.byte 0x09, 0x2a, 0x24, 0x00
+	.byte 0x12, 0x2a, 0x24, 0x00
+	.byte 0x1b, 0x2a, 0x24, 0x00
+	.byte 0x24, 0x2a, 0x24, 0x00
+	.byte 0x2d, 0x2a, 0x24, 0x00
+	.byte 0x36, 0x2a, 0x24, 0x00
+	.byte 0x3f, 0x2a, 0x24, 0x00
+	.byte 0x00, 0x3f, 0x24, 0x00
+	.byte 0x09, 0x3f, 0x24, 0x00
+	.byte 0x12, 0x3f, 0x24, 0x00
+	.byte 0x1b, 0x3f, 0x24, 0x00
+	.byte 0x24, 0x3f, 0x24, 0x00
+	.byte 0x2d, 0x3f, 0x24, 0x00
+	.byte 0x36, 0x3f, 0x24, 0x00
+	.byte 0x3f, 0x3f, 0x24, 0x00
+	.byte 0x00, 0x00, 0x2d, 0x00
+	.byte 0x09, 0x00, 0x2d, 0x00
+	.byte 0x12, 0x00, 0x2d, 0x00
+	.byte 0x1b, 0x00, 0x2d, 0x00
+	.byte 0x24, 0x00, 0x2d, 0x00
+	.byte 0x2d, 0x00, 0x2d, 0x00
+	.byte 0x36, 0x00, 0x2d, 0x00
+	.byte 0x3f, 0x00, 0x2d, 0x00
+	.byte 0x00, 0x15, 0x2d, 0x00
+	.byte 0x09, 0x15, 0x2d, 0x00
+	.byte 0x12, 0x15, 0x2d, 0x00
+	.byte 0x1b, 0x15, 0x2d, 0x00
+	.byte 0x24, 0x15, 0x2d, 0x00
+	.byte 0x2d, 0x15, 0x2d, 0x00
+	.byte 0x36, 0x15, 0x2d, 0x00
+	.byte 0x3f, 0x15, 0x2d, 0x00
+	.byte 0x00, 0x2a, 0x2d, 0x00
+	.byte 0x09, 0x2a, 0x2d, 0x00
+	.byte 0x12, 0x2a, 0x2d, 0x00
+	.byte 0x1b, 0x2a, 0x2d, 0x00
+	.byte 0x24, 0x2a, 0x2d, 0x00
+	.byte 0x2d, 0x2a, 0x2d, 0x00
+	.byte 0x36, 0x2a, 0x2d, 0x00
+	.byte 0x3f, 0x2a, 0x2d, 0x00
+	.byte 0x00, 0x3f, 0x2d, 0x00
+	.byte 0x09, 0x3f, 0x2d, 0x00
+	.byte 0x12, 0x3f, 0x2d, 0x00
+	.byte 0x1b, 0x3f, 0x2d, 0x00
+	.byte 0x24, 0x3f, 0x2d, 0x00
+	.byte 0x2d, 0x3f, 0x2d, 0x00
+	.byte 0x36, 0x3f, 0x2d, 0x00
+	.byte 0x3f, 0x3f, 0x2d, 0x00
+	.byte 0x00, 0x00, 0x36, 0x00
+	.byte 0x09, 0x00, 0x36, 0x00
+	.byte 0x12, 0x00, 0x36, 0x00
+	.byte 0x1b, 0x00, 0x36, 0x00
+	.byte 0x24, 0x00, 0x36, 0x00
+	.byte 0x2d, 0x00, 0x36, 0x00
+	.byte 0x36, 0x00, 0x36, 0x00
+	.byte 0x3f, 0x00, 0x36, 0x00
+	.byte 0x00, 0x15, 0x36, 0x00
+	.byte 0x09, 0x15, 0x36, 0x00
+	.byte 0x12, 0x15, 0x36, 0x00
+	.byte 0x1b, 0x15, 0x36, 0x00
+	.byte 0x24, 0x15, 0x36, 0x00
+	.byte 0x2d, 0x15, 0x36, 0x00
+	.byte 0x36, 0x15, 0x36, 0x00
+	.byte 0x3f, 0x15, 0x36, 0x00
+	.byte 0x00, 0x2a, 0x36, 0x00
+	.byte 0x09, 0x2a, 0x36, 0x00
+	.byte 0x12, 0x2a, 0x36, 0x00
+	.byte 0x1b, 0x2a, 0x36, 0x00
+	.byte 0x24, 0x2a, 0x36, 0x00
+	.byte 0x2d, 0x2a, 0x36, 0x00
+	.byte 0x36, 0x2a, 0x36, 0x00
+	.byte 0x3f, 0x2a, 0x36, 0x00
+	.byte 0x00, 0x3f, 0x36, 0x00
+	.byte 0x09, 0x3f, 0x36, 0x00
+	.byte 0x12, 0x3f, 0x36, 0x00
+	.byte 0x1b, 0x3f, 0x36, 0x00
+	.byte 0x24, 0x3f, 0x36, 0x00
+	.byte 0x2d, 0x3f, 0x36, 0x00
+	.byte 0x36, 0x3f, 0x36, 0x00
+	.byte 0x3f, 0x3f, 0x36, 0x00
+	.byte 0x00, 0x00, 0x3f, 0x00
+	.byte 0x09, 0x00, 0x3f, 0x00
+	.byte 0x12, 0x00, 0x3f, 0x00
+	.byte 0x1b, 0x00, 0x3f, 0x00
+	.byte 0x24, 0x00, 0x3f, 0x00
+	.byte 0x2d, 0x00, 0x3f, 0x00
+	.byte 0x36, 0x00, 0x3f, 0x00
+	.byte 0x3f, 0x00, 0x3f, 0x00
+	.byte 0x00, 0x15, 0x3f, 0x00
+	.byte 0x09, 0x15, 0x3f, 0x00
+	.byte 0x12, 0x15, 0x3f, 0x00
+	.byte 0x1b, 0x15, 0x3f, 0x00
+	.byte 0x24, 0x15, 0x3f, 0x00
+	.byte 0x2d, 0x15, 0x3f, 0x00
+	.byte 0x36, 0x15, 0x3f, 0x00
+	.byte 0x3f, 0x15, 0x3f, 0x00
+	.byte 0x00, 0x2a, 0x3f, 0x00
+	.byte 0x09, 0x2a, 0x3f, 0x00
+	.byte 0x12, 0x2a, 0x3f, 0x00
+	.byte 0x1b, 0x2a, 0x3f, 0x00
+	.byte 0x24, 0x2a, 0x3f, 0x00
+	.byte 0x2d, 0x2a, 0x3f, 0x00
+	.byte 0x36, 0x2a, 0x3f, 0x00
+	.byte 0x3f, 0x2a, 0x3f, 0x00
+	.byte 0x00, 0x3f, 0x3f, 0x00
+	.byte 0x09, 0x3f, 0x3f, 0x00
+	.byte 0x12, 0x3f, 0x3f, 0x00
+	.byte 0x1b, 0x3f, 0x3f, 0x00
+	.byte 0x24, 0x3f, 0x3f, 0x00
+	.byte 0x2d, 0x3f, 0x3f, 0x00
+	.byte 0x36, 0x3f, 0x3f, 0x00
+	.byte 0x3f, 0x3f, 0x3f, 0x00
