Commit Graph

112 Commits

Author SHA1 Message Date
Giacomo Tesio 01451943ec last minutes cleanup 2022-01-05 16:59:31 +00:00
Giacomo Tesio 1e34cf5efb copyright: update 9front's url (they moved from hg to git) 2021-12-30 00:55:39 +01:00
Giacomo Tesio 0adf1b0431 new build: get rid of Go with few rc scripts. 2021-12-30 00:55:06 +01:00
Giacomo Tesio 922e993c41 libs, kernel and commands: re-enable -Werror 2020-11-15 13:30:09 +01:00
Giacomo Tesio 0a325039bf gcc & system build: add `-9` and remove `--posix` from build files 2020-09-17 23:53:12 +02:00
Giacomo Tesio bb2a39cc74 kern: fix compilation warning; raise qa timeouts 2020-09-17 23:49:33 +02:00
Giacomo Tesio 7385e37b13 kern: usb uhci: fix test of ports in init() 2020-09-17 23:49:27 +02:00
Giacomo Tesio 75b451ea1c kern: move `load` from Mach to Sys 2020-09-17 23:49:26 +02:00
Giacomo Tesio 2f850291d5 rename libc to libjehanne; improve libposix
This is to avoid conflicts between standards' assumptions and Jehanne's choices
2020-09-17 23:48:27 +02:00
Giacomo Tesio f104c46858 purge syscall macros 2020-09-17 23:45:23 +02:00
Giacomo Tesio 5f095a9605 temporarily disable -Werror 2020-09-17 23:43:57 +02:00
Giacomo Tesio 2bf39bf38a kern: rename /dev/swap in /dev/sysmem
Jehanne has no SWAP.

And I do not want to explain to my daughters what SWAP **was**.
2018-01-07 07:14:08 +01:00
Giacomo Tesio d04c776f3c Fix Minnich's Copyrights
As far as I can remember the new `dc` argument added to the `mount`
system call is the only API innovation that I imported from Harvey-OS
in the Jehanne's kernel.

It's a great idea of Ronald G. Minnich, introduced at

	72777a1fab

Since he didn't amended the copyright statements in Harvey, I forgot
to amend it here.

Sorry, my fault.
2018-01-06 01:09:04 +01:00
Giacomo Tesio c7d0f621c9 Clarify Forsyth's and 9front's copyrights
I'm very grateful to Charles Forsyth for creating most of Jehanne's kernel
and to 9front's guys for all the code and ideas they freely share.

Here I make their copyrights explicit as they had been erroneusly omitted
or messed up before. Sorry.
2018-01-05 02:30:45 +01:00
Giacomo Tesio 7f1ba356f1 kern: devproc: forbid open(OWRITE) of notes in Broken proceses 2017-12-15 02:58:09 +01:00
Giacomo Tesio c48d0e46ec kern: do not read wdir size on Broken processes 2017-12-15 02:58:09 +01:00
Giacomo Tesio e0b8a369d0 kern: align stack pointer to 16 byte in notify 2017-12-15 02:58:09 +01:00
Giacomo Tesio a3918b108d kern: awake must not interrupt flushes in dev9p
While sending Tflush after a wakeup, we might call sleep.

Since the awake was not yet consumed, the new sleep was interrupted
causing a new Tflush, in an infinite loop that consumes all tags.
2017-12-15 02:58:09 +01:00
Giacomo Tesio 799f99a40f kern: fix pprint on invalid address at syspread 2017-12-15 02:58:09 +01:00
Giacomo Tesio b73c2bce14 kern: awake & dev9p: do not interrupt Tflush to avoid consuming all tags 2017-12-15 02:58:09 +01:00
Giacomo Tesio 3946a06a98 kern: dev9p: Rwrite's count can be greater than Twrite's one 2017-12-15 02:58:09 +01:00
Giacomo Tesio 726217c766 kern: fix proc ref counting in procread 2017-12-15 02:58:09 +01:00
Giacomo Tesio df9c0d8fe4 kern: awake: fix syscall() check for awake_awakened(up) 2017-12-15 02:58:09 +01:00
Giacomo Tesio 2b62ed8010 kern: keep reading /proc/n/syscall after process death, to get all messages 2017-12-15 02:58:09 +01:00
Giacomo Tesio 9aea97a51f kern: fix fmtrwdata on nil buffers 2017-12-15 02:58:09 +01:00
Giacomo Tesio 8ea71b1c66 kern: fix very old bug in syscall tracing 2017-12-15 02:58:09 +01:00
Giacomo Tesio 7ae04d282f kern: devproc: add ppid; enable `rm -e noteid` 2017-12-15 02:56:57 +01:00
Giacomo Tesio 26bd1d8dc4 kern: fix working dir after ns clone
After sending the "clone" request to /proc/$pid/ns, the current process
will be moved to the working directory of $pid.

Otherwise the current process could still access the file and folders
on the service providing its dot, even if such service was not visible to $pid.

Also, keeping the original working directory means that the 'cd' line of the
current process's ns file would be different from that of $pid: the two ns
files must match since the command asked for a "clone".

See also https://marc.info/?l=9fans&m=150893734909969&w=2
2017-10-25 02:06:29 +02:00
Giacomo Tesio 2836ae4d66 kern: improve procfdprint and procfds in devproc 2017-10-25 01:35:34 +02:00
Giacomo Tesio c17d5bdb18 kern: cleanup procread for Qnote 2017-10-25 01:33:51 +02:00
Giacomo Tesio 70d5961022 kern: add missing poperror() to awake_gc_proc 2017-10-25 01:30:07 +02:00
Giacomo Tesio 430df16543 kernel: ignore errors on awake_gc_proc
Calling resrcwait in awake_gc_proc (that is called from pexit and thus
from sys_exits) means that we have to ignore errors that could cause
the syscall to return.

The funny part here was that one single test for newlib showed the
issue by faulting in a note handler AFTER completing with success:

	/arch/amd64/qa/lib/newlib/sigchld/213-sigqueue

The fact was that in the executable, the function notifier() was
located just after the exits() function, whose last line was a call
to _exits().

Thus, when the _exits returned, the notifier() code was executed.
2017-10-25 01:22:01 +02:00
Giacomo Tesio 7c017f5059 kern: fix %r13 management in syscallentry 2017-10-25 01:18:57 +02:00
Giacomo Tesio 90c3415176 kernel: fix _procfdprint to use chan's flags 2017-10-25 01:17:31 +02:00
Giacomo Tesio ba11888753 kern: proc, dup: _procfdprint OCEXEC and ORCLOSE
In _procfdprint print additional informations in the second column:

	E is printed if the file was open with OCEXEC flag
	D is printed if the file was open with ORCLOSE flag

Example output:
  3  rE  9   46 (0000000000000001 0 00)  8192       13 /dev/cons
2017-10-25 01:16:45 +02:00
Giacomo Tesio 320e6e6f35 kern: clone $pid's namespace writing #p/$pid/ns
Any process X can get a new copy of the namespace of a target
process Y by writing the string "clone" to the ns file of Y.

The same user must own both processes.
The process writing the ns file must be allowed to mount.

The Pgrp of the calling process is then replaced with a new copy of
the Pgrp of the target process.

After the operation, any change done by X to its own namespace does
not affect Y. Also, if mount was forbidden for Y, it will also be
forbidden for X after the clone.
2017-10-24 23:28:14 +02:00
Giacomo Tesio 9202b04504 rc: use some uppercase variables (PATH, USER...) 2017-10-22 13:22:37 +02:00
Giacomo Tesio fab9c1d80f libc: introduce <envvars.h>
The new header envvars.h contains the names of commonly used
environment variables, such as $user, $ifs, $path and so on.

These defines are useful for Jehanne core applications that
use them to comunicate some values.

They are not strictly required, but having such defines we
can easily change the naming convention (from lowercase to uppercase).
2017-10-20 01:22:48 +02:00
Giacomo Tesio 63b227be55 elf64ldseg: do not pprint warnings on wrong header as it could simply be an rc script 2017-08-21 23:59:40 +02:00
Giacomo Tesio e0e45fba5a kernel: removed unreachable code in fault (CID: 155701)
If the user process does not have a segment holding the required addr
the fault function return early.
2017-08-15 01:07:48 +02:00
Giacomo Tesio 55a8a84d8d kernel: fix potential overflow in updatecpu (CID 155825) 2017-08-15 00:54:15 +02:00
Giacomo Tesio 0b8a66f877 kernel: umem: fix img_get macro
The img_get macro used to subtract 1 to the argument provided before
computing the porinter to the image. I can't remember why it did so.

However the expression was wrong.

Coverity found the issue:

	Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
	CID:	155616, 155606, 155598, 155597, 155596, 155587,
		155580, 155578, 155577, 155576, 155568, 155566

Simply removing the subtraction seems the obvious fix.
2017-08-15 00:38:09 +02:00
Giacomo Tesio b056df2da6 kernel: simplify sysnotify; should fix CID 156151 (Wrong sizeof argument) 2017-08-14 19:52:22 +02:00
Giacomo Tesio 17c9087965 kernel: fix typo in sysexec (CID 156141) 2017-08-14 19:34:34 +02:00
Giacomo Tesio 180da90a06 kernel: fix args crossing page boundaries in sysexec
Should also fix CID 155615 (Operands don't affect result)
2017-08-14 19:25:54 +02:00
Giacomo Tesio 21b5682a43 kernel: syspread: avoid negative offsets in dir reads
Should also fix CID 160109: Dereference after null check
2017-08-14 18:40:25 +02:00
Giacomo Tesio da588d69ec kernel: fpprocfork: fix CID 174315 (Missing break in switch) 2017-08-14 15:22:51 +02:00
Giacomo Tesio 033744b5be kernel: awake: fix CID 174310: Out-of-bounds read 2017-08-13 21:59:03 +02:00
Giacomo Tesio 34e6b0adc2 kernel: boot: use "bootconsole" instead of "console" env var 2017-08-13 15:24:18 +02:00
Giacomo Tesio c5466152f1 Revert "Revert "kernel: import sdahci from 9front""
This reverts commit ecc2125b28.
2017-08-13 12:47:56 +02:00