Skip to content

Commit 37b49f4

Browse files
author
Ian Seyler
committed
Output 8 blocks instead of 4
1 parent 390280c commit 37b49f4

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Return Infinity
3+
Copyright (c) 2025 Return Infinity
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/init/hpet.asm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
init_hpet:
1010
; Verify there is a valid HPET address
1111
mov rax, [p_HPET_Address]
12+
cmp rax, 0
1213
jz os_hpet_init_error
1314

1415
; Verify the capabilities of HPET

src/pure64.asm

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ start64:
255255
mov eax, 0x00404040
256256
rep stosd
257257

258-
; Visual Debug (1/4)
258+
; Visual Debug (1/8)
259259
mov ebx, 0
260260
call debug_block
261261

@@ -394,7 +394,7 @@ clearcs64:
394394

395395
lgdt [GDTR64] ; Reload the GDT
396396

397-
; Visual Debug (2/4)
397+
; Visual Debug (2/8)
398398
mov ebx, 2
399399
call debug_block
400400

@@ -711,12 +711,26 @@ pde_end:
711711
and cl, 1
712712
mov byte [p_x2APIC], cl
713713

714+
; Visual Debug (3/8)
715+
mov ebx, 4
716+
call debug_block
717+
714718
call init_acpi ; Find and process the ACPI tables
719+
720+
; Visual Debug (4/8)
721+
mov ebx, 6
722+
call debug_block
723+
715724
call init_cpu ; Configure the BSP CPU
725+
726+
; Visual Debug (5/8)
727+
mov ebx, 8
728+
call debug_block
729+
716730
call init_hpet ; Configure the HPET
717731

718-
; Visual Debug (3/4)
719-
mov ebx, 4
732+
; Visual Debug (6/8)
733+
mov ebx, 10
720734
call debug_block
721735

722736
call init_smp ; Init of SMP, deactivate interrupts
@@ -810,6 +824,10 @@ no_address_size:
810824
mov al, [p_x2APIC]
811825
stosb
812826

827+
; Visual Debug (7/8)
828+
mov ebx, 12
829+
call debug_block
830+
813831
; Set the Linear Frame Buffer to use write-combining
814832
mov eax, 0x80000001
815833
cpuid
@@ -864,8 +882,8 @@ lfb_wc_end:
864882
mov ecx, ((32768 - PURE64SIZE) / 8)
865883
rep movsq ; Copy 8 bytes at a time
866884

867-
; Visual Debug (4/4)
868-
mov ebx, 6
885+
; Visual Debug (8/8)
886+
mov ebx, 14
869887
call debug_block
870888

871889
%ifdef BIOS
@@ -891,6 +909,7 @@ clear_regs:
891909
xor r13, r13
892910
xor r14, r14
893911
xor r15, r15
912+
jmp $
894913
jmp 0x00100000 ; Done with Pure64, jump to the kernel
895914

896915

@@ -937,11 +956,12 @@ debug_block:
937956
shl edx, 2 ; Quick multiply by 4 for line offset
938957
xor ecx, ecx
939958
mov cx, [0x00005F00 + 0x10] ; Screen X
940-
shr cx, 4 ; CX = total amount of 8-pixel wide blocks
941-
sub cx, 4
959+
shr cx, 4 ; Quick divide by 16 (box width plus blank width)
960+
sub cx, 8 ; CX = total amount of 8-pixel wide blocks
942961
add ebx, ecx
943962
shl ebx, 5 ; Quick multiply by 32 (8 pixels by 4 bytes each)
944963
add rdi, rbx
964+
sub rdi, 16 ; Move left by half a box width (4 pixels by 4 bytes each)
945965

946966
; Draw the 8x8 pixel block
947967
mov ebx, 8 ; 8 pixels tall

0 commit comments

Comments
 (0)