../syscall_exec16.o devtty.o libc.o ../vt.o video.o ../syscall_fs3.o \
../font8x8.o
../tools/decb-image <../fuzix.bin fuzix.img
-
-
+ dd if=fuzix.img of=fuzix.rom bs=1024 skip=48 count=16
+ dd if=fuzix.img of=fuzix.ide bs=256 skip=26 count=102
+ dd if=fuzix.img of=fuzix.ide bs=256 skip=1 count=1 conv=notrunc
TODO
====
-Test it
Make the boot loader robust (timeout handling)
-Add magic numbers to check we loaded the right thing!
+Add hash of code not just simple magic - so we know bits match
+Why doesn't coco keyboard auto-mapping work ?
+Why don't we find the root fs (IDE mapping bug ?)
+
Support for a real time clock and clock locking
Review irq disabling. We shouldn't need much of this at all as we don't have
floppy hell to contend with, but the switchin/switchout logic needs to be
We have about 2K left to try and jam those bits in which might just about be
enough to add support for very minimal MBR parsing and offsets. That would
-be a big improvement and make the current loading of the kernel image from
-blocks 1-51 of the disk sensible. If not we need to move it.
+be a big improvement.
+
+
+To Test
+=======
+
+Build the image and you'll get a fuzix.ide and fuzix.rom
+
+In the xroar directory where you have a hard disc image do
+
+dd if=/tmp/fuzix.ide of=hd0.img bs=512 seek=3 conv=notrunc
+/opt/xroaride/bin/xroar -default-machine dragon64 -cart ide -cart-rom fuzix.rom
+
+(use dragon64 until I fix the coco keymapping stuff)
+
+exec 49152
+enjoy
std ,x++
cmpx #$1C00
bne ud_wipe
-endstr: rts
+ lda ,x+
+ cmpa $15
+ bne wrong
+ lda ,x+
+ cmpa $C0
+ bne wrong
+ rts
load_error:
ldu #fail
+ bsr copy_str
+l1: bra l1
+
copy_str:
lda ,u+
beq endstr
sta ,y+
bra copy_str
+endstr: rts
fail:
.ascii "Fail"
.db 0
+wrong:
+ .ascii "Wrong image"
+ .db 0
lda 0xFF03
ora #1
sta 0xFF03
+ jsr _vid256x192
jsr _vtinit
rts
; No memory management for now
;
_program_vectors:
+ rts
+
map_kernel:
pshs a
- clr $ffdf ; ROM in
+ clr $ffde ; ROM in
lda #1
map_kr:
sta romin
map_process:
map_process_always:
map_process_a:
- clr $ffde ; ROM out
+ clr $ffdf ; ROM out
clr romin
rts
lda romsave
sta romin
bne map_kr
- clr $ffde
+ clr $ffdf
puls a,pc
map_save:
orcc #0x10
stop: bra stop
+ .area .magic
+ .db $15,$C0,$DE,$4C,$0C,$02
+
static const char *sysname[] = {"Dragon", "COCO", "COCO3", "Unknown"};
+#if 0
struct cart_rom_id {
uint16_t hash;
uint8_t id;
} while(cart++->hash);
return NULL;
}
+#endif
void map_init(void)
{
uint8_t i;
+#if 0
uint8_t bslot = 0;
uint16_t hash;
struct cart_rom_id *rom;
+#endif
kprintf("%s system.\n", sysname[system_id]);
+#if 0
+ /* We would have to do the mpi management in asm and we really
+ don't have enough memory to care about this ! */
if (mpi_present()) {
kputs("MPI cartridge detected.\n");
cartslots = 4;
i == bslot ? '*':' ');
}
mpi_set_slot(bootslot);
+#endif
/* We put swap on the start of slice 0, but with the first 64K free
so we can keep the OS image linearly there */
for (i = 0; i < MAX_SWAPS; i++)
uint8_t membanks;
uint8_t system_id;
+#if 0
uint8_t cartslots = 1;
uint8_t carttype[4];
uint8_t bootslot = 0;
+#endif
uint16_t swap_dev;
void platform_idle(void)
void platform_discard(void)
{
}
-
+#if 0
/* Find a cartridge or it's slot */
int cart_find(int id)
{
}
return -1;
}
+#endif
unsigned char vt_mangle_6847(unsigned char c)
{
giveup = set_timer_ms(2000);
+ kprintf("%x : ", dev);
+
if (ide_wait_nbusy() == -1)
return;
*devh = dev << 4; /* Select */
return;
if (ide_wait_drdy() == -1)
return;
- kprintf("%x : ", dev);
/* Check the LBA bit is set, and print the name */
dptr = buf + 54; /* Name info */
if (*dptr)
- for (i = 0; i < 40; i++)
- kputchar(*dptr++);
+ for (i = 0; i < 20; i++) {
+ kputchar(dptr[1]);
+ kputchar(*dptr);
+ dptr += 2;
+ }
if (!(buf[99] & 0x02)) { /* No LBA ? */
kputs(" - non-LBA\n");
return;
lda 4,s
bsr vidaddr ; preserves X (holding the char)
tfr x,d
- anda $7F ; no high font bits
- suba $20 ; skip control symbols
+ andb #$7F ; no high font bits
+ subb #$20 ; skip control symbols
rolb ; multiply by 8
rola
rolb