FUZIX.git
9 years agostart: the top of user memory we fake up depends on program base
Alan Cox [Fri, 16 Jan 2015 23:00:00 +0000 (23:00 +0000)]
start: the top of user memory we fake up depends on program base

9 years agousermem: Get the 6502 usermem working
Alan Cox [Fri, 16 Jan 2015 22:58:14 +0000 (22:58 +0000)]
usermem: Get the 6502 usermem working

Some hacks left over that want cleaning up, and it's also very slow the way
it is done, but this is a generic 'reference' approach so will do for now

9 years agold65.cfg: define stubs for crt0.s to use
Alan Cox [Fri, 16 Jan 2015 22:57:42 +0000 (22:57 +0000)]
ld65.cfg: define stubs for crt0.s to use

9 years agocrt0.: we need to copy STUBS as well as COMMONMEM
Alan Cox [Fri, 16 Jan 2015 22:57:20 +0000 (22:57 +0000)]
crt0.: we need to copy STUBS as well as COMMONMEM

9 years ago6502: sei after we switched memory banks and set our flags up
Alan Cox [Fri, 16 Jan 2015 22:56:58 +0000 (22:56 +0000)]
6502: sei after we switched memory banks and set our flags up

9 years ago6502: kernel.def was out of date - fix it
Alan Cox [Fri, 16 Jan 2015 22:56:39 +0000 (22:56 +0000)]
6502: kernel.def was out of date - fix it

9 years agousermem-6502: use tmp2,ptr2 and document that ptr1/tmp1 are for the mappers
Alan Cox [Fri, 16 Jan 2015 20:48:10 +0000 (20:48 +0000)]
usermem-6502: use tmp2,ptr2 and document that ptr1/tmp1 are for the mappers

Still all disabled while we debug

9 years agotgl6502: correct comment in crt0
Alan Cox [Fri, 16 Jan 2015 20:47:39 +0000 (20:47 +0000)]
tgl6502: correct comment in crt0

9 years agotgl6502: Store the reference commonmem ROM copy right at the top of memory
Alan Cox [Fri, 16 Jan 2015 20:46:06 +0000 (20:46 +0000)]
tgl6502: Store the reference commonmem ROM copy right at the top of memory

This plus discard etc can live anywhere really so stick them right up the top
so it's easier to see what our memory usage looks like

9 years agofilesys: correct invalid ptr check
Alan Cox [Fri, 16 Jan 2015 20:45:32 +0000 (20:45 +0000)]
filesys: correct invalid ptr check

9 years ago6502: add warning about ordering of stash_zp
Alan Cox [Fri, 16 Jan 2015 20:45:15 +0000 (20:45 +0000)]
6502: add warning about ordering of stash_zp

9 years agousermem_6502: add uzero, uputc and uputw
Alan Cox [Fri, 16 Jan 2015 17:54:17 +0000 (17:54 +0000)]
usermem_6502: add uzero, uputc and uputw

Still need to do uget, uput and ugets

9 years agoinit: build ok with cc65
Alan Cox [Fri, 16 Jan 2015 17:37:34 +0000 (17:37 +0000)]
init: build ok with cc65

9 years ago6502 lib: Small changes to get us to the point we can link init
Alan Cox [Fri, 16 Jan 2015 17:36:53 +0000 (17:36 +0000)]
6502 lib: Small changes to get us to the point we can link init

Mostly we need strtol as the cc65 runtime one tries to use the wrong isfoo()
functions

9 years agosyscall_6502: don't add exit to the Makefile twice
Alan Cox [Fri, 16 Jan 2015 16:05:52 +0000 (16:05 +0000)]
syscall_6502: don't add exit to the Makefile twice

9 years agocrt0_6502: clean up exit symbols
Alan Cox [Fri, 16 Jan 2015 16:04:57 +0000 (16:04 +0000)]
crt0_6502: clean up exit symbols

9 years agotools/syscall_6502: generate correct fastcall stacking also don't delete syscall...
Alan Cox [Fri, 16 Jan 2015 16:03:36 +0000 (16:03 +0000)]
tools/syscall_6502: generate correct fastcall stacking also don't delete syscall.s on clean

9 years agocrt0_6502: exit via return implies exit() not _exit()
Alan Cox [Fri, 16 Jan 2015 16:03:16 +0000 (16:03 +0000)]
crt0_6502: exit via return implies exit() not _exit()

9 years agocrt0_6502: exit is handled differently to the classic cc65 runtime
Alan Cox [Fri, 16 Jan 2015 16:02:44 +0000 (16:02 +0000)]
crt0_6502: exit is handled differently to the classic cc65 runtime

9 years ago6502: syscall return helper so we can set up errno correctly
Alan Cox [Fri, 16 Jan 2015 15:51:59 +0000 (15:51 +0000)]
6502: syscall return helper so we can set up errno correctly

9 years agocrt0_6502: update to reflect proposed ABI
Alan Cox [Fri, 16 Jan 2015 15:43:21 +0000 (15:43 +0000)]
crt0_6502: update to reflect proposed ABI

9 years agoMakefile.6502: build the library with tools and syscalls
Alan Cox [Fri, 16 Jan 2015 15:42:59 +0000 (15:42 +0000)]
Makefile.6502: build the library with tools and syscalls

9 years agotools/syscall6502: corrections
Alan Cox [Fri, 16 Jan 2015 15:41:24 +0000 (15:41 +0000)]
tools/syscall6502: corrections

This now generates some vaguely plausible looking code 8)

9 years agotgl6502: first cut at a sane syscall ABI
Alan Cox [Fri, 16 Jan 2015 15:40:29 +0000 (15:40 +0000)]
tgl6502: first cut at a sane syscall ABI

9 years agokernel: correct syscall_name header
Alan Cox [Fri, 16 Jan 2015 15:40:03 +0000 (15:40 +0000)]
kernel: correct syscall_name header

9 years agoTODO: remove fcc things already done
Alan Cox [Fri, 16 Jan 2015 14:30:38 +0000 (14:30 +0000)]
TODO: remove fcc things already done

9 years agosyscall_exec: handle R2L and L2R stacking compilers
Alan Cox [Fri, 16 Jan 2015 13:36:58 +0000 (13:36 +0000)]
syscall_exec: handle R2L and L2R stacking compilers

9 years ago6502: Usermode execution start up code
Alan Cox [Fri, 16 Jan 2015 13:36:30 +0000 (13:36 +0000)]
6502: Usermode execution start up code

9 years agotgl6502: tool can now automatically merge a monitor
Alan Cox [Fri, 16 Jan 2015 13:18:19 +0000 (13:18 +0000)]
tgl6502: tool can now automatically merge a monitor

9 years agotgl6502: Work on execve, also jump to monitor on crashes
Alan Cox [Fri, 16 Jan 2015 13:12:40 +0000 (13:12 +0000)]
tgl6502: Work on execve, also jump to monitor on crashes

9 years agolibc: includes for changes
Alan Cox [Fri, 16 Jan 2015 01:19:43 +0000 (01:19 +0000)]
libc: includes for changes

9 years agolibc: some more C locale only wrapping and glue
Alan Cox [Fri, 16 Jan 2015 00:57:55 +0000 (00:57 +0000)]
libc: some more C locale only wrapping and glue

Just so we can build intl apps without hassle

9 years agolibc: various minimalist locale stuff (C locale wrappers basically)
Alan Cox [Fri, 16 Jan 2015 00:32:04 +0000 (00:32 +0000)]
libc: various minimalist locale stuff (C locale wrappers basically)

9 years agoioctl: note where tty ioctls live
Alan Cox [Thu, 15 Jan 2015 23:46:51 +0000 (23:46 +0000)]
ioctl: note where tty ioctls live

9 years agosched_yield: A syscall a day 8)
Alan Cox [Thu, 15 Jan 2015 23:42:52 +0000 (23:42 +0000)]
sched_yield: A syscall a day 8)

9 years ago6502: Further libc tidying
Alan Cox [Thu, 15 Jan 2015 23:42:00 +0000 (23:42 +0000)]
6502: Further libc tidying

9 years agosyscalls: add getpgrp (forgot it before!) and also enable flock
Alan Cox [Wed, 14 Jan 2015 00:38:23 +0000 (00:38 +0000)]
syscalls: add getpgrp (forgot it before!) and also enable flock

9 years agoMerge branch 'master' of https://github.com/EtchedPixels/FUZIX
Alan Cox [Tue, 13 Jan 2015 22:03:19 +0000 (22:03 +0000)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

9 years agoREADME: notes on things for the tgl6502
Alan Cox [Tue, 13 Jan 2015 22:02:46 +0000 (22:02 +0000)]
README: notes on things for the tgl6502

9 years agocpu: make brk address rules CPU specific
Alan Cox [Tue, 13 Jan 2015 22:01:23 +0000 (22:01 +0000)]
cpu: make brk address rules CPU specific

The 6502 port has different stack policies to other processors.

Also while we are at it add uaddr_t so we can support different address
space sizes, ready for a future target or two.

9 years agoMakefile: use -O not -Or, we don't use register variables as it needs
Alan Cox [Tue, 13 Jan 2015 22:00:44 +0000 (22:00 +0000)]
Makefile: use -O not -Or, we don't use register variables as it needs

9 years agolibc: Make the libc code with cc65. Clean all the header bugs it found
Alan Cox [Tue, 13 Jan 2015 21:57:49 +0000 (21:57 +0000)]
libc: Make the libc code with cc65. Clean all the header bugs it found

cc65 is quite pedantic about consts, sdcc is rather slack. Clean up all the
errors cc65 found. That should also make it rather easier to do the gcc
builds.

This isn't yet a complete cc65 libc. It doesn't handle some of the calls due
to arg ordering funnies and it doesn't have a syscalls lib. A pure runtime
library for a cc65 'fuzix' target and crt0.s are also needed.

9 years agoMerge pull request #67 from willsowerbutts/z180int
EtchedPixels [Tue, 13 Jan 2015 21:55:03 +0000 (21:55 +0000)]
Merge pull request #67 from willsowerbutts/z180int

Interrupt fixes ("I'm in ur interrupt handler, enabling ur interrupts")

9 years agoKernel: getproc() should not enable interrupts if it is called from
Will Sowerbutts [Tue, 13 Jan 2015 20:28:19 +0000 (20:28 +0000)]
Kernel: getproc() should not enable interrupts if it is called from
within an interrupt handler because we cannot handle any interrupts that
arrive as a result. Enable interrupts only when no process is ready,
which is obviously never the case when we're preempting a process from
within a timer interrupt. The kernel will also panic if we're about to
enable interrupts in getproc() when we're already handling one.

9 years agoKernel: Change NMOS_Z80/CMOS_Z80 to Z80_TYPE. Change _irqvector so that
Will Sowerbutts [Tue, 13 Jan 2015 20:27:43 +0000 (20:27 +0000)]
Kernel: Change NMOS_Z80/CMOS_Z80 to Z80_TYPE. Change _irqvector so that
it does not change in case of re-entrant interrupts.

9 years agotypes.h: cc65 can't handle 64bit ints and isn't likely to do so soon
Alan Cox [Mon, 12 Jan 2015 22:14:05 +0000 (22:14 +0000)]
types.h: cc65 can't handle 64bit ints and isn't likely to do so soon

9 years agounistd/syscalls: Fix 6502 type warnings
Alan Cox [Mon, 12 Jan 2015 22:13:30 +0000 (22:13 +0000)]
unistd/syscalls: Fix 6502 type warnings

9 years agossh: fix warning from cc65
Alan Cox [Mon, 12 Jan 2015 22:13:07 +0000 (22:13 +0000)]
ssh: fix warning from cc65

9 years agostring.h: fix implicit int usage
Alan Cox [Mon, 12 Jan 2015 22:12:33 +0000 (22:12 +0000)]
string.h: fix implicit int usage

9 years agoutils: some tweaks to keep cc65 happy.
Alan Cox [Mon, 12 Jan 2015 22:12:06 +0000 (22:12 +0000)]
utils: some tweaks to keep cc65 happy.

9 years agotgl6502: Make it possible to split out discard, also enable new compiler flags
Alan Cox [Mon, 12 Jan 2015 21:09:21 +0000 (21:09 +0000)]
tgl6502: Make it possible to split out discard, also enable new compiler flags

You'll need the patch I just posted to the cc65 list to use --all-fastcall but
if you take it out all should be well with the current git snapshots

9 years agoioctl: tidy up a bit more
Alan Cox [Mon, 12 Jan 2015 11:13:19 +0000 (11:13 +0000)]
ioctl: tidy up a bit more

Unknown ioctls return ENOTTY not EINVAL (Unix history...) so we need to do
the right thing. In addition we automatically set the errno so blkdev doesn't
have to care about it

9 years agodevio: update to the new ioctl naming
Alan Cox [Mon, 12 Jan 2015 11:11:49 +0000 (11:11 +0000)]
devio: update to the new ioctl naming

9 years agoioctl: implement the superuser bit
Alan Cox [Mon, 12 Jan 2015 11:05:53 +0000 (11:05 +0000)]
ioctl: implement the superuser bit

We need to check this at the syscall level so we can allow it to be invoked
internally without security restrictions but directly with

9 years agoioctl: rename the BLOCK_FLUSH ioctl to match the Linux name
Alan Cox [Mon, 12 Jan 2015 11:05:05 +0000 (11:05 +0000)]
ioctl: rename the BLOCK_FLUSH ioctl to match the Linux name

Also tidy the ioctl table space

9 years agotglsplice: allow a file system to be attached
Alan Cox [Mon, 12 Jan 2015 11:04:18 +0000 (11:04 +0000)]
tglsplice: allow a file system to be attached

9 years agotgl6502: push further work on the tgl6502
Alan Cox [Mon, 12 Jan 2015 11:03:56 +0000 (11:03 +0000)]
tgl6502: push further work on the tgl6502

9 years agoMerge pull request #66 from willsowerbutts/ideflush3
EtchedPixels [Mon, 12 Jan 2015 10:52:27 +0000 (10:52 +0000)]
Merge pull request #66 from willsowerbutts/ideflush3

Cache flush (take 3)

9 years agodevide: Set cache dirty flag even when write operation fails
Will Sowerbutts [Mon, 12 Jan 2015 00:44:40 +0000 (00:44 +0000)]
devide: Set cache dirty flag even when write operation fails

9 years agoblkdev: Remove obsolete blkdev_flush() from header file
Will Sowerbutts [Mon, 12 Jan 2015 00:41:49 +0000 (00:41 +0000)]
blkdev: Remove obsolete blkdev_flush() from header file

9 years agop112, n8vem-mark4: Update devices table for new blkdev ioctl.
Will Sowerbutts [Sun, 11 Jan 2015 23:47:25 +0000 (23:47 +0000)]
p112, n8vem-mark4: Update devices table for new blkdev ioctl.

9 years agodevide: Support for flushing device cache. Avoids sending redundant
Will Sowerbutts [Sun, 11 Jan 2015 23:45:49 +0000 (23:45 +0000)]
devide: Support for flushing device cache. Avoids sending redundant
flush commands when no blocks have been written since the last flush.

9 years agoblkdev: Support for flushing device caches on BLOCK_FLUSH_CACHE ioctl.
Will Sowerbutts [Sun, 11 Jan 2015 23:44:27 +0000 (23:44 +0000)]
blkdev: Support for flushing device caches on BLOCK_FLUSH_CACHE ioctl.

9 years agoKernel: d_flush() flushes the write cache of a device, using the private
Will Sowerbutts [Sun, 11 Jan 2015 23:41:49 +0000 (23:41 +0000)]
Kernel: d_flush() flushes the write cache of a device, using the private
device ioctl BLOCK_FLUSH_CACHE.

d_flush() is called on a device whenever a writable file is closed.

9 years agoMerge pull request #64 from willsowerbutts/blkdevfix
EtchedPixels [Sun, 11 Jan 2015 20:47:13 +0000 (20:47 +0000)]
Merge pull request #64 from willsowerbutts/blkdevfix

blkdev: Bug fix - final blkdev_table entry could not be used

9 years agoblkdev: Bug fix - final blkdev_table entry could not be used
Will Sowerbutts [Sun, 11 Jan 2015 17:47:43 +0000 (17:47 +0000)]
blkdev: Bug fix - final blkdev_table entry could not be used

9 years agotgl6502: fix various basic things such as __fastcall__ for memcpy
Alan Cox [Sat, 10 Jan 2015 22:28:26 +0000 (22:28 +0000)]
tgl6502: fix various basic things such as __fastcall__ for memcpy

Now things look a bit saner and we get to the point of sitting on our butt
waiting for a keyboard input.

9 years ago6502: save the zero page magic bits on interrupt, other minor fixups
Alan Cox [Sat, 10 Jan 2015 21:46:50 +0000 (21:46 +0000)]
6502: save the zero page magic bits on interrupt, other minor fixups

9 years agotricks.s: fork and copy routine for the 6502
Alan Cox [Sat, 10 Jan 2015 21:06:42 +0000 (21:06 +0000)]
tricks.s: fork and copy routine for the 6502

Or at least a first guess thereat

9 years agotgl6502: start fleshing out the 6502 version of tricks.s
Alan Cox [Sat, 10 Jan 2015 18:33:59 +0000 (18:33 +0000)]
tgl6502: start fleshing out the 6502 version of tricks.s

9 years agocrt0.s: load $FF into S not $0
Alan Cox [Sat, 10 Jan 2015 14:47:26 +0000 (14:47 +0000)]
crt0.s: load $FF into S not $0

9 years agotgl6502: update README
Alan Cox [Sat, 10 Jan 2015 00:48:58 +0000 (00:48 +0000)]
tgl6502: update README

9 years agotglsplice: turns fuzix.bin into 6502.rom.
Alan Cox [Sat, 10 Jan 2015 00:44:48 +0000 (00:44 +0000)]
tglsplice: turns fuzix.bin into 6502.rom.

We burn a bank the way we do it right now. Possibly we could instead swap two
banks over so that 0x41 stays the top bank.

9 years agotgl6502: initial bring up tree elements for the TGL6502 platform
Alan Cox [Sat, 10 Jan 2015 00:43:20 +0000 (00:43 +0000)]
tgl6502: initial bring up tree elements for the TGL6502 platform

There is a lot left to fill in on the 6502 tree. There are also some very
weird bugs right now such as kprintf working/not working depending upon subtle
changes to code sizes elsewhere. It's hard at this point to tell if its
emulator bugs, something weird in the setup code, compiler etc.

All part of the fun.

9 years ago6502: don't built -tc128, we want ascii not petsci
Alan Cox [Sat, 10 Jan 2015 00:41:40 +0000 (00:41 +0000)]
6502: don't built -tc128, we want ascii not petsci

9 years agoprocess.c: turn debug back off in default build
Alan Cox [Sat, 10 Jan 2015 00:40:46 +0000 (00:40 +0000)]
process.c: turn debug back off in default build

9 years agoprocess.c: fix build with the full debug enabled
Alan Cox [Sat, 10 Jan 2015 00:40:25 +0000 (00:40 +0000)]
process.c: fix build with the full debug enabled

9 years ago6502: some code tidy
Alan Cox [Sat, 10 Jan 2015 00:40:14 +0000 (00:40 +0000)]
6502: some code tidy

9 years ago6502: stubs for usermem
Alan Cox [Sat, 10 Jan 2015 00:40:04 +0000 (00:40 +0000)]
6502: stubs for usermem

9 years agoMerge branch 'master' of https://github.com/EtchedPixels/FUZIX
Alan Cox [Sat, 10 Jan 2015 00:39:46 +0000 (00:39 +0000)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

9 years agoMerge pull request #63 from willsowerbutts/endian
EtchedPixels [Sat, 10 Jan 2015 00:27:07 +0000 (00:27 +0000)]
Merge pull request #63 from willsowerbutts/endian

devide, mbr: Remove little endian assumptions

9 years agoMerge pull request #61 from adx11/master
EtchedPixels [Sat, 10 Jan 2015 00:26:03 +0000 (00:26 +0000)]
Merge pull request #61 from adx11/master

Makefile: add missing clean targets

9 years agodevide: Address another little-endian assumption
Will Sowerbutts [Fri, 9 Jan 2015 19:56:03 +0000 (19:56 +0000)]
devide: Address another little-endian assumption

9 years agombr: Do not assume little-endian
Will Sowerbutts [Thu, 8 Jan 2015 22:03:49 +0000 (22:03 +0000)]
mbr: Do not assume little-endian

9 years agodevide: Do not assume little-endian
Will Sowerbutts [Thu, 8 Jan 2015 21:48:12 +0000 (21:48 +0000)]
devide: Do not assume little-endian

9 years agoMerge branch 'master' of https://github.com/EtchedPixels/FUZIX
Alan Cox [Fri, 9 Jan 2015 16:53:14 +0000 (16:53 +0000)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

9 years agoMakefile: add missig clean targets
Anthony DeStefano [Fri, 9 Jan 2015 01:16:15 +0000 (20:16 -0500)]
Makefile: add missig clean targets

tools/bankld can use Makefile
tools/bihx and tools/bintomdv are built in the Makefile
common.ihx, common.bin, and relocs.dat are outputs from tools/binhx

9 years agoMerge pull request #59 from willsowerbutts/tickfix
EtchedPixels [Thu, 8 Jan 2015 21:31:04 +0000 (21:31 +0000)]
Merge pull request #59 from willsowerbutts/tickfix

Kernel: Fix definition of ticks_t

9 years agoKernel: Fix definition of ticks_t
Will Sowerbutts [Thu, 8 Jan 2015 19:38:14 +0000 (19:38 +0000)]
Kernel: Fix definition of ticks_t

9 years agoFinal tweaks and TRS80 now swaps on partitions other than 0
Alan Cox [Tue, 6 Jan 2015 23:28:15 +0000 (23:28 +0000)]
Final tweaks and TRS80 now swaps on partitions other than 0

You can now set up a 10MB hd or similar with a mix of disk and swap, and it
also won't randomly pee on disks it doesn't own.

9 years agotrslabel: correct set up
Alan Cox [Tue, 6 Jan 2015 23:12:18 +0000 (23:12 +0000)]
trslabel: correct set up

9 years agostart: update year
Alan Cox [Tue, 6 Jan 2015 23:10:34 +0000 (23:10 +0000)]
start: update year

9 years agotrslabel: initial quick hack volume labeller for TRS80 volumes
Alan Cox [Tue, 6 Jan 2015 23:06:15 +0000 (23:06 +0000)]
trslabel: initial quick hack volume labeller for TRS80 volumes

9 years agotrs80: fix silly bug in devhd - 256 byte sectors so we want 2,+128
Alan Cox [Tue, 6 Jan 2015 23:05:50 +0000 (23:05 +0000)]
trs80: fix silly bug in devhd - 256 byte sectors so we want 2,+128

9 years agodiskgeom: correct lba struct
Alan Cox [Tue, 6 Jan 2015 23:05:36 +0000 (23:05 +0000)]
diskgeom: correct lba struct

9 years agotrs80/core: Enable the pieces we need for TRS80 with labels
Alan Cox [Tue, 6 Jan 2015 22:25:18 +0000 (22:25 +0000)]
trs80/core: Enable the pieces we need for TRS80 with labels

This is very much a work in progress. Mostly pushing it so that Will can
compare with the blkdev work and the needs of the two models in terms
of functionality and size.

9 years agoanalysemap: allow -a to also size discard functions
Alan Cox [Tue, 6 Jan 2015 22:24:37 +0000 (22:24 +0000)]
analysemap: allow -a to also size discard functions

9 years agodiskgeom: disk geometry and mini partitions for small boxen
Alan Cox [Tue, 6 Jan 2015 21:41:46 +0000 (21:41 +0000)]
diskgeom: disk geometry and mini partitions for small boxen

9 years agoTidy up the DISCARD hack
Alan Cox [Tue, 6 Jan 2015 21:34:50 +0000 (21:34 +0000)]
Tidy up the DISCARD hack

9 years agoblkdev: Break apart blkdev_init
Alan Cox [Tue, 6 Jan 2015 12:31:14 +0000 (12:31 +0000)]
blkdev: Break apart blkdev_init

There are two reasons for doing this

1. We push a lot of arguments, and will need to push more which will break the
   planned banked kernel, as well as eating memory
2. We want to give drivers the ability to provide their own alternative scan
   methods

Doing the alloc/assign/scan sequence doesn't cost us anything but is much
more flexible.