FUZIX.git
9 years agoKernel: Useful debug routines for Z180 (commented out)
Will Sowerbutts [Sat, 27 Dec 2014 14:24:55 +0000 (14:24 +0000)]
Kernel: Useful debug routines for Z180 (commented out)

9 years agoMerge remote-tracking branch 'alan/master' into toupstream
Will Sowerbutts [Sat, 27 Dec 2014 14:39:55 +0000 (14:39 +0000)]
Merge remote-tracking branch 'alan/master' into toupstream

9 years agocrt0: set the load page to 1
Alan Cox [Sat, 27 Dec 2014 13:59:50 +0000 (13:59 +0000)]
crt0: set the load page to 1

Probably fcc binman should do the needed magic for such things

9 years agoexecve: handle null files
Alan Cox [Sat, 27 Dec 2014 13:59:03 +0000 (13:59 +0000)]
execve: handle null files

When given an empty file execve was doing a bmap and trying to load block
-1 from the disk. Catch the empty file case earlier and error it.

9 years agoubee: check the right flag on dec b for the crtc loop.
Alan Cox [Sat, 27 Dec 2014 13:14:32 +0000 (13:14 +0000)]
ubee: check the right flag on dec b for the crtc loop.

9 years agotrs80: Check the PV flag not C on 8bit dec
Alan Cox [Sat, 27 Dec 2014 13:13:30 +0000 (13:13 +0000)]
trs80: Check the PV flag not C on 8bit dec

9 years agoexecve: Fix ABI change on unsized binaries
Alan Cox [Sat, 27 Dec 2014 12:51:41 +0000 (12:51 +0000)]
execve: Fix ABI change on unsized binaries

We need to adjust by the load page *after* we have checked for zero.

9 years agoKernel: Remove obsolete lines from kernel.def on p112 and n8vem-mark4 platforms
Will Sowerbutts [Sat, 27 Dec 2014 11:34:19 +0000 (11:34 +0000)]
Kernel: Remove obsolete lines from kernel.def on p112 and n8vem-mark4 platforms

9 years agoKernel: Bug fix -- on system call, touch kernel_flag only after switching to the...
Will Sowerbutts [Sat, 27 Dec 2014 11:26:25 +0000 (11:26 +0000)]
Kernel: Bug fix -- on system call, touch kernel_flag only after switching to the kernel memory bank

9 years agoKernel: Tidy up p112 and n8vem-mark4 targets, remove redundant code and merge memory...
Will Sowerbutts [Sat, 27 Dec 2014 11:22:22 +0000 (11:22 +0000)]
Kernel: Tidy up p112 and n8vem-mark4 targets, remove redundant code and merge memory mapping functions into common Z180 code.

9 years agoKernel: Add N8VEM Mark 4 and DX-Designs P112 platforms
Will Sowerbutts [Sat, 27 Dec 2014 02:38:45 +0000 (02:38 +0000)]
Kernel: Add N8VEM Mark 4 and DX-Designs P112 platforms

9 years agoKernel: Increment both 16-bit and 32-bit tick counters on every timer interrupt
Will Sowerbutts [Sat, 27 Dec 2014 01:52:51 +0000 (01:52 +0000)]
Kernel: Increment both 16-bit and 32-bit tick counters on every timer interrupt

9 years agoKernel: Whitespace fix for start.c
Will Sowerbutts [Sat, 27 Dec 2014 01:52:26 +0000 (01:52 +0000)]
Kernel: Whitespace fix for start.c

9 years agoKernel: lowlevel-z80: Remove unused map_process symbol
Will Sowerbutts [Sat, 27 Dec 2014 01:42:53 +0000 (01:42 +0000)]
Kernel: lowlevel-z80: Remove unused map_process symbol

9 years agoKernel: Allow boot device number to be greater than 9
Will Sowerbutts [Sat, 27 Dec 2014 01:42:25 +0000 (01:42 +0000)]
Kernel: Allow boot device number to be greater than 9

9 years agoKernel: Improve simple timer code. Remove timer.h include where it is not required.
Will Sowerbutts [Sat, 27 Dec 2014 01:37:45 +0000 (01:37 +0000)]
Kernel: Improve simple timer code. Remove timer.h include where it is not required.

9 years agocpm-loader: Fix minor typo in comment
Will Sowerbutts [Sat, 27 Dec 2014 01:26:07 +0000 (01:26 +0000)]
cpm-loader: Fix minor typo in comment

9 years agocpm-loader: Tools to make a CP/M application which boots the Fuzix kernel
Will Sowerbutts [Sat, 27 Dec 2014 01:12:09 +0000 (01:12 +0000)]
cpm-loader: Tools to make a CP/M application which boots the Fuzix kernel

9 years agoKernel support for Z180 CPUs
Will Sowerbutts [Sat, 27 Dec 2014 01:02:49 +0000 (01:02 +0000)]
Kernel support for Z180 CPUs

9 years agoOops: revert Will's bits I didn't mean to merge
Alan Cox [Sat, 27 Dec 2014 00:45:09 +0000 (00:45 +0000)]
Oops: revert Will's bits I didn't mean to merge

9 years agoMerge Will's fixes
Alan Cox [Sat, 27 Dec 2014 00:42:05 +0000 (00:42 +0000)]
Merge Will's fixes
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

9 years agosyscall-z88dk: initial fix ups
Alan Cox [Sat, 27 Dec 2014 00:40:22 +0000 (00:40 +0000)]
syscall-z88dk: initial fix ups

It now looks plausible but isn't yet tested

9 years agosyscall: 32bytes per dirent needed
Alan Cox [Sat, 27 Dec 2014 00:39:56 +0000 (00:39 +0000)]
syscall: 32bytes per dirent needed

9 years agosyscall_name: Fix wrong entries
Alan Cox [Sat, 27 Dec 2014 00:39:35 +0000 (00:39 +0000)]
syscall_name: Fix wrong entries

Ones found while building the Z88DK test C lib

9 years agouname: pass the load average bits down
Alan Cox [Sat, 27 Dec 2014 00:39:09 +0000 (00:39 +0000)]
uname: pass the load average bits down

9 years agoMerge pull request #27 from willsowerbutts/master
EtchedPixels [Sat, 27 Dec 2014 00:37:14 +0000 (00:37 +0000)]
Merge pull request #27 from willsowerbutts/master

Library sleep() -- update for time() API change.

9 years agoVarious tweaks to utilities to build cleanly on my system
Will Sowerbutts [Sat, 27 Dec 2014 00:36:08 +0000 (00:36 +0000)]
Various tweaks to utilities to build cleanly on my system

9 years agoLibrary sleep() -- update for time() API change.
Will Sowerbutts [Sat, 27 Dec 2014 00:05:02 +0000 (00:05 +0000)]
Library sleep() -- update for time() API change.

9 years agoCorrect spelling of LICENCE. This is a UK based project so there
Alan Cox [Fri, 26 Dec 2014 22:41:04 +0000 (22:41 +0000)]
Correct spelling of LICENCE. This is a UK based project so there

9 years agoz88dk: Add first pieces to bootstrap Z88DK for Fuzix
Alan Cox [Fri, 26 Dec 2014 21:40:55 +0000 (21:40 +0000)]
z88dk: Add first pieces to bootstrap Z88DK for Fuzix

9 years agosyscall uname: Add the uptime data
Alan Cox [Fri, 26 Dec 2014 20:42:43 +0000 (20:42 +0000)]
syscall uname: Add the uptime data

While are breaking the prototype ABI lets just stuff the uptime data in
the sysinfo block and be done with it.

9 years agosyscalls: extra argument for _stime()
Alan Cox [Fri, 26 Dec 2014 20:31:06 +0000 (20:31 +0000)]
syscalls: extra argument for _stime()

9 years agotime: correct bug, add stime time type
Alan Cox [Fri, 26 Dec 2014 20:30:00 +0000 (20:30 +0000)]
time: correct bug, add stime time type

This finishes the basic provision for multiple time sources

9 years agoexecve: change binary format, add a byte for bank base and align fields
Alan Cox [Fri, 26 Dec 2014 20:26:24 +0000 (20:26 +0000)]
execve: change binary format, add a byte for bank base and align fields

9 years agocrt0: Add a byte for the base of the binary
Alan Cox [Fri, 26 Dec 2014 20:25:42 +0000 (20:25 +0000)]
crt0: Add a byte for the base of the binary

Next step in the ABI breaking changes

9 years agochmem: Update for new format binaries
Alan Cox [Fri, 26 Dec 2014 20:25:21 +0000 (20:25 +0000)]
chmem: Update for new format binaries

9 years agotime: resynch library with API change for time()
Alan Cox [Fri, 26 Dec 2014 20:16:01 +0000 (20:16 +0000)]
time: resynch library with API change for time()

Better to do this before we have too many dependancies than to delay it
until we can't change it.

9 years agosyscall_name: add argument counts to the tables
Alan Cox [Fri, 26 Dec 2014 20:11:09 +0000 (20:11 +0000)]
syscall_name: add argument counts to the tables

We will need these to automate creation of some types of call stubs

9 years agosyscall_proc: change _time to allow multiple kinds of time
Alan Cox [Fri, 26 Dec 2014 20:10:36 +0000 (20:10 +0000)]
syscall_proc: change _time to allow multiple kinds of time

Add since boot monotomic time.

Yes this is an ABI break....

9 years agosyscall: correct arg descriptions in uname
Alan Cox [Fri, 26 Dec 2014 20:10:22 +0000 (20:10 +0000)]
syscall: correct arg descriptions in uname

9 years agosocz80: start reworking MMU code for 16K banking model
Alan Cox [Tue, 23 Dec 2014 22:49:02 +0000 (22:49 +0000)]
socz80: start reworking MMU code for 16K banking model

Bank switching functions, and switchin/switchout looked at so far. The fork
copying code remains to be done. Here it definitely makes sense to use the
MMU page 17 logic, but we now need to do it in 16K chunks.

9 years agosocz80: config.h updates
Alan Cox [Tue, 23 Dec 2014 22:46:57 +0000 (22:46 +0000)]
socz80: config.h updates

9 years agosocz80: ramtop has changed type
Alan Cox [Tue, 23 Dec 2014 22:46:37 +0000 (22:46 +0000)]
socz80: ramtop has changed type

Start bringing socz80 back into line

9 years agoTODO: rtc done(ish)
Alan Cox [Tue, 23 Dec 2014 21:06:04 +0000 (21:06 +0000)]
TODO: rtc done(ish)

9 years agoREADME: update
Alan Cox [Mon, 22 Dec 2014 16:54:20 +0000 (16:54 +0000)]
README: update

9 years agoPORTING: some updates
Alan Cox [Mon, 22 Dec 2014 15:31:35 +0000 (15:31 +0000)]
PORTING: some updates

9 years agoz80pack-lite: add RTC support
Alan Cox [Mon, 22 Dec 2014 15:11:08 +0000 (15:11 +0000)]
z80pack-lite: add RTC support

9 years agoz80pack: turn on RTC support
Alan Cox [Mon, 22 Dec 2014 14:54:59 +0000 (14:54 +0000)]
z80pack: turn on RTC support

9 years agoz80pack: fix vt.c build failure
Alan Cox [Mon, 22 Dec 2014 14:54:42 +0000 (14:54 +0000)]
z80pack: fix vt.c build failure

9 years agoz80pack: add rtc helper
Alan Cox [Mon, 22 Dec 2014 14:54:22 +0000 (14:54 +0000)]
z80pack: add rtc helper

9 years agotrs80: ensure the rtc digit wrap doesn't catch us out
Alan Cox [Mon, 22 Dec 2014 14:30:41 +0000 (14:30 +0000)]
trs80: ensure the rtc digit wrap doesn't catch us out

9 years agonc100: add RTC support
Alan Cox [Mon, 22 Dec 2014 14:30:28 +0000 (14:30 +0000)]
nc100: add RTC support

9 years agotrs80: CRTC reg 0 was not being set
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

9 years agotrs80: turn on the RTC support
Alan Cox [Mon, 22 Dec 2014 13:03:54 +0000 (13:03 +0000)]
trs80: turn on the RTC support

9 years agoubee: 64 ticks/second and turn on the RTC
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

9 years agotimer: add initial support for RTC seconds locking
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.

9 years agoprocess: note problem to look at wrt ubee and 64 ticks/second
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

9 years agoubee: clean up some remaining TRS80isms
Alan Cox [Mon, 22 Dec 2014 12:38:12 +0000 (12:38 +0000)]
ubee: clean up some remaining TRS80isms

9 years agoubee: enable CRTC loading
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

9 years agotrs80: Set a 2ms seek time on the hard disk
Alan Cox [Mon, 22 Dec 2014 11:51:15 +0000 (11:51 +0000)]
trs80: Set a 2ms seek time on the hard disk

9 years agoubee,devhd: step rates and the like
Alan Cox [Sun, 21 Dec 2014 22:07:57 +0000 (22:07 +0000)]
ubee,devhd: step rates and the like

9 years agoubee: Further floppy driver bashing
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

9 years agoubee: More work on the disk controllers
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 ?)

9 years agoubee,devhd: Bring more into line with what is needed
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

9 years agoubee,devfd: add device select support for port 0x58
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

9 years agotrs80: WD1010 driver FIXME is obsolete
Alan Cox [Sun, 21 Dec 2014 20:16:49 +0000 (20:16 +0000)]
trs80: WD1010 driver FIXME is obsolete

9 years agoubee: initial bits cloned from the TRS80 to begin a Microbee 128/256/512 port
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

9 years agoREADME: update for TRS80
Alan Cox [Sun, 21 Dec 2014 17:53:05 +0000 (17:53 +0000)]
README: update for TRS80

9 years agotrs80: clean up monitor bits
Alan Cox [Sun, 21 Dec 2014 16:53:55 +0000 (16:53 +0000)]
trs80: clean up monitor bits

9 years agotrs80: enable floppy disk write support
Alan Cox [Sun, 21 Dec 2014 15:32:33 +0000 (15:32 +0000)]
trs80: enable floppy disk write support

9 years agotrs80, hd: Make the hard disk driver work and add swap
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.

9 years agotrs80: serial debug
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

9 years agoz80fixedbank: Always use the swapstack
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

9 years agotrs80: start tidying up the hd support
Alan Cox [Fri, 19 Dec 2014 01:13:17 +0000 (01:13 +0000)]
trs80: start tidying up the hd support

Add swap hooks etc

9 years agobankfixed: check the right define
Alan Cox [Fri, 19 Dec 2014 01:12:22 +0000 (01:12 +0000)]
bankfixed: check the right define

9 years agoprocess: Correct handling of out of processes case
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

9 years agozx128: We can't yet use the shared banker for this, but prepare anyway
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

9 years agotrs80: Add serial, keyboard and interrupt handling
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)

9 years agotrs80: 80x24 not 80x25
Alan Cox [Thu, 18 Dec 2014 21:34:02 +0000 (21:34 +0000)]
trs80: 80x24 not 80x25

9 years agotrs80, fd: update the floppy disk driver
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

9 years agoz80pack: add the map_process_a method needed by shared bank code
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

9 years agoz80pack: Switch to shared z80 banking code
Alan Cox [Thu, 18 Dec 2014 21:31:53 +0000 (21:31 +0000)]
z80pack: Switch to shared z80 banking code

9 years agotrs80: use shared bank code
Alan Cox [Thu, 18 Dec 2014 21:31:30 +0000 (21:31 +0000)]
trs80: use shared bank code

9 years agotrs80: move to E800
Alan Cox [Thu, 18 Dec 2014 21:31:04 +0000 (21:31 +0000)]
trs80: move to E800

Make room make room

9 years agomtx; switch to the shared z80 banking code
Alan Cox [Thu, 18 Dec 2014 21:30:05 +0000 (21:30 +0000)]
mtx; switch to the shared z80 banking code

9 years agoz80: introduce a common z80fixedbank.s
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.

9 years agotrs80: bring things up to the bootdev prompt
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.

9 years agovt: Fixes for the simple vt code
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

9 years agostart: remove old tty debug, and fix mix of (c) and (C)
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)

9 years agotrs80load: TRS80 loader
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.

9 years agotrs80: move udata and program top
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

9 years agoprocess: flag a tiny race
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

9 years agotrs80,floppy: bug fixes noticed in passing
Alan Cox [Thu, 18 Dec 2014 00:50:46 +0000 (00:50 +0000)]
trs80,floppy: bug fixes noticed in passing

9 years agotrs80: update config.h
Alan Cox [Thu, 18 Dec 2014 00:50:20 +0000 (00:50 +0000)]
trs80: update config.h

9 years agotrs80: Add a tool to build the needed jv3 images
Alan Cox [Thu, 18 Dec 2014 00:49:53 +0000 (00:49 +0000)]
trs80: Add a tool to build the needed jv3 images

9 years agotrs80: adjust link map to make more sense
Alan Cox [Thu, 18 Dec 2014 00:49:29 +0000 (00:49 +0000)]
trs80: adjust link map to make more sense

9 years agomtx: now the serial is sorted remove the polling
Alan Cox [Thu, 18 Dec 2014 00:48:23 +0000 (00:48 +0000)]
mtx: now the serial is sorted remove the polling

9 years ago6502: Clean up the expanded 6502 bits
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.

9 years agoTODO: update done stuff, also fix related comment that was stale
Alan Cox [Tue, 16 Dec 2014 23:42:05 +0000 (23:42 +0000)]
TODO: update done stuff, also fix related comment that was stale

9 years agomtx: Update the floppy code to turn off the motor when its done
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