
          INSTALL document: Ethernet driver for Minix
          ==========================================

           Mariusz Ostrowski <s133766@ia.pw.edu.pl>


This file describes installation and configuration procedure
of Ethernet driver for Minix 1.5.10 with standard ACK compiler.


1. I recommend installing TNET4 patches first.  Of course 
Ethernet driver can be used by any user program, not only TNET.
You may also install ETHER first, and then TNET - it's up to you.


2. Install the ETHER patches:

2a. subdirectory ./kernel contains diffs and new files for /usr/src/kernel:
3c503.c			[NEW FILE]	cp to /usr/src/kernel
3c503.h			[NEW FILE]	cp to /usr/src/kernel
8390.c			[NEW FILE]	cp to /usr/src/kernel
8390.h			[NEW FILE]	cp to /usr/src/kernel
Makefile.cdiff		[DIFFS]		use patch
const.hdiff		[DIFFS]		use patch
ether.c			[NEW FILE]	cp to /usr/src/kernel
ether.h			[NEW FILE]	cp to /usr/src/kernel
etherframe.h		[NEW FILE]	cp to /usr/src/kernel
etherproto.h		[NEW FILE]	cp to /usr/src/kernel
keyboard.cdiff		[DIFFS]		use patch
klib88.xdiff		[DIFFS]]	use patch
main.cdiff		[DIFFS]		use patch
ne1000.c		[NEW FILE]	cp to /usr/src/kernel
ne1000.h		[NEW FILE]	cp to /usr/src/kernel
protect.cdiff		[DIFFS]		use patch
protect.hdiff		[DIFFS]		use patch
proto.hdiff		[DIFFS]		use patch
table.cdiff		[DIFFS]		use patch
wd8003.c		[NEW FILE]	cp to /usr/src/kernel
wd8003.h		[NEW FILE]	cp to /usr/src/kernel

2b. subdirectory ./fs contains one diffs file for /usr/src/fs:
table.cdiff		[DIFFS]		use patch

2c. subdirectory ./include contains two diffs files for /usr/include:
sgtty.hdiff		[DIFFS]		use patch
sgtty.hdiffT		[DIFFS]		use patch (both ETHER and TNET diffs)

2d. subdirectory ./include/minix contains diffs files for /usr/include/minix:
com.hdiff		[DIFFS]		use patch
com.hdiffT		[DIFFS]		use patch (both ETHER and TNET diffs)
config.hdiff		[DIFFS]		use patch
const.hdiff		[DIFFS]		use patch

2e. subdirectory ./lib/other contains two diffs files for /usr/src/lib/other:
ioctl.cdiff		[DIFFS]		use patch
ioctl.cdiffT		[DIFFS]		use patch (both ETHER and TNET diffs)


3. Configure kernel (ETHER task) to your Ethernet board:

3a. choose your board type in /usr/include/minix/config.h
    for example if you have WD8003 board, you should set:
	#define ETHERNET ETH_WD8003

3b. set your Ethernet board IRQ; for example if your Ethernet
    board uses IRQ5, then you should:
  - in /usr/src/kernel/const.h set ETHER_IRQ to the proper value:
	#define ETHER_IRQ	5
  - in /usr/src/kernel/sconst.h set ETHER_MASK to the proper value:
	#define ETHER_MASK	0x20
    ETHER_MASK should be equal to (1 << (ETHER_IRQ & 0x07))
  - if your board uses IRQ > 7 then in /usr/src/kernel/const.h change: 
	#define ETHER_VECTOR ((ETHER_IRQ & 0x07) + IRQ0_VECTOR)
    to:
	#define ETHER_VECTOR ((ETHER_IRQ & 0x07) + IRQ8_VECTOR)

3c. set your Ethernet board port number in /usr/src/kernel/const.h,
    for example if your board uses port 280h, you should set:
	#define ETHER_PORT	0x280

3d. if you have WD8003 or 3C503 board you should set board's
    shared memory base and size; for example if your board 
    is configured: RAM base C800h, size 8K, then you should set:
	#define ETHER_BASE	0xC8000L
	#define ETHER_SIZE	0x2000L



4. Recompile ioctl.c in /usr/src/lib/other and add it to the library:
	cd /usr/src/lib/other
	make f=ioctl
	ar r ioctl.s /usr/lib/libc.a


5. Recompile and build a new kernel image.
	cd /usr/src/kernel ; config at ; make
	cd /usr/src/fs ; make
	cd /usr/src/mm ; make
	cd /usr/src/tools ; make image


6. Reboot using newly created kernel image.


7. After loging in as root, create /dev/ether:
	mknod /dev/ether c 7 0
	chmod 0666 /dev/ether


8. Compile and run ethtest program from ./ethtest subdirectory:
	cc -o ethtest ethtest.c
	ethtest


9. Some commands and application programs that access kernel data
   structures via /dev/kmem need to be recompiled. The one I know is ps.


From now your PC has full access to your Ethernet network.  Enjoy it!

If you have previously installed TNET and you want it to use
/dev/ether, I suggest installing my patches from ./tnet subdirectory.
See ./tnet/README for details.
