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:07:04 +01:00
parent 3dc701c1c7
commit a04a520b0d
6 changed files with 23 additions and 27 deletions

4
ReadMe
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)
* 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

View File

@ -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 :

View File

@ -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 ;
}

4
configure vendored
View File

@ -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_<arch> The preprocessor flags for target architecture
<arch>. Defaults to "".
HAIKU_CCFLAGS_<arch> The C flags for target architecture <arch>.
@ -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

View File

@ -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 <mbrcode.bin 12
0xfa, 0xfc, 0x31, 0xc0, 0x8e, 0xc0, 0x8e, 0xd8, 0x8e, 0xd0, 0xbc, 0x00,
0x7c, 0xbf, 0x00, 0x08, 0xb9, 0x18, 0x00, 0xf3, 0xaa, 0xbe, 0x00, 0x7c,

View File

@ -5,11 +5,11 @@
; MBR Boot code
;
; 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
; 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
@ -373,27 +373,23 @@ data:
; check whether the code is small enough to fit in the boot code area
end:
;use nasm instead of yasm to check the code size
;%if end - start > 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