FUZIX.git
6 years agomount: add support for fsck
Alan Cox [Sun, 22 Oct 2017 22:31:26 +0000 (23:31 +0100)]
mount: add support for fsck

- Dirty/clean status handling
- Write back superblocks when we go clean but not if we are clean (or bad)
- Add full checks so remount ro works for all cases

This allows you to fsck -a `prtroot` in /etc/rc to recover the system if
needed. Before rebooting you need to remount filesystems r/o or unmount them.

This last bit wants wiring into reboot so it does a runlevel change to init
unless -f is used. We can then umount everything nicely (by adding umount -a)
and remount the rootfs r/o as well as doing a killall etc when we shutdown.

6 years agosyscall_exec16: fix crash with small binaries, reduce code footprint
Alan Cox [Sun, 22 Oct 2017 22:31:13 +0000 (23:31 +0100)]
syscall_exec16: fix crash with small binaries, reduce code footprint

6 years agoStandalone: move to the new fsck behaviour
Alan Cox [Sun, 22 Oct 2017 22:30:44 +0000 (23:30 +0100)]
Standalone: move to the new fsck behaviour

6 years agofsck: get the fsck tool working
Alan Cox [Sun, 22 Oct 2017 22:28:31 +0000 (23:28 +0100)]
fsck: get the fsck tool working

This (with the needed kernel changes) seems to give us the correct behaviour
including handling recovering the live root file system.

If you boot with 'r' as an option or a dirty rootfs you'll now get a r/o
mount and you can fsck /dev/whatever to check it. If it's bad you'll then
get to fix it and it'll reboot.

6 years agoreboot: add user side support for reboot -f
Alan Cox [Sun, 22 Oct 2017 21:06:44 +0000 (22:06 +0100)]
reboot: add user side support for reboot -f

6 years agokernel: we don't use the void *'s back from the blkbuf ops so lose them
Alan Cox [Sun, 22 Oct 2017 18:55:26 +0000 (19:55 +0100)]
kernel: we don't use the void *'s back from the blkbuf ops so lose them

6 years agoExternalBuffers: document how the model works
Alan Cox [Sun, 22 Oct 2017 18:55:07 +0000 (19:55 +0100)]
ExternalBuffers: document how the model works

6 years agotest: fix silly error when copying fixes over
Alan Cox [Sun, 22 Oct 2017 18:45:33 +0000 (19:45 +0100)]
test: fix silly error when copying fixes over

6 years agofuzix-util: add remount to package list
Alan Cox [Sun, 22 Oct 2017 18:44:13 +0000 (19:44 +0100)]
fuzix-util: add remount to package list

6 years agoumount/remount: tidy up umount and add a remount
Alan Cox [Sun, 22 Oct 2017 18:40:23 +0000 (19:40 +0100)]
umount/remount: tidy up umount and add a remount

6 years agoumount: fix includes
Alan Cox [Sun, 22 Oct 2017 18:33:46 +0000 (19:33 +0100)]
umount: fix includes

This worked by luck before. Now add the correct include file

6 years agofsck: Rework standalone fsck to use as native fsck
Alan Cox [Sun, 22 Oct 2017 18:32:41 +0000 (19:32 +0100)]
fsck: Rework standalone fsck to use as native fsck

- Use bitmaps not bytemaps
- Support yes() properly

Not heavily tested yet!

6 years agomm: tidy up some odds and ends with the buffer changes
Alan Cox [Sun, 22 Oct 2017 17:27:18 +0000 (18:27 +0100)]
mm: tidy up some odds and ends with the buffer changes

We actually need something different to what was guessed at, so change the
prototypes and define the functions differently

6 years agodevsys: error rather than 0 on failed uput in devsys
Alan Cox [Sun, 22 Oct 2017 17:26:46 +0000 (18:26 +0100)]
devsys: error rather than 0 on failed uput in devsys

6 years agoMerge pull request #530 from beretta42/fix2
EtchedPixels [Sun, 22 Oct 2017 17:20:40 +0000 (18:20 +0100)]
Merge pull request #530 from beretta42/fix2

devsys: read should return no. of bytes

6 years ago/dev/proc: return number of bytes read.
Brett Gordon [Sun, 22 Oct 2017 15:44:19 +0000 (11:44 -0400)]
/dev/proc: return number of bytes read.

uput only returns -1 on validation fail, or 0 ok.  this made 'ps' sad.
/dev/kmem reading might be broken too...

6 years agoKernel: quick pointer fix.
Brett Gordon [Sun, 22 Oct 2017 15:06:49 +0000 (11:06 -0400)]
Kernel: quick pointer fix.

6 years agoumount: add new syscall wrapper for umount
Alan Cox [Sun, 22 Oct 2017 14:14:23 +0000 (15:14 +0100)]
umount: add new syscall wrapper for umount

6 years agoremount: add new syscall interface
Alan Cox [Sun, 22 Oct 2017 14:13:13 +0000 (15:13 +0100)]
remount: add new syscall interface

6 years agokernel: rework buffer handling and superblocks
Alan Cox [Sat, 21 Oct 2017 23:04:02 +0000 (00:04 +0100)]
kernel: rework buffer handling and superblocks

Be scared.. be very scared

Back up your disks before testing this changeset

The basic idea of this set of patches is to put in most of the framework for
keeping the buffer cache outside of the main kernel mapping. Instead we
introduce some functions to copy between kernel/buffer and user/buffer. As
most traffic goes directly between user/buffer this doesn't hurt us. These
patches don't implement the bits needed for an external buffer cache but they
do implement the framework required to add it.

To minimize impact on some bits like directory scanning we also introduce a
routine that with separate buffer cache address space wil make a temporary copy
of a small area, but on machines with the buffer cache in the normal place
resolves as essentially the same assembler as before (6502 suffers a tiny bit
I suspect).

In order to do this we also have to rework the mount handling. Superblocks are
now copied to/from buffers on mount and sync rather than pinning a buffer. The
superblock buffers mean that for a small system you probably want to drop the
buffer cache size by one block (the one previously pinned for the superblock)
in favour of the superblock table entries you'll now get (which are about 256
bytes each).

Execve is also tided up. We had a set of custom fastpath code for loading a
binary. Only it turns out that if we use readi the existing O_DIRECT fastpath
will do the work for us, which means execve itself can become oblivious to
where the buffer cache hides. This will need work for 8086 when split I/D hits
but it's quite manageable.

While I was at it I also realised that the problem with trying to add remount
support to mount is that remounting despite what the name implies is actually
a variant of umount. You do the same lookups to find the same existing
superblock, iterate the inode list but then swizzle some flags instead of
checking it is non-busy and firing it into hyperspace.

This patch changes umount(x) into _umount(x, flags) where flags include
MS_REMOUNT, MS_RDONLY and MS_NOSUID (not yet properly supported). This provides
enough functionality that you can now probably safely boot read only, fsck the
root fs (except I need to port the native fsck over and squash memory usage)
and the mount it r/w. You *cannot* fix the root fs and remount it without a
reboot. That involves jumping through far too many hoops. I think this is
sufficient as it'll allow the default initscripts to fsck, check and either
reboot or go read/write so we have proper fs recovery (whoopeee)

Programs using umount (all one if it) will need recompiling.

Why do all this

1. It lets you push several KB out of kernel space, which is valuable space
you can then turn into code, inodes (much needed) or processes.
2. Some platforms need the buffers themselves aligned and on boundaries. The
existing model doesn't handle this. For example the PC needs them so one does
not cross a DMA boundary.

At the moment we have systems with 512K+ of RAM that simply can't run with an
appropriate amount of buffering and inodes. Once 8086 is included we get into
situations where we might have 4MB of expanded memory and at that point we
can't hope to get the buffers needed into the 64K of data space, while we
can shove it elsewhere, and with expanded memory into a 64K expanded memory
bank along with some other oddments.

Once this support is finished we can shove both the tty buffers and the disk
buffers out of the way. On a 'big' configuration like a 286 PC we need something
like 30K for process/inode/file/buffer head/superblock data structures to match
the values 2BSD tuned to. That's without buffers ! The big hogs in the kernel
are then the inode structures and the process table entries. We might be able
to move a few bits of the process into its udata but neither it nor pushing
inodes out are easy problems to attack.

6 years agoLibrary: Fix Z80 breakage from 6809 fixes
Alan Cox [Sat, 21 Oct 2017 23:01:59 +0000 (00:01 +0100)]
Library: Fix Z80 breakage from 6809 fixes

ifeq in Makefiles is subtle and quick to anger....

Also check z80 not sdcc.

6 years agoemm: Add some notes
Alan Cox [Sat, 21 Oct 2017 12:50:59 +0000 (13:50 +0100)]
emm: Add some notes

6 years agoz80fixedbank: note a possible optimization
Alan Cox [Sat, 21 Oct 2017 12:50:28 +0000 (13:50 +0100)]
z80fixedbank: note a possible optimization

6 years ago8086: sketch out tricks.S for this platform
Alan Cox [Sat, 21 Oct 2017 12:50:06 +0000 (13:50 +0100)]
8086: sketch out tricks.S for this platform

6 years agokernel: TODO.md was getting tired
Alan Cox [Sat, 21 Oct 2017 12:44:49 +0000 (13:44 +0100)]
kernel: TODO.md was getting tired

6 years ago8086: add copy_fork helper
Alan Cox [Sat, 21 Oct 2017 12:44:15 +0000 (13:44 +0100)]
8086: add copy_fork helper

The banking code needs to own this because it owns the mapping sizes and
already needs the same copiers to move pages around.

6 years agoMerge branch 'master' of https://github.com/EtchedPixels/FUZIX
Alan Cox [Sat, 21 Oct 2017 11:43:53 +0000 (12:43 +0100)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

6 years agoMerge pull request #528 from beretta42/make2
EtchedPixels [Fri, 20 Oct 2017 14:18:15 +0000 (15:18 +0100)]
Merge pull request #528 from beretta42/make2

coco3: make different coco3 platforms

6 years agoMerge pull request #526 from beretta42/nodebug
EtchedPixels [Fri, 20 Oct 2017 14:17:45 +0000 (15:17 +0100)]
Merge pull request #526 from beretta42/nodebug

fs: oops... reserve debugging in fs :)

6 years agococo3: makefile doh!
Brett Gordon [Fri, 20 Oct 2017 00:40:45 +0000 (20:40 -0400)]
coco3: makefile doh!

6 years agococo3: compile for different types of cocos
Brett Gordon [Thu, 19 Oct 2017 19:38:03 +0000 (15:38 -0400)]
coco3: compile for different types of cocos

6 years agofs: oops... reserve debugging in fs :)
Brett Gordon [Thu, 19 Oct 2017 23:17:36 +0000 (19:17 -0400)]
fs: oops... reserve debugging in fs :)

6 years agofs: oops :) undefine debuging on fs
Brett Gordon [Thu, 19 Oct 2017 23:16:40 +0000 (19:16 -0400)]
fs: oops :) undefine debuging on fs

6 years agocrt0: use stosb not zero and mov
Alan Cox [Thu, 19 Oct 2017 22:00:20 +0000 (23:00 +0100)]
crt0: use stosb not zero and mov

Z80 programmer escaped into x86

6 years agoibmpc: PC implementation of the fast page copy and clear
Alan Cox [Thu, 19 Oct 2017 21:59:41 +0000 (22:59 +0100)]
ibmpc: PC implementation of the fast page copy and clear

6 years ago8086: add the page clear and copy logic
Alan Cox [Thu, 19 Oct 2017 21:59:03 +0000 (22:59 +0100)]
8086: add the page clear and copy logic

Fast 4K copy and clear routines for shuffling memory

6 years agomtx: forgot the final commit to fix the devtty build
Alan Cox [Thu, 19 Oct 2017 21:18:18 +0000 (22:18 +0100)]
mtx: forgot the final commit to fix the devtty build

6 years agoz180: set USERCPU so new build rules work
Alan Cox [Thu, 19 Oct 2017 21:15:54 +0000 (22:15 +0100)]
z180: set USERCPU so new build rules work

6 years agobank16; fix silly typo
Alan Cox [Thu, 19 Oct 2017 20:58:09 +0000 (21:58 +0100)]
bank16; fix silly typo

6 years agoMerge branch 'master' of https://github.com/EtchedPixels/FUZIX
Alan Cox [Thu, 19 Oct 2017 20:09:10 +0000 (21:09 +0100)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

6 years agoprojects: longer term kernel projects for someone
Alan Cox [Thu, 19 Oct 2017 20:08:57 +0000 (21:08 +0100)]
projects: longer term kernel projects for someone

6 years agotmpfree: missed TRS80
Alan Cox [Thu, 19 Oct 2017 20:08:30 +0000 (21:08 +0100)]
tmpfree: missed TRS80

6 years agotmpfree: update all the usages of brelse that will now be tmpfree
Alan Cox [Thu, 19 Oct 2017 20:07:55 +0000 (21:07 +0100)]
tmpfree: update all the usages of brelse that will now be tmpfree

6 years agokernel: preparatory work for Split I/D and for out of memory buffers
Alan Cox [Thu, 19 Oct 2017 20:04:39 +0000 (21:04 +0100)]
kernel: preparatory work for Split I/D and for out of memory buffers

Pair tmpbuf with tmpfree (which for now is still brelse) but in future may
be unrelated to bufcache

Change pagemap_realloc prototype and arrange existing loaders so nothing breaks
for now.

6 years agokernel: API changes for realloc
Alan Cox [Thu, 19 Oct 2017 20:03:02 +0000 (21:03 +0100)]
kernel: API changes for realloc

Set the basics out for coping with split I/D binaries and rearranging things
so chmem can mean "stack space". Dummies for now so we can change the API

6 years ago8086: low level support improvements
Alan Cox [Thu, 19 Oct 2017 19:48:22 +0000 (20:48 +0100)]
8086: low level support improvements

6 years agokeycode: add a couple of new keys
Alan Cox [Thu, 19 Oct 2017 19:48:10 +0000 (20:48 +0100)]
keycode: add a couple of new keys

6 years ago8086: banking logic (initial design)
Alan Cox [Thu, 19 Oct 2017 19:47:08 +0000 (20:47 +0100)]
8086: banking logic (initial design)

Not yet tested but this is intended to implement the interleaving of memory
tricks that 8086 Unixen did to avoid the Minix chmem mess.

6 years agoibmpc: scribbles on odder machines
Alan Cox [Thu, 19 Oct 2017 19:46:27 +0000 (20:46 +0100)]
ibmpc: scribbles on odder machines

6 years agoibmpc: Add work in progress
Alan Cox [Thu, 19 Oct 2017 19:45:02 +0000 (20:45 +0100)]
ibmpc: Add work in progress

6 years agoibmpc: load at logical 0
Alan Cox [Thu, 19 Oct 2017 19:44:42 +0000 (20:44 +0100)]
ibmpc: load at logical 0

6 years agomtx: Fix speed setting
Alan Cox [Thu, 19 Oct 2017 19:44:20 +0000 (20:44 +0100)]
mtx: Fix speed setting

6 years agoibmpc: update README based upon work so far
Alan Cox [Thu, 19 Oct 2017 19:43:48 +0000 (20:43 +0100)]
ibmpc: update README based upon work so far

6 years agoMerge pull request #525 from beretta42/make
EtchedPixels [Wed, 18 Oct 2017 20:46:54 +0000 (21:46 +0100)]
Merge pull request #525 from beretta42/make

coco3: clean up make / build script

6 years agococo3: clean up make / build script
Brett Gordon [Tue, 17 Oct 2017 17:38:46 +0000 (13:38 -0400)]
coco3: clean up make / build script

6 years agoMerge pull request #523 from beretta42/flashrom
EtchedPixels [Mon, 16 Oct 2017 18:37:32 +0000 (19:37 +0100)]
Merge pull request #523 from beretta42/flashrom

Flashrom - 6809

6 years agoMerge pull request #524 from beretta42/fview
EtchedPixels [Mon, 16 Oct 2017 18:37:18 +0000 (19:37 +0100)]
Merge pull request #524 from beretta42/fview

fview: bug fix endian checker

6 years agofview: bug fix endian checker
Brett Gordon [Mon, 16 Oct 2017 04:34:22 +0000 (00:34 -0400)]
fview: bug fix endian checker

6 years agoapp: make: build flashrom
Brett Gordon [Mon, 16 Oct 2017 03:36:04 +0000 (23:36 -0400)]
app: make: build flashrom

6 years agoflashrom: add 6809 makefile, rename z80 makefile
Brett Gordon [Mon, 16 Oct 2017 03:35:26 +0000 (23:35 -0400)]
flashrom: add 6809 makefile, rename z80 makefile

6 years agoibmpc: further 8086 sketching out
Alan Cox [Sun, 15 Oct 2017 21:13:50 +0000 (22:13 +0100)]
ibmpc: further 8086 sketching out

6 years agoTODO: update
Alan Cox [Sun, 15 Oct 2017 18:02:57 +0000 (19:02 +0100)]
TODO: update

6 years agoMerge branch 'master' of https://github.com/EtchedPixels/FUZIX
Alan Cox [Sun, 15 Oct 2017 18:02:20 +0000 (19:02 +0100)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

6 years agoSmallC: add missing call
Alan Cox [Sun, 15 Oct 2017 18:01:29 +0000 (19:01 +0100)]
SmallC: add missing call

Confused how it didn't get pushed originally

6 years agoMerge pull request #522 from beretta42/make
EtchedPixels [Sun, 15 Oct 2017 17:55:47 +0000 (18:55 +0100)]
Merge pull request #522 from beretta42/make

Odds and Ends Makefile

6 years agoMerge pull request #521 from beretta42/sdc
EtchedPixels [Sun, 15 Oct 2017 17:55:11 +0000 (18:55 +0100)]
Merge pull request #521 from beretta42/sdc

coco3: fix blkdev mapper routines: blk_op is not in common.

6 years agoibmpc: introduce a platform skeleton so we can test build 8086 core code
Alan Cox [Sun, 15 Oct 2017 17:47:59 +0000 (18:47 +0100)]
ibmpc: introduce a platform skeleton so we can test build 8086 core code

This is *miles* from being an actual port. It's just there to get the core
code comping.

6 years ago8086: move the prototype low level code over to gcc
Alan Cox [Sun, 15 Oct 2017 17:26:41 +0000 (18:26 +0100)]
8086: move the prototype low level code over to gcc

6 years agocpu-8086: move the prototype code to gcc ia16
Alan Cox [Sun, 15 Oct 2017 17:25:28 +0000 (18:25 +0100)]
cpu-8086: move the prototype code to gcc ia16

6 years agoz80pack: correct disk error reporting
Alan Cox [Sun, 15 Oct 2017 17:25:08 +0000 (18:25 +0100)]
z80pack: correct disk error reporting

6 years agolib: only install fcc libs if using sdcc
Brett Gordon [Sun, 15 Oct 2017 00:12:46 +0000 (20:12 -0400)]
lib: only install fcc libs if using sdcc

6 years agosmallc: add image install script
Brett Gordon [Sat, 14 Oct 2017 23:55:10 +0000 (19:55 -0400)]
smallc: add image install script

6 years agofview: fix never run-on comment
Brett Gordon [Sat, 14 Oct 2017 23:52:29 +0000 (19:52 -0400)]
fview: fix never run-on comment

6 years agoapps: make: add as09, rename v7games (duplicate), phony to force build
Brett Gordon [Sat, 14 Oct 2017 23:51:29 +0000 (19:51 -0400)]
apps: make: add as09, rename v7games (duplicate), phony to force build

6 years agosmallc: link CRT0 to build binary correctly.
Brett Gordon [Sat, 14 Oct 2017 23:47:13 +0000 (19:47 -0400)]
smallc: link CRT0 to build binary correctly.

6 years agolibs: 6809 makefile needs empty 'install' target
Brett Gordon [Sat, 14 Oct 2017 23:44:17 +0000 (19:44 -0400)]
libs: 6809 makefile needs empty 'install' target

6 years agoapp: as09/ld09: rename makefile
Brett Gordon [Sat, 14 Oct 2017 22:38:31 +0000 (18:38 -0400)]
app: as09/ld09: rename makefile

6 years agococo3: fix blkdev mapper routines: blk_op is not in common.
Brett Gordon [Sat, 14 Oct 2017 15:34:31 +0000 (11:34 -0400)]
coco3: fix blkdev mapper routines: blk_op is not in common.

6 years agoz80pack: with some versions of SDCC we extend into 0xEx00
Alan Cox [Fri, 13 Oct 2017 19:32:52 +0000 (20:32 +0100)]
z80pack: with some versions of SDCC we extend into 0xEx00

So move discard up a bit to make space for it

6 years agobank16k: () to (void) for neatness and consistency
Alan Cox [Fri, 13 Oct 2017 19:32:14 +0000 (20:32 +0100)]
bank16k: () to (void) for neatness and consistency

6 years agotest: fix compilation with newer SDCC
Alan Cox [Fri, 13 Oct 2017 19:30:22 +0000 (20:30 +0100)]
test: fix compilation with newer SDCC

void * and function types don't mix in strict interpretations of C (think about
split I/D for one)

Patch from Philipp Klaus Krause.

6 years agoMakefile: Clean up OBJSNS items in V7/cmd
Alan Cox [Fri, 13 Oct 2017 19:14:20 +0000 (20:14 +0100)]
Makefile: Clean up OBJSNS items in V7/cmd

6 years agoMakefile: clean up cpm-loader
Alan Cox [Fri, 13 Oct 2017 19:12:47 +0000 (20:12 +0100)]
Makefile: clean up cpm-loader

6 years agobank8086: draft code for 8086 bank handling
Alan Cox [Thu, 12 Oct 2017 22:24:25 +0000 (23:24 +0100)]
bank8086: draft code for 8086 bank handling

After much head scratching about how to implement the interleaving of
memory and real brk() and stack grow that early PC Unixes except Minix did,
I think I finally have something workable....

6 years agosgetl: sometimes C typing is perverse
Alan Cox [Thu, 5 Oct 2017 23:07:51 +0000 (00:07 +0100)]
sgetl: sometimes C typing is perverse

6 years ago6502: Make crt0 put the right address in the header not a hardcode
Alan Cox [Thu, 5 Oct 2017 23:07:20 +0000 (00:07 +0100)]
6502: Make crt0 put the right address in the header not a hardcode

6 years agokernel: fix signal race
Alan Cox [Thu, 5 Oct 2017 23:06:06 +0000 (00:06 +0100)]
kernel: fix signal race

Without this we can have the following occur

kill(pid, foo)
queues signal processing for foo
signal(SIGFOO, SIG_IGN)
executes pending signal and jumps to lala land

6 years ago6502: Fix ZP = 0 assumptions and note further fixes needed
Alan Cox [Tue, 3 Oct 2017 22:30:33 +0000 (23:30 +0100)]
6502: Fix ZP = 0 assumptions and note further fixes needed

The runtime for cc65 assumes it can save to ZP and jump to the same address
via a 16bit index. That fails on our 65C816 build and also on things like the
HuC. Also fix the same offence in ct0.s

Note that we need to save jmpvec+1/2 for re-entry (CC65 forgets to mention this)
and also that we can't just swap zp because unlike a kernel/IRQ switch where
this is valid in Fuzix it's possible to take one signal in another, thus
we must stack the ZP state somewhere (at 20 odd bytes probably the C stack)

6 years agoMakefile: Use $(MAKE) and support -j
Alan Cox [Tue, 3 Oct 2017 21:01:59 +0000 (22:01 +0100)]
Makefile: Use $(MAKE) and support -j

sdcc is slow as molasses but if you've got 16 cores you might as well use them
all 8)

6 years agoincludes: unbreak search.h properly
Alan Cox [Tue, 3 Oct 2017 16:22:08 +0000 (17:22 +0100)]
includes: unbreak search.h properly

6 years agocpm-emulator: Remove only the dead bits this time
Alan Cox [Tue, 3 Oct 2017 15:48:57 +0000 (16:48 +0100)]
cpm-emulator: Remove only the dead bits this time

6 years agoRevert "kernel: remove obsolete CP/M bits"
Alan Cox [Tue, 3 Oct 2017 15:47:56 +0000 (16:47 +0100)]
Revert "kernel: remove obsolete CP/M bits"

Oops.. deleted cpm-loader as well in error

This reverts commit 876590b88adcf31cebcdc8c2bec3f3d1f0612dd8.

6 years ago65c816: assorted low level fixes
Alan Cox [Sun, 1 Oct 2017 23:48:17 +0000 (00:48 +0100)]
65c816: assorted low level fixes

With these fixed we get to a shell prompt and can run some commands. To get
further is going to need cc65 modifications as cc65 generates the following
code in /bin/ls

STA $08 3
STX $09 3
JMP $0008 5

which of course goes castors up on the 65C816 set up because DP is not B:0000
nor can it be.

So far this seems to be the only problem case and it looks as if generating a

PHX 3
PHA 3
RTS 6

would be within one clock for 65C02 or later. 6502 compatible code
will need an uglier fixup I fear.

STA $08 3
TXA 2
PHA 3
LDA $08 3
PHA 3
RTS 6

or similar which isn't pretty but works (self modifying code isn't on
because we might re-enter mid execution)

6 years agofcc: add the ability to pass arguments directly to the underlying compiler
Alan Cox [Sun, 1 Oct 2017 16:30:49 +0000 (17:30 +0100)]
fcc: add the ability to pass arguments directly to the underlying compiler

Please only use this for debug as the goal is to make fcc eventually be a
generic front end that hides all the differences!

Usage is like gcc

fcc -Wc,-sdcc-option

6 years ago65c816: fix fork stack shifting
Alan Cox [Sat, 30 Sep 2017 22:49:08 +0000 (23:49 +0100)]
65c816: fix fork stack shifting

We now run the child - and bomb when the parent is switched back in .. 8(

6 years agoINSTALL: /opt/fcc note
Alan Cox [Sat, 30 Sep 2017 21:32:09 +0000 (22:32 +0100)]
INSTALL: /opt/fcc note

6 years agoINSTALL: we now have simple install instructions of sorts
Alan Cox [Sat, 30 Sep 2017 21:30:48 +0000 (22:30 +0100)]
INSTALL: we now have simple install instructions of sorts

Some make targets to auto-gen root file systems are still needed

6 years agoMakefile: install crt0 and libc
Alan Cox [Sat, 30 Sep 2017 21:26:09 +0000 (22:26 +0100)]
Makefile: install crt0 and libc

6 years agolibc: Add the missing tsearch functions
Alan Cox [Sat, 30 Sep 2017 19:41:49 +0000 (20:41 +0100)]
libc: Add the missing tsearch functions

This leaves the hash tables (hsearch etc) and ftw/nftw as the only big APIs
we are missing.

6 years agolibc: and add roundf to Z80 build for testing
Alan Cox [Sat, 30 Sep 2017 19:12:51 +0000 (20:12 +0100)]
libc: and add roundf to Z80 build for testing

We don't yet build the maths lib for 6809 but should do