@@ -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