Commit graph

1386 commits

Author SHA1 Message Date
Andreas Kling
95cfa49f1b LibGUI: Make event receivers be weak pointers. 2019-02-26 00:51:49 +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
901b7d5d91 Fix a bunch of compiler warnings. Not all, but a lot. 2019-02-25 19:05:51 +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
0b957ed2b1 Some compat work towards making GCC's libstdc++ build. 2019-02-25 10:05:32 +01:00
Andreas Kling
93c0dfd1d7 LibC: A bunch of compat work towards porting GCC. 2019-02-24 15:20:07 +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
d7753c7c8d Move over to building all of userspace with i686-pc-serenity-g++. 2019-02-22 14:45:14 +01:00
Andreas Kling
b0d1969ca5 Userland: Fix two compiler warnings. 2019-02-22 10:50:59 +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
aaa11e3c25 Userland: Fix extra unused printf() argument warning. 2019-02-22 10:32:17 +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
42342d2337 LibC: Tidy up _start a bit and rename compilation unit to "crt0" 2019-02-22 09:21:54 +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
b30773638e Userland: Minor tweaks in /bin/su 2019-02-21 23:49:16 +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
6071a77e8e Userland: Remove the /bin/sh greeting. It was cute but spammy. 2019-02-21 23:34:14 +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
b6115ee5b7 WindowServer: Choose resizing direction based on where it's initiated.
Divide the window into 3x3 hot areas and resize in the direction of the
corner where the resize starts. The middle is a no-op area.

This needs some polish but the basic mechanism is good.
2019-02-21 11:06:37 +01:00
Andreas Kling
16cd4585cd WindowServer: Oops, forgot to plumb through the base size for incresize. 2019-02-21 10:11:12 +01:00
Andreas Kling
6084cd0c56 Add concept of size increments to windowing system.
Use this to implement incremental resizing for Terminal so that we only
ever resize to fit a perfect number of rows and columns.

This is very nice. :^)
2019-02-21 00:21:23 +01:00
Andreas Kling
fd575055c2 Userland: /bin/sh shouldn't crash on EINTR. 2019-02-20 23:45:00 +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
Andreas Kling
0ca3112301 FileManager: Fix glitch in the alternating directory item backgrounds. 2019-02-20 22:10:28 +01:00
Andreas Kling
fa02d2a39b Rework the rendering model so that clients instantiate backing stores.
This makes interactive resizing work a lot better, althought it's still not
perfect. There are still glitches and unpleasant flashes of zeroed memory.
2019-02-20 22:08:14 +01:00
Andreas Kling
e0b81ee4c9 Ext2FS: Remove the inode cache lock in favor of one big lock instead. 2019-02-20 21:58:55 +01:00
Andreas Kling
266e77259e Kernel: If someone else zero-fills a shared VMO page, don't freak out.
Just map the new page and move on.
2019-02-20 21:33:07 +01:00
Andreas Kling
6158f456fa Kernel: Don't remove from SharedBuffer map while iterating it.
This was causing a finalizer crash when handling a process that co-owned
multiple shared buffers.
2019-02-20 21:31:52 +01:00
Andreas Kling
d054fbee91 WindowServer: Don't spam clients with resize events.
Wait for them to finish a paint, then send them a new resize event.
The exception is when releasing the mouse button to end the resize.
Then we send a new resize event right away.
2019-02-20 15:50:05 +01:00
Andreas Kling
59b8183c4b WindowServer: Support resizing windows.
This is pretty limited and not entirely stable, but it does work! :^)
2019-02-20 15:34:55 +01:00
Andreas Kling
a9911fca80 WindowServer: Minor style tweak. 2019-02-20 13:59:13 +01:00
Andreas Kling
96943dbad1 WindowServer: Remove some unused WSWindowManager members. 2019-02-20 13:17:09 +01:00
Andreas Kling
3df4a902df Ext2FS: Lock a lot. Go way overkill with locking for now. 2019-02-20 13:09:59 +01:00
Andreas Kling
809ffa56d7 Kernel: Reduce code duplication in exception handlers. 2019-02-20 12:28:41 +01:00