Age | Commit message (Collapse) | Author |
|
Technically the bottom 2MB is still identity-mapped for the kernel and
not made available to userspace at all, but for simplicity's sake we
can just ignore that and make "address < 0xc0000000" the canonical
check for user/kernel.
|
|
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.
For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.
Going forward, all new source files should include a license header.
|
|
This patch adds a new "accept" promise that allows you to call accept()
on an already listening socket. This lets programs set up a socket for
for listening and then dropping "inet" and/or "unix" so that only
incoming (and existing) connections are allowed from that point on.
No new outgoing connections or listening server sockets can be created.
In addition to accept() it also allows getsockopt() with SOL_SOCKET
and SO_PEERCRED, which is used to find the PID/UID/GID of the socket
peer. This is used by our IPC library when creating shared buffers that
should only be accessible to a specific peer process.
This allows us to drop "unix" in WindowServer and LookupServer. :^)
It also makes the debugging/introspection RPC sockets in CEventLoop
based programs work again.
|
|
|
|
Launching from the terminal inherits $PATH which includes
/usr/local/bin, but launching from the system menubar doesn't, so
HackStudio wasn't finding make installed from ports.
|
|
Now that the "unix" pledge is no longer required for socket I/O, we can
drop it after making the connections we need in a program.
In most GUI program cases, once we've connected to the WindowServer by
instantiating a GApplication, we no longer need "unix" :^)
|
|
|
|
|
|
Allow HOST_CXX to be passed to make which will be the actual host
C++ compiler used, such as 'make HOST_CXX=clang++'.
|
|
|
|
Instead of using ByteBuffer (which always malloc() their storage) for
IPC message encoding, we now use a Vector<u8, 1024>, which means that
messages smaller than 1 KB avoid heap allocation entirely.
|
|
|
|
|
|
Use FileSystemPath to figure out that "./foo.cpp" == "foo.cpp"
|
|
Instead of directly manipulating LDFLAGS, set LIB_DEPS in each
subdirectory Makefile listing the libraries needed for
building/linking such as "LIB_DEPS = Core GUI Draw IPC Core".
This adds each library as an -L and -l argument in LDFLAGS, but
also adds the library.a file as a link dependency on the current
$(PROGRAM). This causes the given library to be (re)built before
linking the current $(PROGRAM), but will also re-link any binaries
depending on that library when it is modified, when running make
from the root directory.
Also turn generator tools like IPCCompiler into dependencies on the
files they generate, so they are built on-demand when a particular
directory needs them.
This all allows the root Makefile to just list directories and not
care about the order, as all of the dependency tracking will figure
it out.
|
|
GApplication now has a palette. This palette contains all the system
theme colors by default, and is inherited by a new top-level GWidget.
New child widgets inherit their parents palette.
It is possible to override the GApplication palette, and the palette
of any GWidget.
The Palette object contains a bunch of colors, each corresponding to
a ColorRole. Each role has a convenience getter as well.
Each GWidget now has a background_role() and foreground_role(), which
are then looked up in their current palette when painting. This means
that you no longer alter the background color of a widget by setting
it directly, rather you alter either its background role, or the
widget's palette.
|
|
|
|
Color themes are loaded from .ini files in /res/themes/
The theme can be switched from the "Themes" section in the system menu.
The basic mechanism is that WindowServer broadcasts a SharedBuffer with
all of the color values of the current theme. Clients receive this with
the response to their initial WindowServer::Greet handshake.
When the theme is changed, WindowServer tells everyone by sending out
an UpdateSystemTheme message with a new SharedBuffer to use.
This does feel somewhat bloated somehow, but I'm sure we can iterate on
it over time and improve things.
To get one of the theme colors, use the Color(SystemColor) constructor:
painter.fill_rect(rect, SystemColor::HoverHighlight);
Some things don't work 100% right without a reboot. Specifically, when
constructing a GWidget, it will set its own background and foreground
colors based on the current SystemColor::Window and SystemColor::Text.
The widget is then stuck with these values, and they don't update on
system theme change, only on app restart.
All in all though, this is pretty cool. Merry Christmas! :^)
|
|
|
|
I had to turn the tree nodes into RefCounted objects since it's not
possible to quick_sort() a Vector<OwnPtr<T>> at the moment.
|
|
Replace the boring list view with an awesome tree view :^)
|
|
Allow everything to be built from the top level directory with just
'make', cleaned with 'make clean', and installed with 'make
install'. Also support these in any particular subdirectory.
Specifying 'make VERBOSE=1' will print each ld/g++/etc. command as
it runs.
Kernel and early host tools (IPCCompiler, etc.) are built as
object.host.o so that they don't conflict with other things built
with the cross-compiler.
|
|
The "Invert tree" checkbox was accidentally defaulted to display true when the actual tree wasn't being inverted, causing the checkbox to say the opposite of the tree state initially. This change just brings the visual indicator in line with what the code is actually doing.
|
|
Sometimes we get empty samples in a profile. I'm not sure why that
happens, but let's just ignore them for now.
|
|
Inverting the tree turns all of the innermost stack frames into roots,
allowing them to accumulate their total sample counts with other
instances of the same frame being innermost. This is an essential
feature of any cool profiler, and now we have it. :^)
|
|
|
|
From a nice suggestion by Nagy Tibor. :^)
|
|
Only do the conversion from JSON once. This makes it much faster to do
time range filtering with the timeline widget. :^)
|
|
Saw this copy-paste mistake in the ProfileViewer Timeline video
|
|
Instead of fetching these from JSON in every paint event, we now have a
separate "SampleData" vector that can be iterated.
This optimization was made possible by profiling ProfileViewer and then
analyzing the profile with ProfileViewer! :^)
|
|
You can now select the time range you want on the profile timeline.
The tree view will update automatically as you alter the range.
Unfortunately this causes the treeview to collapse all of its nodes.
It would be nice to solve this somehow in the future so that nodes
can stay open.
|
|
Userspace stack frames are in blue, kernel stack frames in red :^)
|
|
|
|
|
|
Put the sample count into a separate column. This is so neat :^)
|
|
We were forgetting to call ProfileNode::add_child() which is how the
parent node pointer gets set. This fixes the weird looking GTreeView.
|
|
We begin with a simple treeview that shows a recorded profile.
To record and view a profile of a process with <PID>, simply do this:
$ profile <PID> on
... wait while PID does something interesting ...
$ profile <PID> off
$ cat /proc/profile > my-profile.prof
$ ProfileViewer my-profile.prof
|
|
Make the results of a "find in files" operation look a lot nicer by
presenting them in a table format, instead of in a single-column list.
Since we don't yet support rich text in table view cells, use the
marker glyphs in the system default fixed-width font to show where the
matched text begins and ends on the line we found it on. :^)
|
|
This is primarily to make it possible to pass a GMenu* where a CObject*
is expected.
|
|
Using int was a mistake. This patch changes String, StringImpl,
StringView and StringBuilder to use size_t instead of int for lengths.
Obviously a lot of code needs to change as a result of this.
|
|
Hogging "id" and "name" makes it impossible to use these as message
parameter names, which seems silly. :^)
|
|
This patch introduces code generation for the WindowServer IPC with
its clients. The client/server endpoints are defined by the two .ipc
files in Servers/WindowServer/: WindowServer.ipc and WindowClient.ipc
It now becomes significantly easier to add features and capabilities
to WindowServer since you don't have to know nearly as much about all
the intricate paths that IPC messages take between LibGUI and WSWindow.
The new system also uses significantly less IPC bandwidth since we're
now doing packed serialization instead of passing fixed-sized structs
of ~600 bytes for each message.
Some repaint coalescing optimizations are lost in this conversion and
we'll need to look at how to implement those in the new world.
The old CoreIPC::Client::Connection and CoreIPC::Server::Connection
classes are removed by this patch and replaced by use of ConnectionNG,
which will be renamed eventually.
Goodbye, old WindowServer IPC. You served us well :^)
|
|
not end.
CppLexer expected that `/*` always has `*/` at the end. This PR
fixes the issue and assumes the rest of file is a comment.
|
|
Previously it was not possible to see what each thread in a process was
up to, or how much CPU it was consuming. This patch fixes that.
SystemMonitor and "top" now show threads instead of just processes.
"ps" is gonna need some more fixing, but it at least builds for now.
Fixes #66.
|
|
This moves all of the browser networking to ProtocolServer.
|
|
|
|
Also refactor the token pair matching code a little bit to not repeat
ourselves so much. :^)
|
|
Client-side connection objects must now provide both client and server
endpoint types. When a message is received from the server side, we try
to decode it using both endpoint types and then send it to the right
place for handling.
This now makes it possible for AudioServer to send unsolicited messages
to its clients. This opens up a ton of possibilities :^)
|
|
While you are typing in HackStudio, we re-lex the C++ as you type,
so this means we also need to keep re-checking for matching curlies and
parentheses at the cursor.
Fixes #769 (although it's not optional, because it's too cool. :^)
|
|
This can just piggyback on the code I just wrote for curly braces.
|