2009/4/30 Christian Masloch <[email protected]>:
> There's some C library based on the CALL 5 but I never used it. My test
> case was setting up the correct registers (function in cl instead of ah,
> only functions 00h..24h valid) then using a "call 5" in DEBUG. (Be sure to
> use FreeDOS's DEBUG because MS-DOS's apparently corrupts the CALL 5
> handler inside the PSP.) Here's an example DEBUG script:
>
> === CUT HERE ===
> a
> mov ax, sp
> mov cl, 2
> mov dl, 21
> call 5
> int 3
> nop
>
> g
> q
This is a minimal fix for the kernel:
--- entry.asm (révision 1371)
+++ entry.asm (copie de travail)
@@ -75,10 +75,7 @@
; psp seg
; 000ah
;
- push bp ; trash old return address
- mov bp,sp
- xchg bp,[2+bp]
- pop bp
+ add sp,2 ; trash old return address
pushf ; start setting up int 21h stack
;
; now stack is
@@ -108,7 +105,7 @@
; return offset
;
cmp cl,024h
- jbe cpm_error
+ ja cpm_error
mov ah,cl ; get the call # from cl to ah
jmp reloc_call_int21_handler ; do the system call
cpm_error: mov al,0
By the way, thanks Jeremy (Eric: it wasn't Pat) for committing the sys
fix, I hope you can do this one too.
This bug has been there since the DOS-C days by the way!
Bart
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Freedos-kernel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel