Will Sowerbutts [Sat, 3 Jan 2015 16:03:24 +0000 (16:03 +0000)]
fcc: Make installation directory easier to configure
Alan Cox [Sat, 3 Jan 2015 15:58:53 +0000 (15:58 +0000)]
flock: add C library pieces
Alan Cox [Sat, 3 Jan 2015 15:57:59 +0000 (15:57 +0000)]
errno: match the kernel change
We add ENOLCK but also make EAGAIN match EWOULDBLOCK as Linux does. That avoids
a whole ton of annoying problems with BSD v SYS5
Alan Cox [Sat, 3 Jan 2015 15:49:23 +0000 (15:49 +0000)]
swap.c: Fix off by one
Alan Cox [Sat, 3 Jan 2015 15:41:36 +0000 (15:41 +0000)]
ptab_end: redo the various process table scans
Currently we do a compare with &ptab[maxproc], which generates a pile of
maths to scale maxproc each time around the loop. This is *silly* and its
repeated in various places where it takes space, time and registers.
Instead in start.c evaluate &ptab[maxproc] once after maxproc is computed
and save it as ptab_end. Our comparisons now now don't do the math. This
saves us 180 bytes, or nearly half the cost of adding flock support.
Alan Cox [Sat, 3 Jan 2015 15:38:12 +0000 (15:38 +0000)]
syscall_fs2: correct version of staticfast fix
Alan Cox [Sat, 3 Jan 2015 15:36:39 +0000 (15:36 +0000)]
flock: fix wrong assignment due to staticfast conversion
Alan Cox [Sat, 3 Jan 2015 15:21:04 +0000 (15:21 +0000)]
syscall_fs2: fix inode reference count error on chmod/chown failure
Alan Cox [Sat, 3 Jan 2015 15:14:05 +0000 (15:14 +0000)]
flock: Add BSD flock functionality to FUZIX
System 5 has its own rather more convoluted locking so for once we'll favour
BSD over System 5.
This is an initial patch for testing.
Theory:
We recover spare bits from the inode c_busy, which is now a set of flags not
a bool with 7 wasted bits. Z80 has cheap bit ops, and the dirty bit is the top
bit which is cheap on most other processors too.
The file can be in one of 16 lock states kept in four of the recovered bits
(CFLOCK bits)
0 - unlocked
1 - 14 that many shared locks (15+ gives you an ENOLCKS error)
15 - exclusive
We use one of the spare O_ bits in each file object to keep a single bit
telling us this handle has a lock. The BSD API only allows one lock per file
table entry so that one bit is sufficient because we know that
- if our lock bit is set and the file handle is exclusive lock
then we must own the lock (as its exclusive) so we drop to 0 locks
- if our lock bit is set and the handle is not exclusive locked
then we can't own an exclusive lock so we must therefore be one of
the shared locks
Total cost about 450 bytes of kernel memory and no extra data.
Alan Cox [Sat, 3 Jan 2015 13:49:23 +0000 (13:49 +0000)]
utime: Add the Unix API weirdnesses for utime(filename, NULL);
Alan Cox [Sat, 3 Jan 2015 13:39:20 +0000 (13:39 +0000)]
inode: rearrange NET bits so netd can also use them
This lets us borrow the pipe read code for processes and the pipe write code
for the net daemon to queue data into a socket.
Alan Cox [Sat, 3 Jan 2015 13:38:56 +0000 (13:38 +0000)]
Makefile: build strcasestr
Alan Cox [Sat, 3 Jan 2015 13:38:31 +0000 (13:38 +0000)]
fcc: fix typo
Alan Cox [Sat, 3 Jan 2015 13:38:01 +0000 (13:38 +0000)]
timer: note which sdcc version the bug affects
EtchedPixels [Sat, 3 Jan 2015 00:28:48 +0000 (00:28 +0000)]
Merge pull request #42 from geijoenr/toupstream
more msx2 patches
Alan Cox [Sat, 3 Jan 2015 00:28:22 +0000 (00:28 +0000)]
Makefile: tidy up levee Makefile
Alan Cox [Sat, 3 Jan 2015 00:18:41 +0000 (00:18 +0000)]
levee: A very small vi editor
Still a bit large but with some clean up and tweaking ought to be ok on bigger
boxes, if a bit tight on a 48K bank.
Alan Cox [Sat, 3 Jan 2015 00:12:30 +0000 (00:12 +0000)]
fcc: fix bug introduced with multiple -c support
geijoenr [Fri, 2 Jan 2015 12:05:17 +0000 (13:05 +0100)]
timer: reverse order of assigment in set_timer_duration
sdcc picks up wrong 'duration' from the
stack if done the other way around
geijoenr [Fri, 2 Jan 2015 22:59:15 +0000 (23:59 +0100)]
msx2: add slot mapping
some hardware is accessed using memory mapped ports, we need to
map the slot containing the hw before doing IO, and switch back
when finished.
geijoenr [Fri, 2 Jan 2015 22:56:12 +0000 (23:56 +0100)]
msx2: fix boot from 64kb roms
adding more stuff can make the COMMONMEM to extend beyond bank2,
in that case we need a 64Kb rom and also copy over rom bank3.
Alan Cox [Fri, 2 Jan 2015 23:06:15 +0000 (23:06 +0000)]
strcasestr: another BSDism
Alan Cox [Fri, 2 Jan 2015 23:00:18 +0000 (23:00 +0000)]
sys/types.h: ssize_t
Alan Cox [Fri, 2 Jan 2015 22:59:40 +0000 (22:59 +0000)]
err: Add the extended BSD errc/warnc/verrc/warnc stuff
Alan Cox [Fri, 2 Jan 2015 22:43:27 +0000 (22:43 +0000)]
signal.h: add sig_atomic_t
Alan Cox [Fri, 2 Jan 2015 22:41:02 +0000 (22:41 +0000)]
utimes: Add utimes as a wrapper around utime
Alan Cox [Fri, 2 Jan 2015 22:33:59 +0000 (22:33 +0000)]
strlcpy/strlcat: Add these newer BSD string functions
Alan Cox [Fri, 2 Jan 2015 22:28:08 +0000 (22:28 +0000)]
err.h: include stdarg
Alan Cox [Fri, 2 Jan 2015 22:22:06 +0000 (22:22 +0000)]
libc: add BSD err/warn/errx/warnx interfaces
Alan Cox [Fri, 2 Jan 2015 21:50:47 +0000 (21:50 +0000)]
time: threadsafe functions
Not much use at the moment but since many modern apps favour them anyway we
might as well provide them given they are pretty much zero cost.
Alan Cox [Fri, 2 Jan 2015 20:39:02 +0000 (20:39 +0000)]
clock: Fix up all the clock 1 handling
We can't do things simply because clock 1 runs at 10HZ (as from the last
kernel fixes). Instead try and avoid divides, and also pull a few cunning
tricks for fixed division by ten functions
Alan Cox [Fri, 2 Jan 2015 20:00:03 +0000 (20:00 +0000)]
timer: Make the ticks timer run at 10hz not at a platform rate
We now get a sensible time between rollovers and more importantly we can
do much better in the C library with division by 10 than random per platform
numbers.
Alan Cox [Fri, 2 Jan 2015 19:30:59 +0000 (19:30 +0000)]
hz: add __hz to get HZ value
We need this to fix the CLOCK_MONOTONIC timer which is in HZ sized ticks not
seconds
Alan Cox [Fri, 2 Jan 2015 18:06:51 +0000 (18:06 +0000)]
sleep: use the monotonic timer
Alan Cox [Fri, 2 Jan 2015 18:06:41 +0000 (18:06 +0000)]
Makefile: build the new APIs
Alan Cox [Fri, 2 Jan 2015 18:06:27 +0000 (18:06 +0000)]
libc: More of the POSIX time APIs
Alan Cox [Fri, 2 Jan 2015 18:05:35 +0000 (18:05 +0000)]
includes: Add more of the POSIX time interfaces
Alan Cox [Fri, 2 Jan 2015 18:05:06 +0000 (18:05 +0000)]
syscall_proc: fix _pause() with timeout return
Alan Cox [Fri, 2 Jan 2015 12:09:08 +0000 (12:09 +0000)]
inode: socket hooks
On read we use the pipe logic for sockets, on write they work rather like a
device. This slightly odd set up means that we can buffer incoming packets
through the disk cache and thus onto disk if needed. It's also very cheap
from a code size point of view.
Alan Cox [Fri, 2 Jan 2015 11:57:00 +0000 (11:57 +0000)]
fcc: Support fcc -c 1.c 2.c 3.c
Alan Cox [Fri, 2 Jan 2015 11:56:13 +0000 (11:56 +0000)]
libs: build regexp with lower optimisation
SDCC will build regexp but for some reason takes hours to do so when optimising
any more
Alan Cox [Fri, 2 Jan 2015 11:33:25 +0000 (11:33 +0000)]
Makefile: add a special rule for sed
sed needs to be built with lower optimisation or sdcc runs for hours
Alan Cox [Fri, 2 Jan 2015 11:28:28 +0000 (11:28 +0000)]
Merge branch 'master' of https://github.com/EtchedPixels/FUZIX
Backmerge
Alan Cox [Fri, 2 Jan 2015 11:27:48 +0000 (11:27 +0000)]
man,sort,df: prototypes
Line us back up with the now more correct headers
Alan Cox [Fri, 2 Jan 2015 11:15:13 +0000 (11:15 +0000)]
libclean: honour an environment variable for the SDCC libs
Alan Cox [Fri, 2 Jan 2015 11:14:50 +0000 (11:14 +0000)]
Kernel: allow the user to set an environment variable for the sdcc libs
Alan Cox [Fri, 2 Jan 2015 10:49:00 +0000 (10:49 +0000)]
curses: we don't actually have a curses yet but use termios not sgtty
Alan Cox [Fri, 2 Jan 2015 10:48:45 +0000 (10:48 +0000)]
libs/Makefile: build the syscalls
Alan Cox [Fri, 2 Jan 2015 10:37:14 +0000 (10:37 +0000)]
fuzix.h: remove old stale file
Alan Cox [Fri, 2 Jan 2015 10:35:30 +0000 (10:35 +0000)]
ps.c: Update code to build with FUZIX userland
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
(Removed fuzix.h: Alan Cox)
FIXME:
The proc size depends upon a kernel only define
Should resize the proctab properly not hard code a max size
(or print as it reads)
Alan Cox [Fri, 2 Jan 2015 10:35:05 +0000 (10:35 +0000)]
types: Add clock_t into sys/types.h, and include the types.h in proc.h
Alan Cox [Fri, 2 Jan 2015 10:30:38 +0000 (10:30 +0000)]
includes: Add proc.h with process related definitions
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
Alan Cox [Fri, 2 Jan 2015 10:24:01 +0000 (10:24 +0000)]
sys/stat.h: fix S_ISBLK macro
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
Alan Cox [Fri, 2 Jan 2015 10:22:57 +0000 (10:22 +0000)]
time.h: clock should return clock_t
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
Alan Cox [Fri, 2 Jan 2015 10:22:19 +0000 (10:22 +0000)]
init: sighandler argument is signed int.
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
Alan Cox [Fri, 2 Jan 2015 10:21:36 +0000 (10:21 +0000)]
df.c: Add explicit cast to char * for fsys
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
Alan Cox [Fri, 2 Jan 2015 10:20:26 +0000 (10:20 +0000)]
string.h: fix bzero declaration.
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
Alan Cox [Fri, 2 Jan 2015 10:17:08 +0000 (10:17 +0000)]
syscalls: _getfsys takes a uint16_t not an int.
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
Alan Cox [Fri, 2 Jan 2015 10:16:03 +0000 (10:16 +0000)]
utils: don't try and build termcap using code yet (we have no libtermcap)
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
Alan Cox [Fri, 2 Jan 2015 10:15:14 +0000 (10:15 +0000)]
sgtty: stale UZI file - remove
FUZIX has termios
Alan Cox [Fri, 2 Jan 2015 10:12:06 +0000 (10:12 +0000)]
sys/wait.h: remove stray ^Z
Alan Cox [Fri, 2 Jan 2015 10:09:18 +0000 (10:09 +0000)]
times: correct returned type to be clock_t
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
Alan Cox [Fri, 2 Jan 2015 10:06:18 +0000 (10:06 +0000)]
signal: correct handler prototype, removed bogus SIG_HOLD
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
Alan Cox [Fri, 2 Jan 2015 10:03:27 +0000 (10:03 +0000)]
libclean: Search for SDCC in the same places as kernel/Makefile
From: Sergio L. Pascual <https://github.com/slp/FUZIX>
Alan Cox [Fri, 2 Jan 2015 09:41:28 +0000 (09:41 +0000)]
z80pack: createdrives should use mktemp
EtchedPixels [Fri, 2 Jan 2015 09:32:33 +0000 (09:32 +0000)]
Merge pull request #41 from slp/filesys_fix
Filesys fix
EtchedPixels [Fri, 2 Jan 2015 09:21:11 +0000 (09:21 +0000)]
Merge pull request #40 from slp/noninteractive_ucp
Noninteractive UCP
Sergio L. Pascual [Fri, 2 Jan 2015 01:28:52 +0000 (02:28 +0100)]
createdrives: delete drives if already exist.
Sergio L. Pascual [Fri, 2 Jan 2015 01:12:53 +0000 (02:12 +0100)]
filesys.c: on getdev, fail if s_mounted == 0.
Sergio L. Pascual [Fri, 2 Jan 2015 01:10:52 +0000 (02:10 +0100)]
filesys.c: on newfstab, search for entries where m_dev == NO_DEVICE
Sergio L. Pascual [Fri, 2 Jan 2015 01:07:47 +0000 (02:07 +0100)]
start.c: initialize global fs_tab structure.
Sergio L. Pascual [Fri, 2 Jan 2015 01:06:18 +0000 (02:06 +0100)]
syscall_fs2.c: validate m->m_dev instead of dev.
Sergio L. Pascual [Fri, 2 Jan 2015 01:02:19 +0000 (02:02 +0100)]
createdrives: add a script to automatically generate z80pack drives.
Sergio L. Pascual [Fri, 2 Jan 2015 00:55:35 +0000 (01:55 +0100)]
ucp.c: implement a non-interactive mode.
It's now possible to specify up to two commands as the second argument
on the command line (i.e: ./ucp drivea.cpm "cd /bin ; bget ssh").
EtchedPixels [Thu, 1 Jan 2015 21:32:56 +0000 (21:32 +0000)]
Merge pull request #38 from willsowerbutts/fixstartup
Kernel: Fix Z180 startup code
EtchedPixels [Thu, 1 Jan 2015 21:32:21 +0000 (21:32 +0000)]
Merge pull request #37 from willsowerbutts/rtc
DS1302/DS1202 RTC driver
Alan Cox [Thu, 1 Jan 2015 21:30:09 +0000 (21:30 +0000)]
SDCCBanking: Explanatory note for the bits so far
Alan Cox [Thu, 1 Jan 2015 21:25:15 +0000 (21:25 +0000)]
zx128: Preparatory work for banked kernel
The goal is to use this as the debug base for getting a bankable kernel
image running.
Alan Cox [Thu, 1 Jan 2015 21:24:24 +0000 (21:24 +0000)]
banker: allow -r flag to indicate banking
Alan Cox [Thu, 1 Jan 2015 21:23:58 +0000 (21:23 +0000)]
trs80: fix silly bug
Alan Cox [Thu, 1 Jan 2015 21:23:42 +0000 (21:23 +0000)]
binmunge: allow an _BOOT
Alan Cox [Thu, 1 Jan 2015 21:20:57 +0000 (21:20 +0000)]
devide: the altstatus/control is optional, make it so
Will Sowerbutts [Thu, 1 Jan 2015 18:19:23 +0000 (18:19 +0000)]
Merge branch 'master' of github.com:EtchedPixels/FUZIX into rtc
Alan Cox [Thu, 1 Jan 2015 16:47:34 +0000 (16:47 +0000)]
start: lose debug
Will Sowerbutts [Thu, 1 Jan 2015 15:56:36 +0000 (15:56 +0000)]
Kernel: Fix Z180 startup code for platforms where RAM does not start at physical address 0
Alan Cox [Thu, 1 Jan 2015 14:56:34 +0000 (14:56 +0000)]
Makefile: analyzer has moved into the binprep path
Alan Cox [Thu, 1 Jan 2015 14:55:50 +0000 (14:55 +0000)]
sdldz80: only bank the code if the -r option is used
This allows life to continue as normal for most platforms
Alan Cox [Thu, 1 Jan 2015 14:54:55 +0000 (14:54 +0000)]
binprep: hook the binmunge extensions up, move the analyzer into the other path
Needless to say the analyzer gets completely confused when facing a banked
binary
Alan Cox [Thu, 1 Jan 2015 14:54:11 +0000 (14:54 +0000)]
binmunge: pass the _STUBS addresses into the program
The helper scripts will identify the _STUBS segment in the map file and
the linker will then fill this in.
Will Sowerbutts [Thu, 1 Jan 2015 14:37:48 +0000 (14:37 +0000)]
Kernel: Optionally call rtc_secs() less frequently
Will Sowerbutts [Thu, 1 Jan 2015 14:33:16 +0000 (14:33 +0000)]
Kernel: Bug fix ds1302 driver, leave clk line low after reading.
Will Sowerbutts [Thu, 1 Jan 2015 14:01:52 +0000 (14:01 +0000)]
Kernel: RTC driver for DS1202 on platform-p112
Will Sowerbutts [Thu, 1 Jan 2015 14:01:22 +0000 (14:01 +0000)]
Kernel: RTC driver for DS1302 on platform-n8vem-mark4
Will Sowerbutts [Thu, 1 Jan 2015 13:58:49 +0000 (13:58 +0000)]
Kernel: Add generic DS1202/DS1302 Serial Real Time Clock driver
Will Sowerbutts [Thu, 1 Jan 2015 13:57:10 +0000 (13:57 +0000)]
Kernel: Add mnemonics for Z80182 parallel port registers
Alan Cox [Thu, 1 Jan 2015 14:36:16 +0000 (14:36 +0000)]
Makefile: use our new linker and tool setup
Alan Cox [Thu, 1 Jan 2015 14:33:54 +0000 (14:33 +0000)]
binprep: build the right binary
For the moment we keep the old build method for old style binaries
(no _STUBS area), but for banked ones we expect the platform specific
make Image to do something intelligent. Given that the banking is pretty
much platform specific magic it has to be this way.
Alan Cox [Thu, 1 Jan 2015 14:33:36 +0000 (14:33 +0000)]
zx128: fix remaining escaped "uzi"
Alan Cox [Thu, 1 Jan 2015 14:03:46 +0000 (14:03 +0000)]
Kernel: remove remaining uzi references
In particular we don't want any escaped UZI defines floating around in case
we try and create any shared tools/libs with UZI180 or similar.
Alan Cox [Thu, 1 Jan 2015 13:38:44 +0000 (13:38 +0000)]
kdata: UZI_SYSCALL_COUNT -> FUZIX_SYSCALL_COUNT
Start pulling out the legacy UZI_ values. We don't want them confusing things
when we've got toolchains that support both UZI and FUZIX.