added debuging 'errors'
also there is special handling for them in error.inc
This commit is contained in:
@@ -48,7 +48,7 @@
|
|||||||
%define VBR_ERROR_RESERVED_w 'w'
|
%define VBR_ERROR_RESERVED_w 'w'
|
||||||
%define VBR_ERROR_RESERVED_x 'x'
|
%define VBR_ERROR_RESERVED_x 'x'
|
||||||
|
|
||||||
; 26 errors, 8 in use
|
; 22 errors, 8 in use
|
||||||
%define STAGE2_A20_FAILED 'A'
|
%define STAGE2_A20_FAILED 'A'
|
||||||
%define STAGE2_SIGNATURE_MISSING 'B'
|
%define STAGE2_SIGNATURE_MISSING 'B'
|
||||||
%define STAGE2_MM_E820_NO_SUPPORT 'C'
|
%define STAGE2_MM_E820_NO_SUPPORT 'C'
|
||||||
@@ -71,27 +71,39 @@
|
|||||||
%define STAGE2_ERROR_RESERVED_T 'T'
|
%define STAGE2_ERROR_RESERVED_T 'T'
|
||||||
%define STAGE2_ERROR_RESERVED_U 'U'
|
%define STAGE2_ERROR_RESERVED_U 'U'
|
||||||
%define STAGE2_ERROR_RESERVED_V 'V'
|
%define STAGE2_ERROR_RESERVED_V 'V'
|
||||||
%define STAGE2_ERROR_RESERVED_W 'W'
|
|
||||||
%define STAGE2_ERROR_RESERVED_X 'X'
|
; for development only, specific errors should be above.
|
||||||
%define STAGE2_ERROR_RESERVED_Y 'Y'
|
%define STEVIA_DEBUG_OK 'W'
|
||||||
%define STAGE2_ERROR_RESERVED_Z 'Z'
|
%define STEVIA_DEBUG_ERR 'X'
|
||||||
|
%define STEVIA_DEBUG_UNIMPLEMENTED 'Y'
|
||||||
|
%define STEVIA_DEBUG_HALT 'Z'
|
||||||
|
|
||||||
|
|
||||||
%macro ERROR 1
|
%macro ERROR 1
|
||||||
|
xor ax, ax
|
||||||
mov al, %1
|
mov al, %1
|
||||||
jmp error
|
jmp error
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
; pass error as ascii character in al, errors a-zA-Z or 0-9
|
; pass error as ascii character in al, errors a-zA-Z or 0-9
|
||||||
error:
|
error:
|
||||||
; color 0x4F is white on red
|
|
||||||
; fs = 0xb800 => fs:0x0000 = 0xb8000
|
; fs = 0xb800 => fs:0x0000 = 0xb8000
|
||||||
mov dx, 0xB800
|
mov dx, 0xB800
|
||||||
mov fs, dx
|
mov fs, dx
|
||||||
|
|
||||||
|
mov dx, STEVIA_DEBUG_OK
|
||||||
|
cmp ax, dx
|
||||||
|
jge error.debug_err
|
||||||
|
|
||||||
; the characters are two bytes in the order of 0xb8000: byte c, byte attribute
|
; the characters are two bytes in the order of 0xb8000: byte c, byte attribute
|
||||||
; since x86 is le, we store the attribute in the MSB of dx
|
; since x86 is le, we store the attribute in the MSB of dx
|
||||||
mov dh, 0x4F
|
mov dh, 0x4F ; color 0x4F is white text/red background
|
||||||
|
mov dl, al
|
||||||
|
mov word [fs:0x0000], dx
|
||||||
|
jmp error.stop
|
||||||
|
|
||||||
|
.debug_err:
|
||||||
|
mov dh, 0x5F ; debug case is white text/purple background
|
||||||
mov dl, al
|
mov dl, al
|
||||||
mov word [fs:0x0000], dx
|
mov word [fs:0x0000], dx
|
||||||
|
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ main:
|
|||||||
|
|
||||||
; jump to entry point
|
; jump to entry point
|
||||||
; TODO
|
; TODO
|
||||||
|
ERROR STEVIA_DEBUG_HALT
|
||||||
|
|
||||||
hcf:
|
hcf:
|
||||||
hlt
|
hlt
|
||||||
|
|||||||
Reference in New Issue
Block a user