safedsk.asm
上传用户:xiaoan1112
上传日期:2013-04-11
资源大小:19621k
文件大小:2k
源码类别:

操作系统开发

开发平台:

Visual C++

  1. ;
  2. ;       Microsoft Confidential
  3. ;       Copyright (C) Microsoft Corporation 1991
  4. ;       All Rights Reserved.
  5. ;
  6. vseg segment para public 'CODE'
  7. assume cs:vseg,ds:vseg,es:NOTHING
  8. org     0
  9. PUBLIC  Interrupt
  10. PUBLIC  Strategy
  11. extrn   init_safedsk:near
  12. extrn   buffer_size:word
  13. extrn   track_buffer:byte
  14. Header:
  15. dd      -1                      ;device chain link--filled in by dos
  16. DevAttr dw      0C840h                  ;character device attribute word
  17. dw      Strategy                ;Strategy entry point
  18. dw      Interrupt               ;Interrupt entry point
  19. db      '_doubleB'              ;logical device name
  20. RHPtr   dd      ?                       ;Request Header pointer filled in by 
  21. ;Strategy routing
  22. Strategy        proc    far
  23. mov     WORD PTR cs:[RHPtr],bx
  24. mov     WORD PTR cs:[RHPTR+2],es
  25. ret
  26. Strategy        endp
  27. Interrupt       proc    far
  28. push    ds
  29. push    es
  30. push    di
  31. push    bx
  32. push    dx
  33. push    cs
  34. pop     ds
  35. les     di,DWORD PTR cs:[RHPtr] ;load Request Header pointer into es:di
  36. mov     bl,es:[di+2]            ;get command code from RHPtr into bl
  37. or      bl,bl                   ;We only handle command zero (Init)
  38. jnz     error_out
  39. push    es
  40. push    di
  41. call    init_safedsk
  42. pop     di
  43. pop     es
  44. jnc     short dont_load
  45. Return_To_Dos:
  46. pop     dx
  47. pop     bx
  48. pop     di
  49. pop     es
  50. pop     ds
  51. ret
  52. dont_load:
  53. mov     WORD PTR es:[di+0Eh],offset Header ;return pointer to header
  54. mov     WORD PTR es:[di+10h],cs            ;to indicate don't load
  55. mov     word ptr es:[di+3],8100h           ;inform kernel of error
  56. mov     ax,7FFFh                           ;also clear high bit
  57. and     WORD PTR cs:DevAttr,ax             ;of attribute word
  58.    ;so next driver will load
  59.    ;on top of us
  60. xor     ax,ax                              ;return no error
  61. jmp     short return_to_dos
  62. error_out:
  63. mov     word ptr es:[di+3],8003h ;bad command code in request header
  64. jmp     short return_to_dos
  65. Interrupt       endp
  66. vseg ends
  67. end 
  68. endif