Commit graph

7430 commits

Author SHA1 Message Date
Andreas Kling
b98d8ad5b0 AK: Add a Conditional<condition, TrueType, FalseType> template
This allows you to select a type based on a compile-time condition.
2020-03-08 13:06:51 +01:00
howar6hill
10e0d4a196
LibCore: Add format option for DateTime::to_string() (#1358) 2020-03-08 11:35:26 +01:00
0xtechnobabble
b6307beb6e LibJS: Implement if statements
If statements execute a certain action or an alternative one depending
on whether the tested condition is true or false, this commit helps
establish basic control flow capabilities in the AST.
2020-03-08 11:15:07 +01:00
0xtechnobabble
a96bf2c22e LibJS: Implement logical expressions
Logical expressions are expressions which can return either true or
false according to a provided condition.
2020-03-08 11:15:07 +01:00
0xtechnobabble
4e62dcd6e6 LibJS: Add typed comparison operator
The `===` operator allows us to compare two values while taking their
type into consideration.
2020-03-08 11:15:07 +01:00
0xtechnobabble
3fb0ff102c LibJS: Allow the dumping of literals that aren't numbers 2020-03-08 11:15:07 +01:00
Tibor Nagy
0d17e3bfa6 LibGUI: Fix null-termination of TextDocumentLine 2020-03-08 10:31:48 +01:00
Andreas Kling
0c7058aaa0 LibJS: Include the operator in BinaryExpression dumps 2020-03-07 23:17:07 +01:00
Andreas Kling
1611071ac7 LibJS: Flesh out JS::Value a little bit more 2020-03-07 23:17:07 +01:00
Andreas Kling
d52130836e LibJS: Simplify LogStream::operator<<(JS::Value) and move to .cpp file 2020-03-07 23:17:07 +01:00
Elisée Maurer
cbe0053a97 LibJS: Fix string representation for value of type undefined 2020-03-07 23:15:36 +01:00
Andreas Kling
f5476be702 LibJS: Start building a JavaScript engine for SerenityOS :^)
I always tell people to start building things by working on the thing
that seems the most interesting right now. The most interesting thing
here was an AST + simple interpreter, so that's where we start!

There is no lexer or parser yet, we build an AST directly and then
execute it in the interpreter, producing a return value.

This seems like the start of something interesting. :^)
2020-03-07 19:42:11 +01:00
Andreas Kling
f2f16e1c24 IPv4: Keep IPv4 socket locked during receive operations
We unlock/relock around blocking, but outside of that we now keep the
socket locked.

This fixes an intermittent ASSERT(m_can_read) failure.
2020-03-07 11:27:55 +01:00
Andreas Kling
7a9cb2dfca LibWeb: Cache the <body background> style image value
This way we don't refetch the background image every time style is
recomputed (e.g when hovering different elements.)
2020-03-07 11:17:18 +01:00
Andreas Kling
8f25dbf394 Shell: Fix silly stack overflow in 'cd' builtin
Let's write in C++ and we won't have as many C problems. :^)
2020-03-07 11:02:11 +01:00
Andreas Kling
830a57c6b2 LibWeb: Rename directory LibHTML => LibWeb
Let's rename this to LibWeb since it aims to provide more parts of the
web platform than just HTML. :^)
2020-03-07 10:32:51 +01:00
Andreas Kling
7a6c4a72d5 LibWeb: Move everything into the Web namespace 2020-03-07 10:27:02 +01:00
Shannon Booth
6a3b12664a LibGUI: Move Icon and FontDatabase into the GUI namespace
We also clean up some old references to the old G prefixed GUI classes

This also fixes a potential bug with using: C_OBJECT_ABSTRACT(GAbstractButton)
instead of C_OBJECT_ABSTRACT(AbstractButton)
2020-03-07 01:33:53 +01:00
Shannon Booth
57f1c919df LibCore: Remove all remaining C prefix references
LibCore's GZip is also moved into the Core namespace with this change.
2020-03-07 01:33:53 +01:00
Andreas Kling
4a271430f8 Shell: Set up the PWD environment variable early
This ensures that PWD is set when running "sh -c something"
2020-03-07 00:25:30 +01:00
Shannon Booth
d7cfe61fe4 Userland: Use ArgsParser in crash 2020-03-06 22:46:17 +01:00
Liav A
f3f8b88d8f Kernel: Fix syntax error in FIFO_DEBUG 2020-03-06 22:29:24 +01:00
Tibor Nagy
30152b6c88 Kernel: Fix syntax errors in PS2MOUSE_DEBUG
Found with Cppcheck.
2020-03-06 22:20:53 +01:00
rhin123
72ef3e529a TerminalWidget: Implement ALT selection
When holding ALT & selecting text, the terminal now forms a rectangle
selection similar to other terminal behaviors.
2020-03-06 20:20:02 +01:00
howar6hill
4ba206b7e5 LibC: Fix a indentation problem in time.cpp 2020-03-06 20:15:07 +01:00
Liav A
a6c53cadc8 Meta: Claim copyright on PCI files 2020-03-06 16:03:58 +01:00
Liav A
9991a36d1a CPU: Prevent leakage of virtual addresses to kernel log 2020-03-06 15:57:19 +01:00
Liav A
5cbde297ec Meta: Claim copyright on ACPI files 2020-03-06 15:56:51 +01:00
Andreas Kling
c6693f9b3a Kernel: Simplify a bunch of dbg() and klog() calls
LogStream can handle VirtualAddress and PhysicalAddress directly.
2020-03-06 15:00:44 +01:00
Andreas Kling
b866582d98 AK: Fix all the warnings in the AK tests 2020-03-06 11:22:23 +01:00
Andreas Kling
75a6b27f73 Ext2FS: Remove unused allocate_block()
We only use allocate_blocks() now. If you want a single block, you can
just call allocate_blocks() with a count of 1.
2020-03-06 11:22:23 +01:00
Liav A
259ead5d7a Userland: Replace lsinterrupts with lsirq
Also, lsirq will return more useful data than lsinterrupts did
2020-03-06 11:19:51 +01:00
Liav A
e2889e665f Kernel: Shorten the model name of i8529 PIC class 2020-03-06 11:19:51 +01:00
Liav A
7ef5d222f1 Kernel: Change data in /proc/interrupts to be more richer
Also, during interrupt handlers' enumeration, we call all interrupts
handlers that are not UnhandledInterruptHandler.
2020-03-06 11:19:51 +01:00
Liav A
773afefe7c Kernel: Change HandlerPurpose to HandlerType
Also, GenericInterruptHandler class requires to implement two new
methods.
2020-03-06 11:19:51 +01:00
Andreas Kling
52954ccce6 LibC: Fix crash in free() now that mprotect() works correctly
After we mprotect(PROT_NONE) an allocation block, we can't expect to
read the m_size from that block right after. :^)
2020-03-06 10:52:36 +01:00
Andreas Kling
2709116334 Kernel: Fix strange looking output on unhandled page fault 2020-03-06 10:41:08 +01:00
Andreas Kling
8bb361889c AK: Remove Optional::operator bool()
This was causing some obvious-in-hindsight but hard to spot bugs where
we'd implicitly convert the bool to an integer type and carry on with
the number 1 instead of the actual value().
2020-03-06 10:32:58 +01:00
howar6hill
ae233c1e82 LibC: Implement time formatting functions, partially support timezone
Also fix a bug in mktime() caused by forgetting to check if the present year
is a leap year.
2020-03-06 10:32:48 +01:00
Liav A
425a2ca6ad Init Stage: Allow to boot with smp=on
One can now set the kernel boot argument smp to on, and therefore, to
instruct the kernel to use the IOAPIC instead of the PIC.
2020-03-06 10:32:32 +01:00
Liav A
c335c94242 Kernel: Simplify APIC::enable()
We install a SpuriousInterruptHandler when calling APIC::enable(),
and we don't enable local interrupts for now.
2020-03-06 10:32:32 +01:00
Liav A
a3fa40fc07 Kernel: Enable IRQs before sending commands to devices
Without this fix, a very fast IRQ can preempt the enable_irq() call,
leaving that IRQ being unhandled.
2020-03-06 10:32:32 +01:00
Liav A
f33fb151b4 CPU: Allow to use IRQs in range of 50 to 178 2020-03-06 10:32:32 +01:00
Liav A
30fc78bfaf Kernel: Acquire ISA interrupt overrides from Interrupt Management
Also, InterruptDisabler were added to prevent critical function from
being interrupted. In addition, the interrupt numbers are abstracted
from IDT offsets, thus, allowing to create a better routing scheme
when using IOAPICs for interrupt redirection.
2020-03-06 10:32:32 +01:00
Liav A
d9d792d37f Kernel: Print MultiProcessor features 2020-03-06 10:32:32 +01:00
Andreas Kling
94f287b1c0 Kernel: Unmap non-readable pages
This was caught by running all crash tests with "crash -A".
Basically, non-readable pages need to not be mapped *at all* so that
a "page not present" exception is provoked on access.

Unfortunately x86 does not support write-only mappings, so this is
the best we can do.

Fixes #1336.
2020-03-06 09:58:59 +01:00
Andreas Kling
af29dff224 Inspector: Use pledge() and unveil() 2020-03-06 09:23:07 +01:00
Andreas Kling
dc039fdc7e AK: Simplify JsonObject and JsonArray API a little bit
Instead of set(const JsonValue&) and set(JsonValue&&), just do
set(JsonValue) and let callers move() if they want. This removes some
ambiguity and the compiler is smart enough to optimize it anyway.
2020-03-06 08:51:22 +01:00
Andreas Kling
211e938234 LibGUI: Fix missing equality checks in Window::did_remove_widget()
We should only detach from the cursor tracking widgets on unparenting
if they were the same widget that's being unparented!

Thanks to @agoose77 for spotting this!

Fixes #1354.
2020-03-05 19:49:18 +01:00
Tibor Nagy
c982bfee7e FileManager: Fix asserts on checking properties of symlinks
There were two issues with this code:
- The result of the readlink() call was checked incorrectly for errors.
- This code shouldn't return because otherwise it leaves the GUI buttons
  uninitialized below, causing RefPtr asserts to trigger when the dialog
  tries to access the buttons later on.
2020-03-05 19:04:14 +01:00