Alan Cox [Mon, 22 Dec 2014 14:30:28 +0000 (14:30 +0000)]
nc100: add RTC support
Alan Cox [Mon, 22 Dec 2014 13:04:09 +0000 (13:04 +0000)]
trs80: CRTC reg 0 was not being set
Backported from Microbee port
Alan Cox [Mon, 22 Dec 2014 13:03:54 +0000 (13:03 +0000)]
trs80: turn on the RTC support
Alan Cox [Mon, 22 Dec 2014 12:42:14 +0000 (12:42 +0000)]
ubee: 64 ticks/second and turn on the RTC
We'll need the RTC in fact as 64 doesn't divide by 10
Alan Cox [Mon, 22 Dec 2014 12:39:17 +0000 (12:39 +0000)]
timer: add initial support for RTC seconds locking
We don't try and use the RTC as our actual clock. Many RTCs are not Y2K safe
or have their own interesting sets of problems. We would also have to keep
doing Unix type v RTC time conversion maths.
Instead we treat the RTC seconds as a free running counter and update our
second tick as we see the RTC one shift. This also gives us up to 59 seconds
of 'overrun' which should do for the worst case disk I/O problems.
Alan Cox [Mon, 22 Dec 2014 12:38:30 +0000 (12:38 +0000)]
process: note problem to look at wrt ubee and 64 ticks/second
Alan Cox [Mon, 22 Dec 2014 12:38:12 +0000 (12:38 +0000)]
ubee: clean up some remaining TRS80isms
Alan Cox [Mon, 22 Dec 2014 11:51:50 +0000 (11:51 +0000)]
ubee: enable CRTC loading
Load the CRTC up for 80x25 mode using the table given in the 256TC manuals
Alan Cox [Mon, 22 Dec 2014 11:51:15 +0000 (11:51 +0000)]
trs80: Set a 2ms seek time on the hard disk
Alan Cox [Sun, 21 Dec 2014 22:07:57 +0000 (22:07 +0000)]
ubee,devhd: step rates and the like
Alan Cox [Sun, 21 Dec 2014 21:58:01 +0000 (21:58 +0000)]
ubee: Further floppy driver bashing
512 bytes/sector, double sided
Also set the step to 6ms
Alan Cox [Sun, 21 Dec 2014 21:17:47 +0000 (21:17 +0000)]
ubee: More work on the disk controllers
Set the WD1002 up correctly for and work in 512 bytes/sector mode. This should
bring the devhd side roughly where we need it. This doesn't deal with the
precomp values (can we trust the firmware?) or disk step rates (can we read
the firmware set values somewhere ?)
Alan Cox [Sun, 21 Dec 2014 20:51:29 +0000 (20:51 +0000)]
ubee,devhd: Bring more into line with what is needed
Minor 4-7 are the floppy devices on the WD1002-5 and for those we must set the
side bit in port 0x48
Implement the 0x58 device select logic
Check the device is present on open
Alan Cox [Sun, 21 Dec 2014 20:50:14 +0000 (20:50 +0000)]
ubee,devfd: add device select support for port 0x58
It's probably not present but it costs us nothing much to support
Alan Cox [Sun, 21 Dec 2014 20:16:49 +0000 (20:16 +0000)]
trs80: WD1010 driver FIXME is obsolete
Alan Cox [Sun, 21 Dec 2014 17:55:15 +0000 (17:55 +0000)]
ubee: initial bits cloned from the TRS80 to begin a Microbee 128/256/512 port
Alan Cox [Sun, 21 Dec 2014 17:53:05 +0000 (17:53 +0000)]
README: update for TRS80
Alan Cox [Sun, 21 Dec 2014 16:53:55 +0000 (16:53 +0000)]
trs80: clean up monitor bits
Alan Cox [Sun, 21 Dec 2014 15:32:33 +0000 (15:32 +0000)]
trs80: enable floppy disk write support
Alan Cox [Sat, 20 Dec 2014 00:28:19 +0000 (00:28 +0000)]
trs80, hd: Make the hard disk driver work and add swap
With this we can now swap on the TRS80 platform and things seem to work
acceptably. Disk size and other properties are hardcoded in ways that will
need fixing. Partitioning support also needs to be added.
Alan Cox [Sat, 20 Dec 2014 00:26:58 +0000 (00:26 +0000)]
trs80: serial debug
This makes the serial debug work in the emulator. It's not sufficient for
doing serial debug on a real TRS80
Alan Cox [Fri, 19 Dec 2014 01:30:26 +0000 (01:30 +0000)]
z80fixedbank: Always use the swapstack
If we don't then when we call map_kernel after copying the udata back we
will scribble somewhere on the stack of the process. We could potentially
move the switch back to the point we've fixed up sp, but as we have a swap
stack we might as well use it.
If we get banked boxes without swap then it may be worth looking at the other
path for a lib/z80fixedbanknswap.s
Alan Cox [Fri, 19 Dec 2014 01:13:17 +0000 (01:13 +0000)]
trs80: start tidying up the hd support
Add swap hooks etc
Alan Cox [Fri, 19 Dec 2014 01:12:22 +0000 (01:12 +0000)]
bankfixed: check the right define
Alan Cox [Thu, 18 Dec 2014 23:17:04 +0000 (23:17 +0000)]
process: Correct handling of out of processes case
When the error handling was updated this path was broken. With this fixed
running out of memory/swap now correctly fails with ENOMEM
Alan Cox [Thu, 18 Dec 2014 22:34:52 +0000 (22:34 +0000)]
zx128: We can't yet use the shared banker for this, but prepare anyway
Alan Cox [Thu, 18 Dec 2014 21:34:25 +0000 (21:34 +0000)]
trs80: Add serial, keyboard and interrupt handling
This gives a console you can type into and which is at least good enough
to set the root fs. It follows the standard TRS80 layout but with some extra
ctrl and ctrl-shift hooks for useful keys Tandy forgot to include ({} etc)
Alan Cox [Thu, 18 Dec 2014 21:34:02 +0000 (21:34 +0000)]
trs80: 80x24 not 80x25
Alan Cox [Thu, 18 Dec 2014 21:33:17 +0000 (21:33 +0000)]
trs80, fd: update the floppy disk driver
This is sufficient to mount the root file system and go hunting for init. It
will probably go further still once the other bits are in place
Alan Cox [Thu, 18 Dec 2014 21:32:35 +0000 (21:32 +0000)]
z80pack: add the map_process_a method needed by shared bank code
Alan Cox [Thu, 18 Dec 2014 21:31:53 +0000 (21:31 +0000)]
z80pack: Switch to shared z80 banking code
Alan Cox [Thu, 18 Dec 2014 21:31:30 +0000 (21:31 +0000)]
trs80: use shared bank code
Alan Cox [Thu, 18 Dec 2014 21:31:04 +0000 (21:31 +0000)]
trs80: move to E800
Make room make room
Alan Cox [Thu, 18 Dec 2014 21:30:05 +0000 (21:30 +0000)]
mtx; switch to the shared z80 banking code
Alan Cox [Thu, 18 Dec 2014 21:29:04 +0000 (21:29 +0000)]
z80: introduce a common z80fixedbank.s
This is sufficient for most setups using fixed banks and a common.
Alan Cox [Thu, 18 Dec 2014 11:56:39 +0000 (11:56 +0000)]
trs80: bring things up to the bootdev prompt
Somewhat of a redesign of the original guesswork.
Alan Cox [Thu, 18 Dec 2014 11:55:47 +0000 (11:55 +0000)]
vt: Fixes for the simple vt code
Work around what appears to be an sdcc bug
Allow cursor_off to be called first without writing over address 0
Alan Cox [Thu, 18 Dec 2014 11:55:14 +0000 (11:55 +0000)]
start: remove old tty debug, and fix mix of (c) and (C)
Alan Cox [Thu, 18 Dec 2014 00:53:20 +0000 (00:53 +0000)]
trs80load: TRS80 loader
Assumes single sided double density disk. Sets up the memory map, moves itself
to 0x00-0xff and then loads the kernel at 0x100 before running it.
Alan Cox [Thu, 18 Dec 2014 00:52:24 +0000 (00:52 +0000)]
trs80: move udata and program top
Matches the linker and allows for the fact that F400-FFFF is occupied by
the keyboard mmio and the video map
Alan Cox [Thu, 18 Dec 2014 00:51:12 +0000 (00:51 +0000)]
process: flag a tiny race
I think we can just remove the restore, but needs checking over
Alan Cox [Thu, 18 Dec 2014 00:50:46 +0000 (00:50 +0000)]
trs80,floppy: bug fixes noticed in passing
Alan Cox [Thu, 18 Dec 2014 00:50:20 +0000 (00:50 +0000)]
trs80: update config.h
Alan Cox [Thu, 18 Dec 2014 00:49:53 +0000 (00:49 +0000)]
trs80: Add a tool to build the needed jv3 images
Alan Cox [Thu, 18 Dec 2014 00:49:29 +0000 (00:49 +0000)]
trs80: adjust link map to make more sense
Alan Cox [Thu, 18 Dec 2014 00:48:23 +0000 (00:48 +0000)]
mtx: now the serial is sorted remove the polling
Alan Cox [Wed, 17 Dec 2014 00:33:11 +0000 (00:33 +0000)]
6502: Clean up the expanded 6502 bits
This now assembles at least, I doubt it actually does anything useful.
Alan Cox [Tue, 16 Dec 2014 23:42:05 +0000 (23:42 +0000)]
TODO: update done stuff, also fix related comment that was stale
Alan Cox [Tue, 16 Dec 2014 23:34:52 +0000 (23:34 +0000)]
mtx: Update the floppy code to turn off the motor when its done
Alan Cox [Tue, 16 Dec 2014 23:34:39 +0000 (23:34 +0000)]
mtx: update the README
Alan Cox [Tue, 16 Dec 2014 23:15:08 +0000 (23:15 +0000)]
mtx: include a 6x8 font and upload it into the VDP
We can't it seems rely upon the firmware to have done this for us.
Alan Cox [Tue, 16 Dec 2014 23:13:30 +0000 (23:13 +0000)]
vt: don't vanish the cursor on vt switches
This will need revisiting because the vt implementations mostly keep a single
'what was under the cursor' and 'cursor address'. We may need to make these
live in a standard place and save them too.
Alan Cox [Tue, 16 Dec 2014 23:12:18 +0000 (23:12 +0000)]
mtx: tty fixes
Update comments
Fix the F1/F2 handling
Lock interrupts off to avoid an interrupt messing up a tty update by switching
mid update. This really needs a better model of processing, eg deferring the
echoed character if mid processing
Alan Cox [Tue, 16 Dec 2014 23:12:02 +0000 (23:12 +0000)]
mtx: correct pagemap loading
Alan Cox [Tue, 16 Dec 2014 21:12:12 +0000 (21:12 +0000)]
z80: note assumption in commonmem sizing
Alan Cox [Tue, 16 Dec 2014 18:36:08 +0000 (18:36 +0000)]
mtx: allow some more space during boot by moving _DISCARD a bit
Alan Cox [Tue, 16 Dec 2014 18:35:23 +0000 (18:35 +0000)]
font6x8: Include config.h
Alan Cox [Tue, 16 Dec 2014 18:33:55 +0000 (18:33 +0000)]
font6x8: Add to Makefile
Build the 6x8 font when needed
Alan Cox [Tue, 16 Dec 2014 18:32:40 +0000 (18:32 +0000)]
font8x8: Shrink font, compensate for base change
It's dumb having the small font 128 symbols long when the first 32 are
weird stuff. Make it 96, and shift by 32 chars when printing. Saves us 256
bytes
Alan Cox [Tue, 16 Dec 2014 18:32:01 +0000 (18:32 +0000)]
font6x8: 6 by 8 font courtesy of LinuxLCD
Alan Cox [Tue, 16 Dec 2014 18:31:45 +0000 (18:31 +0000)]
README: update
Alan Cox [Mon, 15 Dec 2014 22:45:52 +0000 (22:45 +0000)]
mtx: Clean up the port and tidy loose ends
Memory sizing
DART setup
Better CTC configuration
Use IM2 so we can tell CTC and DART interrupts apart
Alan Cox [Mon, 15 Dec 2014 12:20:36 +0000 (12:20 +0000)]
mtx: README
Explain the shortcut way to load the images
Alan Cox [Mon, 15 Dec 2014 12:13:23 +0000 (12:13 +0000)]
mtx: clean up caching of page state
map_restore restored the map but not the cache of the write only port, this
then caused crashes if interrupt returns occurred during a user memory
access.
Use the helpers throughout for neatness
Alan Cox [Sun, 14 Dec 2014 23:26:01 +0000 (23:26 +0000)]
mtx: mask sector count on side1
The MTX512 doesn't write sector labels 17-32 on the second side but recycles
1-16
Alan Cox [Sun, 14 Dec 2014 23:19:29 +0000 (23:19 +0000)]
mtx512: undo that
Amazing what a floppy bug can look like
The disk order is just fine
Alan Cox [Sun, 14 Dec 2014 23:04:43 +0000 (23:04 +0000)]
mtx512: Add tools for converting fuzix fs images into mfloppy disk format
Alan Cox [Sun, 14 Dec 2014 23:01:59 +0000 (23:01 +0000)]
mtx: 80 column driver
Use the crtc to do hardware scrolling
Alan Cox [Sun, 14 Dec 2014 23:01:47 +0000 (23:01 +0000)]
mtx: Set the crtc up properly
Alan Cox [Sun, 14 Dec 2014 23:00:31 +0000 (23:00 +0000)]
mtx: Further work on the floppy driver
We now load the superblocks and find the inode etc for init
Note that the order on the virtual disk is odd with the second head after
the first full set of tracks
Alan Cox [Sun, 14 Dec 2014 22:09:16 +0000 (22:09 +0000)]
fsck: bug fixes for big endian fsck on small endian box
Also change misc because a signed 16bit value swizzled gets 32bit extended
which tripped the sanity checker wrongly
Alan Cox [Sun, 14 Dec 2014 18:33:07 +0000 (18:33 +0000)]
mtx: fix typo
Alan Cox [Sun, 14 Dec 2014 18:26:09 +0000 (18:26 +0000)]
mtx: Fix up the consoles and serial
We now have four tty devices, 1 is the 6845, 2 is the VDP, 3 and 4 the
serial ports. The serial isn't finished and the IRQ logic hasn't been tackled.
The keyboard works.
Alan Cox [Sun, 14 Dec 2014 18:24:43 +0000 (18:24 +0000)]
vt: Add support for switching vt state
We need this for the MTX512 but it will also be useful later for MSX, as the
MSX also has a load of VDP RAM that we can use to support multiple text
consoles just like Xenix and later Linux did on a PC.
Alan Cox [Sun, 14 Dec 2014 18:23:06 +0000 (18:23 +0000)]
vdp1: Allow mixed VDP/non VDP
We add a .equ which indicates whether the vdp1 driver should provide the
functions for vt.c or ones that can be wrapped. For MSX we are happy as we
are but for MTX512 we can support a VDP and a 6845 at the same time.
Alan Cox [Sat, 13 Dec 2014 23:56:47 +0000 (23:56 +0000)]
mtx: Initialize the VDP and use it for vt work
Currently this is only half working - we init the vdp but have no font. We
need to upload our own font as CP/M or other boot code might not be using
the VDP display.
Alan Cox [Sat, 13 Dec 2014 23:56:19 +0000 (23:56 +0000)]
mtx: correct VDP
Ports 1 and 2 not 0 and 1
Alan Cox [Sat, 13 Dec 2014 23:55:50 +0000 (23:55 +0000)]
mtx: move things about to allow space for unpack
Otherwise we fall over ourselves
Alan Cox [Sat, 13 Dec 2014 23:55:26 +0000 (23:55 +0000)]
mtx: link VIDEO in the right place
Alan Cox [Sat, 13 Dec 2014 22:49:38 +0000 (22:49 +0000)]
mtx512: Initial port code
Not yet bootable.
Still to complete:
CTC setup
DART serial ports
CP/M tools scripts to spit out a memotech floppy disk
Alan Cox [Sat, 13 Dec 2014 22:48:12 +0000 (22:48 +0000)]
vdp1: Allow the VDP location to be defined not hard coded
Not everything with a 9918 in it is an MSX box...
Alan Cox [Thu, 11 Dec 2014 22:58:26 +0000 (22:58 +0000)]
microdrive: move the work buffer somewhere better
it was at 0x4000 to help debug, move it offscreen
Alan Cox [Thu, 11 Dec 2014 12:12:34 +0000 (12:12 +0000)]
zx128, tools: Update bintomdv to upload the entire image
Alan Cox [Thu, 11 Dec 2014 12:12:19 +0000 (12:12 +0000)]
mdv: turn on the motor when reading the maps - it helps
Alan Cox [Thu, 11 Dec 2014 12:11:55 +0000 (12:11 +0000)]
zx128: on a panic halt and spin
This makes it much easier to debug in FUSE
Alan Cox [Thu, 11 Dec 2014 12:11:26 +0000 (12:11 +0000)]
zx128: kernel.def option to decide if we want to microdrive boot
Also use a temporary boot stack for this
Alan Cox [Thu, 11 Dec 2014 12:10:36 +0000 (12:10 +0000)]
microdrive: fix a few bugs
With this done we can now do all the core bits of loading an image
Alan Cox [Thu, 11 Dec 2014 10:39:28 +0000 (10:39 +0000)]
zx128, Makefile: add rules for mdv building, rebalance 16K blocks
Alan Cox [Wed, 10 Dec 2014 23:29:27 +0000 (23:29 +0000)]
trs80: Fix off by one in floppy code
Alan Cox [Wed, 10 Dec 2014 23:29:00 +0000 (23:29 +0000)]
bintomdv: convert the binary into microdrive cartridge and interface 2 ROM
Alan Cox [Wed, 10 Dec 2014 23:28:47 +0000 (23:28 +0000)]
Makefile: add run for bintomdv
Alan Cox [Wed, 10 Dec 2014 23:24:55 +0000 (23:24 +0000)]
zx128: link and crt0
Call the microdrive init functions
Do the initializer copy (makes no odds if disk loading, matters if ROM)
Shuffle things so that the kernel is at 0x0000->0x3FFF and 0xC000+. The
common, video and other bits then live between 5B and 9F. That leaves us
with A0-BF free plus the C0-FF of the other banks, so we can run somewhat
bigger apps. Not ideal but SDCC hacking is going to be needed to do better
plus teach fuse to emulate banked cartridges.
Memory map open to discussion anyway.
BUG: right now the mdv loader doesn't load 0xFE00-0xFFFF but needs to, need
to move the boot stack first.
Alan Cox [Wed, 10 Dec 2014 23:23:49 +0000 (23:23 +0000)]
zx128: put devices in the same order as other platforms, hook microdrive
We'll need some CONFIG options to select between Microdrive, floppy etc as
I don't think the average Russian Spectrum/Clone came with a Microdrive !
Alan Cox [Wed, 10 Dec 2014 23:21:30 +0000 (23:21 +0000)]
zx128: Add support for the sinclair Microdrive
Read only for the moment, but tested with the boot loader path and seems to
be doing the right thing. Something is buggy in the checksum logic either
of the mdv maker or the reader, not sure which yet.
Headers and blocks are correctly fetched, data blocks are split from the header
as they arrive to avoid double buffering.
The interface 1 ROM is not used at all (so we can use this from a cartridge
to load the rest of the OS)
Alan Cox [Wed, 10 Dec 2014 23:19:50 +0000 (23:19 +0000)]
trs80: further work on the hd driver
Still needs a floppy boot block to begin testing
Alan Cox [Wed, 10 Dec 2014 23:18:50 +0000 (23:18 +0000)]
dragon: fix off by one in devfd
Alan Cox [Wed, 10 Dec 2014 23:18:39 +0000 (23:18 +0000)]
6502: typo fix
Alan Cox [Sun, 7 Dec 2014 14:32:31 +0000 (14:32 +0000)]
fcc: Fix link of start code
From: Will Sowerbutts <will@sowerbutts.com>
crt0.s has lost the 0x100 bytes of space at the start of the executable
image. Attached patch to fcc corrects the link address.
Alan Cox [Sun, 7 Dec 2014 14:31:17 +0000 (14:31 +0000)]
qsort: fix sort order
From: Will Sowerbutts <will@sowerbutts.com>
Alan Cox [Sun, 7 Dec 2014 14:29:24 +0000 (14:29 +0000)]
ssh: fflush the shell prompt
From: Will Sowerbutts <will@sowerbutts.com>
The assumption that libc will fflush stdout on an fgets of stdin is not anything
the standards guarantee. Do the needed fflush