Ver Fonte

* makefile works again
* environ is now defined in system.pp (like go32v2)

peter há 27 anos atrás
pai
commit
15d85c7e3b
3 ficheiros alterados com 122 adições e 118 exclusões
  1. 12 11
      rtl/dos/go32v1/makefile
  2. 100 99
      rtl/dos/go32v1/prt0.as
  3. 10 8
      rtl/dos/go32v1/system.pp

+ 12 - 11
rtl/dos/go32v1/makefile

@@ -22,7 +22,7 @@ endif
 
 # What is the Operating System
 ifndef OS_SRC
-OS_SRC=GO32V1
+OS_SRC=GO32V2
 endif
 
 # What is the target operating system ?
@@ -144,10 +144,11 @@ OEXT=.o1
 
 .PHONY: all clean install diffs diffclean
 
-all : system$(PPUEXT) prt0$(OEXT) crt$(PPUEXT) go32$(PPUEXT) strings$(PPUEXT) \
-	dos$(PPUEXT) printer$(PPUEXT) objects$(PPUEXT) \
-	mmx$(PPUEXT) cpu$(PPUEXT) \
-	mouse$(PPUEXT) fmouse$(PPUEXT) getopts$(PPUEXT) graph$(PPUEXT)
+all : system$(PPUEXT) prt0$(OEXT) go32$(PPUEXT) strings$(PPUEXT) \
+      objpas$(PPUEXT) \
+      dos$(PPUEXT) crt$(PPUEXT) printer$(PPUEXT) objects$(PPUEXT) \
+      mmx$(PPUEXT) cpu$(PPUEXT) \
+      mouse$(PPUEXT) getopts$(PPUEXT) graph$(PPUEXT) \
 
 printer$(PPUEXT) : ../printer.pp system$(PPUEXT)
 	$(COPY) ../printer.pp .
@@ -215,22 +216,22 @@ objects$(PPUEXT) : ../objects.pp system$(PPUEXT)
 	$(PP) $(OPT) objects.pp $(REDIR)
 	$(DEL) objects.pp
 
+objpas$(PPUEXT) : ../../objpas/objpas.pp system$(PPUEXT)
+	$(COPY) ../../objpas/objpas.pp .
+	$(PP) $(OPT) objpas $(REDIR)
+	$(DEL) objpas.pp
+
 mouse$(PPUEXT) : ../mouse.pp system$(PPUEXT)
 	$(COPY) ../mouse.pp .
 	$(PP) $(OPT) mouse.pp $(REDIR)
 	$(DEL) mouse.pp
 
-fmouse$(PPUEXT) : ../fmouse.pp system$(PPUEXT)
-	$(COPY) ../fmouse.pp .
-	$(PP) $(OPT) fmouse.pp $(REDIR)
-	$(DEL) fmouse.pp
-
 clean:
 	-$(DEL) *$(OEXT)
 	-$(DEL) *$(PPUEXT)
 	-$(DEL) *.dif
 	-$(DEL) log
-	-$(DEL) *.as
+	-$(DEL) *$(ASMEXT)
 
 diffclean:
 	-$(DEL) *.dif

+ 100 - 99
rtl/dos/go32v1/prt0.as

@@ -12,74 +12,74 @@
 #
 # **********************************************************************
 #///*
-#//**	Called as start(argc, argv, envp)
+#//**   Called as start(argc, argv, envp)
 #//*/
-#///*	gs:edx points to prog_info structure.  All other registers are OBSOLETE
-#//**	but included for backwards compatibility
+#///*   gs:edx points to prog_info structure.  All other registers are OBSOLETE
+#//**   but included for backwards compatibility
 #//*/
 
-	.text
-	.globl	_start
+        .text
+        .globl  _start
 _start:
-	.globl	start
+        .globl  start
 start:
 # the first instruction must be movl %eax,
 # because that is the way GO32V2 makes the difference between V1 and V2 coff format
-	movl	%eax,__hard_master
-	movl	%esi,___pid
-	movl	%edi,___transfer_buffer
-	movl	%ebx,_ScreenPrimary
-	movl	%ebp,_ScreenSecondary
-	cmpl	$0, %edx
-	je	Lcopy_none
-	movw	%gs,%cx
-	movw	%ds,%ax
-	cmpw	%cx,%ax
-	je	Lcopy_none
+        movl    %eax,__hard_master
+        movl    %esi,___pid
+        movl    %edi,___transfer_buffer
+        movl    %ebx,_ScreenPrimary
+        movl    %ebp,_ScreenSecondary
+        cmpl    $0, %edx
+        je      Lcopy_none
+        movw    %gs,%cx
+        movw    %ds,%ax
+        cmpw    %cx,%ax
+        je      Lcopy_none
 #   /* set the right size */
-	movl  $40,U_SYSTEM_GO32_INFO_BLOCK
+        movl  $40,U_SYSTEM_GO32_INFO_BLOCK
 
-	movl	%gs:(%edx), %ecx
-	cmpl	U_SYSTEM_GO32_INFO_BLOCK, %ecx
-	jbe	Lcopy_less
-	movl	U_SYSTEM_GO32_INFO_BLOCK, %ecx
+        movl    %gs:(%edx), %ecx
+        cmpl    U_SYSTEM_GO32_INFO_BLOCK, %ecx
+        jbe     Lcopy_less
+        movl    U_SYSTEM_GO32_INFO_BLOCK, %ecx
 Lcopy_less:
-	movl	$U_SYSTEM_GO32_INFO_BLOCK, %edi
-	addl	$3, %ecx
-	andl	$0xfffffffc, %ecx
-	movl	%ecx, (%edi)
-	addl	$4, %edi
-	addl	$4, %edx
-	subl	$4, %ecx
+        movl    $U_SYSTEM_GO32_INFO_BLOCK, %edi
+        addl    $3, %ecx
+        andl    $0xfffffffc, %ecx
+        movl    %ecx, (%edi)
+        addl    $4, %edi
+        addl    $4, %edx
+        subl    $4, %ecx
 Lcopy_more:
-	movl	%gs:(%edx), %eax
-	movl	%eax, (%edi)
-	addl	$4, %edx
-	addl	$4, %edi
-	subl	$4, %ecx
-	jnz	Lcopy_more
-
-	movl	U_SYSTEM_GO32_INFO_BLOCK+4, %eax
-	movl	%eax, _ScreenPrimary
-	movl	U_SYSTEM_GO32_INFO_BLOCK+8, %eax
-	movl	%eax, _ScreenSecondary
-        movl	U_SYSTEM_GO32_INFO_BLOCK+12, %eax
-	movl	%eax, ___transfer_buffer
-	movl	U_SYSTEM_GO32_INFO_BLOCK+20, %eax
-	movl	%eax, ___pid
-	movl	U_SYSTEM_GO32_INFO_BLOCK+24, %eax
-	movl	%eax, __hard_master
-
-	jmp	Lcopy_done
+        movl    %gs:(%edx), %eax
+        movl    %eax, (%edi)
+        addl    $4, %edx
+        addl    $4, %edi
+        subl    $4, %ecx
+        jnz     Lcopy_more
+
+        movl    U_SYSTEM_GO32_INFO_BLOCK+4, %eax
+        movl    %eax, _ScreenPrimary
+        movl    U_SYSTEM_GO32_INFO_BLOCK+8, %eax
+        movl    %eax, _ScreenSecondary
+        movl    U_SYSTEM_GO32_INFO_BLOCK+12, %eax
+        movl    %eax, ___transfer_buffer
+        movl    U_SYSTEM_GO32_INFO_BLOCK+20, %eax
+        movl    %eax, ___pid
+        movl    U_SYSTEM_GO32_INFO_BLOCK+24, %eax
+        movl    %eax, __hard_master
+
+        jmp     Lcopy_done
 
 Lcopy_none:
-	movl	%ebx,U_SYSTEM_GO32_INFO_BLOCK+4
-	movl	%ebp,U_SYSTEM_GO32_INFO_BLOCK+8
-	movl	%edi,U_SYSTEM_GO32_INFO_BLOCK+12
-	movl	$4096,U_SYSTEM_GO32_INFO_BLOCK+16
-	movl	%esi,U_SYSTEM_GO32_INFO_BLOCK+20
-	movl	%eax,U_SYSTEM_GO32_INFO_BLOCK+24
-	movl	$28, U_SYSTEM_GO32_INFO_BLOCK
+        movl    %ebx,U_SYSTEM_GO32_INFO_BLOCK+4
+        movl    %ebp,U_SYSTEM_GO32_INFO_BLOCK+8
+        movl    %edi,U_SYSTEM_GO32_INFO_BLOCK+12
+        movl    $4096,U_SYSTEM_GO32_INFO_BLOCK+16
+        movl    %esi,U_SYSTEM_GO32_INFO_BLOCK+20
+        movl    %eax,U_SYSTEM_GO32_INFO_BLOCK+24
+        movl    $28, U_SYSTEM_GO32_INFO_BLOCK
 Lcopy_done:
 
         movw    U_SYSTEM_GO32_INFO_BLOCK+36,%ax
@@ -93,75 +93,76 @@ Lcopy_done:
 
         movw    U_SYSTEM_GO32_INFO_BLOCK+26,%ax
         movw    %ax,_core_selector
-   	movl    U_SYSTEM_GO32_INFO_BLOCK+28,%eax
-   	movl  %eax,U_SYSTEM_STUB_INFO
-	xorl	%esi,%esi
-	xorl	%edi,%edi
-	xorl	%ebp,%ebp
-	xorl	%ebx,%ebx
-
-	movl	%esp,%ebx
+        movl    U_SYSTEM_GO32_INFO_BLOCK+28,%eax
+        movl  %eax,U_SYSTEM_STUB_INFO
+        xorl    %esi,%esi
+        xorl    %edi,%edi
+        xorl    %ebp,%ebp
+        xorl    %ebx,%ebx
+
+        movl    %esp,%ebx
         movl    $0x0,%ebp
-	movl	%esp,%ebx
-	movl	8(%ebx),%eax
-	movl	%eax,_environ
-	movl	4(%ebx),%eax
-	movl	%eax,_args
-	movl	(%ebx),%eax
-	movl	%eax,_argc
+        movl    %esp,%ebx
+        movl    8(%ebx),%eax
+        movl    %eax,_environ
+        movl    %eax,U_SYSTEM_ENVIRON
+        movl    4(%ebx),%eax
+        movl    %eax,_args
+        movl    (%ebx),%eax
+        movl    %eax,_argc
 
-	call	PASCALMAIN
+        call    PASCALMAIN
 
 
 exit_again:
-	movl	$0x4c00,%eax
-	int	$0x21
-	jmp	exit_again
+        movl    $0x4c00,%eax
+        int     $0x21
+        jmp     exit_again
 
-	ret
+        ret
 
-	.data
+        .data
         .globl _argc
 _argc:
-	.long   0
-	.globl  _args
+        .long   0
+        .globl  _args
 _args:
-	.long	0
-	.globl	_run_mode
+        .long   0
+        .globl  _run_mode
 _run_mode:
-	.word	0
-	.globl	_core_selector
+        .word   0
+        .globl  _core_selector
 _core_selector:
-	.word	0
-	.globl	_environ
+        .word   0
+        .globl  _environ
 _environ:
-	.long	0
+        .long   0
 
-	.globl	___pid
+        .globl  ___pid
 ___pid:
-	.long	42
+        .long   42
 
-	.globl	___transfer_buffer
+        .globl  ___transfer_buffer
 ___transfer_buffer:
-	.long	0
+        .long   0
 
-	.globl	_ScreenPrimary
+        .globl  _ScreenPrimary
 _ScreenPrimary:
-	.long	0
+        .long   0
 
-	.globl	_ScreenSecondary
+        .globl  _ScreenSecondary
 _ScreenSecondary:
-	.long	0
+        .long   0
 
-	.globl	__hard_master
-	.globl	__hard_slave
-	.globl	__core_select
+        .globl  __hard_master
+        .globl  __hard_slave
+        .globl  __core_select
 __hard_master:
-	.byte	0
+        .byte   0
 __hard_slave:
-	.byte	0
+        .byte   0
 __core_select:
-	.short	0
+        .short  0
         .globl  __stkbottom
 __stkbottom:
         .long   0

+ 10 - 8
rtl/dos/go32v1/system.pp

@@ -73,6 +73,7 @@ type
 var
   stub_info       : p_stub_info;
   go32_info_block : t_go32_info_block;
+  environ         : ppchar;
 
   implementation
 
@@ -80,9 +81,6 @@ var
 
     {$I system.inc}
 
-{    type
-       plongint = ^longint;}
-
 {$S-}
     procedure st1(stack_size : longint);[public,alias: 'STACKCHECK'];
 
@@ -610,7 +608,7 @@ begin
   TextRec(f).Closefunc:=@fileclosefunc;
 end;
 
-     
+
 Begin
 { Initialize ExitProc }
   ExitProc:=Nil;
@@ -622,14 +620,18 @@ Begin
   OpenStdIO(Input,fmInput,StdInputHandle);
   OpenStdIO(Output,fmOutput,StdOutputHandle);
   OpenStdIO(StdErr,fmOutput,StdErrorHandle);
-{ Reset IO Error }  
+{ Reset IO Error }
   InOutRes:=0;
 End.
 
 {
   $Log$
-  Revision 1.1  1998-03-25 11:18:41  root
-  Initial revision
+  Revision 1.2  1998-03-26 12:21:02  peter
+    * makefile works again
+    * environ is now defined in system.pp (like go32v2)
+
+  Revision 1.1.1.1  1998/03/25 11:18:41  root
+  * Restored version
 
   Revision 1.9  1998/02/14 01:41:35  peter
     * fixed unusedhandle bug which was -1
@@ -638,7 +640,7 @@ End.
   + Added log at the end
 
 
-  
+
   Working file: rtl/dos/go32v1/system.pp
   description:
   ----------------------------