Zenith432 Posted February 13, 2017 Share Posted February 13, 2017 I spoke about another problem you probably knows: boot0af changed when you implemented exFAT booting. ...but I think you can find a problem. PS. Register DI must be inited? When adding support for exfat, I changed boot0 in chameleon as follows When scanning GPT partitions, add search for Microsoft Data Partition GUID. Before my change, boot0 was searching for EFI system partition guid and Apple HFS partition guid. So it was not possible to boot vanilla fat32 (or exfat) on GPT because they have Microsoft data guid. before jumping to the boot1 code, boot0 checked for signature of either fat32 or hfs in the boot1 sector it loaded. I added check for exfat signature so it will run it too. Before jumping to boot1 code, the registers should be bios drive number in DL for MBR, pointer to MBR partition table entry in DS:SI. for GPT not sure about pointer to partition table entry, will have to check. Anyway, I did not modify boot0af in clover myself. It was imported from my changes in chameleon. I will look at the boot0af you uploaded, and current one to compare to what boot0 in chameleon is doing when I have time. Problematic USB stick have format by manufactureIt could fail because the guids in the GPT partition table are not what it's looking for or because the boot1 sector on the fat32 partition does not have the signature it's looking for. I'll have to look at the code in boot0af. 2 Link to comment Share on other sites More sharing options...
Slice Posted February 13, 2017 Share Posted February 13, 2017 Thank you! Link to comment Share on other sites More sharing options...
Micky1979 Posted February 13, 2017 Share Posted February 13, 2017 Welcome back Zenith432. boot0xg attached boot0xg.s.zip Link to comment Share on other sites More sharing options...
Slice Posted February 13, 2017 Share Posted February 13, 2017 May be we shouldn't make universal boot0 with two pass scanning and just make several versions: 1. For pure GPT to search EFI only. 2. For pure MBR to search HFS or FAT32. 3. For single partitions USB stick formatted as FAT32, exFAT or HFS. Enough? Link to comment Share on other sites More sharing options...
Micky1979 Posted February 13, 2017 Share Posted February 13, 2017 IMHO no advantages in making 3 of them if you can have only one. Link to comment Share on other sites More sharing options...
Slice Posted February 13, 2017 Share Posted February 13, 2017 IMHO no advantages in making 3 of them if you can have only one. There is a problem that universal one is not working. Link to comment Share on other sites More sharing options...
Micky1979 Posted February 13, 2017 Share Posted February 13, 2017 I've done this way for Pandora: Link to comment Share on other sites More sharing options...
Micky1979 Posted February 13, 2017 Share Posted February 13, 2017 Slice I see you deprecated the old way of patching dsdt, so clovergen-config need to be adjusted at line 604? // addBoolean(fixDict, CFSTR("NewWay_80000000"), !!(s->FixDsdt & FIX_NEW_WAY)); //deprecated in r4006 1 Link to comment Share on other sites More sharing options...
Zenith432 Posted February 13, 2017 Share Posted February 13, 2017 (edited) I reviewed the code in boot0af from clover r4004. It does everything chameleon boot0 does and a bit more. On the first pass of MBR it looks for protective MBR (0xee) or active partition. On second pass, it looks for either HFS (0xaf), fat32 (0xc) or exfat (0x7). chameleon boot0 only looks for HFS (0xaf) on 2nd pass. If it finds GPT, it looks for partition guid which is either 1) Apple HFS, 2) EFI system partition or 3) Microsoft basic data. If it finds a partition of the above kind, it loads the first 3 sectors from partition, and checks the signature... for HFS signature is HX or H+ on the 3rd partition sector. for FAT32 need 'BO' at offset 0x5a of first partition sector. for exfat need 'EX' at offset 0x3 of first partition sector. It also checks the first partition sector for signature 0x55aa at last two bytes. Looking at the dump of the USB stick on post #1830 I cannot tell if it's GPT with protective MBR, or it's just regular MBR, but gdisk prints it as fake GPT. If it's regular MBR, I see partition type 0xb. boot0af looks for partition type 0xc, but only in the 2nd pass. If it finds active parition in 1st pass, it should try to run it even it's not one of the types it recognizes. The star near that partition appears to indicate the partition is marked as active. If it's marked as active it should be ok even though type is 0xb instead of 0xc. If the partition is not marked as active, then boot0af won't recognize it because of type 0xb. Finally, you need to look on the partition boot sector to see if bytes are 'BO' at offset 0x5a and 0x55aa at offset 0x1fe. PS: The difference between the boot0af posted in post #1829 and the current one is that the older one in post #1829 does not recognize exfat partition type on MBR or exfat boot sector signature. However, this should not interfere with recognition of fat32. Also, the content of the di register on exit from boot0af should not matter. It is not used in boot1f32 (I checked). PPS: If you like, read sectors 0-2 and 8192 off the USB stick with dd and upload. I'll look at them with a hex editor and figure out why it's unrecognized by boot0af. Edited February 13, 2017 by Zenith432 3 Link to comment Share on other sites More sharing options...
Slice Posted February 13, 2017 Share Posted February 13, 2017 I am sorry for the turbulence. The problem is not in boot0af. Somehow this stick is not bootable on this computer (slow USB?) but works on another. The question is closed. There is another problem for me. Imagine situation that you have one computer, bootable USB stick with Clover and all files, and hard drive with macOS. How to make this HDD to be bootable? I can boot into this macOS but in this case writing boot0 is not possible. May be somehow from Shell.efi? Link to comment Share on other sites More sharing options...
Zenith432 Posted February 14, 2017 Share Posted February 14, 2017 Imagine situation that you have one computer, bootable USB stick with Clover and all files, and hard drive with macOS. How to make this HDD to be bootable? I can boot into this macOS but in this case writing boot0 is not possible. May be somehow from Shell.efi? Insufficient information. It is not possible to start boot.efi directly from shell.efi on hackintosh, because it does not inject the things needed to start macos like clover does (smbios, dsdt). You can boot clover from the USB stick and start the macos partition on the HDD from clover. If the computer has native uefi bios, you can install clover on any parition on the HDD that has filesystem readable by native uefi, then boot into the native uefi boot manager, and add cloverx64.efi to the native uefi boot manager - and start clover from the native uefi boot manager. If the computer only has MBR booting, it depends on the OS it's booting now. In Windows, you can chain-boot any other partition by creating a boot.ini file on root directory of Windows system partition and putting a file with the chained partition boot sector same place as boot.ini. It's been many years since I done this so I don't remember the syntax in boot.ini, but you can find instructions how to do it on the web. In Linux, grub can chain-boot other partitions, and I think grub can also boot macos - but I don't know how to set this up. If the computer only has MBR booting, and HDD is currently unbootable (non-functioning boot code on MBR) - it's not possible to make it bootable without writing boot code on MBR. Link to comment Share on other sites More sharing options...
Slice Posted February 14, 2017 Share Posted February 14, 2017 In Linux, grub can chain-boot other partitions, and I think grub can also boot macos - but I don't know how to set this up. Linux LiveCD will be a solution to install boot sector but there is no DVD/CD present. Grub can't boot macOS because of LGPL license. If the computer only has MBR booting, and HDD is currently unbootable (non-functioning boot code on MBR) - it's not possible to make it bootable without writing boot code on MBR. Yes, this is very old PC BIOS based computer and HDD is currently unbootable. So I have to write boot sector and this is a problem having only USB stick and this HDD. I will think about an application like boot0_install.efi. For example Windows installation assumes writing boot sectors. MacOS no. Link to comment Share on other sites More sharing options...
Zenith432 Posted February 14, 2017 Share Posted February 14, 2017 Linux LiveCD will be a solution to install boot sector but there is no DVD/CD present. Yes, this is very old PC BIOS based computer and HDD is currently unbootable. So I have to write boot sector and this is a problem having only USB stick and this HDD. I will think about an application like boot0_install.efi. For example Windows installation assumes writing boot sectors. MacOS no. You can make bootable USB sticks for Linux, for Windows and for macos. I have all three. For Windows - look for "download windows 10 iso" - you actually download something called MediaCreationTool.exe that knows how to create bootable Windows USB stick. For Linux - look for Fedora live USB creator. You can make a "live usb" or install Linux regularly on a USB stick. For Macos - get "Sierra MBR patch" by crazybirdy from this site. It has instructions how to create live macos USB stick. There is a simpler option - use a Clover USB stick to boot the macos partition on the HDD - then use fdisk440 on that system while it's running to write the MBR. PS: EFI shell has an hexedit command that can be used to edit disk sectors - but you'll have to enter 440 bytes of MBR boot code manually... 2 Link to comment Share on other sites More sharing options...
Slice Posted February 14, 2017 Share Posted February 14, 2017 There is a simpler option - use a Clover USB stick to boot the macos partition on the HDD - then use fdisk440 on that system while it's running to write the MBR. This is what I am speaking. If you boot macOS from the HDD then fdisk440 is NOT ABLE to write the MBR. (ElCapitan at least) PS. or PBR. Link to comment Share on other sites More sharing options...
Zenith432 Posted February 14, 2017 Share Posted February 14, 2017 Try using /dev/rdisk instead of /dev/disk This is what I am speaking. If you boot macOS from the HDD then fdisk440 is NOT ABLE to write the MBR. (ElCapitan at least) PS. or PBR. Link to comment Share on other sites More sharing options...
Slice Posted February 14, 2017 Share Posted February 14, 2017 Try using /dev/rdisk instead of /dev/disk Anyway: "resource busy". The system guards boot sector from any modification. I hear it's not happen if the MBR sector clear (all zero). But in my case I can't do anything with fdisk440 or DD, even under sudo. The only way is to boot from second HDD if any. Link to comment Share on other sites More sharing options...
Zenith432 Posted February 14, 2017 Share Posted February 14, 2017 Something strange going on. I tried with 10.11.6 using fdisk440 to update MBR code on two different hard disks, both containing mounted partitions, one of which is the running macos partition - and it worked. Both with /dev/disk and /dev/rdisk. Anyway: "resource busy". The system guards boot sector from any modification. I hear it's not happen if the MBR sector clear (all zero). But in my case I can't do anything with fdisk440 or DD, even under sudo. The only way is to boot from second HDD if any. PS: Maybe it'll work in single user mode -s ?? Link to comment Share on other sites More sharing options...
Slice Posted February 15, 2017 Share Posted February 15, 2017 PS: Maybe it'll work in single user mode -s ?? Resource busy as well. OS 10.11.6. Link to comment Share on other sites More sharing options...
smolderas Posted February 15, 2017 Share Posted February 15, 2017 Resource busy as well. OS 10.11.6. Try to find the process who access to it with `lsof`. Maybe it is just trying to indexing. Link to comment Share on other sites More sharing options...
Slice Posted February 15, 2017 Share Posted February 15, 2017 Try to find the process who access to it with `lsof`. Maybe it is just trying to indexing. In single user mode (-s)? Link to comment Share on other sites More sharing options...
cecekpawon Posted February 15, 2017 Share Posted February 15, 2017 EDK2 provide some patches for (Ascii)StrnLenS in safestring ** But they appear has not been used anywhere yet with Clover 2 Link to comment Share on other sites More sharing options...
Zenith432 Posted February 18, 2017 Share Posted February 18, 2017 (edited) Clover 4012 with Kaby Lake i5-7600 - Epic Fail Using Clover 4012 binaries from sourceforge. i5-7600 Gigabyte Z270-HD3-CF Using integrated Intel HD 630 for graphics Tried booting both OS 10.11.6 and 10.12.3 Stuck in the text screen after KernelAndKext patches. Does not switch to graphics mode. Tried some of the suggestions in this thread without success. Booting Clover using native UEFI boot from EFI system partition formatted as FAT32 (uses CloverGUI only) Native EFI drivers + efifs Grub NTFS driver 1.1 + Clover VBox HFS + all other drivers from Clover in drivers64UEFI Tried booting both systems with Chameleon 2847 (which does not do much of what Clover does) - stuck in the graphics screen after Chameleon does its stuff and jumps to kernel. Nothing displayed by kernel. Attached are Clover config.plist, debug.log for 10.11.6, 10.12.3, screenshot of where it's stuck. The screenshot is similar for both versions, but different addresses for BootArgs2, DevTree and kernel patches. Any suggestions? PS: Another, unrelated issue is that there is no countdown to auto-start. I have to choose a system and press a key to start. kaby_lake_fail.zip Edited February 18, 2017 by Zenith432 Link to comment Share on other sites More sharing options...
SavageAUS Posted February 19, 2017 Share Posted February 19, 2017 I'm not sure what changes were made after version 4004 but all version after 4004 including 4007, 4009, 4011 and 4012 all break my HDMI audio. I'm using Toleda's script to enable it audio_cloverHDMI-120_v1.0d.command and adding one fix any help please. Link to comment Share on other sites More sharing options...
smolderas Posted February 19, 2017 Share Posted February 19, 2017 I'm not sure what changes were made after version 4004 but all version after 4004 including 4007, 4009, 4011 and 4012 all break my HDMI audio. I'm using Toleda's script to enable it audio_cloverHDMI-120_v1.0d.command and adding one fix Screen Shot 2017-02-19 at 10.37.34 am.png any help please. See this. Why are you not patching your DSDT and adding the HDAU device into it? Link to comment Share on other sites More sharing options...
SavageAUS Posted February 19, 2017 Share Posted February 19, 2017 See this. Why are you not patching your DSDT and adding the HDAU device into it? Because up until now I have not needed to. Sent from my SM-G930F using Tapatalk Link to comment Share on other sites More sharing options...
Recommended Posts