mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-03-20 03:31:27 +00:00
Add online volume call and more tftp scripts
This commit is contained in:
parent
1dc0d252f8
commit
e2d1fb3ba4
src
@ -46,6 +46,7 @@ import fileio
|
||||
word create
|
||||
word destroy
|
||||
word newline
|
||||
word online
|
||||
word readblock
|
||||
word writeblock
|
||||
end
|
||||
|
@ -35,19 +35,20 @@ struc t_fileio
|
||||
word create
|
||||
word destroy
|
||||
word newline
|
||||
word online
|
||||
word readblock
|
||||
word writeblock
|
||||
end
|
||||
predef a2getpfx(path), a23setpfx(path), a2getfileinfo(path, fileinfo), a23geteof(refnum), a2iobufs(iobufs), a2open(path), a2close(refnum)
|
||||
predef a23read(refnum, buf, len), a2write(refnum, buf, len), a2create(path, type, aux), a23destroy(path)
|
||||
predef a2newline(refnum, emask, nlchar), a2readblock(unit, buf, block), a2writeblock(unit, buf, block)
|
||||
predef a2newline(refnum, emask, nlchar), a2online(unit, buf), a2readblock(unit, buf, block), a2writeblock(unit, buf, block)
|
||||
//
|
||||
// Exported function table.
|
||||
//
|
||||
word fileio[]
|
||||
word = @a2getpfx, @a23setpfx, @a2getfileinfo, @a23geteof, @a2iobufs, @a2open, @a2close
|
||||
word = @a23read, @a2write, @a2create, @a23destroy
|
||||
word = @a2newline, @a2readblock, @a2writeblock
|
||||
word = @a2newline, @a2online, @a2readblock, @a2writeblock
|
||||
//
|
||||
// SOS/ProDOS error code
|
||||
//
|
||||
@ -325,6 +326,57 @@ def a3newline(refnum, emask, nlchar)
|
||||
perr = syscall($C9, @params)
|
||||
return perr
|
||||
end
|
||||
def a1online(unit, buf)
|
||||
perr = $27 // IOERR
|
||||
return perr
|
||||
end
|
||||
def a2online(unit, buf)
|
||||
byte params[4]
|
||||
|
||||
params.0 = 2
|
||||
params.1 = unit
|
||||
params:2 = buf
|
||||
perr = syscall($C5, @params)
|
||||
return perr
|
||||
end
|
||||
def a3volume(unit, volname)
|
||||
byte devname[17]
|
||||
byte info[11]
|
||||
byte params[9]
|
||||
|
||||
^volname = 0
|
||||
params.0 = 4
|
||||
params.1 = unit
|
||||
params:2 = @devname
|
||||
params:4 = @info
|
||||
params.6 = 11
|
||||
if syscall($85, @params) == 0
|
||||
params.0 = 4
|
||||
params:1 = @devname
|
||||
params:3 = volname
|
||||
params:5 = 0
|
||||
params:7 = 0
|
||||
return syscall($C5, @params)
|
||||
fin
|
||||
return -1
|
||||
end
|
||||
def a3online(unit, buf)
|
||||
byte info[11]
|
||||
byte volname[17]
|
||||
byte i
|
||||
|
||||
if unit == 0
|
||||
for i = $01 to $0F
|
||||
if a3volume(i, buf) == 0
|
||||
^buf = ^buf | (i << 4)
|
||||
fin
|
||||
buf = buf + 16
|
||||
next
|
||||
else
|
||||
return a3volume(unit, buf)
|
||||
fin
|
||||
return 0
|
||||
end
|
||||
def a13readblock(unit, buf, block)
|
||||
perr = $27 // IOERR
|
||||
return perr
|
||||
@ -366,6 +418,7 @@ when MACHID & MACHID_MODEL
|
||||
fileio:write = @a3write
|
||||
fileio:create = @a3create
|
||||
fileio:newline = @a3newline
|
||||
fileio:online = @a3online
|
||||
fileio:readblock = @a13readblock
|
||||
fileio:writeblock = @a13writeblock
|
||||
break
|
||||
@ -382,6 +435,7 @@ when MACHID & MACHID_MODEL
|
||||
fileio:create = @a1create
|
||||
fileio:destroy = @a1destroy
|
||||
fileio:newline = @a1newline
|
||||
fileio:online = @a1online
|
||||
fileio:readblock = @a13readblock
|
||||
fileio:writeblock = @a13writeblock
|
||||
break
|
||||
|
@ -354,10 +354,26 @@ def servUDP(ipsrc, portsrc, data, len, param)
|
||||
return 0
|
||||
end
|
||||
|
||||
def volumes#0
|
||||
word strbuf
|
||||
byte i
|
||||
|
||||
strbuf = heapmark()
|
||||
fileio:online(0, strbuf)
|
||||
for i = 0 to 15
|
||||
^strbuf = ^strbuf & $0F
|
||||
if ^strbuf
|
||||
putc('/'); puts(strbuf); putln()
|
||||
fin
|
||||
strbuf = strbuf + 16
|
||||
next
|
||||
end
|
||||
|
||||
puts("TFTP Server Version 2.0 Dev\n")
|
||||
if !iNet:initIP()
|
||||
return -1
|
||||
fin
|
||||
puts("TFTP Server Version 2.0 Dev\n")
|
||||
puts("Online volumes:\n"); volumes()
|
||||
portTFTP = iNet:openUDP(TFTP_PORT, @servUDP, 0)
|
||||
//
|
||||
// Alloc aligned file/io buffers
|
||||
@ -370,6 +386,7 @@ buff=>datOp = $0300 // Data op
|
||||
repeat
|
||||
iNet:serviceIP()
|
||||
until conio:keypressed()
|
||||
getc // eat keypress
|
||||
done
|
||||
|
||||
Experpts from: RFC 1350, TFTP Revision 2, July 1992
|
||||
|
@ -32,3 +32,4 @@ echo "BLD/MOUSETEST.PLA"; atftp $1 --put -l samplesrc/mousetest.pla -r $2/BLD/MO
|
||||
echo "BLD/HTTPD.PLA"; atftp $1 --put -l samplesrc/httpd.pla -r $2/BLD/HTTPD.PLA#040000
|
||||
echo "BLD/LZ4CAT.PLA"; atftp $1 --put -l samplesrc/lz4cat.pla -r $2/BLD/LZ4CAT.PLA#040000
|
||||
echo "BLD/ROD.PLA"; atftp $1 --put -l samplesrc/rod.pla -r $2/BLD/ROD.PLA#040000
|
||||
echo "BLD/RPNCALC.PLA"; atftp $1 --put -l samplesrc/rpncalc.pla -r $2/BLD/RPNCALC.PLA#040000
|
||||
|
@ -1,4 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Net demos
|
||||
echo "RPNCALC"; atftp $1 --put -l rel/RPNCALC#FE1000 -r $2/DEMOS/RPNCALC#FE1000
|
||||
echo "NET/TFTPD"; atftp $1 --put -l rel/TFTPD#FE1000 -r $2/DEMOS/NET/TFTPD#FE1000
|
||||
echo "NET/HTTPD"; atftp $1 --put -l rel/HTTPD#FE1000 -r $2/DEMOS/NET/HTTPD#FE1000
|
||||
atftp $1 --put -l samplesrc/index.html -r $2/DEMOS/NET/INDEX.HTML#040000
|
||||
|
6
src/tftprel
Executable file
6
src/tftprel
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
./tftpsys $1 $2
|
||||
./tftpsane $1 $2
|
||||
./tftpbld $1 $2
|
||||
./tftpdemos $1 $2
|
8
src/tftpsane
Executable file
8
src/tftpsane
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# SANE libraries
|
||||
echo "SYS/SANE"; atftp $1 --put -l rel/SANE#FE1000 -r $2/SYS/SANE#FE1000
|
||||
echo "SYS/FPSTR"; atftp $1 --put -l rel/FPSTR#FE1000 -r $2/SYS/FPSTR#FE1000
|
||||
echo "SYS/FPU"; atftp $1 --put -l rel/FPU#FE1000 -r $2/SYS/FPU#FE1000
|
||||
echo "SYS/FP6502.CODE"; atftp $1 --put -l ../sysfiles/FP6502.CODE#060000 -r $2/SYS/FP6502.CODE#060000
|
||||
echo "SYS/ELEMS.CODE"; atftp $1 --put -l ../sysfiles/ELEMS.CODE#060000 -r $2/SYS/ELEMS.CODE#060000
|
@ -17,13 +17,10 @@ echo "SYS/ED"; atftp $1 --put -l rel/ED#FE1000 -r $2/SYS/ED#FE1000
|
||||
echo "SYS/ETHERIP"; atftp $1 --put -l rel/ETHERIP#FE1000 -r $2/SYS/ETHERIP#FE1000
|
||||
echo "SYS/MOUSE"; atftp $1 --put -l rel/apple/MOUSE#FE1000 -r $2/SYS/MOUSE#FE1000
|
||||
echo "SYS/FIBER"; atftp $1 --put -l rel/FIBER#FE1000 -r $2/SYS/FIBER#FE1000
|
||||
echo "SYS/FPSTR"; atftp $1 --put -l rel/FPSTR#FE1000 -r $2/SYS/FPSTR#FE1000
|
||||
echo "SYS/FPU"; atftp $1 --put -l rel/FPU#FE1000 -r $2/SYS/FPU#FE1000
|
||||
echo "SYS/INET"; atftp $1 --put -l rel/INET#FE1000 -r $2/SYS/INET#FE1000
|
||||
echo "SYS/LONGJUMP"; atftp $1 --put -l rel/LONGJMP#FE1000 -r $2/SYS/LONGJMP#FE1000
|
||||
echo "SYS/LZ4"; atftp $1 --put -l rel/LZ4#FE1000 -r $2/SYS/LZ4#FE1000
|
||||
echo "SYS/MEMMGR"; atftp $1 --put -l rel/MEMMGR#FE1000 -r $2/SYS/MEMMGR#FE1000
|
||||
echo "SYS/SANE"; atftp $1 --put -l rel/SANE#FE1000 -r $2/SYS/SANE#FE1000
|
||||
echo "SYS/CONIO"; atftp $1 --put -l rel/apple/CONIO#FE1000 -r $2/SYS/CONIO#FE1000
|
||||
echo "SYS/DGR"; atftp $1 --put -l rel/apple/DGR#FE1000 -r $2/SYS/DGR#FE1000
|
||||
echo "SYS/FILEIO"; atftp $1 --put -l rel/apple/FILEIO#FE1000 -r $2/SYS/FILEIO#FE1000
|
||||
|
Loading…
x
Reference in New Issue
Block a user