Skip to content

Commit 7efd48b

Browse files
author
Ian Seyler
committed
Add LFB check
1 parent 6791100 commit 7efd48b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/drivers/lfb/lfb.asm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ lfb_init:
1616
push rbx
1717
push rax
1818

19+
mov rax, [os_screen_lfb] ; Quick check of the LFB address
20+
cmp rax, 0 ; Is it 0?
21+
je lfb_init_error ; If so, no LFB was configured
22+
1923
; Convert font data to pixel data. The default 12x6 font is 72 pixels per glyph. 288 bytes per.
2024
mov rdi, os_font
2125
mov rsi, font_data
@@ -115,7 +119,13 @@ render_done:
115119
; Overwrite the kernel b_output function so output goes to the screen instead of the serial port
116120
mov rax, lfb_output_chars
117121
mov [0x100018], rax
122+
jmp lfb_init_done
123+
124+
lfb_init_error:
125+
mov rax, b_output_serial
126+
mov [0x100018], rax ; Set kernel b_output to the serial port
118127

128+
lfb_init_done:
119129
pop rax
120130
pop rbx
121131
pop rcx

0 commit comments

Comments
 (0)