/**************************************************************************** OS/A65 Version 1.4.0 Multitasking Operating System for 6502 Computers Copyright (C) 1989-1997 Andre Fachat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ****************************************************************************/ /**********************************************************************/ /* SLIP/TCP */ /* Serial Line Internet Protocol Driver */ /* */ /* Driver connects STDIN/OUT with a serial line internet protocol */ /* */ /* Options: */ /* ROM */ /* NOPRG */ /* */ /**********************************************************************/ #define C64 #define NOMMU #ifndef MY_IP /*#define MY_IP 192,168,0,13*/ #define MY_IP 193,197,89,64 #endif #ifndef FSTCP_SERVER_IP #define FSTCP_SERVER_IP 192,168,0,1 #endif #ifndef FSTCP_SERVER_PORT #define FSTCP_SERVER_PORT 8090 #endif #ifndef WWW_DRV #define WWW_DRV 2 #define WWW_DEFAULT "index.html" #define WWW_PATH 0 #endif /* One of these two _must_ be defined. They don't work together! */ #define NO_FSTCP /* if defined, do not use fstcp */ #undef NO_WWW /* if defined, do not use www server */ #define MAXOQUEUE 4 #define INBUF 64 #define MTU 1024 #define MAXSLOT 16 #define IPBUFFER 32*256 /* must be within one (4k) page for MMU! */ #define DEBUGMEM /**********************************************************************/ #ifndef ROM #define DEBUG /*#define DEBUGMEM*/ /*#define DEBUGPKT*/ #if 1 #define DB(A) .(:jmp ll0:ll1 .byt A,0:ll0 lda #ll1:jsr ETxtout:.): #else #define DB(a) #endif #ifdef C64 #define STDIOADDR $f000 #endif #include "kernel.i65" #include "oa1str.i65" #include "oa1fs.i65" #include "stdlib/stdio.a65" ;PRGSTART =$4000 #endif /* ROM */ #ifndef SLIPDEV #define SLIPDEV 0 #endif #define balloc Balloc #define getblen Getblen #define getbadr Getbadr #define btrunc Btrunc #define bfree Bfree #define incownr Incownr /**********************************************************************/ .( #ifdef ROM .word PRGEND .byt PK_PRG .byt 8 .byt SLIPDEV,SLIPDEV .word PRG #ifndef ROMTEST .byt $8,$8,$9,$9,$a,$a,$b,$b,$c,$c,$d,$d,$e,$e,<-1 #else .byt $c,$1c,$d,$1d,$e,$1e,<-1 #endif /* ROMTEST */ .byt "shell",0,"shell b c:auto.bat",0 #else /* ROM */ /*------------------------------------------------------------------------*/ #ifndef NOPRG ;.word $800 ; *=PRGSTART PRGSTART .word 0 .byt PK_PRG .byt 8 .word 0 .word PRG .byt <-1 #else .word PRGSTART *=PRGSTART #endif /* NOPRG */ #endif /* ROM */ /**********************************************************************/ .data owntask .byt 0 sendbuf .byt 0 ; !=0 when WWW server reads file -> filesystem doesn't listen .text PRG .( stx owntask lda #0 sta sendbuf #if 0 jsr binit bcs exit DB("^m^jbinit ") #endif jsr oinit bcs exit DB("oinit ") jsr iinit bcs exit DB("iinit ") jsr tcpinit bcs exit DB("tcpinit ") jmp doloop exit rts doloop jsr loopin jsr loopout jsr tcploop #ifndef NO_FSTCP jsr fstcp_mloop #endif jsr SUSPEND jmp doloop .) MyIP .byt MY_IP #include "sltcp.def" #include "slipi.a65" #include "slipo.a65" /* protocols can share same variables */ .( .zero pp .word 0 pd .word 0 .data pslot .byt 0 phl .byt 0 ppl .word 0 pdl .word 0 .text #include "icmp.a65" #include "tcp.a65" #include "putil.a65" .) /* mem routines went to stdlib! */ /*#include "mem.a65"*/ #include "util.a65" PRGEND .)