Thread: DOS network-communication (NETBEUI)

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    13

    DOS network-communication (NETBEUI)

    Hi

    I have many DOS clients on my LAN and I need to realize a communication tool based on NETBEUI protocol, does anybody know where i can get examples and source code (in C) ?
    Network is working, I can share files among the DOS PC's.

    Any help ?

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    You might check out Ralph Brown's Interrupt List. I'm not familiar with that protocol but if its a dos-based driver then it must be interrupt driven. Perhaps the interrupt listing has the information you need. It will most likely use interrupt 2Fh, but there is another standard networking interrupt vector that most companies used. However it slips my mind at this point because I haven't done any DOS programming in over a year.

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    13
    Thanks,
    but I am actually a Java Developer and not familiar with dark, basic hardware implementations.. as a matter of fact I need to code in C for my DOS clients thus I am searching for example code which I can use direclty by modifying the source code.

    Thanks again

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    You need to interface with the Net driver which will be located in upper memory in DOS. In order to 'call' the driver it will reside on an interrupt which you can invoke. Upon invocation the system looks in the IVT (interrupt vector table). The algo is: offset=(interrupt_num*4), segment=(interrupt_num*4)+2. The value at the location in this table is then used to call the interrupt handler which is provided by the driver manufacturer.

    You simply need to pass the correct function number in the AX register (most implementations use the AX register as a function selector) and the correct values in the other registers. The registers used and the correct values to put in them are completely dependent on implementation inside the driver so there really is not a standard. The RBIL or interrupt listing by Ralph Brown will provide a wealth of information on many, many, many older network drivers and I'm sure yours is probably in there somewhere.

    Here is an example of setting the video mode in C via int 10h. The desired mode is to be put into AX. There are other options available to use for diff cards but all of them support putting the mode number into AX.

    This sets the video mode to 320x200x256 1 byte per pixel. It is a palettised mode in that the numbers in the video memory correspond to a pallette table in the video card memory which then correspond to certain RGB values.
    Code:
    #include <dos.h>
    
    int main(void)
    {
      REGS regs;
      regs.x.ax=0x13;
      int86(0x10,&regs,&regs);
    
      //Fill screen with blue
      //Video memory in graphics modes >=320x200x256 all start at A000:0000
      unsigned char far*Screen=(unsigned char far *)MK_FP(0xA000,0);
    
      for (unsigned int memloc=0;memloc<64000;memloc++)
      {
         Screen[memloc]=1;
      }
    
      return(0);
    }
    In inline asm:

    Code:
    #include <dos.h>
    
    int main(void)
    {
      unsigned char far  *Screen=(unsigned char far *)MK_FP(0xA000,0);
      
      asm {
        mov    ax,13h
        int      10h
       
        les      di,[Screen]
        mov    cx,32000d
        mov    al,0x01
        mov    ah,0x01
        rep     stosw
      }
     
      return(0);
    }

  5. #5
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Hehe, writing a protocol stack using inline assembly would be... cumbersome.

    I'm sure there are libraries available.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  6. #6
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    But I thought that DOS never had any network access... microsoft first accessed the network with windows.

    then how could there be an interupt or a lib?
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  7. #7
    Registered User
    Join Date
    Nov 2004
    Posts
    13
    Well thanks for your postings..I don't have the knowledge to implement any interrput stuff, I think that I will try to realize the communication through a database that is located on a shared drive.
    I have Microsoft Network Client 3.0 on my DOS PC's, they can all access a shared drive on a Win2000 PC where I will have a database which gets queried by the DOS clients frequently..

    All I need now is source code in C that lets me access (execute SQL statements) on a Microsoft Access database.

    ? ?

    Thanks for your replies

    Marcel

  8. #8
    Registered User
    Join Date
    Nov 2004
    Posts
    13
    Just for information.
    I found a nice tool for tcp/ip communication for DOS:
    http://www.ertos.com/ and http://www.wattcp.com
    http_d is kind of a socket (on DOS) that can become access easily e.g. through Java etc..
    Works nice !

    All you need is a Packet Driver for your NIC

    Marcel

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Network File Copy in DR DOS
    By daron in forum C Programming
    Replies: 3
    Last Post: 09-30-2005, 01:49 AM
  2. Cross Network communication using Winsock2?
    By dp_76 in forum Networking/Device Communication
    Replies: 6
    Last Post: 05-20-2005, 07:05 AM
  3. Network program for dos through c
    By planet_abhi in forum Networking/Device Communication
    Replies: 3
    Last Post: 05-23-2004, 10:12 AM
  4. DOS network..
    By planet_abhi in forum C Programming
    Replies: 2
    Last Post: 05-19-2004, 02:20 AM
  5. DOS program versus DOS console program
    By scromer in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-10-2002, 01:42 PM