Commit Graph

2412 Commits

Author SHA1 Message Date
Robin Burchell
190111e21a Userland: Port ln to use ArgsParser 2019-05-17 15:49:37 +02:00
Robin Burchell
bffed9e3cb ArgsParser: Expand to be able to handle multiple single arguments
This is needed for e.g. ln
2019-05-17 15:49:37 +02:00
Robin Burchell
b92fa59832 Userland: Port pape to use ArgsParser, and minor cleanups 2019-05-17 15:49:37 +02:00
Robin Burchell
56aad835ad Userland: Port sysctl to use ArgsParser, and minor cleanups 2019-05-17 15:49:37 +02:00
Robin Burchell
6dd7ee53ea AK/Userland: Add single value to ArgsParser usage, and port tail to use ArgsParser 2019-05-17 15:49:37 +02:00
Robin Burchell
c478503581 ArgsParser: Remove prefix from constructor
It makes sense to keep this consistent between applications, and the
purpose of the string is not immediately obvious from an API perspective.

If we need to make it configurable later, that can come from a setter.
2019-05-17 15:49:37 +02:00
Robin Burchell
729507f2bd ArgsParser: Remove boolean trap on add_arg
Rather than requiring a boolean for whether or not the argument is
required, add some new methods to make the purpose of the bool explicit.
2019-05-17 15:49:37 +02:00
Robin Burchell
5cad215919 ArgsParser: Style fixup
Remove tabs, make whitespace lines a little more in fitting with the rest of the codebase.
2019-05-17 15:49:37 +02:00
Andreas Kling
3ec625067a Terminal: Uh, also change the one caller of beep() to sysbeep().. 2019-05-17 14:34:07 +02:00
Andreas Kling
c081aae9b5 LibC: Rename beep() to sysbeep() to avoid clashing with curses. 2019-05-17 14:32:53 +02:00
Robin Burchell
c8fda23a03 LibCore/Userland: Introduce a simple tail implementation
Also introduce more seek modes on CIODevice, and an out param to find
the current position inside the file -- this means less syscalls (and
less potential races) than requesting it through a separate pos()
accessor or something.
2019-05-17 14:28:13 +02:00
Robin Burchell
805e87a21c WindowServer: Add a more dynamic app list
This contains more stuff, and is easier to add to since it's just a vector :)
2019-05-17 14:20:44 +02:00
Andreas Kling
cc5ee3bff4 Vector: Add insert() overload that takes a const T&. 2019-05-17 04:59:56 +02:00
Andreas Kling
cde47089d2 Kernel: Remove some unnecessary massaging of region base/size pairs.
These will be appropriately rounded by the allocate_range(), so call sites
can stop worrying about it.
2019-05-17 04:47:06 +02:00
Andreas Kling
6957825444 Kernel: Factor out range allocation from Process::allocate_region*().
These functions were doing exactly the same thing for range allocation, so
share that code in an allocate_range() helper.

Region allocation will now also fail if range allocation fails, which means
that mmap() can actually fail without falling apart. Exciting times!
2019-05-17 04:39:22 +02:00
Andreas Kling
87b54a82c7 Kernel: Let Region keep a Range internally. 2019-05-17 04:32:08 +02:00
Andreas Kling
4a6fcfbacf Kernel: Use a RangeAllocator for kernel-only virtual space allocation too. 2019-05-17 04:02:29 +02:00
Andreas Kling
b1bb737704 Kernel: Remove Process::m_next_address.
This isn't needed now that we have RangeAllocator. :^)
2019-05-17 03:47:00 +02:00
Andreas Kling
45ff3a7e6a Kernel: Make Thread::kernel_stack_base() work for kernel processes. 2019-05-17 03:43:51 +02:00
Andreas Kling
c414e65498 Kernel: Implement a simple virtual address range allocator.
This replaces the previous virtual address allocator which was basically
just "m_next_address += size;"

With this in place, virtual addresses can get reused, which cuts down on
the number of page tables created. When we implement ASLR some day, we'll
probably have to do page table deallocation, but for now page tables are
only deallocated once the process dies.
2019-05-17 03:40:15 +02:00
Andreas Kling
c56e3ebee1 Always dump QEMU CPU state on CPU reset. 2019-05-17 00:06:23 +02:00
Andreas Kling
bcb7893156 WindowServer: Don't treat bottom titlebar edge as part of the border.
We were allowing initiation of resize from the bottom titlebar edge
since everything inside the window frame that's not either inside the
title bar, or inside the window content, is considered the border.
2019-05-16 20:29:42 +02:00
Andreas Kling
c597c2332b Userland: Add /bin/whoami 2019-05-16 20:18:17 +02:00
Andreas Kling
f196e2fcda Terminal: Set original window title to "Terminal"
Don't rely on the shell setting the window title using escape sequences.
2019-05-16 20:13:41 +02:00
Andreas Kling
4e7e2950bc WindowServer: Fill unbacked windows with their background color.
This avoids flashing a content-less window frame during client startup.
2019-05-16 20:11:09 +02:00
Andreas Kling
4e88872c8e Kernel: Always dump_backtrace() on process crash. 2019-05-16 19:49:48 +02:00
GuillaumeGas
0ba4ceb2cd Added CProcessStatisticsReader to avoid having to parse /proc/all (#35)
* Added CProcessStatisticsReader to avoid having to parse /proc/all

* Took @awesomekling's feedbacks into account

* Fixed indentation and replaced tabs by spaces
2019-05-16 18:47:47 +02:00
Andreas Kling
174639b7f0 Kernel: Symbolicate userspace backtraces using ELFLoader.
Stash away the ELFLoader used to load an executable in Process so we can use
it for symbolicating userspace addresses later on. This will make debugging
userspace programs a lot nicer. :^)
2019-05-16 17:18:25 +02:00
Andreas Kling
e20aecefba LibC: Don't clobber errno in dbgprintf(). 2019-05-16 16:24:22 +02:00
Robin Burchell
f1f3cd58b0 FileSystem: fix errno on lseek() beyond the bounds of a file
These are all EINVAL. Also remove bogus assert on metadata.size.
2019-05-16 16:05:08 +02:00
Robin Burchell
abb7455163 LibC/Shell: Add unsetenv(), and unset builtin calling it in Shell. 2019-05-16 14:32:09 +02:00
Robin Burchell
b2dd12daac LibC: Change putenv (and getenv) to not copy, but directly return the environ values.
This is in keeping with how putenv should function. It does mean that
the shell's export command now leaks, but that's not a difficult fix.

Contributes to #29.
2019-05-16 14:32:09 +02:00
Andreas Kling
c5434e0cfa Kernel: Simplify ELF loader by removing the allocator indirections. 2019-05-16 14:16:08 +02:00
Andreas Kling
07df2fa7ec GFilePicker: Remove the frame around the little toolbar. 2019-05-16 14:06:55 +02:00
Andreas Kling
ee363faf10 GButton: Only draw focus rect if there is a caption text. 2019-05-16 14:05:28 +02:00
Robin Burchell
6f73a549fa LibC: Add struct timespec to time.h 2019-05-16 14:03:49 +02:00
Robin Burchell
4dad585609 LibC: Allow {AF,PF}_UNIX as well as {AF,PF}_LOCAL
Seems that these are equivilent. POSIX specifies _LOCAL, but a lot of
software uses _UNIX.
2019-05-16 14:03:49 +02:00
Robin Burchell
cf41b0ef17 LibC: Add INET_ADDRSTRLEN define 2019-05-16 14:03:49 +02:00
Robin Burchell
619489da62 LibC: Define a SOMAXCONN value in socket.h
No idea if this is sensible; but some software will look for it.
2019-05-16 14:03:49 +02:00
Robin Burchell
f0f5dd6cef LibC: Implement str{n}casecmp 2019-05-16 14:03:49 +02:00
Andreas Kling
2f4e7edee5 Kernel: Simplify dump_backtrace() API for clients.
It makes no sense that clients had to worry about whether or not KSyms
were loaded.
2019-05-16 13:41:16 +02:00
Andreas Kling
7a2da54c07 Only the kernel needs to build with default includes disabled. 2019-05-16 13:40:43 +02:00
Robin Burchell
cef161c2bc TextEditor: Make use of GFilePicker to select a file to open 2019-05-16 13:31:19 +02:00
Robin Burchell
23c90da26c GFilePicker: Make the path selected accessible externally 2019-05-16 13:31:19 +02:00
Andreas Kling
176f683f66 Kernel: Move Inode to its own files. 2019-05-16 03:02:37 +02:00
Robin Burchell
8aecebe8f3 GTextEditor: Introduce triple click to select all 2019-05-16 01:24:34 +02:00
Robin Burchell
c4610b825d WSWindowManager: Fix a small whoopsie with double click delivery
We must reset the click clock to invalid after delivering the double
click event. Otherwise, a subsequent click will make us (incorrectly)
deliver another double click.
2019-05-16 01:24:34 +02:00
Robin Burchell
966c5d10b1 GTextEditor: Minor cleanup
Remove an unnecessary layer of nesting
2019-05-16 01:24:34 +02:00
Robin Burchell
f55965b5e8 WindowServer/GMenu: Adjust the popup position to fit the window inside the screen
Rather than passing a "top_anchored" bool. Fixes #22.
2019-05-16 01:22:54 +02:00
Robin Burchell
a4b0dfff43 Move double click events from LibGUI to the window server 2019-05-15 22:45:28 +02:00