Index: kernel/arch/amd64/src/boot/boot.S
===================================================================
--- kernel/arch/amd64/src/boot/boot.S	(revision 7bcfbbc039dd4d392dc880cbc1a87b94b7ca853f)
+++ kernel/arch/amd64/src/boot/boot.S	(revision ac88c93e54a03010f4e42edfccfda35af3482f3e)
@@ -73,6 +73,24 @@
 	movl %ebx, grub_ebx
 	
+	# Protected 32-bit. We want to reuse the code-seg descriptor,
+	# the Default operand size must not be 1 when entering long mode
+	
+	movl $0x80000000, %eax  
+ 	cpuid
+ 	cmp $0x80000000, %eax						# any function > 80000000h?
+	jbe long_mode_unsupported
+	movl $(AMD_CPUID_EXTENDED), %eax			# Extended function code 80000001
+	cpuid
+	bt $29, %edx								# Test if long mode is supported.
+ 	jc long_mode_supported
+
+	long_mode_unsupported:
+		movl $long_mode_msg, %esi
+		jmp error_halt
+	
+	long_mode_supported:
+	
 #ifdef CONFIG_FB
-	mov $vesa_init, %esi;
+	mov $vesa_init, %esi
 	mov $VESA_INIT_SEGMENT << 4, %edi
 	mov $e_vesa_init - vesa_init, %ecx
@@ -93,22 +111,4 @@
 	mov %bx, KA2PA(vesa_bpp)
 #endif	
-
-	# Protected 32-bit. We want to reuse the code-seg descriptor,
-	# the Default operand size must not be 1 when entering long mode
-	
-	movl $0x80000000, %eax  
- 	cpuid
- 	cmp $0x80000000, %eax						# any function > 80000000h?
-	jbe long_mode_unsupported
-	movl $(AMD_CPUID_EXTENDED), %eax			# Extended function code 80000001
-	cpuid
-	bt $29, %edx								# Test if long mode is supported.
- 	jc long_mode_supported
-
-	long_mode_unsupported:
-		cli
-		hlt
-	
-	long_mode_supported:
 	
 	# Enable 64-bit page transaltion entries - CR4.PAE = 1.
@@ -446,5 +446,65 @@
 .align 4
 e_vesa_init:
-#endif	
+#endif
+
+# Print string from %esi to EGA display (in red) and halt
+error_halt:
+	movl $0xb8000, %edi						# base of EGA text mode memory
+	xorl %eax, %eax
+	
+	movw $0x3d4, %dx						# read bits 8 - 15 of the cursor address
+	movb $0xe, %al
+	outb %al, %dx
+	
+	movw $0x3d5, %dx
+	inb %dx, %al
+	shl $8, %ax
+	
+	movw $0x3d4, %dx						# read bits 0 - 7 of the cursor address
+	movb $0xf, %al
+	outb %al, %dx
+	
+	movw $0x3d5, %dx
+	inb %dx, %al
+	
+	cmp $1920, %ax
+	jbe cursor_ok
+		movw $1920, %ax						# sanity check for the cursor on the last line
+	cursor_ok:
+	
+	movw %ax, %bx
+	shl $1, %eax
+	addl %eax, %edi
+	
+	movw $0x0c00, %ax						# black background, light red foreground
+	cld
+	
+	ploop:
+		lodsb
+		cmp $0, %al
+		je ploop_end
+		stosw
+		inc %bx	
+		jmp ploop
+	ploop_end:
+	
+	movw $0x3d4, %dx						# write bits 8 - 15 of the cursor address
+	movb $0xe, %al
+	outb %al, %dx
+	
+	movw $0x3d5, %dx
+	movb %bh, %al
+	outb %al, %dx
+	
+	movw $0x3d4, %dx						# write bits 0 - 7 of the cursor address
+	movb $0xf, %al
+	outb %al, %dx
+	
+	movw $0x3d5, %dx
+	movb %bl, %al
+	outb %al, %dx
+		
+	cli
+	hlt
 				
 .section K_DATA_START, "aw", @progbits
@@ -514,2 +574,5 @@
 grub_ebx:
 	.long 0
+
+long_mode_msg:
+	.ascii "64 bit long mode not supported. System halted.\0"
