Commit Graph

22571 Commits

Author SHA1 Message Date
Tom
8fe52b8306 Meta: Force relative mouse coordinates with multiple screens
QEMU appears to always relay absolute mouse coordinates relative to the
screen that the mouse is pointed to, without any way for us to know
what screen it was. So, when dealing with multiple displays force using
relative coordinates only.
2021-06-25 23:54:37 +02:00
Linus Groh
a59ba0e21f LibJS: Change PropertyName(i32) => template<Integral T> PropertyName(T)
Negative numeric properties are not a thing (and we even VERIFY()'d this
in the constructor). It still allows using types with a negative range
for now as we have various places using int for example (without
actually needing the negative range, but that's a different story).

u32 is the internal type of `m_number` already, so this now allows us to
leverage the full u32 range for numeric properties.
2021-06-25 22:01:23 +01:00
Linus Groh
f4867572b7 LibJS: Change PropertyName(Symbol*) => PropertyName(Symbol&)
Requires a bunch of find-and-replace updates across LibJS, but
constructing a PropertyName from a nullptr Symbol* should not be
possible - let's enforce this at the compiler level instead of using
VERIFY() (and already dereference Symbol pointers at the call site).
2021-06-25 22:01:23 +01:00
Tom
3d5340d033 Meta: Add SERENITY_SCREENS environment variable
This allows specifying how many screens we should use. This also then
only enables virtio-gpu if more than one display is requested.

This also adds an environment variable SERENITY_QEMU_DISPLAY_BACKEND
which allows overriding the default qemu display backend, as it may
not be available.
2021-06-25 22:20:55 +02:00
Andreas Kling
d436d6d565 LibJS: Rename ScriptFunction::m_parent_scope => m_environment
This is for the [[Environment]] slot so let's have a matching name. :^)
2021-06-25 21:22:37 +02:00
Andreas Kling
667bba2410 LibJS: Add the Function.[[ThisMode]] field
This is not a behavioral change in itself, just prep work for future
spec-compliance changes.
2021-06-25 21:15:04 +02:00
Andreas Kling
b650d11dd3 LibJS: FunctionEnvironment.[[FunctionObject]] is the *invoked* function
We were setting the wrong [[FunctionObject]] on the environment when
going through ProxyObject and BoundFunction.
2021-06-25 20:38:43 +02:00
Andreas Kling
08d2ea3fac LibJS: Rename the context in Call/Construct ops to "callee context"
This matches what the spec calls them.
2021-06-25 20:38:43 +02:00
Andreas Kling
06787410ad LibJS: Make assertion in BindThisValue mirror the spec exactly :^) 2021-06-25 20:38:43 +02:00
Tom
8cfb4c82f0 WindowServer: Change rendering drag&drop to use the Overlay class
This enables flicker-free rendering.
2021-06-25 20:38:13 +02:00
Tom
84cab29c59 WindowServer: Change window geometry label to use the Overlay class
This enables flicker-free rendering.
2021-06-25 20:38:13 +02:00
Tom
8b26debda1 DisplaySettings: Show screen numbers when showing the Monitors tab
This will be helpful once we allow the user to rearrange the displays.
2021-06-25 20:38:13 +02:00
Tom
41859ad3fe WindowServer: Add an Overlay class for flicker-free overlay rendering
An Overlay is similar to a transparent window, but has less overhead
and does not get rendered within the window stack. Basically, the area
that an Overlay occupies forces transparency rendering for any window
underneath, which allows us to render them flicker-free.

This also adds a new API that allows displaying the screen numbers,
e.g. while the user configures the screen layout in DisplaySettings

Because other things like drag&drop or the window-size label are not
yet converted to use this new mechanism, they will be drawn over the
screen-number currently.
2021-06-25 20:38:13 +02:00
Tom
42cb38b71a WindowServer: Enhance simple shadow function to include optional frame
If the shadow bitmap contains portions of the frame then we need to
slightly tweak the logic dealing with very small width and/or height.
2021-06-25 20:38:13 +02:00
Sahan Fernando
b9ad6058aa Kernel: Add VirtIOGPU graphics device 2021-06-25 19:26:30 +02:00
Sahan Fernando
b569b2df35 Kernel: Don't clear VirtualConsoles when initializing
Instead of calling clear() for each virtual console we initialize, we
only call clear() when activating it from ConsoleManagement.
2021-06-25 19:26:30 +02:00
Sahan Fernando
bab6fb76b7 WindowServer: Redraw screen when switching back from tty 2021-06-25 19:26:30 +02:00
Sahan Fernando
ae5d961d97 Kernel: Pass TTY-switch keyboard combo to userspace 2021-06-25 19:26:30 +02:00
Sahan Fernando
4f53e52ca3 Kernel: Fix use after AK::move in Kernel::TimerQueue 2021-06-25 19:26:30 +02:00
Sahan Fernando
974e996d33 Userland: Add FB_FLUSH ioctl for fbdev 2021-06-25 19:26:30 +02:00
Sahan Fernando
34e9fa4d3b Kernel: Abstract FramebufferConsole away from contiguous physical range
Currently, Kernel::Graphics::FramebufferConsole is written assuming that
the underlying framebuffer memory exists in physically contiguous
memory. There are a bunch of framebuffer devices that would need to use
the components of FramebufferConsole (in particular access to the kernel
bitmap font rendering logic). To reduce code duplication, framebuffer
console has been split into two parts, the abstract
GenericFramebufferConsole class which does the rendering, and the
ContiguousFramebufferConsole class which contains all logic related to
managing the underling vm object.

Also, a new flush method has been added to the class, to support devices
that require an extra flush step to render.
2021-06-25 19:26:30 +02:00
Sahan Fernando
cf1c8eb778 Kernel: Add Scheduler::is_initialized 2021-06-25 19:26:30 +02:00
Sam Atkins
8e9fb3766d FileManager: Add "Open in New Window" context menu action 2021-06-25 19:19:57 +02:00
Itamar
e16c24bb95 HackStudio: Do not create a new LanguageClient unless needed
Previously, whenever Editor::set_document() was called, we destroyed
the previous LanguageClient instance of the editor and created a new
one.

We now check if the language of the existing LanguageClient matches the
new document, and if so we do not create a new LanguageClient instance.

This fixes an issue where doing "goto definition" would crash
HackStudio. This was probably introduced in 44418cb351.

The crash occurred because when doing "goto definition", we called a
AK::Function callback from the LanguageClient, which internally called
Editor::set_document().

Editor::set_document() destroyed the existing LanguageClient, which
cased a VERIFY in Function::clear() to fail because we were trying to
destroy the AK::Function object while executing inside it.
2021-06-25 18:58:34 +02:00
Itamar
7331b74731 LibGUI: Add TextEditor::has_document() 2021-06-25 18:58:34 +02:00
Itamar
743157348d HackStudio: Add LanguageClient::Language() getter 2021-06-25 18:58:34 +02:00
Itamar
eecbcff6af AK: Add NOTE about VERIFY in Function::clear 2021-06-25 18:58:34 +02:00
kleines Filmröllchen
22d7e57955 LibAudio: Implement a basic FLAC loader
This commit adds a loader for the FLAC audio codec, the Free Lossless
Audio codec by the Xiph.Org foundation. LibAudio will automatically
read and parse FLAC files, so users do not need to adjust.

This implementation is bare-bones and needs to be improved upon.
There are many bugs, verbatim subframes and any kind of seeking is
not supported. However, stereo files exported by libavcodec on
highest compression setting seem to work well.
2021-06-25 20:48:14 +04:30
kleines Filmröllchen
184a9e7e67 LibAudio: Make ResampleHelper templated for different sample types
Previously, ResampleHelper was fixed on handling double's, which makes
it unsuitable for the upcoming FLAC loader that needs to resample
integers. For this reason, ResampleHelper is templated to support
theoretically any type of sample, though only the necessary i32 and
double are templated right now.

The ResampleHelper implementations are moved from WavLoader.cpp to
Buffer.cpp.

This also improves some imports in the WavLoader files.
2021-06-25 20:48:14 +04:30
kleines Filmröllchen
2e00155275 AudioServer: Make AudioServer boot in text mode
This way, we can have Audio on the console :^)
2021-06-25 20:48:14 +04:30
kleines Filmröllchen
488de12ed4 LibAudio: Make LoaderPlugin::error_string return String&
Previously, error_string() returned char* which is bad Serenity style
and caused issues when other error handling methods were tried. As both
WavLoader and (future) FLAC loader store a String internally for the
error message, it makes sense to return a String reference instead.
2021-06-25 20:48:14 +04:30
kleines Filmröllchen
d599a14545 LibAudio: Add the Int32 sample format
The signed 32-bit PCM sample format is required for the FLAC standard.
2021-06-25 20:48:14 +04:30
kleines Filmröllchen
9d4c50ca60 AK: Add big endian bit reading to InputBitStream
The existing InputBitStream methods only read in little endian, as this
is what the rest of the system requires. Two new methods allow the input
bitstream to read bits in big endian as well, while using the existing
state infrastructure.

Note that it can lead to issues if little endian and big endian reads
are used out of order without aligning to a byte boundary first.
2021-06-25 20:48:14 +04:30
kleines Filmröllchen
463a645d37 LibCore: Add InputFileStream::seek
As a file is able to seek(), InputFileStreams can delegate the seek()
easily. This allows for seeking to specific locations in the file.
2021-06-25 20:48:14 +04:30
kleines Filmröllchen
988763c0ef Toolchain: Add the AFLACLOADER_DEBUG macro
This enables FLAC debugging output, which is used
with the new FLAC loader introduced in later commits.
2021-06-25 20:48:14 +04:30
Andreas Kling
57214268dd LibJS: Make sure to always initialize Reference::m_base_value 2021-06-25 17:25:55 +02:00
Andreas Kling
7b28fa99ba LibJS: Rename Reference methods to match the spec
- get -> get_value (GetValue in the spec)
- put -> put_value (PutValue in the spec)

Also add spec links. :^)
2021-06-25 17:20:23 +02:00
Andreas Kling
bce7fdba81 LibJS: Bring Reference records a bit closer to the ECMAScript spec
Our Reference class now has the same fields as the spec:

- Base (a non-nullish value, an environment record, or `unresolvable`)
- Referenced Name (the name of the binding)
- Strict (whether the reference originated in strict mode code)
- ThisValue (if non-empty, the reference represents a `super` keyword)

The main difference from before is that we now resolve the environment
record that a reference interacts with. Previously we simply resolved
to either "local variable" or "global variable".

The associated abstract operations are still largely non-conforming,
since we don't yet implement proper variable bindings. But this patch
should at least fix a handful of test262 cases. :^)

There's one minor regression: some TypeError message strings get
a little worse due to doing a RequireObjectCoercible earlier in the
evaluation of MemberExpression.
2021-06-25 16:58:36 +02:00
Andreas Kling
6e1932e8b2 LibJS: Evaluate this in terms of ResolveThisBinding 2021-06-25 16:58:36 +02:00
Andreas Kling
92ce4ac23f LibJS: Remove outdated FIXME in GetThisEnvironment 2021-06-25 16:58:36 +02:00
Andreas Kling
07acdc7be2 LibJS: Rename VM::get_reference() => resolve_binding()
This function maps to the ResolveBinding operation from the spec,
so let's rename it to match.
2021-06-25 16:58:36 +02:00
Alexander
2b4cab284c Kernel/AHCI: Dont assume ports start at 0
This fixes a bug that occurs when the controller's ports are not
(internally) numbered sequentially.
This is done by checking the bits set in PI.
This bug was found on bare-metal, on a laptop with 1 Port that
was reported as port 4.
2021-06-25 16:27:01 +02:00
Alexander
e9b7d58d10 Kernel/AHCI: Fix shift of 1
This makes the 1 in the shift unsigned.
This also changes the is_set_at parameter to be a u8.
2021-06-25 16:27:01 +02:00
Gunnar Beutner
f17b4e561f Meta: Increase RAM amount for Bochs
Booting with 128 MB of RAM is kind of tough.
2021-06-25 15:19:09 +02:00
Gunnar Beutner
c9747a3236 Kernel: Build the x86_64 kernel as an ELF32 executable
Multiboot only supports ELF32 executables. This changes the build
process to build an ELF32 executable which has a 32-bit entry point,
but consists of mostly 64-bit code.
2021-06-25 15:19:09 +02:00
Gunnar Beutner
04ba5cfcad Kernel: Ensure that the Multiboot header is placed into the first 8kB
The Multiboot header must be within the first 8kB of the executable
for it to be picked up by QEMU, GRUB and other multiboot-capable
boot loaders.
2021-06-25 15:19:09 +02:00
Gunnar Beutner
4c555684b7 Kernel: Set an appropriate GDT for 64-bit mode 2021-06-25 15:19:09 +02:00
Gunnar Beutner
d84abe51f5 Kernel: Use PML4T for 64-bit mode 2021-06-25 15:19:09 +02:00
Gunnar Beutner
13e4093da4 Kernel: Move Multiboot header into a separate file 2021-06-25 15:19:09 +02:00
Gunnar Beutner
19c0498ccc Kernel: Update the x86_64 boot code to match i386's code 2021-06-25 15:19:09 +02:00