sossego
Retired from the forums
This has been discussed on the mailing list: http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045032.html
With the Microsoft reference we are back on the reason, this thread was started. I'm happy without UEFI. In fact I took the opportunity to install Windows 7 back on MBR. Works fine here and no BIOS manual switching is required.On 03/10/2013, at 7:46 AM, Michael Copeland <michael at kryptos-security.com> wrote:
> Hmm
> Should I build with GCC?
>
Yes, the in-tree version of clang doesn't understand __attribute__((ms_abi)) and so it won't generate the Microsoft function call code that UEFI expects. You'll need gcc >= 4.7 so you'll need it from ports. This has been one of the blockers on getting it done (beyond my lack of time).
Cheers,
Benno.
Erratus said:9.2-RELEASE has required it to disable UEFI.
wblock@ said:Ah, but that's not necessarily due to FreeBSD 9.2. Clearing the active flag on the PMBR may make it work:gpart clear -a active ada0
gpart set -a attrib -i index [-f flags] geom
gpart unset -a attrib -i index [-f flags] geom
PARTITION ATTRIBUTES
gptboot checks and manages several attributes of GPT UFS partitions.
bootme Attempt to boot from this partition. If more than one partition has the bootme attribute set, gptboot will attempt to boot each one until successful.
bootonce Attempt to boot from this partition only one time. Setting this attribute with gpart(8) automatically also sets the bootme attribute. Multiple partitions may have the bootonce and bootme attributes set.
bootfailed The bootfailed attribute marks partitions that had the bbootonce attribute set, but failed to boot. This attribute is managed by the system. See BOOTING and POST-BOOT ACTIONS below for details.
USAGE
For normal usage, the user does not have to set or manage any of the partition attributes. gptboot will boot from the first UFS partition found.
#> gpart list ada0
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 488397134
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada0p1
Mediasize: 524288 (512k)
Sectorsize: 512
Stripesize: 0
Stripeoffset: 20480
Mode: r0w0e0
rawuuid: d100e823-2e89-11e3-9ba8-e069956961c1
rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
label: gptboot
length: 524288
offset: 20480
type: freebsd-boot
index: 1
end: 1063
#> fdisk -a /dev/ada0p1
******* Working on device /dev/ada0p1 *******
parameters extracted from in-core disklabel are:
cylinders=1 heads=16 sectors/track=63 (1008 blks/cyl)
parameters to be used for BIOS calculations are:
cylinders=1 heads=16 sectors/track=63 (1008 blks/cyl)
fdisk: invalid fdisk partition table found
Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 63, size 945 (0 Meg), flag 80 (active)
beg: cyl 0/ head 1/ sector 1;
end: cyl 0/ head 15/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
Partition 1 is marked active
Do you want to change the active partition? [n] y
Supply a decimal value for "active partition" [1] 0
Active partition number must be in range 1-4. Try again.
sysid 238 (0xee),(EFI GPT)
Correct. I ran into this myself some time ago. I had to manually 'unset' that flag to get my system booting again.Erratus said:
#> gdisk /dev/ada0
GPT fdisk (gdisk) version 0.8.6
NOTE: Write test failed with error number 1. It will be impossible to save
changes to this disk's partition table!
You may be able to enable writes by exiting this program, typing
'sysctl kern.geom.debugflags=16' at a shell prompt, and re-running this
program.
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Recovery/transformation command (? for help): o
Disk size is 488397168 sectors (232.9 GiB)
MBR disk identifier: 0x00000000
MBR partitions:
Number Boot Start Sector End Sector Status Code
1 1 39 primary 0xEE
2 40 1063 primary 0xA5
3 2048 488397127 primary 0xA5
Command (? for help): r
Recovery/transformation command (? for help): h
WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: 1 2
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): [red]y [/red]
Creating entry for GPT partition #1 (MBR partition #2)
Enter an MBR hex code (default A5):
Set the bootable flag? (Y/N): [red]n[/red]
Creating entry for GPT partition #2 (MBR partition #3)
Enter an MBR hex code (default A5):
Set the bootable flag? (Y/N): [red]n[/red]
Unused partition space(s) found. Use one to protect more partitions? (Y/N): [red]n[/red]
Recovery/transformation command (? for help): q
comments are welcome.Note that even with the extra protective partition, significant parts of a disk could go unprotected. In the case of this example, it's just a few sectors at the end of the disk; however, if you hybridize two non-contiguous partitions, the last of which is not at the end of the disk, either the partitions at the end of the disk or the space between the partitions will be unallocated in an MBR sense.
gpart unset -a active ada0
. You will need a recent 9-STABLE to be able to use that.wblock@ said:Sorry, I cut a sample from email that was wrong. But it was close, should have beengpart clear -a active ada0
. You will need a recent 9-STABLE to be able to use that.
Don't use hybrid MBRs, that combines the worst features and problems of both.
gpart clear
is not implemented in 9.2-RELEASE.zspider said:I decided to do an experiment by putting FreeBSD 9.1 on a USB hard drive, with a full GPT partitioning scheme and it booted. Yet it's never worked whenever it's installed to the main drive?
Erratus said:USB uses just it's own interface. If I remember it right, what I've learned in the past days, booting from USB is like booting from BIOS legacy. So you should check your BIOS setup regarding UEFI, when using the "main" interface (i.e. ad*).
Erratus said:I do not see any difference to post 30. Did you edit it?
Sogpart clear
is not implemented in 9.2-RELEASE.
Manually editing the raw device should also be possible, but how?
zspider said:I decided to do an experiment by putting FreeBSD 9.1 on a USB hard drive, with a full GPT partitioning scheme and it booted. Yet it's never worked whenever it's installed to the main drive?
vanessa said:Interesting ... Was it your BIOS handing over to the USB drive or was it the boot0 loader on the HDD?
Erratus said:So you updated your BIOS and lost disabling UEFI? Then I would look at the release notes of the BIOS versions of your mainboard and look if you can load an legacy BIOS version, that does not affect problems you might have had.
Some people update without any need their BIOSes, just for having a newer one. This is generally not advisable to do, unless you have a problem on the system you have to solve.