UEFI boot FAIL!

verus

New Member


Messages: 17

#1
Howdy All,

I have been beating my head against the brick wall that is this issue for the last few days. I have tried everything I can think of and everything I have found on this forum and others. I will explain my goal and what I have attempted.

Also this is the first time I am trying to install FreeBSD on an UEFI system

Goal:
Dual boot FreeBSD 10.1 and Windows 8.1 (required for work)
Boot manager: don't really care rEFInd, Grub2, ect
I am installing FreeBSD 10.1 using the FreeBSD-10.1-RELEASE-amd64-uefi-memstick.img .
I am installing this on Asus X200MA-RCLT08

First installation attempt:
windows 8.1 working boots normally
Disabled secure boot
installed from usb and used UFS (GTP)
partition talble is:
100MB EFI -(windows UEFI)
900MB Recovery
128MB MS- Reserverd
186GB MS-basic-data
800KB EFI (FreeBSD)
144GB FreeBSD-UFS /
4GB FreeBSD-swap

Issue:
FreeBSD will not freaking boot!!!
UEFI dose not see the EFI partition created during installation.
It will boot if the install media is in the USB port it was in during installation and that is selected from the UEFI boot menu. (note if it is not in the USB port used during install, then the installation menu is booted)

Attempted resolutions:

I followed this guide http://ximalas.info/2015/03/19/uefi-gpt-windows-10-freebsd-10-and-refind/
when I select freeBSD from the menu I get the attached error
Code:
Fatal trap 1 with interrupts dissabled

Fatal trap 1: privileged instruction fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer     = 0x20:0xffffff80400000
stack pointer           = 0x28:0xffffff814b5a70
frame pointer           = 0x28:0x0
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = resume, IOPL = 0
current process         = 0 ()
trap number             = 1
panic: privileged instruction fault
cpuid = 0
KDB: stack backtrace:
#0 0xffffffff80963000 at ??+0
#1 0xffffffff80928125 at ??+0
#2 0xffffffff80d24f1f at ??+0
#3 0xffffffff80d24b7c at ??+0
#4 0xffffffff80d0a782 at ??+0
Uptime: 1s
I then attempted to skip the 3rd party boot loader and mounted the windows ESP again and copied the /boot/boot1.efi to /esp/efi/fbsd/bootx64.efi
I then in the system UEFI created boot entry pointing at /efi/fbsd/bootx64.efi
booted the system to the new entry and
Code:
Fatal trap 1 with interrupts dissabled

Fatal trap 1: privileged instruction fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer     = 0x20:0xffffff80400000
stack pointer           = 0x28:0xffffff814b5a70
frame pointer           = 0x28:0x0
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = resume, IOPL = 0
current process         = 0 ()
trap number             = 1
panic: privileged instruction fault
cpuid = 0
KDB: stack backtrace:
#0 0xffffffff80963000 at ??+0
#1 0xffffffff80928125 at ??+0
#2 0xffffffff80d24f1f at ??+0
#3 0xffffffff80d24b7c at ??+0
#4 0xffffffff80d0a782 at ??+0
Uptime: 1s
Again!!!

Second installation attempt:
Disabled secure boot
installed from usb and used UFS (GTP)
partition talble is:
800KB EFI (FreeBSD)
144GB FreeBSD-UFS /
4GB FreeBSD-swap

UEFI Sees the EFI Partition now: YAY (im hopeful; who needs wendooz anyway)
I boot the system and ... wait for it....
Code:
Fatal trap 1 with interrupts dissabled

Fatal trap 1: privileged instruction fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer     = 0x20:0xffffff80400000
stack pointer           = 0x28:0xffffff814b5a70
frame pointer           = 0x28:0x0
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = resume, IOPL = 0
current process         = 0 ()
trap number             = 1
panic: privileged instruction fault
cpuid = 0
KDB: stack backtrace:
#0 0xffffffff80963000 at ??+0
#1 0xffffffff80928125 at ??+0
#2 0xffffffff80d24f1f at ??+0
#3 0xffffffff80d24b7c at ??+0
#4 0xffffffff80d0a782 at ??+0
Uptime: 1s
FML
 
OP
OP
V

verus

New Member


Messages: 17

#7
FYI: sadly the UEFI implementation on this laptop does not seem to support MBR partitions :( so I am stuck trying to solve this
 
OP
OP
V

verus

New Member


Messages: 17

#9
Howdy all tried the suggestions above. Still no joy.

I also tried dd if=/boot/boot1.efifat of=/dev/ada0p1 to rewrite the EFI partition. I guess what is bugging me most is that booting from usb using UEFI isn't an issue, and I don't understand why the internal HDD would be any different.
 

trev

Aspiring Daemon

Thanks: 113
Messages: 615

#10
FYI: sadly the UEFI implementation on this laptop does not seem to support MBR partitions :( so I am stuck trying to solve this
Forget MBR partitions then, use GPT which is what I ended up with on the Mac Mini:

gpart show
Code:
=>  34  976773101  ada0  GPT  (466G)
  34  128  1  freebsd-boot  (64K)
  162  4194304  2  freebsd-ufs  (2.0G)
  4194466  41943040  3  freebsd-ufs  (20G)
  46137506  83886080  4  freebsd-ufs  (40G)
  130023586  83886080  5  freebsd-ufs  (40G)
  213909666  41943040  6  freebsd-ufs  (20G)
  255852706  419430400  7  freebsd-ufs  (200G)
  675283106  281018368  8  freebsd-ufs  (134G)
  956301474  18874368  9  freebsd-swap  (9.0G)
  975175842  1597293  - free -  (780M)
 
OP
OP
V

verus

New Member


Messages: 17

#11
Forget MBR partitions then, use GPT which is what I ended up with on the Mac Mini:

gpart show
Code:
=>  34  976773101  ada0  GPT  (466G)
  34  128  1  freebsd-boot  (64K)
  162  4194304  2  freebsd-ufs  (2.0G)
  4194466  41943040  3  freebsd-ufs  (20G)
  46137506  83886080  4  freebsd-ufs  (40G)
  130023586  83886080  5  freebsd-ufs  (40G)
  213909666  41943040  6  freebsd-ufs  (20G)
  255852706  419430400  7  freebsd-ufs  (200G)
  675283106  281018368  8  freebsd-ufs  (134G)
  956301474  18874368  9  freebsd-swap  (9.0G)
  975175842  1597293  - free -  (780M)

I had tried to use the non UEFI image to install and point the bios in legacy mode to the MBR but it does not show as an option Asus doesn't support MBR on the newer boards.
 

trev

Aspiring Daemon

Thanks: 113
Messages: 615

#12
I had tried to use the non UEFI image to install and point the bios in legacy mode to the MBR but it does not show as an option Asus doesn't support MBR on the newer boards.
Ignore MBR, the FreeBSD installer defaults to GPT (at least with 9.1-R), it can also be changed in the installer before you partition.
 
OP
OP
V

verus

New Member


Messages: 17

#13
Ignore MBR, the FreeBSD installer defaults to GPT (at least with 9.1-R), it can also be changed in the installer before you partition.
Thank you. I was just trying to get BSD to boot with out the boot loader being on USB.
 

georges

Member

Thanks: 1
Messages: 49

#14
I had similar but not booting from one drive. Maybe it will help.


I have 2 internal HDD and like you my ASUS motherboard only supports UEFI booting. No legacy.
FreeBSD 10+ installs fine but never able to boot on my 2nd HDD.

After a lot of banging and coffee, I did the following:

Install and then drop to a shell before exiting the installation or reboot from the CD, drop to emergency shell and did the following:

Code:
gpart set -a active <drive/partition>
This worked every time. I have to do this every time I install. Even PC-BSD have the same problem.

Hope this helps.
 

georges

Member

Thanks: 1
Messages: 49

#16
In my case I installed FreeBSD with auto ZFS, then I set active on the whole drive. My drive is ada1. So I did:
gpart set -a active /dev/ada1

Worked everytime. If you are installing to a partition (as sharing one drive with Windows) I'll probably set it on that partitions.
gpart list
or
gpart show

It will show the boot partition I think.

Will show all the info.
 
OP
OP
V

verus

New Member


Messages: 17

#17
My partition table is as below:
gpart show
Code:
800KB EFI (FreeBSD)
144GB FreeBSD-UFS /
4GB FreeBSD-swap
So I ran
gpart set -a active /dev/ada0

Now the bios does not see the drive.
 

georges

Member

Thanks: 1
Messages: 49

#18
Mine shows the following

gpart show ada1
Code:
=>  34  1465149101  ada1  GPT  (699G)
  34  1024  1  freebsd-boot  (512K)
  1058  4194304  2  freebsd-swap  (2.0G)
  4195362  1460953773  3  freebsd-zfs  (697G)
So I set it to the whole disk. I chose at installation the 2nd drive and told it not to install the boot record record on the 1st as I don't want to dual boot(I just boot through boot menu). Probably that is what is different.
 
OP
OP
V

verus

New Member


Messages: 17

#19
The freebsd-boot partition is missing and you miss-leaded the BIOS looking into a geom without one. That is why the BIOS cannot find anything.

You probably need to boot with i.e. an USB medium and do the partitioning on the hard drive from the fixit shell if your first hard drive cannot boot or has no tools.
I used the Auto (UFS) option during install and that is what it gives me. Please correct me if i am wrong but isn't the 144GB partition (since it is set as root (/)) the boot partition? what would you recommend as a solution?
 
OP
OP
V

verus

New Member


Messages: 17

#21
Really? Or does it just not appear until SecureBoot is disabled?
There is NO legacy support for hard drives or SSD even with secureboot disabled. On the new Asus boards disabling secureboot just doesn't enforce signing, or so I was told by Asus support.
 

chrbr

Aspiring Daemon

Thanks: 232
Messages: 643

#24
I used the Auto (UFS) option during install and that is what it gives me.
Please see figure 2.15 in https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/bsdinstall-partitioning.html. It shows a freebsd-boot partition where the software to start up FreeBSD is copied to during installation. See gpart(8) section bootcode. Information about the booting is in gptbootcode(8) and https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot-introduction.html.

Regarding the installation, please try the auto setup again, just to be sure . If it does not work follow http://www.wonkity.com/~wblock/docs/html/disksetup.html. I think it is more clear than the ncurses dialog of the manual installer. Thank you wblock@ :beer::). You can decide if you like to have mount points for /usr, /var and /tmp or if you just want everything under the root partition. For the beginning, just to test if you can finally startup I would suggest to have it as simple as possible. I just hope that there are any additional restrictions due to ASUS. Good luck!
 
OP
OP
V

verus

New Member


Messages: 17

#25
Please see figure 2.15 in https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/bsdinstall-partitioning.html. It shows a freebsd-boot partition where the software to startup FreeBSD is copied to during installation. See gpart(8) section bootcode. Information about the booting is in gptbootcode(8) and https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot-introduction.html.

Regarding the installation, please try the auto setup again, just to be sure . If it does not work follow http://www.wonkity.com/~wblock/docs/html/disksetup.html. I think it is more clear than the ncurses dialog of the manual installer. Thank you wblock@ :beer::). You can decide if you like to have mount points for /usr, /var and /tmp or if you just want everything under the root partition. For the beginning, just to test if you can finally startup I would suggest to have it as simple as possible. I just hope that there are any additional restrictions due to ASUS. Good luck!

I will give this a try this afternoon. FYI I have used the auto setup 5-6 times trying various fixes and then blowing the disk away. Every time it has given me the same disk setup.
 
Top