home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1358 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  8.0 KB

  1. From: johnm@vaxc.cc.monash.edu.au
  2. Newsgroups: alt.sources
  3. Subject: [pcip] Re: 802.3 Novell and TCP/IP on top of Packet Driver
  4. Message-ID: <12139@stag.math.lsa.umich.edu>
  5. Date: 21 May 90 04:47:30 GMT
  6.  
  7. Archive-name: novell-packet-ipx/18-May-90
  8. Original-posting-by: johnm@vaxc.cc.monash.edu.au
  9. Original-subject: Re: 802.3 Novell and TCP/IP on top of Packet Driver
  10. Reposted-by: emv@math.lsa.umich.edu (Edward Vielmetti)
  11.  
  12. [This is an experimental alt.sources re-posting from the newsgroup(s)
  13. comp.protocols.tcp-ip.ibmpc. Comments on this service to emv@math.lsa.umich.edu 
  14. (Edward Vielmetti).]
  15.  
  16.  
  17. In article <399@van-bc.UUCP>, skl@van-bc.UUCP (Samuel Lam) writes:
  18. > By now, thanks to Kelly MacDonald at BYU, we all know how to do
  19. > Ethernet II (Blue Book) Novell over a packet driver and make it
  20. > co-exist with a TCP/IP stack on top of the same packet driver...
  21. > The question of the day now is:  Does anyone have any insight
  22. > in doing the same with the ordinary 802.3 Novell, so that one
  23. > would not have to involve the Novell servers and other Novell
  24. > nodes on the network just to get TCP/IP and Novell to co-exist
  25. > on one Ethernet interface on a single PC?
  26.  
  27. I've done it.  I modified HEAD.ASM and TAIL.ASM from version 5 of the
  28. packet drivers and use an IPX linked against PDSHELL.OBJ.  
  29.  
  30. I also modified things so that the packet driver doesn't initialize the
  31. Ethernet card until you actually use the packet driver.  This works well
  32. with the WD8003E driver, but with the NE1000/Tiara driver it doesn't
  33. show you the Ethernet address until you actually start using the packet
  34. driver.  :-(
  35.  
  36. We had to continue using 802.3 Novell because we needed student PCs to
  37. remote boot (from the Novell fileserver).  In the AUTOEXEC.BAT just load
  38. the appropriate packet driver, IPX linked against PDSHELL, NET3, and do
  39. the rest of the things you normally do.  No need to have a RAM disk
  40. taking up memory.
  41.  
  42. In our AUTOEXEC.BAT we also have a program that looks at the signature
  43. in the Ethernet Boot ROM and decides which packet driver to load (with
  44. which IRQ etc.).  This means we can have *one* boot image on the server
  45. for all types of cards, and we don't have classrooms full of PCs each
  46. reading BOOTCONF.SYS two bytes at a time ... but that's a different
  47. story.
  48.  
  49. Please use this code, improve it (it's my only bit of 8*86 coding --
  50. done without a manual), and share it around.
  51.  
  52.     John
  53.  
  54. Here are my the differences to the version 5 files.
  55.  
  56. ------------------  HEAD.DIF  ------------------------------
  57. *** VC$1:[COS142D.KA9Q.DRIVERS5]HEAD.ASM;1
  58. --- head.asm
  59. **************
  60. *** 42,47
  61.   is_at        db    0        ; =1 if we're on an AT.
  62.   sys_features    db    0        ; 2h = MC   40h = 2nd 8259
  63.   
  64.   functions    label    word
  65.       dw    f_driver_info        ;function 1
  66.       dw    f_access_type
  67. --- 42,51 -----
  68.   is_at        db    0        ; =1 if we're on an AT.
  69.   sys_features    db    0        ; 2h = MC   40h = 2nd 8259
  70.   
  71. + ; call etopen the first time the packet driver is called
  72. + called_etopen   db      0               ; have called etopen
  73. +         extrn   etopen: near
  74.   functions    label    word
  75.       dw    f_driver_info        ;function 1
  76.       dw    f_access_type
  77. **************
  78. *** 197,202
  79.       jz    our_isr_ei        ;no.
  80.   ;    sti                ;yes - re-enable them.
  81.   our_isr_ei:
  82.       mov    dh,BAD_COMMAND        ;in case we find a bad number.
  83.       mov    bl,ah            ;jump to the correct function.
  84.       mov    bh,0
  85. --- 201,235 -----
  86.       jz    our_isr_ei        ;no.
  87.   ;    sti                ;yes - re-enable them.
  88.   our_isr_ei:
  89. +         cmp     called_etopen,1         ; have we initialized the card?
  90. +         je      our_isr_cont            ; yes
  91. +         push    ax                    ; save lots of registers
  92. +         push    bx
  93. +         push    cx
  94. +         push    dx
  95. +         push    si
  96. +         push    di
  97. +         push    bp
  98. +         push    ds
  99. +         push    es
  100. +         call    etopen                  ; init the card
  101. +         mov     called_etopen,1         ; remember this fact
  102. +         pop     es                      ; restore lots of registers
  103. +         pop     ds
  104. +         pop     bp
  105. +         pop     di
  106. +         pop     si
  107. +         pop     dx
  108. +         pop     cx
  109. +         pop     bx
  110. +         pop     ax
  111. +  
  112. + our_isr_cont:
  113.       mov    dh,BAD_COMMAND        ;in case we find a bad number.
  114.       mov    bl,ah            ;jump to the correct function.
  115.       mov    bh,0
  116. **************
  117. *** 464,469
  118.   ;    mov    si,_SI[bp]
  119.   ;    mov    cx,_CX[bp]    ; count of bytes
  120.   
  121.       call    send_pkt
  122.       pop    ds
  123.       ret
  124. --- 497,518 -----
  125.   ;    mov    si,_SI[bp]
  126.   ;    mov    cx,_CX[bp]    ; count of bytes
  127.   
  128. + ; Take Ethernet encapsulated Novell IPX packets (from BYU's PDSHELL) and
  129. + ; change them to be IEEE 802.3 encapsulated.
  130. + EPROT_OFF       equ     EADDR_LEN*2
  131. +         cmp     ds:[si].EPROT_OFF,3781h ; if not Novell (prot 8137)
  132. +         jne     f_send_pkt_1            ;  don't tread on it
  133. +         push    ax                      ; get scratch reg
  134. +         mov     ah,[si].EPROT_OFF+4     ; get len
  135. +         mov     al,[si].EPROT_OFF+5
  136. +         inc     ax                      ; make even (rounding up)
  137. +         and     ax,0fffeh
  138. +         mov     ds:[si].EPROT_OFF,ah    ; save in prot field
  139. +         mov     ds:[si].EPROT_OFF+1,al
  140. +         pop     ax                      ; restore old contents
  141. + f_send_pkt_1:
  142. +    
  143.       call    send_pkt
  144.       pop    ds
  145.       ret
  146. **************
  147. *** 752,757
  148.   ;enter with cx = packet length, es:di -> packet type.
  149.       assume    ds:code, es:nothing
  150.       push    cx
  151.   
  152.       mov    bx,offset handles
  153.   recv_find_1:
  154. --- 801,819 -----
  155.   ;enter with cx = packet length, es:di -> packet type.
  156.       assume    ds:code, es:nothing
  157.       push    cx
  158. + ; Take IEEE 802.3 encapsulated packets that could be Novell IPX and
  159. + ; make them Ethernet encapsulated Novell IPX packets (for PDSHELL).
  160. +         push    ax                      ; get scratch reg
  161. +         mov     ah,es:[di]              ; get length word
  162. +         mov     al,es:[di]+1
  163. +         cmp     ax,GIANT                ; if > GIANT
  164. +         ja      recv_find_0             ;  then it is a protocol
  165. +         cmp     es:2[di],0ffffh         ; if next word not ffff
  166. +         jne     recv_find_0             ;  then not Novell
  167. +         mov     es:[di],3781h           ; make Novell protocol (8137)
  168. + recv_find_0:
  169. +         pop     ax                      ; restore old contents
  170.   
  171.       mov    bx,offset handles
  172.   recv_find_1:
  173. ------------------  HEAD.DIF  ------------------------------
  174.  
  175. ------------------  TAIL.DIF  ------------------------------
  176. *** VC$1:[COS142D.KA9Q.DRIVERS5]TAIL.ASM;1
  177. --- tail.asm
  178. **************
  179. *** 36,41
  180.    db "Packet driver skeleton copyright 1988-89, Russell Nelson.",CR,LF
  181.    db "This program is free software; see the file COPYING for details.",CR,LF
  182.    db "NO WARRANTY; see the file COPYING for details.",CR,LF
  183.   crlf_msg    db    CR,LF,'$'
  184.   
  185.   ;parse_args should parse the arguments.
  186. --- 36,42 -----
  187.    db "Packet driver skeleton copyright 1988-89, Russell Nelson.",CR,LF
  188.    db "This program is free software; see the file COPYING for details.",CR,LF
  189.    db "NO WARRANTY; see the file COPYING for details.",CR,LF
  190. +  db "Delayed etopen and IEEE 802.3 mods by John Mann.",CR,LF
  191.   crlf_msg    db    CR,LF,'$'
  192.   
  193.   ;parse_args should parse the arguments.
  194. **************
  195. *** 177,185
  196.       jmp    error
  197.   int_ok:
  198.   
  199. !     call    etopen            ;init the driver.  If any errors,
  200. !                     ;this routine returns cy.
  201. !     jc    no_resident
  202.   
  203.       push    dx            ;remember where they want to end.
  204.   
  205. --- 178,192 -----
  206.       jmp    error
  207.   int_ok:
  208.   
  209. ! ; Don't call etopen when we are loaded, but when we are called
  210. ! ; for the first time
  211. ! ;
  212. ! ;    call    etopen            ;init the driver.  If any errors,
  213. ! ;                    ;this routine returns cy.
  214. ! ;    jc    no_resident
  215. ! ;
  216. ! ; Save all of driver in case needed by delayed etopen
  217. !         mov     dx,offset end_tail      ; save whole of driver
  218.   
  219.       push    dx            ;remember where they want to end.
  220.   
  221. **************
  222. *** 523,528
  223.       loope    memory_test_1        ;keep going if the store worked.
  224.       pop    ds
  225.       ret
  226.   
  227.   code    ends
  228.   
  229. --- 530,537 -----
  230.       loope    memory_test_1        ;keep going if the store worked.
  231.       pop    ds
  232.       ret
  233. + end_tail        label   byte            ; end of the driver
  234.   
  235.   code    ends
  236.   
  237. ------------------  TAIL.DIF  ------------------------------
  238.  
  239. --
  240. John Mann, Computer Centre, Monash University, Clayton VIC 3168, Australia
  241. Net: johnm@vaxc.cc.monash.edu.au  Ph: +61 3 565 4774  FAX: +61 3 565 4746
  242.