sbcv2: First cut at Zeta floppy support
authorAlan Cox <alan@linux.intel.com>
Sun, 26 Aug 2018 13:06:07 +0000 (14:06 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 26 Aug 2018 13:06:07 +0000 (14:06 +0100)
Kernel/platform-sbcv2/Makefile
Kernel/platform-sbcv2/config.h
Kernel/platform-sbcv2/devices.c
Kernel/platform-sbcv2/fuzix.lnk
Kernel/platform-sbcv2/kernel.def

index 67777c7..4773ae6 100644 (file)
@@ -12,6 +12,9 @@ ASRCS += tricks.s commonmem.s
 DISCARD_DSRCS = ../dev/devide_discard.c
 DSRCS = ../dev/blkdev.c ../dev/devide.c ../dev/mbr.c
 DSRCS += ../dev/propio2.c ../dev/ds1302.c
+DSRCS += ../dev/devfd.c
+
+DASRCS = ../dev/devfd_hw.s
 
 NSRCS = 
 
@@ -21,8 +24,9 @@ NOBJS = $(patsubst ../dev/net/%.c,%.rel, $(NSRCS))
 DISCOBJS = $(DISCSRCS:.c=.rel)
 DISCARD_DOBJS = $(patsubst ../dev/%.c,%.rel, $(DISCARD_DSRCS))
 DOBJS = $(patsubst ../dev/%.c,%.rel, $(DSRCS))
+DAOBJS = $(patsubst ../dev/%.s,%.rel, $(DASRCS))
 
-OBJS  = $(COBJS) $(AOBJS) $(NOBJS) $(DISCOBJS) $(DOBJS) $(DISCARD_DOBJS)
+OBJS  = $(COBJS) $(AOBJS) $(NOBJS) $(DISCOBJS) $(DOBJS) $(DISCARD_DOBJS) $(DAOBJS)
 
 JUNK =  *.lst *.asm *.sym *.rst *.lst
 
@@ -46,6 +50,9 @@ $(NOBJS): %.rel: ../dev/net/%.c
 $(AOBJS): %.rel: %.s
        $(CROSS_AS) $(ASOPTS) $<
 
+$(DAOBJS): %.rel: ../dev/%.s
+       $(CROSS_AS) $(ASOPTS) $@ $<
+
 clean:
        rm -f $(OBJS) $(JUNK)  core *~
 
index c7e414f..0e3a5c2 100644 (file)
@@ -24,6 +24,8 @@
 /* PPIDE is present */
 #define CONFIG_IDE
 #define CONFIG_PPIDE
+/* Floppy controller does not do high density */
+#define CONFIG_FLOPPY_NOHD
 
 #define CONFIG_DYNAMIC_BUFPOOL
 #define CONFIG_DYNAMIC_SWAP
 
 #define CONFIG_BANKS   2       /* 2 x 32K */
 
-/* For now we don't support resizing */
-#define VT_WIDTH       80
-#define VT_HEIGHT      25
-#define VT_RIGHT       79
-#define VT_BOTTOM      24
-
 #define TICKSPERSEC 10     /* Ticks per second */
 #define PROGBASE    0x0000  /* Base of user  */
 #define PROGLOAD    0x0100  /* Load and run here */
index a854830..b91e2db 100644 (file)
@@ -7,13 +7,14 @@
 #include <blkdev.h>
 #include <devide.h>
 #include <printf.h>
+#include <devfd.h>
 
 struct devsw dev_tab[] =  /* The device driver switch table */
 {
   /* 0: /dev/hd                Hard disc block devices */
   {  blkdev_open, no_close,     blkdev_read,   blkdev_write,   blkdev_ioctl  },
   /* 1: /dev/fd                Floppy disc block devices */
-  {  nxio_open,   no_close,     no_rdwr,       no_rdwr,        no_ioctl  },
+  {  fd_open,     fd_close,     fd_read,       fd_write,       no_ioctl  },
   /* 2: /dev/tty       TTY devices */
   {  tty_open,    tty_close,    tty_read,      tty_write,      tty_ioctl },
   /* 3: /dev/lpr       Printer devices */
index 5a3530c..121653c 100644 (file)
@@ -42,4 +42,6 @@ platform-sbcv2/propio2.rel
 platform-sbcv2/ppide.rel
 platform-sbcv2/ds1302.rel
 platform-sbcv2/ds1302-n8vem.rel
+platform-sbcv2/devfd.rel
+platform-sbcv2/devfd_hw.rel
 -e
index 00c2637..ca90eb8 100644 (file)
@@ -1,4 +1,4 @@
-; UZI mnemonics for memory addresses etc
+; FUZIX mnemonics for memory addresses etc
 
 U_DATA                      .equ 0xF000       ; (this is struct u_data from kernel.h)
 U_DATA__TOTALSIZE           .equ 0x200        ; 256+256 bytes)
@@ -15,3 +15,11 @@ Z80_MMU_HOOKS                    .equ 0
 CONFIG_SWAP                .equ 1
 
 NBUFS                      .equ 5
+
+; FDC9266 floppy controller ports
+FDC_CCR                .equ    0       ; No CCR
+FDC_MSR                .equ    0x36    ; 8272 Main Status Register (R/O)
+FDC_DATA       .equ    0x37    ; 8272 Data Port (R/W)
+FDC_DOR                .equ    0x38    ; Digital Output Register (W/O)
+
+CPU_CLOCK_KHZ  .equ    8000    ; 8MHz is usual top