Fix dec/hex bug in crt0.S; do -msoft-float just in case
authorhpa <hpa>
Sat, 18 Dec 2004 22:31:47 +0000 (22:31 +0000)
committerhpa <hpa>
Sat, 18 Dec 2004 22:31:47 +0000 (22:31 +0000)
dos/Makefile
dos/crt0.S

index 37b6f9b..5b58af0 100644 (file)
@@ -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
index 1052100..9d0b2f8 100644 (file)
@@ -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