FUZIX.git
9 years agoStandalone: feel it all through indent
Alan Cox [Mon, 1 Dec 2014 22:27:38 +0000 (22:27 +0000)]
Standalone: feel it all through indent

Now at least its readable and we can begin pruning the large chunks of it that
we don't actually need.

9 years agoutils: Allow for wrong endian file systems
Alan Cox [Sun, 30 Nov 2014 20:57:29 +0000 (20:57 +0000)]
utils: Allow for wrong endian file systems

9 years agoxfs2: auto-switch endianness and fix build bug
Alan Cox [Sun, 30 Nov 2014 20:56:44 +0000 (20:56 +0000)]
xfs2: auto-switch endianness and fix build bug

9 years agomkfs: indent and clean
Alan Cox [Sun, 30 Nov 2014 20:47:06 +0000 (20:47 +0000)]
mkfs: indent and clean

9 years agomkfs: remove dosendian damage
Alan Cox [Sun, 30 Nov 2014 20:44:39 +0000 (20:44 +0000)]
mkfs: remove dosendian damage

9 years agomkfs: add basics to allow wrong endian creation
Alan Cox [Sun, 30 Nov 2014 20:44:03 +0000 (20:44 +0000)]
mkfs: add basics to allow wrong endian creation

9 years agomicropack: Add needed NMOS define
Alan Cox [Sun, 30 Nov 2014 20:37:47 +0000 (20:37 +0000)]
micropack: Add needed NMOS define

9 years agofsck: Support checking a "wong endian" file system
Alan Cox [Sun, 30 Nov 2014 20:37:01 +0000 (20:37 +0000)]
fsck: Support checking a "wong endian" file system

So you can check 6809 file systems on an x86 etc

9 years agoucp: provision for endianness handling
Alan Cox [Sun, 30 Nov 2014 18:27:47 +0000 (18:27 +0000)]
ucp: provision for endianness handling

We are going to need to handle wrong-endian file systems in order to cope
with the 6809 port. Add macros ready

9 years agotimer: fix struct assigns
Alan Cox [Sun, 30 Nov 2014 15:08:24 +0000 (15:08 +0000)]
timer: fix struct assigns

SDCC isn't fond of them so be explicit

9 years agoz80: add different includes for CMOS/NMOS Z80
Alan Cox [Sun, 30 Nov 2014 15:08:04 +0000 (15:08 +0000)]
z80: add different includes for CMOS/NMOS Z80

9 years agoz80: add NMOS v CMOS indicator to all the platforms
Alan Cox [Sun, 30 Nov 2014 15:07:15 +0000 (15:07 +0000)]
z80: add NMOS v CMOS indicator to all the platforms

We need to know this to cover the interrupt erratum in di() and the
flag restore code

9 years agodragon: remove bogus comment
Alan Cox [Sat, 29 Nov 2014 20:55:04 +0000 (20:55 +0000)]
dragon: remove bogus comment

9 years agodragon: remove junk from devtty.h
Alan Cox [Sat, 29 Nov 2014 20:53:37 +0000 (20:53 +0000)]
dragon: remove junk from devtty.h

9 years agousermem_sam: Bug fixes
Alan Cox [Sat, 29 Nov 2014 14:26:17 +0000 (14:26 +0000)]
usermem_sam: Bug fixes

Correct uput
Add interrupt masking otherwise we can take an IRQ while we are within a
usermem access with no valid stack. At that point we crapped a stack frame
somewhere in the wrong memory bank.

9 years agostart: remove bogus copy of const object - make it static const
Alan Cox [Sat, 29 Nov 2014 14:25:44 +0000 (14:25 +0000)]
start: remove bogus copy of const object - make it static const

9 years agotime_t: use a 32bit pair in kernel
Alan Cox [Fri, 28 Nov 2014 22:34:44 +0000 (22:34 +0000)]
time_t: use a 32bit pair in kernel

While SDCC has a full 64bit longlong the other compilers are sadly lacking
at the moment. For the kernel the easiest thing to do is to work in 32bit
chunks, it's not as if the CPU can do better than 16bits at a go anyway

9 years agodevio: tty queue functions are really unsigned char
Alan Cox [Fri, 28 Nov 2014 22:27:17 +0000 (22:27 +0000)]
devio: tty queue functions are really unsigned char

gcc cares so quieten it down

9 years ago6809: Switch to -Os
Alan Cox [Fri, 28 Nov 2014 22:11:06 +0000 (22:11 +0000)]
6809: Switch to -Os

We've updated the helpers so can now do this.

A minimal build 6809 image currently weighs in at 24K code, 8K data. Some
of this is the CPU, some the calling conventions, and some gcc.

9 years agostart: put the termios init data into const
Alan Cox [Fri, 28 Nov 2014 22:10:33 +0000 (22:10 +0000)]
start: put the termios init data into const

That way we've got more chance of discarding it

9 years agovt: go back to memcpy
Alan Cox [Fri, 28 Nov 2014 22:09:52 +0000 (22:09 +0000)]
vt: go back to memcpy

We do need to switch to a memmove, but now we've fixed memcpy we can just
tag it as a TODO. Reverse scroll is busted on dragon due to this

9 years agodragon: update the configuration file
Alan Cox [Fri, 28 Nov 2014 22:09:24 +0000 (22:09 +0000)]
dragon: update the configuration file

Remove usermem_c bits

9 years ago6809: remove debug from lowlevel code, add more compiler glue
Alan Cox [Fri, 28 Nov 2014 22:08:42 +0000 (22:08 +0000)]
6809: remove debug from lowlevel code, add more compiler glue

9 years agodragon: use usermem_sam
Alan Cox [Fri, 28 Nov 2014 22:07:22 +0000 (22:07 +0000)]
dragon: use usermem_sam

This provides a different implementation of the SAM copier routines that do
not touch the stack at awkward moments

9 years agodragon: SAM implementation of the user memory copier
Alan Cox [Fri, 28 Nov 2014 22:05:47 +0000 (22:05 +0000)]
dragon: SAM implementation of the user memory copier

9 years agodragon: fix memcpy prototype and implementation
Alan Cox [Fri, 28 Nov 2014 22:05:15 +0000 (22:05 +0000)]
dragon: fix memcpy prototype and implementation

9 years agoREADME.md: expand notes on 64K size
Alan Cox [Thu, 27 Nov 2014 23:44:34 +0000 (23:44 +0000)]
README.md: expand notes on 64K size

9 years agoMakefile: avoid soft registers on 6809 for now
Alan Cox [Thu, 27 Nov 2014 23:41:45 +0000 (23:41 +0000)]
Makefile: avoid soft registers on 6809 for now

(not that gcc is actually generating them for some reason anyway)

9 years agodragon: Major updates
Alan Cox [Thu, 27 Nov 2014 23:39:43 +0000 (23:39 +0000)]
dragon: Major updates

- Crazy SAM RAM mapping support
- Propogate vectors correctly to user pages
- Flesh out the tricks.s code as needed (mostly by deleting bits)
- Keyboard driver
- IRQ support now working

This is sufficient to boot to the bootdev prompt, type a device number
and fail to mount the file system.

9 years agodragon: move the display to 0x6000
Alan Cox [Thu, 27 Nov 2014 23:36:30 +0000 (23:36 +0000)]
dragon: move the display to 0x6000

This gives us clear space below 0x6000 to possibly allow for bigger binaries
(but there are some nasties about changing how the vectors must work that
 won't be doable on a "real" Dragon ROM)

It's also the needed basis for 32K COCO and Dragon32 support given a banked
cartridge unit and banked call support.

9 years agoz80: Add bits ready for any endian fixing we have to do
Alan Cox [Thu, 27 Nov 2014 23:35:52 +0000 (23:35 +0000)]
z80: Add bits ready for any endian fixing we have to do

9 years agodragon: update the instructions
Alan Cox [Thu, 27 Nov 2014 01:14:21 +0000 (01:14 +0000)]
dragon: update the instructions

9 years agoMakefile: split video/videodata on 6809 as we are ROMming video
Alan Cox [Thu, 27 Nov 2014 01:09:53 +0000 (01:09 +0000)]
Makefile: split video/videodata on 6809 as we are ROMming video

Also add the new tools

With this lot done the Dragon builds and gets to the bootdev prompt pending
writing some actual drivers.

Still lots of other stuff busted - time_t is 32bit and needs fixing up
really, syscall and irq are not really done at all. Endianisms - who knows 8)

9 years agodragon: Update the link map
Alan Cox [Thu, 27 Nov 2014 01:09:35 +0000 (01:09 +0000)]
dragon: Update the link map

9 years agodragon: update crt0.s to allow for the work done in setup and the switcher
Alan Cox [Thu, 27 Nov 2014 01:09:13 +0000 (01:09 +0000)]
dragon: update crt0.s to allow for the work done in setup and the switcher

9 years agodragon: rewrite the setup code
Alan Cox [Thu, 27 Nov 2014 01:06:39 +0000 (01:06 +0000)]
dragon: rewrite the setup code

We load the first ROM with an unpacking routine and all the data. On boot
it sets up the SAM (must be done from ROM), the PIAs and then says hello,
clears memory and moves all the RAM objects from a DECB stream we add
into the ROM image.

With that done, it flips to the second ROM which together with the
cartridge mappings gives you a high 32K for kernel code, although it has
to be split using text1/text2 as we must stuff the exception vectors into
0xBFF0-0xBFFF - so double check the fuzix.map

9 years agodragon: 64K RAM not 96K
Alan Cox [Thu, 27 Nov 2014 01:06:22 +0000 (01:06 +0000)]
dragon: 64K RAM not 96K

9 years agodragon: Build the rom images not just fuzix.bin
Alan Cox [Thu, 27 Nov 2014 01:06:05 +0000 (01:06 +0000)]
dragon: Build the rom images not just fuzix.bin

9 years agodragon: remove dead bits, add vt mapper function
Alan Cox [Thu, 27 Nov 2014 01:05:28 +0000 (01:05 +0000)]
dragon: remove dead bits, add vt mapper function

9 years agodragon: correct config.h, turn on new vt features etc
Alan Cox [Thu, 27 Nov 2014 01:04:56 +0000 (01:04 +0000)]
dragon: correct config.h, turn on new vt features etc

9 years agodragon: do char mapping in the right spot
Alan Cox [Thu, 27 Nov 2014 01:04:35 +0000 (01:04 +0000)]
dragon: do char mapping in the right spot

9 years ago6809: add mulhi
Alan Cox [Thu, 27 Nov 2014 01:04:02 +0000 (01:04 +0000)]
6809: add mulhi

We need this for load average computation

9 years agodecbdragon: Turn the DECB stream into a set of ROM images
Alan Cox [Thu, 27 Nov 2014 01:03:41 +0000 (01:03 +0000)]
decbdragon: Turn the DECB stream into a set of ROM images

9 years agovt: minor fixes and a temporary hack
Alan Cox [Thu, 27 Nov 2014 01:01:50 +0000 (01:01 +0000)]
vt: minor fixes and a temporary hack

We have overlapped input/output so should use memmove - just we don't yet
have a memmove in all our support code - botch it for now

Add support to start on a different line (eg below boot rom info)

Allow a mapping function for simple mode (eg for Petscii and for 6809
boxes with the 6847)

9 years agoz80pack: fix silly unfixed comment from early 48K setup
Alan Cox [Tue, 25 Nov 2014 22:42:30 +0000 (22:42 +0000)]
z80pack: fix silly unfixed comment from early 48K setup

9 years agoz80pack32: Prototyping work to support 32K + 32K fixed better
Alan Cox [Tue, 25 Nov 2014 22:39:54 +0000 (22:39 +0000)]
z80pack32: Prototyping work to support 32K + 32K fixed better

Initial test work to see what is needed to handle machines that have a 32K
chunk you can page and a fixed 32K chunk (MTX512, N8VEM v2, MicroBee etc)

Buildable prototype but needs work doing on the crt0.s/binman setup to cope
with binaries containing a big hole in the middle.

9 years agobinman: sanity check data area, fix end reporting
Alan Cox [Tue, 25 Nov 2014 18:01:00 +0000 (18:01 +0000)]
binman: sanity check data area, fix end reporting

9 years agosocz80: update to new _discard
Alan Cox [Tue, 25 Nov 2014 18:00:41 +0000 (18:00 +0000)]
socz80: update to new _discard

9 years agopcw8256: note zero requirement
Alan Cox [Tue, 25 Nov 2014 17:59:45 +0000 (17:59 +0000)]
pcw8256: note zero requirement

9 years agoz80pack-lite: update to new _discard
Alan Cox [Tue, 25 Nov 2014 17:59:19 +0000 (17:59 +0000)]
z80pack-lite: update to new _discard

9 years agopcw8256: update to new _discard
Alan Cox [Tue, 25 Nov 2014 17:58:56 +0000 (17:58 +0000)]
pcw8256: update to new _discard

9 years agotrs80: update to new _discard
Alan Cox [Tue, 25 Nov 2014 17:58:07 +0000 (17:58 +0000)]
trs80: update to new _discard

9 years agonc100: update to new _discard
Alan Cox [Tue, 25 Nov 2014 17:57:50 +0000 (17:57 +0000)]
nc100: update to new _discard

9 years agomsx2: update to new _discard logic
Alan Cox [Tue, 25 Nov 2014 17:57:26 +0000 (17:57 +0000)]
msx2: update to new _discard logic

9 years agomsx1: update to new discard
Alan Cox [Tue, 25 Nov 2014 17:56:53 +0000 (17:56 +0000)]
msx1: update to new discard

9 years agokdata,start: undo the bufpool hack
Alan Cox [Tue, 25 Nov 2014 15:55:37 +0000 (15:55 +0000)]
kdata,start: undo the bufpool hack

The strings should now end up in _DISCARD without hackery

9 years agoz80pack: link _DISCARD at 0xE000
Alan Cox [Tue, 25 Nov 2014 15:55:18 +0000 (15:55 +0000)]
z80pack: link _DISCARD at 0xE000

9 years agoz80pack: Keep discard separate
Alan Cox [Tue, 25 Nov 2014 15:54:39 +0000 (15:54 +0000)]
z80pack: Keep discard separate

We can now discard the _DISCARD segment - yay, another 1K

9 years agobinman: Pack the _DISCARD section so it can be relocated and discarded
Alan Cox [Tue, 25 Nov 2014 15:53:53 +0000 (15:53 +0000)]
binman: Pack the _DISCARD section so it can be relocated and discarded

This means platforms need to adjust their crt0.s as per the following
z80pack commits

9 years agoMakefile: put string constants from the startup into discard as well
Alan Cox [Tue, 25 Nov 2014 15:53:05 +0000 (15:53 +0000)]
Makefile: put string constants from the startup into discard as well

This lets us undo the buffer hack in a bit

9 years agoz80pack: remove facepalm
Alan Cox [Tue, 25 Nov 2014 15:52:44 +0000 (15:52 +0000)]
z80pack: remove facepalm

9 years agoprocess: Add loadav calculator.
Alan Cox [Tue, 25 Nov 2014 11:00:42 +0000 (11:00 +0000)]
process: Add loadav calculator.

Needs to be exposed nicely to userspace yet.

Also remove a dead FIXME in the process code

9 years agokn_open: shave off 30 bytes
Alan Cox [Tue, 25 Nov 2014 00:34:34 +0000 (00:34 +0000)]
kn_open: shave off 30 bytes

9 years agoi_alloc: shave another 60 bytes off
Alan Cox [Tue, 25 Nov 2014 00:31:09 +0000 (00:31 +0000)]
i_alloc: shave another 60 bytes off

9 years agoz80pack: use end of bounce buffer for swap stack
Alan Cox [Mon, 24 Nov 2014 23:57:10 +0000 (23:57 +0000)]
z80pack: use end of bounce buffer for swap stack

It's never doing both at once

9 years agoMerge pull request #19 from atsidaev/clean-apps
EtchedPixels [Mon, 24 Nov 2014 19:14:33 +0000 (19:14 +0000)]
Merge pull request #19 from atsidaev/clean-apps

FUZIX executables generation

9 years agoapps: add binman support and produce FUZIX executables
Alexander Tsidaev [Mon, 24 Nov 2014 17:15:12 +0000 (12:15 -0500)]
apps: add binman support and produce FUZIX executables

9 years agolibrary: line endings fix, file modes fix.
Alexander Tsidaev [Mon, 24 Nov 2014 16:21:42 +0000 (11:21 -0500)]
library: line endings fix, file modes fix.

9 years agoFixed library and apps maker.
salex [Mon, 24 Nov 2014 16:07:10 +0000 (11:07 -0500)]
Fixed library and apps maker.

9 years agoMerge pull request #18 from atsidaev/clean-24112014
EtchedPixels [Mon, 24 Nov 2014 08:34:59 +0000 (08:34 +0000)]
Merge pull request #18 from atsidaev/clean-24112014

zx128 multitasking support

9 years agozx128: custom banking added
Alexander Tsidaev [Sun, 23 Nov 2014 21:51:05 +0000 (02:51 +0500)]
zx128: custom banking added

9 years agoz80pack: kill dead code
Alan Cox [Sun, 23 Nov 2014 22:43:57 +0000 (22:43 +0000)]
z80pack: kill dead code

9 years agoexecve: per CPU magic, also allow for different program base
Alan Cox [Sun, 23 Nov 2014 22:36:10 +0000 (22:36 +0000)]
execve: per CPU magic, also allow for different program base

Use different magic numbers for different CPU types. Note that we need to
pass some kind of base info and check it in future (or support relocatable
binaries ?)

As noted by Atsidaev our handling of some of this was rather confused. We
now pass the size (top - PROGBASE) to the allocator. This sort of assumes for
6502 we'll set 0x0200 (or higher) entry and 0x0000 base and something similar
for 6809.

zx128 will still need a custom banking module eventually. Once someone
beats SDCC into banking the kernel code that can mostly live in 2 (or 3)
16K banks in an interface 2 cartridge with banking support then it can
use 0x8000-0xBFFF and lazy memcpy it from another page (or even exchange
two pages) on a taskswitch between two different 32K apps.

See: http://www.fruitcake.plus.com/Sinclair/Interface2/Cartridges/Interface2_RC_Custom.htm#SoftwarePaging

9 years agoz80pack: update Makefiles to have correct rules for dev/../.. code
Alan Cox [Sun, 23 Nov 2014 22:17:56 +0000 (22:17 +0000)]
z80pack: update Makefiles to have correct rules for dev/../.. code

9 years agozx128: vt keyboard scan bug fixed
Alexander Tsidaev [Sun, 23 Nov 2014 17:23:22 +0000 (22:23 +0500)]
zx128: vt keyboard scan bug fixed

9 years agozx128: fd_bankcmd eliminated at last
Alexander Tsidaev [Sun, 23 Nov 2014 12:12:57 +0000 (17:12 +0500)]
zx128: fd_bankcmd eliminated at last

9 years agozx128: multitasking support
Alexander Tsidaev [Sat, 22 Nov 2014 22:50:08 +0000 (03:50 +0500)]
zx128: multitasking support

9 years agoz80pack: add shared devlpr
Alan Cox [Sun, 23 Nov 2014 20:07:36 +0000 (20:07 +0000)]
z80pack: add shared devlpr

9 years agoz80pack: share the lpr driver code
Alan Cox [Sun, 23 Nov 2014 20:06:53 +0000 (20:06 +0000)]
z80pack: share the lpr driver code

9 years agoz80pack: clean up common devtty between versions
Alan Cox [Sun, 23 Nov 2014 13:56:52 +0000 (13:56 +0000)]
z80pack: clean up common devtty between versions

9 years agoz80pack-lite: link _discard suitably
Alan Cox [Sun, 23 Nov 2014 00:54:07 +0000 (00:54 +0000)]
z80pack-lite: link _discard suitably

9 years agoz80pack-lite: get it to build again
Alan Cox [Sun, 23 Nov 2014 00:51:15 +0000 (00:51 +0000)]
z80pack-lite: get it to build again

Not yet tested

9 years agomicropack: use the shared devfd
Alan Cox [Sun, 23 Nov 2014 00:40:58 +0000 (00:40 +0000)]
micropack: use the shared devfd

9 years agoz80pack-lite: bring into alignment with modernity
Alan Cox [Sun, 23 Nov 2014 00:40:27 +0000 (00:40 +0000)]
z80pack-lite: bring into alignment with modernity

9 years agoz80pack-lite: clean up old code
Alan Cox [Sun, 23 Nov 2014 00:40:12 +0000 (00:40 +0000)]
z80pack-lite: clean up old code

9 years agoz80pack-lite: bring up to date a bit more
Alan Cox [Sun, 23 Nov 2014 00:39:56 +0000 (00:39 +0000)]
z80pack-lite: bring up to date a bit more

9 years agoz80pack-lite: clean up config, use common devfd
Alan Cox [Sun, 23 Nov 2014 00:39:23 +0000 (00:39 +0000)]
z80pack-lite: clean up config, use common devfd

9 years agoz80pack: devfd updates
Alan Cox [Sun, 23 Nov 2014 00:38:25 +0000 (00:38 +0000)]
z80pack: devfd updates

9 years agoz80pack: Move devfd somewhere common
Alan Cox [Sun, 23 Nov 2014 00:07:38 +0000 (00:07 +0000)]
z80pack: Move devfd somewhere common

Begin folding all the common z80pack bits together

9 years agoMakefile: remove comment - staying with uzi.lnk ordering for now
Alan Cox [Sat, 22 Nov 2014 22:55:07 +0000 (22:55 +0000)]
Makefile: remove comment - staying with uzi.lnk ordering for now

9 years agopcw8256: fix ramtop definition
Alan Cox [Sat, 22 Nov 2014 22:54:56 +0000 (22:54 +0000)]
pcw8256: fix ramtop definition

9 years agopcw8256: fix swap defines
Alan Cox [Sat, 22 Nov 2014 22:50:21 +0000 (22:50 +0000)]
pcw8256: fix swap defines

9 years agopcw8256: Various fixes
Alan Cox [Sat, 22 Nov 2014 22:48:15 +0000 (22:48 +0000)]
pcw8256: Various fixes

Make sure we link the commonmem.s first
Use the standard commonmem
Move the written parts of common clear of the first 256 bytes (so swap can
work)

9 years agocommonmem: switch some platforms to using the new .include
Alan Cox [Sat, 22 Nov 2014 22:47:31 +0000 (22:47 +0000)]
commonmem: switch some platforms to using the new .include

9 years agocommonmem: add a standard Z80 commonmem to .include
Alan Cox [Sat, 22 Nov 2014 22:46:30 +0000 (22:46 +0000)]
commonmem: add a standard Z80 commonmem to .include

9 years agoz80pack: fix comment
Alan Cox [Sat, 22 Nov 2014 20:54:46 +0000 (20:54 +0000)]
z80pack: fix comment

9 years agovdp: Create a shared device area
Alan Cox [Sat, 22 Nov 2014 20:51:30 +0000 (20:51 +0000)]
vdp: Create a shared device area

We want this as there are MSX1 boxes with MSX2 memory mappers (or from our
viewpoint MSX2 boxes with MSX1 video). In addition it turns out that the VDP
used on the Memotech MTX series machines is basically the same beastie.

9 years ago_open: fix static corruptor
Alan Cox [Sat, 22 Nov 2014 00:48:18 +0000 (00:48 +0000)]
_open: fix static corruptor

We can block in a tty open, which if another open then occurs leaves
the staticfast "ino" corrupted. Save it in a temporary variable so that
for we still get almost all the benefit of staticfast here.

9 years agomm: remove fairly useless and non-portable optimisation hack
Alan Cox [Sat, 22 Nov 2014 00:43:16 +0000 (00:43 +0000)]
mm: remove fairly useless and non-portable optimisation hack

Far better to optimise usercopy functions if you need to

9 years agotypes: rework the types for the BASE/TOP configurations
Alan Cox [Sat, 22 Nov 2014 00:12:34 +0000 (00:12 +0000)]
types: rework the types for the BASE/TOP configurations

This makes it a fair bit cleaner