Switch back from yasm to nasm

These days, nasm supports more instructions than yasm. Additionally, it
offers a disassembler.
This commit is contained in:
Jonathan Schleifer
2014-03-28 23:10:24 +01:00
parent 3dc701c1c7
commit a04a520b0d
6 changed files with 23 additions and 27 deletions
+2 -2
View File
@@ -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) * autoheader (part of autoconf, needed for building gcc)
* automake * automake
* gawk * gawk
* yasm (http://www.tortall.net/projects/yasm/wiki/Download) * nasm
* wget * wget
* (un)zip * (un)zip
* cdrtools (not genisoimage!) * cdrtools (not genisoimage!)
@@ -76,7 +76,7 @@ The following darwin ports need to be installed:
* gnuregex * gnuregex
* gsed * gsed
* cdrtools * cdrtools
* yasm * nasm
* wget * wget
* less * less
* mpfr * mpfr
+6 -6
View File
@@ -325,9 +325,9 @@ rule KernelArchitectureSetup architecture
# offset in floppy image (>= sizeof(haiku_loader)) # offset in floppy image (>= sizeof(haiku_loader))
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
# yasm is required for target arch x86 # nasm is required for target arch x86
if ! $(HAIKU_YASM) { if ! $(HAIKU_NASM) {
Exit "HAIKU_YASM not set. Please re-run configure." ; Exit "HAIKU_NASM not set. Please re-run configure." ;
} }
case x86_64 : case x86_64 :
@@ -340,9 +340,9 @@ rule KernelArchitectureSetup architecture
# x86_64 kernel source is under arch/x86. # x86_64 kernel source is under arch/x86.
HAIKU_KERNEL_ARCH = x86 ; HAIKU_KERNEL_ARCH = x86 ;
# yasm is required for target arch x86_64 # nasm is required for target arch x86_64
if ! $(HAIKU_YASM) { if ! $(HAIKU_NASM) {
Exit "HAIKU_YASM not set. Please re-run configure." ; Exit "HAIKU_NASM not set. Please re-run configure." ;
} }
case m68k : case m68k :
+1 -1
View File
@@ -120,7 +120,7 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ] {
} }
# other commonly used tools # other commonly used tools
AddHaikuImagePackages bison cdrtools flex jam m4 make mkdepend yasm ; AddHaikuImagePackages bison cdrtools flex jam m4 make mkdepend nasm ;
} }
Vendored
+2 -2
View File
@@ -111,7 +111,7 @@ environment variables:
HAIKU_RANLIB_x86_gcc2 The static library indexer for x86_gcc2. Defaults HAIKU_RANLIB_x86_gcc2 The static library indexer for x86_gcc2. Defaults
to "ranlib". to "ranlib".
HAIKU_STRIP_x86_gcc2 The x86_gcc2 strip command. Defaults to "strip". 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_<arch> The preprocessor flags for target architecture HAIKU_CPPFLAGS_<arch> The preprocessor flags for target architecture
<arch>. Defaults to "". <arch>. Defaults to "".
HAIKU_CCFLAGS_<arch> The C flags for target architecture <arch>. HAIKU_CCFLAGS_<arch> The C flags for target architecture <arch>.
@@ -486,7 +486,7 @@ HAIKU_PORTS_CROSS=
HAIKU_PACKAGING_ARCHS= HAIKU_PACKAGING_ARCHS=
set_default_value HAIKU_YASM yasm set_default_value HAIKU_NASM nasm
if sha256sum < /dev/null > /dev/null 2>&1; then if sha256sum < /dev/null > /dev/null 2>&1; then
HOST_SHA256=sha256sum HOST_SHA256=sha256sum
@@ -40,7 +40,7 @@ using std::nothrow;
// compiled mbr boot loader code // compiled mbr boot loader code
static const uint8 kBootCode[] = { static const uint8 kBootCode[] = {
// compiled form of //haiku/trunk/src/bin/writembr/mbr.S // 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 <mbrcode.bin 12 // bin2h <mbrcode.bin 12
0xfa, 0xfc, 0x31, 0xc0, 0x8e, 0xc0, 0x8e, 0xd8, 0x8e, 0xd0, 0xbc, 0x00, 0xfa, 0xfc, 0x31, 0xc0, 0x8e, 0xc0, 0x8e, 0xd8, 0x8e, 0xd0, 0xbc, 0x00,
0x7c, 0xbf, 0x00, 0x08, 0xb9, 0x18, 0x00, 0xf3, 0xaa, 0xbe, 0x00, 0x7c, 0x7c, 0xbf, 0x00, 0x08, 0xb9, 0x18, 0x00, 0xf3, 0xaa, 0xbe, 0x00, 0x7c,
+11 -15
View File
@@ -5,11 +5,11 @@
; MBR Boot code ; MBR Boot code
; ;
; assemble the Master boot record with: ; assemble the Master boot record with:
; yasm -f bin -O5 -o mbr.bin mbr.S ; nasm -f bin -O5 -o mbr.bin mbr.S
; ;
; assemble the MBR's code (does not contain the partiton table ; assemble the MBR's code (does not contain the partiton table
; nor the MAGIC code) with: ; nor the MAGIC code) with:
; 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
;%define DEBUG 1 ;%define DEBUG 1
@@ -373,27 +373,23 @@ data:
; check whether the code is small enough to fit in the boot code area ; check whether the code is small enough to fit in the boot code area
end: end:
;use nasm instead of yasm to check the code size %if end - start > DISKSIG
;%if end - start > DISKSIG %error "Code exceeds master boot code area!"
; %error "Code exceeds master boot code area!" %endif
;%endif
%ifdef MBR_CODE_ONLY %ifdef MBR_CODE_ONLY
;just build the code. ;just build the code.
;Do not generate the datas ;Do not generate the datas
%else %else
;use nasm instead of yasm => use %rep instead of times %rep start + DISKSIG - end
;%rep start + DISKSIG - end db 0 ;fill the rest of the code area
; db 0 ;fill the rest of the code area %endrep
;%endrep
times start + DISKSIG - end db 0
kMbrDiskID dd 0 ;Disk signature kMbrDiskID dd 0 ;Disk signature
dw 0 ;reserved dw 0 ;reserved
PartitionTable times PartitionEntry_size * 4 db 0 PartitionTable times PartitionEntry_size * 4 db 0
DiskSignature: DiskSignature:
;use nasm instead of yasm to check the MAGIC offset %if DiskSignature - start <> MAGIC_OFF
;%if DiskSignature - start <> MAGIC_OFF %error "incorrect Disk Signature offset"
; %error "incorrect Disk Signature offset" %endif
;%endif
kMbrSignature db 0x55, 0xAA kMbrSignature db 0x55, 0xAA
%endif %endif