ProjectOSX

Welcome Guest!

Returning User? Login here.

Want membership privileges? Register here.

67 Pages V  « < 50 51 52 53 54 > »   
Start a new topic Add Reply
> How To Make Efi Bootloader
Slice
post Apr 17 2012, 08:17 AM
Post #1021
My observations are very strange in the light of talking above.
boot0hfs is provided to start first found HFS+ partition, right? So why it started FAT32 partition from my USB stick?

Previously I had boot0md installed here. When I started from the USB stick I see start of Chameleon installed at HDD but not Clover installed on USB. Why?
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
dmazar
post Apr 17 2012, 08:45 AM
Post #1022
Guys, boot0 and boot0hfs are doing search in two phases:
boot0: searches for active partion, and if not found then searches for hfs
boot0hfs: searches for hfs partion, and if not found then searches for active - so it can boot fat32 if it is active (I guess)

I needed to clear this to myself once:
http://forum.voodooprojects.org/index.php/...8.html#msg10398

Chain0: if i remember correctly, searches all disks, only mbr, but with uinque feature of seraching extended partitions.

This post has been edited by dmazar: Apr 17 2012, 08:59 AM
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
blackosx
post Apr 17 2012, 09:04 AM
Post #1023
Lol.. thanks dmazar - You can always explain things better than me biggrin.gif
10.9.4 | Asus Maximus IV Gene-Z (PMpatched BIOS 3603) | i7-2600 3.40GHz | SSDT from Sam's ssdtPRGen.sh | Radeon 5770 1GB | 4GB DDR3
Booting with either Clover 2716 | Chameleon r2375 | RevoBoot v1.5.40 | Ozmosis 0894M
Slice
post Apr 17 2012, 09:32 AM
Post #1024
Thank you, dmazar!
Now I see that all works as you described. I will to correct description provided with Clover.
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
Slice
post Apr 17 2012, 11:39 AM
Post #1025
Now, reversing logics what to boot with what BOOT0* I found the follow:
We are proposed to install boot0, boot1 and Clover on the same volume. Is there any sense to put them on different drives?
1. MBR with HFS+ partition. If active - BOOT0 PASS1 else BOOT0 PASS2
2. MBR with FAT32 partition. If active - BOOT0 PASS1 else never with any BOOT0*.
3. GPT with EFI FAT32 installation. BOOT0 PASS1.
4. GPT with HFS+ installation. BOOT0 PASS1.
Is there any sense in boot0hfs or boot0md? Any cases?
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
dmazar
post Apr 17 2012, 01:14 PM
Post #1026
QUOTE (Slice @ Apr 17 2012, 01:39 PM) *
Is there any sense in boot0hfs or boot0md? Any cases?

This is just for dualboot with Windows. boot0hfs: allows win partition on the same drive to be active (important for older win) and boot0md: separate drives - allows booting from win drive since win hybernate, disk image backup and probably some other things are not working if win drive is not BIOS drive 80.
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
Slice
post Apr 17 2012, 02:06 PM
Post #1027
QUOTE (dmazar @ Apr 17 2012, 05:14 PM) *
This is just for dualboot with Windows. boot0hfs: allows win partition on the same drive to be active (important for older win) and boot0md: separate drives - allows booting from win drive since win hybernate, disk image backup and probably some other things are not working if win drive is not BIOS drive 80.

Understand. Two new situation:
1. MBR with active Windows and passive HFS+. BOOT0 will boot Windows while BOOT0hfs will boot OSX. OK.
2. Two drives. One with MBR and windows only, active partition, or may be other partitions here. This drive is 0x80.
Second drive contains Clover and OSX. In this case we install boot0md onto first drive. If no boot1 on the second drive it will return to first drive to boot Windows.
All correct?
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
dmazar
post Apr 17 2012, 08:13 PM
Post #1028
QUOTE (Slice @ Apr 17 2012, 04:06 PM) *
All correct?

Yes.

I think your options will work with boot0* like this:
0. MBR with active Windows and passive HFS+. => BOOT0 will boot Windows, BOOT0hfs and boot0md will boot OSX.
1. MBR with HFS+ partition. => boot0* will boot it.
2. MBR with FAT32 partition. => boot0 and boot0hfs will boot if active, boot0md: probably not - depends on other disks and if active
3. GPT with EFI FAT32 installation. => if pure GPT then boot0* will boot it
4. GPT with HFS+ installation. => if pure GPT then boot0* will boot it
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
dmazar
post Apr 19 2012, 06:53 PM
Post #1029
QUOTE (Slice @ Apr 17 2012, 01:39 PM) *
Now, reversing logics what to boot with what BOOT0* I found the follow:
We are proposed to install boot0, boot1 and Clover on the same volume. Is there any sense to put them on different drives?
1. MBR with HFS+ partition. If active - BOOT0 PASS1 else BOOT0 PASS2
2. MBR with FAT32 partition. If active - BOOT0 PASS1 else never with any BOOT0*.
3. GPT with EFI FAT32 installation. BOOT0 PASS1.
4. GPT with HFS+ installation. BOOT0 PASS1.
Is there any sense in boot0hfs or boot0md? Any cases?

Guys, I'll just quickly go back to this. I think that the explanation of this boot0* stuff could be simplified to this:

1. use boot0hfs in all cases, except when disk1=Win, disk2=OSX and then use boot0md on disk1
or
2. use boot0md in all cases, except when MBR with FAT32 (USB) and then use boot0hfs (or boot0)

use chain0 for extended/logical partitions

I guess there could be some combinations where above simplification will not be correct, but in most cases it should work.
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
dmazar
post Apr 19 2012, 07:08 PM
Post #1030
QUOTE (blackosx @ Apr 19 2012, 10:15 AM) *
Here's result from my iMac
CODE
BootArgs: Version=1, Revision=6
EFI Runtime: Mode=64, PageStart=0xe3e (0xe3e000), PageCount=0x76, SystemTable=0xe5df18
MemoryMap: Size=0x2670, DescriptorSize=48, DescriptorVersion=1
Type Physical Start - Physical End Number of Pages Virtual Start Attribute
...
RT_data 0000000000e3e000 - 0000000000e5dfff 0000000000000020 0000000000e3e000 800000000000000f
...

Thanks for this! A bit offtopic: I'm a bit confused with red stuff above. I would expect ffffffff80e3e000. Is this 32 bit OSX on 64 bit EFI?
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
Slice
post Apr 20 2012, 05:17 AM
Post #1031
QUOTE (blackosx @ Apr 20 2012, 01:33 AM) *
hmmm. I can't think to what the problem can be.
To help solve this problem, would you run this and return the ~/diskdumptest folder please?
[attachment=4297:dumpDisk....command.zip]

You seems to propose that EFI partition is mounted? No, it is hidden.
Attached File  diskdumptest.zip ( 5.46K ) Number of downloads: 7


Don't know how I wrongly installed boot1h into EFI PBR, and I can't erase it from here.
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
dmazar
post Apr 20 2012, 10:26 AM
Post #1032
QUOTE (Slice @ Apr 20 2012, 07:33 AM) *
Third case.
I have MBR partition table but Active partition is not first HFS+. In this case old boot0 only will work.

That's true. This is why boot0 is still there.

This case assumes that the first and the second HFS partition have boot1 installed and that second one is active because user wants to boot from this seond one. 2 HFS partitions on an MBR disk? Why not GPT then? How often can this situation be found?

As I said, there can be other "unusual" combinations. But, in general, I got the impression that people usually have booter on the first HFS partition and are starting from it with boot0hfs. And if there is Win install on the same drive, then hybrid is created and this partition is usually set to active - and this is handled by boot0hfs.


HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
Slice
post Apr 20 2012, 11:08 AM
Post #1033
QUOTE (dmazar @ Apr 20 2012, 02:26 PM) *
This case assumes that the first and the second HFS partition have boot1 installed and that second one is active because user wants to boot from this seond one. 2 HFS partitions on an MBR disk? Why not GPT then? How often can this situation be found?

Very usual situation when OSX is proposed to install on already working computer with MBR partitions. It is not possible to remake into GPT.
Then first system installed. Then second system installed. May be more.
Windows XP and Windows7-32 will not work with GPT. Moreover Windows7-32 will not work if EFI partition is present. MBR only.

Now I stopped at the question:
If a partition already have boot1h or boot1f32 installed but I don't want to use it as main booter partition, what is happen?
1. MBR. Suppose all partitions have some PBR boot codes. boot0 can choose active partition namely.
2. GPT. EFI has boot1f32 and second partition has boot1h. Priority?


Hi blackosx,
yes, I have boot1h on EFI partition and I know this is wrong. Can't install here boot1f32 because original geometry is lost.
Can't mount the partition because it has wrong PBR
CODE
bash-3.2# mount_msdos /dev/disk0s1 /Volumes/EFI/
mount_msdos: Unsupported sector size (49294)
bash-3.2#

But for OSX all is well, all is good. I have GPT with normal, hidden EFI partition without any Hacks.
Test with debug2. Seems to be OK.
Attached File  diskdumptest.zip ( 5.64K ) Number of downloads: 9
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
blackosx
post Apr 20 2012, 11:25 AM
Post #1034
QUOTE (Slice @ Apr 20 2012, 12:08 PM) *
Hi blackosx,
yes, I have boot1h on EFI partition and I know this is wrong.

Thanks for confirming boot1h is really there, I thought you meant the script was detecting it incorrectly.

QUOTE (Slice @ Apr 20 2012, 12:08 PM) *
Can't mount the partition because it has wrong PBR

Would resizing your main HDD partition with Disk Utility, when booted from the OS X install DVD cause it to re-write the GUID partition?

QUOTE (Slice @ Apr 20 2012, 12:08 PM) *
Test with debug2. Seems to be OK.

Thanks for running the revised debug script. I'll have a look at the result and update DarwinDumper.
10.9.4 | Asus Maximus IV Gene-Z (PMpatched BIOS 3603) | i7-2600 3.40GHz | SSDT from Sam's ssdtPRGen.sh | Radeon 5770 1GB | 4GB DDR3
Booting with either Clover 2716 | Chameleon r2375 | RevoBoot v1.5.40 | Ozmosis 0894M
Slice
post Apr 20 2012, 11:39 AM
Post #1035
QUOTE (blackosx @ Apr 20 2012, 03:25 PM) *
Would resizing your main HDD partition with Disk Utility, when booted from the OS X install DVD cause it to re-write the GUID partition?

Probably yes, but I afraid to change anything. It works.
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
dmazar
post Apr 20 2012, 11:57 AM
Post #1036
QUOTE (Slice @ Apr 20 2012, 01:08 PM) *
Very usual situation when OSX is proposed to install on already working computer with MBR partitions. It is not possible to remake into GPT.
Then first system installed. Then second system installed. May be more.

But then you probably already have OSX booter installed on the first partition and it will be able to boot all other partitions. Why would you install second one on the second or third partition? I mean, there could be some reason, but from my perspective - not likely for ordinary users. And if you have such requirement, then you probably know all about it (boot0* stuff) or should dig into it and understand it.

I prefer simple solution that will work in most of the cases. Ordinary users should not think much about which boot0 to choose, so you should do that for them. That's why I got back with those simplifications from previous post. "Unusual speciffics" should learn more anyway.

QUOTE (Slice @ Apr 20 2012, 01:08 PM) *
Windows XP and Windows7-32 will not work with GPT. Moreover Windows7-32 will not work if EFI partition is present. MBR only.

Do not know about that. I thought OSX will make hybrid in such case by default and Win will see it as MBR disk.

QUOTE (Slice @ Apr 20 2012, 01:08 PM) *
Now I stopped at the question:
If a partition already have boot1h or boot1f32 installed but I don't want to use it as main booter partition, what is happen?
1. MBR. Suppose all partitions have some PBR boot codes. boot0 can choose active partition namely.
2. GPT. EFI has boot1f32 and second partition has boot1h. Priority?

1 - correct
2 - they are scanned in the order of presence in GPT Array, so in the normal case EFI will be chosen

I never saw a solution for "deleting" PBR booter. If needed, removing 0x55 0xAA boot signature would do, I guess.
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
dmazar
post Apr 20 2012, 12:23 PM
Post #1037
QUOTE (blackosx @ Apr 19 2012, 11:33 PM) *
EDIT: Here's a dump of memory when booted using 64-bit kernel.

Thanks!
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
Slice
post Apr 20 2012, 12:40 PM
Post #1038
I see the sources of boot0hfs and have doubts again.
CODE
;
; Turbo - also try EFI System Partition
;

    cmp        eax, kEFISystemGUID    ; check current GUID Partition for EFI System Partition GUID type
    jne        .gpt_continue

.gpt_ok:
   ;
   ; Found HFS Partition
   ;

    mov        eax, [si + gpta.StartingLBA]        ; load boot sector from StartingLBA
    mov        [my_lba], eax        
    mov        dh, 1                                ; Argument for loadBootSector to check HFS+ partition signature.
    call    loadBootSector
    jne        .gpt_continue                        ; no boot loader signature

    mov        si, kMBRPartTable                    ; fake the current GUID Partition
    mov        [si + part.lba], eax                ; as MBR style partition for boot1h
    mov     BYTE [si + part.type], kPartTypeHFS    ; with HFS+ filesystem type (0xAF)
    jmp        SHORT initBootLoader    
    
.gpt_continue:

    add        si, bx                                ; advance SI to next partition entry
    loop    .gpt_loop                            ; loop through all partition entries    

.exit:
    pop     bx
    ret                                            ; no more GUID partitions. Giving up.

It is proposed that EFI partition is always HFS+ ?!
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
dmazar
post Apr 20 2012, 02:11 PM
Post #1039
QUOTE (Slice @ Apr 20 2012, 02:40 PM) *
It is proposed that EFI partition is always HFS+ ?!

Because of this?
; fake the current GUID Partition as MBR style partition for boot1h
; with HFS+ filesystem type (0xAF)
mov BYTE [si + part.type], kPartTypeHFS

I think that line is not even necessary. This passing of pointer to partition record is something specific to boot0->boot1. boot1h needs it to get the partition sector offset. It is used by boot1f32 also, but probably not needed since partition offset is already in FAT32 header in that first partition sector.

So - only partition record LBA offset is important here. I think nothing else from that record is used in boot1*. And setting part.type = kPartTypeHFS does not have any effect.

Just passing partition LBA offset in some register would be more readable I guess.
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
Slice
post Apr 20 2012, 03:28 PM
Post #1040
Not sure about this
CODE
; Argument for loadBootSector to check HFS+ partition signature.

May be yes, you are right and it will work.
So, if GPT and EFI partition has 0xaa55 then boot0hfs always started from EFI part. No matter if we have HFS+ partition.

And I found one more reason to use boot0.
I have MBR and there is a small unused FAT32 partition remains from Dell Utility partition. Why not use it for Clover? FAT32 is good because I can save screenshots and preboot.log. Note! If I set signature to 0xEF then Windows 7 will not started. If 0x06 the Windows7 works.
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2

67 Pages V  « < 50 51 52 53 54 > » 
Add Reply Start a new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: