Is there a way to put Windows in PIC-mode instead of APIC-mode?

We have a Windows product image that was built on a PIC-based
motherboard, but now we will be shipping a lower-cost APIC-based
motherboard *as well* (we will be supporting both motherboards).
Building another APIC-based Windows image is something I want to avoid
so as to not support two nearly-identical images, but also the customer
won’t know which image to use since the motherboard details are hidden
from them. So, I’d like to have just one image.

Is there a way to configure Windows to always run in PIC-mode even if an
APIC is present?

Unfortunately, that’s not an option in the BIOS of the new motherboard.

I searched around on Google and the MS Knowledgebase, but didn’t come up
with anything. (Although I did find that Linux has what I want with a
“noapic” option, which suggests that it might be possible.)

Any ideas?

The answer is “no” but I am really curious as to how your product ends
up with a dependency on the type of interrupt controller.

On Dec 8, 2007 12:18 PM, Taed Wynnell wrote:
>
>
> We have a Windows product image that was built on a PIC-based motherboard,
> but now we will be shipping a lower-cost APIC-based motherboard as well
> (we will be supporting both motherboards). Building another APIC-based
> Windows image is something I want to avoid so as to not support two
> nearly-identical images, but also the customer won’t know which image to use
> since the motherboard details are hidden from them. So, I’d like to have
> just one image.
>
> Is there a way to configure Windows to always run in PIC-mode even if an
> APIC is present?
>
> Unfortunately, that’s not an option in the BIOS of the new motherboard.
>
> I searched around on Google and the MS Knowledgebase, but didn’t come up
> with anything. (Although I did find that Linux has what I want with a
> “noapic” option, which suggests that it might be possible.)
>
> Any ideas?
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer


Mark Roddy

> Is there a way to configure Windows to always run in PIC-mode even if an APIC is present?

Sure - just disable APIC in BIOS, and reinstall Windows. Please note if you disable APIC in BIOS settings, Windows installation that got installed with APIC enabled is not going to work, because PIC and APIC require totally different HAL versions.

Unfortunately, that’s not an option in the BIOS of the new motherboard.

I hope by now you understand that even if this option was available, it still would not lead you anywhere, as far as your product is concerned…

We have a Windows product image that was built on a PIC-based motherboard,
but now we will be shipping a lower-cost APIC-based motherboard *as well*
(we will be supporting both motherboards). Building another APIC-based Windows
image is something I want to avoid…

Sorry, but if you want to avoid building separate images for PIC and APIC motherboards,
then just don’t bypass system-provided HAL and do things the way MSFT tells you to - after all, this is what HAL is for. However, if you want to do something “not-so-conventional” and choose to bypass system-provided HAL, you have no option, other than building separate images.

…so as to not support two nearly-identical images,

What about isolating HAL-specific code in a library???

Anton Bassov

Taed,

if you are asking how to put the same disk image of an embedded type
system on both the old system and the apic system, then you might look at
the boot.ini option /HAL= This will allow you to specify the apic HAL as
boot.ini option.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

“Taed Wynnell” wrote in message news:xxxxx@ntdev…
We have a Windows product image that was built on a PIC-based
motherboard, but now we will be shipping a lower-cost APIC-based
motherboard as well (we will be supporting both motherboards).
Building another APIC-based Windows image is something I want to avoid
so as to not support two nearly-identical images, but also the customer
won’t know which image to use since the motherboard details are hidden
from them. So, I’d like to have just one image.

Is there a way to configure Windows to always run in PIC-mode even if an
APIC is present?

Unfortunately, that’s not an option in the BIOS of the new motherboard.

I searched around on Google and the MS Knowledgebase, but didn’t come up
with anything. (Although I did find that Linux has what I want with a
“noapic” option, which suggests that it might be possible.)

Any ideas?

“Mark Roddy” wrote in message news:xxxxx@ntdev…
> The answer is “no” but I am really curious as to how your product ends
> up with a dependency on the type of interrupt controller.

The product is an entire embedded system, so it’s not our drivers and
whatnot that are dependent, but Windows itself. The goal is to have the
same disk image work with both motherboards.

Don,

if you are asking how to put the same disk image of an embedded type system on
both the old system and the apic system, then you might look at the boot.ini
option /HAL= This will allow you to specify the apic HAL as boot.ini option.

IIRC, Windows setup does not copy all HAL versions to the disk - the only “spare” version
it copies is that of MP HAL if it detects that the system has multiple logical CPUs and only one of them is currently enabled in BIOS. Therefore, I think APIC-based machine is not going to have PIC HAL on the disk…

Anton Bassov

wrote in message news:xxxxx@ntdev…
>> Is there a way to configure Windows to always run in PIC-mode even if an
>> APIC is present?
>
> Sure - just disable APIC in BIOS, and reinstall Windows. Please note if
> you disable APIC in BIOS settings, Windows installation that got installed
> with APIC enabled is not going to work, because PIC and APIC require
> totally different HAL versions.
>
>> Unfortunately, that’s not an option in the BIOS of the new motherboard.
>
> I hope by now you understand that even if this option was available, it
> still would not lead you anywhere, as far as your product is concerned…

I don’t understand your point. If the BIOS option were available and I set
the BIOS on the APIC motherboard to work in PIC-mode, then both systems
would appear to have a PIC motherboard to Windows. And thus, we could use
the same PIC-based Windows image on both systems. What am I missing?

Anton,

In this case you did not remember correctly, but even if this does
happen the guy is making an image he can add the file. I had a workstation
with flakey ACPI an used /HAL to force the hal of my choice.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

wrote in message news:xxxxx@ntdev…
> Don,
>
>> if you are asking how to put the same disk image of an embedded type
>> system on
>> both the old system and the apic system, then you might look at the
>> boot.ini
>> option /HAL= This will allow you to specify the apic HAL as boot.ini
>> option.
>
> IIRC, Windows setup does not copy all HAL versions to the disk - the only
> “spare” version
> it copies is that of MP HAL if it detects that the system has multiple
> logical CPUs and only one of them is currently enabled in BIOS. Therefore,
> I think APIC-based machine is not going to have PIC HAL on the disk…
>
> Anton Bassov
>

“Don Burn” wrote in message news:xxxxx@ntdev…
> if you are asking how to put the same disk image of an embedded type
> system on both the old system and the apic system, then you might look at
> the boot.ini option /HAL= This will allow you to specify the apic HAL as
> boot.ini option.

Thanks for the reminder of that option. However, I had tried doing that
last year when we had a similar issue with ACPI and non-ACPI motherboards,
and it didn’t work (it ended up crashing as I recall). My theory at the
time was that there were registry or other configuration settings that were
still dependant on the type of HAL, so one couldn’t use the /HAL= bios.ini
switch to force a different type of HAL. (And that the option was really
only useful for checked mode.)

In fact, the seemingly equivalent of editing the disk offline and putting
the correct HAL.DLL on there also doesn’t work and crashes. However, if one
then reinstalls (not repairs) Windows from the install disk to the edited
disk, it will correct whatever problem there was. (Oddly enough, though,
the reinstall without putting the correct HAL on there first does NOT put
the correct HAL on there.) I did go through that process this time again,
so I know I’m right on that point.

I’ll try the /HAL= again, but do you really think that the /HAL= switch
would allow the use of a different type of HAL with respect to PIC/APIC and
ACPI/non-ACPI?

I’m using Win2003. However, I heard from Microsoft support last year that
Vista and/or Win2008 do away with these issues by auto-detecting the HAL and
NTOSKRNL types on bootup. I don’t know if they know enough to use the right
one, or if they did away with the multiple versions altogether.

There used to be a “bad BIOS” list in the windows install stuff. If your
bios was on the bad bios list, it would install in PIC mode even though the
system claimed to have an APIC, since the APIC was known to work wrong.

There also used to be an option in the install script to force a PIC
install, if I recall. Don’t remember what the option was anymore, that was
pushing 10 years ago. Don’t know if it would still be there or not.

I guess I’m surprised that your disk image with the PIC HAL doesn’t “just
work” on your APIC machine. That used to be pretty common, in fact there
was an F5 or some such option in the normal install to let you choose to use
the APIC or not on W2K.

Loren

> I’ll try the /HAL= again, but do you really think that the /HAL= switch

It won’t work. As best I recall, as well as picking the HAL, it either
picks a matching kernel or applies assorted patches to the kernel when
loading apic. You can’t just change the HAL at that point, you have to at
least change the kernel also, and I seem to recall that was iffy. Much
easier to reinstall from scratch.

Loren

> I don’t understand your point. If the BIOS option were available and I set the BIOS

on the APIC motherboard to work in PIC-mode, then both systems would appear
to have a PIC motherboard to Windows. And thus, we could use the same
PIC-based Windows image on both systems. What am I missing?

Well, I thought that you mean doing it dynamically from a driver…

Let’s face it - normally you just don’t tell the user “If you want my driver to work on your system make sure BIOS setting are appropriate for it”. Instead, it is supposed to work without any user intervention - after all, a typical Windows user may have no idea about BIOS’s very existence, and is very unlikely to know about the way interrupts are vectored…

Anton Bassov

Said the OP:

"Unfortunately, that’s not an option in the BIOS of the new motherboard. "

The system bios (thankfully) does not support disabling the APIC. The
answer to the OP’s question is simply ‘no’.

On Dec 8, 2007 4:36 PM, wrote:
> > I don’t understand your point. If the BIOS option were available and I set the BIOS
> > on the APIC motherboard to work in PIC-mode, then both systems would appear
> > to have a PIC motherboard to Windows. And thus, we could use the same
> > PIC-based Windows image on both systems. What am I missing?
>
> Well, I thought that you mean doing it dynamically from a driver…
>
> Let’s face it - normally you just don’t tell the user “If you want my driver to work on your system make sure BIOS setting are appropriate for it”. Instead, it is supposed to work without any user intervention - after all, a typical Windows user may have no idea about BIOS’s very existence, and is very unlikely to know about the way interrupts are vectored…
>
> Anton Bassov
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>


Mark Roddy

I agree. However, in this case, the user doesn’t even know that we run
Windows. It’s an embedded system and we control every aspect of the system,
which is why we’re working with a disk image, and not just some installer
program. The problem is not with our driver, it’s with Windows – we want
the same disk image to work on both the PIC and APIC systems. That way, the
field installers won’t have to deal with multiple images; they’ll always use
the same one, so no chance of error or confusion.

wrote in message news:xxxxx@ntdev…
> > I don’t understand your point. If the BIOS option were available and I
set the BIOS
> > on the APIC motherboard to work in PIC-mode, then both systems would
appear
> > to have a PIC motherboard to Windows. And thus, we could use the same
> > PIC-based Windows image on both systems. What am I missing?
>
> Well, I thought that you mean doing it dynamically from a driver…
>
> Let’s face it - normally you just don’t tell the user “If you want my
driver to work on your system make sure BIOS setting are appropriate for
it”. Instead, it is supposed to work without any user intervention - after
all, a typical Windows user may have no idea about BIOS’s very existence,
and is very unlikely to know about the way interrupts are vectored…
>
> Anton Bassov
>

“Mark Roddy” wrote in message news:xxxxx@ntdev…
> Said the OP:
> "Unfortunately, that’s not an option in the BIOS of the new motherboard. "
>
> The system bios (thankfully) does not support disabling the APIC. The
> answer to the OP’s question is simply ‘no’.

Actually, there are BIOSes out there that can configure the APIC to act as a
PIC. We have a request in to the motherboard manufacturer to see if they
can add that feature to theirs. If they do, then I’m set. But I don’t know
if they will or how long it will take, so that’s why I’m exploring other
options.

And yes, it’s looking like the answer is no to my question…

Thanks anyway!

If you don’t really care if your driver runs on a PIC or APIC based
motherboard, then just create one image for each. Put both of them on a
WAIK bootable DVD. Write a program to determine if a PIC or APIC is
present and install the appropriate one. Since you control the complete
design of the embedded system that is easiest. I don’t think it will be
that difficult. You can embed your driver in the booting OS (Vista PE) and
have full access to your hardware. This WAIK is designed to permit system
OEMs to install special drivers for boot devices relatively easy. Why make
the installers do all the work of deciding which image is appropriate for
this machine?

WAIK = Windows Automated Install Kit - used to be released to system OEMs
only before Vista, but became a free download shortly after Vista was
released.

I think the images can be on another system (server) and not directly on the
DVD so they can easily duplicated to computers being prepared for shipment.
I suspect they can be on an external HD connected via USB or 1394. The
bootable OS could also be placed on a USB flash drive with or without the
images. Currently 16GB flash drives are available for around $150 +/-$30.

If the hard drive is unformatted I think it should be formatted but that can
be automated. Since this is really designed to be an installer of the OS,
only one image with your drivers added can be easily created and the correct
HAL/NTOSKRNL will be choosen automatically.

“Taed Wynnell” wrote in message news:xxxxx@ntdev…
> “Mark Roddy” wrote in message news:xxxxx@ntdev…
>> Said the OP:
>> "Unfortunately, that’s not an option in the BIOS of the new motherboard.
>> "
>>
>> The system bios (thankfully) does not support disabling the APIC. The
>> answer to the OP’s question is simply ‘no’.
>
> Actually, there are BIOSes out there that can configure the APIC to act as
> a
> PIC. We have a request in to the motherboard manufacturer to see if they
> can add that feature to theirs. If they do, then I’m set. But I don’t
> know
> if they will or how long it will take, so that’s why I’m exploring other
> options.
>
> And yes, it’s looking like the answer is no to my question…
>
> Thanks anyway!
>
>
>

> "Unfortunately, that’s not an option in the BIOS of the new motherboard. "

The system bios (thankfully) does not support disabling the APIC.
The answer to the OP’s question is simply ‘no’.

The purpose of BIOS is just booting the computer. Therefore, BIOS APIC settings are guaranteed to be in effect only before it transfers control to the OS - once APIC setting can be modified by anyone who runs at privilege level 0 (these modifications don’t really have to be saved in CMOS, do they ), it is up to the OS to decide whether it wants to make use of APIC or whether it wants to disable it and run in PIC mode.

In other words, it is just the question of how to make setup configure Windows to run in PIC mode regardless of BIOS settings (i.e. to disable APIC and run PIC kernel and HAL). As other posters say, earlier versions of Windows allowed it, but I am not so sure about the modern ones…

Anton Bassov

> it’s an embedded system and we control every aspect of the system, which is

why we’re working with a disk image, and not just some installer program.

At this point I just refuse to understand anything. Are you saying that your software has a chance to run before the OS (or setup program) even gets loaded??? If this is the case, instead of asking questions in Windows-related NGs, you should go straight to Intel site and download Developer’s Manual, Volume 3, as well as IOAPIC Manual and other related docs - once it is your software and not Windows who is in charge of things (how lucky you are), answers to all your questions are there…

Anton Bassov

You don’t say in this message which version of Windows you’re dealing
with, so I’ll assume you’re talking about XP.

Your PIC-based image will run on the motherboard with an APIC (as long
as the BIOS is well-formed.) Vista would enable the APIC without a
re-installation, but XP will stick with whichever interrupt controller
the image was created with.

  • Jake Oshins
    Windows Kernel Guy
    Former Owner of the HAL Code

“Taed Wynnell” wrote in message
news:xxxxx@ntdev…
We have a Windows product image that was built on a PIC-based
motherboard, but now we will be shipping a lower-cost APIC-based
motherboard as well (we will be supporting both motherboards).
Building another APIC-based Windows image is something I want to avoid
so as to not support two nearly-identical images, but also the
customer won’t know which image to use since the motherboard details
are hidden from them. So, I’d like to have just one image.
Is there a way to configure Windows to always run in PIC-mode even if
an APIC is present?
Unfortunately, that’s not an option in the BIOS of the new
motherboard.
I searched around on Google and the MS Knowledgebase, but didn’t come
up with anything. (Although I did find that Linux has what I want
with a “noapic” option, which suggests that it might be possible.)
Any ideas?

Loren, you’re acronyms are getting confused. The “bad BIOS” list was
for broken ACPI BIOSes, not broken APIC BIOSes.

  • Jake

“Loren Wilton” wrote in message
news:xxxxx@ntdev…
> There used to be a “bad BIOS” list in the windows install stuff. If
> your bios was on the bad bios list, it would install in PIC mode
> even though the system claimed to have an APIC, since the APIC was
> known to work wrong.
>
> There also used to be an option in the install script to force a PIC
> install, if I recall. Don’t remember what the option was anymore,
> that was pushing 10 years ago. Don’t know if it would still be
> there or not.
>
> I guess I’m surprised that your disk image with the PIC HAL doesn’t
> “just work” on your APIC machine. That used to be pretty common, in
> fact there was an F5 or some such option in the normal install to
> let you choose to use the APIC or not on W2K.
>
> Loren
>
>