Cannot boot on new Intel i3 laptop

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.
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: Cannot boot on new Intel i3 laptop

Post by rdos »

The trick to use the first AP core to initialize VBE now works on another a bit older laptop, and so should work on the new i3 too. Then the issue would be if the network card works and what kind of internal disc it has to see if it is suitable. At least, dual booting with Windows 10 works pretty well, but if the disc is supported, I would want to reinstall Windows 10 to use at least one FAT32 disc. Or maybe it's possible to shrink the partition and add a new FAT32 partition. If it is GPT, then there should be an EFI system partition that RDOS can use too.
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: Cannot boot on new Intel i3 laptop

Post by nullplan »

rdos wrote:The trick to use the first AP core to initialize VBE now works on another a bit older laptop, and so should work on the new i3 too.
Why would you even think that? "This way of using undefined behavior worked on that machine, so it should be fine on this one too" is a statement I have heard before, but only from programmers not wanting to admit to a dumb design decision. I have a colleague who had the bright idea of "wrapping" a C struct in a C++ class by means of private inheritance. Then he used virtual member functions all over the place, and then he used wild casts on instances of the C struct in an array. I told him what he's doing is definitely undefined behavior, because the C++ class is using virtual functions, so the compiler must put the vtable pointer somewhere, so the C++ class is larger than the C struct, and so his use there must be corrupting memory all over the place. He told me that it works on his machine. And it did, somehow, while we used OS-9. Then we started using Linux, and in the case given here, GCC will put the vtable pointer at the start of the class, and now all the memory references were off by four. And then he still said that it was GCC's fault for laying out the memory like that.

So anyway, to my knowledge no BIOS code is specified to work on any CPU but the BSP, so any luck you might have had with that in the past was just that: luck. And indeed, does it work on the i3? I believe the thread was started because it doesn't. So you are looking at the manifestation of your own null hypothesis while proclaiming the alternative one is still true.
Carpe diem!
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: Cannot boot on new Intel i3 laptop

Post by nexos »

In regards to what @zaval is talking about, here is what I think you should (I did this my bootloader) Allocate physical memory using EFI's AllocatePages. After ExitBootServices, map the physical pages to the virtual address you want to use. Then copy the kernel there. If you are on 32 bit EFI and not using paging, then the above solution won't work. But if you do use paging, that is how I would handle it.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: Cannot boot on new Intel i3 laptop

Post by rdos »

nullplan wrote: So anyway, to my knowledge no BIOS code is specified to work on any CPU but the BSP, so any luck you might have had with that in the past was just that: luck. And indeed, does it work on the i3? I believe the thread was started because it doesn't. So you are looking at the manifestation of your own null hypothesis while proclaiming the alternative one is still true.
Yes, it works on the i3 machine too. And why wouldn't it? Why would BIOS care about which core is running it as long as it's only one?

Actually, I plan to use this as the default on multicore computers since it avoids using V86 mode.
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: Cannot boot on new Intel i3 laptop

Post by rdos »

nexos wrote:In regards to what @zaval is talking about, here is what I think you should (I did this my bootloader) Allocate physical memory using EFI's AllocatePages. After ExitBootServices, map the physical pages to the virtual address you want to use. Then copy the kernel there. If you are on 32 bit EFI and not using paging, then the above solution won't work. But if you do use paging, that is how I would handle it.
It won't work. The standard today is 64 bit EFI and I want to boot a 32-bit kernel that cannot handle linear addresses above 4G.

The problem is not with physical memory above 4G (PAE paging handles that), but getting booted into a 64-bit image loaded above 4G. The only solution in that case is to find an area below 4G, copy the image, and then switch to protected mode from there.
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: Cannot boot on new Intel i3 laptop

Post by rdos »

I've managed to boot up the i3 with 1920x1080 resolution now, and the command shell works and so does the graphics demo. However, that's where the good news ends. The RTL8168 network chip doesn't work with my driver, and the SATA disc is in RAID mode and cannot be found. The USB stack seems to work, but the specification seems to be incorrect since it only has one XHCI (which would be fine). The VBE mode performance is horrible, just like it is on other newer Intel platforms. It performs in paritity with very old 486 or Pentium hardware.

So, I'm giving it away since it is worthless for running my OS on.
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: Cannot boot on new Intel i3 laptop

Post by rdos »

Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Cannot boot on new Intel i3 laptop

Post by Octocontrabass »

rdos wrote:the SATA disc is in RAID mode and cannot be found.
Have you checked the firmware setup to see if you can change it to AHCI mode?
rdos wrote:The VBE mode performance is horrible, just like it is on other newer Intel platforms.
Is that with or without write-combining?
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: Cannot boot on new Intel i3 laptop

Post by rdos »

Tried the AP core VBE initialization on my 4-core AMD Athlon K8 stationary computer as well, and it works perfectly well there too.

I also tried the guidemo program at 1400x1050 resolution, so a bit lower than the laptop, but the program is something like 10 times faster on this 10 years old computer.
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: Cannot boot on new Intel i3 laptop

Post by rdos »

Octocontrabass wrote:
rdos wrote:the SATA disc is in RAID mode and cannot be found.
Have you checked the firmware setup to see if you can change it to AHCI mode?
I cannot see any setting for SATA interface in the BIOS. When I google on the PCI vendor & product it says SATA mobile disc in RAID mode.
Octocontrabass wrote:
rdos wrote:The VBE mode performance is horrible, just like it is on other newer Intel platforms.
Is that with or without write-combining?
It seemed I missed that. Set the page table attributes to 0x6B now (page write-through = 1).

Exact results from running the demo for 1 minute:
Intel i3: 5800 operations
Amd Athlon: 60000 operations.

When compensating for the higher resolution, it means the ten years old AMD run the graphics demo 7.5 times faster than the modern Intel I3.
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Cannot boot on new Intel i3 laptop

Post by Octocontrabass »

rdos wrote:Set the page table attributes to 0x6B now (page write-through = 1).
Write-through is not the same thing as write-combining. Have you tried write-combining?
rdos
Member
Member
Posts: 3297
Joined: Wed Oct 01, 2008 1:55 pm

Re: Cannot boot on new Intel i3 laptop

Post by rdos »

Octocontrabass wrote:
rdos wrote:Set the page table attributes to 0x6B now (page write-through = 1).
Write-through is not the same thing as write-combining. Have you tried write-combining?
I think this is what the bits mean. According to the PAT table in the processor manual, PAT1 is write combining. This is encoded with PAT = 0, PCD = 0 and PWT = 1, which is what should 0x6B mean.

0x6B = 0110 1011
PAT = 0
D = 1
A = 1
PCD = 0
PWT = 1
U/S = 0
R/W = 1
P = 1
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Cannot boot on new Intel i3 laptop

Post by Octocontrabass »

rdos wrote:According to the PAT table in the processor manual, PAT1 is write combining.
Did you program PAT1 to write-combining? By default, PAT1 is write-through.
User avatar
zaval
Member
Member
Posts: 656
Joined: Fri Feb 17, 2017 4:01 pm
Location: Ukraine, Bachmut
Contact:

Re: Cannot boot on new Intel i3 laptop

Post by zaval »

rdos wrote: I've managed to boot up the i3 with 1920x1080 resolution now, and the command shell works and so does the graphics demo. However, that's where the good news ends. The RTL8168 network chip doesn't work with my driver, and the SATA disc is in RAID mode and cannot be found. The USB stack seems to work, but the specification seems to be incorrect since it only has one XHCI (which would be fine). The VBE mode performance is horrible, just like it is on other newer Intel platforms. It performs in paritity with very old 486 or Pentium hardware.

So, I'm giving it away since it is worthless for running my OS on.
In UEFI mode? if so, what did you change, what was the problem?
If it's about legacy mode, then you may try to check how GetMemoryMap() behaves just by creating a small UEFI memory map dumper. I have such, it just prints the memory map into ConOut (display, serial). if you want to try it, let me know.
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: Cannot boot on new Intel i3 laptop

Post by bzt »

zaval wrote:In UEFI mode? if so, what did you change, what was the problem?
If it's about legacy mode, then you may try to check how GetMemoryMap() behaves just by creating a small UEFI memory map dumper. I have such, it just prints the memory map into ConOut (display, serial). if you want to try it, let me know.
No need to get crazy, memmap is a standard, built-in command in UEFI Shell. It's source is publicly available and Open Source.
https://uefi.org/sites/default/files/re ... ll_2_2.pdf (page 173)
https://github.com/tianocore/edk2/blob/ ... b/MemMap.c

Cheers,
bzt
Post Reply