Disable processor detection in the kernel - Page 1
Forum section: electronics / general

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 12, 2012, 12:33:56 am
content: I recently got a Jetway JNC9KDL-2700. The BIOS has a bug that causes it to report the CPU as being incompatible with 64-bit, even though it is compatible. Therefore, 64-bit Gentoo will not boot. Is there a way to patch/hack the kernel to bypass the check and boot anyways? Or a way to patch the BIOS to correctly report the 64-bit compatibility? (Now I know why that board was so cheap compared to the others...)

author: PeterG
author_rank: Frequent Contributor
timestamp: February 12, 2012, 01:20:27 am
content: looking at what the folks over at mini-itx.com have to say, it seems this board is not 64 bit capable yet.http://www.mini-itx.com/store/?c=47"64-bit OS Support: Currently EMT64 is *not* enabled on these boards. We expect Jetway to release a BIOS update when 64-bit drivers become available from Intel."It seems EMT64 is disabled in bios, this limits your options. You can either get another board OR wait for a bios update. There may be an update already?Regards

author: gxti
author_rank: Frequent Contributor
timestamp: February 12, 2012, 01:24:34 am
content: Apparently they did it due to some squabble over lack of (Windows) video drivers. How asinine. The good news is that this platform does not support more than 4GiB of RAM anyway, so you might as well just install a 32-bit system.

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 12, 2012, 01:44:49 am
content: Pretty stupid for them to disable that feature. Imagine buying a car with a 7 speed transmission and then finding out that only 4 of the gears can be used. There are other boards with very similar hardware that do run 64-bit just fine. I was looking for a small Atom board with HDMI and dual gigabit Ethernet. The Jetway looked like a great deal, costing much less than other comparable boards. That is, until I discovered the showstopper "bug". I bought the board from a well-known site (Newegg) and there was no notice that 64-bit support is broken. Returning the board would be a hassle so I'll look into hacking it or the kernel to make it work. (As for why I can't just use 32-bit, I paid for 64-bit and want to use it, plus in my dual mode PC design, I'm planning to use some tricks that would only work if both systems share the same architecture.)Maybe it will end up like the Rigol 50MHz to 100MHz hack...

author: DrGeoff
author_rank: Frequent Contributor
timestamp: February 12, 2012, 01:59:03 am
content: Download the kernel source and configure/compile it manually. It's not too hard.Quote from: gxti on February 12, 2012, 01:24:34 am64-bit refers to the data bus width, not necessarily the same as the addressable memory. So a 64-bit processor will give you a lot more benefits than extra address lines.

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 12, 2012, 03:26:54 am
content: I just disabled the check and now it just hangs. Is there a register for enabling 64-bit that normally would be set by the BIOS?

author: PeterG
author_rank: Frequent Contributor
timestamp: February 12, 2012, 03:56:02 am
content: When you disable the cpu check it will hang. You are attempting to pump 64 bit data through a 32 bit pipe. The the bios is setting the cpu to 32 bit mode and there is no way i know of to get around this. I would ask around for bios updates.Good luck.Regards

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 12, 2012, 05:25:51 am
content: Why isn't it possible to throw in a little code to set the registers to the correct values before booting the kernel?

author: westfw
author_rank: Super Contributor
timestamp: February 12, 2012, 05:33:11 am
content: IIRC, the bios starts in "real" mode, where there are certain things it can do that just cannot be done once the CPU is switched to "virtual" mode, even if the process has all the maximum privilege levels. I don't know exactly when that happens (or if I have that exactly right), but it doesn't surprise me that there are things that MUST be done in the BIOS itself...

author: PeterG
author_rank: Frequent Contributor
timestamp: February 12, 2012, 05:50:20 am
content: I can't find a seller of these boards who states it is a 64 bit board?It looks like Jetway have released a newer board rather than release a new bios for this board.Regards

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 12, 2012, 06:32:58 am
content: Quote from: westfw on February 12, 2012, 05:33:11 amWould it be possible to switch back to real mode, set the registers, then switch back? Or is a reset the only way to go back into real mode? Unlike most modern motherboards, the BIOS chip is an 8 pin DIP (25Q16BVAIC), so it should be possible to back up the existing code using a microcontroller, hack it, then flash the hacked code. Hacking the code would be the hardest part... A hack that does not touch the BIOS would be much preferred.Quote from: PeterG on February 12, 2012, 05:50:20 amThe processor is 64-bit, so like most users, I assumed that it would run 64-bit just fine. The marketers sure are tricky - they're technically not lying since they never mention 64-bit but someone who looks over the processor specs would assume that 64-bit works. So unless a hack is found, spend a little more for a well known brand like Asus or Intel and avoid the trouble.If it won't be possible to get 64-bit working properly without extensive work, just how much would I give up running it as a 32-bit platform? I would definitely lose some tricks like efficiently sharing binaries between the two platforms as the lowered common architecture support between the two would cause significant loss in performance on the i7 side. 64-bit integer arithmetic and logical performance would really suffer but I don't think very many programs use that. 64-bit can have an advantage unrelated to 64-bit in that the 32-bit compiler did not use many new features like SSE2 unless told to, but that can be fixed by properly setting up the CFLAGS. So the main issue would be losing some nice tricks, and the problem wouldn't be fixed right.

author: Psi
author_rank: Super Contributor
timestamp: February 12, 2012, 10:04:15 am
content: Maybe talk to the guys at coreboot, (open source bios replacement)I can't see that motherboard in this coreboot supported list but they might be able to give you some ideas.

author: amyk
author_rank: Super Contributor
timestamp: February 12, 2012, 11:02:19 am
content: I don't see how a BIOS can have an effect on 64-bit or not (with the caveat below). There's nothing to "enable"; the check for 64-bit is done with the CPUID instruction, which as far as I can see from a quick glance at the datasheet, there is no "lock-out" bit to disable (unlike e.g. the PIII's processor serial number).All x86 chips start up in real mode, where they basically work like an 8086. The BIOS often switches into protected mode to do its own initialization/memory test/etc., then switches back into real mode to boot from whatever boot device is chosen. It's up to the OS to then switch into 32-bit protected mode, and 64-bit long mode from there, or go into long mode directly.http://wiki.osdev.org/Entering_Long_Mode_DirectlyUnless Intel sold them some D2700s that do not work correctly in 64-bit mode (what does CPUID say?), it should just work.Now for the caveat: it is possible the BIOS loads microcode which disables 64-bit mode support advertised by CPUID. You will need to do quite a bit of BIOS reverse-engineering to find this out. Note that microcode also contains fixes for errata, so disabling microcode update completely may cause other issues. Intel doesn't give much public information on this anymore so the CPU might not work properly at all without the proper microcode loaded.

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 12, 2012, 02:15:44 pm
content: Could it be possible to boot a temporary 32-bit kernel, update the microcode, and kexec a 64-bit kernel?

author: gxti
author_rank: Frequent Contributor
timestamp: February 12, 2012, 05:17:16 pm
content: Since you're using Gentoo anyway, why not use a 32-bit kernel/userland with CFLAGS set to optimize for the specific CPU? It will still use all the fancy new opcodes but still in 32-bit addressing mode. It may even be faster since the code will be smaller.

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 12, 2012, 06:52:07 pm
content: The Atom system I'm working on is part of a dual mode PC where the other half is an i7, so 32-bit code would run suboptimally on an i7 and make it difficult to efficiently share binaries. (As opposed to if both ran 64-bit, in which case the only loss would be from not being able to use a few instructions only available on Sandy Bridge, a much lesser trade-off.) And if I chroot from the i7 side to quickly compile code, it would be cross compiling instead of just compiling. I also thought the extra registers are only available in 64 bit mode. I may need to just run it in 32-bit if getting 64-bit to work would be too difficult and just do without the advantages of 64-bit.

author: amyk
author_rank: Super Contributor
timestamp: February 13, 2012, 09:39:47 am
content: Quote from: NiHaoMike on February 12, 2012, 02:15:44 pmTheoretically, yes. Intel's microcode update mechanism is well-documented. However it would be better to embed the microcode back into the BIOS so it loads upon boot.A quick search at Intel's site:http://www.intel.com/content/www/us/en/search.html?lstSites=Embedded&allwords=d2700+microcodereveals two results:QuoteandQuoteNote how "rev 10A" is "64 bit" while "rev 109" is "32 bit". I think CPUs running rev 109 have problems with 64-bit mode, which is why there is rev 10A. Apparently "privileged registration" is required to download those files from Intel (registration is free, so why not give it a try), but presumably any other board's BIOS using the same CPU and for which 64-bit works should contain the 10A microcode, so that's another route you can pursue.

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 14, 2012, 03:01:32 am
content: I had no problems getting the microcode files since I work at Intel. Someone there mentioned that none of the Atoms officially support 64-bit, even though some are listed to be compatible. So it looks like I'll be sticking to 32-bit, although it is stupid for Jetway to disable a feature just because it is not officially supported. I'm sure very few motherboard manufacturers officially support extreme overclocking yet many do give you the option.

author: amyk
author_rank: Super Contributor
timestamp: February 14, 2012, 11:26:48 am
content: Now that's odd. Even with the 64-bit microcode it doesn't work? I know some Atoms are not 64-bit, but everything I can find says the D2700 is.