Hi!

20-Ноя-2005 16:57 [EMAIL PROTECTED] (Kenneth Davis) wrote to
[EMAIL PROTECTED]:

> --- NEW FILE: intwrap.asm ---
> reloc_call_int13_handler:
>     cli             ; disable other interrupts for now

     INT instruction already disables IFlag.

>     stc             ; force error unless BIOS clears

     ?! This is issue of caller to set or reset CFlag.

>     push dx         ; store BIOS drive # for error handling usage
>     push ds         ; get segment of kernel DATA
>     mov  ds, [cs:_DGROUP_]
>     pushf           ; simulate int call so returns back here (flags+cs:ip on
> stack)
>     call far [ds:_UserInt13]

     Bug!!! Here DS register is garbaged, whereas it used by some functions
(for example, INT13/42).

>     pop  ds          ; restore ds
>     jc   int13err   ; test if error, if not return to caller
> int13iret:
>     inc sp          ; clean up stack
>     inc sp

>     sti             ; ensure int's are renabled
>     retf 2          ; return to caller leaving flags asis

     I don't think that this is right way, because caller may disable
interrupts for own purposes, whereas here interrupts enabled.

> int13wrap:
> %IF XCPU < 186
>     push ax         ; preserve registers, setup stack frame
>     push bp
>     mov  bp, sp
>     mov  ax, 13h    ; want to push 0x13 onto stack
>     xchg ax, [bp+2] ; so restore pushed ax value and put 0x13 on stack
>     pop  bp         ; clean up stack frame (leaving just 0x13 pushed on stack)

        push    bp
        push    bp
        mov     bp,sp
        mov     word [bp+2],13h
        pop     bp





-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to