CSRCS = devtty.c devrd.c
-CSRCS += devices.c main.c libc.c
+CSRCS += devices.c main.c
ASRCS = tgl6502.s crt0.s
ASRCS += tricks.s commonmem.s
../devio.o ../filesys.o ../process.o ../inode.o ../syscall_fs.o \
../syscall_proc.o ../syscall_other.o ../mm.o ../swap.o ../bankfixed.o \
../tty.o ../devsys.o ../syscall_fs2.o ../syscall_exec.o \
- ../usermem.o ../usermem_std-6502.o devtty.o libc.o
+ ../usermem.o ../usermem_std-6502.o devtty.o
/* For now used BANK_FIXED as we don't yet have sane swap with 16K maps */
#define CONFIG_BANK_FIXED
#define MAX_MAPS 2
-#define MAP_SIZE 0xC000
+#define MAP_SIZE 0xE000
/* And swapping */
#define SWAPDEV 257 /* FIXME */
-#define SWAP_SIZE 0x60 /* 48K in blocks */
+#define SWAP_SIZE 0x70 /* 56K in blocks */
#define SWAPBASE 0x0000 /* We swap the lot in one, include the */
-#define SWAPTOP 0xC000 /* vectors so its a round number of sectors */
+#define SWAPTOP 0xE000 /* vectors so its a round number of sectors */
/* FIXME: we need to swap the udata separately */
#define MAX_SWAPS 32
#define TICKSPERSEC 10 /* Ticks per second */
-#define PROGBASE 0x0200 /* also data base */
-#define PROGLOAD 0x0200
-#define PROGTOP 0xC000 /* Top of program */
+#define PROGBASE 0x2000 /* also data base */
+#define PROGLOAD 0x2000
+#define PROGTOP 0xE000 /* Top of program */
#define BOOT_TTY 513 /* Set this to default device for stdio, stderr */
sta ptr1
lda #>__BSS_RUN__
sta ptr1+1
- lda #0
- tay
lda #'z'
sta $FF03
+ lda #0
+ tay
ldx #>__BSS_SIZE__
beq bss_wipe_tail
bss_wiper_1: sta (ptr1),y
+++ /dev/null
-#include "cpu.h"
-
-void *memcpy(void *d, void *s, size_t sz)
-{
- unsigned char *dp, *sp;
- while(sz--)
- *dp++=*sp++;
- return d;
-}
-
-size_t strlen(const char *p)
-{
- const char *e = p;
- while(*e++);
- return e-p-1;
-}
-
sta _ramsize
lda #120
sta _procmem
-
jsr program_vectors_k
rts
sta $FFFB
; However tempting it may be to use BRK for system calls we
; can't do this on an NMOS 6502 because the chip has brain
- ; dead IRQ handling buts that could simply "lose" the syscall!
+ ; dead IRQ handling bits that could simply "lose" the syscall!
lda #<syscall_entry
sta syscall
lda #>syscall_entry
; banking/mappings without having to leave interrupts off all the time
;
map_process_always:
+ pha
+ txa
pha
lda #<U_DATA__U_PAGE
ldx #>U_DATA__U_PAGE
jsr map_process_2
pla
+ tax
+ pla
rts
;
; X,A points to the map table of this process
; common area just to balance out memory usages).
;
map_kernel:
+ pha
+ txa
pha
; Common is left untouched as is ZP and S
lda #$01 ; Kernel RAM at 0x2000-0x3FFF
inx
stx $FF91
pla
+ tax
+ pla
rts
; X,A holds the map table of this process
sta ptr1
tya
pha
- sty ptr1+1
+ stx ptr1+1
ldy #0
lda (ptr1),y ; 4 bytes if needed
+ tax
jsr restore_bits
pla
tay
; we go to proper banking
rts
-; Save the current mapping.
;
-; FIXME: need to copy the 8 byte area
+; Save the current mapping.
+; May not be sufficient if we want IRQs on while doing page tricks
;
map_save:
pha
+ lda U_DATA__U_PAGE
sta saved_map
pla
rts