Help - Search - Members - Calendar
Full Version: How To Make Efi Bootloader
Project OS X Forums > OS X 10.6 (Snow Leopard) > Development
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27
Slice
QUOTE (гык-sse2 @ Apr 18 2011, 01:49 PM) *
Don't know why don't you have it. I'm on 10.6.6.
but boot.efi from Lion reads board-id from SMBIOS, and something is wrong, because board-id matches (I used it on XPC), it displays, but it's unsupported. Maybe wrong length?

DataHub serves as an SMBIOS replacement and Lion reads properties from here but SMBIOS.
There may be a reason for KP, if DataHub has no good memory description. I know Chameleon write the definition somewhere I am not clear. And with Chameleon system is stable.
SunKi
QUOTE
What about FirmwareFeatures?
Did you ever try to open StartupDisk.prefPane and look into Console messages?
CODE
20.04.11 11:15:48    com.apple.diskmanagementd[710]    Could not access BootOrder


just remind

QUOTE
CODE
struct SMBFirmwareVolume {
    SMB_STRUCT_HEADER               // Type 128
    SMBByte           RegionCount;
    SMBByte           Reserved[3];
    SMBDWord          FirmwareFeatures;
    SMBDWord          FirmwareFeaturesMask;
    SMBByte           RegionType[ NUM_FLASHMAP_ENTRIES ];
    FW_REGION_INFO    FlashMap[   NUM_FLASHMAP_ENTRIES ];
};
Slice
I already realized it in Clover as far as you know.

And I want to say to all that SMBIOS definition is not enough.
jadran
Hi to all

This is a next version of edkbuild script:
Click to view attachment
NEW:
Creates CloverBoot directory where bootsectors and efildr32 renamed to boot will be after compiling
Add HFSPlus.efi error detection with README comment.

Any comment is welcome.

EDIT2:
Click to view attachment
Added iboot-cl from slice svn for Clover dependency (now in iboot-cl/Slice)
And now bootsectors are from Clover svn
Slice
Thank you for the great work. I will place a link into post#1.

You can also add iBoot download and compile into the script.
jadran
QUOTE (Slice @ Apr 20 2011, 09:23 AM) *
Thank you for the great work. I will place a link into post#1.

You can also add iBoot download and compile into the script.


I will if you guys think that is necessary. I don't know in witch way is Clover going, as base for iboot, or Clover will have its own GUI application with patches?
And one more thing;
I think that we should maybe change Clover from "boot" to "clover", easier to understand, and maybe nicer.
гык-sse2
I think that we should maybe change Clover from "boot" to "clover", easier to understand, and maybe nicer.

What to change from "boot" to "clover"? Where is "boot"?
jadran
QUOTE (гык-sse2 @ Apr 20 2011, 03:51 PM) *
I think that we should maybe change Clover from "boot" to "clover", easier to understand, and maybe nicer.

What to change from "boot" to "clover"? Where is "boot"?


I mean in stage bootloader boot1h and boot1f32, nothing special and insignificant, but nice add

just to add this folder to svn of cloverefiboot and than we are not dependent on chameleon forge, and credits are the same.
Click to view attachment
гык-sse2
QUOTE (jadran @ Apr 20 2011, 07:33 PM) *
I mean in stage bootloader boot1h and boot1f32, nothing special and insignificant, but nice add

just to add this folder to svn of cloverefiboot and than we are not dependent on chameleon forge, and credits are the same.
Click to view attachment

Ah, you are about HFS boot... I'm not using it, but I think users would prefer the old "boot", because it's compatible with those Darwin bootloader install scripts or commands, though files are different.
jadran
QUOTE (гык-sse2 @ Apr 20 2011, 05:58 PM) *
Ah, you are about HFS boot... I'm not using it, but I think users would prefer the old "boot", because it's compatible with those Darwin bootloader install scripts or commands, though files are different.


Commands are the same, files are the same, install script is the same, only diff would be name of the Efildr20 from "boot" to "clover", but well it is insignificant.
I hope there will be some GUI from You and Slice to add to script and that this thing will mature in real efi environment for boot.efi.

@Slice:
in witch way is Clover going, as base for iboot, or Clover will have its own GUI application with patches?
blackosx
QUOTE (jadran @ Apr 20 2011, 09:15 AM) *
This is a next version of edkbuild script:
Click to view attachment

Any comment is welcome.

Hi jadran

I tested your revised script this morning. The only option I had time to try was the --auto option which worked great.
The script finished with the correct report about the missing HFSplus.efi. That's a useful note. Good job.

After adding HFSPlus.efi, I then manually compiled Clover, to have it fail requesting iboot_cl as posted by Slice.
Can you have the script add that iboot_cl as it's now mandatory to have it for successful compilation?

Thanks
Slice
QUOTE (jadran @ Apr 21 2011, 12:46 PM) *
Commands are the same, files are the same, install script is the same, only diff would be name of the Efildr20 from "boot" to "clover", but well it is insignificant.
I hope there will be some GUI from You and Slice to add to script and that this thing will mature in real efi environment for boot.efi.

@Slice:
in witch way is Clover going, as base for iboot, or Clover will have its own GUI application with patches?

Name "boot" is predefined in boot1h so I dunno if it possible to change. You did it?
Clover is an EFI firmware able to launch any .efi application. To autostart iboot.efi should be renamed to /efi/boot/bootIA32.efi.
Same way you can start any GUI: Shell, iBoot, rEFIt, XPC (? it is 64 bit while we are on 32bit platform).
I have no my own GUI.
Clover also can boot OS without any GUI from active partition if bootIA32.efi is not found.

But Clover is not finished yet. I am still thinking about last patches should be made into AppleSim.
The boot process must be the follow
1. MBR - boot0
2. PBR - boot1h or bs32
3. Clover EFI
4. GUI
5. Additional drivers loaded from GUI: Smbios (read plist), Acpi (read *.aml), AppleSim (take it out from EFI and from GUI), FS drivers... else?
6. boot.efi or Legacy boot for other OSes.
jadran
QUOTE (Slice @ Apr 21 2011, 10:18 AM) *
Name "boot" is predefined in boot1h so I dunno if it possible to change. You did it?

I did it one post before, and posted Bootsectors U can add to svn and then I will change script to use Bootsector files from Clover svn not Chameleon svn.

QUOTE
But Clover is not finished yet. I am still thinking about last patches should be made into AppleSim.

I know it is not finished, and well as blackosx mentioned where will be iboot-cl for download? (Forum post is not good place for a script) Will it be in Clover svn or I
need to add ninjas svn?
Slice
QUOTE (jadran @ Apr 21 2011, 01:29 PM) *
I did it one post before, and posted Bootsectors U can add to svn and then I will change script to use Bootsector files from Clover svn not Chameleon svn.


I know it is not finished, and well as blackosx mentioned where will be iboot-cl for download? (Forum post is not good place for a script) Will it be in Clover svn or I
need to add ninjas svn?

I proposed I would be as ninja's svn branch. Wait until we do it.
About bootsector I can submit it without testing. One moment.

Or just add original ninja's iboot into script. I hope he will correct all mistakes we noticed.
humph
Hi all, been lurking here a good while now following the exciting developments. Awesome stuff.

Having failed to compile some weeks ago (XCode4, gcc version issues, I guess), I took the opportunity to also try out Jadran's 0.4 script now that I've got an XCode 3.2.4 environment back, and made Clover (and iBoot) successfully. Seeing the problems with DSDT (hang), tried booting w/o DSDT (knowing that it probably would fail at some stage). But it's crashing really early on!!
I could post a picture, but to save space: panic (cpu 0x02abfe5)...tsc_init: EFI not supported!..../osfmk/i386/tsc.c.:190. Uptime 0 nano. :-(

Using Atom N270 with (Slice's) 10.6.7 kernel. Needless to say, boots fine under Chameleon or Revolution.
Same issue booting direct, via Boot Manager, iBoot or reFIT. I see others had some success with Atom, so wondering if I've got a messed up boot/efildr somehow.

If anyone has suggestions, I'd very much welcome them. Else I'll just "lurk" a bit longer and try new builds etc in the days/weeks ahead, and hope!
гык-sse2
That means that FSB is not set or zero. Either VBoxAppleSim doesn't work or not included or iBoot overrides it to 0.
jadran
QUOTE (Slice @ Apr 21 2011, 11:49 AM) *
About bootsector I can submit it without testing. One moment.

I added readme file.
Click to view attachment

Tested mine self. works like it should.

About script, will add ninjas one, but i hope you guys will make your own and add to svn.
humph
QUOTE (гык-sse2 @ Apr 21 2011, 01:08 PM) *
That means that FSB is not set or zero. Either VBoxAppleSim doesn't work or not included or iBoot overrides it to 0.

Thank you. Gonna investigate over the holiday weekend! Interestingly, smbiosview shows 'External Clock: 0", but current/maxspeed OK....!!
OS_Ninja
usrsse2 i added you to the project wink.gif
Mojodojo
Tried to build clover with Jadran's script, but getting error:

QUOTE
Build environment: Darwin-10.7.0-x86_64-i386-64bit
Build start time: 14:27:14, Apr.22 2011

WORKSPACE = /Users/***/Documents/efi/edk2
ECP_SOURCE = /Users/***/Documents/efi/edk2/EdkCompatibilityPkg
EDK_SOURCE = /Users/***/Documents/efi/edk2/EdkCompatibilityPkg
EFI_SOURCE = /Users/***/Documents/efi/edk2/EdkCompatibilityPkg
EDK_TOOLS_PATH = /Users/***/Documents/efi/edk2/BaseTools

TARGET_ARCH = IA32
TARGET = DEBUG
TOOL_CHAIN_TAG = XCODE32

Active Platform = /Users/***/Documents/efi/edk2/DuetPkg/cloverefiboot/DuetPkgIa32.dsc
Flash Image Definition = /Users/***/Documents/efi/edk2/DuetPkg/cloverefiboot/DuetPkg.fdf

Processing meta-data .

build.py...
/Users/***/Documents/efi/edk2/DuetPkg/cloverefiboot/DuetPkgIa32.dsc(294): error 000E: File/directory not found in workspace
/Users/***/Documents/efi/edk2/iboot-cl/iboot.inf


iboot-cl, what's this?
jadran
QUOTE (blackosx @ Apr 21 2011, 10:04 AM) *
Can you have the script add that iboot_cl as it's now mandatory to have it for successful compilation?


I revised the script:
http://www.projectosx.com/forum/index.php?...ost&p=14213

added iboot-cl for clover
but U can compile clover without iboot-cl just comment #iboot-cl/iboot.inf in DuetPkgIa32.dsc
Mojodojo
QUOTE (jadran @ Apr 22 2011, 02:58 PM) *
I revised the script:
http://www.projectosx.com/forum/index.php?...ost&p=14213

added iboot-cl for clover
but U can compile clover without iboot-cl just comment #iboot-cl/iboot.inf in DuetPkgIa32.dsc



Thank you for quick fix!

But... rolleyes.gif
QUOTE
/Users/***/Documents/efi/edk2/DuetPkg/cloverefiboot/DuetPkgIa32.dsc(295): error 000E: File/directory not found in workspace
/Users/***/Documents/efi/edk2/rEFIt_UEFI/refit.inf

rammjet
QUOTE (jadran @ Apr 22 2011, 07:58 AM) *
I revised the script:
http://www.projectosx.com/forum/index.php?...ost&p=14213

added iboot-cl for clover
but U can compile clover without iboot-cl just comment #iboot-cl/iboot.inf in DuetPkgIa32.dsc

I'm a bit confused...since Slice now has his own branch of iBoot, should we be using that with Clover or using the posted iboot-cl package?
Slice
QUOTE (rammjet @ Apr 22 2011, 04:59 PM) *
I'm a bit confused...since Slice now has his own branch of iBoot, should we be using that with Clover or using the posted iboot-cl package?

Posted iboot-cl package is at svn now.

mojodojo, exclude also rEFIt, or make svn up.
kocoman
I complied the DUET in Windows XP, (Fro Nvidia chipset motherboard, non-intel)

The SVN versions needed the CpuDxe from edk2010, else you would get (for both 32bit and 64bit)

post 148
QUOTE
With binary it compiles, but doesn't start (INT 06h Invalid opcode).


post 229
QUOTE
EDK2 gives int 06h - invalid opcode. Trying unpatched using script.


QUOTE
INT 6Fh Unknown Interrupt - HALT!!



32-bit boots "Welcome to EFI world" on the svn edk2

64-bit does not boot (on the svn edk2), it just MBR Start, then reboots

so I downgrade the edk2 version to edk2010.UP3, then recompile for 64-bit, then it says "WELCOME TO EFI" World.

I also look at the Russian forums, and tried this file (post 295)

http://www.applelife.ru/topic/19403-efi-%d...post__p__213374

QUOTE
Вот образ моей флешки
Прикрепленный файл UsbDUET.dmg.zip (1,68МБ)
Количество загрузок:: 5


It does boot a logo, then black screen..

So what is the mystery of this WELCOME TO EFI WORLD, then not load anything else??
(I know it goes to DxeMain, but then I can't find the code that gets run there..)
humph
QUOTE (гык-sse2 @ Apr 21 2011, 12:08 PM) *
That means that FSB is not set or zero. Either VBoxAppleSim doesn't work or not included or iBoot overrides it to 0.

Got past the tsc/FSB issue by these dirty hacks in VBoxAppleSim.c:

CODE
//initial values
    FSBFrequency = 133000000ull; // 200000000ull;

and

CODE
        CPUFrequency = TSCFrequency;
        //    FSBFrequency = Type4Record->ExternalClock * 1000000ull;


I guess there's something strange with the "Type 4" tables, perhaps related to this machine only. Have to say I don't very much understand any of this...

Now just having that PlatformExpert ACPI panic (also still not using DSDT.aml to avoid hang). But hey, it's progress smile.gif
Slice
QUOTE (humph @ Apr 22 2011, 05:42 PM) *
I guess there's something strange with the "Type 4" tables, perhaps related to this machine only. Have to say I don't very much understand any of this...

Go from Clover into ShellFull.efi. Type here
smbiosview
and look Table 4.
Are you sure Clover's SmbiosGen is included into your project?
rammjet
QUOTE (humph @ Apr 22 2011, 09:42 AM) *
Now just having that PlatformExpert ACPI panic (also still not using DSDT.aml to avoid hang). But hey, it's progress smile.gif

You can try some advice that гык-sse2 gave to me. It sorta worked and might give another data point:

QUOTE
rammjet, change FDF and DSC files to use non-Clover GenericBdsLib, PlatformBdsLib, AcpiTable and exclude AcpiPlatform. This will undo Slice's ACPI patch

Following this advice, I was able to boot completely into Lion, but I had to wait for a minute or so pause during the boot. For SL, it gets to the end and hangs. But in neither case did I get the PlatformExpert ACPI panic.
humph
QUOTE (Slice @ Apr 22 2011, 07:03 PM) *
....and look Table 4.
Are you sure Clover's SmbiosGen is included into your project?

Well I see Type=4 Handle 0x4, with a bunch of stuff about the CPU. N270, ExtClock same as before:0, but MaxSpeed:1600etc.
And I'm pretty sure CloverSMBIOGen is in the FV. It's not omitted in the fdf and dsc. (ie: Clover version included, the standard DuetPkg/smbios is # out). Also have the Universal/SmbiosDxe-all standard unchanged from orignal source download.


Rammjet, thanks for the reminder to try that ACPI change. Think I'll leave it to tomorrow and a clear head, since last time I tried that (before sse2 pointed me in the right direction and before the tsc hack, so would), I guess I goofed as lost all AHCI volume detection blink.gif
Slice
QUOTE (kocoman @ Apr 22 2011, 05:31 PM) *
I complied the DUET in Windows XP, (Fro Nvidia chipset motherboard, non-intel)

So what is the mystery of this WELCOME TO EFI WORLD, then not load anything else??
(I know it goes to DxeMain, but then I can't find the code that gets run there..)

This point of stop (before you see Clover logo) means that one of the Clover additional module didn't start. For example AcpiPlatformDxe.
Try to exclude it from fdf to load the module from Shell.
load AcpiPlatform.efi
The same for other modules.
If all modules started successfully you can start a system from this point
CODE
fs1:
System\Library\CoreServices\boot.efi -v

with any arguments you like

PS: After changing fdf I see result wasn't changed. Make ./build32.sh clean
DHP
QUOTE (rammjet @ Apr 22 2011, 11:02 PM) *
Following this advice, I was able to boot completely into Lion, but I had to wait for a minute or so pause during the boot. For SL, it gets to the end and hangs. But in neither case did I get the PlatformExpert ACPI panic.

Are you using Xcode 3 or 4?

This might not be the case for you, but I ran into an issue after switching to Xcode 4. Some of my for () {} and do/while() {} loops looped all the way to the end the wider the bit value of the var to check (8, 16, 32 or 64 bit) the longer it took to complete the iterations. The code runs smooth/fast with Xcode 3 but sucked when compiled with Xcode 4. Maybe that is why you (and I before) had to wait some time for it to complete.

p.s. Apple injects one type 4 table for each CPU. Still wondering why.
STLVNUB
Hi DHP, for me using XC4, it doesn't compile, cpu error, have to boot to other system with XC3. Systems are SL of course.
Slice
QUOTE (DHP @ Apr 23 2011, 12:42 PM) *
p.s. Apple injects one type 4 table for each CPU. Still wondering why.

You means for i5 Apple has 2 tables #4?

I want to discuss the follow logics:
Looking into AppleSim we found that some variables written into DataHub unless they present in Smbios. Why? The answer in that AppleSMBIOS is a kext and started after kernel but boot.efi or kernel wants to know something about hardware. So some variables should be placed out of SMBIOS structure.
Then look into <Guid/DataHubRecords.h> and here I understand that DataHub is modern, EFI-styled, GUIDed SMBIOS.
So, for the best result we need to copy some values from Smbios to DataHub.
We don't know what values will be usefull for new releases of OS but for now values that produces by Clover are not enough.

Any thoughts?
kocoman
I tried to compile clover in X64 (under windows), I have commented out the iboot, because right now I just need the efildr20, but I get this error:


QUOTE
"C:\WINDDK\3790.1830\bin\win64\x86\amd64\cl.exe" /Foc:\cloverx64\edk2\Bu
ild\CloverIA32\DEBUG_DDK3790\X64\DuetPkg\cloverefiboot\VBoxPeCoffLib\VBoxPeCoffL
ib\OUTPUT\.\BasePeCoff.obj /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2
s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /FAsc /FRc:\cloverx64\edk2\Build
\CloverIA32\DEBUG_DDK3790\X64\DuetPkg\cloverefiboot\VBoxPeCoffLib\VBoxPeCoffLib\
OUTPUT\BasePeCoff.SBR /Ic:\cloverx64\edk2\DuetPkg\cloverefiboot\VBoxPeCoffLib /
Ic:\cloverx64\edk2\Build\CloverIA32\DEBUG_DDK3790\X64\DuetPkg\cloverefiboot\VBox
PeCoffLib\VBoxPeCoffLib\DEBUG /Ic:\cloverx64\edk2\DuetPkg /Ic:\cloverx64\edk2\
DuetPkg\Include /Ic:\cloverx64\edk2\MdePkg /Ic:\cloverx64\edk2\MdePkg\Include
/Ic:\cloverx64\edk2\MdePkg\Include\X64 c:\cloverx64\edk2\DuetPkg\cloverefiboot\
VBoxPeCoffLib\BasePeCoff.c
BasePeCoff.c
c:\cloverX64\edk2\DuetPkg\cloverefiboot\VBoxPeCoffLib\BasePeCoff.c(126) : error
C2220: warning treated as error - no 'object' file generated
c:\cloverX64\edk2\DuetPkg\cloverefiboot\VBoxPeCoffLib\BasePeCoff.c(126) : warnin
g C4244: '=' : conversion from 'UINTN' to 'UINT32', possible loss of data
c:\cloverX64\edk2\DuetPkg\cloverefiboot\VBoxPeCoffLib\BasePeCoff.c(135) : warnin
g C4244: '=' : conversion from 'UINTN' to 'UINT32', possible loss of data
NMAKE : fatal error U1077: '"C:\WINDDK\3790.1830\bin\win64\x86\amd64\cl.exe"' :
return code '0x2'
Stop.


I've checked the latest svn of BasePeCoff.c, but it only added DEBUG statements and nothing to fix this..

C2220: warning treated as error

edit:

to fix

load up Conf/tools_def.txt, replace all /WX with blank
humph
QUOTE (rammjet @ Apr 22 2011, 10:02 PM) *
You can try some advice that гык-sse2 gave to me. It sorta worked and might give another data point:

Following this advice, I was able to boot completely into Lion, but I had to wait for a minute or so pause during the boot. For SL, it gets to the end and hangs. But in neither case did I get the PlatformExpert ACPI panic.

That did the trick...although some issues still to resolve. Taking out the Clover ACPI stuff allows me to boot SL, all the way....sort of*.
Note that the AHCI disks do not automatically show in boot list, just the USB, so have to specify boot file manually or add to boot option.
Also got a 'cant take control of USB from BIOS' error, not got around to seeing what's going on there yet.
But still no idea how to load DSDT so far.
BTW, manually loading acpiplatform.efi (clovers version, AFAIK) leads to a hang. Trying the Duet version gives an error and is not loaded.

* Used an old Natit kext to inject GMA950 GFX (rather than DSDT) to get to see GUI rather than just single user, but display jittering badly, LOL. Anyway allowed me to confirm boots OK.

Also, will / can there ever be a solution to the waiting for 5-200s when launching (shell) etc?
kocoman
I got another error

QUOTE
"C:\WINDDK\3790.1830\bin\win64\x86\amd64\cl.exe" /Foc:\cloverx64\edk2\Bu
ild\CloverIA32\DEBUG_DDK3790\X64\DuetPkg\cloverefiboot\VBoxAppleSim\VBoxAppleSim
\OUTPUT\.\VBoxAppleSim.obj /nologo /c /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /G
L /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /FAsc /FRc:\cloverx64\edk2\Build\Clo
verIA32\DEBUG_DDK3790\X64\DuetPkg\cloverefiboot\VBoxAppleSim\VBoxAppleSim\OUTPUT
\VBoxAppleSim.SBR /Ic:\cloverx64\edk2\DuetPkg\cloverefiboot\VBoxAppleSim /Ic:\c
loverx64\edk2\Build\CloverIA32\DEBUG_DDK3790\X64\DuetPkg\cloverefiboot\VBoxApple
Sim\VBoxAppleSim\DEBUG /Ic:\cloverx64\edk2\MdePkg /Ic:\cloverx64\edk2\MdePkg\I
nclude /Ic:\cloverx64\edk2\MdePkg\Include\X64 /Ic:\cloverx64\edk2\MdeModulePkg
/Ic:\cloverx64\edk2\MdeModulePkg\Include /Ic:\cloverx64\edk2\IntelFrameworkPk
g /Ic:\cloverx64\edk2\IntelFrameworkPkg\Include /Ic:\cloverx64\edk2\IntelFrame
workModulePkg /Ic:\cloverx64\edk2\IntelFrameworkModulePkg\Include /Ic:\cloverx
64\edk2\DuetPkg /Ic:\cloverx64\edk2\DuetPkg\Include c:\cloverx64\edk2\DuetPkg\c
loverefiboot\VBoxAppleSim\VBoxAppleSim.c
VBoxAppleSim.c
c:\cloverX64\edk2\DuetPkg\cloverefiboot\VBoxAppleSim\SmBios.h(2127) : warning C4
200: nonstandard extension used : zero-sized array in struct/union
c:\cloverX64\edk2\DuetPkg\cloverefiboot\VBoxAppleSim\VBoxAppleSim.c(423) : error
C2275: 'EFI_DATA_HUB_PROTOCOL' : illegal use of this type as an expression
c:\cloverX64\edk2\IntelFrameworkPkg\Include\Protocol\DataHub.h(70) : see
declaration of 'EFI_DATA_HUB_PROTOCOL'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\VBoxAppleSim\VBoxAppleSim.c(423) : error
C2065: 'DataHub' : undeclared identifier
c:\cloverX64\edk2\DuetPkg\cloverefiboot\VBoxAppleSim\VBoxAppleSim.c(480) : warni
ng C4047: 'function' : 'EFI_DATA_HUB_PROTOCOL *' differs in levels of indirectio
n from 'int'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\VBoxAppleSim\VBoxAppleSim.c(480) : warni
ng C4024: 'CpuUpdateDataHub' : different types for formal and actual parameter 1

NMAKE : fatal error U1077: '"C:\WINDDK\3790.1830\bin\win64\x86\amd64\cl.exe"' :
return code '0x2'
Stop.


Slice
QUOTE (kocoman @ Apr 23 2011, 07:20 PM) *
I tried to compile clover in X64 (under windows), I have commented out the iboot, because right now I just need the efildr20, but I get this error:
CODE
BasePeCoff.c(126) :
conversion from 'UINTN' to 'UINT32', possible loss of data

Change line 96 to be
CODE
UINT32                 Offset = 0;


QUOTE (kocoman @ Apr 23 2011, 08:37 PM) *
I got another error
CODE
SmBios.h(2127) : warning C4
200: nonstandard extension used : zero-sized array in struct/union

Change to
CODE
typedef struct { //kSMBTypeMemorySPD - as read 128 bytes from SMBus to memInfoData
    SMBIOS_STRUCTURE   Hdr;
    UINT16           Type17Handle;
    UINT16           Offset;
    UINT16           Size;
    UINT16           Data[1];
} SMBIOS_TABLE_TYPE130;

Data[] was good for Apple's gcc but for Windows must be non-zero.

About DataHub don't know. Check svn again.
DHP
QUOTE (Slice @ Apr 23 2011, 10:34 AM) *
You means for i5 Apple has 2 tables #4?

I should have said: "logical CPU" i.e. it's one for each processor declaration in the DSDT. BTW DataHub only adds one and that was why I said: "still wondering why".

QUOTE (Slice @ Apr 23 2011, 10:34 AM) *
I want to discuss the follow logics:
Looking into AppleSim we found that some variables written into DataHub unless they present in Smbios. Why? The answer in that AppleSMBIOS is a kext and started after kernel but boot.efi or kernel wants to know something about hardware. So some variables should be placed out of SMBIOS structure.
Then look into <Guid/DataHubRecords.h> and here I understand that DataHub is modern, EFI-styled, GUIDed SMBIOS.
So, for the best result we need to copy some values from Smbios to DataHub.
We don't know what values will be usefull for new releases of OS but for now values that produces by Clover are not enough.

Any thoughts?

Yes. Booting with Clover requires you to patch the SMBIOS table before the pre-boot functions are called. This way everything, including boot.efi and the mach_kernel can obtain the correct data from it.

And keep in mind that structure type 127 must be last, or the function getting SMBIOS data/values will quit prematurely, without returning anything useful. Not required for booting with Chameleon based booters.

There's also the number of structures, a word, which was 0x0000 in your example, and that was why I said that it was wrong. That and the last byte being 0x00 too instead of 0x26

Also. I think that you only need structure type: 0, 1, 2, 4, 17 and 19. The latter might be a dog because it is pretty much broken. And Lion seems to dislike busted SMBIOS tables.

Now some fun. You mentioned Guid/DataHubRecords.h so now I wonder if anyone here checked boot.efi for any of these GUID's. I mean if boot.efi checks it then there has to be matching GUID's. Don't you think?
Slice
Yes, Type127 is always last, because it created by standard protocol no matter I did.

About 0x00 and 0x26 I still can't understand what you mean. I checked my SMBIOS-EPS with specification and found no errors. Again, it created by EFI protocol, not by me.

I know which tables are used by AppleSMBIOS and what values used from each Table#. I prefer to fill all these fields in all these tables.
But I also think it is not enough.

About GUIDs in boot.efi it is a good idea. Someone even checked? Not sure.
Recently Kabyl shown some unknown protocols used. And what to do with its?
And I spoke about future releases of OSX. Some changes may occur.

But we also know that non-EFI chameleon is good for Snow and simple XPC good for Lion. So we need not so much settings.
bcc9
QUOTE (Slice @ Apr 23 2011, 02:46 PM) *
But we also know that non-EFI chameleon is good for Snow and simple XPC good for Lion. So we need not so much settings.
Any plans to merge in the smbios settings from chameleon/iboot into clover? The more fields filled in the better, no?
For example, for type 4, iboot fills in ProcessorId, chameleon does not, and clover does not.
kocoman
I went to sleep after I got this error.

(most error I bypass by comment out the #header <xx>

based on google search, it looks like Apple's cpuid.h ?

QUOTE
"C:\WINDDK\3790.1830\bin\win64\x86\amd64\cl.exe" /Foc:\cloverx64\edk2\Bu
ild\CloverIA32\DEBUG_DDK3790\X64\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\SmbiosGen
\OUTPUT\.\SmbiosGen.obj /nologo /c /GS- /X /W4 /Gs32768 /D UNICODE /O1ib2s /GL /
Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /FAsc /FRc:\cloverx64\edk2\Build\Clover
IA32\DEBUG_DDK3790\X64\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\SmbiosGen\OUTPUT\Sm
biosGen.SBR /Ic:\cloverx64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe /Ic:\clov
erx64\edk2\Build\CloverIA32\DEBUG_DDK3790\X64\DuetPkg\cloverefiboot\OsxSmbiosGen
Dxe\SmbiosGen\DEBUG /Ic:\cloverx64\edk2\MdePkg /Ic:\cloverx64\edk2\MdePkg\Incl
ude /Ic:\cloverx64\edk2\MdePkg\Include\X64 /Ic:\cloverx64\edk2\MdeModulePkg /
Ic:\cloverx64\edk2\MdeModulePkg\Include /Ic:\cloverx64\edk2\IntelFrameworkPkg
/Ic:\cloverx64\edk2\IntelFrameworkPkg\Include /Ic:\cloverx64\edk2\DuetPkg /Ic:
\cloverx64\edk2\DuetPkg\Include c:\cloverx64\edk2\DuetPkg\cloverefiboot\OsxSmbio
sGenDxe\SmbiosGen.c
SmbiosGen.c
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\SmBios.h(2127) : warning
C4200: nonstandard extension used : zero-sized array in struct/union
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(127) : error C20
54: expected '(' to follow 'inline'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(127) : error C21
43: syntax error : missing ')' before '*'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(127) : error C20
85: 'cpuid' : not in formal parameter list
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(127) : error C21
43: syntax error : missing ';' before '*'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(127) : error C20
59: syntax error : ')'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(140) : error C20
54: expected '(' to follow 'inline'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(140) : error C21
46: syntax error : missing ')' before identifier 'selector'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(140) : error C20
85: 'do_cpuid' : not in formal parameter list
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(140) : error C21
46: syntax error : missing ',' before identifier 'selector'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(140) : error C20
85: 'uint32_t' : not in formal parameter list
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(140) : error C21
43: syntax error : missing ';' before '*'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(140) : error C20
59: syntax error : ')'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(150) : error C20
61: syntax error : identifier 'uint64_t'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(150) : error C20
59: syntax error : ';'
c:\cloverX64\edk2\DuetPkg\cloverefiboot\OsxSmbiosGenDxe\cpuid.h(150) : error C21
46: syntax error : missing ')' before identifier 'msr'
Slice
QUOTE (bcc9 @ Apr 24 2011, 03:01 AM) *
Any plans to merge in the smbios settings from chameleon/iboot into clover? The more fields filled in the better, no?
For example, for type 4, iboot fills in ProcessorId, chameleon does not, and clover does not.

Yes, I planned to improve Smbios patch. But reading user's smbios.plist should be GUI property because it depends on choosing partition to boot.
And I don't want to spare time on unnecessary patches. ProcessorId?

QUOTE (kocoman @ Apr 24 2011, 06:04 AM) *
(most error I bypass by comment out the #header <xx>

based on google search, it looks like Apple's cpuid.h ?

It it is from xnu kernel with little modifications.
Slice
I looked into AppleEFINVRAM hex and asm and found the follow Guids
CODE
gEfiGlobalVariableGuid = {0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }};
gAppleEFINVRAMGuid = {0x7C436110, 0xAB2A, 0x4BBB, {0xA8, 0x80, 0xFE, 0x41, 0x99, 0x5C, 0x9F, 0x82}};
gAppleEFINVRAMTRBSecureGuid = {0xF68DA75E, 0x1B55, 0x4E70, {0xB4, 0x1B, 0xA7, 0xB7, 0xA5, 0xB7, 0x58, 0xEA}};

The last one is unknown so far.
гык-sse2
QUOTE (Slice @ Apr 24 2011, 08:57 AM) *
Yes, I planned to improve Smbios patch. But reading user's smbios.plist should be GUI property because it depends on choosing partition to boot.

Why does it depend on it? Different hardware requires different settings, but different operating systems - why?
bcc9
QUOTE (Slice @ Apr 23 2011, 09:57 PM) *
Yes, I planned to improve Smbios patch. But reading user's smbios.plist should be GUI property because it depends on choosing partition to boot.
And I don't want to spare time on unnecessary patches. ProcessorId?

Yes, ProcessorId, from the SMBIOS_TABLE_TYPE4 typedef in SmBios.h. Initialized in SetupDataForOSX() in the iboot code.

My thinking is that if iboot is known to boot Lion on more systems than chameleon or clover without iboot, and iboot fills in more smbios table information automatically, then it'd be logical to try and merge what iboot is setting into clover.
bcc9
QUOTE (гык-sse2 @ Apr 24 2011, 11:16 AM) *
Why does it depend on it? Different hardware requires different settings, but different operating systems - why?

I think he just means that smbios.plist is typically in /Extra/smbios.plist which can depend upon which partition you are booting on, which in turn is not determined until you've gone thru the GUI partition selection.

I know I have multiple installs of OSX and I don't share my /Extra in a EFI partition - I like to have a separate /Extra directory per OS install.

Now, when I mentioned smbios information from iboot I meant the data that is being filled in automatically in bootprocess.c, not data that is coming from the user configuration.
bcc9
QUOTE (Slice @ Apr 23 2011, 09:57 PM) *
It it is from xnu kernel with little modifications.

His problem seems to be that he's using a windows build environment & compiler to compile what you set up for gcc compilation.
bcc9
On my sandy bridge system, with a pci-e video card, if I warm boot clover (reboot from linux for example), then the boot hangs right after displaying "Welcome to EFI WORLD!". If I boot via the reset button, booting into clover works.

Without a pci-e video card, boot always hangs with "Welcome to EFI WORLD!" displayed, with no clover startup screen ever displayed. iboot & xpc also always hang when using built-in video on this system.

I notice that the edk2 code has hard-coded assumptions about the memory map layout, my guess is that these assumptions break if there is on-board video allocating video RAM out of main memory.

Anyone able to get past "Welcome to EFI WORLD!" with on-board video?
Slice
QUOTE (bcc9 @ Apr 25 2011, 12:13 AM) *
I think he just means that smbios.plist is typically in /Extra/smbios.plist which can depend upon which partition you are booting on, which in turn is not determined until you've gone thru the GUI partition selection.

Exactly what I mean.

QUOTE (bcc9 @ Apr 25 2011, 12:34 AM) *
On my sandy bridge system, with a pci-e video card, if I warm boot clover (reboot from linux for example), then the boot hangs right after displaying "Welcome to EFI WORLD!". If I boot via the reset button, booting into clover works.

Without a pci-e video card, boot always hangs with "Welcome to EFI WORLD!" displayed, with no clover startup screen ever displayed. iboot & xpc also always hang when using built-in video on this system.

I notice that the edk2 code has hard-coded assumptions about the memory map layout, my guess is that these assumptions break if there is on-board video allocating video RAM out of main memory.

Anyone able to get past "Welcome to EFI WORLD!" with on-board video?

It seems to be my main problem.
Dell Inspiron with IntelX3100 - just reboot before Welcome.
Dell Latitude with IntelGMA950 - successfully boot into system but GMA950 crashes after some memory usage.
Where is the hard-coded assumption?

My hex investigation. I made hex search inside Lion's boot.efi to known protocols.
The results:
Found:
gDataHubPlatformGuid, gEfiDataHubProtocolGuid, gConsoleControlGuid, gDevicePropertiesGuid, gAppleEFINVRAMGuid, gAppleScreenInfoGuid, gEfiAppleNvramGuid, gEfiGraphicsOutputProtocolGuid
Also found many unknown guids.

Not found
gEfiLegacy8259ProtocolGuid, gDataHubOptionsGuid, gEfiProcessorSubClassGuid (and other DataHub subclasses), gEfiUnknown1ProtocolGuid,
FsbFrequencyPropertyGuid, DevicePathsSupportedGuid, gNotifyExitBootServices
bcc9
QUOTE (Slice @ Apr 24 2011, 01:57 PM) *
Where is the hard-coded assumption?

For example BiosVideoThunkDxe/BiosVideo.c:

ModeBuffer->LinearFrameBuffer = (VOID *) (UINTN) (0xa0000);
...
This->Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS)(UINTN)ModeData->LinearFrameBuffer;


Is that still true if your frame buffer is allocated by bios from DRAM (the built-in video case)?


or iboot:

UINT8* ptr=TO_POINTER(UINT8,0x100000);
...
bootArgsNew=(BootArgsNew*)ptr;

I think this relates to why my bootargs come out as 0 when I try to boot into the lion installer partition via clover to iboot.


This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.