A couple of servers have arrived and one of them is not starting my OS.
If someone could find my fault it would be appreciated.
Here is my Init code for the CPU.
Code: Select all
FIL void tCPUs::InitThisCPU()
{
// Disable Cache
asm volatile ("mov %cr0, %rax");
asm volatile ("btr $29, %rax"); // Clear No Write Thru (Bit 29)
asm volatile ("bts $30, %rax"); // Set Cache Disable (Bit 30)
asm volatile ("mov %rax, %cr0");
// Flush Cache
asm volatile ("wbinvd");
// Disable Paging Global Extensions
asm volatile ("mov %cr4, %rax");
asm volatile ("btr $7, %rax"); // Clear Paging Global Extensions (Bit 7)
asm volatile ("mov %rax, %cr4");
// Disable MTRRs and Configure default memory type to UC
asm volatile ("mov $0x000002FF, %ecx");
asm volatile ("rdmsr");
asm volatile ("and $0xFFFFF300, %eax"); // Clear MTRR Enable (Bit 11), Fixed Range MTRR Enable (Bit 10), and Default Memory Type (Bits 7:0) to UC (0x00)
asm volatile ("wrmsr");
// Enable MTRRs
asm volatile ("mov $0x000002FF, %ecx");
asm volatile ("rdmsr");
asm volatile ("bts $11, %eax"); // Set MTRR Enable (Bit 11), Only enables Variable Range MTRR's
asm volatile ("wrmsr");
// Flush Cache
asm volatile ("wbinvd");
// Enable Cache
asm volatile ("mov %cr0, %rax");
asm volatile ("btr $29, %rax"); // Clear No Write Thru (Bit 29)
asm volatile ("btr $30, %rax"); // Clear Cache Disable (Bit 30)
asm volatile ("mov %rax, %cr0");
Progress("InitaliseCPU - Enable Cache Done");
// Enable Floating Point
asm volatile ("mov %cr0, %rax");
asm volatile ("bts $1, %rax"); // Set Monitor co-processor (Bit 1)
asm volatile ("btr $2, %rax"); // Clear Emulation (Bit 2)
asm volatile ("mov %rax, %cr0");
Progress("InitaliseCPU - Floating Point Done");
// Enable SSE
asm volatile ("mov %cr4, %rax");
asm volatile ("bts $9, %rax"); // Set Operating System Support for FXSAVE and FXSTOR instructions (Bit 9)
asm volatile ("bts $10, %rax"); // Set Operating System Support for Unmasked SIMD Floating-Point Exceptions (Bit 10)
asm volatile ("mov %rax, %cr4");
Progress("InitaliseCPU - FSSE Done");
// Enable Math Co-processor
asm volatile ("finit");
Progress("InitaliseCPU - finit Done");
asm volatile ("": : :"%rcx","%rax","cc","memory");
}
Code: Select all
asm volatile ("btr $30, %rax"); // Clear Cache Disable (Bit 30)
Alistair