From 9b22a6965579ea1867aea291d910c96f386b518b Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Tue, 24 Aug 2021 14:09:29 -0500 Subject: major backup 8.24.21 --- src/bootloader/cpu_check.asm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/bootloader/cpu_check.asm') diff --git a/src/bootloader/cpu_check.asm b/src/bootloader/cpu_check.asm index 0fa6ddf..ec5ee7b 100644 --- a/src/bootloader/cpu_check.asm +++ b/src/bootloader/cpu_check.asm @@ -1,4 +1,4 @@ -[extern _meminfo_loc] +[extern _meminfo] detect_arch: ; detect CPUID @@ -19,6 +19,7 @@ cpuid and edx, 0x0020000000 jz .print_long_error + ; APIC mov eax, 0x00000001 cpuid @@ -31,14 +32,13 @@ jz .print_sse_error mov bx, .no_error -mov cx, 0 call bios_print ; get memory mappings mov ax, 0 mov es, ax -mov ax, _meminfo_loc +mov ax, _meminfo mov di, ax mov eax, 0xe820 @@ -64,50 +64,50 @@ je .mem_detected jmp .mem_detect_loop .mem_detected: +add di,24 +mov ecx, 24 +mov al, 0 +rep stosb + ret .print_cpuid_error: mov bx, .cpuid_error -mov cx, 0 call bios_print jmp $ .print_long_error: mov bx, .arch_error -mov cx, 0 call bios_print jmp $ .print_apic_error: mov bx, .apic_error -mov cx, 0 call bios_print jmp $ .print_mem_error: mov bx, .mem_error -mov cx, 0 call bios_print jmp $ .print_sse_error: mov bx, .sse_error -mov cx, 0 call bios_print jmp $ .cpuid_error: - db "No CPUID capabilitity", 0x0 + db "Somehow, your CPU doesn't even support the ability to detect its abilities. I'm gonna go out on a limb and say your cpu is too old to run this OS.", 0x0 .arch_error: - db "This operating system was compiled to run in 64 bit mode!", 0x0 + db "This operating system requires a x64 processor.", 0x0 .apic_error: - db "No apic support", 0x0 + db "No APIC support.", 0x0 .mem_error: - db "Could not get information on memory!", 0x0 + db "Couldn't obtain memory map.", 0x0 .sse_error: - db "This OS requires SSE", 0x0 + db "This OS requires the SSE instruction set.", 0x0 .no_error: - db "CPU info gathered!", 0x0 + db "CPU meets requirements to boot!", 0x0 -- cgit v1.2.3