From 87051be6137ad01fd0aacfebd637ce0bca189e43 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 16 Jan 2015 22:57:20 +0000 Subject: [PATCH] crt0.: we need to copy STUBS as well as COMMONMEM --- Kernel/platform-tgl6502/crt0.s | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Kernel/platform-tgl6502/crt0.s b/Kernel/platform-tgl6502/crt0.s index 6b3c27e7..78ac7110 100644 --- a/Kernel/platform-tgl6502/crt0.s +++ b/Kernel/platform-tgl6502/crt0.s @@ -13,6 +13,7 @@ .import __BSS_RUN__, __BSS_SIZE__ .import __DATA_LOAD__, __DATA_RUN__, __DATA_SIZE__ .import __COMMONMEM_LOAD__, __COMMONMEM_RUN__, __COMMONMEM_SIZE__ + .import __STUBS_LOAD__, __STUBS_RUN__, __STUBS_SIZE__ .importzp ptr1, ptr2, tmp1 ; startup code @0 @@ -116,6 +117,22 @@ gogogo: jsr copyloop + lda #<__STUBS_LOAD__ ; Source pointer + sta ptr1 + lda #>__STUBS_LOAD__ + sta ptr1+1 + + lda #<__STUBS_RUN__ ; Target pointer + sta ptr2 + lda #>__STUBS_RUN__ + sta ptr2+1 + + ldx #<~__STUBS_SIZE__ + lda #>~__STUBS_SIZE__ ; Use -(__STUBS_SIZE__+1) + sta tmp1 + + jsr copyloop + jsr copycommon @@ -162,7 +179,8 @@ copyloop: ; -; This is also used at runtime so split it off as a helper +; This may also used be useful at runtime so split it off as a helper +; We can revisit and unsplit it if not. ; copycommon: pha -- 2.34.1