- timer
- ramdiscs
- SD card
-- two serial ports (USB virtual and native)
+- two serial ports (USB virtual and native) (currently not quite working)
It does not support
- speed setting on the uarts with the newer FPGA firmware
This port is heavily based upon (and mostly consists of) code by Will
Sowerbutts.
+
+
+MMU
+---
+
+The MMU has 4K pages, but we use them in 16K blocks. It also supports both
+read-only pages and an MMU bypass for copying memory. The read-only bit
+isn't yet used but ought to be used to protect kernel space. The bypass mode
+is used and any code using it *MUST* not use it from an IRQ or if it does
+must save/restore it properly.
#define TICKSPERSEC 100 /* Ticks per second */
#define PROGBASE 0x0000
#define PROGLOAD 0x0100 /* also data base */
-#define PROGTOP 0xF700 /* Top of program, base of U_DATA */
+#define PROGTOP 0xF800 /* Top of program, base of U_DATA */
#define BOOT_TTY (512 + 1)/* Set this to default device for stdio, stderr */
/* In this case, the default is the first TTY device */
-mwxuy
-i fuzix.ihx
-b _CODE=0x0088
--b _COMMONMEM=0xF700
+-b _COMMONMEM=0xF800
-b _DISCARD=0xE000
-l z80
platform-socz80/crt0.rel
; UZI mnemonics for memory addresses etc
-U_DATA .equ 0xf700 ; (this is struct u_data from kernel.h)
+U_DATA .equ 0xf800 ; (this is struct u_data from kernel.h)
U_DATA__TOTALSIZE .equ 0x300 ; 256+256+256 bytes.
Z80_TYPE .equ 0 ; Actually a T80
; 2013-12-21 William R Sowerbutts
+; 2015-01-30 Alan Cox
.module tricks
.include "../kernel.def"
.include "kernel.def"
- .area _COMMONMEM
+;
+; These do not need to be in common memory as we don't have to
+; pull udata remapping tricks on a 16K banked system. In the case of
+; SocZ80 they *MUST NOT* be in common as they reload the MMU page for
+; 0xF000. That takes multiple instructions and the code will vanish
+; midstream if it is in common space!
+;
+ .area _CODE2
; Switchout switches out the current process, finds another that is READY,
; possibly the same process, and switches it in. When a process is
; load into MMU
ld a, #0x0F
out (MMU_SELECT), a
- ld a, d
+ ld a, h
out (MMU_FRAMEHI), a
- ld a, e
+ ld a, l
out (MMU_FRAMELO), a
+ ld a,#'!'
+ call outchar
+
; now the copy operation is complete we can get rid of the stuff
; _switchin will be expecting from our copy of the stack.
pop bc
; save the parent mapping
ld b, a
- call outcharhex
- ld a, c
- call outcharhex
; store the old MMU mapping
ld a, #0x0E
out (MMU_SELECT), a
; child base page is in c parent in b
ld d,#0
- ld l,d
- ld c,a
+ ld l, d
+ ld a, c
sla a
rl d
sla a
rl d
sla a
rl d ; de now holds the src pointer
+ ld e, a
ld b, #4 ; we're going to copy 16K
copynextpage:
push hl
push de
push bc
+ call outde
+ call outhl
ld hl, #0xe000
ld de, #0xd000