BareMetal OS issues
Posted: Wed Sep 30, 2015 2:19 pm
Hello all,
This is my first post but I have been reading here a lot. I am having an issue with BareMetal OS. The part that is giving me issues is in kernel64.asm here is the code that will cause it to spew binary across the screen and eventually to a blank screen and locked up.
; Set up the stack
shl rax, 21 ; Shift left 21 bits for a 2 MiB stack
add rax, [os_StackBase] ; The stack decrements when you "push", start at 2 MiB in
sub rax, 8
mov rsp, rax
Now I am sure that this is not an issue for most as I have ran the code on an older dual core hyperthreaded cpu and the OS runs exactly as it is designed. My problem only happens on an I7 5820K and it is overclocked as well. The motherboard is an ASUS X99-A. I have lowered the cpu speed to below stock settings and also disabled all but 2 cores with and without hyper threading. The mov rsp, rax is the line that if I comment it out that the OS will boot to the cmd line interface. Also if I do a dir on cmd line I will get a green screen. I am convinced that the issue is related to the CPU or the MOBO.
I had located another issue and solved it if anyone else is running an overclocked CPU. In smp.asm 1 line before the wait3 label is a value to loop and wait for the cpu to stabilize after turning on a core. I changed the line of code to this: add rax, 200. I think it was 20 before. Before this change, BMOS would boot with a different core count every time. The CPU was not reporting back to the code that it was able to lock the core, therefore BMOS was not seeing it as an active core.
Any help or ideas are welcome. I have been fighting this issue for over a week now.
Thanks
Tim
This is my first post but I have been reading here a lot. I am having an issue with BareMetal OS. The part that is giving me issues is in kernel64.asm here is the code that will cause it to spew binary across the screen and eventually to a blank screen and locked up.
; Set up the stack
shl rax, 21 ; Shift left 21 bits for a 2 MiB stack
add rax, [os_StackBase] ; The stack decrements when you "push", start at 2 MiB in
sub rax, 8
mov rsp, rax
Now I am sure that this is not an issue for most as I have ran the code on an older dual core hyperthreaded cpu and the OS runs exactly as it is designed. My problem only happens on an I7 5820K and it is overclocked as well. The motherboard is an ASUS X99-A. I have lowered the cpu speed to below stock settings and also disabled all but 2 cores with and without hyper threading. The mov rsp, rax is the line that if I comment it out that the OS will boot to the cmd line interface. Also if I do a dir on cmd line I will get a green screen. I am convinced that the issue is related to the CPU or the MOBO.
I had located another issue and solved it if anyone else is running an overclocked CPU. In smp.asm 1 line before the wait3 label is a value to loop and wait for the cpu to stabilize after turning on a core. I changed the line of code to this: add rax, 200. I think it was 20 before. Before this change, BMOS would boot with a different core count every time. The CPU was not reporting back to the code that it was able to lock the core, therefore BMOS was not seeing it as an active core.
Any help or ideas are welcome. I have been fighting this issue for over a week now.
Thanks
Tim