ProjectOSX

Welcome Guest!

Returning User? Login here.

Want membership privileges? Register here.

67 Pages V  « < 45 46 47 48 49 > »   
Start a new topic Add Reply
> How To Make Efi Bootloader
dmazar
post Mar 11 2012, 09:43 PM
Post #921
Just an idea from VBoxFs: injection of FakeSMC on file system driver level for booting CD install. They have fsw_hfs_inject() call, but unfortunately not implemented. Plus "blacklisting of certain files on FS driver level" (AppleIntelCPUPowerManagement.kext).
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
STLVNUB
post Mar 11 2012, 11:02 PM
Post #922
Using HomeBrew and my script ( CloverBrewer) which utilises cbuild.sh for Clover and a modified cbuildrEFIt.sh for rEFIt
I have successfully built Clover IA32/X64 using gcc4.63.
Have tested boot(X64) and CLOVERX64.efi.Seems to work ok.No names in rEFIt though??

My script does this: (short rant about Homebrew or goto Then:)

Using Homebrew (brew) you can install/uninstall all sorts of things.
e.g
binutils:
To install: brew install binutils, brew will do its thing: (Downloading, installing etc)
To uninstall: brew uninstall binutils.
Done..

Then:
Utilises HomeBrew and installs 'brew' if NOT found. (HIGHLY recommend installing it)
installs: binutils, gmp, libmpc, mpfr
These are depends for gcc-4.6.3.tar.bz2, so if there NOT there they INSTALLED.
Then installs gcc-4.6.3.tar.bz2 (latest and greatest.
Using 'brew install PATHTO/gcc463.rb --use-gcc
Then continues with script

Builds IA32 and X64 versions of Clover/rEFIt ( 2 1/2 minutes)
Copies boot to Media/Bootloaders/(IA32/X64)/boot.

IT will prompt you to copy your EFI folder to Media if NOT there and wait for keypress.

Copy said folder to Media , and press any key,and it will:

Make devicestrings, strings.dat and places it into Media/EFI/devices/
Copy Clover(IA32/X64).efi to Media/EFI/BOOT
Make you a cup of coffee. dry.gif

IT is auto set to gcc46 (X64/IA32) release.
Just rm the Build folder, it will know its NOT there and do a cleanall
otherwise it does a clean, then builds.
Don't know if the cleanall/clean is necessary, i.e can X64 settings build IA32??

Anybody want to test, preferably on clean system, just let me know.
I Love Homebrew, which is my MAIN reason for using my own script to buildstrap the other scripts.

@slice
Is there a switch for pciroot (0/1) or do i need to edit dsdt.
also memory not showing correctly in System Profiler.

Thanks slice, your doing great job.

Will iron out the bugs, if any and upload it.
Azrock Z77 Pro3, G1610 AMD HD7750 Clover/Ozmosis
Toshiba A660-0MR00R I7-7740QM GT330M 8 Gig Clover

Slice
post Mar 12 2012, 06:44 AM
Post #923
QUOTE (STLVNUB @ Mar 12 2012, 03:02 AM) *
No names in rEFIt though??

It is a bug of VBoxHfs driver. I will think how to correct this.

QUOTE
@slice
Is there a switch for pciroot (0/1) or do i need to edit dsdt.
also memory not showing correctly in System Profiler.

Thanks slice, your doing great job.

Will iron out the bugs, if any and upload it.

Yes, this is already implemented, just not announced
CODE
    <key>PCIRootUID</key>
    <string>0</string>

About memory I think it is a bug in SMBIOS that Clover is still not corrected.
I had such a bug with older revision but with rev314 all is fine for me.
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.4), OS⌘10.9.1, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
Slice
post Mar 12 2012, 06:59 AM
Post #924
QUOTE (dmazar @ Mar 12 2012, 01:43 AM) *
Just an idea from VBoxFs: injection of FakeSMC on file system driver level for booting CD install. They have fsw_hfs_inject() call, but unfortunately not implemented. Plus "blacklisting of certain files on FS driver level" (AppleIntelCPUPowerManagement.kext).

It looks to be possible because boot.efi uses our HFS driver to load kexts.
There is a best way to influence on the driver is to implement a new protocol like we did with APPLE_GETVAR_PROTOCOL.
But there must be our own protocol and VboxHfs should connect to it.
If the hfs driver got a command to read files from s/l/e it can first load drivers from EFI/kexts (through the protocol calls) and then return back to involved functions.
This will not work if kernelcache loaded.
Or may be implement adding extra-kexts to kernelcache on the fly? What is the structure of the kernelcache?
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.4), OS⌘10.9.1, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
Slice
post Mar 12 2012, 08:40 AM
Post #925
Load FakeSMC instead of CpuPM? wink.gif
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.4), OS⌘10.9.1, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
humph
post Mar 12 2012, 09:29 AM
Post #926
QUOTE (dmazar @ Mar 10 2012, 08:13 PM) *
I've tried the version from Clover again. 64 and 32 bit built with cross gcc (built with latest jadran's buildgcc) and it boots OSX.
What kind of issues do you have with it?

For me, on 32bit, the VBoxHFS built same way as dmazar described in #907 (and also using jadran's new build script and GCC46), appears to be much slower to read kernel and startup mkext, compared to the "old" MP2,1 binary version (based purely on how fast the read progress goes on the screen). Although perhaps I'm doing something wrong. The resulting VBoxHFS.efi is around 20kB vs 19kB for the others, but the resulting boot file is around 3kB smaller than when using the old HFS binary. But it does boot.
dmazar
post Mar 12 2012, 09:47 AM
Post #927
QUOTE (Slice @ Mar 12 2012, 07:59 AM) *
There is a best way to influence on the driver is to implement a new protocol like we did with APPLE_GETVAR_PROTOCOL.

Speaking of loading without caches: was iBoot EFI able to inject kexts on ExitBootServices?

If this is not doable, then your suggestion to override file system driver on EFI level seems like a doable solution. Separate driver (that can even be loaded from /EFI/drivers) that intercepts boot.efi's request for HFS file system and inserts it's own implementation. This implementation just redirects calls to real HFS driver to real volume, or, in case of S/L/E, additionally reads entries from clover's volume and injects them into result. This could work with any HFSPlus.efi.

Did not go into details, but seems doable. But it could be used only when forcing booting without caches, like CD install. And then ... new versions are not comming on a CD any more.
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
Slice
post Mar 12 2012, 10:05 AM
Post #928
I see a problem. HFS driver gets many calls from boot.efi. At what moment we should perform our action?
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.4), OS⌘10.9.1, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
iNDi
post Mar 12 2012, 10:58 AM
Post #929
QUOTE (dmazar @ Mar 12 2012, 09:47 AM) *
Speaking of loading without caches: was iBoot EFI able to inject kexts on ExitBootServices?

If this is not doable, then your suggestion to override file system driver on EFI level seems like a doable solution. Separate driver (that can even be loaded from /EFI/drivers) that intercepts boot.efi's request for HFS file system and inserts it's own implementation. This implementation just redirects calls to real HFS driver to real volume, or, in case of S/L/E, additionally reads entries from clover's volume and injects them into result. This could work with any HFSPlus.efi.

Did not go into details, but seems doable. But it could be used only when forcing booting without caches, like CD install. And then ... new versions are not comming on a CD any more.



yes its possible to inject kexts in OnExitBootServices event with some limitations, you have to load them before the event occurs.
dmazar
post Mar 12 2012, 11:13 AM
Post #930
QUOTE (Slice @ Mar 12 2012, 11:05 AM) *
I see a problem. HFS driver gets many calls from boot.efi. At what moment we should perform our action?

QUOTE (Slice @ Mar 12 2012, 11:05 AM) *
I see a problem. HFS driver gets many calls from boot.efi. At what moment we should perform our action?

Are you working on it?

I see the first steps like this:

boot.efi should first get EFI_SIMPLE_FILE_SYSTEM (FS) protocol with BS->OpenProtocol (or maybe some other protocol discovery method?). then should call FS->OpenVolume to get EFI_FILE_PROTOCOL. It should then use this EFI_FILE_PROTOCOL.Read for reading dirs and files.

So, probably OpenProtocol should be taken and when request for EFI_SIMPLE_FILE_SYSTEM comes for HFS volume handle different then clover's it should create it's own implementation with OpenVolume. When this OpenVolume is called, then it should return it's own implementation of EFI_FILE_PROTOCOL.

Alternative is to change EFI_FILE_PROTOCOL implementation directly in VBoxHfs.

One more issue: independent (out of clover) drivers would not know which is clover's volume. So clover would need to publish it somehow, or this override should be made inside clover.

HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
dmazar
post Mar 12 2012, 11:22 AM
Post #931
QUOTE (humph @ Mar 12 2012, 10:29 AM) *
VBoxHFS ... appears to be much slower to read kernel and startup mkext, compared to the "old" MP2,1 binary version

It is slower to me also. Plus still does not have volume label support. Extracted HFSPlus.efi looks like a better choice after all.
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
Slice
post Mar 12 2012, 11:53 AM
Post #932
QUOTE (dmazar @ Mar 12 2012, 03:13 PM) *
Are you working on it?

I see the first steps like this:

boot.efi should first get EFI_SIMPLE_FILE_SYSTEM (FS) protocol with BS->OpenProtocol (or maybe some other protocol discovery method?). then should call FS->OpenVolume to get EFI_FILE_PROTOCOL. It should then use this EFI_FILE_PROTOCOL.Read for reading dirs and files.

So, probably OpenProtocol should be taken and when request for EFI_SIMPLE_FILE_SYSTEM comes for HFS volume handle different then clover's it should create it's own implementation with OpenVolume. When this OpenVolume is called, then it should return it's own implementation of EFI_FILE_PROTOCOL.

Alternative is to change EFI_FILE_PROTOCOL implementation directly in VBoxHfs.

One more issue: independent (out of clover) drivers would not know which is clover's volume. So clover would need to publish it somehow, or this override should be made inside clover.

boot.efi may call OpenVolume several times. We don't know exactly. The most interesting moment is when it open dir SLE. At this moment we can rewrite the dir contents to contain FakeSMC and then override reading it from our cache created before.

There is no problem to publish resources and Clover volume. As I said before we can implement own protocol to have a connection between boot.efi and clover.

I am still not working on the problem, just discuss if it possible.

About VBoxHfs I don't see it is slow and Volume Label Support will be added.
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.4), OS⌘10.9.1, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
jadran
post Mar 12 2012, 12:44 PM
Post #933
QUOTE (Slice @ Mar 12 2012, 12:53 PM) *
About VBoxHfs I don't see it is slow and Volume Label Support will be added.


I think, that with vboxhfs clover moves away from grey zone...
iNDi
post Mar 12 2012, 12:57 PM
Post #934
really should rewrite the HFS driver to be native, rather than use the convoluted methods used in VBoxHFS and VBoxIso9660 etc.

the code is pretty bad ie copies structures when ptrs should be used.
dmazar
post Mar 15 2012, 02:32 PM
Post #935
Managed to override EFI_SIMPLE_FILE_SYSTEM_PROTOCOL and EFI_FILE_PROTOCOL on boot volume and as a side effect get trace of how boot.efi is reading files.

I'll leave it here - maybe somebody will find something useful in there.
Attached File  BootEfi_FS_Trace.zip ( 25.5K ) Number of downloads: 21
HW: Asus P8P67-M, Intel Core i5-2300, 4GB, XFX HD-567X-ZHH3 SW: SL, L, ML: Clover UEFI boot
zhell
post Mar 17 2012, 07:47 PM
Post #936
QUOTE (STLVNUB @ Mar 12 2012, 12:02 AM) *
Using HomeBrew and my script ( CloverBrewer) which utilises cbuild.sh for Clover and a modified cbuildrEFIt.sh for rEFIt
I have successfully built Clover IA32/X64 using gcc4.63.
Have tested boot(X64) and CLOVERX64.efi.Seems to work ok.No names in rEFIt though??

Anybody want to test, preferably on clean system, just let me know.
Will iron out the bugs, if any and upload it.

Sounds great, STLVNUB. I would like to test your script. I agree that Homebrew is an awesome way to build software that has dependencies.

The binaries available in the first post don't seem to be able to hand over control to the kernel. It loads the KEXTs (either from kernel cache or from /S/L/E fine, but afterwards the machine simply reboots.

I have tried with and without graphics injector and also with and without my custom DSDT.

This is on a GA-Z68MX with an i7 2600, 16GB RAM, and booting Lion 10.7.3 from an internal SSD.

Although the EFI shell lists all my volumes just fine (3 drives with multiple partitions each), Clover can only see the first partition of the first drive. All drives are SATA in AHCI mode.
GA-Z68MX-UD2H-B3-U1c | Core i7 2600 | 16GB DDR3-1600
Intel SSD 520 240GB + WDC WD-20EARX 2TB Fusion drive
Sapphire Radeon HD 6850 1024MB PEG | Atheros AR9380 Mini PCIe | Intel 82574L PCIe
OS X 10.8.2 | Chameleon 2.1svn | Clover EFI r897
STLVNUB
post Mar 18 2012, 12:30 AM
Post #937
QUOTE (zhell @ Mar 18 2012, 05:47 AM) *
Sounds great, STLVNUB. I would like to test your script. I agree that Homebrew is an awesome way to build software that has dependencies.

Ok, good to hear someone else likes "HOMEBREW". at least it won't make you drunk.
Find attached CloverBreweryTool v0.0.
[attachment=4188:CloverBreweryTool.zip]
If you can test it on a Clean system, that would be great.
The script will check for HomeBrew and download/install if not found.
It will do same for wget and git.( well hopefully anyway)

Script will update brew and proceed to ' brew install gcc463'
If all goes well, it will then make a Media folder containing Bootloader and EFI folders for later use.
It will also dump device strings, strings.dat to Media/EFI/devices.

CloverBrewery auto builds both IA32 and X64 (GCC46 of course) versions of Clover/rEFIt and places Clover boot files into Media/Bootloader/(IA32/X64)
It places CLOVERIA32.efi and CLOVERX64.efi into Media/EFI/BOOT
Keeps logs in folder LOGS as well.

Build time is under 3 minutes here.

May be some bugs, but works great from here and can/will be be vastly expanded/improved.

Enjoy.

This post has been edited by STLVNUB: Mar 18 2012, 12:33 AM
Azrock Z77 Pro3, G1610 AMD HD7750 Clover/Ozmosis
Toshiba A660-0MR00R I7-7740QM GT330M 8 Gig Clover

blackosx
post Mar 18 2012, 08:40 AM
Post #938
Hi STLVNUB

I thought I'd try your CloverBreweryTool on a fresh installation of 10.8 DP2.

So to report back to you, the first issue is /usr/local doesn't exist.
Here's output from Terminal:
CODE
********************************************
* Welcome To CloverBrewery V 0.0 *
* This script by STLVNUB *
* credits: slice, jadran, trauma, blackosx *
* Using Homebrew, the OS X Package Manager *
* http://mxcl.github.com/homebrew/ *
********************************************

Homebrew is NOT installed
It is very usefull for other things
Do you want to INSTALL it??
Type 'y' to INSTALL
Or Type 'n' to 'Exit'
y
Entering function getBREW
Getting brew, wget, git, and gcc463
Take ownership of /usr/local so you don't have to sudo
Password:
chown: /usr/local: No such file or directory
Download and install Homebrew from github
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 185 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
100 122 100 122 0 0 18 0 0:00:06 0:00:06 --:--:-- 34
0 122 0 0 0 0 0 0 --:--:-- 0:00:12 --:--:-- 0tar: could not chdir to '/usr/local'

1 617k 1 11088 0 0 869 0 0:12:08 0:00:12 0:11:56 2628
curl: (23) Failed writing body (0 != 4096)
brew install wget
/Users/blackosx/Desktop/CloverBreweryTool/CloverBrewery.command: line 205: brew: command not found
brew install git
/Users/blackosx/Desktop/CloverBreweryTool/CloverBrewery.command: line 209: brew: command not found
brew update
/Users/blackosx/Desktop/CloverBreweryTool/CloverBrewery.command: line 212: brew: command not found
Exiting Function getBREW

Press any key to install gcc4.63

I didn't continue any further for now. I'll test this for you as and when you provide updates smile.gif
10.9.1 | 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 2627 | Chameleon r2375 | RevoBoot v1.5.40 | Ozmosis 0894M
zhell
post Mar 18 2012, 05:41 PM
Post #939
QUOTE (STLVNUB @ Mar 18 2012, 01:30 AM) *
Ok, good to hear someone else likes "HOMEBREW". at least it won't make you drunk.
Find attached CloverBreweryTool v0.0.
[attachment=4188:CloverBreweryTool.zip]

Thanks STLVNUB.

I have tried to run your script, but not gotten to a successful compilation.

I get stuck at the point where the script goes to town and actually starts building EDK2:
CODE
*******************************************
* Auto Build Full Clover-rEFIt_UEFI Build *
* Using Flags: gcc46 x64/ia32 release     *
*******************************************


I suppose that you have GCC installed in /opt/local/ia32 and /opt/local/x64 from a manual installation following Slice's instructions, whereas your script does not seem to install anything to this location.

I have also made some changes to give the user the option to install Homebrew into the current directory instead of /usr/local. I think this is very useful because some people don't want anything in /usr/local because it typically conflicts with binary installations.
I have attached my modified version.
Attached File  CloverBreweryTool.command.zip ( 3.46K ) Number of downloads: 6

It would be great if you could enhance your script such that it builds everything in the current directory.
Reason for edit: make a link of attachement into post
GA-Z68MX-UD2H-B3-U1c | Core i7 2600 | 16GB DDR3-1600
Intel SSD 520 240GB + WDC WD-20EARX 2TB Fusion drive
Sapphire Radeon HD 6850 1024MB PEG | Atheros AR9380 Mini PCIe | Intel 82574L PCIe
OS X 10.8.2 | Chameleon 2.1svn | Clover EFI r897
blackosx
post Mar 18 2012, 09:55 PM
Post #940
QUOTE (zhell @ Mar 18 2012, 05:41 PM) *
I have attached my modified version.

Thanks zhell, though I had to made a couple of tweaks to overcome a couple of problems:
- Add the CopyToClover folder from STLVNUB's CloverBreweryTool folder.
- Add the following after the else in function main() because I was getting an $BREW_PREFIX unbound variable error.
CODE
export BREW_PREFIX="/usr/local"
export PATH="$BREW_PREFIX/bin:$BREW_PREFIX/sbin:$PATH"


QUOTE (zhell @ Mar 18 2012, 05:41 PM) *
I suppose that you have GCC installed in /opt/local/ia32 and /opt/local/x64 from a manual installation following Slice's instructions, whereas your script does not seem to install anything to this location.

I think this applies here too as I see this:
CODE
Building ... /Users/blackosx/Desktop/Clover_Scripts/Zhell/src/edk2/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf [X64]
/bin/sh: /opt/local/x64/gcc: No such file or directory
10.9.1 | 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 2627 | Chameleon r2375 | RevoBoot v1.5.40 | Ozmosis 0894M

67 Pages V  « < 45 46 47 48 49 > » 
Add Reply Start a new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: