Skip to content

Commit bcc6760

Browse files
funcion print normal escribe string.
1 parent 5b859df commit bcc6760

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

asm/boot/uefi.asm

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ num2strWord:
11041104

11051105

11061106
;;==============================================================================
1107-
;; print - impresion a buffer de video luego de ExitBootSerivces()
1107+
;; print - impresion utf8 a buffer de video luego de ExitBootSerivces()
11081108
;;==============================================================================
11091109
;; Argumentos:
11101110
;; -- rdx = cadena fmt
@@ -1127,18 +1127,24 @@ strcpy16:
11271127
print_flush:
11281128
mov rax, [FB]
11291129
mov rdi, [PPSL]
1130-
1131-
mov rcx, 'a'
1132-
lea rsi, [font_data + 8 * rcx]
1130+
mov r8, 0 ;; ix src str.
1131+
1132+
.loop_read_string_char:
1133+
push rax
1134+
mov rcx, 0
1135+
mov cl, [msg_test8 + r8]
1136+
cmp cl, 0
1137+
je .string_flush_end
1138+
lea rsi, [font_data + 8 * rcx] ;; rsi p2fontLine
11331139
mov rdx, 0
1134-
.loop_vertical_line:
1140+
.loop_font_vertical_line:
11351141
cmp rdx, font_height
11361142
je .char_flush_end
11371143
mov rcx, 0
11381144
mov rbx, 0
11391145
mov bl, [rsi + rdx]
11401146

1141-
.loop_horizontal_pixel:
1147+
.loop_font_horizontal_pixel:
11421148
cmp rcx, 8
11431149
je .next_line
11441150
bt rbx, rcx
@@ -1151,17 +1157,27 @@ print_flush:
11511157
mov dword [rax + 4 * rcx], 0x00FFFFFF
11521158
.nextPixel:
11531159
inc rcx
1154-
jmp .loop_horizontal_pixel
1160+
jmp .loop_font_horizontal_pixel
11551161

11561162
.next_line:
11571163
inc rdx
11581164
lea rax, [rax + 4 * rdi]
1159-
jmp .loop_vertical_line
1165+
jmp .loop_font_vertical_line
11601166

11611167
.char_flush_end:
1168+
inc r8
1169+
pop rax
1170+
lea rax, [rax + 8 * r8]
1171+
lea rax, [rax + 8 * r8]
1172+
lea rax, [rax + 8 * r8]
1173+
lea rax, [rax + 8 * r8]
1174+
jmp .loop_read_string_char
1175+
1176+
.string_flush_end:
11621177
cli
11631178
hlt
11641179
ret
1180+
\
11651181

11661182

11671183
times 4 * 1024 - ($ - $$) db 0 ;; Zero padding resto de .text
@@ -1278,7 +1294,7 @@ msg_will_exit_uefi_services: dw utf16("A continuacion hara exit de uefi service
12781294
msg_boot_services_exit_ok: dw utf16("Exit from uefi services exitoso"), 0
12791295

12801296
msg_test: dw utf16("Test"), 13, 0xA, 0
1281-
1297+
msg_test8: db "ab", 0
12821298

12831299
fmt_memmap_cant_descriptors: dw utf16("Uefi returned memmap | Cant descriptors = %d"), 13, 0xA, 0
12841300

build/uefi.elf

0 Bytes
Binary file not shown.

build/uefi.sys

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)