webserver: update the code a bit
This commit is contained in:
parent
d1ec1232dc
commit
61afe25161
|
@ -1,7 +1,6 @@
|
|||
PCX2HGR = ../hgr-utils/pcx2hgr
|
||||
DOS33 = ../dos33fs-utils/dos33
|
||||
TXT2BAS = ../asoft_basic-utils/tokenize_asoft
|
||||
SHAPETABLE = ../hgr-utils/shape_table
|
||||
MAKEB = ../dos33fs-utils/make_b
|
||||
|
||||
all: ethernet.dsk
|
||||
|
||||
|
@ -11,14 +10,16 @@ SETUP.BAS: setup.bas
|
|||
WEBSERVER.BAS: webserver.bas
|
||||
$(TXT2BAS) < webserver.bas > WEBSERVER.BAS
|
||||
|
||||
R.TXT: request.txt
|
||||
$(MAKEB) request.txt R.TXT 0xc000
|
||||
|
||||
ethernet.dsk: SETUP.BAS \
|
||||
WEBSERVER.BAS \
|
||||
R.TXT
|
||||
$(DOS33) -y ethernet.dsk SAVE A SETUP.BAS
|
||||
$(DOS33) -y ethernet.dsk SAVE A WEBSERVER.BAS
|
||||
$(DOS33) -y ethernet.dsk SAVE T R.TXT
|
||||
$(DOS33) -y ethernet.dsk SAVE B R.TXT
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *~ *.BAS
|
||||
rm -f *~ *.BAS R.TXT
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Working on getting the Uthernet II card to do something interesting.
|
||||
|
|
@ -1,39 +1,43 @@
|
|||
1 REM *** Setup UTHERNET II - W5100
|
||||
2 REM *** Assumes slot 5 ($C0D0)
|
||||
3 SLOT=49360: REM *** $C0D0
|
||||
4 MR=SLOT+4: REM *** MODE REGISTER C0D4
|
||||
5 HA=SLOT+5:LA=SLOT+6: REM *** HIGH/LOW ADDR $C0D5,$C0D6
|
||||
7 DP=SLOT+7: REM *** DATA PORT $C0D7
|
||||
10 REM *** Init W5100
|
||||
12 POKE 49364,128 : REM RESET W5100
|
||||
14 POKE 49364,3 : REM AUTOINCREMENT
|
||||
12 POKE MR,128 : REM RESET W5100
|
||||
14 POKE MR,3 : REM AUTOINCREMENT
|
||||
20 REM *** Setup MAC Address
|
||||
21 REM *** 41:50:50:4c:45:32
|
||||
22 POKE 49365,0:POKE 49366,9
|
||||
23 POKE 49367,65
|
||||
23 POKE 49367,80
|
||||
23 POKE 49367,80
|
||||
23 POKE 49367,76
|
||||
23 POKE 49367,69
|
||||
23 POKE 49367,50
|
||||
22 POKE HA,0:POKE LA,9
|
||||
23 POKE DP,65
|
||||
23 POKE DP,80
|
||||
23 POKE DP,80
|
||||
23 POKE DP,76
|
||||
23 POKE DP,69
|
||||
23 POKE DP,50
|
||||
30 REM *** Setup IP Address
|
||||
31 REM *** 192.168.8.15
|
||||
32 POKE 49366,15
|
||||
33 POKE 43367,192
|
||||
34 POKE 43367,168
|
||||
35 POKE 43367,8
|
||||
36 POKE 43367,15
|
||||
32 POKE LA,15
|
||||
33 POKE DP,192
|
||||
34 POKE DP,168
|
||||
35 POKE DP,8
|
||||
36 POKE DP,15
|
||||
40 PRINT "UTHERNET II READY: 192.168.8.15"
|
||||
100 *** Setup Socket
|
||||
105 POKE 43365,0:POKE 43366,26: REM RX MEMSIZE
|
||||
110 POKE 43367,3: REM 8kB RX buffer
|
||||
115 POKE 43367,3: REM 8kB TX buffer
|
||||
|
||||
'START:
|
||||
'/* sets TCP mode */
|
||||
'Sn_MR = 0x01;
|
||||
'/* sets source port number */
|
||||
'Sn_PORT = source_port;
|
||||
'/* sets OPEN command */
|
||||
'Sn_CR = OPEN;
|
||||
100 REM *** Setup Socket
|
||||
105 POKE HA,0:POKE LA,26: REM RX MEMSIZE
|
||||
110 POKE DP,3: REM 8kB RX buffer
|
||||
115 POKE DP,3: REM 8kB TX buffer
|
||||
200 REM *** Setup TCP MODE on SOCKET 0
|
||||
205 POKE HA,4: POKE LA,0: REM *** 0x400 mode
|
||||
210 POKE DP,65 : REM *** 0x41 MAC FILTER (non-promisc) TCP
|
||||
300 REM ** Setup Source PORT
|
||||
305 POKE HA,4: POKE LA,3: REM *** 0x404 port
|
||||
310 POKE DP, 80: REM *** http port 80
|
||||
400 REM *** OPEN socket
|
||||
405 POKE HA,4: POKE LA,1: REM *** 0x401 command register
|
||||
410 POKE DP, 1: REM *** OPEN
|
||||
500 REM *** Check if opened
|
||||
'if (Sn_SR != SOCK_INIT) Sn_CR = CLOSE; goto START;
|
||||
'}
|
||||
'{
|
||||
'If (Sn_SR == SOCK_ESTABLISHED) goto ESTABLISHED stage;
|
||||
|
||||
' CALL LISTEN
|
||||
|
|
Loading…
Reference in New Issue