As the current File Servers don't yet support file sizes > 2^31-1
(except for ext2 with some work), the VFS-FS protocol negotioting
field now has a field that FSes can use to indicate they do support
64-bit off_t. When they do, VFS will accept 64-bit results. Otherwise
VFS will zero out the upper 32 bits.
The previous commit contained a hack to support truncate for dynamically
linked binaries. This commit removes it as it's no longer necessary.
Change-Id: I07189d410094b193cb7bbd3f2507537bb1e7f96c
This patch will make mode_t 16-bits->32-bits, off_t 32-bits->64-bits,
ino_t 32-bits->64-bits, and nlink_t 16-bits->32-bits. As uid_t and
gid_t were already 32-bits we can drop the big_{mode,off,ino,uid,
gid,nlink}_t types from struct stat. This has huge consequences:
. lseek now has to accept a 64-bit argument and returns a 64-bit
result. Therefore we need a new lseek and return proper results
based on the used version (i.e., translate).
. some fcntl functions take and return a struct flock which holds 2
off_t fields. Like lseek, we need to distinguish between old and
new versions.
. getdents uses struct dirent which has among other fields an ino_t
and off_t field. Consequently we need a new getdents system call
and have to translate when we encounter an old call.
. truncate and ftruncate also take off_t arguments and therefore
require a new version.
To add insult to injury VFS itself uses getdents. This has as
consequence that we have 2^3 combinations of version for getdents; old
and new version of libc (new system calls), new and old version of VFS
(when booting an old image), old and new version of an FS. We can
distinguish between these cases as follows; libc will use new system
call numbers that have not yet been in use. When using a new number,
VFS knows libc is new, otherwise it's an old libc. Vice versa, libc
first tries the new number and if that fails due to ENOSYS (unknown
system call number) it knows it's dealing with an old VFS. Finally,
since we now have VFS-FS protocol versioning and by bumping the version
to 1, VFS knows an FS is old when it reports version 0 and an FS knows
VFS is old when VFS reports it's using version 0.
0 = old version, 1 = new version
libc | VFS | FS | approach
----------------------------
0 | 0 | 0 | Nothing to do
----------------------------
0 | 0 | 1 | VFS reports protocol version 0, FS falls back
| to using the old getdents function
----------------------------
0 | 1 | 0 | VFS reports protocol version 1, FS version 0.
| libc requires old getdents so there is nothing
| to do. VFS itself needs new getdents and will
| translate.
----------------------------
0 | 1 | 1 | VFS reports protocol version 1, FS version 1.
| VFS intercepts getdents results and translates
| them on the fly before returning results to libc
----------------------------
1 | 0 | 0 | libc first tries new system call number and
| then fall back to the old number. libc first
| translates the results to the new getdents before
| returning.
----------------------------
1 | 0 | 1 | VFS reports protocol version 0, so FS uses fall
| back. libc translates.
----------------------------
1 | 1 | 0 | VFS reports protocol version 1, FS version 0. VFS
| will intercept all results and translate on the
| fly.
----------------------------
1 | 1 | 1 | Nothing to do.
As VFS can distinguish between old and new system calls of (f)truncate,
lseek, and fcntl, it will translate the arguments and results if
necessary. Likewise libc falls back to using the old calls and
translating the results to the new version if necessary.
Change-Id: Id5bc819e6ef90f317dbddb21020e0a65028225ce
The next commit will make mode_t 32-bits, ino_t 64-bits, nlink_t
32-bits, and off_t 64-bits. However, in the protocol there is no
room for that.
When analyzing the usage of these data types we can see that of
mode_t we currently use 15 bits and that future flags (if copied
from NetBSD) are only of importance to VFS and not to the actual
file system on disk. Therefore we can get away with keeping the
protocol version of mode_t (pmode_t) 16 bits.
At this point it is unlikely that MINIX will support file systems
that can hold more than 2^32 files. Keeping the protocol version of
ino_t (pino_t) 32-bits and exposing it as 64-bits to the rest of the
system is fine.
uid_t and gid_t are already 32-bits, but in behind the scenes they're
16-bits. This is sufficient since we don't support uid/gids larger
than 2^16-1.
off_t will become 64-bits, but the protocol had room reserved
for that since it was revised years ago.
So to make the difference clear between what the protocol supports
and what is exposed to the system, we define protocol version of
these data types.
Change-Id: Ifb883aafb222142e69d6dcc3049a47170b78b3ee
By adding versioning we have a handle on ABI breaking changes in
the protocol or system wide data structures. As of this commit the
protocol version is 0 in order to be compatible with File Servers
that are not yet aware of versioning.
Change-Id: I8f4eca49b506f0c03383c25593e0c44bddac3d66
We're bumping the version to 3.3.0. This needed to be done anyway,
but it is also as a preparation for the next few commits that will
make struct stat identical to NetBSD's. In general all changes will
be fully backwards compatible, except for dynamically linked
binaries. By changing the version number we can provide new versions
of those binaries that are built for the new struct stat/off_t/ino_t.
Change-Id: Idc200bb6f75cdce7604e7706a5e30518496e543b
pkgin now depends on pkg_install. If pkg_install appears after pkgin
in PREINSTALLED_PACKAGES, there will be an error because pkg_install
was installed as a dependency for pkgin.
. data structure that automatically keeps a set
of pages in reserve, to replace sparepages and
possibly re-used in the future for similar situations,
e.g. if in-filesystem-cache block eviction is
implemented and FS asks for a new block
Change-Id: I149d46c14b9c8e75df16cb94e08907f008c339a6
Install /home/ast and /home/bin as part of the system build procedure,
as the setup script is not ran on the arm image.
/home/bin is needed for successful completion of our test suite.
This patch does not change the setup script, as it is not bothered by
those files/directiories being already there, and may be useful during
reinstallation on intel systems.
Change-Id: I358c881df09223c343442673aa0822937f9ea33c
When you provided a string with junk after the terminating nul to a
UNIX domain socket and used bind(2), the canonical path function would
not properly terminate the new string. This caused VFS to return
ENAMETOOLONG on an otherwise valid path name.
Test case is added to test56.
Change-Id: I883b6be23d9e4ea13c3cee28cbb3726343df037f
* Use the same output directory as was previously the standard.
* Add copying of uEnv and cmdline to the obj directory to allow booting from tftp.
* No longer start qemu at the end of the process.
* Use sudo if the script was called as non root user.
Change-Id: I53143b1ce6633e764d173c3eb883c2efa3e6a5b7
Do not hardcode warning and optimisation flags, otherwise the
main options (i.e. DBG, CPPFLAGS) will not work as expected.
You can still provide specific default by using DBG?=<value>.
Doing so leaves the opportunity to override the setting from the
commandline, while the default value from the build system is
then ignored for that particular package.
When crosscompiling, and using build.sh, adding -V DBG=<value> has
this same effect as make DBG=<value>.
Change-Id: Ic610e4d33b945acad64571e1431f1814291e2d84
To use the new SD building script, Linux has to be configured with
loop.max_part=15 on the command line (or set at module load time)
to make the loopback device see the partitions.
This commit removes a lot of differences between the ARM and x86
boot ramdisk and rc scripts. It changes the ARM build from running
from ramdisk to requiring a full filesystem on the SD image and
booting into it.
. ramdisk: remove some arm-only utilities only used for running
from the shell
. remove ARM-only rc.arm, proto.arm.small, ttys and mylogin.sh
boot-time ramdisk files
. change kernel to add "arch" variable so userland knows what
we're running on from sysenv
. make ARM use the regular ramdisk rc file, changed to distinguish
i386-only and ARM-only drivers; requires rootdevname to be set
. change /etc/rc and /usr/etc/rc to start i386-only drivers only on
i386 systems
. change the kernel/arm to have a special case for the memory
driver to load it higher so it can be bigger
. add uEnv.txt, cmdline.txt and a for now highly linux-dependent
SD preparation script arm_sdimage.sh to the git repository in
releasetools/
Change-Id: I68910ba4e96ee80f7a12b65e48b5d39b43ca6397
REQ_PEEK behaves just like REQ_READ except that it does not copy
data anywhere, just obtains the blocks from the FS into the cache.
To be used by the future mmap implementation.
Change-Id: I1b56de304f0a7152b69a72c8962d04258adb44f9
Select(2)ing on UNIX domain sockets was not working properly because
connection state wasn't properly checked/propagated. So selecting for
a read descriptor and closing the write descriptor on the other end
didn't cause select to return. Similarly, read(2) kept blocking while
it should return an error when the other end closed the socket.
Change-Id: I3f5bb52af1a6b03313d508bf915fc838357ba450
. if there is no memory there, it's not writable; this
check bug by the shared memory's writable() method causes
pagefaults not to be handled at all in certain situations,
triggering an assert() in pt_writemap()
. added some assert()s to catch this and similar situations
in the future
Change-Id: Ife89bfab4f9a3aa7bf4e33dfb0b13b89dcd5bb94