Browse Source

* small update
* uses gprt1 again for gprt21 becuase gprt21.as crashes

peter 26 years ago
parent
commit
b0b561fa95
2 changed files with 35 additions and 5 deletions
  1. 8 3
      rtl/linux/Makefile
  2. 27 2
      rtl/linux/i386/gprt21.as

+ 8 - 3
rtl/linux/Makefile

@@ -190,8 +190,9 @@ cprt0$(OEXT) : $(CPU)/cprt1.as
 cprt21$(OEXT) : $(CPU)/cprt21.as
 cprt21$(OEXT) : $(CPU)/cprt21.as
 	$(AS) -o cprt21$(OEXT) $(CPU)/cprt21.as 
 	$(AS) -o cprt21$(OEXT) $(CPU)/cprt21.as 
 
 
-gprt21$(OEXT) : $(CPU)/gprt21.as
-	$(AS) -o gprt21$(OEXT) $(CPU)/gprt21.as
+# still need to use gprt1, because gprt21 crashes
+gprt21$(OEXT) : $(CPU)/gprt1.as
+	$(AS) -o gprt21$(OEXT) $(CPU)/gprt1.as
 
 
 endif
 endif
 
 
@@ -273,7 +274,11 @@ ipc$(PPUEXT) : ipc.pp linux$(PPUEXT) $(SYSTEMPPU)
 
 
 #
 #
 # $Log$
 # $Log$
-# Revision 1.21  1999-05-03 21:29:35  peter
+# Revision 1.22  1999-05-03 23:30:28  peter
+#   * small update
+#   * uses gprt1 again for gprt21 becuase gprt21.as crashes
+#
+# Revision 1.21  1999/05/03 21:29:35  peter
 #   + glibc 2.1 support
 #   + glibc 2.1 support
 #
 #
 # Revision 1.20  1999/04/22 10:56:32  peter
 # Revision 1.20  1999/04/22 10:56:32  peter

+ 27 - 2
rtl/linux/i386/gprt21.as

@@ -36,8 +36,9 @@ _start:
         movl    %esi,U_SYSLINUX_ARGC    /* Move the argument counter    */
         movl    %esi,U_SYSLINUX_ARGC    /* Move the argument counter    */
         movl    %ebx,U_SYSLINUX_ARGV    /* Move the argument pointer    */
         movl    %ebx,U_SYSLINUX_ARGV    /* Move the argument pointer    */
 
 
+        movl    %edi,%eax
         xorl    %ebp,%ebp
         xorl    %ebp,%ebp
-        pushl   %edi
+        pushl   %eax
         pushl   %esp
         pushl   %esp
         pushl   %edx
         pushl   %edx
         pushl   $_fini
         pushl   $_fini
@@ -56,6 +57,8 @@ cmain:
         popl    %eax
         popl    %eax
         movl    %eax,___fpc_ret
         movl    %eax,___fpc_ret
         movl    %ebx,___fpc_ret_ebx
         movl    %ebx,___fpc_ret_ebx
+        movl    %esi,___fpc_ret_esi
+        movl    %edi,___fpc_ret_edi
         pushl   %eax
         pushl   %eax
 
 
         /* start the program */
         /* start the program */
@@ -69,12 +72,21 @@ _haltproc:
 
 
         movl    ___fpc_ret,%edx         /* return to libc */
         movl    ___fpc_ret,%edx         /* return to libc */
         movl    ___fpc_ret_ebx,%ebx
         movl    ___fpc_ret_ebx,%ebx
+        movl    ___fpc_ret_esi,%esi
+        movl    ___fpc_ret_edi,%edi
         push    %edx
         push    %edx
         ret
         ret
 
 
         .globl  __gmon_start__
         .globl  __gmon_start__
         .type   __gmon_start__,@object
         .type   __gmon_start__,@object
 __gmon_start__:
 __gmon_start__:
+        pushl   %ebp
+        movl    __monstarted,%eax
+        leal    0x1(%eax),%edx
+        movl    %esp,%ebp
+        movl    %edx,__monstarted
+        testl   %eax,%eax
+        jnz     .Lnomonstart
         pushl   $etext                  /* Initialize gmon */
         pushl   $etext                  /* Initialize gmon */
         pushl   $_start
         pushl   $_start
         call    monstartup
         call    monstartup
@@ -82,6 +94,9 @@ __gmon_start__:
         pushl   $_mcleanup
         pushl   $_mcleanup
         call    atexit
         call    atexit
         addl    $4,%esp
         addl    $4,%esp
+.Lnomonstart:
+        movl   %ebp,%esp
+        popl   %ebp
         ret
         ret
 
 
 .data
 .data
@@ -97,11 +112,21 @@ ___fpc_ret:                             /* return address to libc */
         .long   0
         .long   0
 ___fpc_ret_ebx:
 ___fpc_ret_ebx:
         .long   0
         .long   0
+___fpc_ret_esi:
+        .long   0
+___fpc_ret_edi:
+        .long   0
 
 
+.bss
+        .lcomm __monstarted,4
 
 
 #
 #
 # $Log$
 # $Log$
-# Revision 1.1  1999-05-03 21:29:36  peter
+# Revision 1.2  1999-05-03 23:30:29  peter
+#   * small update
+#   * uses gprt1 again for gprt21 becuase gprt21.as crashes
+#
+# Revision 1.1  1999/05/03 21:29:36  peter
 #   + glibc 2.1 support
 #   + glibc 2.1 support
 #
 #
 # Revision 1.3  1998/11/04 10:16:25  peter
 # Revision 1.3  1998/11/04 10:16:25  peter