From 5e9b05475246cd32b5c6d4a79b3f1817b92b7bce Mon Sep 17 00:00:00 2001 From: hpa Date: Sat, 18 Dec 2004 22:31:47 +0000 Subject: [PATCH] Fix dec/hex bug in crt0.S; do -msoft-float just in case --- dos/Makefile | 2 +- dos/crt0.S | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dos/Makefile b/dos/Makefile index 37b6f9b..5b58af0 100644 --- a/dos/Makefile +++ b/dos/Makefile @@ -3,7 +3,7 @@ LD = ld -m elf_i386 OBJCOPY = objcopy OPTFLAGS = -g -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer INCLUDES = -include code16.h -I. -I.. -I../libfat -CFLAGS = -W -Wall -ffreestanding $(OPTFLAGS) $(INCLUDES) +CFLAGS = -W -Wall -ffreestanding -msoft-float $(OPTFLAGS) $(INCLUDES) LDFLAGS = -T com16.ld AR = ar RANLIB = ranlib diff --git a/dos/crt0.S b/dos/crt0.S index 1052100..9d0b2f8 100644 --- a/dos/crt0.S +++ b/dos/crt0.S @@ -1,5 +1,9 @@ .code16 +#ifndef REGPARM +# error "This file assumes -mregparm=3 -DREGPARM=3" +#endif + .section ".init","ax" .globl _start .type _start,@function @@ -16,11 +20,11 @@ _start: shrw $2,%cx rep ; stosl - # Compute argc and argv + # Compute argc and argv (assumes REGPARM) xorl %edx,%edx - movzbw 80,%bx - movb %dl,81(%bx) # Zero-terminate string - movb $81,%dl + movzbw 0x80,%bx + movb %dl,0x81(%bx) # Zero-terminate string + movb $0x81,%dl pushl %eax # Make space for argv movl %esp,%eax calll __parse_argv -- 2.7.4