Commit graph

917 commits

Author SHA1 Message Date
Andreas Kling
887b4a7a1a Start working on a simple Launcher app.
Let GButton have an optional icon (GraphicsBitmap) that gets rendered in the
middle of the button if present.

Also add GraphicsBitmap::load_from_file() which allows mmap'ed RGBA32 files.
I wrote a little program to take "raw" files from GIMP and swizzle them into
the correct byte order.
2019-02-07 23:17:06 +01:00
Andreas Kling
71b9ec1ae0 Kernel: Add basic process priority support.
For now, the WindowServer process will run with high priority,
while the Finalizer process will run with low priority.
Everyone else gets to be "normal".

At the moment, priority simply determines the size of your time slices.
2019-02-07 12:21:17 +01:00
Andreas Kling
ee2bb98b88 Kernel: Increase default time slice to 20ms. 2019-02-07 11:53:45 +01:00
Andreas Kling
dc7f257c01 Kernel: Remove a bunch of unnecessary InterruptDisablers. 2019-02-07 11:24:09 +01:00
Andreas Kling
5582a0a254 Kernel: When a lock is busy, donate remaining process ticks to lock holder.
Since we know who's holding the lock, and we're gonna have to yield anyway,
we can just ask the scheduler to donate any remaining ticks to that process.
2019-02-07 11:14:58 +01:00
Andreas Kling
4df92709c8 Kernel: Add proper locking to SynthFS and stop disabling interrupts. 2019-02-07 10:47:11 +01:00
Andreas Kling
b5e5541cbc Kernel: Remove an unnecessary InterruptDisabler in SynthFS. 2019-02-07 10:42:00 +01:00
Andreas Kling
3fc3a8d7bc Kernel: Remove some unnecessary zero initialization now that BSS is cleared. 2019-02-07 10:31:32 +01:00
Andreas Kling
2e663eda36 Kernel: Don't disable interrupts to access the system hostname. 2019-02-07 10:29:26 +01:00
Andreas Kling
458706c4cf Kernel: Let's try disabling the CPU's page-level caching for framebuffers. 2019-02-07 09:24:41 +01:00
Andreas Kling
44e1a45b2a AK: Optimize Vector::append(Vector&&) for case where this->m_impl is null. 2019-02-07 09:09:30 +01:00
Andreas Kling
443d1c2237 WindowServer: Coordinate double-buffering with the BochsVGA card.
Use the BochsVGA card's virtual-height + virtual-y features to implement
a "hardware double buffering" type scheme.

This is a performance degradation since we now draw a bunch more than before.
But there's also no tearing or cursor flickering. I'm gonna commit this and
try to improve upon it. :^)
2019-02-07 08:56:26 +01:00
Andreas Kling
1f159eaab0 Add a fast memcpy() using MMX when we're moving >= 1KB.
This is a nice speedup for WindowServer. I'll eventually have to do this
with SSE but the kernel doesn't support SSE yet so this is it for now.
2019-02-07 08:46:52 +01:00
Andreas Kling
e29060620f WindowServer: Improve parsing of mouse packets. 2019-02-07 08:08:08 +01:00
Andreas Kling
a537d78ac0 Kernel: Drivers for PS/2 mouse and keyboard kept stealing from each other.
We need to look at the i8042 status register to see if the packets in the
PS/2 controller's output buffer are mouse or keyboard packets.

This fixes occasionally surprising inputs while using both devices.
2019-02-07 07:58:26 +01:00
Andreas Kling
26f4301521 Kernel: Stop spamming the kernel log buffer when loading ksyms. 2019-02-06 18:52:12 +01:00
Andreas Kling
6cba80510e Kernel: Add a Finalizer process to take care of dying processes.
Instead of processes themselves getting scheduled to finish dying,
let's have a Finalizer process that wakes up whenever someone is dying.
This way we can do all kinds of lock-taking in process cleanup without
risking reentering the scheduler.
2019-02-06 18:45:21 +01:00
Andreas Kling
e05237485c Kernel: Various stability improvements.
- Don't cli() in Process::do_exec() unless current is execing.
  Eventually this should go away once the scheduler is less retarded
  in the face of interrupts.

- Improved memory access validation for ring0 processes.
  We now look at the kernel ELF header to determine if an access
  is appropriate. :^) It's very hackish but also kinda neat.

- Have Process::die() put the process into a new "Dying" state where
  it can still get scheduled but no signals will be dispatched.
  This way we can keep executing in die() but won't get our EIP
  hijacked by signal dispatch. The main problem here was that die()
  wanted to take various locks.
2019-02-06 17:34:27 +01:00
Andreas Kling
03c0e836f0 Kernel: Fix some broken debugging code in VFS. 2019-02-06 17:34:27 +01:00
Andreas Kling
d0b2949b4d AK: Lock should ASSERT_INTERRUPTS_ENABLED().
Trying to take a Lock while interrupts are disabled is always a bug.
2019-02-06 17:34:24 +01:00
Andreas Kling
a1b63bb6d4 Bootloader: Locate the kernel's data segment and clear it.
This was a constant source of stupid bugs and I kept postponing it because
I wasn't in the mood to write assembly code. Until now! :^)
2019-02-06 16:02:10 +01:00
Andreas Kling
781f216676 AK: Add a TemporaryChange helper class. 2019-02-06 16:01:59 +01:00
Andreas Kling
8cc6e304ca Kernel: Clean up around Scheduler::yield() a bit.
Also add assertion in Lock that the scheduler isn't currently active.
I've been seeing occasional fuckups that I suspect might be someone called
by the scheduler trying to take a busy lock.
2019-02-06 15:06:48 +01:00
Andreas Kling
27263b6172 Clean up LDFLAGS a bit.
While working on the ELF loader I was trying to keep binaries as simple as
possible so I could understand them easily. Now that the ELF loader is mature
and working fine, we can move closer towards ld defaults.
2019-02-06 14:48:09 +01:00
Andreas Kling
353b191a49 Clean up some uninteresting log spam. 2019-02-06 11:32:23 +01:00
Andreas Kling
39c3b117c9 SharedGraphics: Fix broken rendering of partially clipped GlyphBitmaps. 2019-02-06 10:39:24 +01:00
Andreas Kling
b3b28b8b15 Kernel: Add /proc/pci so we can see what's on the PCI bus. 2019-02-06 10:29:35 +01:00
Andreas Kling
731fc5a7c8 Kernel: Much improved BochsVGA (BXVGA) support.
Instead of cowboy-calling the VESA BIOS in the bootloader, find the emulator
VGA adapter by scanning the PCI bus. Then set up the desired video mode by
sending device commands.
2019-02-06 10:17:26 +01:00
Andreas Kling
e9f6508ada Remove some unused files. 2019-02-05 15:36:26 +01:00
Andreas Kling
ddb13ae6d8 LibC: Add some integer functionality needed for NASM. 2019-02-05 13:38:32 +01:00
Andreas Kling
caff611ca3 WindowServer: Tweak window title bar look. 2019-02-05 13:20:36 +01:00
Andreas Kling
0669ef8977 Kernel: Writing to a slave PTY should yield EIO if the master is closed. 2019-02-05 13:09:01 +01:00
Andreas Kling
2a0700af9a Kernel: Closing a MasterPTY should generate a TTY hangup. 2019-02-05 12:55:19 +01:00
Andreas Kling
378e20c535 Kernel: Reading from a slave PTY should give EOF if master PTY is closed. 2019-02-05 12:27:32 +01:00
Andreas Kling
3accdb0e93 Handle WindowCloseRequest in FontEditor and /bin/guitest. 2019-02-05 12:07:06 +01:00
Andreas Kling
0a183df655 WindowServer: Tweak look of window close button. 2019-02-05 12:01:47 +01:00
Andreas Kling
0f15093e96 LizaRegular8x10: Tweak some glyphs. 2019-02-05 11:53:06 +01:00
Andreas Kling
38f589a9cb SharedGraphics: Add some useful painting helpers and make use of them. 2019-02-05 11:42:58 +01:00
Andreas Kling
b782055b96 Kernel: Add an InterruptFlagSaver helper class.
This is useful instead of InterruptDisabler in some cases.
2019-02-05 11:14:09 +01:00
Andreas Kling
cd1bbdf052 WindowServer: Make the window close button look a bit nicer. 2019-02-05 11:05:24 +01:00
Andreas Kling
11db8c1697 Add a simple close button ("X") to windows.
Clicking the button generates a WindowCloseRequest event which the client app
then has to deal with. The default behavior for GWindow is to close() itself.

I also added a flag, GWindow::should_exit_event_loop_on_close() which does
what it sounds like it does.

This patch exposed some bugs in GWindow and GWidget teardown.
2019-02-05 10:31:37 +01:00
Andreas Kling
d0078b6574 Clock: Turns the clock window from guitest2 into a separate program.
We can't not have a desktop clock app. :^)
2019-02-05 09:44:13 +01:00
Andreas Kling
41567c5bb9 Show the amount of memory in GraphicsBitmaps in /bin/top.
This seems like an extremely relevant metric to track.
2019-02-05 09:27:27 +01:00
Andreas Kling
b1e054ffe8 Rename LizaBold to LizaRegular and LizaBlack to LizaBold.
LizaRegular is quickly becoming my favorite bitmap font. It's so pretty :^)
2019-02-05 09:08:25 +01:00
Andreas Kling
0c38a4c30f WindowServer: Sever the WSWindow/Process link when the process dies.
This fixes a deadlock where the WindowServer would get stuck trying to
acquire a dead process's event stream lock.
2019-02-05 08:32:32 +01:00
Andreas Kling
ca16d9d98e Kernel: Invalidate file-backed VMO's when inodes are written.
The current strategy is simply to nuke all physical pages and force
reload them from disk. This is obviously not optimal and should eventually
be optimized. It should be fairly straightforward.
2019-02-05 08:17:46 +01:00
Andreas Kling
af21a45b1a FontEditor: Allow specifying which font to edit on the command line.
Also add a quit button. The quit button has a tendency to freeze the kernel.
That doesn't seem entirely right.
2019-02-05 07:23:01 +01:00
Andreas Kling
d459525725 AK: Vector::data() shouldn't crash if the vector is empty.
It's up to the caller to check size() and stay within the bounds.
2019-02-05 07:12:45 +01:00
Andreas Kling
a32b33621f LizaBlack8x10: Tweak some glyphs. 2019-02-05 07:12:25 +01:00
Andreas Kling
a258d6507a mmap all the font files!
Font now uses the same in-memory format as the font files we have on disk.
This allows us to simply mmap() the font files and not use any additional
memory for them. Very cool! :^)

Hacking on this exposed a bug in file-backed VMObjects where the first client
to instantiate a VMObject for a specific inode also got to decide its size.
Since file-backed VMObjects always have the same size as the underlying file,
this made no sense, so I removed the ability to even set a size in that case.
2019-02-05 06:43:33 +01:00