From 37b49f4dae84632d12a339d310ec034e2b3396cb Mon Sep 17 00:00:00 2001 From: Ian Seyler Date: Thu, 26 Jun 2025 16:08:15 -0400 Subject: [PATCH 1/2] Output 8 blocks instead of 4 --- LICENSE | 2 +- src/init/hpet.asm | 1 + src/pure64.asm | 36 ++++++++++++++++++++++++++++-------- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/LICENSE b/LICENSE index 003b733..5c22cee 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Return Infinity +Copyright (c) 2025 Return Infinity Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/init/hpet.asm b/src/init/hpet.asm index 6ad0568..1cfa1c9 100644 --- a/src/init/hpet.asm +++ b/src/init/hpet.asm @@ -9,6 +9,7 @@ init_hpet: ; Verify there is a valid HPET address mov rax, [p_HPET_Address] + cmp rax, 0 jz os_hpet_init_error ; Verify the capabilities of HPET diff --git a/src/pure64.asm b/src/pure64.asm index 4fb51f2..89c5d93 100644 --- a/src/pure64.asm +++ b/src/pure64.asm @@ -255,7 +255,7 @@ start64: mov eax, 0x00404040 rep stosd -; Visual Debug (1/4) +; Visual Debug (1/8) mov ebx, 0 call debug_block @@ -394,7 +394,7 @@ clearcs64: lgdt [GDTR64] ; Reload the GDT -; Visual Debug (2/4) +; Visual Debug (2/8) mov ebx, 2 call debug_block @@ -711,12 +711,26 @@ pde_end: and cl, 1 mov byte [p_x2APIC], cl +; Visual Debug (3/8) + mov ebx, 4 + call debug_block + call init_acpi ; Find and process the ACPI tables + +; Visual Debug (4/8) + mov ebx, 6 + call debug_block + call init_cpu ; Configure the BSP CPU + +; Visual Debug (5/8) + mov ebx, 8 + call debug_block + call init_hpet ; Configure the HPET -; Visual Debug (3/4) - mov ebx, 4 +; Visual Debug (6/8) + mov ebx, 10 call debug_block call init_smp ; Init of SMP, deactivate interrupts @@ -810,6 +824,10 @@ no_address_size: mov al, [p_x2APIC] stosb +; Visual Debug (7/8) + mov ebx, 12 + call debug_block + ; Set the Linear Frame Buffer to use write-combining mov eax, 0x80000001 cpuid @@ -864,8 +882,8 @@ lfb_wc_end: mov ecx, ((32768 - PURE64SIZE) / 8) rep movsq ; Copy 8 bytes at a time -; Visual Debug (4/4) - mov ebx, 6 +; Visual Debug (8/8) + mov ebx, 14 call debug_block %ifdef BIOS @@ -891,6 +909,7 @@ clear_regs: xor r13, r13 xor r14, r14 xor r15, r15 + jmp $ jmp 0x00100000 ; Done with Pure64, jump to the kernel @@ -937,11 +956,12 @@ debug_block: shl edx, 2 ; Quick multiply by 4 for line offset xor ecx, ecx mov cx, [0x00005F00 + 0x10] ; Screen X - shr cx, 4 ; CX = total amount of 8-pixel wide blocks - sub cx, 4 + shr cx, 4 ; Quick divide by 16 (box width plus blank width) + sub cx, 8 ; CX = total amount of 8-pixel wide blocks add ebx, ecx shl ebx, 5 ; Quick multiply by 32 (8 pixels by 4 bytes each) add rdi, rbx + sub rdi, 16 ; Move left by half a box width (4 pixels by 4 bytes each) ; Draw the 8x8 pixel block mov ebx, 8 ; 8 pixels tall From 90c8194ca5ee45f8e48aaca3ce4c4871f700fe90 Mon Sep 17 00:00:00 2001 From: Ian Seyler Date: Thu, 26 Jun 2025 16:11:42 -0400 Subject: [PATCH 2/2] Remove dubug `jmp $` --- src/pure64.asm | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pure64.asm b/src/pure64.asm index 89c5d93..18cdf62 100644 --- a/src/pure64.asm +++ b/src/pure64.asm @@ -909,7 +909,6 @@ clear_regs: xor r13, r13 xor r14, r14 xor r15, r15 - jmp $ jmp 0x00100000 ; Done with Pure64, jump to the kernel