Browse Source

Import GeckOS 2.0.8

tags/2.0.8
maze 4 months ago
parent
commit
86d612147a
98 changed files with 14730 additions and 7911 deletions
  1. BIN
      arch/c64/boot/charom
  2. 1
    0
      arch/c64/boot/charom
  3. BIN
      arch/c64/boot/gen
  4. 1
    0
      arch/c64/boot/gen
  5. 8
    8
      arch/c64/c64rom.a65
  6. 1
    0
      arch/c64/devices/c64dev.a65
  7. 4
    2
      arch/c64/devices/ser_acia1.a65
  8. 6
    2
      arch/c64/kernel/kenv.a65
  9. 22
    5
      arch/csa65/Makefile
  10. 6
    3
      arch/csa65/apps/Makefile
  11. 6
    3
      arch/csa65/boot/Makefile
  12. 5
    0
      arch/csa65/boot/README
  13. BIN
      arch/csa65/boot/csaold
  14. 1
    0
      arch/csa65/boot/fsibm
  15. 7
    2
      arch/csa65/boot/inirom.a65
  16. 1
    0
      arch/csa65/boot/ramdisk
  17. 73
    15
      arch/csa65/csarom.a65
  18. 362
    0
      arch/csa65/csarom.old
  19. 266
    0
      arch/csa65/csarom2.a65
  20. 1296
    0
      arch/csa65/devices/drv_wd1770.a65
  21. 20
    0
      arch/csa65/foo
  22. 46
    0
      arch/csa65/sysapps/Makefile
  23. 4
    0
      arch/csa65/sysapps/foo
  24. 9
    0
      arch/csa65/sysapps/fsibm.a65
  25. 1
    0
      arch/csa65/sysapps/mkdisk
  26. 0
    402
      arch/embedded/kernel/kenv.a65
  27. 1
    0
      arch/embedded/kernel/kenv.a65
  28. 6
    1
      arch/embedded/kernel/kinit.a65
  29. 4
    6
      arch/embedded/rom.a65
  30. 0
    402
      arch/gecko/kernel/kenv.a65
  31. 1
    0
      arch/gecko/kernel/kenv.a65
  32. 0
    313
      arch/pet32k/devices/kbd_pet.a65
  33. 1
    0
      arch/pet32k/devices/kbd_pet.a65
  34. 0
    366
      arch/pet32k/devices/piec_pet.a65
  35. 1
    0
      arch/pet32k/devices/piec_pet.a65
  36. 0
    402
      arch/proto/kernel/kenv.a65
  37. 1
    0
      arch/proto/kernel/kenv.a65
  38. 53
    8
      devices/console.a65
  39. 304
    0
      devices/scsi.a65
  40. 353
    0
      devices/scsi/COPYING
  41. 24
    0
      devices/scsi/Makefile
  42. 136
    0
      devices/scsi/README
  43. 778
    0
      devices/scsi/csascsi1.a65
  44. 1405
    0
      devices/scsi/csascsi1.fig
  45. BIN
      devices/scsi/csascsi1.gif
  46. 2849
    0
      devices/scsi/csascsi1.ps
  47. 35
    0
      devices/scsi/csascsi1desc.txt
  48. 23
    0
      devices/scsi/csascsi1parts.txt
  49. 109
    0
      devices/scsi/main.a65
  50. 80
    0
      devices/scsi/paccess.a65
  51. 36
    0
      devices/scsi/part.i65
  52. 372
    0
      devices/scsi/pcpart.a65
  53. 68
    0
      devices/scsi/printc64.a65
  54. 90
    0
      devices/scsi/printcsa.a65
  55. 582
    0
      devices/scsi/ramdscsi.a65
  56. 2
    2
      devices/ser_acia.a65
  57. 0
    339
      doc/COPYING
  58. 1
    0
      doc/COPYING
  59. 44
    0
      doc/LOG-2.0
  60. 0
    59
      doc/README.lsh
  61. 1
    0
      doc/README.lsh
  62. 33
    0
      doc/TODO
  63. 5
    4
      doc/index.html
  64. 6
    0
      doc/kernel.html
  65. 2
    0
      include/kdefs.i65
  66. 0
    140
      include/kernel.i65
  67. 1
    0
      include/kernel.i65
  68. 0
    244
      include/lib6502.i65
  69. 1
    0
      include/lib6502.i65
  70. 5
    1
      kernel/devices.a65
  71. 9
    2
      kernel/init.a65
  72. 9
    2
      kernel/tasks.a65
  73. 2
    2
      lib6502/libexec.a65
  74. 1
    0
      lib6502/libglob.a65
  75. 3
    0
      lib6502/libjmp.a65
  76. 11
    9
      sysapps/fs/Makefile
  77. 27
    5040
      sysapps/fs/fsibm.a65
  78. 21
    0
      sysapps/fs/fsibm/Makefile
  79. 519
    0
      sysapps/fs/fsibm/buffer.a65
  80. 713
    0
      sysapps/fs/fsibm/cluster.a65
  81. 887
    0
      sysapps/fs/fsibm/cmd.a65
  82. 193
    0
      sysapps/fs/fsibm/defs.a65
  83. 288
    0
      sysapps/fs/fsibm/drive.a65
  84. 170
    0
      sysapps/fs/fsibm/drv_ramd1.a65
  85. 259
    0
      sysapps/fs/fsibm/drv_ramd2.a65
  86. 944
    0
      sysapps/fs/fsibm/file.a65
  87. 183
    0
      sysapps/fs/fsibm/loop.a65
  88. 648
    0
      sysapps/fs/fsibm/util.a65
  89. 47
    0
      sysapps/fs/fsibm/vars.a65
  90. 6
    12
      sysapps/fs/fsiec.a65
  91. 6
    3
      sysapps/init/Makefile
  92. 161
    7
      sysapps/init/init.a65
  93. 3
    3
      sysapps/irtx/irtx.a65
  94. 12
    0
      sysapps/magic/Makefile
  95. 47
    0
      sysapps/magic/magic.a65
  96. 1
    1
      sysapps/mon/shdir.a65
  97. 0
    101
      sysapps/slipd/oa1fs.h
  98. 1
    0
      sysapps/slipd/oa1fs.h

BIN
arch/c64/boot/charom View File


+ 1
- 0
arch/c64/boot/charom View File

@@ -0,0 +1 @@
1
+../../csa65/boot/charom

BIN
arch/c64/boot/gen View File


+ 1
- 0
arch/c64/boot/gen View File

@@ -0,0 +1 @@
1
+/site/WWW/root/cbm/own/e1/@GEN.$4000:A,P

+ 8
- 8
arch/c64/c64rom.a65 View File

@@ -61,8 +61,10 @@
61 61
 
62 62
 
63 63
 				/* if you have a 16550A UART with FIFO */
64
-#define	UARTBASE	$d600
65
-#undef	ACIABASE	$d600
64
+#undef	UARTBASE	$d600
65
+#define ACIABASE	$d600
66
+/* #define ACIABASE	$df00 */
67
+
66 68
 #define	UARTXTAL	4 	/*  xtal is 4 times 1.8324 MHz */
67 69
 
68 70
 #define	MEMINIVAL	0	/* Clear memory to 0 on boot */
@@ -138,20 +140,18 @@
138 140
 		   and a nullmodem cable between /dev/modem (VICE) and 
139 141
 		   a slip line */
140 142
 
141
-#define	PARALLEL
143
+#undef	PARALLEL
142 144
 #undef	OLDHACK
143 145
 
144 146
 #undef 	UARTBASE
145
-#define	ACIABASE	$d600
147
+#undef 	ACIABASE
146 148
 #undef 	UARTXTAL
147 149
 
148 150
 #undef BOOTDRV
149
-#define	BOOTDRV		"f"
150 151
 
151 152
 #undef WWWDRV
152
-#define	WWWDRV		"f"
153 153
 
154
-#endif	/* ANDRE */
154
+#endif	/* EMUSLIP */
155 155
 
156 156
 /***************************************************************************
157 157
  * 
@@ -247,7 +247,7 @@ end_slipd
247 247
 
248 248
 /************* boot lsh from BOOTDRV			*/
249 249
 
250
-#if 1
250
+#ifdef BOOTDRV
251 251
 
252 252
 	/* add autostart of lib6502 program 'lsh' */
253 253
 

+ 1
- 0
arch/c64/devices/c64dev.a65 View File

@@ -73,6 +73,7 @@ devstart
73 73
 #include  "devices/ser_9600.a65" ; fast serial interface by Daniel Dallmann
74 74
 
75 75
 #ifdef ACIABASE
76
+#print ACIABASE
76 77
 #include  "devices/ser_acia.a65"
77 78
 #endif
78 79
 

+ 4
- 2
arch/c64/devices/ser_acia1.a65 View File

@@ -43,12 +43,14 @@
43 43
  * can be checked independently.
44 44
  */
45 45
 
46
-#ifdef C64ACIA
47
-#define	ACIA	C64ACIA
46
+#ifdef ACIABASE
47
+#define	ACIA	ACIABASE
48 48
 #else
49 49
 #define ACIA	$d600
50 50
 #endif
51 51
 
52
+#print ACIA
53
+
52 54
 #define	Anzdev	1
53 55
 
54 56
           .(

+ 6
- 2
arch/c64/kernel/kenv.a65 View File

@@ -270,10 +270,10 @@ mtask	.)
270 270
           sei
271 271
           dec Syscnt     ; wieder in Task 
272 272
           bne mtask      ; nein dann Ende
273
-
273
+#ifndef NO_DEVICE
274 274
           bit adev       ; Ruecksprung in Device
275 275
           bpl mtask      ; ja dann Ende
276
- 
276
+#endif 
277 277
           sty YR         ; sonst Task-Env setzen
278 278
           stx XR
279 279
           sta AC
@@ -307,9 +307,13 @@ mtask
307 307
           lda Syscnt
308 308
           inc Syscnt
309 309
           cmp #0
310
+#ifdef NO_DEVICE
311
+          beq msys
312
+#else
310 313
           bne mse
311 314
           bit adev       ; called by device
312 315
           bmi msys       ; no then save stack
316
+#endif
313 317
 mse       pla
314 318
           plp
315 319
           rts

+ 22
- 5
arch/csa65/Makefile View File

@@ -1,16 +1,33 @@
1 1
 
2
-TRG=boot/csarom
3 2
 
4
-XA=xa
3
+XA=xa #-2.1.4h
4
+
5 5
 FILE=file65
6 6
 RELOC=reloc65
7 7
 
8
-csa ${TRG}: # $(wildcard *.a65)
8
+all: boot/csarom boot/csarom2
9
+
10
+redo:
11
+	rm -f boot/csarom
12
+	make
13
+	cp boot/csarom /site/mystuff/var/lptiec
14
+	cat foo
15
+
16
+boot/csaold: csarom.old
17
+	${XA} -I../.. -I../../include -bt 32768 \
18
+		csarom.old -o boot/csaold -l csaold.lab
19
+
20
+csa boot/csarom: csarom.a65
21
+	${XA} -I../.. -I../../include -bt 32768 \
22
+		csarom.a65 -o boot/csarom -l csarom.lab
23
+
24
+boot/csarom2: csarom2.a65
9 25
 	${XA} -I../.. -I../../include -bt 32768 \
10
-		csarom.a65 -o ${TRG} -l csarom.lab
26
+		csarom2.a65 -o boot/csarom2 -l csarom2.lab
11 27
 
12 28
 clean:
13
-	rm -f ${TRG} csarom.lab csarom
29
+	rm -f csarom.lab csarom2.lab csaold.lab
14 30
 	(cd boot; ${MAKE} clean ;)
15 31
 	(cd apps; ${MAKE} clean ;)
32
+	(cd sysapps; ${MAKE} clean ;)
16 33
 

+ 6
- 3
arch/csa65/apps/Makefile View File

@@ -4,9 +4,12 @@ XAINPUT=../../../include,../../..
4 4
 XA=xa
5 5
 
6 6
 irtx.o65: irtx.a65
7
-	(XAINPUT=${XAINPUT}; export XAINPUT;\
8
-	${XA} -DKERNEL=61440 -c irtx.a65 -o irtx.o65 ;\
9
-	if [ $$? -ne 0 ]; then rm -f irtx.o65; fi; )
7
+	xa -I../../../include -I../../.. -R -LLIB6502 -LOSA2KERNEL $< -o $@
8
+
9
+# irtx.o65: irtx.a65
10
+# 	(XAINPUT=${XAINPUT}; export XAINPUT;\
11
+# 	${XA} -DKERNEL=61440 -c irtx.a65 -o irtx.o65 ;\
12
+# 	if [ $$? -ne 0 ]; then rm -f irtx.o65; fi; )
10 13
 
11 14
 clean:
12 15
 	rm -f irtx.o65

+ 6
- 3
arch/csa65/boot/Makefile View File

@@ -2,10 +2,13 @@
2 2
 XAINPUT=../../../include
3 3
 XA=xa
4 4
 
5
-all: inirom csarom
5
+all: inirom csarom csarom2
6 6
 
7 7
 csarom:
8
-	(cd ..; ${MAKE};)
8
+	(cd ..; ${MAKE} boot/csarom;)
9
+
10
+csarom2:
11
+	(cd ..; ${MAKE} boot/csarom2;)
9 12
 
10 13
 inirom: inirom.a65
11 14
 	(XAINPUT=${XAINPUT}; export XAINPUT;\
@@ -13,5 +16,5 @@ inirom: inirom.a65
13 16
 	if [ $$? -ne 0 ]; then rm -f inirom; fi)
14 17
 
15 18
 clean:
16
-	rm -f csarom inirom
19
+	rm -f csarom csarom2 inirom
17 20
 

+ 5
- 0
arch/csa65/boot/README View File

@@ -0,0 +1,5 @@
1
+
2
+When using the patched-up VICE xcsa emulator, use the commandline:
3
+
4
+    ~/vice/src/vice-0.12.0.16-csa-22/src/xcsa -kernal ./csaold -speed 200
5
+

BIN
arch/csa65/boot/csaold View File


+ 1
- 0
arch/csa65/boot/fsibm View File

@@ -0,0 +1 @@
1
+../sysapps/fsibm

+ 7
- 2
arch/csa65/boot/inirom.a65 View File

@@ -36,7 +36,8 @@ l1        =$0
36 36
           sta l1
37 37
 l2        ldx l1
38 38
           lda #DC_EXIT
39
-          jsr DEVCMD
39
+;          jsr DEVCMD
40
+;.byt 2
40 41
           inc l1
41 42
           lda l1
42 43
           cmp #16
@@ -49,7 +50,7 @@ l2        ldx l1
49 50
 
50 51
           sei			; remap MMU pages 8-15 with values from 
51 52
           ldx #7		; 4 to b
52
-l3        lda $eff1,x
53
+l3        lda $eff2,x
53 54
           sta $eff8,x
54 55
           dex
55 56
           bpl l3
@@ -66,6 +67,10 @@ l5        lda data,x
66 67
           sta $1000,x
67 68
           inx
68 69
           bne l5
70
+
71
+	lda SYSPORT
72
+	and #$ff-SYS_LED
73
+	sta SYSPORT
69 74
           
70 75
           jmp $1000		; and jump there
71 76
           

+ 1
- 0
arch/csa65/boot/ramdisk View File

@@ -0,0 +1 @@
1
+/m/sdb8/tmp/dev.image

+ 73
- 15
arch/csa65/csarom.a65 View File

@@ -33,16 +33,22 @@
33 33
 
34 34
 /* These are changeable ****************************************************/
35 35
 
36
-#define	FSIEC_PARALLEL
36
+#define	DEBUGFS 	/* FSIBM debug */
37
+#define	FSIBM_SECTOR24BIT
38
+
39
+#define	CSA_CONSOLE	0	/* device to output debug/log messages */
40
+
41
+#undef	FSIEC_PARALLEL
37 42
 #undef	FSIEC_SERIAL
38
-#undef	FSIBM
43
+#define	FSIBM
44
+#undef	MONSH
39 45
 #define	USE_LIB6502
40 46
 
41 47
 #define	NEED_CHECKCHLD		/* this is necessary if using "init" or 
42 48
 				   lib6502 */
43 49
 #define	NEED_GETINFO
44 50
 
45
-/* #define   ROMTEST */		/* debug option */
51
+#undef   ROMTEST		/* debug option */
46 52
 /* #define   EMUTEST */		/* debug option */
47 53
 /* #define   SYSPAGE	$12 */	/* debug option */
48 54
 
@@ -56,6 +62,11 @@
56 62
 
57 63
 #define	RAMEND		$80	/* 32k in bank 0 */
58 64
 
65
+#define	CLK2MHZ
66
+
67
+#undef	BOOTDRV	"c"
68
+
69
+
59 70
 /***************************************************************************
60 71
  * 
61 72
  * Better not change anything below 
@@ -98,6 +109,13 @@
98 109
   Therefore they all get their own zero, data and bss addresses.
99 110
 
100 111
 */
112
+
113
+
114
+#echo ############ magic
115
+
116
+/* so that init recognizes a ROM */
117
+#include "sysapps/magic/magic.a65"
118
+
101 119
 /************* devices                                  */
102 120
 
103 121
 #echo ############ devices
@@ -127,10 +145,18 @@
127 145
 
128 146
 /************* init process                             */
129 147
 
130
-.data:*=$300:.zero:*=$10:.bss:*=$400:.text
148
+.data:*=$3c0:.zero:*=$20:.bss:*=$400:.text
131 149
 #define	INIT_VERBOSE
150
+#define	INIT_OUTDEV 	CSA_CONSOLE
132 151
 #define	INIT_MERGE
133 152
 #define	INIT_RESTART
153
+#define INIT_LIB6502
154
+#define	INIT_MMU
155
+#define	INIT_MMU_BANK 	3
156
+#ifdef ROMTEST
157
+#define	INIT_ROM2TEST		/* $0-$7 instead of $8-$f in INIT_MMU_BANK */
158
+#endif
159
+
134 160
 #echo ############ init:
135 161
 #include  "sysapps/init/init.a65"
136 162
 .data
@@ -163,7 +189,7 @@
163 189
 #undef	NOCMD
164 190
 
165 191
 .data:*=$300:.zero:*=$10:.bss:*=$500:.text
166
-#echo ############ fsiec:
192
+#echo ############ fsiec (parallel):
167 193
 
168 194
 #undef FSIEC_AS_INIT
169 195
 #define	FSIEC_DEVICE	"devices/piec_csa.a65"
@@ -189,7 +215,7 @@
189 215
 #undef	NOCMD
190 216
 
191 217
 .data:*=$300:.zero:*=$10:.bss:*=$400:.text
192
-#echo ############ fsiec:
218
+#echo ############ fsiec (serial):
193 219
 
194 220
 #undef FSIEC_AS_INIT
195 221
 #define	FSIEC_DEVICE	"devices/siec_csa.a65"
@@ -213,6 +239,10 @@
213 239
 .data:*=$300:.zero:*=$10:.bss:*=$500:.text
214 240
 #echo ############ fsibm:
215 241
 
242
+#define	FSIBM_OUTDEV	CSA_CONSOLE
243
+/* #define	FSIBM_DEVICE_DRV "arch/csa65/devices/drv_wd1770.a65" */
244
+#define	FSIBM_DEVICE_DRV "devices/scsi.a65"  
245
+/* #define	FSIBM_DEVICE_DRV "sysapps/fs/fsibm/drv_ramd1.a65" */
216 246
 #include  "sysapps/fs/fsibm.a65"
217 247
 
218 248
 .data
@@ -227,7 +257,9 @@
227 257
 
228 258
 /************* mon - OS/A 1 old style monitor/shell     */
229 259
 
230
-.data:*=$500:.zero:*=$30:.bss:*=$400:.text
260
+#ifdef MONSH
261
+
262
+.data:*=$3c0:.zero:*=$20:.bss:*=$400:.text
231 263
 #echo ############ shell:
232 264
 
233 265
 #ifdef CLK1MHZ
@@ -236,15 +268,13 @@
236 268
 #undef	  SHORTMON
237 269
 #endif
238 270
 
239
-/*
240
-#define   NOSH
241
-#define   NOSYSFKT
242
-*/
271
+#undef   NOSH
272
+#undef   NOSYSFKT
243 273
 
244 274
 #define MON_SHDEV	0 
245 275
 #define	MON_MONDEV	7
246 276
 #define	MON_SHEXE	$c0
247
-#define	MON_MONEXE	$80
277
+#define	MON_MONEXE	$c0
248 278
 #include  "sysapps/mon/mon.a65"
249 279
 
250 280
 .zero
@@ -258,6 +288,30 @@
258 288
 #print *
259 289
 .text
260 290
 
291
+#endif
292
+
293
+/************* boot lsh from BOOTDRV                    */
294
+
295
+#ifdef BOOTDRV
296
+
297
+#echo ************ lsh
298
+
299
+        /* add autostart of lib6502 program 'lsh' */
300
+
301
+        .(
302
+        .word end_auto
303
+        .byt PK_LIB+PK_AUTOEXEC+PK_RESTART      ; is lib6502 program
304
+        .word 0         ; P_ADDR ignored
305
+        .byt 16         ; P_RAM
306
+        .byt 128        ; P_SHARED
307
+        .byt 0          ; P_PRIORITY
308
+        .byt 1,1        ; P_DEV
309
+        .byt BOOTDRV,":lsh",0,"-d",0,0
310
+end_auto
311
+	.)
312
+
313
+#endif
314
+
261 315
 /************* end of ROM executables                   */
262 316
 
263 317
           .word -1
@@ -277,17 +331,21 @@
277 331
 .zero
278 332
 #echo zero:
279 333
 #print *
280
-Zerostart =*	; only lib6502 and prg - that's it
334
+/* Zerostart must keep save the sh/mon and init variables */
335
+Zerostart =$40	; *	; only lib6502 and prg - that's it
336
+#print Zerostart
281 337
 .data
282 338
 #echo data:
283 339
 #print *
284 340
 .bss 
285 341
 #echo bss:
286 342
 #print *
287
-Memstart =*	; only lib6502 and prg
343
+/* Memstart must keep save the sh/mon and init variables */
344
+Memstart =$500	;	*	; only lib6502 and prg
345
+#print Memstart
288 346
 .text
289 347
 
290
-Memend = $1000
348
+Memend = $3000
291 349
 
292 350
 #endif
293 351
 

+ 362
- 0
arch/csa65/csarom.old View File

@@ -0,0 +1,362 @@
1
+/****************************************************************************
2
+   
3
+    OS/A65 Version 2.0.0
4
+    Multitasking Operating System for 6502 Computers
5
+
6
+    Copyright (C) 1989-1998 Andre Fachat 
7
+
8
+    This program is free software; you can redistribute it and/or modify
9
+    it under the terms of the GNU General Public License as published by
10
+    the Free Software Foundation; either version 2 of the License, or
11
+    (at your option) any later version.
12
+
13
+    This program is distributed in the hope that it will be useful,
14
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+    GNU General Public License for more details.
17
+
18
+    You should have received a copy of the GNU General Public License
19
+    along with this program; if not, write to the Free Software
20
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+
22
+****************************************************************************/
23
+
24
+/***************************************************************************/
25
+/*                      These defines control the ROM build                */
26
+/*                                                                         */
27
+
28
+#define   ROM
29
+
30
+/* These are necessary for CS/A65 kernel ***********************************/
31
+
32
+#define	OSA_ARCH	"CS/A65"
33
+
34
+/* These are changeable ****************************************************/
35
+
36
+#define	FSIEC_PARALLEL
37
+#undef	FSIEC_SERIAL
38
+#undef	FSIBM
39
+#define	USE_LIB6502
40
+
41
+#define	NEED_CHECKCHLD		/* this is necessary if using "init" or 
42
+				   lib6502 */
43
+#define	NEED_GETINFO
44
+
45
+#undef   ROMTEST 		/* debug option */
46
+/* #define   EMUTEST */		/* debug option */
47
+/* #define   SYSPAGE	$12 */	/* debug option */
48
+
49
+#define	NOMIRRORMEM		/* ramtest kernel options */
50
+#define	SHORTRAMTEST
51
+
52
+#define	NMIRESET
53
+
54
+#undef	CMOSCPU
55
+#undef	NOSYSPORT
56
+
57
+#define	RAMEND		$80	/* 32k in bank 0 */
58
+
59
+#define	CLK1MHZ
60
+
61
+#undef	BOOTDRV	"c"
62
+
63
+/***************************************************************************
64
+ * 
65
+ * Better not change anything below 
66
+ */
67
+
68
+#ifdef CMOSCPU
69
+#define	OSA_CPU		"6502"
70
+#else
71
+#define	OSA_CPU		"65C02"
72
+#endif
73
+
74
+/***************************************************************************
75
+ *
76
+ * Here comes the ROM content
77
+ */
78
+
79
+#include  "config.i65"
80
+#include  "kdefs.i65"
81
+#include  "fdefs.i65"
82
+#include  "kernel.i65"
83
+
84
+#define	SEM_VIAE840_T1	SEM_SERIEC
85
+#undef	SEM_SERIEC
86
+#undef	SEM_PARIEC
87
+
88
+#define	ROMSTART	$8000
89
+#define	RAMSIZE		(ROMSTART>>8)
90
+#define	MIN_MEM		$20		/* 8 kbyte */
91
+
92
+	.(
93
+;          .word $2000		; load address 
94
+          *=ROMSTART
95
+
96
+/************* ROM entries                              */
97
+/*
98
+
99
+  The lib6502 needs to use addresses in each of the environments. 
100
+  Devices (normally) use the kernel address space.
101
+  All other tasks, including the kernel have their own environment.
102
+  Therefore they all get their own zero, data and bss addresses.
103
+
104
+*/
105
+
106
+#echo ############ magic
107
+
108
+/************* devices                                  */
109
+
110
+#include "sysapps/magic/magic.a65"
111
+
112
+#echo ############ devices
113
+.data:*=$f00:.zero:*=$d0:.bss:*=$400:.text
114
+.zero
115
+#echo zero:
116
+#print *
117
+.data
118
+#echo data:
119
+#print *
120
+.bss 
121
+#echo bss:
122
+#print *
123
+.text
124
+
125
+#include  "devices/csadev.a65"
126
+.zero
127
+#echo zero:
128
+#print *
129
+.data
130
+#echo data:
131
+#print *
132
+.bss 
133
+#echo bss:
134
+#print *
135
+.text
136
+
137
+/************* init process                             */
138
+
139
+.data:*=$3c0:.zero:*=$20:.bss:*=$400:.text
140
+#define	INIT_VERBOSE
141
+#define	INIT_MERGE
142
+#define	INIT_RESTART
143
+#define INIT_LIB6502
144
+#define	INIT_MMU
145
+#define	INIT_MMU_BANK 2
146
+#echo ############ init:
147
+#include  "sysapps/init/init.a65"
148
+.data
149
+#echo data (<1024):
150
+#print *
151
+.bss
152
+#echo bss:
153
+#print *
154
+.text
155
+
156
+/************* fsdev - converts devices into files      */
157
+
158
+.data:*=$300:.zero:*=$10:.bss:*=$400:.text
159
+#echo ############ fsdev:
160
+#include  "sysapps/fs/fsdev.a65"
161
+.data
162
+#echo data (<=1024):
163
+#print *
164
+.bss
165
+#echo bss:
166
+#print *
167
+.text
168
+
169
+/************* fsiec - as IEEE488 bus filesystem        */
170
+
171
+#ifdef FSIEC_PARALLEL
172
+
173
+#undef	NOLOOP
174
+#undef	NOFS
175
+#undef	NOCMD
176
+
177
+.data:*=$300:.zero:*=$10:.bss:*=$500:.text
178
+#echo ############ fsiec (parallel):
179
+
180
+#undef FSIEC_AS_INIT
181
+#define	FSIEC_DEVICE	"devices/piec_csa.a65"
182
+
183
+#include  "sysapps/fs/fsiec.a65"
184
+
185
+.data
186
+#echo data (<=1280):
187
+#print *
188
+.bss
189
+#echo bss:
190
+#print *
191
+.text
192
+
193
+#endif
194
+
195
+/************* fsiec - as IEC bus filesystem            */
196
+
197
+#ifdef FSIEC_SERIAL
198
+
199
+#define	NOLOOP
200
+#undef	NOFS
201
+#undef	NOCMD
202
+
203
+.data:*=$300:.zero:*=$10:.bss:*=$400:.text
204
+#echo ############ fsiec (serial):
205
+
206
+#undef FSIEC_AS_INIT
207
+#define	FSIEC_DEVICE	"devices/siec_csa.a65"
208
+
209
+#include  "sysapps/fs/fsiec.a65"
210
+
211
+.data
212
+#echo data (<=1024):
213
+#print *
214
+.bss
215
+#echo bss:
216
+#print *
217
+.text
218
+
219
+#endif
220
+
221
+/************* fsibm - PC-style disks filesystem        */
222
+
223
+#ifdef FSIBM
224
+
225
+.data:*=$300:.zero:*=$10:.bss:*=$500:.text
226
+#echo ############ fsibm:
227
+
228
+#define	FSIBM_DEVICE_DRV "arch/csa65/devices/drv_wd1770.a65"
229
+#include  "sysapps/fs/fsibm.a65"
230
+
231
+.data
232
+#echo data (<=1280):
233
+#print *
234
+.bss 
235
+#echo bss:
236
+#print *
237
+.text
238
+
239
+#endif
240
+
241
+/************* mon - OS/A 1 old style monitor/shell     */
242
+
243
+.data:*=$3c0:.zero:*=$20:.bss:*=$400:.text
244
+#echo ############ shell:
245
+
246
+#ifdef CLK1MHZ
247
+#define   SHORTMON
248
+#else
249
+#undef	  SHORTMON
250
+#endif
251
+
252
+/*
253
+#define   NOSH
254
+#define   NOSYSFKT
255
+*/
256
+
257
+#define MON_SHDEV	0 
258
+#define	MON_MONDEV	1	/* 7 */
259
+#define	MON_SHEXE	$c0
260
+#define	MON_MONEXE	$80
261
+#include  "sysapps/mon/mon.a65"
262
+
263
+.zero
264
+#echo zero
265
+#print *
266
+.data
267
+#echo data:
268
+#print *
269
+.bss 
270
+#echo bss:
271
+#print *
272
+.text
273
+
274
+/************* boot lsh from BOOTDRV                    */
275
+
276
+#ifdef BOOTDRV
277
+
278
+#echo ************ lsh
279
+
280
+        /* add autostart of lib6502 program 'lsh' */
281
+
282
+        .(
283
+        .word end_auto
284
+        .byt PK_LIB+PK_AUTOEXEC+PK_RESTART      ; is lib6502 program
285
+        .word 0         ; P_ADDR ignored
286
+        .byt 16         ; P_RAM
287
+        .byt 128        ; P_SHARED
288
+        .byt 0          ; P_PRIORITY
289
+        .byt 1,1        ; P_DEV
290
+        .byt BOOTDRV,":lsh",0,"-d",0,0
291
+end_auto
292
+	.)
293
+
294
+#endif
295
+
296
+/************* end of ROM executables                   */
297
+
298
+          .word -1
299
+
300
+/************* lib6502 code                             */
301
+
302
+#ifdef USE_LIB6502
303
+
304
+/* lib6502 jmp table is below STDIOADDR */
305
+
306
+#echo "############ lib6502"
307
+.data:*=$300:.zero:*=8:.bss:*=$400:.text
308
+
309
+#include  "lib6502/lib6502.a65"
310
+/* #include  "stdlib/stdio.a65" */
311
+
312
+.zero
313
+#echo zero:
314
+#print *
315
+/* Zerostart must keep save the sh/mon and init variables */
316
+Zerostart =$40	; *	; only lib6502 and prg - that's it
317
+#print Zerostart
318
+.data
319
+#echo data:
320
+#print *
321
+.bss 
322
+#echo bss:
323
+#print *
324
+/* Memstart must keep save the sh/mon and init variables */
325
+Memstart =$500	;	*	; only lib6502 and prg
326
+#print Memstart
327
+.text
328
+
329
+Memend = $3000
330
+
331
+#endif
332
+
333
+/************* fill not used area (I/O, screens)        */
334
+
335
+#if *>$e7ff
336
+#echo "program too long!, should be $e800 (59392), is"
337
+#print *
338
+ldx ,x
339
+#endif
340
+          .dsb $f000-*,<-1
341
+
342
+/************* Kernel                                   */
343
+          
344
+.data:*=$300:.zero:*=8:.bss:*=$600:.text
345
+#echo ############ kernel:
346
+
347
+#include  "kernel/kernel.a65"
348
+
349
+.zero
350
+#echo zero:
351
+#print *
352
+.data
353
+#echo data:
354
+#print *
355
+.bss 
356
+#echo bss:
357
+#print *
358
+.text
359
+
360
+	.)
361
+
362
+

+ 266
- 0
arch/csa65/csarom2.a65 View File

@@ -0,0 +1,266 @@
1
+/****************************************************************************
2
+   
3
+    OS/A65 Version 2.0.0
4
+    Multitasking Operating System for 6502 Computers
5
+
6
+    Copyright (C) 1989-1998 Andre Fachat 
7
+
8
+    This program is free software; you can redistribute it and/or modify
9
+    it under the terms of the GNU General Public License as published by
10
+    the Free Software Foundation; either version 2 of the License, or
11
+    (at your option) any later version.
12
+
13
+    This program is distributed in the hope that it will be useful,
14
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+    GNU General Public License for more details.
17
+
18
+    You should have received a copy of the GNU General Public License
19
+    along with this program; if not, write to the Free Software
20
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+
22
+****************************************************************************/
23
+
24
+/***************************************************************************/
25
+/*                      These defines control the ROM build                */
26
+/*                                                                         */
27
+
28
+#define   ROM
29
+
30
+/* These are necessary for CS/A65 kernel ***********************************/
31
+
32
+#define	OSA_ARCH	"CS/A65"
33
+
34
+#define	OSA2KERNEL	$f000
35
+
36
+#ifdef CMOSCPU
37
+#define OSA_CPU         "6502"
38
+#else
39
+#define OSA_CPU         "65C02"
40
+#endif
41
+
42
+/* These are changeable ****************************************************/
43
+
44
+#define	FSIEC_PARALLEL
45
+#undef	FSIEC_SERIAL
46
+#undef	FSIBM
47
+#define	USE_LIB6502
48
+
49
+#define	CLK2MHZ
50
+
51
+#undef	BOOTDRV	"c"
52
+
53
+
54
+/***************************************************************************
55
+ * 
56
+ * Better not change anything below 
57
+ */
58
+
59
+/***************************************************************************
60
+ *
61
+ * Here comes the ROM content
62
+ */
63
+
64
+#include  "config.i65"
65
+#include  "kdefs.i65"
66
+#include  "fdefs.i65"
67
+#include  "kernel.i65"
68
+
69
+#define	SEM_VIAE840_T1	SEM_SERIEC
70
+#undef	SEM_SERIEC
71
+#undef	SEM_PARIEC
72
+
73
+#define	ROMSTART	$8000
74
+
75
+	.(
76
+;          .word $2000		; load address 
77
+          *=ROMSTART
78
+
79
+/************* ROM entries                              */
80
+/*
81
+
82
+  The lib6502 needs to use addresses in each of the environments. 
83
+  Devices (normally) use the kernel address space.
84
+  All other tasks, including the kernel have their own environment.
85
+  Therefore they all get their own zero, data and bss addresses.
86
+
87
+*/
88
+
89
+#echo ############ magic
90
+
91
+/* so that init recognizes this as second ROM */
92
+#include "sysapps/magic/magic.a65"
93
+
94
+/************* fsiec - as IEEE488 bus filesystem        */
95
+
96
+#ifdef FSIEC_PARALLEL
97
+
98
+#undef	NOLOOP
99
+#undef	NOFS
100
+#undef	NOCMD
101
+
102
+.data:*=$300:.zero:*=$10:.bss:*=$500:.text
103
+#echo ############ fsiec (parallel):
104
+
105
+#undef FSIEC_AS_INIT
106
+#define	FSIEC_DEVICE	"devices/piec_csa.a65"
107
+
108
+#include  "sysapps/fs/fsiec.a65"
109
+
110
+.data
111
+#echo data (<=1280):
112
+#print *
113
+.bss
114
+#echo bss:
115
+#print *
116
+.text
117
+
118
+#endif
119
+
120
+/************* fsiec - as IEC bus filesystem            */
121
+
122
+#ifdef FSIEC_SERIAL
123
+
124
+#define	NOLOOP
125
+#undef	NOFS
126
+#undef	NOCMD
127
+
128
+.data:*=$300:.zero:*=$10:.bss:*=$400:.text
129
+#echo ############ fsiec (serial):
130
+
131
+#undef	FSIEC_AS_INIT
132
+#define	FSIEC_OUTDEV	7
133
+#define	FSIEC_DEVICE	"devices/siec_csa.a65"
134
+
135
+#include  "sysapps/fs/fsiec.a65"
136
+
137
+.data
138
+#echo data (<=1024):
139
+#print *
140
+.bss
141
+#echo bss:
142
+#print *
143
+.text
144
+
145
+#endif
146
+
147
+/************* fsibm - PC-style disks filesystem        */
148
+
149
+#ifdef FSIBM
150
+
151
+.data:*=$300:.zero:*=$10:.bss:*=$500:.text
152
+#echo ############ fsibm:
153
+
154
+#define	FSIBM_OUTDEV	7
155
+#define	FSIBM_DEVICE_DRV "arch/csa65/devices/drv_wd1770.a65"
156
+#include  "sysapps/fs/fsibm.a65"
157
+
158
+.data
159
+#echo data (<=1280):
160
+#print *
161
+.bss 
162
+#echo bss:
163
+#print *
164
+.text
165
+
166
+#endif
167
+
168
+/************* mon - OS/A 1 old style monitor/shell     */
169
+
170
+.data:*=$3c0:.zero:*=$20:.bss:*=$400:.text
171
+#echo ############ shell:
172
+
173
+#ifdef CLK1MHZ
174
+#define   SHORTMON
175
+#else
176
+#undef    SHORTMON
177
+#endif
178
+
179
+#undef   NOSH
180
+#undef   NOSYSFKT
181
+
182
+#define MON_SHDEV       0
183
+#define MON_MONDEV      7
184
+#define MON_SHEXE       $c0
185
+#define MON_MONEXE      $c0
186
+#include  "sysapps/mon/mon.a65"
187
+
188
+.zero
189
+#echo zero
190
+#print *
191
+.data
192
+#echo data:
193
+#print *
194
+.bss
195
+#echo bss:
196
+#print *
197
+.text
198
+
199
+/************* boot lsh from BOOTDRV                    */
200
+
201
+#ifdef BOOTDRV
202
+
203
+#echo ************ lsh
204
+
205
+        /* add autostart of lib6502 program 'lsh' */
206
+
207
+        .(
208
+        .word end_auto
209
+        .byt PK_LIB+PK_AUTOEXEC+PK_RESTART      ; is lib6502 program
210
+        .word 0         ; P_ADDR ignored
211
+        .byt 16         ; P_RAM
212
+        .byt 128        ; P_SHARED
213
+        .byt 0          ; P_PRIORITY
214
+        .byt 1,1        ; P_DEV
215
+        .byt BOOTDRV,":lsh",0,"-d",0,0
216
+end_auto
217
+	.)
218
+
219
+#endif
220
+
221
+/************* end of ROM executables                   */
222
+
223
+          .word -1
224
+
225
+/************* lib6502 code                             */
226
+
227
+#ifdef USE_LIB6502
228
+
229
+/* lib6502 jmp table is below STDIOADDR */
230
+
231
+#echo "############ lib6502"
232
+.data:*=$300:.zero:*=8:.bss:*=$400:.text
233
+
234
+#include  "lib6502/lib6502.a65"
235
+/* #include  "stdlib/stdio.a65" */
236
+
237
+.zero
238
+#echo zero:
239
+#print *
240
+/* Zerostart must keep save the sh/mon and init variables */
241
+Zerostart =$40  ; *     ; only lib6502 and prg - that's it
242
+#print Zerostart
243
+.data
244
+#echo data:
245
+#print *
246
+.bss
247
+#echo bss:
248
+#print *
249
+/* Memstart must keep save the sh/mon and init variables */
250
+Memstart =$500  ;       *       ; only lib6502 and prg
251
+#print Memstart
252
+.text
253
+
254
+Memend = $3000
255
+
256
+#endif
257
+
258
+/************* fill not used area (I/O, screens)        */
259
+
260
+
261
+          .dsb $fffe-*,<-1
262
+
263
+          .word -1
264
+	.)
265
+
266
+

+ 1296
- 0
arch/csa65/devices/drv_wd1770.a65
File diff suppressed because it is too large
View File


+ 20
- 0
arch/csa65/foo View File

@@ -0,0 +1,20 @@
1
+
2
+If "ROMTEST" is defined:
3
+
4
+p 02
5
+e 2 18
6
+e 3 19
7
+e 4 1a
8
+e 5 1b
9
+e 6 1c
10
+e 7 1d
11
+e 8 1e
12
+e 9 1f
13
+yc
14
+l"csarom" 2000
15
+l"inirom" 3fe
16
+
17
+or otherwise:
18
+
19
+~/vice/src/vice-0.12.0.16-csa-22/bin/xcsa -kernal ./csarom -basic ./csarom2
20
+

+ 46
- 0
arch/csa65/sysapps/Makefile View File

@@ -0,0 +1,46 @@
1
+
2
+apps = lsh
3
+sysapps = mon slipd
4
+files = mkdir rmdir rm format chkdsk ls cat mv
5
+inet = tlogin telnet httpd
6
+
7
+XA=xa
8
+
9
+all: osa.d64
10
+
11
+redo: 
12
+	rm -f fsibm.o65
13
+	make
14
+	cat foo
15
+
16
+fsibm.o65: fsibm.a65
17
+	${XA} -bz 32 -bt 1280 -bd 768 -bb 12288 -l fsibm.lab -r -I.. -I../../../include -I../../.. -R -DOSA2KERNEL=\$$f000 $< -o $@
18
+	file65 -V fsibm.o65
19
+	reloc65 -xt -o fsibm fsibm.o65
20
+
21
+osa.d64: ${files} ${sysapps} ${apps} fsibm.o65
22
+	./mkdisk ${files} ${sysapps} ${apps} ${inet} fsibm.o65
23
+	dd if=osa.x64 of=osa.d64 bs=64 skip=1
24
+
25
+clean:
26
+	rm -f fsibm.o65 fsibm.lab fsibm
27
+	rm -f ${files} ${sysapps} ${apps} ${inet}
28
+	rm -f osa.d64 osa.x64
29
+
30
+${apps}:
31
+	(cd ../../../apps/lsh; make lsh;)
32
+	(if test ! -r lsh; then ln -s ../../../apps/lsh/lsh lsh; fi)
33
+
34
+${sysapps}:
35
+	(cd ../../../sysapps/$@; make $@;)
36
+	(if test ! -r $@; then ln -s ../../../sysapps/$@/$@ $@; fi)
37
+
38
+${files}:
39
+	(cd ../../../apps/file; make $@;)
40
+	(if test ! -r $@; then ln -s ../../../apps/file/$@ $@; fi)
41
+
42
+${inet}:
43
+	(cd ../../../apps/inet; make $@;)
44
+	(if test ! -r $@; then ln -s ../../../apps/inet/$@ $@; fi)
45
+
46
+

+ 4
- 0
arch/csa65/sysapps/foo View File

@@ -0,0 +1,4 @@
1
+monitor
2
+p 05
3
+e 1 18 19 1a
4
+l"fsibm" 500

+ 9
- 0
arch/csa65/sysapps/fsibm.a65 View File

@@ -0,0 +1,9 @@
1
+
2
+/* #define	FSIBM_DEVICE_DRV	"devices/drv_wd1770.a65" */
3
+/* #define	FSIBM_DEVICE_DRV	"sysapps/fs/fsibm/drv_ramd1.a65" */
4
+#define	FSIBM_DEVICE_DRV	"devices/scsi.a65" 
5
+
6
+#define	DEBUGFS
7
+
8
+#include "sysapps/fs/fsibm.a65"
9
+

+ 1
- 0
arch/csa65/sysapps/mkdisk View File

@@ -0,0 +1 @@
1
+../../c64/boot/mkdisk

+ 0
- 402
arch/embedded/kernel/kenv.a65 View File

@@ -1,402 +0,0 @@
1
-/****************************************************************************
2
-   
3
-    OS/A65 Version 2.0.0
4
-    Multitasking Operating System for 6502 Computers
5
-
6
-    Copyright (C) 1989-1998 Andre Fachat 
7
-
8
-    This program is free software; you can redistribute it and/or modify
9
-    it under the terms of the GNU General Public License as published by
10
-    the Free Software Foundation; either version 2 of the License, or
11
-    (at your option) any later version.
12
-
13
-    This program is distributed in the hope that it will be useful,
14
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
-    GNU General Public License for more details.
17
-
18
-    You should have received a copy of the GNU General Public License
19
-    along with this program; if not, write to the Free Software
20
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
-
22
-****************************************************************************/
23
-
24
-/* TODO: make stack addr computation a table lookup, which is faster */
25
-
26
-/*        Struct Task Environment Entry          */
27
-
28
-/* we have three structs now: 
29
- * TE_* 	for task environment handling - not needed for system without
30
- *       	memory management
31
- * TT_*		task table, contains STD streams, etc
32
- * TH_*		thread table, has stack info and state
33
- */
34
-
35
-#define	TE_SLEN		0	/* we don't have envs */
36
-
37
-/************************************************************************
38
- * These routines are needed in the env section! 
39
- *   inienv
40
- *   setthread
41
- *   initsp
42
- *   push
43
- *   pull
44
- *   memtask
45
- *   memsys
46
- *
47
- *   sbrk
48
- *   getenv
49
- *   freenv
50
- */
51
-
52
-&&enmem  = notimp	; to enable memory blocks to the kernel
53
-&&setblk = notimp	; to set memory blocks in MMU mapping
54
-
55
-#ifdef STACKCOPY
56
-	.zero
57
-zp	.word 0
58
-
59
-	.data
60
-
61
-Stacks  .dsb MAXNTHREADS * STACKSIZE
62
-
63
-	.text
64
-#endif
65
-
66
-
67
-&inienv .(
68
-	lda #<-1
69
-	sta actThread
70
-	sta actTask
71
-	lda #1
72
-	sta Syscnt
73
-	clc
74
-	rts
75
-	.)
76
-
77
-setthread .(
78
-	.data
79
-newThread .byt 0
80
-	.text
81
-
82
-	cmp actThread
83
-	bne doit
84
-	rts
85
-doit
86
-	sta newThread
87
-
88
-	ldx actThread
89
-	cpx #<-1
90
-	beq nosave
91
-
92
-	lda THREADSAVE
93
-	sta threadTab + TH_LIBSAVE,x
94
-	lda THREADSAVE+1
95
-	sta threadTab + TH_LIBSAVE+1,x
96
-
97
-#ifdef STACKCOPY
98
-	txa		; stack is 8 * TH_SLEN = 64
99
-	ldy #0
100
-	sty zp+1
101
-	asl 
102
-	rol zp+1
103
-	asl
104
-	rol zp+1
105
-	asl
106
-	rol zp+1
107
-	clc
108
-	adc #<Stacks
109
-	sta zp
110
-	lda #>Stacks
111
-	adc zp+1
112
-	sta zp+1
113
-	;bcc l1
114
-	;inc zp+1
115
-;l1
116
-	lda threadTab + TH_SP,x
117
-	tay
118
-	iny
119
-l2	cpy #STACKSIZE
120
-	bcs savetask
121
-	lda $100,y
122
-	sta (zp),y
123
-	iny
124
-	bne l2
125
-#endif
126
-savetask
127
-	ldy threadTab + TH_TASK,x
128
-	lda TASKSAVE
129
-	sta taskTab + TT_LIBSAVE,y
130
-	lda TASKSAVE + 1
131
-	sta taskTab + TT_LIBSAVE + 1,y
132
-nosave	
133
-loadtask
134
-	ldx newThread
135
-	stx actThread
136
-	cpx #<-1
137
-	bne load
138
-	stx actTask
139
-	beq noload
140
-load
141
-	ldy threadTab + TH_TASK,x
142
-	sty actTask
143
-
144
-	lda taskTab + TT_LIBSAVE,y
145
-	sta TASKSAVE
146
-	lda taskTab + TT_LIBSAVE + 1,y
147
-	sta TASKSAVE + 1
148
-
149
-loadthread 
150
-	lda threadTab + TH_LIBSAVE,x
151
-	sta THREADSAVE
152
-	lda threadTab + TH_LIBSAVE+1,x
153
-	sta THREADSAVE+1
154
-
155
-#ifdef STACKCOPY
156
-	txa
157
-	ldy #0
158
-	sty zp+1
159
-	asl 
160
-	rol zp+1
161
-	asl
162
-	rol zp+1
163
-	asl
164
-	rol zp+1
165
-	clc
166
-	adc #<Stacks
167
-	sta zp
168
-	lda #>Stacks
169
-	adc zp+1
170
-	sta zp+1
171
-	;bcc l3
172
-	;inc zp+1
173
-;l3
174
-	lda threadTab + TH_SP,x
175
-	tay
176
-	iny
177
-l4	cpy #STACKSIZE
178
-	bcs endset
179
-	lda (zp),y
180
-	sta $100,y
181
-	iny
182
-	bne l4
183
-#endif
184
-noload
185
-endset	rts
186
-	.)
187
-
188
-initsp	.(
189
-#ifdef STACKCOPY
190
-	lda #STACKSIZE-1
191
-	;ldx actThread
192
-	sta threadTab + TH_SP,x
193
-	rts
194
-#else
195
-	.data
196
-divsp	.byt 0
197
-	.text
198
-
199
-	;ldx actThread
200
-	txa
201
-	clc
202
-	adc #TH_SLEN
203
-	sta divsp
204
-	asl
205
-	asl				; split stack
206
-	clc
207
-	adc divsp
208
-	sta threadTab + TH_SP,x
209
-	dec threadTab + TH_SP,x
210
-	rts
211
-#endif
212
-	.)
213
-
214
-pull	.(
215
-	ldx actThread
216
-	inc threadTab + TH_SP,x
217
-	lda threadTab + TH_SP,x
218
-	tay
219
-	lda $0100,y
220
-	rts
221
-	.)
222
-
223
-&push	.(
224
-	pha
225
-	ldx actThread
226
-	lda threadTab + TH_SP,x
227
-	tay
228
-	pla
229
-	sta $0100,y
230
-	dec threadTab + TH_SP,x
231
-	rts
232
-	.)
233
-
234
-	.(
235
-	.zero
236
-AC      .byt 0
237
-XR      .byt 0
238
-YR      .byt 0
239
-SR      .byt 0
240
-ADR     .word 0
241
-&SSP    .byt 0
242
-	.text
243
-
244
-/* 
245
- * this one is used to return from an interrupt. We do not need to save
246
- * any registers. so for brevity, we do it as macro
247
- * This doesn't check for interrupted devices, as we do not have them 
248
- * without MMU (so far).
249
- */
250
-
251
-#define MEMTASK2()                                      \
252
-	.(						:\
253
-	  sei						:\
254
-	  dec Syscnt					:\
255
-	  bne mtask					:\
256
-          tsx                                           :\
257
-          stx SSP                                       :\
258
-          ldy actThread                                 :\
259
-          ldx threadTab+TH_SP,y                         :\
260
-          txs						:\
261
-mtask	.)
262
-
263
-/* 
264
- * This is the standard return to user space. the kernel jumps here,
265
- * so we need not save any return address, but use the one on the
266
- * user stack.
267
- */
268
-&&memtask .(
269
-	  php
270
-          sei
271
-          dec Syscnt     ; wieder in Task 
272
-          bne mtask      ; nein dann Ende
273
-
274
-          bit adev       ; Ruecksprung in Device
275
-          bpl mtask      ; ja dann Ende
276
- 
277
-          sty YR         ; sonst Task-Env setzen
278
-          stx XR
279
-          sta AC
280
-          pla		 ; SR
281
-
282
-          tsx
283
-          stx SSP
284
-
285
-          ldy actThread
286
-          ldx threadTab+TH_SP,y 
287
-          txs
288
-
289
-          pha		 ; SR
290
-          lda AC
291
-          ldy YR
292
-          ldx XR
293
-mtask     
294
-	  plp
295
-          rts
296
-	  .)
297
-
298
-/* 
299
- * This is the kernel entry routine. It leaves all registers as they
300
- * are, except for the stack pointer, which is set to the system stack.
301
- * also the return address is moved from user stack to system stack,
302
- * to allow "JSR"-ing to memsys.
303
- */
304
-&&memsys  php
305
-          sei
306
-          pha
307
-          lda Syscnt
308
-          inc Syscnt
309
-          cmp #0
310
-          bne mse
311
-          bit adev       ; called by device
312
-          bmi msys       ; no then save stack
313
-mse       pla
314
-          plp
315
-          rts
316
-
317
-msys      pla
318
-          sta AC
319
-          pla
320
-          sta SR
321
-          stx XR
322
-          ; sty YR
323
-          pla
324
-          sta ADR
325
-          pla
326
-          sta ADR+1
327
-          tsx
328
-          txa
329
-          ldx actThread
330
-          sta threadTab+TH_SP,x
331
-          ldx SSP
332
-          txs
333
-          lda ADR+1
334
-          pha
335
-          lda ADR
336
-          pha
337
-          lda SR
338
-          pha
339
-          lda AC
340
-          ldx XR
341
-          ; ldy YR
342
-          plp
343
-          cld
344
-          rts
345
-	.)
346
-
347
-
348
-&&sbrk	.(
349
-	bcc ok
350
-	sec
351
-	lda #E_NOMEM
352
-	rts
353
-ok	lda #>ROMSTART		; return available memory
354
-	clc
355
-	rts
356
-	.)
357
-
358
-kgetenv	.(
359
-	ldx #0
360
-	clc
361
-	rts
362
-	.)
363
-
364
-freenv	.(
365
-	clc
366
-	rts
367
-	.)
368
-
369
-/*
370
- * MAPSYSBUF() maps the PCBUF of the active task into the system memory
371
- * at address SYSBUF. It's not needed in a C64...
372
- */
373
-#undef	MAPSYSBUF
374
-#define	SYSBUF	$200
375
-
376
-/*
377
- * MAPENV() maps the address given in a/y in env x to somewhere in the 
378
- * kernel map. returns mapped address in a/y
379
- * MAPAENV() does the same but for the actual task (env)
380
- */
381
-#define	MAPENV()
382
-#define	MAPAENV()
383
-
384
-
385
-/*
386
- * needed for GETINFO, gives RAM available for task
387
- */
388
-#define	GETTASKMEM	lda #>ROMSTART
389
-
390
-/*
391
- * copy routines for SEND/RECEIVE and FORK
392
- */
393
-#undef CPPCBUFRX
394
-#undef CPPCBUFTX
395
-#define	CPFORKBUF()
396
-
397
-/*
398
- * needed in device code to get active environment in AC
399
- */
400
-#define GETACTENV()     lda #<-1
401
-
402
-

+ 1
- 0
arch/embedded/kernel/kenv.a65 View File

@@ -0,0 +1 @@
1
+../../c64/kernel/kenv.a65

+ 6
- 1
arch/embedded/kernel/kinit.a65 View File

@@ -90,10 +90,15 @@
90 90
 #include "kernel/zerotest.a65"
91 91
 
92 92
 /*
93
- * check system RAM up to ROMSTART, jump to he_ram if failure
93
+ * check system RAM up to RAMEND, jump to he_ram if failure
94 94
  * returns available RAM in 256 byte blocks in AC
95 95
  */
96
+	.(
97
+	.zero
98
+cnt	.byt 0
99
+	.text
96 100
 #include "kernel/ramtest.a65"
101
+	.)
97 102
 
98 103
 /*
99 104
  * originally SYSPORT specific, they have a value for the C64 also...

+ 4
- 6
arch/embedded/rom.a65 View File

@@ -39,14 +39,10 @@
39 39
 
40 40
 /* These are changeable ****************************************************/
41 41
 
42
-#define	RAMSIZE		$04	/* The size of the RAM we allow to be used.
43
-				   Size in pages (256 bytes). Must be below
44
-				   ROMSTART */
45
-
46 42
 #define	MIN_MEM		$04	/* minimum memory we need in system env. to 
47 43
 				   work ok, in pages */
48 44
 
49
-#undef	ROMSTART		/* where the ROM starts -> see below */
45
+#define	RAMEND		$20	/* where the ROM starts (in pages) */
50 46
 
51 47
 #define	MEMINIVAL	0	/* Clear memory to 0 on boot */
52 48
 
@@ -66,10 +62,12 @@
66 62
 
67 63
 #define	NO_SEND			/* no SEND/RECEIVE/XRECEIVE calls */
68 64
 
65
+#define	NO_DEVICE		/* no DEVICE handling */
66
+
69 67
 #define	EOK_SEPARATE		/* include kernel/end.a65 separately */
70 68
 
71 69
 #undef	EOK_NOFILL		/* don't fill ROM till $ffff */
72
-	
70
+
73 71
 /***************************************************************************/
74 72
 /* 			You should include your application files below    */
75 73
 /*									   */ 

+ 0
- 402
arch/gecko/kernel/kenv.a65 View File

@@ -1,402 +0,0 @@
1
-/****************************************************************************
2
-   
3
-    OS/A65 Version 2.0.0
4
-    Multitasking Operating System for 6502 Computers
5
-
6
-    Copyright (C) 1989-1998 Andre Fachat 
7
-
8
-    This program is free software; you can redistribute it and/or modify
9
-    it under the terms of the GNU General Public License as published by
10
-    the Free Software Foundation; either version 2 of the License, or
11
-    (at your option) any later version.
12
-
13
-    This program is distributed in the hope that it will be useful,
14
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
-    GNU General Public License for more details.
17
-
18
-    You should have received a copy of the GNU General Public License
19
-    along with this program; if not, write to the Free Software
20
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
-
22
-****************************************************************************/
23
-
24
-/* TODO: make stack addr computation a table lookup, which is faster */
25
-
26
-/*        Struct Task Environment Entry          */
27
-
28
-/* we have three structs now: 
29
- * TE_* 	for task environment handling - not needed for system without
30
- *       	memory management
31
- * TT_*		task table, contains STD streams, etc
32
- * TH_*		thread table, has stack info and state
33
- */
34
-
35
-#define	TE_SLEN		0	/* we don't have envs */
36
-
37
-/************************************************************************
38
- * These routines are needed in the env section! 
39
- *   inienv
40
- *   setthread
41
- *   initsp
42
- *   push
43
- *   pull
44
- *   memtask
45
- *   memsys
46
- *
47
- *   sbrk
48
- *   getenv
49
- *   freenv
50
- */
51
-
52
-&&enmem  = notimp	; to enable memory blocks to the kernel
53
-&&setblk = notimp	; to set memory blocks in MMU mapping
54
-
55
-#ifdef STACKCOPY
56
-	.zero
57
-zp	.word 0
58
-
59
-	.data
60
-
61
-Stacks  .dsb MAXNTHREADS * STACKSIZE
62
-
63
-	.text
64
-#endif
65
-
66
-
67
-&inienv .(
68
-	lda #<-1
69
-	sta actThread
70
-	sta actTask
71
-	lda #1
72
-	sta Syscnt
73
-	clc
74
-	rts
75
-	.)
76
-
77
-setthread .(
78
-	.data
79
-newThread .byt 0
80
-	.text
81
-
82
-	cmp actThread
83
-	bne doit
84
-	rts
85
-doit
86
-	sta newThread
87
-
88
-	ldx actThread
89
-	cpx #<-1
90
-	beq nosave
91
-
92
-	lda THREADSAVE
93
-	sta threadTab + TH_LIBSAVE,x
94
-	lda THREADSAVE+1
95
-	sta threadTab + TH_LIBSAVE+1,x
96
-
97
-#ifdef STACKCOPY
98
-	txa		; stack is 8 * TH_SLEN = 64
99
-	ldy #0
100
-	sty zp+1
101
-	asl 
102
-	rol zp+1
103
-	asl
104
-	rol zp+1
105
-	asl
106
-	rol zp+1
107
-	clc
108
-	adc #<Stacks
109
-	sta zp
110
-	lda #>Stacks
111
-	adc zp+1
112
-	sta zp+1
113
-	;bcc l1
114
-	;inc zp+1
115
-;l1
116
-	lda threadTab + TH_SP,x
117
-	tay
118
-	iny
119
-l2	cpy #STACKSIZE
120
-	bcs savetask
121
-	lda $100,y
122
-	sta (zp),y
123
-	iny
124
-	bne l2
125
-#endif
126
-savetask
127
-	ldy threadTab + TH_TASK,x
128
-	lda TASKSAVE
129
-	sta taskTab + TT_LIBSAVE,y
130
-	lda TASKSAVE + 1
131
-	sta taskTab + TT_LIBSAVE + 1,y
132
-nosave	
133
-loadtask
134
-	ldx newThread
135
-	stx actThread
136
-	cpx #<-1
137
-	bne load
138
-	stx actTask
139
-	beq noload
140
-load
141
-	ldy threadTab + TH_TASK,x
142
-	sty actTask
143
-
144
-	lda taskTab + TT_LIBSAVE,y
145
-	sta TASKSAVE
146
-	lda taskTab + TT_LIBSAVE + 1,y
147
-	sta TASKSAVE + 1
148
-
149
-loadthread 
150
-	lda threadTab + TH_LIBSAVE,x
151
-	sta THREADSAVE
152
-	lda threadTab + TH_LIBSAVE+1,x
153
-	sta THREADSAVE+1
154
-
155
-#ifdef STACKCOPY
156
-	txa
157
-	ldy #0
158
-	sty zp+1
159
-	asl 
160
-	rol zp+1
161
-	asl
162
-	rol zp+1
163
-	asl
164
-	rol zp+1
165
-	clc
166
-	adc #<Stacks
167
-	sta zp
168
-	lda #>Stacks
169
-	adc zp+1
170
-	sta zp+1
171
-	;bcc l3
172
-	;inc zp+1
173
-;l3
174
-	lda threadTab + TH_SP,x
175
-	tay
176
-	iny
177
-l4	cpy #STACKSIZE
178
-	bcs endset
179
-	lda (zp),y
180
-	sta $100,y
181
-	iny
182
-	bne l4
183
-#endif
184
-noload
185
-endset	rts
186
-	.)
187
-
188
-initsp	.(
189
-#ifdef STACKCOPY
190
-	lda #STACKSIZE-1
191
-	;ldx actThread
192
-	sta threadTab + TH_SP,x
193
-	rts
194
-#else
195
-	.data
196
-divsp	.byt 0
197
-	.text
198
-
199
-	;ldx actThread
200
-	txa
201
-	clc
202
-	adc #TH_SLEN
203
-	sta divsp
204
-	asl
205
-	asl				; split stack
206
-	clc
207
-	adc divsp
208
-	sta threadTab + TH_SP,x
209
-	dec threadTab + TH_SP,x
210
-	rts
211
-#endif
212
-	.)
213
-
214
-pull	.(
215
-	ldx actThread
216
-	inc threadTab + TH_SP,x
217
-	lda threadTab + TH_SP,x
218
-	tay
219
-	lda $0100,y
220
-	rts
221
-	.)
222
-
223
-&push	.(
224
-	pha
225
-	ldx actThread
226
-	lda threadTab + TH_SP,x
227
-	tay
228
-	pla
229
-	sta $0100,y
230
-	dec threadTab + TH_SP,x
231
-	rts
232
-	.)
233
-
234
-	.(
235
-	.zero
236
-AC      .byt 0
237
-XR      .byt 0
238
-YR      .byt 0
239
-SR      .byt 0
240
-ADR     .word 0
241
-&SSP    .byt 0
242
-	.text
243
-
244
-/* 
245
- * this one is used to return from an interrupt. We do not need to save
246
- * any registers. so for brevity, we do it as macro
247
- * This doesn't check for interrupted devices, as we do not have them 
248
- * without MMU (so far).
249
- */
250
-
251
-#define MEMTASK2()                                      \
252
-	.(						:\
253
-	  sei						:\
254
-	  dec Syscnt					:\
255
-	  bne mtask					:\
256
-          tsx                                           :\
257
-          stx SSP                                       :\
258
-          ldy actThread                                 :\
259
-          ldx threadTab+TH_SP,y                         :\
260
-          txs						:\
261
-mtask	.)
262
-
263
-/* 
264
- * This is the standard return to user space. the kernel jumps here,
265
- * so we need not save any return address, but use the one on the
266
- * user stack.
267
- */
268
-&&memtask .(
269
-	  php
270
-          sei
271
-          dec Syscnt     ; wieder in Task 
272
-          bne mtask      ; nein dann Ende
273
-
274
-          bit adev       ; Ruecksprung in Device
275
-          bpl mtask      ; ja dann Ende
276
- 
277
-          sty YR         ; sonst Task-Env setzen
278
-          stx XR
279
-          sta AC
280
-          pla		 ; SR
281
-
282
-          tsx
283
-          stx SSP
284
-
285
-          ldy actThread
286
-          ldx threadTab+TH_SP,y 
287
-          txs
288
-
289
-          pha		 ; SR
290
-          lda AC
291
-          ldy YR
292
-          ldx XR
293
-mtask     
294
-	  plp
295
-          rts
296
-	  .)
297
-
298
-/* 
299
- * This is the kernel entry routine. It leaves all registers as they
300
- * are, except for the stack pointer, which is set to the system stack.
301
- * also the return address is moved from user stack to system stack,
302
- * to allow "JSR"-ing to memsys.
303
- */
304
-&&memsys  php
305
-          sei
306
-          pha
307
-          lda Syscnt
308
-          inc Syscnt
309
-          cmp #0
310
-          bne mse
311
-          bit adev       ; called by device
312
-          bmi msys       ; no then save stack
313
-mse       pla
314
-          plp
315
-          rts
316
-
317
-msys      pla
318
-          sta AC
319
-          pla
320
-          sta SR
321
-          stx XR
322
-          ; sty YR
323
-          pla
324
-          sta ADR
325
-          pla
326
-          sta ADR+1
327
-          tsx
328
-          txa
329
-          ldx actThread
330
-          sta threadTab+TH_SP,x
331
-          ldx SSP
332
-          txs
333
-          lda ADR+1
334
-          pha
335
-          lda ADR
336
-          pha
337
-          lda SR
338
-          pha
339
-          lda AC
340
-          ldx XR
341
-          ; ldy YR
342
-          plp
343
-          cld
344
-          rts
345
-	.)
346
-
347
-
348
-&&sbrk	.(
349
-	bcc ok
350
-	sec
351
-	lda #E_NOMEM
352
-	rts
353
-ok	lda #>ROMSTART		; return available memory
354
-	clc
355
-	rts
356
-	.)
357
-
358
-kgetenv	.(
359
-	ldx #0
360
-	clc
361
-	rts
362
-	.)
363
-
364
-freenv	.(
365
-	clc
366
-	rts
367
-	.)
368
-
369
-/*
370
- * MAPSYSBUF() maps the PCBUF of the active task into the system memory
371
- * at address SYSBUF. It's not needed in a C64...
372
- */
373
-#undef	MAPSYSBUF
374
-#define	SYSBUF	$200
375
-
376
-/*
377
- * MAPENV() maps the address given in a/y in env x to somewhere in the 
378
- * kernel map. returns mapped address in a/y
379
- * MAPAENV() does the same but for the actual task (env)
380
- */
381
-#define	MAPENV()
382
-#define	MAPAENV()
383
-
384
-
385
-/*
386
- * needed for GETINFO, gives RAM available for task
387
- */
388
-#define	GETTASKMEM	lda #>ROMSTART
389
-
390
-/*
391
- * copy routines for SEND/RECEIVE and FORK
392
- */
393
-#undef CPPCBUFRX
394
-#undef CPPCBUFTX
395
-#define	CPFORKBUF()
396
-
397
-/*
398
- * needed in device code to get active environment in AC
399
- */
400
-#define GETACTENV()     lda #<-1
401
-
402
-

+ 1
- 0
arch/gecko/kernel/kenv.a65 View File

@@ -0,0 +1 @@
1
+../../c64/kernel/kenv.a65

+ 0
- 313
arch/pet32k/devices/kbd_pet.a65 View File

@@ -1,313 +0,0 @@
1
-/****************************************************************************
2
-   
3
-    OS/A65 Version 2.0.0
4
-    Multitasking Operating System for 6502 Computers
5
-
6
-    Copyright (C) 1989-1998 Andre Fachat 
7
-
8
-    This program is free software; you can redistribute it and/or modify
9
-    it under the terms of the GNU General Public License as published by
10
-    the Free Software Foundation; either version 2 of the License, or
11
-    (at your option) any later version.
12
-
13
-    This program is distributed in the hope that it will be useful,
14
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
-    GNU General Public License for more details.
17
-
18
-    You should have received a copy of the GNU General Public License
19
-    along with this program; if not, write to the Free Software
20
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
-
22
-****************************************************************************/
23
-
24
-
25
-/**************************************************************************
26
- * Cursor handling
27
- */
28
-
29
-          .(
30
-        .data
31
-crsrfl  .byt 0
32
-crsrcnt .byt 0
33
-        .text
34
-
35
-&inicrsr
36
-        lda #0
37
-        sta crsrfl
38
-        sta crsrcnt
39
-        rts
40
-
41
-&&crsroff .(                    ; disable cursor
42
-          bit crsrfl
43
-          bpl ret               ; not enabled
44
-
45
-          bit crsrfl
46
-          bvc clr               ; not inversed
47
-          ldy spalte
48
-          lda (vzei),y
49
-          eor #$80
50
-          sta (vzei),y
51
-clr       lda #0
52
-          sta crsrfl
53
-&ret      rts
54
-        .)
55
-
56
-&&crsron .(                     ; enable cursor
57
-          bit crsrfl
58
-          bmi irq               ; already enabled
59
-          lda #0                ; inverse cursor next crsrirq
60
-          sta crsrcnt
61
-          lda #128              ; enabled, but not invers
62
-          sta crsrfl
63
-
64
-&irq
65
-          dec crsrcnt
66
-          bpl ret               ; not this time
67
-          lda #10
68
-          sta crsrcnt
69
-
70
-          ldy spalte
71
-          lda (vzei),y
72
-          eor #$80
73
-          sta (vzei),y
74
-          lda crsrfl
75
-          eor #$40
76
-          sta crsrfl
77
-
78
-          rts
79
-          .)
80
-
81
-	.)
82
-
83
-/**************************************************************************
84
- * Bell handling
85
- */
86
-
87
-          .(
88
-          
89
-	.data
90
-pnt       .byt 0
91
-cnt       .byt 0
92
-	.text
93
-
94
-&inibell  
95
-	  lda #%00100100
96
-          sta VIA1+VIA_IER
97
-          lda VIA1+VIA_ACR
98
-          and #%11000011
99
-          ora #%00010000
100
-          sta VIA1+VIA_ACR
101
-&&trigbell 
102
-	  lda #0
103
-          sta pnt
104
-          sta cnt
105
-          lda #15
106
-          sta VIA1+VIA_SR
107
-&&bellirq  
108
-	  lda cnt
109
-          bne endirq
110
-          ldy pnt
111
-          lda tcnt,y
112
-          beq endbell
113
-          sta cnt
114
-          lda tfrq,y
115
-          sta VIA1+VIA_T2CL
116
-          lda #0
117
-          sta VIA1+VIA_T2CH
118
-          inc pnt
119
-endirq    dec cnt
120
-          rts
121
-endbell   lda #0
122
-          sta VIA1+VIA_SR
123
-          rts
124
-          
125
-tcnt      .byt 2,2,2,2,2,2,2,0
126
-tfrq      .byt 32,64,128,32,64,128,32
127
-
128
-          .)
129
- 
130
-/**************************************************************************
131
- * keyboard handling for PET
132
- */
133
-
134
-          .(
135
-
136
-kcnt       =zei2
137
-	.data
138
-rcnt      .byt 0
139
-shiftfl   .byt 0
140
-prev      .byt 0
141
-	.zero
142
-tzei      .word 0
143
-	.text
144
-
145
-&inikbd   .(
146
-          lda PIO+PIA_CRA
147
-          and #255-4
148
-          sta PIO+PIA_CRA
149
-          ldx #15
150
-          stx PIO+PIA_PA
151
-          ora #4
152
-          sta PIO+PIA_CRA
153
-          lda PIO+PIA_CRB
154
-          and #255-4
155
-          sta PIO+PIA_CRB
156
-          ldx #0
157
-          stx PIO+PIA_PB
158
-          ora #4
159
-          sta PIO+PIA_CRB 
160
-	  lda #4
161
-          sta rcnt
162
-          sta rspd
163
-          rts
164
-          .)
165
-
166
-&&getkey   .(
167
-          lda PIO
168
-          and #$f0
169
-          ora #6	; 8 for graphics
170
-          sta PIO
171
-ix1       
172
-	  lda PIO+2
173
-          cmp PIO+2
174
-          bne ix1   
175
-          ldy #0
176
-          and #%01000001
177
-          cmp #%01000001
178
-          beq nshift
179
-          iny
180
-nshift    inc PIO
181
-x0        lda PIO+2
182
-          cmp PIO+2
183
-          bne x0
184
-          and #%00000001
185
-          bne nctrl
186
-          iny
187
-          iny
188
-nctrl     sty shiftfl
189
-
190
-          tya
191
-          asl
192
-          tax
193
-          lda ttab+1,x
194
-          tay
195
-          lda ttab,x
196
-          sta tzei
197
-          sty tzei+1   
198
-          ldy #0
199
-          ldx #0
200
-lx1       stx kcnt
201
-          lda PIO
202
-          and #$f0
203
-          ora kcnt
204
-          sta PIO
205
-          ldx #8
206
-l2        lda PIO+2
207
-          cmp PIO+2
208
-          bne l2
209
-l3        asl
210
-          bcs lc
211
-          pha
212
-          lda (tzei),y
213
-          bne le
214
-          pla
215
-lc        iny
216
-          dex
217
-          bne l3
218
-          ldx kcnt
219
-          inx
220
-          cpx #10
221
-          bcc lx1
222
-
223
-          ldy #<-1
224
-          sty prev
225
-nokey     
226
-/* TODO: check keyboard code - C64 works different */
227
-;	  ldx #KEY_START
228
-;	  stx rcnt
229
-	  ldx shiftfl
230
-          sec
231
-          rts
232
-
233
-le        tax
234
-          pla
235
-          txa
236
-          cpy prev
237
-          sty prev
238
-          bne lx
239
-
240
-          dec rcnt
241
-          bne nokey
242
-          ldx rspd
243
-          .byt $2c
244
-
245
-lx        ldx #KEY_START
246
-          stx rcnt
247
-
248
-          ldx shiftfl
249
-          clc
250
-          rts
251
-          .)
252
-
253
-ttab      .word ktab,stab,ctab,sctab
254
-
255
-#ifndef PET_KEYB_GRAPHICS
256
-
257
-				/* business keyboard */
258
-
259
-ktab      .asc ".", 0, TC_CRGT, "8",0, "8529",0,"^^70741"
260
-	  .asc "5;k]hfs",TC_ESC,"6@l",TC_CR,"jgda"
261
-	  .asc TC_BS,"pi\yrw",0, "4[o", TC_CDWN, "uteq"
262
-	  .asc "3",0,0,"..bc",0,"2",0,0,"0,nvz"
263
-	  .asc "1/",0,TC_HOME,"m x",0,0,0,":",3,"963_"
264
-
265
-stab      .asc 0, 0, TC_CLFT, "8",0, "(%",34,"9^^",0,"70'$!"
266
-	  .asc "5+K]HFS",TC_ESC,"6@L",TC_CR,"JGDA"
267
-	  .asc TC_INS,"PI\YRW",0, "4[O", TC_CUP, "UTEQ"
268
-	  .asc "3",0,0,".>BC",0,"2",0,0,"0<NVZ"
269
-	  .asc "1?",0,TC_CLR,"M X",0,0,0,"*",0,")&#_"
270
-
271
-ctab      .asc ".", 0, TC_WRU, "8",0, "8529",0,"^^70741"
272
-	  .asc "5;^k]^h^f^s",TC_ESC,"6@^l",TC_CR,"^j^g^d^a"
273
-	  .asc TC_DEL,"^p^i\^y^r^w",0, "4[^o", TC_WLO, "^u^t^e^q"
274
-	  .asc "3",0,0,"..^b^c",0,"2",0,0,"0,^n^v^z"
275
-	  .asc "1/",0,TC_WCLS,"^m ^x",0,0,0,":",3,"963_"
276
-
277
-sctab     .asc 0, 0, TC_CLFT, "8",0, "(%",34,"9^^",0,"70'$!"
278
-	  .asc "5+^K]^H^F^S",TC_ESC,"6@^L",TC_CR,"^J^G^D^A"
279
-	  .asc TC_INS,"^P^I\^Y^R^W",0, "4[^O", TC_CUP, "^U^T^E^Q"
280
-	  .asc "3",0,TC_CUP,".>^B^C",0,"2",0,0,"0<^N^V^Z"
281
-	  .asc "1?",0,TC_CLR,"^M ^X",0,0,0,"*",0,")&#_"
282
-
283
-
284
-#else 				/* graphics keyboard */
285
-
286
-ktab      .asc TC_CRGT,TC_HOME,"~(&%#!",TC_BS,TC_CDWN,"^@)\'$":.byt $22
287
-          .asc "97^^outeq/8^@piyrw"
288
-          .asc "64^@ljgda*5^@:khfs"
289
-          .asc "31",TC_CR,";mbcz+2^@?,nvx"
290
-          .asc "-0^@>^@]@^@=.^@",3,"< [^@"
291
-
292
-stab      .asc TC_CLFT,TC_CLR,"|(&%#!",TC_INS,TC_CUP,"^@)\'$":.byt $22
293
-          .asc "97^^OUTEQ/8^@PIYRW"
294
-          .asc "64^@LJGDA*5^@:KHFS"
295
-          .asc "31",TC_LF,";MBCZ+2^@?,NVX"
296
-          .asc "-0^@>^@}@^@=.^@",TC_ESC,"< {^@"
297
-
298
-ctab      .asc TC_WRU,TC_WCLS,"~(&%#!",TC_DEL,TC_WLO,"^@)\'$",$22
299
-          .asc "97^^^o^u^t^e^q/8^@^p^i^y^r^w"
300
-          .asc "64^@^l^j^g^d^a*5^@:^k^h^f^s"
301
-          .asc "31",TC_EOL,";^m^b^c^z+2^@?,^n^v^x"
302
-          .asc "-0^@>^@]@^@=.^@",TC_CLL,"< [^@"
303
-
304
-sctab     .asc "^@^@|(&%#!^H^@^@)\'$":.byt $22
305
-          .asc "97^^O^U^T^E^Q/8^@^P^I^Y^R^W"
306
-          .asc "64^@^L^J^G^D^A*5^@:^K^H^F^S"
307
-          .asc "31^m;^M^B^C^Z+2^@?,^N^V^X"
308
-          .asc "-0^@>^@}@^@=.^@@< {^@"
309
-
310
-#endif
311
-
312
-	.)
313
-

+ 1
- 0
arch/pet32k/devices/kbd_pet.a65 View File

@@ -0,0 +1 @@
1
+../../cbm8x96/devices/kbd_pet.a65

+ 0
- 366
arch/pet32k/devices/piec_pet.a65 View File

@@ -1,366 +0,0 @@
1
-/****************************************************************************
2
-   
3
-    OS/A65 Version 2.0.0
4
-    Multitasking Operating System for 6502 Computers
5
-
6
-    Copyright (C) 1989-1998 Andre Fachat 
7
-
8
-    This program is free software; you can redistribute it and/or modify
9
-    it under the terms of the GNU General Public License as published by
10
-    the Free Software Foundation; either version 2 of the License, or
11
-    (at your option) any later version.
12
-
13
-    This program is distributed in the hope that it will be useful,
14
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
-    GNU General Public License for more details.
17
-
18
-    You should have received a copy of the GNU General Public License
19
-    along with this program; if not, write to the Free Software
20
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
-
22
-****************************************************************************/
23
-
24
-
25
-#define   VIA1      $e840
26
-#define   PIA2      $e820
27
-#define   PIA1      $e810
28
-
29
-#include "chips/via6522.i65"
30
-#include "chips/pia6521.i65"
31
-
32
-#ifdef FSIEC_USE_STDLIB
33
-#define	CHDIR	Chdir
34
-#define	ASSIGN	Assign
35
-#endif
36
-
37
-	.data
38
-byte      .byt 0
39
-bytfl     .byt 0
40
-eoifl     .byt 0
41
-	.text
42
-
43
-&getif  clc
44
-	ldx #SEM_VIAE840_T1
45
-	jmp PSEM
46
-&freif	ldx #SEM_VIAE840_T1
47
-	jmp VSEM
48
- 
49
-&IECINIT  .(
50
-          lda #%00111000
51
-          sta PIA2+PIA_CRA
52
-          lda #0
53
-          sta PIA2+PIA_PA          ; DDRA
54
-          cmp PIA2+PIA_PA
55
-          bne inix
56
-          lda #%00111100           ; CA2 = NDAC hi
57
-          sta PIA2+PIA_CRA
58
-          
59
-          lda #%00111000
60
-          sta PIA2+PIA_CRB
61
-          lda #$ff
62
-          sta PIA2+PIA_PB          ; DDRB
63
-          cmp PIA2+PIA_PB
64
-          bne inix
65
-          lda #%00111100           ; CB2 = DAV hi
66
-          sta PIA2+PIA_CRB
67
-          lda #<-1                 ; DRB
68
-          sta PIA2+PIA_PB
69
-
70
-          lda #%00111000
71
-          sta PIA2+PIA_CRA
72
-          lda PIA2+PIA_PA          ; DDRA
73
-	  and #%10111111
74
-          sta PIA2+PIA_PA          ; DDRA
75
-          cmp PIA2+PIA_PA
76
-          bne inix
77
-          lda #%00111100           ; CA2 = NDAC hi
78
-          sta PIA2+PIA_CRA
79
-
80
-	  lda PIA1+PIA_CRA
81
-          ora #%00111100           ; CA2 = EOI hi
82
-	  sta PIA1+PIA_CRA
83
-	 
84
-	  lda VIA1+VIA_DDRB
85
-	  and #%00111110 
86
-          ora #%00000110
87
-          sta VIA1+VIA_DDRB
88
-          cmp VIA1+VIA_DDRB
89
-          bne inix
90
-	  lda VIA1+VIA_DRB
91
-	  ora #%00000110
92
-          sta VIA1+VIA_DRB         ; alle ausgaenge hi
93
-
94
-          lda VIA1+VIA_ACR
95
-          and #%00111101           ; PB2 Latch off, T1 timed IRQ
96
-          sta VIA1+VIA_ACR
97
-          lda VIA1+VIA_PCR
98
-          ora #%11100000           ; cb2 hi out (Piezo)
99
-          sta VIA1+VIA_PCR
100
-          lda #%01011000           ; T1, CB1, CB2 -IRQ off 
101
-          sta VIA1+VIA_IER
102
-          lda #0
103
-          sta byte
104
-          sta bytfl
105
-          sta eoifl
106
-          clc
107
-          rts
108
-inix      sec
109
-          rts
110
-          .)
111
-
112
-/* Blocktiefe 2 */
113
-
114
-#ifndef NOFS
115
-
116
-aout	=atnout
117
-/*
118
-aout      pha
119
-          lda #0
120
-          sta status
121
-          jsr nrfdhi
122
-          jsr ndachi
123
-         
124
-          lda bytfl
125
-          beq oo1
126
-          sec
127
-          ror eoifl
128
-          jsr iecout
129
-          lda #0
130
-          sta bytfl
131
-
132
-oo1       pla
133
-          sta byte
134
-*/
135
-iec0out   sei
136
-          jsr waitdavhi
137
-          jsr atnlo
138
-
139
-iecout    .(
140
-          sei
141
-jsr nrfdhi
142
-jsr ndachi
143
-          jsr davhi
144
-          jsr tstdev     ;nrfdhi & ndachi = z
145
-          beq devnotpr
146
-          lda byte
147
-          jsr out
148
-ox1       JSR setti
149
-ox1a      JSR fragti
150
-          BNE XTO
151
-          bit VIA1+VIA_DRB
152
-          bvc ox1a       ; wait nrfd hi
153
-          lda eoifl
154
-          bpl o0
155
-          jsr eoilo
156
-o0        jsr davlo
157
-          jsr setti
158
-o1        jsr fragti
159
-          bne timeout
160
-          jsr fragndac   ; wait ndac hi
161
-          bcc o1
162
-          jsr davhi
163
-          jsr eoihi
164
-          lsr eoifl
165
-          jsr clrdata    ; alle data hi
166
-ox2       lda VIA1+VIA_DRB
167
-          lsr
168
-          bcs ox2        ; wait ndaclo
169
-          clc
170
-;          cli
171
-          rts
172
-          
173
-XTO       JSR YIELD
174
-          SEI
175
-          JMP ox1
176
-          .)
177
-          
178
-&seclisten sta byte
179
-          jsr iecout
180
-          jsr atnhi
181
-          cli
182
-          rts
183
-#endif
184
-
185
-timeout   lda #1
186
-          .byt $2c
187
-devnotpr  lda #128
188
-          jsr seterr
189
-          jsr eoihi
190
-          jsr davhi
191
-          jsr ndachi
192
-          sec
193