FUZIX.git
6 years agolink: remove root power to link to a directory
Alan Cox [Wed, 21 Feb 2018 20:35:48 +0000 (20:35 +0000)]
link: remove root power to link to a directory

It's never used, it makes a nasty mess and it breaks the locking

6 years agomkdir: Fix error recover path
Alan Cox [Wed, 21 Feb 2018 20:32:26 +0000 (20:32 +0000)]
mkdir: Fix error recover path

This tried to unlink random crap not the correct path. Broken when I tidied
up the path walking logic

6 years agoflock: LEVEL_0 update
Alan Cox [Wed, 21 Feb 2018 20:31:36 +0000 (20:31 +0000)]
flock: LEVEL_0 update

6 years agolevels: LEVEL_0 makes no sense except as a uaccess check shortener now
Alan Cox [Wed, 21 Feb 2018 20:30:41 +0000 (20:30 +0000)]
levels: LEVEL_0 makes no sense except as a uaccess check shortener now

For anything else we are probably better using overlays for stuff like
mkdir and rmdir than being incompatible

6 years agounlink: lock right node
Alan Cox [Wed, 21 Feb 2018 20:30:30 +0000 (20:30 +0000)]
unlink: lock right node

6 years agofs: fixes from testing
Alan Cox [Wed, 21 Feb 2018 20:24:01 +0000 (20:24 +0000)]
fs: fixes from testing

1. Don't allow rmdir .
2. Don't allow rmdir of a directory with a file in it (we stopped only subdirs)
3. Don't consider unreferenced inodes when checking if a remount is valid
4. Fix the case of

process A
cd /tmp/foo
process B
rmdir /tmp/foo
process A
ls .   (stale entry)

6 years agofilesys: introduce a routine to check if a directory is empty of files
Alan Cox [Wed, 21 Feb 2018 20:23:42 +0000 (20:23 +0000)]
filesys: introduce a routine to check if a directory is empty of files

6 years agounlink: will need to hold lock over unlinki
Alan Cox [Wed, 21 Feb 2018 20:22:47 +0000 (20:22 +0000)]
unlink: will need to hold lock over unlinki

6 years ago65c816: fix kprintf
Alan Cox [Wed, 21 Feb 2018 20:22:27 +0000 (20:22 +0000)]
65c816: fix kprintf

6 years agodevio: Fix build with IDUMP, minor tweaks for error handling
Alan Cox [Wed, 21 Feb 2018 14:14:54 +0000 (14:14 +0000)]
devio: Fix build with IDUMP, minor tweaks for error handling

6 years agodevio: First cut at putting into place sleeping I/O support
Alan Cox [Wed, 21 Feb 2018 13:32:49 +0000 (13:32 +0000)]
devio: First cut at putting into place sleeping I/O support

This allows the locking frameworks needed to let block devices sleep, but not
to do I/O from interrupts. The latter is much more complicated and it's not
clear that is useful except on bigger systems which need a different buffer
cache anyway

6 years agokernel: pathbuf is dead remove the remnants
Alan Cox [Wed, 21 Feb 2018 11:08:29 +0000 (11:08 +0000)]
kernel: pathbuf is dead remove the remnants

6 years agokernel: minimal patches and defines ready for parallel fs access support
Alan Cox [Tue, 20 Feb 2018 22:14:33 +0000 (22:14 +0000)]
kernel: minimal patches and defines ready for parallel fs access support

This puts in place the pieces we will need to hook up in order to support
sleeping file system accesses. We also need to add 'D' state to the scheduler
but that is needed anyway to fix some other corner cases.

6 years agopg: Add the late V7 "pg" command
Alan Cox [Tue, 20 Feb 2018 18:31:19 +0000 (18:31 +0000)]
pg: Add the late V7 "pg" command

6 years agocpio: some tidying
Alan Cox [Tue, 20 Feb 2018 18:31:03 +0000 (18:31 +0000)]
cpio: some tidying

Really we should switch to ascii format cpio

6 years agoFrom: Tormod Volden <debian.tormod@gmail.com>
Alan Cox [Tue, 20 Feb 2018 14:24:54 +0000 (14:24 +0000)]
From: Tormod Volden <debian.tormod@gmail.com>

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
---
 Kernel/platform-dragon-nx32/Makefile |  1 +
 Kernel/tools/lw-checkmap             | 12 +++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/Kernel/platform-dragon-nx32/Makefile b/Kernel/platform-dragon-nx32/Makefile
index efea7ab..8a40526 100644
--- a/Kernel/platform-dragon-nx32/Makefile
+++ b/Kernel/platform-dragon-nx32/Makefile
@@ -60,3 +60,4 @@ image:
  devsd.o devsd_discard.o spi.o devscsi.o devscsi_discard.o \
  scsi_tc3.o discard.o
  ../tools/pad256 ../fuzix.bin
+ ../tools/lw-checkmap ../fuzix.map
diff --git a/Kernel/tools/lw-checkmap b/Kernel/tools/lw-checkmap
index f98a552..9402b2f 100755
--- a/Kernel/tools/lw-checkmap
+++ b/Kernel/tools/lw-checkmap
@@ -1,8 +1,14 @@
 :
 # Simple check of map file generated by lwlink (LWTOOLS)
-grep ^Section "$1" | sort -k5 | awk '{
+grep ^Section "$1" | sort -k5 | awk '
+  BEGIN{ errs=0 }
+
+  {
  st=strtonum("0x"$6);
  if (en<st) {printf "free 0x%x-0x%x = %i\n",en,st,st-en};
- if (en>st) {printf "overlap at 0x%x-0x%x!\n",st,en};
+ if (en>st) {printf "overlap at 0x%x-0x%x!\n",st,en; errs++};
  en=st+strtonum("0x"$8);
-}'
+  }
+
+  END{ if (errs>0) {exit 1}; }
+'
--
2.7.4

6 years agopdp11: Add another missing piece and turn on library building
Alan Cox [Sun, 18 Feb 2018 14:15:03 +0000 (14:15 +0000)]
pdp11: Add another missing piece and turn on library building

6 years agopdp11: setjmp structure
Alan Cox [Sun, 18 Feb 2018 14:03:35 +0000 (14:03 +0000)]
pdp11: setjmp structure

6 years ago68000: fix longjmp code
Alan Cox [Sun, 18 Feb 2018 14:03:18 +0000 (14:03 +0000)]
68000: fix longjmp code

6 years agopdp11: setjmp and longjmp
Alan Cox [Sun, 18 Feb 2018 14:02:20 +0000 (14:02 +0000)]
pdp11: setjmp and longjmp

6 years agopdp11: udivhi3 helper
Alan Cox [Sun, 18 Feb 2018 14:01:56 +0000 (14:01 +0000)]
pdp11: udivhi3 helper

6 years agopdp11: sort out more of the low level bits
Alan Cox [Sun, 18 Feb 2018 14:01:34 +0000 (14:01 +0000)]
pdp11: sort out more of the low level bits

6 years agopdp11: set correct header type for binaries
Alan Cox [Sun, 18 Feb 2018 00:32:17 +0000 (00:32 +0000)]
pdp11: set correct header type for binaries

We'll probably just go a.out but for now

6 years agosyscall_other: bracketing
Alan Cox [Sat, 17 Feb 2018 22:39:43 +0000 (22:39 +0000)]
syscall_other: bracketing

6 years agopdp11: more platform updating
Alan Cox [Sat, 17 Feb 2018 22:39:13 +0000 (22:39 +0000)]
pdp11: more platform updating

Not yet a complete usable machine

6 years agopdp11: sketch out more of the needed base code
Alan Cox [Sat, 17 Feb 2018 22:38:14 +0000 (22:38 +0000)]
pdp11: sketch out more of the needed base code

6 years agolibs: PDP11 syscall directory
Alan Cox [Sat, 17 Feb 2018 22:37:30 +0000 (22:37 +0000)]
libs: PDP11 syscall directory

6 years agopdp11: add syscall generator code
Alan Cox [Sat, 17 Feb 2018 22:36:57 +0000 (22:36 +0000)]
pdp11: add syscall generator code

6 years agoinet_aton: use long type otherwise it breaks on 16bit
Alan Cox [Sat, 17 Feb 2018 22:35:43 +0000 (22:35 +0000)]
inet_aton: use long type otherwise it breaks on 16bit

6 years agocpio: reformat
Alan Cox [Mon, 12 Feb 2018 23:31:59 +0000 (23:31 +0000)]
cpio: reformat

6 years agocpio: add first cut at porting cpio over
Alan Cox [Mon, 12 Feb 2018 00:42:21 +0000 (00:42 +0000)]
cpio: add first cut at porting cpio over

Needs work yet

6 years agolibc: const pedanticism
Alan Cox [Sun, 11 Feb 2018 21:31:22 +0000 (21:31 +0000)]
libc: const pedanticism

6 years ago6502: optimise the top byte check to avoid a shift
Alan Cox [Sun, 11 Feb 2018 21:31:00 +0000 (21:31 +0000)]
6502: optimise the top byte check to avoid a shift

6 years agolibs: update another TODO
Alan Cox [Sun, 11 Feb 2018 17:23:28 +0000 (17:23 +0000)]
libs: update another TODO

6 years agolibs: update a TODO file
Alan Cox [Sun, 11 Feb 2018 17:19:01 +0000 (17:19 +0000)]
libs: update a TODO file

6 years agolibclean: add another rule for SDCC 3.7
Alan Cox [Sun, 11 Feb 2018 17:18:43 +0000 (17:18 +0000)]
libclean: add another rule for SDCC 3.7

6 years agostart: we fire up sysio directly so must set u_done
Alan Cox [Sun, 11 Feb 2018 17:17:42 +0000 (17:17 +0000)]
start: we fire up sysio directly so must set u_done

6 years agoINSTALL: note sdcc requirements
Alan Cox [Sun, 11 Feb 2018 17:17:30 +0000 (17:17 +0000)]
INSTALL: note sdcc requirements

6 years agon_open: rework so we operate directly from user memory
Alan Cox [Sat, 10 Feb 2018 19:58:42 +0000 (19:58 +0000)]
n_open: rework so we operate directly from user memory

In addition adjust the logic so we build a correctly parsed last name component
in lastname so that it can be used by the caller to manipulate directories.

This gets rid of filename() which saves us copying and parsing the path twice
as well as getting rid of that code
It gets rid of most of the 30 byte name arrays (rename still has to have one)
It allows us to get rid of ugets()
Our PATH_MAX can now be arbitrarily set (for now still 512)
ugets/_ugets/__ugets all go away
pathbuf for LEVEL2 goes away, LEVEL0 and 1 and 2 now all look the same

The end result on Z80 at least is that we run faster amd we save a whopping 400
bytes.

6 years agoaudio; fix dumb bug
Alan Cox [Sat, 10 Feb 2018 19:52:47 +0000 (19:52 +0000)]
audio; fix dumb bug

Not that we have any working audio layer yet

6 years agowritei: workaround for sdcc
Alan Cox [Sat, 10 Feb 2018 00:09:13 +0000 (00:09 +0000)]
writei: workaround for sdcc

sdcc at least isn't bright enough to turn

static uint32 x

if (x >> 25)

into a byte load of x + 3 followed by an &0xFE

Instead it generates a 25 repeat bitshift of a 32bit value across four
registers in a fairly critical code path.

Allow defines to help it out with its dumbness.

6 years agokernel: restructure readi/writei to save memory
Alan Cox [Fri, 9 Feb 2018 23:49:50 +0000 (23:49 +0000)]
kernel: restructure readi/writei to save memory

This saves us 256 bytes on Z80 mostly by removing the amount of 32bit maths
SDCC has the opportunity to **** up.

We introduce a helper (umove) which adjusts all the pointers and offsets
for a given file and use that where we can. We also restructure a bit so we
can use the udata.u_done value in readi/writei

This has some minor consequences:
Callers need to check u_done for completion not u_count
Char and Socket handlers don't affect the offset unless they choose to (which
is saner). Devsys has been modified accordingly.

Handle with care.

6 years agoubee: floppy driver write fix
Alan Cox [Fri, 9 Feb 2018 23:41:22 +0000 (23:41 +0000)]
ubee: floppy driver write fix

6 years agoubee: set tick rate properly
Alan Cox [Fri, 9 Feb 2018 23:41:12 +0000 (23:41 +0000)]
ubee: set tick rate properly

6 years agobuffers: BF_SUPERBLOCK is dead, kill it off
Alan Cox [Fri, 9 Feb 2018 00:19:56 +0000 (00:19 +0000)]
buffers: BF_SUPERBLOCK is dead, kill it off

6 years agoubee: disk probing
Alan Cox [Thu, 8 Feb 2018 23:07:33 +0000 (23:07 +0000)]
ubee: disk probing

With these patches I can build a .ds82 image for the rootfs in the B drive
and boot it with "1 ro". Read/write seems to eat the disk, so that needs a bit
of debugging!

6 years agoMakefile.z80: fix build bug
Alan Cox [Thu, 8 Feb 2018 22:34:03 +0000 (22:34 +0000)]
Makefile.z80: fix build bug

6 years agodu: sort if and bracketing
Alan Cox [Thu, 8 Feb 2018 22:33:40 +0000 (22:33 +0000)]
du: sort if and bracketing

6 years agoubee: first cut at automatic disk controller probing
Alan Cox [Sun, 4 Feb 2018 21:17:43 +0000 (21:17 +0000)]
ubee: first cut at automatic disk controller probing

6 years agoMerge branch 'master' of https://github.com/EtchedPixels/FUZIX
Alan Cox [Sun, 4 Feb 2018 20:36:41 +0000 (20:36 +0000)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

6 years agoMerge pull request #585 from beretta42/cal
EtchedPixels [Sat, 3 Feb 2018 21:01:24 +0000 (21:01 +0000)]
Merge pull request #585 from beretta42/cal

util: 'cal' fix output.

6 years agoutil: 'cal' fix output.
Brett Gordon [Sat, 3 Feb 2018 19:47:03 +0000 (14:47 -0500)]
util: 'cal' fix output.

6 years agoubee: update README
Alan Cox [Thu, 1 Feb 2018 00:45:59 +0000 (00:45 +0000)]
ubee: update README

6 years agoMerge branch 'master' of https://github.com/EtchedPixels/FUZIX
Alan Cox [Thu, 1 Feb 2018 00:43:56 +0000 (00:43 +0000)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

6 years agoubee: floppy transfer routines
Alan Cox [Thu, 1 Feb 2018 00:42:57 +0000 (00:42 +0000)]
ubee: floppy transfer routines

We now appear to read sectors correctly. Next stop is to sort out how the
dd/sd and side detect should work as well as what to do about 9/10 sector
media.

Then I guess we can try a real root file system!

6 years agoubee: First chunk of floppy work
Alan Cox [Wed, 31 Jan 2018 12:49:49 +0000 (12:49 +0000)]
ubee: First chunk of floppy work

This won't work yet as the core floppy asm code is still for the TRS80 which
isn't quite the same beast.

(There also appear to be some funnies with the emulator that cause problems
as it thinks the controller will provide data immediately after the command
whereas a real disk even if it were perfectly aligned would have to process
all the sector marks *before* data arrives.

6 years agoubee: stuck the initializer block somewhere out of the way
Alan Cox [Wed, 31 Jan 2018 12:49:31 +0000 (12:49 +0000)]
ubee: stuck the initializer block somewhere out of the way

6 years agoubee: Updates
Alan Cox [Tue, 30 Jan 2018 00:24:50 +0000 (00:24 +0000)]
ubee: Updates

This gets us to the point we prompt for a keyboard response and have IRQ
events running. The 256TC keyboard half works (shift and control seem busted
and we've yet to work out what to do with alt anyway).

Next stop disk drivers

6 years agoubee: first draft of printer driver
Alan Cox [Tue, 30 Jan 2018 00:23:59 +0000 (00:23 +0000)]
ubee: first draft of printer driver

6 years agoubee: update notes
Alan Cox [Tue, 30 Jan 2018 00:23:42 +0000 (00:23 +0000)]
ubee: update notes

6 years agoMerge pull request #583 from beretta42/passwd
EtchedPixels [Mon, 29 Jan 2018 21:01:37 +0000 (21:01 +0000)]
Merge pull request #583 from beretta42/passwd

pwd: putpwent: wrong order of fields.

6 years agoMerge branch 'master' of https://github.com/EtchedPixels/FUZIX
Alan Cox [Sun, 28 Jan 2018 15:22:03 +0000 (15:22 +0000)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

6 years agoubee: make room for initializers
Alan Cox [Sun, 28 Jan 2018 15:21:14 +0000 (15:21 +0000)]
ubee: make room for initializers

With this changed we get the bootdev: prompt but don't have any working
interrupt handling in order to process keystrokes

6 years agobinman: spot discard/initializer overlap
Alan Cox [Sun, 28 Jan 2018 15:20:47 +0000 (15:20 +0000)]
binman: spot discard/initializer overlap

6 years agoubee: some further initial work
Alan Cox [Sun, 28 Jan 2018 00:48:07 +0000 (00:48 +0000)]
ubee: some further initial work

Thi is enough to get us loaded into memory and run through the early
assembly entry code. We don't get far yet though.

6 years agoubee: update notes
Alan Cox [Sun, 28 Jan 2018 00:47:19 +0000 (00:47 +0000)]
ubee: update notes

6 years agoappleiie: more filling out of initial bits and pieces
Alan Cox [Sun, 28 Jan 2018 00:45:01 +0000 (00:45 +0000)]
appleiie: more filling out of initial bits and pieces

6 years agokernel: add keycodes for F11/F12 as we'll need them soon
Alan Cox [Sun, 28 Jan 2018 00:44:09 +0000 (00:44 +0000)]
kernel: add keycodes for F11/F12 as we'll need them soon

6 years agopwd: putpwent: wrong order of fields.
Brett Gordon [Sat, 27 Jan 2018 20:52:12 +0000 (15:52 -0500)]
pwd: putpwent: wrong order of fields.

6 years agoMerge pull request #582 from beretta42/ramrom
EtchedPixels [Fri, 26 Jan 2018 17:05:23 +0000 (17:05 +0000)]
Merge pull request #582 from beretta42/ramrom

coco3: poke RAM mode on init, just in case.

6 years agococo3: poke RAM mode on init, just in case.
Brett Gordon [Fri, 26 Jan 2018 07:05:14 +0000 (02:05 -0500)]
coco3: poke RAM mode on init, just in case.

6 years agoappleiie: more sketching out of the platform code
Alan Cox [Mon, 22 Jan 2018 21:46:40 +0000 (21:46 +0000)]
appleiie: more sketching out of the platform code

6 years agoMerge branch 'master' of https://github.com/EtchedPixels/FUZIX
Alan Cox [Mon, 22 Jan 2018 00:11:06 +0000 (00:11 +0000)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

6 years agoplatform-appleiie: Initial sketches on how a IIe port might look
Alan Cox [Mon, 22 Jan 2018 00:10:29 +0000 (00:10 +0000)]
platform-appleiie: Initial sketches on how a IIe port might look

6 years agostrlcpy: make more robust
Alan Cox [Mon, 22 Jan 2018 00:09:09 +0000 (00:09 +0000)]
strlcpy: make more robust

6 years ago6502,libs: callax 65c02 would also need to do a 16bit dec - not worth it
Alan Cox [Mon, 22 Jan 2018 00:08:31 +0000 (00:08 +0000)]
6502,libs: callax 65c02 would also need to do a 16bit dec - not worth it

6 years agosyscall_net: move endif to the right place
Alan Cox [Mon, 22 Jan 2018 00:08:17 +0000 (00:08 +0000)]
syscall_net: move endif to the right place

6 years agoswap: fix build with fussy compilers
Alan Cox [Mon, 22 Jan 2018 00:08:03 +0000 (00:08 +0000)]
swap: fix build with fussy compilers

6 years ago65c816: update documentation
Alan Cox [Mon, 22 Jan 2018 00:07:52 +0000 (00:07 +0000)]
65c816: update documentation

6 years agoMerge pull request #580 from beretta42/fortune
EtchedPixels [Tue, 16 Jan 2018 19:34:20 +0000 (19:34 +0000)]
Merge pull request #580 from beretta42/fortune

fortune: bug: main doesn't return success.

6 years agofortune: bug: main doesn't return success.
Brett Gordon [Tue, 16 Jan 2018 03:54:12 +0000 (22:54 -0500)]
fortune: bug: main doesn't return success.

6 years agoMerge pull request #579 from beretta42/bogo
EtchedPixels [Fri, 12 Jan 2018 17:31:00 +0000 (17:31 +0000)]
Merge pull request #579 from beretta42/bogo

Add 6809 bogomips delay loop

6 years agoutil: 6809 bogomips
Brett Gordon [Fri, 12 Jan 2018 05:21:33 +0000 (00:21 -0500)]
util: 6809 bogomips

6 years agov65c816: add the graphics mode ioctls remove a debug output to uart for vt
Alan Cox [Sun, 7 Jan 2018 23:10:16 +0000 (23:10 +0000)]
v65c816: add the graphics mode ioctls remove a debug output to uart for vt

We still hack the input side while I debug the SDL input logic on the
emulator.

6 years agov65c816: add support for the new kbd/framebuffer code in v65c816
Alan Cox [Thu, 4 Jan 2018 22:18:16 +0000 (22:18 +0000)]
v65c816: add support for the new kbd/framebuffer code in v65c816

So we can start the console work.

6 years agoMerge branch 'master' of https://github.com/EtchedPixels/FUZIX
Alan Cox [Thu, 4 Jan 2018 22:17:55 +0000 (22:17 +0000)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX

6 years agoMerge pull request #578 from beretta42/fixes
EtchedPixels [Thu, 4 Jan 2018 22:17:40 +0000 (22:17 +0000)]
Merge pull request #578 from beretta42/fixes

Easy fixes

6 years agococo3: actually declare defmode.
Brett Gordon [Thu, 4 Jan 2018 05:06:20 +0000 (00:06 -0500)]
coco3: actually declare defmode.

6 years agoutils: remount: easy bugfix
Brett Gordon [Thu, 4 Jan 2018 04:19:34 +0000 (23:19 -0500)]
utils: remount: easy bugfix

6 years agov65c816-big: fix memory scribble
Alan Cox [Wed, 3 Jan 2018 21:55:15 +0000 (21:55 +0000)]
v65c816-big: fix memory scribble

6 years agov65c816-big: DMA protection
Alan Cox [Wed, 3 Jan 2018 21:45:32 +0000 (21:45 +0000)]
v65c816-big: DMA protection

6 years agov65c816: DMA protection for disk DMA
Alan Cox [Wed, 3 Jan 2018 21:45:09 +0000 (21:45 +0000)]
v65c816: DMA protection for disk DMA

6 years ago65c816: Fixes for non bank 0
Alan Cox [Tue, 2 Jan 2018 21:03:23 +0000 (21:03 +0000)]
65c816: Fixes for non bank 0

With this fixed the large mode seems to work (not heavily tested) and
an 8MB boot works to a shell prompt and some test commands at least.

6 years agov65c816: update notes
Alan Cox [Tue, 2 Jan 2018 19:22:32 +0000 (19:22 +0000)]
v65c816: update notes

6 years agov65c816-big: update notes
Alan Cox [Tue, 2 Jan 2018 19:22:13 +0000 (19:22 +0000)]
v65c816-big: update notes

6 years agov65c816-big: callax replacement for big memory
Alan Cox [Tue, 2 Jan 2018 19:21:52 +0000 (19:21 +0000)]
v65c816-big: callax replacement for big memory

6 years ago65c816: use brk helper
Alan Cox [Tue, 2 Jan 2018 19:20:45 +0000 (19:20 +0000)]
65c816: use brk helper

6 years ago65c816: fix wrap on DP computation, and add brk handling
Alan Cox [Tue, 2 Jan 2018 19:20:28 +0000 (19:20 +0000)]
65c816: fix wrap on DP computation, and add brk handling

6 years ago65c816: fix bank 0 error
Alan Cox [Tue, 2 Jan 2018 19:20:08 +0000 (19:20 +0000)]
65c816: fix bank 0 error

6 years agov65c816: Fix usermem
Alan Cox [Mon, 1 Jan 2018 23:59:16 +0000 (23:59 +0000)]
v65c816: Fix usermem

With this fixed we can start init but we blow up on syscalls.

Be warned - this port tends to eat the disk as well so keep a copy!