From 33cfbf0b4d31750952995718475b337e160dfa58 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 23 Jun 2017 18:05:19 +0100 Subject: [PATCH] micropack: more experimentation Still not useful but we now have the notion of a 'level 0' implementation and takes us a bit closer to the goal --- Kernel/platform-micropack/bootblock.s | 9 ++++++--- Kernel/platform-micropack/config.h | 7 ++++--- Kernel/platform-micropack/crt0.s | 3 +++ Kernel/platform-micropack/fuzix.lnk | 8 ++++---- Kernel/platform-micropack/rules.mk | 10 +++++----- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Kernel/platform-micropack/bootblock.s b/Kernel/platform-micropack/bootblock.s index 926128e0..34b6794c 100644 --- a/Kernel/platform-micropack/bootblock.s +++ b/Kernel/platform-micropack/bootblock.s @@ -34,7 +34,8 @@ diskload: di ld a, #59 ; start on track 60 out (11), a exx - ld c, #17 ; number of tracks to load (56Kish) + ld c, #12 ; number of tracks to load (0x6000 + ; to 0xFBFF) load_tracks: in a, (11) inc a ; track out (11), a @@ -66,6 +67,8 @@ load_sectors: exx ld de, #128 add hl, de djnz load_sectors ; 26 sectors = 3328 bytes + ld a,#'@' + out (1),a dec c jr nz, load_tracks ld a, #0xc9 ; to help debug @@ -74,8 +77,8 @@ load_sectors: exx out (1), a ld a, #10 out (1), a - jp 0x88 + jp 0x8000 - .ds 25 + .ds 20 stack: .db 0xff diff --git a/Kernel/platform-micropack/config.h b/Kernel/platform-micropack/config.h index 69892eb6..439d179a 100644 --- a/Kernel/platform-micropack/config.h +++ b/Kernel/platform-micropack/config.h @@ -21,15 +21,16 @@ #define CONFIG_BANKS 1 #define PTABSIZE 8 +#define ITABSIZE 15 #define TICKSPERSEC 100 /* Ticks per second */ #define PROGBASE 0x0000 /* also data base */ #define PROGLOAD 0x0100 -#define PROGTOP 0x7E00 /* Top of program, base of U_DATA */ +#define PROGTOP 0x6D00 /* Top of program, base of U_DATA */ #define PROC_SIZE 32 /* Memory needed per process */ -#define SWAP_SIZE 0x40 /* 32K in blocks (we actually don't need the low 256) */ +#define SWAP_SIZE 0x30 /* in blocks (we actually don't need the low 256) */ #define SWAPBASE 0x0000 /* We swap the lot in one, include the */ -#define SWAPTOP 0x8000 /* vectors so its a round number of sectors */ +#define SWAPTOP 0x6000 /* vectors so its a round number of sectors */ #define MAX_SWAPS PTABSIZE /* The full drive would actually be 170! */ #define swap_map(x) ((uint8_t *)(x)) /* Simple zero based mapping */ diff --git a/Kernel/platform-micropack/crt0.s b/Kernel/platform-micropack/crt0.s index 6e7a767e..71f12d40 100644 --- a/Kernel/platform-micropack/crt0.s +++ b/Kernel/platform-micropack/crt0.s @@ -33,11 +33,14 @@ .globl s__DATA .globl l__DATA .globl kstack_top + .globl init ; startup code .area _CODE init: di + ld a,#'*' + out (1),a ld sp, #kstack_top ; Configure memory map diff --git a/Kernel/platform-micropack/fuzix.lnk b/Kernel/platform-micropack/fuzix.lnk index caee95d2..506c22f4 100644 --- a/Kernel/platform-micropack/fuzix.lnk +++ b/Kernel/platform-micropack/fuzix.lnk @@ -1,9 +1,9 @@ -mwxuy --r -i fuzix.ihx --b _DISCARD=0x6000 --b _UDATA=0x7E00 --b _CODE=0x8000 +-b _INITIALIZER=0x1000 +-b _DISCARD=0x5000 +-b _UDATA=0x5D00 +-b _CODE=0x6000 -l z80 platform-micropack/crt0.rel platform-micropack/commonmem.rel diff --git a/Kernel/platform-micropack/rules.mk b/Kernel/platform-micropack/rules.mk index 51797902..990c36a8 100644 --- a/Kernel/platform-micropack/rules.mk +++ b/Kernel/platform-micropack/rules.mk @@ -2,8 +2,8 @@ # Use RST8 for call preamble # CROSS_CCOPTS += --peep-file $(ROOT_DIR)/cpu-z80/rst8.peep -export CROSS_CC_SYS1=--codeseg CODE3 -export CROSS_CC_SYS2=--codeseg CODE4 -export CROSS_CC_SYS3=--codeseg CODE5 -export CROSS_CC_SYS4=--codeseg CODE6 -export CROSS_CC_SYS5=--codeseg CODE7 +#export CROSS_CC_SYS1=--codeseg CODE3 +#export CROSS_CC_SYS2=--codeseg CODE4 +#export CROSS_CC_SYS3=--codeseg CODE5 +#export CROSS_CC_SYS4=--codeseg CODE6 +#export CROSS_CC_SYS5=--codeseg CODE7 -- 2.34.1