From: Alan Cox Date: Sat, 17 Jan 2015 02:16:15 +0000 (+0000) Subject: tgl6502: more debugging but we can now execute fork() ok X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=d0b8c41cd7e25a47f7c229a20b0dae9728987a42;p=FUZIX.git tgl6502: more debugging but we can now execute fork() ok --- diff --git a/Kernel/platform-tgl6502/tgl6502.s b/Kernel/platform-tgl6502/tgl6502.s index 2ab37cc2..1fb9af49 100644 --- a/Kernel/platform-tgl6502/tgl6502.s +++ b/Kernel/platform-tgl6502/tgl6502.s @@ -306,6 +306,13 @@ outchar: ; we can use the shorter one for the CMOS chip ; vector: + lda #')' + sta $FF03 + pla + tax + pla + jsr outxa + jmp _trap_monitor pha txa pha @@ -386,10 +393,10 @@ syscall_entry: tya jsr outcharhex pla - iny - dey + cpy #0 beq noargs copy_args: + dey lda (ptr1),y ; copy the arguments over sta U_DATA__U_ARGN+1,x dey @@ -397,7 +404,7 @@ copy_args: sta U_DATA__U_ARGN,x inx inx - dey + cpy #0 bne copy_args noargs: ldx #'Y' @@ -411,12 +418,12 @@ noargs: lda sp+1 pha tsx - stx U_DATA__U_SP + stx U_DATA__U_SYSCALL_SP ; ; We save a copy of the high byte of sp here as we may need it to get ; the brk() syscall right. ; - sta U_DATA__U_SP + 1 + sta U_DATA__U_SYSCALL_SP + 1 ; ; ; FIXME: we should check here if there is enough 6502 stack left @@ -447,7 +454,7 @@ noargs: ; ; Correct the system stack ; - ldx U_DATA__U_SP + ldx U_DATA__U_SYSCALL_SP txs ; ; From that recover the C stack and the syscall buf ptr