diff --git a/elks/arch/i86/kernel/process.c b/elks/arch/i86/kernel/process.c index 95740bd4e..18b8ad7e5 100644 --- a/elks/arch/i86/kernel/process.c +++ b/elks/arch/i86/kernel/process.c @@ -132,6 +132,7 @@ void arch_setup_user_stack (register struct task_struct * t, word_t entry) void arch_setup_sighandler_stack(register struct task_struct *t, __kern_sighandler_t addr,unsigned signr) { + printk("SIGCB %d: DS %x SS %x\n", t->pid, t->t_regs.ds, t->t_regs.ss); debug("Stack %x:%x was %x %x %x %x\n", _FP_SEG(addr), _FP_OFF(addr), get_ustack(t,0), get_ustack(t,2), get_ustack(t,4), get_ustack(t,6)); put_ustack(t, -6, (int)get_ustack(t,0)); diff --git a/libc/system/signalcb.S b/libc/system/signalcb.S index 17ce5116f..4cf5b223c 100644 --- a/libc/system/signalcb.S +++ b/libc/system/signalcb.S @@ -20,7 +20,10 @@ _signal_cbhandler: push %dx push %si push %di + push %ds push %es + mov %ss,%ax + mov %ax,%ds mov 6(%bp),%bx #ifndef __IA16_CALLCVT_REGPARMCALL @@ -43,6 +46,7 @@ _signal_cbhandler: #endif pop %es + pop %ds pop %di pop %si pop %dx diff --git a/libc/watcom/asm/signalcb.asm b/libc/watcom/asm/signalcb.asm index 765956d22..ca0be81c3 100644 --- a/libc/watcom/asm/signalcb.asm +++ b/libc/watcom/asm/signalcb.asm @@ -20,6 +20,8 @@ __signal_cbhandler proc far push di push ds push es + mov ax,ss ; ensure valid DS (=SS) + mov ds,ax mov ax,6[bp] ; get signal # callf _signal_wchandler_ ; call user function from C