Mirror of most important branches of the main Sortix repository
Go to file
Jonas 'Sortie' Termansen 568c97c77f Fix SEEK_END, file offset overflow, and read/write/mkpartition syscall bugs.
Fix SEEK_END seeking twice as far as requested. Centralize lseek handling in
one place and avoid overflow bugs. Inode lseek handlers now only need to
handle SEEK_END with offset 0. Prevent the file offset from ever going below
zero or overflowing.

Character devices are now not seekable, but lseek will pretend they are, yet
always stay at the file offset 0. pread/pwrite on character devices will now
ignore the file offset and call read/write.

This change prevents character devices from being memory mapped, notably
/dev/zero can no longer be memory mapped. None of the current ports seem
to rely on this behavior and will work with just MAP_ANONYMOUS.

Refactor read and write system calls to have a shared return statement for
both seekable and non-seekable IO.

Fix file offset overflow bugs in read and write system calls.

Fix system calls returning EPERM instead of properly returning EBADF when
the file has not been opened in the right mode.

Truncate IO counts and total vector IO length so the IO operation does not
do any IO beyond OFF_MAX. Truncate also total vector IO length for recvmsg
and sendmsg. Fail with EINVAL if total vector IO length exceeds SSIZE_MAX.

Don't stop early if the total IO length is zero, so zero length IO now block
on any locks internal to the inode.

Handle reads at the maximum file offset with an end of file condition and
handle writes of at least one byte at the maximum file offset by failing
with EFBIG.

Refactor UtilMemoryBuffer to store the file size using off_t instead of
size_t to avoid casts and keep file sizes in the off_t type. Properly
handle errors in the code, such as failing with EROFS instead of EBADF if
the backing memory is not writeable, and failing with EFBIG if writing
beyond the end of the file.

Fix mkpartition not rejecting invalid partition start offsets and lengths.
Strictly enforce partition start and length checks in the partition code.
Enforce partitions exist within regular files or block devices.

Fix a few indention issues.
2017-12-04 23:56:46 +01:00
bench Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
build-aux Fix command line parsing with expr(1) failing if the parameter is 0. 2017-08-20 12:44:59 +02:00
carray Fix date format in manual pages. 2017-07-02 22:07:39 +02:00
disked Highlight installer, upgrader and disked interactive prompts. 2017-08-26 16:43:54 +02:00
dispd Detect whether the terminal has a display and a keyboard layout. 2016-11-23 22:31:04 +01:00
doc Deprecate inet_addr(3) and inet_ntoa(3). 2017-02-14 20:43:30 +01:00
editor Fix date format in manual pages. 2017-07-02 22:07:39 +02:00
ext Fix handling of unmountable filesystems. 2016-03-26 16:07:22 +01:00
games Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
hostname Add hostname(1). 2017-03-19 17:33:47 +01:00
init Mix in fresh randomness when writing out /boot/random.seed. 2017-09-06 23:41:05 +02:00
kblayout Add UK keyboard layout. 2017-02-05 14:24:22 +00:00
kblayout-compiler Add German keyboard layout. 2016-11-14 20:35:54 +01:00
kernel Fix SEEK_END, file offset overflow, and read/write/mkpartition syscall bugs. 2017-12-04 23:56:46 +01:00
libc Allow AF_UNSPEC family in socketpair(2). 2017-08-26 16:49:57 +02:00
libm Remove libm exec-include directory. 2016-01-25 17:39:57 +01:00
libmount Default to installing GRUB if an existing installation uses GRUB. 2016-10-04 00:34:50 +02:00
login Fix date format in manual pages. 2017-07-02 22:07:39 +02:00
mkinitrd Fix date format in manual pages. 2017-07-02 22:07:39 +02:00
regress Implement getpeername(2) and getsockname(2). 2017-02-26 22:24:35 +01:00
sf Fix date format in manual pages. 2017-07-02 22:07:39 +02:00
sh Only the tty1 login session powers off. 2017-02-12 13:26:26 +01:00
share/man Fix chvideomode(5) usable/used typo. 2017-07-02 22:09:53 +02:00
sysinstall Mix in fresh randomness when writing out /boot/random.seed. 2017-09-06 23:41:05 +02:00
tix Add -q option to tix-install(8). 2017-04-18 23:38:52 +02:00
trianglix Fix mode constants not in octal. 2017-03-19 13:25:27 +01:00
update-initrd Fix command line parsing with expr(1) failing if the parameter is 0. 2017-08-20 12:44:59 +02:00
utils Fix failed fix to pstree(1) vertical line drawing character. 2017-08-20 12:44:34 +02:00
.gitignore Add sysroot-overlay-* to .gitignore. 2017-02-12 13:27:04 +01:00
LICENSE Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
Makefile Add hostname(1). 2017-03-19 17:33:47 +01:00
README Fix 'is can' typo in README. 2016-10-01 14:52:09 +02:00

README

The Sortix Operating System
===========================

Sortix is a small self-hosting operating-system aiming to be a clean and modern
POSIX implementation.  It is a hobbyist operating system written from scratch
with its own base system, including kernel and standard library, as well as
ports of third party software.  It has a straightforward installer and can be
developed under itself.  Releases come with the source code in /src, ready for
tinkering.

It has been in development since 2011 by a single developer and contributors.
Though the system is stable and capable right now, it is still early in
development, and a number of crucial features haven't been made yet.  Releases
are made yearly and future releases will add features such as networking, SMP,
and USB that were skipped in favor of becoming self-hosting now.

Documentation
-------------

The system is documented as manual pages.  Introductory system usage is covered
in the user-guide(7) manual page.

Links
-----

For more information, please visit the official website:

  https://sortix.org/

Building Sortix
---------------

Development of Sortix under itself is covered in development(7).

Development from another operating system is covered in cross-development(7).

You can view the cross-development(7) manual page with this command:

  man share/man/man7/cross-development.7

License
-------

Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.

Sortix is free software licensed under the ISC license as described in the
LICENSE file.  It also contains permissively licensed code from other projects.