19Fermer21
FarewellLe 27/04/2013 à 20:06
Bon, j'avais un bug. On est à -6 octets par rapport à la version initiale.

1. Le patch (s'applique à sld.asm de la dernière release officielle) :
--- sld.asm.org	2013-04-26 19:09:04.882258000 +0200
+++ sld.asm	2013-04-27 20:19:43.530160000 +0200
@@ -1183,17 +1183,19 @@
 kernel::LibsExec:
 	movem.l	d0-d7/a0-a6,-(a7)			; 
 	GET_DATA_PTR					; Get Preos Data Ptr
-	moveq	#0,d7					; Set Error
+	lea	(4*16)(a7),a4
+	move.l	(a4),a2					; Get Library name
+	move.b	(4*17+2)(a7),d3				; Minimum Library version
+	clr.l	(a4)					; Set error
 	pea	(12).w					; Create a list (Next, RealReturnAddr, LibPtr)
 	ROM_THROW HeapAllocPtr				; Alloc Node
 	move.l	a0,(a7)					; Ok ?
 	beq.s	\AllocError
 	move.l	a0,a3					; Ptr to node
 	move.l	(LibsExecList-Ref)(a6),(a3)+		; Save Next node in List 
-	move.l	(4*16)(a7),(a3)+			; Save Real Return Address
+	move.l	-(a4),(a3)+				; Save Real Return Address
+	addq.l	#4,a4
 	move.l	a3,(LibsExecList-Ref)(a6)		; Update list head
-	move.l	(4*17)(a7),a2				; Get Library name
-	move.b	(4*18+2)(a7),d3				; Minimum Library version
 	bsr	kernel::FindLib				; Find the library
 	move.l	a0,(a3)					; Save the lib & Check for success
 	beq.s	\FreeNode
@@ -1207,16 +1209,17 @@
 	bsr.s	kernel::LibsPtr				; Get the ptr to the required func
 	move.l	a0,d0
 	beq.s	\UnrelocLib
-	move.l	a0,(4*17)(a7)				; New return address
+	move.l	a0,(a4)+				; New return address
 	lea	\next(pc),a0
-	move.l	a0,(4*18)(a7)				; After it return here
+	move.l	a0,(a4)					; After it return here
 	addq.l	#4,a7					; Pop Stack Frame
 	movem.l	(a7)+,d0-d7/a0-a6
 	addq.l	#4,a7					; Pop First Return Address
 	rts						; Jump to the function and return \next
 
 \next	subq.l	#8,a7					; Fix stack ptr.
-	movem.l	d0-d7/a0-a7,-(a7)			; Pop a7 to increase Stack Frame
+	st.b	(a7)					; Set success
+	movem.l	d0-d7/a0-a7,-(a7)			; Push a7 to increase Stack Frame
 	GET_DATA_PTR					; Get a6 
 	subq.l	#4,a7					; Create Stack Frame
 \UnrelocLib:
@@ -1229,10 +1232,8 @@
 	move.l	-(a3),(LibsExecList-Ref)(a6)		; Set new head
 	move.l	a3,(a7)
 	ROM_THROW HeapFreePtr				; Free Node
-	moveq	#1,d7					; Set no error
 \AllocError
 	addq.l	#4,a7					; Fix stack
-	move.l	d7,(4*16)(a7)				; Set error
 \end:	movem.l	(a7)+,d0-d7/a0-a6
 	rts
 


2. h220xtsr n'est pas construit dans le makefile de PreOS : tigcc -O2 -Wall -W h220xtsr -ar h220xtsr.a

3. J'ai un truc étrange, particulièrement quand j'ai un souci de lib non trouvé. Le problème semble purement graphique, et à ce moment du programme, je n'ai même pas ouvert dynamiquement la libc de PedroM, donc a priori j'ai pas touché aux streams :

VkGh et F2iA

4. PreOS a les reins solides cheeky
;----------------------------------------------- ; Open pdtlib ;----------------------------------------------- lea PdtlibFilename(pc),a0 lea PdtlibTrampolinesTable(pc),a1 lea PdtlibTrampolinesOffets(pc),a2 movea.l fp,a3 moveq.l #0,d1 move.b d1,-(sp) move.w #PDTLIB_INSTALL_TRAMPOLINES,-(sp) pea (a0) RAMT RAM_kernel::LibsExec move.l a0,PDTLIB_DESCRIPTOR(fp) tst.l (sp) bne.s \PdtlibLoaded lea STACK_FRAME_SIZE(fp),sp lea StrErrorPdtlib(pc),a0 bra.s \BootFail \PdtlibLoaded:
et DEFINE pdtlib@0004 RAMT RAM_kernel::LibsBegin move.l a0,d0 beq.s \Fail movem.l a0-a2,-(sp) \Loop: movea.l (sp),a0 move.w (a1)+,d0 bmi.s \EOT RAMT RAM_kernel::LibsPtr move.w (a2)+,d0 move.w #$4EF9,0(a3,d0.w) ; jmp ... move.l a0,2(a3,d0.w) ; ... imm.l bra.s \Loop movea.l (sp),a0 ; Function not found RAMT RAM_kernel::LibsEnd clr.l (sp) \EOT: movem.l (sp)+,a0-a2 \Fail: rts
FEEL THE POWER !!! love boing grin