From a04a520b0d0c0d075c2a002bb42a1fe7be20ca69 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Fri, 28 Mar 2014 23:07:04 +0100 Subject: [PATCH] Switch back from yasm to nasm These days, nasm supports more instructions than yasm. Additionally, it offers a disassembler. --- ReadMe | 4 +-- build/jam/ArchitectureRules | 12 ++++----- build/jam/OptionalPackages | 2 +- configure | 4 +-- .../intel/PartitionMapWriter.cpp | 2 +- src/bin/writembr/mbr.S | 26 ++++++++----------- 6 files changed, 23 insertions(+), 27 deletions(-) diff --git a/ReadMe b/ReadMe index 15a976bf7d..68d376bbd6 100644 --- a/ReadMe +++ b/ReadMe @@ -42,7 +42,7 @@ development tools are included in official releases (e.g. R1 alpha 1) and in the * autoheader (part of autoconf, needed for building gcc) * automake * gawk - * yasm (http://www.tortall.net/projects/yasm/wiki/Download) + * nasm * wget * (un)zip * cdrtools (not genisoimage!) @@ -76,7 +76,7 @@ The following darwin ports need to be installed: * gnuregex * gsed * cdrtools - * yasm + * nasm * wget * less * mpfr diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules index d2a12fd824..91466a4d82 100644 --- a/build/jam/ArchitectureRules +++ b/build/jam/ArchitectureRules @@ -325,9 +325,9 @@ rule KernelArchitectureSetup architecture # offset in floppy image (>= sizeof(haiku_loader)) HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB - # yasm is required for target arch x86 - if ! $(HAIKU_YASM) { - Exit "HAIKU_YASM not set. Please re-run configure." ; + # nasm is required for target arch x86 + if ! $(HAIKU_NASM) { + Exit "HAIKU_NASM not set. Please re-run configure." ; } case x86_64 : @@ -340,9 +340,9 @@ rule KernelArchitectureSetup architecture # x86_64 kernel source is under arch/x86. HAIKU_KERNEL_ARCH = x86 ; - # yasm is required for target arch x86_64 - if ! $(HAIKU_YASM) { - Exit "HAIKU_YASM not set. Please re-run configure." ; + # nasm is required for target arch x86_64 + if ! $(HAIKU_NASM) { + Exit "HAIKU_NASM not set. Please re-run configure." ; } case m68k : diff --git a/build/jam/OptionalPackages b/build/jam/OptionalPackages index 09b8340ac2..cc83ae73ac 100644 --- a/build/jam/OptionalPackages +++ b/build/jam/OptionalPackages @@ -120,7 +120,7 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ] { } # other commonly used tools - AddHaikuImagePackages bison cdrtools flex jam m4 make mkdepend yasm ; + AddHaikuImagePackages bison cdrtools flex jam m4 make mkdepend nasm ; } diff --git a/configure b/configure index 9dd3acfed3..0656ccd57a 100755 --- a/configure +++ b/configure @@ -111,7 +111,7 @@ environment variables: HAIKU_RANLIB_x86_gcc2 The static library indexer for x86_gcc2. Defaults to "ranlib". HAIKU_STRIP_x86_gcc2 The x86_gcc2 strip command. Defaults to "strip". - HAIKU_YASM The yasm assembler (x86 only). + HAIKU_NASM The nasm assembler (x86 and x86_64 only). HAIKU_CPPFLAGS_ The preprocessor flags for target architecture . Defaults to "". HAIKU_CCFLAGS_ The C flags for target architecture . @@ -486,7 +486,7 @@ HAIKU_PORTS_CROSS= HAIKU_PACKAGING_ARCHS= -set_default_value HAIKU_YASM yasm +set_default_value HAIKU_NASM nasm if sha256sum < /dev/null > /dev/null 2>&1; then HOST_SHA256=sha256sum diff --git a/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp b/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp index 4f600e8836..f7fa01b7c4 100644 --- a/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp +++ b/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp @@ -40,7 +40,7 @@ using std::nothrow; // compiled mbr boot loader code static const uint8 kBootCode[] = { // compiled form of //haiku/trunk/src/bin/writembr/mbr.S - // yasm -f bin -O5 -o mbrcode.bin mbr.S -dMBR_CODE_ONLY=1 + // nasm -f bin -O5 -o mbrcode.bin mbr.S -dMBR_CODE_ONLY=1 // bin2h DISKSIG - ; %error "Code exceeds master boot code area!" - ;%endif + %if end - start > DISKSIG + %error "Code exceeds master boot code area!" + %endif %ifdef MBR_CODE_ONLY ;just build the code. ;Do not generate the datas %else - ;use nasm instead of yasm => use %rep instead of times - ;%rep start + DISKSIG - end - ; db 0 ;fill the rest of the code area - ;%endrep - times start + DISKSIG - end db 0 + %rep start + DISKSIG - end + db 0 ;fill the rest of the code area + %endrep kMbrDiskID dd 0 ;Disk signature dw 0 ;reserved PartitionTable times PartitionEntry_size * 4 db 0 DiskSignature: - ;use nasm instead of yasm to check the MAGIC offset - ;%if DiskSignature - start <> MAGIC_OFF - ; %error "incorrect Disk Signature offset" - ;%endif + %if DiskSignature - start <> MAGIC_OFF + %error "incorrect Disk Signature offset" + %endif kMbrSignature db 0x55, 0xAA %endif