+SClock
authorshort <>
Wed, 8 Oct 2003 05:58:47 +0000 (05:58 +0000)
committershort <>
Wed, 8 Oct 2003 05:58:47 +0000 (05:58 +0000)
12 files changed:
configure.ac
project/Makefile.am
project/QueryDev/ListItem.pm
project/QueryDev/QueryDev.README [new file with mode: 0644]
project/SClock/Index.html.pl [new file with mode: 0755]
project/SClock/ListItem.pm [new file with mode: 0755]
project/SClock/Makefile.am [new file with mode: 0644]
project/SClock/SClock.README [new file with mode: 0644]
project/SClock/SClock.asm [new file with mode: 0644]
project/SClock/SClock.lha [new file with mode: 0644]
project/ShortRel/ListItem.pm
project/ShortRel/ShortRel.README [new file with mode: 0644]

index 0c747e4..b7dbd11 100644 (file)
@@ -85,6 +85,7 @@ Makefile
 ./project/wayback/Makefile
 ./project/kewensis/Makefile
 ./project/QueryDev/Makefile
+./project/SClock/Makefile
 ])
 
 echo done.
index 8cdf6fc..80a52be 100644 (file)
@@ -68,7 +68,8 @@ SUBDIRS= \
                lynxilla        \
                wayback         \
                kewensis        \
-               QueryDev
+               QueryDev        \
+               SClock
 
 EXTRA_DIST+= \
                Index.html.pl \
index 6342d65..eec3300 100755 (executable)
@@ -34,6 +34,7 @@ our @ListItem=(
                "priority"=>3,
                "download"=>"QueryDev.lha",
                "link-source file"=>"QueryDev.asm",
+               "link-aminet README"=>"QueryDev.README",
                "summary"=>"Detect disk device name from its volume name",
                "license"=>"PD",
                "maintenance"=>"ready",
diff --git a/project/QueryDev/QueryDev.README b/project/QueryDev/QueryDev.README
new file mode 100644 (file)
index 0000000..2c34825
--- /dev/null
@@ -0,0 +1,14 @@
+Short:    Volume name -> device name
+Author:   short@k332.feld.cvut.cz (Jan Kratochvil)
+Uploader: short@k332.feld.cvut.cz (Jan Kratochvil)
+Type:     util/cli
+
+Description:
+   QueryDev  detects the device name from the given volume name.  Volume must
+be  locked in the system.  Useful for DiskCopy which has the parameter DEVICE
+and  you  want  to  copy  the  diskette  from any drive.  QueryDev writes the
+detected device name to the specified variable.
+
+Requirements:
+   Kickstart version V37 (2.04) or higher and ss.library V5.0 or higher (from
+package SSLib*.lha).
diff --git a/project/SClock/Index.html.pl b/project/SClock/Index.html.pl
new file mode 100755 (executable)
index 0000000..8d24758
--- /dev/null
@@ -0,0 +1,39 @@
+#! /usr/bin/perl
+# 
+# $Id$
+# Main page of 'My::Project::SClock'
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# 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; exactly version 2 of June 1991 is required
+# 
+# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+package project::SClock::Index;
+require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
+our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+our $CVS_ID=q$Id$;
+use strict;
+use warnings;
+
+BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
+use My::Web;
+Wuse 'My::Project';
+Wuse 'project::SClock::ListItem';
+
+
+My::Project->init_project(
+               "__PACKAGE__"=>__PACKAGE__,
+               "ListItem"=>\@project::SClock::ListItem::ListItem,
+               );
+
+My::Web->footer();
diff --git a/project/SClock/ListItem.pm b/project/SClock/ListItem.pm
new file mode 100755 (executable)
index 0000000..a1bec73
--- /dev/null
@@ -0,0 +1,52 @@
+#! /usr/bin/perl
+# 
+# $Id$
+# Definition of 'My::Project::SClock' for list.cgi.pl
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# 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; exactly version 2 of June 1991 is required
+# 
+# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+package project::SClock::ListItem;
+require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
+our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+our $CVS_ID=q$Id$;
+use strict;
+use warnings;
+
+use My::Web;
+
+
+our @ListItem=(
+               "name"=>"SClock",
+               "platform"=>"amiga",
+               "priority"=>3,
+               "download"=>"SClock.lha",
+               "link-source file"=>"SClock.asm",
+               "link-aminet README"=>"SClock.README",
+               "summary"=>"Detect disk device name from its volume name",
+               "license"=>"PD",
+               "maintenance"=>"ready",
+               "language"=>"680x0 asm",
+               "description"=><<"HERE",
+<p>SClock reads the current date and time from the remote machine and sets this
+time on the local machine. You can save this time to battery backed up clock,
+if present.</p>
+<p>In fact this is the same work as does the standard AmiTCP command SynClock,
+but SClock has no need for the TCP: device, the inet-handler and is much faster
+(no REXX).</p>
+HERE
+               );
+
+1;
diff --git a/project/SClock/Makefile.am b/project/SClock/Makefile.am
new file mode 100644 (file)
index 0000000..14bf2ee
--- /dev/null
@@ -0,0 +1,23 @@
+# $Id$
+# automake source for the Makefile of project/SClock/ subdir
+# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# 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; exactly version 2 of June 1991 is required
+# 
+# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+include $(top_srcdir)/Makefile-head.am
+
+EXTRA_DIST+= \
+       ListItem.pm \
+       Index.html.pl
diff --git a/project/SClock/SClock.README b/project/SClock/SClock.README
new file mode 100644 (file)
index 0000000..89d9b6b
--- /dev/null
@@ -0,0 +1,13 @@
+Short: Better AmiTCP SynClock (V37+&ss.lib)
+
+Description:
+   SClock  reads  the  current date and time from the remote machine and sets
+this  time on the local machine.  You can save this time to battery backed up
+clock, if present.
+   In  fact  this  is  the  same  work  as  does  the standard AmiTCP command
+SynClock,  but  SClock has no need for the TCP:  device, the inet-handler and
+is much faster (no REXX).
+
+Requirements:
+   Kickstart version V37 (2.04) or higher and ss.library V5.0 or higher (from
+package SSLib*.lha).
diff --git a/project/SClock/SClock.asm b/project/SClock/SClock.asm
new file mode 100644 (file)
index 0000000..950b55f
--- /dev/null
@@ -0,0 +1,144 @@
+;DEBUG equ     1
+
+TimePort       equ     13              ;Port of the "daytime" service
+
+       include "SSMac.h"
+
+       dbuf    Date,dat_SIZEOF
+       dbuf    DateStr,10
+       dbuf    TimeStr,9
+
+       start
+
+       get.l   Arg_Host,a0
+       call    bsdsocket,GetHostByName
+       moveq   #2,d2
+       tst.l   d0
+       beq     NetErrorVar
+       move.l  d0,a1
+       addq    #8,a1           ;h_(name|aliases)
+       move.l  (a1)+,d0        ;h_addrtype
+       subq.l  #2,d0           ;PF_INET
+       dtl     <Network protocol not supported>,a0
+       bne.s   ErrorSSNE1
+       move.l  (a1)+,d0        ;h_length
+       subq.l  #4,d0
+ErrorSSNE1     bne     ErrorSS
+       move.l  (a1),a1         ;h_addr_list
+       move.l  (a1),a1
+       move.l  (a1),d3         ;Address
+       moveq   #2,d0   ;AF_INET
+       moveq   #1,d1   ;SOCK_STREAM
+       moveq   #0,d2   ;?Why???
+       call    bsdsocket,Socket
+       move.l  d0,d4
+       bmi.s   NetErrorNE
+       clr.l   -(sp)           ;sin_zero
+       clr.l   -(sp)           ;sin_zero
+       push    d3              ;sin_addr.s_addr
+       move.l  #(4<<24)!(2<<16)!TimePort,-(sp) ;sin_(len|family|port)
+       move.l  sp,a0           ;sockaddr_in
+       moveq   #16,d1          ;sizeof(sockaddr_in)
+       call    Connect
+       tst.l   d0
+NetErrorNE     bne     NetError
+       lea     -24(sp),sp
+       move.l  sp,a0
+       moveq   #24,d1
+       moveq   #0,d2
+       move.l  d4,d0
+       call    Recv
+       move.l  d0,d2
+       addq.l  #1,d0
+       beq     NetError
+       moveq   #24,d1
+       dtl     <Invalid data received>,a0
+       cmp.l   d1,d0
+       bcs.s   ErrorSSNE1
+       lea     8(sp),a2
+       geta    DateStr,a1
+       put.l   a1,Date+dat_StrDate
+       move.w  (a2),(a1)+
+       move.l  -(a2),d0
+       moveq   #'-',d1
+       move.b  d1,d0
+       ror.l   #8,d0
+       move.l  d0,(a1)+
+       move.b  d1,(a1)+
+       lea     18(a2),a2
+       move.b  (a2)+,(a1)+
+       move.b  (a2),(a1)
+       addq    #2,a1
+       put.l   a1,Date+dat_StrTime
+       lea     11(sp),a2
+       moveq   #7,d0
+CopyTime       move.b  (a2)+,(a1)+
+       dbra    d0,CopyTime
+       geta    Date,a2
+       move.l  a2,d1
+       call    dos,StrToDate
+       tst.l   d0
+       bne.s   ConvOkay
+       dtl     <StrToDate("%s","%s")>,a0
+       geta    Date+dat_StrDate,a1
+       jump    ss,DosError
+
+ConvOkay       move.l  (a2)+,d0        ;ds_Days
+       move.l  #1440>>3,d1
+       lsl.l   #3,d1
+       call    utility,UMult32
+       add.l   (a2)+,d0        ;ds_Minute
+       moveq   #60,d1
+       call    UMult32
+       move.l  (a2),d1         ;ds_Tick
+       divu    #50,d1
+       ext.l   d1
+       add.l   d1,d0
+       move.l  d0,d2
+       dtl     <timer.device>,a0
+       move.w  #IOTV_SIZE,a1
+       moveq   #UNIT_VBLANK,d0
+       moveq   #0,d1
+       sub.l   a2,a2
+       call    ss,TrackDevice
+       move.w  #TR_SETSYSTIME,IO_COMMAND(a1)
+       move.l  d2,IOTV_TIME+TV_SECS(a1)
+       move.l  a1,a0
+       move.l  d1,a1
+       call    ChkDoIO
+       tstv.l  Arg_Save
+       beq.s   EXIT
+       dtl     <battclock.resource>,a1
+       push    a1
+       call    exec,OpenResource
+       move.l  sp,a1
+       dtl     <%s not found>,a0
+       tst.l   d0
+       beq.s   ErrorSS
+       move.l  d0,a6
+       move.l  d2,d0
+       call    WriteBattClock
+EXIT   jump    ss,ExitCleanup
+
+NetError       moveq   #0,d2
+NetErrorVar    clr.l   -(sp)
+       call    bsdsocket,Errno
+       push    d0
+       push    #$8000001C
+       add.l   d2,(sp)
+       move.l  sp,a0
+       call    SocketBaseTagList
+       addq    #4,sp
+       pop     a0
+       tst.l   d0
+       beq.s   ErrorSS
+ErrorUnknown   dtl     <Unknown net subsystem error>,a0
+ErrorSS        jump    ss,ExitError
+
+       tags
+       template <HOST/A,SAVE/S>
+       dv.l    Arg_Host
+       dv.l    Arg_Save
+       library bsdsocket,3
+       finish
+       end
diff --git a/project/SClock/SClock.lha b/project/SClock/SClock.lha
new file mode 100644 (file)
index 0000000..6ca5f03
Binary files /dev/null and b/project/SClock/SClock.lha differ
index 6b212ac..baf3fd9 100755 (executable)
@@ -34,6 +34,7 @@ our @ListItem=(
                "priority"=>4,
                "download"=>"ShortRel.lha",
                "link-source file"=>"ShortRel.asm",
+               "link-aminet README"=>"ShortRel.README",
                "aminet"=>"util/cli/ShortRel",
                "summary"=>"Executable file relocations compressor",
                "license"=>"PD",
diff --git a/project/ShortRel/ShortRel.README b/project/ShortRel/ShortRel.README
new file mode 100644 (file)
index 0000000..3bfa039
--- /dev/null
@@ -0,0 +1,16 @@
+Short:    32bit relocations <-> 16bit
+Author:   short@k332.feld.cvut.cz (Jan Kratochvil)
+Uploader: short@k332.feld.cvut.cz (Jan Kratochvil)
+Type:     util/cli
+
+Description:
+   ShortRel   loads   the  input  file  (must  be  an  executable),  converts
+relocations  (32-bit  to  16-bit  or vice versa), strips debug informaion (if
+requested)  and  writes  out  the result.  16-bit relocations use 2 bytes per
+each one and 32-bit relocations use 4 bytes.  So conversion of any executable
+with  many  relocations  from  32-bit to 16-bit relocations saves 2 bytes per
+each one.
+
+Requirements:
+   Kickstart  version 37 (2.04) or higher and ss.library V5.0 or higher (from
+package SSLib*.lha).