flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > SMP |
Author |
|
revolution 07 Oct 2009, 07:49
Perhaps the AMD docs can help a bit? I don't know if they can, just that sometimes there is some extra info the Intel forget to tell.
|
|||
07 Oct 2009, 07:49 |
|
sinsi 07 Oct 2009, 07:58
Yeah, but the spec is intel (mp 1.4) from years ago, but I will give it a try.
Does your website have an instant link to the pdf's? <edit |
|||
07 Oct 2009, 07:58 |
|
Pirata Derek 07 Oct 2009, 08:59
If you use:
Code: ... cli hlt nop ret ... The CPU will be "STONED", because HLT maintains it in a low operative state, but CLI doesn't let interrupts (like a mouse movement) to wake it up except for the RESET-PIN interrupt (it's the interrupt with the most priority to be executed) I think you should find another way to let some hardware interrupts wake up CPU. |
|||
07 Oct 2009, 08:59 |
|
revolution 07 Oct 2009, 09:33
Pirata Derek wrote: If you use: Code: ...
@@:
cli
hlt
jmp @b
... [edit] I hope I am not confusing this with the ARM stuff. Anyhow, it should be easy to setup a test to confirm. |
|||
07 Oct 2009, 09:33 |
|
ManOfSteel 07 Oct 2009, 09:45
Pirata Derek wrote: If you use: Yeah, because this is deliberately badly written code. Of course you shouldn't explicitly give it a "cli". hlt should *always* be called in a "sti" area. And what's with the nop? Have I missed something somewhere in the docs? Is it for older machines (like when using in/out)? |
|||
07 Oct 2009, 09:45 |
|
Pirata Derek 07 Oct 2009, 12:21
Yes, i know:
I inserted the CLI because it is in the second question of the first post. (check it) The NOP is an optional that i use to be sure CPU won't perform any operation after returning to an interrupt (fired after the HLT) Once, a driver without the NOP after the HLT crashed my system. with the NOP, it didn't crash no more. I don't know why, maybe the NT kernel sucks... |
|||
07 Oct 2009, 12:21 |
|
edfed 08 Oct 2009, 11:53
with PIT set to 24 Hz and HLT in the main loop, you set the minimal looping frequency to 24 Hz.
Code: |________________|________________|______________|_____ ^ PIT interrupt, 24 times/sec. default 18,2 times/sec all code executed between two PIT interrupt is ended by HLT. then, to wake PC, you use PIT. measure of time between HLT and PIT int will give you the spare computing power you have. |
|||
08 Oct 2009, 11:53 |
|
Madis731 09 Oct 2009, 10:32
I'm writing some 64-bit SMP protected-mode code right now and:
Q1: No, but I send them anyway - some CPUs *might* not wake up on the first one, but most (newer) do. Q2: You suspend a CPU with HLT HLT is 'woken' by an interrupt - so if you return from an interrupt, you continue to the next instrction. IF you suspend a CPU with CLI/HLT the only way to wake it up is RESET and that's not what you usually want. I do a CLI/HLT only to debug with QEMU. Q2a: If you use CLI/HLT then - YES! Intel docs do suck, but everything is there |
|||
09 Oct 2009, 10:32 |
|
revolution 09 Oct 2009, 10:40
Madis731: Are you sure that NMI does not also wake up the CPU from a CLI/HLT?
|
|||
09 Oct 2009, 10:40 |
|
cod3b453 23 Oct 2009, 17:09
Manual says cli doesn't affect NMI and execution resumes after hlt on NMI or SMI.
|
|||
23 Oct 2009, 17:09 |
|
sinsi 21 May 2010, 06:40
If I start an AP via INIT-SIPI-SIPI, then stone it with HLT, is sending it an NMI a good way to unstone it or is there a better way?
All the handler does is IRET and the code continues as I expect but is it good/bad/shrug? |
|||
21 May 2010, 06:40 |
|
cod3b453 21 May 2010, 08:53
Yes, the APIC can send another IPI (type NMI) to wake up a target processor which behaves like a normal interrupt if you program the LVT/LINT of the LAPICs of all processors.
Intel Vol 3A and AMD Vol 2 should give you more details. |
|||
21 May 2010, 08:53 |
|
sinsi 21 May 2010, 09:06
It just seems strange to send NMI, since that was historically a catastrophic failure (ram parity error).
|
|||
21 May 2010, 09:06 |
|
cod3b453 21 May 2010, 10:23
Well you can still send a normal IPI if you don't use cli but I don't know how that affects interrupts across processors -- maybe someone here can enlighten us
|
|||
21 May 2010, 10:23 |
|
cod3b453 29 May 2010, 09:00
Update: seems the IOAPIC directs all normal interrupts to core 0 so you can use this to stop APs with hlt and wake them with a normal (type fixed) IPI at a vector of your choice. I'm not in a position to test this with my OS atm but hope to soon.
|
|||
29 May 2010, 09:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.