Browse Source

Rebasing from previous TLS inclusion (#728)

* Remove some unused code, tidy logging a little

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix more warnings.

These are the "just warnings" warnings in realemu.

Signed-off-by: Dan Cross <cross@gajendra.net>

* Fix a real bug in aux/vga/vmware.c.

Another precedence bug.

Signed-off-by: Dan Cross <cross@gajendra.net>

* gdbserver - fix return of individual regs, minor tweaks

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix some really really ugly code in disksim

Rewriting code to make it simpler makes it simpler!
Imagine that!

Signed-off-by: Dan Cross <cross@gajendra.net>

* Fix more warnings.

Signed-off-by: Dan Cross <cross@gajendra.net>

* Implement single step - incomplete, but allows continuing

After a breakpoint is hit, if the user continues, the first packet is 's' - single step.  This implementation is incomplete, amd64 only, and is known to cause issues if the user deliberately single steps, but as it allows continuing after hitting a breakpoint, it's worth checking in to be improved later.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Rewrite part of httpd to simplify some code.

This change also removes a warning. It's interesting
how often warnings point out code that's not idiomatic,
or can be rewritten to make it simpler and clearer.

Signed-off-by: Dan Cross <cross@gajendra.net>

* Fix more warnings.

We're down to fewer than 100 left now. Yay!

Signed-off-by: Dan Cross <cross@gajendra.net>

* Clean up the rest of the warnings.

This brings us to zero (well, except for some shift/reduce
conflicts out of yacc for hoc(1) ... but those aren't at all
the same thing) with the current settings.

Next up: remove the rest of the -Wno... flags from the various
.json files and clean up the residuals and the kernel.

Signed-off-by: Dan Cross <cross@gajendra.net>

* Fix a bug in amd64/trap.c

Again, a precedence bug; this time in the kernel.
Fixed with parenthesis.

Signed-off-by: Dan Cross <cross@gajendra.net>

* Fix a bug in port/elf64.c.

Another operator precedence bug.

Signed-off-by: Dan Cross <cross@gajendra.net>

* keyboard: move devkbmap to the architecture

It's portable code but needs some non-portable support.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Fix bug in libmach where mapped text segment didn't include stack

The format of /proc/pid/segment changed in commit 121208f.  Originally, if a segment was read-only, 'R' would be shown after the segment name.  In the case of the stack, this would be absent.  After that commit, there would always be a token displaying the segment permissions, therefore changing the format.  Also, due to the optional 'P' token, it is difficult to parse reliably.

The symptom was that any mapped data segment didn't include the stack.  This was because the change in format to segment meant when creating the map, we were reading the lower address for the stack, rather than the top.  This showed up when trying to view the stack in gdbserver -
 e.g. displaying backtrace.

This commit also combines the 'P' token with the permission section so we always know which tokens are where.  Segment doesn't seem to be pa
rsed anywhere else that I can find, so should be safe.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix gdb writing to memory

Setting a variable (e.g. 'set foo=123') was broken.  This is because ebin2mem was overwriting the src rather than the dest for some reason.  wmem would then copy the dest (which hadn't been touched since the malloc...)

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* A few gdbstub tweaks to improve readability, logging, etc.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix the rest of the warnings.

This fixes the rest of the warnings in the default build and
re-enable -Werror.  There may be some still lurking in the bits
of code that don't get built when we just run `util/build`
(e.g., other kernel configurations mostly) but this gets the
vast bulk of them.

Of note, RISC-V is currently broken due to unrelated missing
symbols called from the keyboard map driver.

Signed-off-by: Dan Cross <cross@gajendra.net>

* Remove 'ignored and undocumented' tee -u flag

Signed-off-by: Matt Singletary <matt.singletary@gmail.com>

* Remove unused flag variable to tee

Signed-off-by: Matt Singletary <matt.singletary@gmail.com>

* Remove repeat of -b arg in crop man page

Signed-off-by: Matt Singletary <matt.singletary@gmail.com>

* Reduce noise in gdb logs and debug output

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Reformat some JSON and remove an option for clang.

Remove `-Qunused-arguments`.

Signed-off-by: Dan Cross <cross@gajendra.net>

* Remove trailing whitespace from source files.

This is a trivial cleanup (done with a script, Ron!).

Signed-off-by: Dan Cross <cross@gajendra.net>

* Remove blank lines at end of file.

Remove a bunch of blank lines at the end of files.

Signed-off-by: Dan Cross <cross@gajendra.net>

* JSON: run preen on json files

Long overdue:
./util/preen -d=false `find . -name "*.json" -print`

Preen needs some cleanup. I never changed it since for a while util/build
was going away. But it still works.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* More broken windows: now-redundant 'assign' comments.

Remove a bunch of no-longer-relevant comments about
assignments in loops and conditionals.

Signed-off-by: Dan Cross <cross@gajendra.net>

* Improve gdb's handling of detach and kill

detach will start the process after removing all breakpoints.
kill will properly kill the process.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Code formatting and removing unused code

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix warnings exposed by clang>3.8.

Compiled with clang 4.0 on my dev machine.

Signed-off-by: Dan Cross <cross@gajendra.net>

* Stop process when connecting gdb

Previously, gdb expected process to already be stopped.  Now we do it immediately.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Replace a call to `__builtin_return_address(0)` with `getcallerpc()`

Signed-off-by: Dan Cross <cross@gajendra.net>

* regress: add a test for apex note handling problem

This is what I see apex doing in its signal handler.
It fails badly, indicating a kernel bug.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Fix bugs in field.c

Signed-off-by: Dan Cross <cross@gajendra.net>

* apexnote: don't set ureg->ip = 0 in NSAVE

Why was this done? Probably NIX related and we didn't expect
to ever see APE again.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Add some prints to the apexnote so you can see where it fails

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* noted: correctly set arguments on NSAVE

The old code was setting nf->arg0, 1 which
was a kenc convention. Set di and si instead.
The regression test seems to pass now.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Implement get_reg for gdbserver

Rather important for getting the stack pointer to step out of functions.
Also tidy the formatting of some error messages that showed up alongside the bug.

Seems the list of registers is duplicated in sys/src/9/amd64/dat.h
We should probably pick one place for this to avoid the duplication.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix warning about unused var - improves code, no order dependency now

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add untouched FreeBSD implementation of UFS to Harvey as libufs

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add a script that will list all UFS files that break spatch

Gives us the following list of:
../ufs/dirhash.h
../ufs/extattr.h
../ufs/inode.h
../ufs/quota.h
../ufs/ufs_dirhash.c
../ufs/ufs_quota.c
../ffs/ffs_extern.h
../ffs/ffs_snapshot.c
../ffs/ffs_softdep.c
../ffs/ffs_vfsops.c
../ffs/softdep.h

The script can be adapted for future ports.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add some FreeBSD macros to allow spatch to better parse the UFS code

list-spatch-breakers.sh now reports only the following files as problematic:
ffs/ffs_softdep.c
ffs/softdep.h

At least some of these problems are caused by #defines inside struct definitions.

Perhaps they won't really cause problems.  If they do, then we could move the #defines.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* libufs: build file

As you get files to build, from them from
to
SourceFiles

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* 9sys: ignore .s files

we leave them around so gdb works better. Add them .gitignore.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ffs: get one file to build

I'm hoping you can use this as a template. We get one
file to build.

TODO: spatch remaining types in ffs/fs.h

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* libufs: connect it into user-mode builds

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Use bash for list-spatch-breakers.sh

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* ufs: create example script and apply it

This change was created via:

spatch --in-place --dir . --sp-file port-scripts/scalar.cocci

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Strip out all freebsd #includes.

Needed to hand edit a little, as the spatch tried to remove a couple of comments.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Tidy name of previous patch

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove all FreeBSD __FBSDID IDs, repalce with standard harvey includes

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* ufs: Fix more scalars, extend scalar.cocci

Also, set up -I so things get included easily.

Please don't set it up so includes include includes.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* hash: add hash function from aki

this includes a test. It needs a fix in the formatting: what is %z%u in the
plan 9 world?

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* hashmap: use %u, not %zu

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ufs: get rid of include guards

Just get your includes right, ok?

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ufs: proto fixes

Somewhere along the line this got lost.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Add libufs to the klibs

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Adding lex

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Tabs in parser.y

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Lost tab in parser.y

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Removing nm, now it's in binutils port for Harvey.

This solves issue #521

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding support for GCC 7

Tested: gcc-7 (Ubuntu 7-20170407-0ubuntu2)
	 7.0.1 20170407 (experimental)
	 [trunk revision 246759]

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* mug: initiliaze Point p

gcc-7 had a complaint.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Adapting to Ron's PR

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Run scalar.cocci over all files

Added the option --macro with the port-scripts/macros.h to get better results from spatch.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Trying to get ufs_bmap.c to build (part 1)

Pull some defines from FreeBSD into freebsd_util.h.
Remove some defines that wouldn't do anything in C.
Fix includes and signatures in ufs_bmap.c.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Bringing back some more programs

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Added execnet and moved to apex eqn and compress

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Convert u_long to uint64_t

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Convert NULLs to nils

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fixes advised by Ron

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* devufs skeleton

Framework for UFS2 kernel device

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add license

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add dummy mount file and directory to devufs

Also noticed that the strlen declaration was missing const modifier.  Others are missing, but can be added separately.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Ensure string declarations are the same for shared kernel and libc calls

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Make string library functions return int

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove reference to #U in usbstart

Seems to be for Inferno

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Build kernel and user version of libufs, strip down and build ffs_vfsops.c

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add newfs from FreeBSD for creating UFS filesystems

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add build.json for newfs

Signed-off-by: Dave MacFarlane <driusan@gmail.com>

* clangs 3.9 and 4.0

Signed-off-by: Sevki <s@sevki.org>

* ufs - open a channel to the path sent to mount

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

Conflicts:
	sys/include/libufs.h
	sys/src/9/port/devufs.c
	sys/src/libufs/ufs_harvey.c

* Remove rogue print

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove dead code in newfs

Remove code that was guarded by an #if 0 block in newfs, and references to
an undefined __FBSDID macro.

Signed-off-by: Dave MacFarlane <driusan@gmail.com>

* libc.h: no, we won't compile on gcc 2. Deal with it.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Tidy up devufs error handling

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Simplify devufs write code

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Replace NULL with nil in newfs

Fix references to NULL in newfs code

Signed-off-by: Dave MacFarlane <driusan@gmail.com>

* Remove FreeBSD headers and add header from libufs

- Add header from libufs which defines some FreeBSD types for Harvey rather
than duplicating the effort, and '#if 0'ed out the FreeBSD headers which
don't exist.
- Add a couple FreeBSD ufs types needed for newfs to libufs header

Signed-off-by: Dave MacFarlane <driusan@gmail.com>

* Move libufs into the kernel as 'ufs'

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Missed a file

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* First part of code to read UFS2 superblock

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS now reads from the Chan directly

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove libufs.h for now - just put all harvey bits in ufs_harvey.h

Can move out anything that needs to be exposed later.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Enable some mount options

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* A little more work on UFS mounting

Malloc the ufsmount struct, but comment out all fields we don't yet use - some we won't need at all, so we'll add them back as necessary.

Remove GJOURNAL related code.  We won't be supporting this.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove commented out code we don't yet need

(Also fixes gcc build error about a multi line comment)

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: add gjournal check

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: ENable a little more code

Added print where entire functions have been commented out so we can easily track later.  These can be removed when the function has been uncommented.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS - move forward by one more line

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS - Bring in another line in mount

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS add ffs_update

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS add a couple more lines to mount...

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Move freebsd_util.h to root of ufs code

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS add yet another line of mount code...

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Hook up ffs_snapgone function

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: Replace usermountpoint mutex with QLock

Also add user mountpoint freeing on error

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: Don't need the buf anymore

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: Add ffs_oldfscompat_read

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: A little more mount

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: Read in cylinder group info

Bit of a milestone - we can now read from specific disk blocks, not just a byte offset.  Doing it this way, and using a wrapper function, keeps the bread interface very similar to FreeBSDs, hopefully avoiding some bugs during the port.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: Add a little more mount code...

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: A little more mount, and a mountpoint qlock

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: More mount code.

Assume we don't support ACL, MAC or TRIM, at least for now.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: More mount

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS: Mounting the softdep code

This brought in a lot of scattered changes unfortunately.  I've disabled snapshots for now (NO_FFS_SNAPSHOT).  Another slight bit of ugliness is 'struct workhead'.  Need to keep the struct due to the way the LIST_HEAD macro works.  If I change that (yes, I tried) then it breaks somewhere else that calls the macro as so: LIST_HEAD(, snapdata)....

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Remove unnecessary code

These flags aren't used in UFS, and seem more relevant the FreeBSD kernel, so let's assume we can remove them for now.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Add ctl file for devufs mountpoints

echo unmount > /dev/ufs/0/ctl
will now unmount mountpoint 0.

Also embedding the mountpoint ID in the qid path, as seen in devproc.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Slightly more specific errors

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Add ufs_lookup.c

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Make error literals static

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Start to expose ufs_lookup code

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Get rid of _KERNEL define

...all of this is in the kernel anyway.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS ufs_root exposed, calls into empty ffs_vget

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Expose a little more of ffs_vgetf

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Only support UFS2

More code to delete as it's found...

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Get root inode (without locking)

Lots of todos here, locking in particular.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Change IFTOVT macro to ifmt_to_vtype function

Also fixes gcc build error

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* A little UFS refactoring fs -> Fs

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS Make bread behave a bit more like FreeBSD's implementation

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Use ID rather than mount name for UFS
- Don't need code to identify mount as UFS since it's the only choice
- Add in some stats and parameters from fs that we will need later
- A couple of small bits of tidying

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add code to manage vnodes in mountlist
- ffs_vgetf will get an existing vnode or pick one from freelist
- vnodes for same inode are now shared and reference counted
- freelist of vnodes maintained on mountlist
- vnode lists on mountpoint protected by qlock
- added stats file to mountpoint
- started to tidy up code with ufs_ext.h for externally facing definitions

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Tidy up vnode before use, point it to correct mountpoint

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix build (mmount -> v_mount) - should save before committing

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix mountpoint unlock bug in error case

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Rename vnode members, removing v_ from field names

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Use RWlock as UFS vnlock

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Set -fno-stack-protector

Arch, I'm disappointed in you, we should not have to do this.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Remove some vnode types we won't need

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove dupe prototypes

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Start of UFS inode lookup

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* newfs: get it to build

move things around, get to just having build errors, not include errors.

I doubt we need disklabel.h, plan 9 does things differently.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* Add locking 'asserts' and improve locking of new vnodes

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Hook up UFS init/uninit functions (though they don't do anything)

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Implement ffs_blkatoff and move bread function

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Implement ffs_blkatoff

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix UFS blkatoff signature for Harvey (Buf -> void)

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add libufs from FreeBSD

Unchanged from FreeBSD code, same version as it was when we got the rest of the UFS code.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Move code required by libufs into libufs

Needed to move more code into sys/include.  Also split some functions out of ffs_subr into libufs/libufs_subr.c

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix up some included in libufs

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Just include libufs headers and go from there

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix typo in '<ufs/libufs.h>'

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Get libufs/block.c compiling without errors + 1st pass at ufsdat.h

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Get libufs/inode.c building, move more things to ufsdat.h

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add libufs to the build

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove some duplicate typdefs

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix build - needed to refer to libufs.json file by name

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* sblock and cgroup now compile

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Make gcc happy

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Adding 4th Intel Ivy generation and AMD Ryzen

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Get last bits of libufs compiling

I removed ufs_disk_fillout and ufs_disk_fillout_blank from type.c altogether.  They're used in newfs, but they don't seem to be used outside the 'file' path.  If I'm wrong, we can add it back.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix ufs crash if trying to mount file with bad fs

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* newfs - search+replace macros

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* newfs - Change printf/fprintf, and try to be more consistent

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* newfs - convert exit/errx/warnx calls to exits

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add newfs to the build, mostly commented or ifdef'ed out

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* newfs - implement the basic arguments

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* newfs - handle file argument.  Create/open file.
Also remove some args we won't use

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* newfs - add option to specify volume label

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* newfs - handle all valid args

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* newfs - complete scaffolding of newfs.c

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Enable remaining newfs code

Can now create a ufs file image.
A few things still to do:
 - Set the group once we decide what to do about group and user ids in the file system
 - Remove the dinode union - we only need the UFS2 dinode
 - Figure out why 0.00MB is output by newfs

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove all LITTLE_ENDIAN tests from ufs code

By assuming that we only handle 'new' file systems with a
fs_maxsymlinklen > 0, we can avoid all the LITTLE_ENDIAN tests.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove old-style dir templates, some code for old-style file systems

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove traces of ufs1 from newfs code

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* UFS inode doesn't need the ufs1_dinode as part of a union

Only changing the code that is compiled right now.  There are more changes to be made in the commented out/ifdefed code.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Get rid of ufs1_dinode

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove some ufs macros that were a bit confusing

(And not needed if we only support ufs1)
More changes will need to be made to code we haven't compiled yet, but can fix them as we hit them.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove duplicate definition of MountPoint

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove some more UFS1 code

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add file to devufs to dump out the superblock

E.g. cat /dev/ufs/0/superblock

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Can dump out an inode using e.g. cat /dev/ufs/0/inode/3

Listing all inodes isn't supported.
Also fix a couple of bugs where running ls -l <filename> wouldn't find a file.
And a few bugs where permissions weren't passed through from the dirtab.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* A bit of UFS spring cleaning - move all UFS source into one folder

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* More UFS spring cleaning - move fs.h into same fodler as other ufs bits

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Tidy up UFS paths

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Remove GJournal support

This provided support for journalling via GEOM in FreeBSD.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Display inode details

Also, I shouldn't have added lrand() to the kerel lib.h.  This function uses a different Lock to that in the kernel (but with same name), and ths caused problems.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add cast to please gcc

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Ensure root and snapshot directory in new fs has correct gen number

Also fix bug in cast if for whatever reason the inode doesn't have a generation number.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fix gcc casting issue, update comment

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Add support to devufs for dumping out contents of inode's file


Just structure for now.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Adding gzip family

Removing troff which is now in APEX repo (pending troff2html).
Removing obsolete mkfiles.

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* UFS Keep vnode from open to close

Beginnings of code to read inode file data

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Rename ufsdat.h to libufsdat.h

This is in prep for creating a new ufsdat.h in the kernel UFS code.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Consolidate Harvey UFS headers into ufsdat.h and ufsfns.h

Still need to tidy a bit more -
 - should consolidate harvey UFS .c files
 - should tidy contents of new headers
 - need to look at libufs again

Once that's done, I'll get onto reading a file...

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Tidy UFS harvey-specific source

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Move low-level UFS code out of devufs + tidy after PR feedback

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Fixing define in deflate.c

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing gzip build

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Regex was ok, my fault

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding jpg

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding the json build files

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding page

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing an uninitialized variable

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixes for clang

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Ufs - Implement simple versions of Buf and getblk and enable of ufs_bmaparray

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Adding more programs for userland

- cdfs: classic, maybe we need an alternate ata driver, I'm not sure if there are CD/DVD units
   AHCI
- map and plot: classic demo for graphics
- tarsplit: another utility for compressing
- zenith: Keith Poole's acme version focused on keyboard

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing comma

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing typos

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing reviewed

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* UFS - add Buf, Uio, ufs_readdir

Uio uses Block under the hood.
Removed code for cookies and EOF flag from ufs_readdir, as that's only for NFS support in FreeBSD.
Still need to handle Block-related errors, since they would occur deep in the UFS code.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Improve UFS error handling a little (at the top level)

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Try to please gcc by changing void* to unsigned char*

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Better error checking in devufs, release chan  when releasing mp

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Adding tbl, html2roff, troff2html and cfs

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding CIFS, ext2srv and moving lp to APEX due to dependencies

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding paqfs and moving pic to APEX due to dependencies

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Moving postscript to legacy, pending if it will upgraded or refactored as an independent package due to size, like gs

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding proof

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Moving ratfs to legacy, it's upas family

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding scat and moving to legacy webfs and wikifs

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixes for compliance with both toolchains gcc and clang

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Aesthetic change to cmd/build.json

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing json files

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Enable reading of files in UFS

cat /dev/ufs/0/inodes/<fileinode>/data

Also handle file offsets better when dumping files or directories.
Quite a few todos here.

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Make gcc happy

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>

* Removing ssh/telnet/rlogin services due to old syscall dependency

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Removing ancient scsi experiment and obsolete spelling/dictionary tools

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding scuzz

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding snap

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fix for gcc

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Removing fax since harvey hasn't telco

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding vnc, Fixing snap/take.c

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding Aquarela

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding aquarela to general build

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Grap moved to APEX due to dependencies

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Spin moved to legacy, APEX dependent

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding tapefs

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding tapefs to general build

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Moving mk to legacy repo

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Adding missing json files

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing log in README since main website was changed

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing typo

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Update README.md

add a line break after the logo

* Adding MIT License for 9front code in libsec remaining mixed files

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing typo

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing link in readme to right MIT license

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing copyrights in libc write and read

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Bringing back bootstrap script and a Build version with last functionalities (#706) (#727)

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>

* Fixing a detail

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>
Álvaro Jurado 6 years ago
parent
commit
1331a7deaa

Diff Data Not Available.