Changes in v1.8.3 (3/18/2003) (brianp)
authorBrian Palmer <brianp@sginet.com>
Tue, 18 Mar 2003 22:32:30 +0000 (22:32 +0000)
committerBrian Palmer <brianp@sginet.com>
Tue, 18 Mar 2003 22:32:30 +0000 (22:32 +0000)
- Added _alloca() function because Mingw32 generates code that needs it
- Defined _mainCRTStartup in fathelp.asm because Mingw32 looks for that symbol

svn path=/trunk/; revision=4342

freeldr/freeldr/CHANGELOG
freeldr/freeldr/Makefile
freeldr/freeldr/arch/i386/_alloca.S [new file with mode: 0644]
freeldr/freeldr/arch/i386/fathelp.asm
freeldr/freeldr/include/version.h

index 5a8d09f..9b540c8 100644 (file)
@@ -1,3 +1,8 @@
+Changes in v1.8.3 (3/18/2003) (brianp)
+
+- Added _alloca() function because Mingw32 generates code that needs it
+- Defined _mainCRTStartup in fathelp.asm because Mingw32 looks for that symbol
+
 Changes in v1.8.2 (1/24/2003) (ekohl)
 
 - Relaxed check for Int13-Extension support.
index b66af39..44327bc 100644 (file)
@@ -205,7 +205,8 @@ ARCH_OBJS   =       fathelp.o       \
                                drvmap.o        \
                                int386.o        \
                                i386disk.o      \
-                               portio.o
+                               portio.o        \
+                               _alloca.o               # For Mingw32 builds
 
 RTL_OBJS       =       print.o         \
                                stdlib.o        \
diff --git a/freeldr/freeldr/arch/i386/_alloca.S b/freeldr/freeldr/arch/i386/_alloca.S
new file mode 100644 (file)
index 0000000..0994374
--- /dev/null
@@ -0,0 +1,32 @@
+/* stuff needed for libgcc on win32.  */
+
+//#ifdef L_chkstk
+
+       .global ___chkstk
+       .global __alloca
+___chkstk:
+__alloca:
+       pushl  %ecx             /* save temp */
+       movl   %esp,%ecx        /* get sp */
+       addl   $0x8,%ecx        /* and point to return addr */
+
+probe:         cmpl   $0x1000,%eax     /* > 4k ?*/
+       jb    done              
+
+       subl   $0x1000,%ecx             /* yes, move pointer down 4k*/
+       orl    $0x0,(%ecx)              /* probe there */
+       subl   $0x1000,%eax             /* decrement count */
+       jmp    probe                    /* and do it again */
+
+done:  subl   %eax,%ecx           
+       orl    $0x0,(%ecx)      /* less that 4k, just peek here */
+
+       movl   %esp,%eax
+       movl   %ecx,%esp        /* decrement stack */
+
+       movl   (%eax),%ecx      /* recover saved temp */
+       movl   4(%eax),%eax     /* get return address */
+       jmp    *%eax    
+
+
+//#endif
index 805b8ad..9aedb92 100644 (file)
@@ -52,6 +52,8 @@ BootPartition                 equ             0x7dfd
 ; This code is loaded at 0000:8000 so we have to
 ; encode a jmp instruction to jump to 0000:8200
 
+global _mainCRTStartup ; For Mingw32 builds where the linker looks for this symbol
+_mainCRTStartup:
 global start
 start:
         db     0xe9
index d36bc41..f3996a5 100644 (file)
@@ -22,7 +22,7 @@
 
 
 /* just some stuff */
-#define VERSION                        "FreeLoader v1.8.2"
+#define VERSION                        "FreeLoader v1.8.3"
 #define COPYRIGHT              "Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>"
 #define AUTHOR_EMAIL   "<brianp@sginet.com>"
 #define BY_AUTHOR              "by Brian Palmer"
@@ -36,7 +36,7 @@
 //
 #define FREELOADER_MAJOR_VERSION       1
 #define FREELOADER_MINOR_VERSION       8
-#define FREELOADER_PATCH_VERSION       2
+#define FREELOADER_PATCH_VERSION       3
 
 
 PUCHAR GetFreeLoaderVersionString(VOID);