Commit Graph

420 Commits

Author SHA1 Message Date
Meisaka Yukara 307223a5a7 Add PCI scanning functions and busmastering functions.
This commit is joint work by Meisaka Yukara <Meisaka.Yukara@gmail.com> and
Jonas 'Sortie' Termansen <sortie@maxsi.org>.
2017-02-19 12:10:59 +01:00
Jonas 'Sortie' Termansen fcefd86432 Implement shutdown(2). 2017-02-18 15:29:40 +01:00
Jonas 'Sortie' Termansen 4b2cf28bbf Add socket(2).
This removes the /dev/net socket interface.

This is an incompatible ABI change.
2017-02-14 20:43:31 +01:00
Jonas 'Sortie' Termansen a53dd5d29d Support deallocating kernel timers in timer handlers. 2017-02-14 20:43:30 +01:00
Jonas 'Sortie' Termansen 7a8a71674e Move readv/writev family and sendmsg/recvmsg into drivers. 2017-02-13 22:04:21 +01:00
Jonas 'Sortie' Termansen 28229eb6e6 Fix pipe2(2) not supporting O_NONBLOCK. 2017-02-13 21:12:24 +01:00
Jonas 'Sortie' Termansen e9ee189d29 Fix BGA driver crashes without vbox guest additions. 2017-01-22 22:28:58 +01:00
Jonas 'Sortie' Termansen bdc791f692 Fix saving and restoring console cursor position. 2017-01-22 22:28:58 +01:00
Nicholas De Nova 73d984bca3 Panic upon detection of xz, gzip, or bzip2 magic in loaded modules. 2016-12-29 12:57:57 -06:00
Jonas 'Sortie' Termansen 0cf88fd58a Revert "Add <limits.h>."
This reverts commit f6cde2d7a6.

gcc detected this header existing and emitted its own limits.h that
included the libc limits.h. This caused the #include_next chain to reach
the end and including the header failed.

Undoing this commit for now until the compiler toolchain is updated to
avoid this problem.
2016-12-27 21:58:07 +01:00
Jonas 'Sortie' Termansen 0bb608b09e Support 8-bit/24-bit color and more escape codes in the graphical console.
The console has gained these escape codes:
 - Set color to any of 256 entries in the palette.
 - Set color to any 24-bit RGB value.
 - Inverse mode.
 - Bold mode.
 - Underline mode.
 - Move cursor to line N.
 - \a is now ignored.

The effectively unused ATTR_CHAR has been removed. Parsing of escape codes
has been improved. The graphical palette has been changed to the tango
colors, which makes Sortix look a bit differently. Some user-space programs
have been changed to use different colors that look better under the new
palette.

Remove const from methods that weren't really const and remove mutable
keyword workaround.
2016-11-27 11:19:03 +01:00
Jonas 'Sortie' Termansen ce54be34da Add VirtualBox Guest Additions. 2016-11-27 11:18:49 +01:00
Jonas 'Sortie' Termansen e7c5d032d1 Refactor graphical resolution changes. 2016-11-27 11:18:48 +01:00
Jonas 'Sortie' Termansen 0342e03073 Add debug uart utility functions. 2016-11-27 11:18:48 +01:00
Jonas 'Sortie' Termansen b38c84852c Add pseudo terminals.
This is a compatible ABI change riding on the previous commit's bump.
2016-11-23 22:31:05 +01:00
Jonas 'Sortie' Termansen 6ef5a5cee3 Detect whether the terminal has a display and a keyboard layout.
A new ioctl TIOCGDISPLAYS allow detecting which displays the terminal
has associated. The ability to set a keyboard layout can be detected
with tcgetblob kblayout.

Improve the user-space multi-monitor support while here.

The kernel now sets TERM rather than init(8).

This is a compatible ABI change riding on the previous commit's bump.
2016-11-23 22:31:04 +01:00
Jonas 'Sortie' Termansen db7182ddc3 Add support for sessions.
This change refactors the process group implementation and adds support
for sessions. The setsid(2) and getsid(2) system calls were added.

psctl(2) now has PSCTL_TTYNAME, which lets you get the name of a process's
terminal, and ps(1) now uses it.

The initial terminal is now called /dev/tty1.

/dev/tty is now a factory for the current terminal.

A global lock now protects the process hierarchy which makes it safe to
access other processes. This refactor removes potential vulnerabilities
and increases system robustness.

A number of terminal ioctls have been added.

This is a compatible ABI change.
2016-11-23 22:30:47 +01:00
Jonas 'Sortie' Termansen d529a1e332 Add factory inode support. 2016-11-23 21:46:06 +01:00
Jonas 'Sortie' Termansen f6cde2d7a6 Add <limits.h>. 2016-11-22 21:36:43 +01:00
Philippe Michaud-Boudreault 4890297611 Optimize is_power_of_two. 2016-11-06 17:42:13 +01:00
Jonas 'Sortie' Termansen d720f16537 Add ONLCR and OCRNL.
This is a compatible ABI change.
2016-11-05 23:38:40 +01:00
Jonas 'Sortie' Termansen 9603be8e65 Split LogTerminal into a base class with the core terminal semantics.
No semantic change.
2016-11-05 17:00:43 +01:00
Jonas 'Sortie' Termansen d84715c6ef Fix SIGTTIN during tty reading not setting errno to EINTR. 2016-11-05 16:19:50 +01:00
Jonas 'Sortie' Termansen 51e13b9357 Fix terminal escape keystroke not sending escape byte. 2016-11-03 22:31:17 +01:00
Jonas 'Sortie' Termansen eacfc72f2f Fix concurrent serial port read and write. 2016-11-03 22:10:45 +01:00
Jonas 'Sortie' Termansen 8951adc5f0 Add VMIN support. 2016-11-03 08:36:46 +01:00
Pedro Falcato 205a3e7156
Remove not_rsp and not_esp. 2016-10-30 12:03:47 +00:00
Jonas 'Sortie' Termansen 2d91c7d385 Fix exit_thread(2) multi-threaded process destruction. 2016-10-17 18:38:04 +02:00
Jonas 'Sortie' Termansen 84c0844f56 Seed kernel entropy with randomness from the previous boot.
The bootloader will now load the /boot/random.seed file if it exists, in
which case the kernel will use it as the initial kernel entropy. The kernel
warns if no random seed was loaded, unless the --no-random-seed option was
given. This option is used for live environments that inherently have no
prior secret state. The kernel initializes its entropy pool from the random
seed as of the first things, so randomness is available very early on.

init(8) will emit a fresh /boot/random.seed file on boot to avoid the same
entropy being used twice. init(8) also writes out /boot/random.seed on
system shutdown where the system has the most entropy. init(8) will warn if
writing the file fails, except if /boot is a real-only filesystem, and
keeping such state is impossible. The system administrator is then
responsible for ensuring the bootloader somehow passes a fresh random seed
on the next boot.

/boot/random.seed must be owned by the root user and root group and must
have file permissions 600 to avoid unprivileged users can read it. The file
is passed to the kernel by the bootloader as a multiboot module with the
command line --random-seed.

If no random seed is loaded, the kernel attempts a poor quality fallback
where it seeds the kernel arc4random(3) continuously with the current time.
The timing variance may provide some effective entropy. There is no real
kernel entropy gathering yet. The read of the CMOS real time clock is moved
to an early point in the kernel boot, so the current time is available as
fallback entropy.

The kernel access of the random seed module is supposed to be infallible
and happens before the kernel log is set up, but there is not yet a failsafe
API for mapping single pages in the early kernel.

sysupgrade(8) creates /boot/random.seed if it's absent as a temporary
compatibility measure for people upgrading from the 1.0 release. The GRUB
port will need to be upgraded with support for /boot/random.seed in the
10_sortix script. Installation with manual bootloader configuration will
need to load the random seed with the --random-seed command line. With GRUB,
this can be done with: module /boot/random.seed --random-seed
2016-10-04 00:34:50 +02:00
Jonas 'Sortie' Termansen 6944250bd1 Allow detecting fallback video modes. 2016-10-03 21:38:34 +02:00
Jonas 'Sortie' Termansen a97e1ef16c Modernize carray(1) and fix missing allocation checks.
Add short options for most long options. Rename the -i option to -H, but
support -i for compatibility until the next release cycle, where -i will
become the short option of --identifier. Rename --include to --headers
and support --include until the next release cycle.

Add carray(1) manual page which makes --help unnecessary, and remove
--version as it surely matches your local Sortix version.
2016-09-29 00:01:41 +02:00
Jonas 'Sortie' Termansen 848eaaf593 Port build utilities to musl. 2016-09-29 00:01:40 +02:00
Jonas 'Sortie' Termansen 91a6ee7919 Add 24-bit graphics support to kernel. 2016-09-28 20:29:18 +02:00
Jonas 'Sortie' Termansen c8487ff12b Fix readlinkat(2) return value truncation. 2016-09-28 20:15:36 +02:00
Jonas 'Sortie' Termansen 394d3d7115 Fix kernel not using BRAND_DEFAULT_HOSTNAME. 2016-09-28 20:15:36 +02:00
Jonas 'Sortie' Termansen 0e78aec1c3 Fix console scrolling bottleneck. 2016-09-25 22:28:17 +02:00
Jonas 'Sortie' Termansen f28fc4ac39 Fix non-blocking recv(2) and send(2). 2016-08-22 01:47:31 +02:00
Jonas 'Sortie' Termansen 8ec5d9af44 Fix linked list and shadowing bugs in kernel clock and timer code. 2016-08-21 00:04:27 +02:00
Jonas 'Sortie' Termansen 2b6463aa95 Fix drivers not detecting PCI devices without an interrupt line. 2016-08-21 00:03:58 +02:00
Jonas 'Sortie' Termansen da89dec2e2 Fix AHCI port IDENTIFY timeout taking 10 seconds. 2016-08-21 00:03:57 +02:00
Jonas 'Sortie' Termansen 8f81f990f8 Fix undefined stack register after switch into long mode.
Thanks to dminuoso for pointing out the issue.
2016-07-29 15:20:05 +02:00
Jonas 'Sortie' Termansen 1dbd1f760a Fix missing validation of program entry points. 2016-07-29 15:20:04 +02:00
Jonas 'Sortie' Termansen 2e03bd94d3 Add protection against sigreturn oriented programming (SROP).
This change hardens against invalid calls to sigreturn, which is a very
useful gadget when compromising a process. The system call now verifies
it is a real return from a signal and aborts the process otherwise. This
should render such attacks impossible in threads that are not servicing a
signal, and infeasible in threads that are handling signals they are yet to
return from.

The kernel now keeps track for each thread how many signals are being
handled but haven't returned yet.

Each thread now has a random signal value. It is re-randomized when the
thread handles a signal and the current signal counter is zero. This is
xorred with the context address and used as canary on the stack during
signal dispatch, protecting the saved context on the stack. This works
mostly like the regular stack protector.

The kernel now keeps track of the stack pointer for a single handled
signal per thread. It doesn't seem worth it to keep track of multiple
handled signals, as more than one is rare. Note that each delivered signal
will not necessarily result in a sigreturn because it is valid for a thread
to longjmp(3) out of a signal handler to a valid jmp_buf.

The sigreturn system call will abort if either:

- It was not called from the kernel sigreturn page.
- The thread is not currently processing a signal.
- The thread is processing a single signal, and the stack pointer did not
  have the expected value.
- It fails to read the context on the stack.
- The canary is wrong.
2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen 9b98679885 Clean up errno. 2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen 01a9779fc6 Compile libc with -ffreestanding.
This properly avoids problems where the compiler is unaware that this is the
implementation and assumes it can rely on the implementation. For instance,
it might implement calloc using a call to calloc.

Restructure the code that wrongly assumed __STDC_HOSTED__ meant userspace.
2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen 1ca1a068a1 Make the branding system more neutral. 2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen 1826fc32cd Fix signal delivery stack alignment. 2016-05-15 19:30:51 +02:00
Jonas 'Sortie' Termansen e69565fd15 Remove compatibility with Sortix 0.9. 2016-05-15 01:31:48 +02:00
Jonas 'Sortie' Termansen ecfe121a8c Add assertions to Signal::DispatchHandler callers. 2016-03-28 17:37:37 +02:00
Jonas 'Sortie' Termansen c1e5bcba7f Fix S_IROTH having the wrong value. 2016-03-28 16:25:42 +02:00
Jonas 'Sortie' Termansen fe87b61a33 Add tagline. 2016-03-26 23:50:50 +01:00
Jonas 'Sortie' Termansen 9f77beaea6 Fix floating point registers of new threads. 2016-03-26 23:29:09 +01:00
Jonas 'Sortie' Termansen 05282c86d7 Fix fchownat(2) system call ABI on x86.
This system call has five arguments, of which one is a 64-bit uid_t, and
another is a 64-bit gid_t, which means that 7 registers are needed. However,
x86 only has 5 registers available for system calls. Wrap the system call
with a structure like with mmap(2).
2016-03-26 23:28:36 +01:00
Jonas 'Sortie' Termansen 7348cb0b9a Add initrd module options. 2016-03-07 18:37:20 +01:00
Jonas 'Sortie' Termansen 2b72262b4f Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.

All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.

All imported code from other projects is compatible with this license.

All GPL licensed code from other projects had previously been removed.

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

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2016-03-05 22:21:50 +01:00
Jonas 'Sortie' Termansen af40496ffb Convert utils to C. 2016-03-03 23:02:24 +01:00
Jonas 'Sortie' Termansen 01b59c1947 Convert libc to C. 2016-03-03 23:02:23 +01:00
Jonas 'Sortie' Termansen 3487b62152 Remove dead MTRR code from the kernel. 2016-02-29 01:37:31 +01:00
Jonas 'Sortie' Termansen ede0571926 Add UTIME_NOW and UTIME_OMIT. 2016-02-24 17:32:05 +01:00
Jonas 'Sortie' Termansen 02c6316e95 Remove kernel debugger, old kernel US layout and kernel symbol code.
The debugger has fallen behind and has become a maintenance burden.  It was
the only user of the old kernel US layout system, which is good to get rid
of.  The debugger didn't work with graphical output and was likely to
conflict with the new keyboard system if used, which no longer triggered it.
The kernel symbol code was removed to simplify the kernel.

The kernel debugger was an useful debugging feature, but it needs to be done
in a better way before it can be added back.
2016-02-22 00:12:26 +01:00
Jonas 'Sortie' Termansen ebdb2a844f Disable PS/2 port testing.
This is reportedly a problem with some emulated PS/2 controllers.
glauxosdever reported his computer responds 0x50 0x00 instead of just 0x00.
OpenBSD has commented out this check in sys/dev/ic/pckbc.c, claiming it's a
problem with some controllers and that some might even hang.

I doubt not testing ports is going to be a problem, as the identitication
code runs next and verifies devices and all relevant modern hardware
probably has this working well enough.
2016-02-18 22:15:17 +01:00
Jonas 'Sortie' Termansen 065a51cb00 Fix user-space filesystem st_dev values being non-unique. 2016-02-17 23:49:19 +01:00
Jonas 'Sortie' Termansen 16c5738a20 Fix typo in PS/2 error string.
Discovered by Alexandros Alexandrou.
2016-02-13 20:07:47 +01:00
Jonas 'Sortie' Termansen bab21ae7dd Add tar and tix initrd support. 2016-02-07 14:48:28 +01:00
Jonas 'Sortie' Termansen 475bd7c26e Add support for multiple initrds. 2016-02-07 14:48:27 +01:00
Jonas 'Sortie' Termansen 9fe234d4d8 Rewrite init(8). 2016-02-06 17:29:42 +01:00
Jonas 'Sortie' Termansen 398eee1a8b Add AHCI driver. 2016-02-02 22:47:49 +01:00
Jonas 'Sortie' Termansen 79e01c2eba Rewrite ATA driver. 2016-02-02 22:47:49 +01:00
Jonas 'Sortie' Termansen b0bbf1e013 Fix fsm_mountat(2) error handling. 2016-01-27 21:36:04 +01:00
Jonas 'Sortie' Termansen 2e4b15daed Simplify directory reading. 2016-01-26 18:42:54 +01:00
Jonas 'Sortie' Termansen fe067c5150 Refactor boot page availability testing. 2016-01-26 17:51:25 +01:00
Jonas 'Sortie' Termansen cfb9dd6045 Remove poorly implemented kernel symbol loading. 2016-01-26 17:45:06 +01:00
Jonas 'Sortie' Termansen 08bac6e3f6 Add kernelinfo firmware string. 2016-01-26 17:45:06 +01:00
Jonas 'Sortie' Termansen 4b1079510b Execute only programs with an executable bit set. 2016-01-25 17:39:57 +01:00
Jonas 'Sortie' Termansen 2e3d7c45af Add paging no-execute and write protection support.
Enable the NX bit on x86_64 and set if not PROT_EXEC and enable the write
protection mode (CR0.WP) that disables the default behavior where the kernel
is able to write to read-only memory. Fix kernel broken assumptions it can
access read-only memory and take care to never set PROT_KWRITE on user-space
pages unless PROT_WRITE is also set, otherwise user-space will be able to
write to read-only memory.

This achieves X^W in the whole system except for the core kernel itself as
it is currently don't know the purpose of pages when identity mapping the
first 4 MiB.
2016-01-25 17:39:57 +01:00
Jonas 'Sortie' Termansen bff1265d62 Add termios(2). 2016-01-25 15:47:40 +01:00
Jonas 'Sortie' Termansen 8f233b4a10 Add console backspace bold and underline support.
Combine textbuffer char and attr concepts while here.
2016-01-23 01:02:50 +01:00
Jonas 'Sortie' Termansen 9297ff2a20 Add PS/2 mouse driver. 2016-01-23 00:50:53 +01:00
Jonas 'Sortie' Termansen 306709fc4a Add PS/2 controller driver. 2016-01-23 00:50:53 +01:00
Meisaka Yukara 3d48c7f658 Fix firing of absolute clocks. 2016-01-22 21:17:05 +01:00
Jonas 'Sortie' Termansen dc07435002 Fix closefrom(2) infinite loop. 2016-01-22 20:01:32 +01:00
Jonas 'Sortie' Termansen ff8b2be515 Implement CLOCK_THREAD_CPUTIME_ID and CLOCK_THREAD_SYSTIME_ID. 2016-01-09 02:28:44 +01:00
Jonas 'Sortie' Termansen af9cc8ed05 Schedule full console redraw after user-space framebuffer write. 2016-01-08 19:56:11 +01:00
Jonas 'Sortie' Termansen dad5c57f33 Allow bootloader bitmap framebuffer modesetting. 2016-01-08 19:56:11 +01:00
Jonas 'Sortie' Termansen 8c7c6fa59f Center ascii cat on boot. 2016-01-08 19:56:11 +01:00
Jonas 'Sortie' Termansen 9d3aecfa07 Work around sync on close bottleneck. 2016-01-08 01:25:10 +01:00
Jonas 'Sortie' Termansen 74fe008001 Silence static analysis warnings. 2016-01-08 00:48:01 +01:00
Jonas 'Sortie' Termansen a45b93785c Fix program loading bugs. 2016-01-08 00:41:20 +01:00
Jonas 'Sortie' Termansen 48c6ccdf06 Fix MapPCIBAR potential overflow. 2016-01-08 00:39:13 +01:00
Jonas 'Sortie' Termansen 055f502c02 Fix dup3(2) O_CLOEXEC and O_CLOFORK handling. 2016-01-08 00:36:14 +01:00
Jonas 'Sortie' Termansen 8fabfc5f7b Fix kernel console rendering U+007F. 2016-01-07 19:17:04 +01:00
Jonas 'Sortie' Termansen 3e068bc88f Fix x86 Alignment Check and Security Exception handlers.
The processor pushes an error code when delivering these exception.

Discovered by Alexandros Alexandrou.
2016-01-07 19:17:04 +01:00
Jonas 'Sortie' Termansen 22351d7f72 Fix untimely delivery of signals during userfs reference count messages. 2016-01-07 19:08:43 +01:00
Jonas 'Sortie' Termansen 559857b97e Fix features.h inclusions not yet changed to sys/cdefs.h. 2015-12-23 17:49:59 +01:00
Jonas 'Sortie' Termansen f60b2c6ec4 Add keyboard layout support to kernel. 2015-12-19 02:44:15 +01:00
Jonas 'Sortie' Termansen 7da84494ab Add kblayout-compiler(1). 2015-12-19 02:21:15 +01:00
Jonas 'Sortie' Termansen 4b6b06bbc8 Add scram(2). 2015-12-12 22:53:07 +01:00
Jonas 'Sortie' Termansen f2eb347e9f Fix PS2Keyboard memcpy(dest, NULL, 0) undefined behavior. 2015-12-12 22:53:07 +01:00
Jonas 'Sortie' Termansen ab27c85948 Implement sigaction(2) SA_RESETHAND. 2015-12-12 19:28:08 +01:00
Jonas 'Sortie' Termansen 802c12e64a Implement ppoll(2) timeouts. 2015-12-12 19:28:08 +01:00
Jonas 'Sortie' Termansen 0045f18c81 Remove kernel Scheduler::Init(). 2015-12-12 19:28:07 +01:00
Jonas 'Sortie' Termansen cee24359d8 Add psctl(2). 2015-12-12 19:28:07 +01:00
Jonas 'Sortie' Termansen 716ac0dceb Fix logterminal TERMMODE_LINEBUFFER checking. 2015-12-12 19:28:07 +01:00
Jonas 'Sortie' Termansen 24cf8f42b8 Silence maybe initialized warning in sigsuspend. 2015-12-12 16:53:42 +01:00
Jonas 'Sortie' Termansen 32feba2709 Fix memcpy(dest, NULL, 0) undefined behavior. 2015-12-12 16:53:42 +01:00
Jonas 'Sortie' Termansen 1acf16dea0 Fix kernel makefile finding crtbegin.o and crtend.o when not needed. 2015-12-12 16:53:42 +01:00
Jonas 'Sortie' Termansen f4995c24f4 Add kernel --init option. 2015-10-28 19:36:33 +01:00
Jonas 'Sortie' Termansen 62b5d45a78 Add kernel command line support. 2015-10-28 19:36:33 +01:00
Jonas 'Sortie' Termansen fc637c8880 Prevent orphan processes from becoming zombies. 2015-10-28 19:36:33 +01:00
Jonas 'Sortie' Termansen 44d4807fc4 Add ENOMOUNT. 2015-10-28 19:36:33 +01:00
Jonas 'Sortie' Termansen bae08f13ef Fix fsmarshall not handling users and groups.
This is an incompatible ABI change.
2015-10-28 16:07:36 +01:00
Jonas 'Sortie' Termansen 7c6e6ef317 Fix kernel string copy from user-space. 2015-10-09 16:17:52 +02:00
Jonas 'Sortie' Termansen 2727d9fb50 Fix pipe destruction race condition. 2015-10-09 16:17:52 +02:00
Jonas 'Sortie' Termansen 12b5044bc7 Fix signal delivery during context switch. 2015-10-09 16:17:52 +02:00
Jonas 'Sortie' Termansen 875ce1adf7 Fix faccessat(2) not reporting correct permissions. 2015-10-01 22:50:51 +02:00
Jonas 'Sortie' Termansen 4c2a93ea02 Fix munmap(2) shrink from right logic.
This fixes a rather nasty issue where gcc's garbage collection triggered a
munmap call with the effect that it began unmapping huge amounts of kernel
data until the system triple faulted.
2015-10-01 22:50:51 +02:00
Jonas 'Sortie' Termansen 40c2fd12dc Fix logterminal TERMMODE_UNICODE checking. 2015-10-01 22:49:02 +02:00
Jonas 'Sortie' Termansen 6725972e11 Fix LinkInodeInDir return value.
The callers expected it to return an int different than 0 on failure. The
link method returns different than 0 on failure. This actually worked by
lucky coincidence. Change the return type to int and 0 on success, and -1
on failure per popular demand.

Thanks to Meisaka Yukara for spotting this.
2015-09-25 15:01:20 +02:00
Jonas 'Sortie' Termansen 275541383c Fix dtable return value type errors and missing input validation.
Update to current coding conventions while here.

Thanks to Meisaka Yukara for spotting the return value type errors.
2015-09-25 15:01:20 +02:00
Jonas 'Sortie' Termansen 3501b1e701 Fix console margin not having color of nearest neighbour. 2015-09-25 15:01:19 +02:00
Jonas 'Sortie' Termansen ac6f016748 Fix partition reads and writes at end. 2015-09-25 14:59:04 +02:00
Jonas 'Sortie' Termansen 6813a26196 Fix box drawing character ninth column rendering. 2015-09-25 14:59:04 +02:00
Jonas 'Sortie' Termansen 73a182f80c Add interface to get 32-bit pages. 2015-08-28 15:24:54 +02:00
Jonas 'Sortie' Termansen eb11613da6 Add interface to wait for IO port changes. 2015-08-28 15:24:54 +02:00
Jonas 'Sortie' Termansen 39d8894fc0 Write newline when closing the kernel debugger. 2015-08-27 22:12:45 +02:00
Jonas 'Sortie' Termansen 34a832dbf3 Add tcgetblob and statvfs support to kramfs. 2015-08-26 23:12:45 +02:00
Jonas 'Sortie' Termansen ae1ed0c13c Replace strtok_r uses with strsep. 2015-08-26 17:49:28 +02:00
Jonas 'Sortie' Termansen 0fc3d70716 Clear registers after system calls. 2015-08-26 16:29:18 +02:00
Jonas 'Sortie' Termansen a79aeed0c1 Remove __BEGIN_DECLS and __END_DECLS. 2015-08-26 14:52:44 +02:00
Jonas 'Sortie' Termansen 5915e2cd14 Add closefrom(2). 2015-08-26 14:01:25 +02:00
Jonas 'Sortie' Termansen aa09f8cecc Simplify kernel PrepareLookup. 2015-08-22 01:29:38 +02:00
Jonas 'Sortie' Termansen 75cf34cb8e Add random device. 2015-08-22 01:04:58 +02:00
Jonas 'Sortie' Termansen 6405e2ea6e Add arc4random support to the kernel. 2015-08-22 01:04:58 +02:00
Jonas 'Sortie' Termansen 20698b35c7 Refactor kernel log. 2015-08-21 21:25:01 +02:00
Jonas 'Sortie' Termansen 77467b7768 Detect physical memory before initializing the kernel log. 2015-08-21 21:25:00 +02:00
Jonas 'Sortie' Termansen 218875eb79 Initialize paging before KernelInit. 2015-08-21 21:25:00 +02:00
Jonas 'Sortie' Termansen a422c394b8 Initialize the GDT in the bootstrap assembly. 2015-08-21 21:25:00 +02:00
Jonas 'Sortie' Termansen cf55531aae Make nfds_t size_t. 2015-08-21 21:25:00 +02:00
Jonas 'Sortie' Termansen ef45218660 Add S_ISGID and S_ISUID.
I originally left them out because Sortix doesn't have setuid and setgid
executable support, but this created considerable compatibility issues and
it is better to supply them as the mode bits still exist and can be set.
2015-08-21 21:25:00 +02:00
Jonas 'Sortie' Termansen a5eacdbdcc Fix log terminal write insecure copying. 2015-08-21 20:41:33 +02:00
Jonas 'Sortie' Termansen 6cf07034d5 Fix missing parenthesizes in <sys/wait.h> macros. 2015-08-14 17:26:07 +02:00
Jonas 'Sortie' Termansen 158716f96a Fix ctype invocations with wrong domain. 2015-08-11 15:57:56 +02:00
Jonas 'Sortie' Termansen 1dee12e58e Fix typo in initrd extraction failure panic. 2015-07-28 22:01:44 +02:00
Jonas 'Sortie' Termansen fffefeba8f Fix execve(2) keeping program descriptors open. 2015-07-09 19:20:49 +02:00
Jonas 'Sortie' Termansen d235251139 Fix AbstractInode::statvfs not setting f_favail. 2015-06-27 17:06:43 +02:00
Jonas 'Sortie' Termansen 779bbe19dd Fix vulnerability if p_filesz exceeds p_memsz in ELF loader. 2015-06-27 17:06:43 +02:00
Jonas 'Sortie' Termansen 2291076f19 Fix poll zero timeout not being instant wakeup. 2015-06-27 17:06:43 +02:00
Jonas 'Sortie' Termansen 9acc74de28 Fix read-only mmap with backing store. 2015-06-27 17:06:33 +02:00
Jonas 'Sortie' Termansen d068a352f7 Fix missing lock in kernel descriptor fork. 2015-06-27 17:06:32 +02:00
Jonas 'Sortie' Termansen 5589085084 Fix unlinkat potentially following paths twice. 2015-06-27 17:06:32 +02:00