Andreas Kling
37f6844c6c
Kernel: Port stat() to KResult/KResultOr<T>.
2019-03-02 00:11:27 +01:00
Andreas Kling
f75eb9af16
Kernel: Support chdir() to a directory that's executable but not readable.
...
Also the superuser should be allowed to resolve any possible path without
getting tripped up by EACCES.
2019-03-01 23:54:07 +01:00
Andreas Kling
274b0260f7
Kernel: Don't send SIGCHLD to parent process if he has SA_NOCLDWAIT set.
...
Just transfer ownership of the dead process to the colonel and let the
scheduler reap it on next iteration.
2019-03-01 15:52:05 +01:00
Andreas Kling
6c2089c59d
Put miscellaneous debug spam behind #ifdefs.
2019-03-01 10:51:58 +01:00
Andreas Kling
1b16a29044
Kernel+Userland: Implement fchmod() syscall and use it to improve /bin/cp.
...
/bin/cp will now copy the permission bits from source to destination. :^)
2019-03-01 10:39:19 +01:00
Andreas Kling
7ee4e79cd6
Kernel: Oops, fix Vector assertion in FS::Sync.
2019-02-28 22:33:00 +01:00
Andreas Kling
6b581aff77
Kernel: Make a copy of the dirty inode list before iterating in sync().
2019-02-28 21:51:59 +01:00
Andreas Kling
e427b514dc
Kernel: Implement basic SIGSTOP and SIGCONT support.
2019-02-28 12:27:26 +01:00
Andreas Kling
c09ab7cc40
Kernel: Only allow sending signals to process you own.
2019-02-28 11:46:38 +01:00
Andreas Kling
258f4671ea
Kernel: kill() syscall should support sending a signal to yourself.
2019-02-28 09:44:48 +01:00
Andreas Kling
166aadc4e1
ProcessManager: Start working on a graphical process manager.
...
I need a table view widget for this thing, so I'm also using this to
prototype a model/view thingy.
2019-02-28 01:43:50 +01:00
Andreas Kling
dda9b9ab1b
Userland: Add a simple /bin/stat program.
2019-02-27 21:45:06 +01:00
Andreas Kling
7c18b86781
Kernel: Allow uid 0 to read/write/execute any file.
2019-02-27 17:08:13 +01:00
Andreas Kling
d7d6deaa5c
Ext2FS: Fix hole in Ext2FSInode::directory_entry_count() locking.
2019-02-27 17:07:34 +01:00
Andreas Kling
60d0a48be5
Kernel: Use KResult in link().
2019-02-27 15:31:26 +01:00
Andreas Kling
5b27f11b97
Kernel: Use KResult in unlink() and rmdir().
2019-02-27 14:11:25 +01:00
Andreas Kling
c9d7fc6ec6
Kernel: chmod() should allow superuser to change mode bits of any file.
2019-02-27 12:34:43 +01:00
Andreas Kling
1d2529b4a1
Add chown() syscall and a simple /bin/chown program.
2019-02-27 12:32:53 +01:00
Andreas Kling
e421c10735
More compat work towards porting vim.
...
It now builds and runs in the small-featureset configuration. :^)
2019-02-27 00:02:01 +01:00
Andreas Kling
424368034b
LibC: Make errno codes be #defines instead of enum values.
...
It turns out that a lot of 3rd party software does things like:
#ifdef EINTR
...
#endif
This won't work if EINTR is an enum. So much for that nice idea.
2019-02-26 22:40:35 +01:00
Andreas Kling
a356746d04
Compat work towards porting vim.
2019-02-26 15:57:59 +01:00
Andreas Kling
2e5b9d318f
Kernel: Simplify ELF loading a bit.
...
Instead of iterating over the sections and memcpy()ing per-section,
do all the copying based on program headers instead.
2019-02-26 15:52:06 +01:00
Andreas Kling
e0c1541847
Compat work towards making bash-5.0 build with less patches.
...
Hacked implementations of sigsetjmp() and siglongjmp(). I didn't know about
these APIs until just now, but I hope I got them right.
2019-02-26 14:05:28 +01:00
Andreas Kling
3f29a12d90
More compat work. Rename libraries from LibFoo.a => libfoo.a
...
This makes it more straightforward to build a cross-compiler toolchain.
Also move math stuff from LibC to LibM.
2019-02-26 13:30:57 +01:00
Andreas Kling
cccc8d8aeb
More compat work.
...
Move syscall to int 0x82 since using int 0x80 was kinda prone to fork bombs
when building things on Linux. :^)
2019-02-26 12:57:02 +01:00
Andreas Kling
9624b54703
More moving towards using signed types.
...
I'm still feeling this out, but I am starting to like the general idea.
2019-02-25 22:06:55 +01:00
Andreas Kling
beda478821
Kernel: Make syscalls that take a buffer size use ssize_t instead of size_t.
...
Dealing with the unsigned overflow propagation here just seems unreasonably
error prone. Let's limit ourselves to 2GB buffer sizes instead.
2019-02-25 21:21:12 +01:00
Andreas Kling
5af4e622b9
Kernel: Add KResult and KResultOr<T> classes.
...
The idea here is to combine a potential syscall error code with an arbitrary
type in the case of success. I feel like this will end up much less error
prone than returning some arbitrary type that kinda sorta has bool semantics
(but sometimes not really) and passing the error through an out-param.
This patch only converts a few syscalls to using it. More to come.
2019-02-25 20:50:22 +01:00
Andreas Kling
15fb917f28
Convert more RetainPtr use to Retained.
2019-02-25 16:04:08 +01:00
Andreas Kling
2cfcbdc735
AK: Add Retained<T>, like RetainPtr, but never null.
...
Also use some Clang attribute wizardry to get a warning for use-after-move.
2019-02-25 12:43:52 +01:00
Andreas Kling
9fd4f4862b
Kernel: Make dump_backtrace() kinda sorta work.
2019-02-24 14:51:48 +01:00
Andreas Kling
d218686c0a
Ext2FS: Don't copy more than sizeof(ext2_inode) bytes of raw inode data.
...
Some file systems have inodes larger than sizeof(ext2_inode) so this would
stomp all over unrelated data.
2019-02-24 14:24:04 +01:00
Andreas Kling
a7a456002e
LibC: Enough compat work to make binutils-2.32 build and run.
2019-02-23 17:24:50 +01:00
Andreas Kling
75b100673f
Switch over to building everything with i686-elf-g++.
2019-02-22 10:45:32 +01:00
Andreas Kling
afa6f88039
Throw away the Clock app since we now have a clock in the menubar. :^)
2019-02-22 10:42:29 +01:00
Andreas Kling
6788dcdb58
Start fixing things up to build with a proper cross-compiler.
2019-02-22 10:23:28 +01:00
Andreas Kling
1da261eeb6
Ext2FS: Tweak a debug message to print file mode in octal.
2019-02-22 09:13:05 +01:00
Andreas Kling
f98dcbf1d6
Kernel: Respect the process umask in open() and mkdir().
2019-02-22 02:39:13 +01:00
Andreas Kling
6d3e12899b
Kernel: Pass process arguments directly on the stack.
...
Get rid of the convoluted get_arguments and get_environment syscalls.
This patch also adds a simple /bin/env that just prints its environment.
2019-02-22 01:55:22 +01:00
Andreas Kling
e969419202
Kernel: Don't allocate and discard an extra stack for every process.
2019-02-22 00:27:06 +01:00
Andreas Kling
920e8e58ed
Kernel+Userland: Implement setuid() and setgid() and add /bin/su
...
Also show setuid and setgid bits in "ls -l" output. :^)
2019-02-21 23:38:10 +01:00
Andreas Kling
8b64f213a1
Kernel: sigpending() and sigprocmask() should validate memory writes.
2019-02-21 21:33:52 +01:00
Andreas Kling
19acb2baf7
Kernel: Add file permission checks to link() syscall.
...
Also use the new name, not the old name, for the new link, duh.
2019-02-21 17:05:32 +01:00
Andreas Kling
a624fe06b8
Kernel: Add file permission checks to utime() syscall.
2019-02-21 16:37:41 +01:00
Andreas Kling
f0a869ea50
Kernel: Process::cwd_inode() should return a reference.
...
There's always a current working directory inode.
2019-02-21 16:19:07 +01:00
Andreas Kling
ce3b548077
Kernel: Separate VFS stat() from open().
...
It was very confusing that you had to open a FileDescriptor in order to stat
a file. This patch gives VFS a separate stat() function and uses it to
implement the stat() and lstat() syscalls.
2019-02-21 16:09:12 +01:00
Andreas Kling
f5f136931a
Kernel: Start adding various file system permission checks.
...
Fail with EACCES in various situations. Fix userland bugs that were exposed.
2019-02-21 15:45:31 +01:00
Andreas Kling
43075e5878
Add a simple /bin/df which gathers its info from /proc/df.
2019-02-21 14:48:00 +01:00
Andreas Kling
7d288aafb2
Kernel: Add link() syscall to create hard links.
...
This accidentally grew into a little bit of VFS cleanup as well.
Also add a simple /bin/ln implementation to exercise it.
2019-02-21 13:26:40 +01:00
Andreas Kling
0aaec6b19a
Support resizing the Terminal app.
...
I set it up so that TIOCSWINSZ on a master PTY gets forwarded to the slave.
This feels intuitively right. Terminal can then use that to inform the shell
or whoever is inside the slave that the window size has changed.
TIOCSWINSZ also triggers the generation of a SIGWINCH signal. :^)
2019-02-20 23:38:20 +01:00