ASRCS = p68000.S crt0.S
ASRCS += tricks.S
-COBJS = $(CSRCS:.c=$(BINEXT))
-AOBJS = $(ASRCS:.S=.o)
LSRCS = ../lib/68000exception.c
LOBJS = $(patsubst ../lib/%.c,%.o, $(LSRCS))
-OBJS = $(COBJS) $(AOBJS) $(LOBJS)
+DSRCS = ../dev/mbr.c ../dev/blkdev.c
+DOBJS = $(patsubst ../dev/%.c,%.o, $(DSRCS))
+
+COBJS = $(CSRCS:.c=$(BINEXT))
+AOBJS = $(ASRCS:.S=.o)
+
+OBJS = $(COBJS) $(AOBJS) $(DOBJS) $(LOBJS)
+
+CROSS_CCOPTS += -I../dev/
all: $(OBJS)
$(AOBJS): %.o: %.S
$(CROSS_AS) $(ASOPTS) $< -o $*.o
+$(DOBJS): %.o: ../dev/%.c
+ $(CROSS_CC) $(CROSS_CCOPTS) -c $<
+
$(LOBJS): %.o: ../lib/%.c
$(CROSS_CC) $(CROSS_CCOPTS) -c $<
../tty.o ../devsys.o ../usermem.o ../syscall_fs2.o \
../syscall_fs3.o ../syscall_exec32.o \
../usermem_std-68000.o devlpr.o devtty.o libc.o ../vt.o ../malloc.o \
+ blkdev.o mbr.o \
../font8x8.o >../fuzix.map
m68k-uclinux-objcopy fuzix.elf -O binary ../fuzix.bin
# And now make a bootable floppy
This is an initial 'gee it compiles' work in progress initial 68000 port
-Don't expect it to do anything !
+Status:
+- Makes a bootable floppy correctly
+- Floppy loads kernel and transfers to it
+- Video seems to work (at least for high resolution)
+ (but clear to end of line is not yet done)
+- Keyboard is done
+- Timer interrupt is running
+- Gets us to the point of prompting for a boot device
+- Error trap handling seems to be a bit busted up
+
+In Progress
+- Writing drivers for floppy, ACSI/SCSI, and IDE controllers
+
+TODO
+- Clean up and abstract PSG GPIO interfaces and locking nicely
+- Write the delay loop for the DMA. Probably a good excuse to use
+ the Linux 68K bogomips logic
+- Probe for STe and Mega systems
+- FDC set sides etc
Notes:
Need to support 'resident' style binaries
Start of disk boot block info ?
-Tidy up di/ei usage - we don't want to turn on hblank at random in our ei
-stuff!!!
-
-First boot sector loaded into buffer. must checksum to $1234
-then executed. Must be PI
-
-Eventually need multi-segment executables
-
-
Interrupts
2 - hblank
#define NBUFS 10 /* Number of block buffers */
#define NMOUNTS 4 /* Number of mounts at a time */
+#define MAX_BLKDEV 4
+
/* TODO tty scan rows/cols etc */
{
timer_t x = set_timer_duration(3 * TICKSPERSEC);
while (!timer_expired(x)) {
- if (!((*(volatile uint8_t *)0xFFFA81) & 0x20))
+ uint8_t status = *(volatile uint8_t *)0xFFFA01;
+ if (!(status & 0x20))
return 0;
platform_idle();
}
void fd_probe(void)
{
+ /* Do we need to deal with waiting for motor off here ? */
locked = 1;
fd_probe_drive(0);
fd_probe_drive(1);
#include <kdata.h>
#include <devfd.h>
#include <devsys.h>
+#include <blkdev.h>
#include <devlpr.h>
#include <tty.h>
#include <vt.h>
{
// minor open close read write ioctl
// -----------------------------------------------------------------
- /* 0: /dev/fd Floppy disc block devices */
- { fd_open, no_close, fd_read, fd_write, no_ioctl },
- /* 1: /dev/hd Hard disc block devices (absent) */
- { nxio_open, no_close, no_rdwr, no_rdwr, no_ioctl },
+ /* 0: /dev/hd Hard disc block devices */
+ { blkdev_open, no_close, blkdev_read, blkdev_write, blkdev_ioctl },
+ /* 1: /dev/fd Floppy disc block devices */
+ { fd_open, no_close, fd_read, fd_write, no_ioctl },
/* 2: /dev/tty TTY devices */
- { tty_open, tty_close, tty_read, tty_write, vt_ioctl },
+ { tty_open, tty_close, tty_read, tty_write, vt_ioctl },
/* 3: /dev/lpr Printer devices */
- { lpr_open, lpr_close, no_rdwr, lpr_write, no_ioctl },
+ { lpr_open, lpr_close, no_rdwr, lpr_write, no_ioctl },
/* 4: /dev/mem etc System devices (one offs) */
- { no_open, no_close, sys_read, sys_write, sys_ioctl },
+ { no_open, no_close, sys_read, sys_write, sys_ioctl },
/* Pack to 7 with nxio if adding private devices and start at 8 */
};
}
void device_init(void)
{
+ fd_probe();
}