Reboot while unmasking the PIC

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

Reboot while unmasking the PIC

Post by IanSeyler »

I am running into an odd problem with booting up some new multi-core machines. As soon as the code below runs it causes the machine to reboot.

Inserting a 'CLI' before it doesn't help even though interrupts are already disabled earlier on.

Code: Select all

	; Enable specific interrupts
	in al, 0x21
	mov al, 11111001b		; Enable Cascade, Keyboard
	out 0x21, al
	in al, 0xA1
	mov al, 11111110b		; Enable RTC
	out 0xA1, al
Everything checked out on my 16-core AMD but a 32-core and 64-core both reboot. It does seem that the Timer interrupt works correctly in Pure64 so I know the PIC is ok. The code above is from BareMetal OS.

Thanks,
-Ian
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
jbemmel
Member
Member
Posts: 53
Joined: Fri May 11, 2012 11:54 am

Re: Reboot while unmasking the PIC

Post by jbemmel »

What's the IOPL the code is running at?
M2004
Member
Member
Posts: 65
Joined: Sun Mar 07, 2010 2:12 am

Re: Reboot while unmasking the PIC

Post by M2004 »

ReturnInfinity: Have you tried to test whether the problem is interrupt specific?
Enabling/disabling each interrupt one at a time.

Regards
Mac2004
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Reboot while unmasking the PIC

Post by Owen »

What do the ACPI tables say with regards to the machine's legacy hardware?

Its entirely plausible that the machine only has enough PIC support to pretend to the legacy BIOS code that there's a timer, and that the machine doesn't even claim to have a keyboard controller, etc.

Particularly the missing keyboard controller is a good one. Many machines, I/O to the conventional keyboard controller port will do nasty things to the embedded controller.
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

Re: Reboot while unmasking the PIC

Post by IanSeyler »

This was kernel code and any change to the PIC mask caused a reboot. I was using Pure64 v0.4.9 and have now switched over to v0.5.1 (which uses the IO-APIC for interrupts instead of the PIC). Everything seems to be working now on the 32-core. I will test the 64-core later.

-Ian
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

Re: Reboot while unmasking the PIC

Post by IanSeyler »

The 64-core works as well. Let this be a lesson to dump the PIC and go with the IO-APIC!

Now if only the Intel 82576 was fully reverse-compatible with the 8254x instead of just partially...

-Ian
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
Post Reply