Commit Graph

3839 Commits

Author SHA1 Message Date
Andreas Kling
fc6bd52e0d LibCore: Childify children of CLocalServer and IPC::Connection
Inspecting a "TextEditor" process with Inspector now looks awesome. :^)
2019-08-18 12:15:06 +02:00
Andreas Kling
a1a4013b1c LibGUI: Make the timers in GAbstractButton and GScrollBar into children 2019-08-18 12:14:15 +02:00
Andreas Kling
93f14966c0 WindowServer: Make WSMenu's be children of the WSClientConnection 2019-08-18 12:05:33 +02:00
Andreas Kling
8aece8f5b7 WindowServer: Make WSCompositor the parent of its timers 2019-08-18 11:59:43 +02:00
Andreas Kling
1b3599fbbc LibCore: Make CSocket's notifiers into children of the CSocket
The Inspector app quickly exposes crappy flat object hiearchies without
parent/child relationships. This is one of many commits that improves
the situation by making parent/child CObject relationships explicit.
2019-08-18 11:54:39 +02:00
Andreas Kling
9d57e7ed68 WindowServer: Tell WSWindows who their CObject parent is
Instead of using a weird "internal owner" pointer, just set the owning
object as the CObject::parent of WSWindow.
2019-08-18 11:52:19 +02:00
Andreas Kling
68e94f0a2e Inspector: Implement RemoteObjectGraphModel::parent_index()
This makes GTreeView paint the tree lines correctly. It's a bit weird
that this is needed, but straightforward to implement so meh.
2019-08-18 11:12:43 +02:00
Andreas Kling
2e4e4ad957 Inspector: Add a custom 16x16 icon to represent objects
Behold, my finest "1990's OOP cube icon" :^)
2019-08-18 10:49:38 +02:00
Andreas Kling
05cd178477 Inspector: Add a GUI tool for viewing a remote process's CObject graph
Here comes the foundation for a neat remote debugging tool.

Right now, it connects to a remote process's CEventLoop RPC socket and
retreives the remote object graph JSON dump. The remote object graph
is then reconstructed and exposed through a GModel subclass, which is
then displayed in a GTreeView.

It's pretty cool, I think. :^)
2019-08-18 10:19:13 +02:00
Andreas Kling
5c7bb09a73 GTreeView: Support multiple root-level items
Previously it was only possible to have a single root-level item in a
GTreeView. This was an oversight and I didn't realize it because this
code was only ever used in the FileManager, which has one root ("/").

Also factored out item toggling into a separate function, and increase
the base indentation level so that root items can be toggled as well.

Finally, let the user toggle the selected item with the spacebar. :^)
2019-08-18 10:17:00 +02:00
Andreas Kling
f6cb2fd2fb GModel: Have create_index() take a const void*
This is just for convenience really. It lets you skip const_casting in
all the code that calls this API, which you would basically always be
doing otherwise.
2019-08-18 10:14:53 +02:00
Andreas Kling
203612439a LibGUI: Add LogStream operator<< for GModelIndex 2019-08-18 10:14:26 +02:00
Andreas Kling
fc43cf929d LibHTML: Implement basic block height computation
..and add vertical box properties to the layout tree dumps.
2019-08-18 08:39:52 +02:00
Andreas Kling
70eca3b500 LibHTML: Finish the block width calculation
Also add horizontal box values to the layout tree dump.
2019-08-18 08:39:52 +02:00
Andreas Kling
587ddc5126 LibHTML: Fix host build and turn on ccache 2019-08-18 08:39:52 +02:00
Conrad Pankoff
b957c61e6f Kernel: Implement generic VGA device using multiboot info
This implements a very basic VGA device using the information provided
to us by the bootloader in the multiboot header. This allows Serenity to
boot to the desktop on basically any halfway modern system.
2019-08-18 07:40:53 +02:00
Conrad Pankoff
23b6ef29dd WindowServer: Detect framebuffer capabilities and settings
The main changes are twofold:

* Buffer flipping is now controlled by the m_screen_can_set_buffer flag
  in WSCompositor. This flag, in turn, is impacted by m_can_set_buffer
  flag, in WSScreen. m_can_set_buffer is set in the WSScreen constructor
  by checking the return value of fb_set_buffer. If the framebuffer
  supports this operation, it will succeed, and we record this fact. This
  information is then used by WSCompositor to set its own
  m_screen_can_set_buffer flag.

* WSScreen now only requests a resolution change of the framebuffer. The
  driver itself is ultimately responsible for what resolution or mode is
  actually set, so WSScreen has to read the response from that request,
  and has no choice but to accept the answer. This allows the driver to
  choose a "close enough" value to what was requested, or simply ignore
  it.

The result of this is that there is no special configuration necessary
for WindowServer to work with reduced-capability framebuffer devices.
2019-08-18 07:40:02 +02:00
Conrad Pankoff
3932dfbb04 Kernel: Implement generic framebuffer ioctls in BXVGA
This also hides some functions that were previously public, since that
same functionality is now exposed via ioctl functions.
2019-08-18 07:40:02 +02:00
Conrad Pankoff
5e46122a82 Kernel: Add framebuffer ioctls; wrap raw ioctls with a C API 2019-08-18 07:40:02 +02:00
Conrad Pankoff
1868523e00 LibC: Move duplicated winsize struct definition into ioctl_numbers.h 2019-08-18 07:40:02 +02:00
Conrad Pankoff
879bc28e14 Kernel: Disable VGA console in graphical mode 2019-08-18 07:37:12 +02:00
Conrad Pankoff
36e3e7b75a Shell: Support forward delete 2019-08-18 07:36:23 +02:00
Andreas Kling
266b9cb654 LibC: Fix strtol() not populating `endptr' for valid strings
We were not writing anything out to the `endptr` pointer if a number
was successfully parsed from the input string.

Fixes #460.
2019-08-17 22:07:48 +02:00
Andreas Kling
a20f3c6647 Meta: Add some more notes to the contribution guidelines 2019-08-17 21:45:06 +02:00
Andreas Kling
272bd1d3ef Kernel: Make crash dumps look aligned once again
This broke with the recent changes to make printf hex fields behave
a bit more correctly.
2019-08-17 21:29:46 +02:00
Jesse
ad909e7c3f FloppyDiskDevice: Fixed hang on wait_for_irq() (#458)
It turns out that the `SenseInterrupt` command is actually
very important! The system hangs if it's not there! Whoops...!
2019-08-17 16:26:53 +02:00
Andreas Kling
8a91b90258 GTableView: Fix column resize cursor not showing up in scrolled tables
If the table was scrolled somewhat, we'd stop showing the resize cursor
when hovering the mouse cursor between two table column headers.
2019-08-17 15:01:45 +02:00
Andreas Kling
8031960541 GTableView: Fix row selection when clicking between two cells
We should still select the entire row when you click between two cells.
2019-08-17 14:56:53 +02:00
Andreas Kling
5f6b6c1665 Kernel: Do the umount() by the guest's root inode identifier
It was previously possible to unmount a filesystem mounted on /mnt by
doing e.g "umount /mnt/some/path".
2019-08-17 14:28:13 +02:00
Andreas Kling
c029f39895 SystemServer: Don't spawn a TTYServer on on /dev/tty0
tty0 receives input while WindowServer is up, which meant that having
a shell on tty0 would cause commands typed into Terminal to run twice,
once in Terminal's shell, and once on the tty0 shell.

Long term we shouldn't send input to any VirtualConsole while the
WindowServer is up, so this just fixes the immediate weirdness. :^)
2019-08-17 14:19:18 +02:00
Andreas Kling
da7ae52eee Ext2FS: Clean up prepare_to_unmount() a little bit 2019-08-17 13:49:37 +02:00
Sergey Bugaev
6778abb999 Kernel+SystemServer: Mount filesystems and start TTYServer in userspace 2019-08-17 12:07:55 +02:00
Sergey Bugaev
f95c264f17 Meta: Fix .gitignore excluding files under Base/ 2019-08-17 12:07:55 +02:00
Sergey Bugaev
9dfcbc58ec Userland: Reimplement the mount command
This new version can do three things:

* When invoked as `mount`, it will print out a list of mounted filesystem,
* When invoked as `mount -a`, it will try to mount filesystems
  listed in /etc/fstab,
* When invoked as `mount device mountpoint -t fstype`, it will mount that
  device on that mountpoint. If not specified, fstype defaults to ext2.
2019-08-17 12:07:55 +02:00
Sergey Bugaev
e0e1be8c33 LibCore: Fix a crash in CArgsParser 2019-08-17 12:07:55 +02:00
Sergey Bugaev
bec646c0bb LibC: Implement wait()
This is a simple convenience wrapper over waitpid().
2019-08-17 12:07:55 +02:00
Sergey Bugaev
fde8f7f538 Kernel: Expose info about source devices of mounts in /proc/df 2019-08-17 12:07:55 +02:00
Sergey Bugaev
425c356288 Kernel+LibC+Userland: Support mounting other kinds of filesystems 2019-08-17 12:07:55 +02:00
Sergey Bugaev
66a0a12435 DevPtsFS: Do not assume there is one of it
Unfortunately, that also means it can no longer inherit from SynthFS.
2019-08-17 12:07:55 +02:00
Sergey Bugaev
37cc80fb96 ProcFS: Do not assume there is one of it
The complication is around /proc/sys/ variables, which were attached
to inodes. Now they're their own thing, and the corresponding inodes
are lazily created (as all other ProcFS inodes are) and simply refer
to them by index.
2019-08-17 12:07:55 +02:00
Andreas Kling
1febd59f83 LibCore+rpcdump: Publish CObject graph to on-demand RPC socket
All programs that have a CEventLoop now allow local socket connections
via /tmp/rpc.PID and will dump a serialized JSON array of all the live
CObjects in the program onto connecting sockets.

Also added a small /bin/rpcdump tool that connects to an RPC socket and
produces a raw dump of the JSON that comes out.
2019-08-17 11:39:26 +02:00
Andreas Kling
2fa2d72761 CObject: Put all CObjects on a global IntrusiveList for introspection
This will allow us to easily traverse the entire CObject graph.
2019-08-17 11:26:19 +02:00
Andreas Kling
e3f3c980bf IntrusiveList: Make Iterator::operator* return a T&
This makes iteration a little more pleasant :^)
2019-08-17 11:25:32 +02:00
Andreas Kling
6b81d8de70 DevTools: Add CLocalServer to the host-side tool build dependencies 2019-08-17 11:08:10 +02:00
Andreas Kling
7127c4fdbb LibCore: CIODevice::set_error() is meant to be called with the 'errno'
The point of this function is to stash away the innermost error code
so that we don't lose it by the time we get back to the client code.
2019-08-17 11:07:15 +02:00
Andreas Kling
910fab564e LocalSocket: Make recvfrom() return 0 to signal EOF when peer is gone
Once the peer has disconnected, recvfrom() should always return 0 once
the socket buffer has been drained.
2019-08-17 11:04:45 +02:00
Andreas Kling
17670ae725 Meta: Fix up clean builds
This is kind of a mess, but because IPC client code depending on the
IPC protocol definition artifacts in the server code, we have to build
the IPC servers first. And their dependencies before that, etc.

One more drop in the "maybe we should switch to CMake" bucket..
2019-08-17 10:05:16 +02:00
Conrad Pankoff
d0117744ab Meta: Rearrange makeall.sh for more consistent builds
makeall.sh used to build the AK tests and leave some binary objects laying
around that would get in the way of further incremental builds. There also
wasn't a lot of structure to the order things were built in. This patch
improves both of those things.
2019-08-17 09:31:35 +02:00
Jesse Buhagiar
bc22456f89 Kernel: Added unmount ability to VFS
It is now possible to unmount file systems from the VFS via `umount`.
It works via looking up the `fsid` of the filesystem from the `Inode`'s
metatdata so I'm not sure how fragile it is. It seems to work for now
though as something to get us going.
2019-08-17 09:29:54 +02:00
Andreas Kling
f7251c74a9 WindowServer: Let's run without buffer flipping by default
Instead of having a special mode that we only use in QEMU, let's bring
ourselves closer to real hardware by not relying on the QEMU VGA card.
2019-08-16 17:07:40 +02:00