bootloader - the loops - warm processor
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: bootloader - the loops - warm processor
You don't reload CS. You can do that pretty easily by adding a jmp 0x8:somelabel after loading your GDT or other segment registers.
Re: bootloader - the loops - warm processor
I think i was reloading cs.
Code: Select all
$Main:
cli
xor ax, ax
mov ds, ax
lgdt [gdt]
mov eax, cr0
or eax, 1
mov cr0, eax
jmp 08h:$PMode_32Bits
;$$
bits 32
$PMode_32Bits:
mov ax, 16
mov ds, ax
mov ss, ax
mov esp, 090000h
;$$
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: bootloader - the loops - warm processor
Yes, I see now. That was not in your previous post, which I replied to.
Re: bootloader - the loops - warm processor
Sorry, forgot to type in the actual jump.
So i can't see why i cant execute HLT.
So i can't see why i cant execute HLT.
Re: bootloader - the loops - warm processor
Are you loading an actual GDT or a pointer?
Re: bootloader - the loops - warm processor
An actual GDT,
Code: Select all
gdts: dq 0
dw 0FFFFh
dw 0
db 0
db 10011010b
db 11001111b
db 0
dw 0FFFFh
dw 0
db 0
db 10010010b
db 11001111b
db 0
gdte:
gdt: dw gdte - gdts - 1
dd gdts
Re: bootloader - the loops - warm processor
I've tried MikeOS and DexOS, they both have that problem!
Even when idle, they use 100% of the CPU.
Seems to me that they didn't implement a "halting" state when no query is being executed so that the CPU can rest.
Even when idle, they use 100% of the CPU.
Seems to me that they didn't implement a "halting" state when no query is being executed so that the CPU can rest.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: bootloader - the loops - warm processor
I would say Windows Server 2003 uses throttling and sleep states to reduce power consumption when idle (and therefore cool it down). Most hobby OS's don't do that.
I also think your gauge of "100% CPU" is flawed. Hot or not isn't how you determine CPU usage
I also think your gauge of "100% CPU" is flawed. Hot or not isn't how you determine CPU usage
Re: bootloader - the loops - warm processor
Thanks for you reply, what do you mean that it's flawed?
The virtual machine process, Bochs and VPC uses 100% when im running my code or when i tried MikeOS and DexOS.
When im running a code in RMode and end the code with a simple loop with HLT, the virtual machine process only uses 0-2% (when idle).
I've tried running the OSes through real hardware and not via a virtual machine, and the processor gets really hot - the exact same way when running the codes or the OSes via a virtual machine.
Not everyone has a CPU without a fan and notices the amount of heat the OS is making the CPU produce.
The virtual machine process, Bochs and VPC uses 100% when im running my code or when i tried MikeOS and DexOS.
When im running a code in RMode and end the code with a simple loop with HLT, the virtual machine process only uses 0-2% (when idle).
I've tried running the OSes through real hardware and not via a virtual machine, and the processor gets really hot - the exact same way when running the codes or the OSes via a virtual machine.
Not everyone has a CPU without a fan and notices the amount of heat the OS is making the CPU produce.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: bootloader - the loops - warm processor
If the virtual machine is running at 0-2% CPU usage, that proves that your method of determining that hlt isn't working is flawed (and that it is in fact working). Just because your processor gets hot doesn't mean that it's under a full load.
Like I said before, Windows Server will put the CPU into a sleep state, or throttle it, in order to reduce power consumption and therefore reduce heat. Your OS doesn't do that.
Like I said before, Windows Server will put the CPU into a sleep state, or throttle it, in order to reduce power consumption and therefore reduce heat. Your OS doesn't do that.
Re: bootloader - the loops - warm processor
Okay, I understand what you mean.
So I should look at sleep states or throttle. Since my OS will just be a Web Server OS.
Thanks for you help.
So I should look at sleep states or throttle. Since my OS will just be a Web Server OS.
Thanks for you help.
Re: bootloader - the loops - warm processor
Well DexOS does have hlt in the main loops, example CLI loop
Plus my getkeypress function have it in.
Code: Select all
CheckForKey:
call GetCommand
call ProcessCmd
hlt
jmp CheckForKey
Re: bootloader - the loops - warm processor
Great that you could answer Dex.
Your OS is great for "HTPC-Like" computers. But without some kind of power management, the CPU gets really hot. (If there is no fan).
Most PII and PIII computers i have doesn't have/need a fan because of the huge heatsink.
Have you tried your OS with a old CPU without a fan?
Your OS is great for "HTPC-Like" computers. But without some kind of power management, the CPU gets really hot. (If there is no fan).
Most PII and PIII computers i have doesn't have/need a fan because of the huge heatsink.
Have you tried your OS with a old CPU without a fan?
Re: bootloader - the loops - warm processor
Sure, i have run it as a server on this old PCKurdistan wrote:Have you tried your OS with a old CPU without a fan?
http://www.youtube.com/watch?v=ErPDIG8HQno
For 2 weeks or more, without a problem, but i will look into it, to see what i can do about it, thanks.