Page 1 of 1

Can´t do reset! [Solved]

Posted: Fri Jan 01, 2016 6:05 am
by digo_rp
Hi all,

when I setup APIC mode, disable pic, start smp, OS Kernel goes ok! but I can´t do Reset...

I have been trying keyboard reset, idt with 0 size triple fault reset, and nothing...

my OS just freeze...

does anyone got an idea? just some start please!

thanks so much...

Re: Can´t do reset!

Posted: Fri Jan 01, 2016 6:39 am
by BrightLight
TBH, I don't know much about SMP. But you can try ACPI reset. It's very simple, even simpler than ACPI shutdown.
EDIT: Forgot to say this, ACPI reset isn't supported on Bochs and QEMU, and appears to be broken in VirtualBox. It seems, you'll have to test it on real hardware.

Re: Can´t do reset!

Posted: Fri Jan 01, 2016 7:10 am
by digo_rp
thank you so much.
I´ll check these out!

Re: Can´t do reset!

Posted: Sat Jan 02, 2016 4:28 pm
by onlyonemac
I have used the triple fault reset before; I'm not sure why it's not working for you. I used to do it with interrupts enabled - not sure if that matters.

Re: Can´t do reset!

Posted: Sat Jan 02, 2016 6:32 pm
by digo_rp
thanks... it is a kind of odd stuff...
I can´t figure out why it doesn´t Works.!!!

Re: Can´t do reset!

Posted: Sun Jan 03, 2016 3:30 am
by BrightLight
Did you try ACPI reset?

Re: Can´t do reset!

Posted: Sun Jan 03, 2016 4:40 am
by onlyonemac
Maybe post the code that you're using for your triple-fault reset?

Re: Can´t do reset!

Posted: Sun Jan 03, 2016 6:01 am
by digo_rp
At some of my pcs is not supported!
I don´t understand why that happens...

when I use PIC 8259 Works ok! triple fault, keyboard reset, everything... when I change to APIC, nothing Works....

Re: Can´t do reset!

Posted: Sun Jan 03, 2016 6:51 am
by BrightLight
Why not try something like this?

Code: Select all

void reset()
{
	disable_apic();
	enable_pic();
	disable_smp();

	outportb(0x64,0xFE);		// keyboard reset
	while(1);
}

Re: Can´t do reset!

Posted: Sun Jan 03, 2016 7:00 am
by digo_rp
hum... cool thanks.. I´ll try this...

thanks so much...

Re: Can´t do reset!

Posted: Sun Jan 03, 2016 11:29 am
by onlyonemac
omarrx024 wrote:Why not try something like this?

Code: Select all

void reset()
{
	disable_apic();
	enable_pic();
	disable_smp();

	outportb(0x64,0xFE);		// keyboard reset
	while(1);
}
Sounds good, replace the keyboard reset with your preferred reset method (or try each in turn, from order of most supported to least supported, for maximum compatibility). I was going to suggest something similar to this since he mentioned that the issue occurs only when using the APIC but it is OK when using the PIC.

Re: Can´t do reset!

Posted: Mon Jan 04, 2016 8:26 am
by BrightLight
Of course, you should try ACPI reset first. If that doesn't work, then try the keyboard reset. If all doesn't work, then a triple fault should be a last resort, as it doesn't reset some PCs.

Re: Can´t do reset!

Posted: Tue Jan 05, 2016 1:58 pm
by onlyonemac
omarrx024 wrote:If all doesn't work, then a triple fault should be a last resort, as it doesn't reset some PCs.
Really??? I thought that a reset after an unhandled triple-fault was the one constant in os-dev...

Re: Can´t do reset!

Posted: Tue Jan 05, 2016 2:52 pm
by Kazinsal
onlyonemac wrote:
omarrx024 wrote:If all doesn't work, then a triple fault should be a last resort, as it doesn't reset some PCs.
Really??? I thought that a reset after an unhandled triple-fault was the one constant in os-dev...
The triple fault was introduced in the 286, whose programming manual says that it puts the CPU into a shutdown cycle. Most chipsets interpret the shutdown cycle being initiated to mean "the processor needs to be reset", so they pull the reset pin high (or maybe it's low, I can't remember and I don't have a CPU manual on hand) and the CPU resets.

Technically, if this behaviour has not changed (and it likely hasn't, backwards compatibility being Intel's best friend), it would be a valid option for the shutdown cycle to lead to a power-off or simply a hang.

Re: Can´t do reset!

Posted: Wed Jan 06, 2016 7:46 pm
by digo_rp
Hi all, I´m glad to say that now I can do reset!

the problem was at my setup_pic code

thanks so much guys. a lot ...

:D