Commit graph

2400 commits

Author SHA1 Message Date
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
Andreas Kling
3cba2a8a78 Kernel: Add a beep() syscall that beeps the PC speaker.
Hook this up in Terminal so that the '\a' character generates a beep.
Finally emit an '\a' character in the shell line editing code when
backspacing at the start of the line.
2019-05-15 21:40:41 +02:00
Robin Burchell
dcf490ecab ReadMe: Add build/run instructions from "old" wiki
Saves having to go hunting for them
2019-05-15 21:14:09 +02:00
Robin Burchell
ac2a3b65bb makeall: Use set -e to exit on failure
And pretty the building/installing up a little, rather than a huge chain of &&
2019-05-15 21:14:09 +02:00
Robin Burchell
c6bc23a748 makeall: Like BuildIt, respect MAKEJOBS 2019-05-15 21:14:09 +02:00
Robin Burchell
f9515d56e7 BuildIt: Allow specifying MAKEJOBS rather than forcing to nprocs 2019-05-15 20:16:58 +02:00
Robin Burchell
bfd94dbf54 UseIt: allow sourcing from outside the Toolchain dir 2019-05-15 20:16:58 +02:00
Robin Burchell
219f2f988e BuildIt: use set -e to fail immediately on error
This saves time if something goes wrong very early in the build process.
2019-05-15 20:16:58 +02:00
Andreas Kling
3cd1db09d4 Documentation: Add a brief description of Serenity's smart pointer types. 2019-05-15 14:07:14 +02:00
Andreas Kling
65e56eb72b GButton: Allow triggering a "click" by pressing Return when focused. 2019-05-15 04:25:53 +02:00
Andreas Kling
ad731cc08f LibGUI: Support cycling through focusable widgets with Tab and Shift-Tab. 2019-05-15 02:39:58 +02:00
Andreas Kling
01ffcdfa31 Kernel: Encapsulate the Region's COW map a bit better. 2019-05-14 17:31:57 +02:00
Andreas Kling
2fa5e2b66b ProcessManager: Keep /proc/all open to reduce CPU impact of ProcessManager. 2019-05-14 17:12:35 +02:00