Jump to content
47 posts in this topic

Recommended Posts

I made a stage 1 boot record for booting Chameleon off an exFAT partition.
It's called boot1x.
Analog of boot1h or boot1f32.
 
Also made an program 'boot1-install' that can install the stage 1 boot loader for all three file systems
boot1f32 -> FAT32
boot1h -> HFS+
boot1x -> exFAT
 
So far, installing boot1h on HFS+ can be done trivially with dd.
Installing boot1f32 can be done with a shell script boot1f32-install.sh (though the script doesn't always recognize a proper FAT32 boot record.)
However, installing an exFAT boot record requires a companion program because it needs to compute a checksum of the exFAT VBR.  So I made a program to install all three types of boot records.  It is similar to fdisk440 that installs boot0/boot0hfs on MBR.
 
Files included:
sources for boot1x.s, boot0xg.s and boot1-install.c.
binaries for boot1x, boot1xalt, boot1f32, boot1h, boot0xg and boot1-install.
 
For Using exFAT under MBR
Install Chameleon's boot0 on MBR using fdisk440.
Set the exFAT partition as active (can be done with fdisk440 as well).
install boot1x or boot1xalt on exFAT partition using boot1-install.
Copy Chameleon's 2nd stage boot to /boot on the exFAT partition.

For Using exFAT under GPT
Install Chameleon's boot0 (or boot0xg) on protective MBR using fdisk440.
install boot1x or boot1xalt on exFAT partition using boot1-install.
Copy Chameleon's 2nd stage boot to /boot on the exFAT partition.

boot0xg is a modified version of boot0 such that when searching GPT it looks for exFAT or FAT32
partitions marked as "Microsoft basic data" type. The normal boot0 looks for EFI System Partition
formatted as FAT32.

 

As of r2507, Chameleon's boot0 has been replaced by boot0xg.  boot0xg has all features of previous boot0 +
recognize exFAT on MBR marked active + recognize exFAT+FAT32 on GPT typed as "Microsoft basic data".

 

As of r2516, Chameleon's boot2 supports reading configuration files from an exFAT partition.

boot1xalt is an alternate variant of boot1x that waits 2 seconds for a keypress of a single digit X.
If a digit is pressed, it loads /bootX instead of boot.  This feature may be used for selecting
one of multiple stage-2 boot loaders.

Enjoy.

 

Changelog

  • 1.0.5 - See description in post #44.
  • 1.0.4 - Incorporated Micky1979's force umount option -u (post #38), Use xcrun in Makefile to find build tools.
  • 1.0.3 - Beefed up boot0xg, see post #19.
  • 1.0.2 - Added boot0xg and Readme.txt.
  • 1.0.1 - Fixed crash with CFStringGetCStringPtr in boot1-install.
  • 1.0 - Original.

ChameleonExfatVBR_1.0.5.tar.gz

Edited by Zenith432
  • Like 6

So for this one, drive boot is format to GUID table, where would this apply to?

Unfortunately it's not possible to use with GPT right now.

boot1x is oblivious to whether exFAT partition is on MBR or GPT.  All it needs is bios drive # in DL and first 2 sectors loaded from exFAT partition.

However, boot0 is not equipped to boot exFAT partition from GPT.  It boots either HFS+ or EFI System Partition (formatted as FAT32).

I looked at the boot0 code, and it's not difficult to allow for exFAT, BUT there is not enough space in the MBR.  So I'll make modified boot0 that supports exFAT on GPT instead of EFI System Partition.  Stay tuned. Solved in 1.0.2.

 

Thanks for pointing this out.

Hi Zenith432!

There is great deal to implement exFAT volume support. May I apply it for Clover?

Clover already has EXFAT driver and can read all support files from the partition. It's a pity the driver is read-only as well as HFSplus driver.

Cheer!

Yes, sure - go ahead.

 

For Clover to fully work with exFAT, its boot2 stage must be able read files from exFAT volume.

 

Technical specs are

  1. boot1x expects boot0 to load 1024 bytes form exFAT partition, whether MBR or GPT.  Drive number passed in DL.  The partition offset is already stored in the bios parameter block in exFAT boot record, so no need for that. [update Jan 12 2015 - Starting with version 1.0.5, it's enough for boot0 to load initial 512 bytes.]
  2. It loads /boot from the exFAT volume.  Max size of /boot is 512 * 1024 - 512 (to fit in addresses 0x20200 - 0xa0000).
  3. boot1-install detect volume type (exFAT, FAT32 or HFS+) and either
    1. For HFS+, store 1024 bytes of boot file template (boot1h) in sectors 0-1.
    2. For FAT32, store 512 bytes of boot file template (boot1f32), overwrite bytes 3 - 89 with existing FAT32 BPB.
    3. For exFAT, store 1024 bytes of boot file template (boot1x) and prepare VBR area (24 sectors total) according to spec.

You can use custom templates as follows

  • For HFS+ boot file template must be 1024 bytes.
  • For FAT32 boot file template must be 512 bytes, with space left for FAT32 BPB and 0x55AA signature.
  • For exFAT boot file template must be 512 - 4608 bytes, leave space for exFAT BPB (bytes 3 - 119) and signature of 0x55AA at end of each sector.

Hi Zenith432!

There is great deal to implement exFAT volume support. May I apply it for Clover?

Clover already has EXFAT driver and can read all support files from the partition. It's a pity the driver is read-only as well as HFSplus driver.

Cheer!

  • Like 1

I think your bin files are ready to use with Clover as technology is the same.

This is CloverEFI==boot with EXFAT driver included. boot.zip

I will prepare USB stick tomorrow to test. (MBR, exFAT)

Ok, I prepared a variant of boot0 called boot0xg

For booting an exFAT partition stored in GPT.

 

For booting exFAT from MBR can use regular boot0.

 

What boot0xg boot is one of

 

1) any MBR partition marked as active.

2) any HFS partition on MBR

3) any HFS parition on GPT

4) any exFAT or FAT32 parition on GPT classified as "Microsoft Basic Data" type (this is the normal kind.)

5) Any FAT32 partition on GPT classified as "EFI System Partition"

 

Functionality dropped from boot0

- dropped printing of string 'test' to make some space for code.

 

assemble with

 

 

nasm -DCONFIG_BOOT0_DEBUG=0 -DCONFIG_BOOT0_VERBOSE=1 -o boot0xg boot0xg.s

 

EDIT: Attachment removed - boot0xg is now packaged with everything else in post #1.

Edited by Zenith432
  • Like 1

Hi Zenith432,

I set printf to see why it is not working and got

DAVolumeKind (null)

	if (CFDictionaryGetValueIfPresent(descDict, kDADiskDescriptionVolumeKindKey, (void const**) &s_ref)) {
		char const* cstr = CFStringGetCStringPtr(s_ref, kCFStringEncodingUTF8);
#if 1
		printf("DAVolumeKind %s\n", cstr);
#endif

What is wrong?

 

EDITED:

I made this way

		char const* cstr = CFStringGetCStringPtr(s_ref, kCFStringEncodingUTF8);
#if 1
		printf("DAVolumeKind %s\n", cstr);
#endif
    if (!cstr) {
      daVolumeKind = _undetected;
    } else

  • Like 1

OK,

this way boot1-install successfully write boot1 on my USB drive.

It now looks like

Screen Shot 2014-11-27 at 13.41.30.png

Attempt to boot from is failed.

Now I boot into system usual way and see the drive is broken

Screen Shot 2014-11-27 at 13.41.38.png

What is happen? Why the contents changed?

 

Continue testing with QEMU...

EDITED.

No, boot1x is not working.

This is the image for testing with QEMU

CF32.img.lzma.zip

  • The problem with illegal instruction is call to CFStringGetCStringPtr which sometimes fails.  I need to change code to provide a buffer.  Will fix. Fixed.
  • Do you know why the boot sector got overwritten with 0xf4?  (hlt instruction)  It's the default boot sector OS X creates for exFAT.  Anyways, the sector looks okay in your disc image. [Note: the boot sector may have been overwritten if the partition wasn't dismounted when installing boot1x.]
  • I'll analyze the disc image you uploaded later when I have time. See post #12.
  • I've tested boot0xg, and it seems to work, but chameleon boot2 is not succeeding in loading org.chameleon.Boot.plist from adjoining fat32 partition.  So I'm still checking it. Done testing boot0xg.  It works.  For some reason, when the adjoining partition for /Extra is FAT32, Chameleon's boot2 can't read it on GPT.  However, if the adjoining partition for /Extra is HFS+, things work fine.  I've repackaged boot0xg with the other stuff and added a Readme.txt file for installing.   EDIT: starting with r2494, Chameleon can read files off FAT32 in GPT.
  • Now it's 433 posts :)

I uploaded version 1.0.1 with a fix for the bug pointed out in posts # 8 - 9.

The code change is

diff --git a/boot1-install.c b/boot1-install.c
--- a/boot1-install.c
+++ b/boot1-install.c
@@ -581,7 +581,12 @@ int checkDevicePath2(char const* pathName)
 	if (CFDictionaryContainsKey(descDict, kDADiskDescriptionVolumePathKey))
 		isVolumeMounted = 1;
 	if (CFDictionaryGetValueIfPresent(descDict, kDADiskDescriptionVolumeKindKey, (void const**) &s_ref)) {
+		static char cstr_buffer[64];
 		char const* cstr = CFStringGetCStringPtr(s_ref, kCFStringEncodingUTF8);
+		if (!cstr) {
+			CFStringGetCString(s_ref, &cstr_buffer[0], (CFIndex) sizeof cstr_buffer, kCFStringEncodingUTF8);
+			cstr = &cstr_buffer[0];
+		}
 #if 0
 		printf("DAVolumeKind %s\n", cstr);
 #endif
Edited by Zenith432

Slice

I copied your disk image CF32 "as is" onto a USB stick starting at sector 32, length 62432.
Wrapped it with an MBR.
Installed boot0 on the MBR. Made the CF32 partition type 7 (ntfs/exfat) and active.
And guess what?
It works.

It boots clover :)

This was in real hardware, not virtual machine.

So why not work in qemu?  Could be a couple of things

  • I used an instruction in the code for boot1x not legal for x86 real mode.  [Don't think I did.]
  • A BIOS problem, most likely int 0x13, function 0x42 returning error.

Then I remembered

- The /boot file is contiguous on the disk, and the code tries to load in as big a chunks as possible.

- For this I used kMaxBlockCount = 127, which is maximum EDD spec for int 0x13, func 0x42 allows.

- But the code for boot1f32 says some BIOSes don't like the 16 bit offset in the address to be negative (go above 0x8000).

- Which means they can only load 64 sectors (32 KB).

- So attached is a more tolerant variant of boot1x.s with kMaxBlockCount=64.

- Please try see if this works in qemu.

- If tolerant version works, I'll set the max count to 64 permanently like in boot1f32.

 

Continue testing with QEMU...
EDITED.
No, boot1x is not working.

boot1x_tolerant.zip

I confirm, it works!

I used tolerant version and made "make" in src folder of 1.0.2 package.

Inserted USB drive and make

sudo ./boot1-install -yM /dev/rdisk1s1

It's fine.

Then use Disk Utility to make ISO from the drive.

Yesterday I made a mistake creating iso from partition while for QEMU it must be whole drive. Now it is.

CFx3.img.lzma.zip

Screen Shot 2014-11-28 at 12.45.50.png

 

Then I will think how to add this possibility to Clover package.

boot1x does not work from a naked exFAT partition (unwrapped with MBR) - because it expects previous boot code to load entire 1024 bytes.  Legacy BIOS by convention only loads 512 bytes.

So this was probably the reason it didn't work - not the use of kMaxBlockCount=127 with int 0x13.  I will leave kMaxBlockCount at 127 for the time being.

Yesterday I made a mistake creating iso from partition while for QEMU it must be whole drive. Now it is.

Hi Zenith432
THX for for your continue effort in making the things better!
I merge your "EXFAT boot support" (not completely) see commit 2495

I'm not completely sure... and I have problem to build the boo1x.s (nasm version? no idea...)

So I add it (boot1x.s) but is not called anywhere in any makefile.

ErmaC

  • Like 1

Hi Zenith432

THX for for your continue effort in making the things better!

I merge your "EXFAT boot support" (not completely) see commit 2495

I'm not completely sure... and I have problem to build the boo1x.s (nasm version? no idea...)

So I add it (boot1x.s) but is not called anywhere in any makefile.

ErmaC

Yes, NASM version. Use the most recent. 2.11.

  • Like 1

As Slice said, the errors are due to use of nasm 2.11.06.

Attached is a patch to r2495 to make it build with Apple's nasm 0.98 and add boot1x to the Makefiles.

 

PS: I suggest you add nasm -O3 optimization to boot0 Makefile as well.  It is the default in nasm 2.11.06, and I've used boot0 and boot0hfs successfully when optimized that way.

 

Hi Zenith432
THX for for your continue effort in making the things better!
I merge your "EXFAT boot support" (not completely) see commit 2495

I'm not completely sure... and I have problem to build the boo1x.s (nasm version? no idea...)

So I add it (boot1x.s) but is not called anywhere in any makefile.

ErmaC

 

[fix boot1x mak r2495 diff]

 

 

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -76,6 +76,7 @@ dist-local image-local:
     @cp -f ${SYMROOT}/i386/boot0xg ${IMGROOT}/usr/standalone/i386
     @cp -f ${SYMROOT}/i386/boot1h ${IMGROOT}/usr/standalone/i386
     @cp -f ${SYMROOT}/i386/boot1f32 ${IMGROOT}/usr/standalone/i386
+    @cp -f ${SYMROOT}/i386/boot1x ${IMGROOT}/usr/standalone/i386
 ifdef CONFIG_FDISK440
     @cp -f ${SYMROOT}/i386/fdisk440 ${IMGROOT}/usr/bin
 endif
diff --git a/i386/boot1/Makefile b/i386/boot1/Makefile
--- a/i386/boot1/Makefile
+++ b/i386/boot1/Makefile
@@ -16,7 +16,7 @@ DIRS_NEEDED = $(SYMROOT)
 VERS = `vers_string -f 5.0 | tr - .`
 NEW_VERS = Darwin boot1h v$(VERS)
 
-PROGRAMS  =  boot1hp boot1f32
+PROGRAMS  =  boot1hp boot1f32 boot1x
 
 ifeq (${CONFIG_BOOT1_HFS}, y)
 PROGRAMS += boot1h
@@ -37,7 +37,7 @@ $(SYMROOT)/boot1h: boot1h.s
 
 $(PROGRAMS): $(SRCROOT)/autoconf.inc
     @echo "    [NASM] $(@F)"
-    @$(NASM) $(@F).s -o $@
+    @$(NASM) $(@F).s -o $@ -O3
 
 install_i386:: all $(INSTALLDIR)
     cp $(SYMROOT)/boot1h $(INSTALLDIR)/
diff --git a/i386/boot1/boot1x.s b/i386/boot1/boot1x.s
--- a/i386/boot1/boot1x.s
+++ b/i386/boot1/boot1x.s
@@ -90,8 +90,8 @@ gsFATCache: times FATCache_size db 0
 ;
 ; exFAT BPB
 ;
-gPartitionOffset: dq 0
-gVolumeLength: dq 0
+gPartitionOffset: dd 0, 0
+gVolumeLength: dd 0, 0
 gFATOffset: dd 0
 gFATLength: dd 0
 gClusterHeapOffset: dd 0
@@ -429,7 +429,7 @@ getRange:
 .loop:
     cmp eax, 2
     jb .finishup
-    cmp eax, kMaxCluster
+    cmp eax, -9 ;kMaxCluster
     jnb .finishup
     cmp bx, kMaxContigClusters
     jnb .finishup

Edited by Zenith432
  • Like 1

Yes, NASM version. Use the most recent. 2.11.

 

:o

ermac$ nasm -v
NASM version 0.98.40 (Apple Computer, Inc. build 11) compiled on Sep 18 2014
================= Making all in boot1 =================
	[NASM] boot1hp
	[NASM] boot1f32
	[NASM] boot1x
boot1x.s:93: error: integer supplied to a DQ instruction
boot1x.s:94: error: integer supplied to a DQ instruction
boot1x.s:183: error: short jump is out of range
boot1x.s:188: error: short jump is out of range
boot1x.s:199: error: short jump is out of range
boot1x.s:226: error: short jump is out of range
make[3]: *** [/Users/ermac/Documents/local/chameleon/sym/i386/boot1x] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

http://www.nasm.us/pub/nasm/releasebuilds/2.11.06/nasm-2.11.06.tar.xz

 

ermac$ cd /Users/ermac/Downloads/nasm-2.11.06
nasm-2.11.06 ermac$ ./configure
checking for prefix by checking for nasm... /usr/bin/nasm
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking if gcc accepts -W... yes
checking if gcc accepts -Wall... yes
checking if gcc accepts -std=c99... yes
checking if gcc accepts -pedantic... yes
checking for nroff... nroff
checking for asciidoc... no
checking for xmlto... no
checking for acrodist... no
checking for ps2pdf... no
checking for pstopdf... pstopdf
configure: WARNING: No acsciidoc package found
configure: WARNING: No xmlto package found
checking for ANSI C header files... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for inttypes.h... (cached) yes
checking for strings.h... (cached) yes
checking stdbool.h usability... yes
checking stdbool.h presence... yes
checking for stdbool.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for C/C++ restrict keyword... __restrict
checking for size_t... yes
checking if gcc has a working bool type... yes
checking whether byte ordering is bigendian... no
checking for strcspn... yes
checking for strspn... yes
checking for vsnprintf... yes
checking for _vsnprintf... no
checking for snprintf... yes
checking for _snprintf... no
checking for strcasecmp... yes
checking for stricmp... no
checking for strncasecmp... yes
checking for strnicmp... no
checking for strsep... yes
checking for strlcpy... yes
checking for getuid... yes
checking for getgid... yes
checking whether strcasecmp is declared... yes
checking whether stricmp is declared... no
checking whether strncasecmp is declared... yes
checking whether strnicmp is declared... no
checking whether strsep is declared... yes
checking whether strlcpy is declared... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating rdoff/Makefile
config.status: creating doc/Makefile
config.status: creating config.h
config.status: executing default-1 commands
nasm-2.11.06 ermac$ make
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o nasm.o nasm.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o nasmlib.o nasmlib.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o ver.o ver.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o raa.o raa.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o saa.o saa.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o rbtree.o rbtree.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o float.o float.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o insnsa.o insnsa.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o insnsb.o insnsb.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o directiv.o directiv.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o assemble.o assemble.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o labels.o labels.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o hashtbl.o hashtbl.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o crc64.o crc64.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o parser.o parser.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outform.o output/outform.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outlib.o output/outlib.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/nulldbg.o output/nulldbg.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/nullout.o output/nullout.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outbin.o output/outbin.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outaout.o output/outaout.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outcoff.o output/outcoff.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outelf.o output/outelf.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outelf32.o output/outelf32.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outelf64.o output/outelf64.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outelfx32.o output/outelfx32.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outobj.o output/outobj.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outas86.o output/outas86.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outrdf2.o output/outrdf2.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outdbg.o output/outdbg.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outieee.o output/outieee.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outmac32.o output/outmac32.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o output/outmac64.o output/outmac64.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o preproc.o preproc.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o quote.o quote.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o pptok.o pptok.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o macros.o macros.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o listing.o listing.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o eval.o eval.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o exprlib.o exprlib.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o stdscan.o stdscan.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o strfunc.o strfunc.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o tokhash.o tokhash.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o regvals.o regvals.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o regflags.o regflags.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o ilog2.o ilog2.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o lib/strlcpy.o lib/strlcpy.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o preproc-nop.o preproc-nop.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o disp8.o disp8.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o iflag.o iflag.c
gcc  -o nasm nasm.o nasmlib.o ver.o raa.o saa.o rbtree.o float.o insnsa.o insnsb.o directiv.o assemble.o labels.o hashtbl.o crc64.o parser.o output/outform.o output/outlib.o output/nulldbg.o output/nullout.o output/outbin.o output/outaout.o output/outcoff.o output/outelf.o output/outelf32.o output/outelf64.o output/outelfx32.o output/outobj.o output/outas86.o output/outrdf2.o output/outdbg.o output/outieee.o output/outmac32.o output/outmac64.o preproc.o quote.o pptok.o macros.o listing.o eval.o exprlib.o stdscan.o strfunc.o tokhash.o regvals.o regflags.o ilog2.o lib/strlcpy.o preproc-nop.o disp8.o iflag.o  
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o ndisasm.o ndisasm.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o disasm.o disasm.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o sync.o sync.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o insnsd.o insnsd.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o insnsn.o insnsn.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o regs.o regs.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I. -o regdis.o regdis.c
gcc  -o ndisasm ndisasm.o disasm.o sync.o nasmlib.o ver.o insnsd.o insnsb.o insnsn.o regs.o regdis.o disp8.o iflag.o  
cd rdoff && /Applications/Xcode.app/Contents/Developer/usr/bin/make all
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. rdfdump.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. rdoff.c
gcc  -o rdfdump rdfdump.o rdoff.o
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. ldrdf.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. symtab.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. collectn.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. rdlib.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. segtab.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. hash.c
gcc  -o ldrdf ldrdf.o rdoff.o symtab.o collectn.o rdlib.o segtab.o hash.o ../nasmlib.o
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. rdx.c
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. rdfload.c
gcc  -o rdx rdx.o rdoff.o rdfload.o symtab.o collectn.o hash.o ../nasmlib.o
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. rdflib.c
gcc  -o rdflib rdflib.o
gcc -c -g -O2 -W -Wall -std=c99 -pedantic -DHAVE_CONFIG_H -I. -I.. rdf2bin.c
gcc  -o rdf2bin rdf2bin.o rdoff.o rdfload.o symtab.o collectn.o hash.o ../nasmlib.o
rm -f rdf2com && ln -s rdf2bin rdf2com
rm -f rdf2ith && ln -s rdf2bin rdf2ith
rm -f rdf2ihx && ln -s rdf2bin rdf2ihx
rm -f rdf2srec && ln -s rdf2bin rdf2srec
nasm-2.11.06 ermac$ sudo make install
Password:
mkdir -p /usr/bin
/usr/bin/install -c nasm /usr/bin/nasm
/usr/bin/install -c ndisasm /usr/bin/ndisasm
mkdir -p /usr/share/man/man1
/usr/bin/install -c -m 644 ./nasm.1 /usr/share/man/man1/nasm.1
/usr/bin/install -c -m 644 ./ndisasm.1 /usr/share/man/man1/ndisasm.1
ermac$ nasm -v
NASM version 2.11.06 compiled on Nov 29 2014
	[RANLIB] libsaio.a
================= Making all in boot0 =================
	[NASM] boot0
	[NASM] boot0hfs
	[NASM] boot0md
	[NASM] boot0xg
	[NASM] chain0
================= Making all in boot1 =================
	[NASM] boot1hp
	[NASM] boot1f32
	[NASM] boot1x
	[NASM] boot1h
	[NASM] boot1he
================= Making all in boot2 =================
exfat.png

:D

 

THX!

 

ErmaC

As Slice said, the errors are due to use of nasm 2.11.06.

Attached is a patch to r2495 to make it build with Apple's nasm 0.98 and add boot1x to the Makefiles.

THX again guys!

 

I merge the diff to the SVN in a couple of minute... EDIT: done 2496

 

PS: I suggest you add nasm -O3 optimization to boot0 Makefile as well.

done 2497

 

... I will update the installer scripts too! ...soon.

 

ErmaC

  • Like 1

I've optimized boot0xg code to save space, and added back the feature to recognize EFI System Partition.

It's packaged in 1.0.3, post #1.

Full features of newest boot0xg summarized in post #7.

boot0xg is now upward compatible with boot0 in that

- it does everything boot0 does + recognize exFAT on MBR marked active + recognize exFAT+FAT32 on GPT typed as "Microsoft basic data".

 

ErmaC: Since boot0xg now has all features of boot0, it's possible to replace boot0 with it instead of having separate variants.  [in clover it's the variant called boot0af.]

  • Like 2

Hi Zenith432, thanks for your new work.

 

I'm (would) update some scripts and I need to figure out what to do.

Doing that in Terminal return an uuid only if is an exfat filesystem:

/System/Library/Filesystems/exfat.fs/Contents/Resources/exfat.util -k disk2s1

3FB67114-5845-34C2-88A3-1CED9E85A974

...that is the same of Diskarbitration return for kDADiskDescriptionVolumeUUIDKey  ....36 length otherwise 0 for non-exfat.

or, I can use its exit status  (254 if contain exfat filesystem as writed in the man page)

can be this a secure way in all scenario to know in advance if I have to use new boot files and your boot1-install, using exfat.util in the Chameleon's CheckFatType.sh script? 

For exfat, the kDADiskDescriptionVolumeKindKey in DiskArbitration should be 'exfat'.  If you run 'diskutil info disk2s1' you should see a line with 'Type: exfat' somewhere in there and can grep for that in a script.  There may be identifiable UUIDs in 'diskutil info' too.

 

can be this a secure way in all scenario to know in advance if I have to use new boot files and your boot1-install, using exfat.util in the Chameleon's CheckFatType.sh script? 

  • Like 1

 If you run 'diskutil info disk2s1' you should see a line with 'Type: exfat' somewhere in there and can grep for that in a script.  There may be identifiable UUIDs in 'diskutil info' too.

Yep, sorry that's why I have asked. Sometimes "diskutil info" made me crazy about its output that can be different in differents OS (like | grep 'Mount point' or 'Mount Point') that would really be better to avoid.

Hoping that this does not appen for:

File System Personality:  ExFAT
Type (Bundle):            exfat
Name (User Visible):      ExFAT 

...now and in the future :)

Only for this.

×
×
  • Create New...