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.
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).
I do not expect chown, fchownat and lchown to be much used in
UNIX softwares that we care to port.
We stub the functions in libposix so that we can refer them from
standard C libaries (such as newlib).
We will implement them (parsing /cfg/users to determinate uid and gid)
when it will be actually needed from a software ported to Jehanne.
There are a few issues with Plan 9's `access`:
- it has side effects: to test the actual access (that the file
servers can allow or deny according to complex custom rules)
it opens and then closes the file, allocating (and disposing) the fd
- it does not work on directories, since
- they cannot be opened for writing, despite the fact that to
create a file in a directory you must be granted write access on
that directory
- they cannot be opened for execution, despite the fact that to
access a file in a directory you must be granted execution access
on that directory
Despite the fact that `access` (even on UNIX) is a violation of the
"tell, don't ask" principle (the access could be forbidden just after
its successful return, making subsequent `open` fail anyway), this
fact smells of a little design error in the file interface.
So, right now we choose to let the libposix's `access` lie on directories:
it will always return 0 on AWRITE and AEXEC for them, accepting that
a successive create/mkdir may fail.
However, a cleaner file API and protocol should allow a simpler `access`
to be implemented for directories too.
This large commit address several issues
- removed 386 directory: Jehanne is 64bit only
- simplified kernel options management
- rewritten boot process
- ported memory related stuff from 9front's 9/pc64
- removed devacpi
- removed old code
- deep refactor of awake syscall
- removed MCACHE support for mount
- fix libc's setjmp/longjmp
This commit introduce a special rendezvous point at (void*)~0 that
cannot be reached by any process, since it's not added to the
rendezvous group.
This turns the rendezvous syscall to a cheap way to block until
either a note or a wakeup from awake(2) occurs.
This new feature is used in libc's sleep: the test qa/kern/fork_chain
has shown that using a stack address as rendezvous point is not safe enougth
for sleep, since two different process forked from the same function can
call sleep with the same base pointer. This lead the wakeup variable in
jehanne_sleep to have the same address on both process.
TODO add a test that show this behaviour in the old code.