Commit Graph

722 Commits

Author SHA1 Message Date
Andreas Kling
244efe050a Clipboard: Move the system clipboard to a dedicated service process :^)
This commit moves the clipboard from WindowServer into a new Clipboard
service program. Clipboard runs as the unprivileged "clipboard" user
and with a much tighter pledge than WindowServer.

To keep things working as before, all GUI::Application users now make
a connection to Clipboard after making the connection to WindowServer.
It could be interesting to connect to Clipboard on demand, but right
now that would necessitate expanding every GUI app's pledge to include
"unix" and also unveiling the clipboard portal, which I prefer not to.
2020-05-14 22:53:58 +02:00
Linus Groh
7bfd24ca76 LibWeb: Support the :root pseudo class 2020-05-14 08:49:51 +02:00
Andreas Kling
23ee68c63e PaintBrush: Borrow the "move" cursor for the "move" tool :^) 2020-05-13 00:11:47 +02:00
Andreas Kling
5f9d80d8bc LibWeb: Add basic support for CSS percentages
Many properties can now have percentage values that get resolved in
layout. The reference value (what is this a percentage *of*?) differs
per property, so I've added a helper where you provide a reference
value as an added parameter to the existing length_or_fallback().
2020-05-11 23:07:30 +02:00
Ben Wiederhake
87b6578516 FontEditor: Fix link to icon after it moved
Fixup for 6f2837cb13
2020-05-11 09:29:30 +02:00
Linus Groh
4c1a765076 LibWeb: Add basic support for "border-style: {dotted,dashed}" 2020-05-10 19:41:00 +02:00
Andreas Kling
61e112d3b7 DisplaySettings: Tweak app icon 2020-05-10 14:40:36 +02:00
Andreas Kling
5af4ad097f Base: Open .font files in FontEditor again
This broke when we introduced LaunchServer.
2020-05-10 14:24:04 +02:00
Linus Groh
d3d29ea1cc Demos: Add LibGfx Demo :^) 2020-05-10 13:34:59 +02:00
Andres Vieira
cbbfc08f1d Docs: Add unzip(1) man page 2020-05-09 23:50:44 +02:00
Andres Vieira
78f334f447 Base: Add a "zip" folder to /home/anon/ with a .zip file to test 2020-05-09 23:50:44 +02:00
Andreas Kling
7b34f5bb92 LaunchServer: Don't use SystemServer keepalive 2020-05-09 16:57:35 +02:00
Andreas Kling
68991855ef Base: Open https:// URLs in Browser 2020-05-09 15:17:29 +02:00
Andreas Kling
3d41cc849c LaunchServer: Run with portal permissions 600
The LaunchServer is personal to "anon" and we don't want other users
accessing it to launch anything.
2020-05-09 15:16:16 +02:00
Nicholas Hollett
2708cc0f72 LaunchServer: Add the LaunchServer to centralise file associations.
Step one of moving DesktopServices::open handling out of process. This
makes it easier to do things like read in associations for which program
opens which files or protocols. This gives users the ability to modify
the associations without having to rebuild :^)
2020-05-09 15:12:56 +02:00
Hüseyin ASLITÜRK
6f2837cb13 Base: Move 32px font editor app icon under 32x32 folder 2020-05-09 10:00:13 +02:00
Andreas Kling
5bfd893292 Kernel+Userland: Add "settime" pledge promise for setting system time
We now require the "settime" promise from pledged processes who want to
change the system time.
2020-05-08 22:54:17 +02:00
Hüseyin ASLITÜRK
cef2dce9a1 Base: Add emoji files for 26A1, 2B06 and 2B07 2020-05-08 09:49:41 +02:00
Linus Groh
c1a6841cb2 Base: Add "`" to GB keymap 2020-05-07 22:13:46 +02:00
AnotherTest
a82419469f LibWeb: Add canvas.fill
This implements only one of the two forms of this function,
ctx.fill(winding_rule).
Also tweaks the quadratic curve demo to have a nice looking filled
shape.
2020-05-06 14:50:29 +02:00
Andreas Kling
e73ad78ba6 LibWeb: Add support for "display: inline-block"
This display type is implemented using a LayoutBlock that is_inline().
Basically it behaves like a block internally, and its children are laid
out in the normal block layout fashion. Externally however, it behaves
like an atomic inline-level box.

Layout of inline-block boxes happens in three stages:

1. The outer dimensions of the block are computed during the recursive
   normal layout pass. We skip positioning, but lay out children.

2. Later on, during line layout in the *containing block*, the inline
   block now contributes a linebox fragment. When linebox fragments are
   positioned, we learn the final position of the inline block. That's
   when we set the inline block's position.

3. We re-layout the inline block's children once again. This is done to
   make sure they end up in the right position. The layout tree doesn't
   use relative offsets, so after we position the inline block in (2),
   its children will not have its positions updated. Relayout moves
   all children of inline blocks to the right place.

This is a rather naive approach but it does get the basic behavior into
place so we can iterate on it. :^)
2020-05-05 16:18:28 +02:00
Sergey Bugaev
983e541584 Base: Fix a typo 2020-05-05 11:07:06 +02:00
AnotherTest
0a55679de4 LibWeb: Add canvas.quadraticCurveTo()
Also adds a test, and removes debug spam ™️
2020-05-05 09:21:07 +02:00
Sergey Bugaev
718271c9df Base: Document unveil(2)
Also, escape underscores in chroot_with_mount_flags.
2020-05-04 21:44:50 +02:00
Ben Wiederhake
fe178b6234 SystemMenu+MouseDemo: Add menu entry and nice icons 2020-05-04 09:58:14 +02:00
Andreas Kling
a83d74b38c Base: Add browser bookmark for Google :^) 2020-05-03 23:01:58 +02:00
Shannon Booth
0e403a43a4 Terminal: Add config for startup command
This is useful when working on a program as you can put the command into
the config file, instead of having to type it up each time on boot.
2020-05-02 14:12:57 +02:00
Brendan Coles
548ecceb75 Screensaver: Add app-screensaver.png 16x16 icon 2020-05-02 14:12:45 +02:00
AnotherTest
72d56b46b5 LibTLS: Make enough stuff work to have a demo run
...maybe, sometimes :^)
2020-05-02 12:24:10 +02:00
Brendan Coles
905de7df58 Fire: Add app-fire.png 16x16 icon 2020-05-02 11:42:29 +02:00
Brendan Coles
6c1e842a7e Cube: Add app-cube.png 16x16 icon 2020-05-02 11:42:21 +02:00
Andreas Kling
e9b7a51a9a Base: Tweak MessageBox icons a tiny bit 2020-05-02 01:29:55 +02:00
LepkoQQ
c7f0de14b5 LibGfx: Decode paletted and grayscale images with 1/2/4 bit depth
When dealing with png data that has less than 8 bits per pixel, round
up to the next byte when allocating per row buffers and streamers. This
fixes decoding odd sized PNGs with less than 8 bits per pixel.

Also added a test page with some odd sized palleted PNGs.
2020-05-02 01:28:18 +02:00
Linus Groh
e37065cc8b Base: Update js(1) manpage
Syntax highlighting is now enabled by default!
2020-05-02 01:23:50 +02:00
Andreas Kling
b5039a047f Base: Adjust filetype icons to be right-aligned for consistency
Established convention is for the flavor icon to go on the right side.
2020-05-01 17:23:41 +02:00
Hüseyin ASLITÜRK
d8477074b9 Base: Icons for INI, Object and Library file types 2020-05-01 16:58:18 +02:00
Andreas Kling
23d99e92b9 WindowServer: Add action icons to the window menus 2020-04-30 12:58:38 +02:00
Andreas Kling
e8a5c10382 Base: Add back the OG grid wallpaper from back in the day, now as a PNG 2020-04-30 12:31:02 +02:00
Andreas Kling
51df4bdbfc DisplaySettings: Rename from DisplayProperties 2020-04-29 15:53:51 +02:00
Andreas Kling
40fe076e10 Base: Tweak default desktop background color slightly 2020-04-29 14:37:10 +02:00
Linus Groh
8f2300afb5 mkdir: Add -p option to create parent directories 2020-04-28 09:36:09 +02:00
Linus Groh
6fd7966d81 mkdir: Use ArgParser, support creating multiple directories 2020-04-28 09:36:09 +02:00
Andreas Kling
e3232eb25b LibWeb: Support loading data: URLs transparently via ResourceLoader
This is pretty darn cool! :^)
2020-04-26 22:57:00 +02:00
Hüseyin ASLITÜRK
59f87d12d0 Base: 32x32 icons for cplusplus and header file types 2020-04-26 21:31:41 +02:00
Andres Vieira
88368df9a2 Base+Browser: Add an icon for the serenity Browser and make it use it
Browser was using the filetype-html icon instead of a dedicated one, so
we now have the globe from that icon reimagined and in good Buggie
company :^)
2020-04-26 21:13:57 +02:00
LepkoQQ
b094c064d8 Base: Add test page for decoding different basic png formats. 2020-04-26 20:29:17 +02:00
LepkoQQ
35dda6222e Base: Improve cursor arrow to feel more symetrical 2020-04-26 18:17:46 +02:00
Linus Groh
4d0a344da0 Base+LibGUI: Add icon for Python files 2020-04-26 01:12:14 +02:00
Linus Groh
a36ceffb56 Emoji: Rename U+1F600.png to U+1F41E.png (ladybug)
The image for U+1F600 "GRINNING FACE" shows a ladybug, but the
codepoint of that emoji is actually U+1F41E "LADY BEETLE" :^)
2020-04-26 01:12:03 +02:00
Andreas Kling
cba9550f1c HackStudio: Toolbar icon overhaul 2020-04-25 14:17:02 +02:00
Itamar
74f41d5f98 HackStudio: Add cpp debugger
The HackStudio debugger integrates with LibDebug to provide
source-level debugging.

The user can set breakpoints at various positions in the source code,
and then run the program in debug mode.

When the program is stopped, the current execution position is
displayed, and the user can insert/remove breakpoints, continue
execution, or single step the program.
2020-04-25 13:16:46 +02:00
Itamar
393560d8a2 HackStudio: GUI support for setting breakpoints on source code lines 2020-04-25 13:16:46 +02:00
Brendan Coles
6dde2c7f47 Browser: Add Browser.ini configuration file
The Browser can now load a home page URL from the user's Browser.ini
configuration file rather than using a hard-coded URL.
2020-04-25 10:55:55 +02:00
Andreas Kling
45a932a600 Base: New "cut" action icon 2020-04-24 20:42:34 +02:00
Andreas Kling
9d8620f956 Browser: Add icons for the "new tab" and "close tab" actions 2020-04-24 20:42:34 +02:00
Andreas Kling
2b64cf3efe Base: New "open" and "save" action icons 2020-04-24 20:42:34 +02:00
Andreas Kling
7db0194d4b Base: Tweak Calendar app icon 2020-04-24 20:42:34 +02:00
Andreas Kling
4218b00cb4 Base: Tweak ladybug icon 2020-04-24 17:10:59 +02:00
Linus Groh
746dd5b190 LibJS: Implement computed properties in object expressions 2020-04-23 23:56:04 +02:00
Andreas Kling
5fc02c6f1d Base: Nudge Redmond theme closer to the Windows 95 colors :^) 2020-04-23 19:59:12 +02:00
Andreas Kling
42ddd551ef Base: Tweak filetype-javascript icon and add 32x32 version 2020-04-23 19:08:33 +02:00
Andreas Kling
0f8dca9441 Base: Tweak new/open/save icons (make them a bit smaller) 2020-04-23 18:52:33 +02:00
Andreas Kling
2454c3b7fb Applications: Remove ChanViewer app
The HTTP JSON API this relied on is no longer available via HTTP and
I would rather make the website work in Browser anyway. :^)
2020-04-23 18:38:54 +02:00
Andreas Kling
9142890822 Base: Tweak icons with arrows in them (to be more pointy) 2020-04-23 18:35:15 +02:00
Andreas Kling
622806f570 Base: Tweak go-home icon 2020-04-23 18:31:03 +02:00
Emanuele Torre
a804615b9b Base: Close head tag in canvas-path.html and give the document a title 2020-04-23 09:42:43 +02:00
Brendan Coles
9ab4a8179a TextEditor: Add "Find Previous" 16x16 icon 2020-04-22 17:14:36 +02:00
Brendan Coles
802c06ab7b Base: Add missing Syntax color settings for Joi theme 2020-04-22 11:48:38 +02:00
Brendan Coles
7e01e38cf4 Base: Add Sunshine theme 2020-04-22 11:47:42 +02:00
Hüseyin ASLITÜRK
84317df579 Base: Add QuickShow application to system menu 2020-04-21 12:03:35 +02:00
Brendan Coles
a47b9fe490 TextEditor: Add "Find Next" 16x16 icon 2020-04-21 09:49:47 +02:00
angel
441c2715bb LibGUI: Add Select all action to TextEditor
Previously, TextEditor processed the Select all command directly on the
keydown event handler. For this reason, WindowManager would not process
it as an action for the focused control and an action with the same
keyboard shortcut from the parent could override the TextEditor's one
even when it is focused.

For instance, when pressing Ctrl+A on the FileManager's path bar, all
files were selected instead, which is not the expected behavior.

Now the Select all command is an actual action on TextEditor, so that
WindowManager can process it correctly before any other actions. I also
added an icon for it!
2020-04-20 22:43:40 +02:00
Andreas Kling
badbe8bc99 Solitaire: Sharpen 16x16 icon 2020-04-20 15:24:59 +02:00
Andreas Kling
8311b24620 Solitaire: Use a pre-scaled buggie image for the back of cards
Instead of scaling on the fly, which is not super aesthetic yet.
2020-04-20 15:24:59 +02:00
Linus Groh
f38897ef20 Base: Add Demo applications to system menu 2020-04-19 18:16:11 +02:00
Linus Groh
440f017946 Base: Update js(1) manpage
- Include all options
- Update example REPL session to match current output
- Mention REPL's help()
- Add test mode section
2020-04-19 15:22:31 +02:00
Sergey Bugaev
15daf88e93 Base: Document open(1) 2020-04-19 11:14:26 +02:00
Brendan Coles
4e9643981f Base: Update Redmond theme window borders to appear less flat 2020-04-19 10:53:09 +02:00
Andreas Kling
5dd87c18c4 Base: Start a desktop FileManager by default! :^) 2020-04-18 22:09:40 +02:00
Andreas Kling
6adea6069a Base: Tweak Redmond 2000 selection color 2020-04-18 20:35:18 +02:00
Andreas Kling
2de843692c Base: Tweak Redmond 2000 menu selection color 2020-04-18 19:44:57 +02:00
Andreas Kling
3bed5e28fb Base: Add a "Redmond 2000" theme from the 32-bit era :^) 2020-04-18 19:42:38 +02:00
Brendan Coles
f8e3aa1ad9 Base: Add Redmond theme 2020-04-18 17:49:50 +02:00
bcoles
e2f0e36bdb
Base: Add Browser to QuickLaunch (#1836) 2020-04-18 12:36:00 +02:00
Read H
0ef2efac7c Base files: Add protocols file
This commit adds the standard /etc/protocols file to
the base files to be used by netdb's protoent family of functions.
2020-04-18 10:11:55 +02:00
Andreas Kling
0d93e249c3 LibWeb: Add some basic path drawing functionality to the canvas element
This patch adds the following methods to CanvasRenderingContext2D:

- beginPath()
- moveTo(x, y)
- lineTo(x, y)
- closePath()
- stroke()

We also add the lineWidth property. :^)
2020-04-16 21:06:03 +02:00
Read H
ce572c9cb5 Base Files: Add services file.
Adding the services database file to /etc/services. This is the most
common location for this file in *nix systems.
2020-04-16 15:55:45 +02:00
Andreas Kling
aab022b77b Base: Add a little test web page for canvas drawImage() :^) 2020-04-14 20:42:14 +02:00
Linus Groh
dd7796515f LibJS: Add console.{debug,info,warn,error}() 2020-04-12 18:42:42 +02:00
Hüseyin ASLITÜRK
74a8e3fe1c Base: Add go-first, go-last, zoom-in, zoom-out icons 2020-04-12 18:08:11 +02:00
Linus Groh
54fc972a72 MenuApplets: Support memory usage and custom colors in ResourceGraph
The ResourceGraph menu applet now supports a few command line options:

--cpu / -C to display a CPU usage graph
--memory / -M to display a memory usage graph
--name / -n to set a name which is used to order applets
--color / -c to set the graph color (supports anything
Gfx::Color::from_string() understands)

The SystemServer.ini and WindowServer.ini config files have been updated
to spawn and show two ResourceGraph menu applets, one for CPU usage
(green) and one for memory usage (cyan) - this matches the colors in the
SystemMonitor graphs.
2020-04-11 10:03:12 +02:00
Linus Groh
b46a8d7335 MenuApplets: Rename CPUGraph to ResourceGraph
The plan is to extend what currently is known as "CPUGraph" and let the
SystemServer spawn multiple instances of it - which then can show memory
or network usages as well :^)

Simply renaming the applet is the first step.
2020-04-11 10:03:12 +02:00
Linus Groh
31505dde7e LibJS: Add String.prototype.pad{Start,End}() 2020-04-10 16:37:04 +02:00
Brendan Coles
63f8cbfb56 IRCClient: Add NotifyOnMessage/NotifyOnMention config options
Allow IRCClient user to opt out of notifications.
2020-04-10 13:16:07 +02:00
Brendan Coles
df7b617ba1 IRCClient: Add ShowNickChangeMessages/ShowJoinPartMessages conf options
Allow IRCClient to hide nick change spam and join/part spam
2020-04-10 12:56:19 +02:00
Brian Gianforcaro
39855fe9ef LibWeb: Add canvas.strokeRect(), and fix scale & translate
Add an implementation of CanvasRenderingContext2DWrapper.strokeRect().
While implementing this I fixed fillRect() and the new strokeRect() to
honor the .scale() and .translate() values that had previously been plumbed.

Also enhance the canvas.html demo to utilize strokeRect(), scale(), and translate().
2020-04-08 11:07:50 +02:00
VAN BOSSUYT Nicolas
694e4e9168 Resources: Added filetype icon for object, library, text and unknown. 2020-04-07 21:27:31 +02:00
Liav A
23fb985f02 Kernel & Userland: Allow to mount image files formatted with Ext2FS 2020-04-06 15:36:36 +02:00
VAN BOSSUYT Nicolas
0d04327318 Ressources: Added more file type icon. 2020-04-06 14:44:09 +02:00
AnotherTest
3ab6c5fd09 DHCPClient: Log errors and cleanup the code
Prior to this, we ran the DHCP client as a high-priority service, but
making the system feel laggy "for some network stuff" is not the
greatest of ideas :^)
2020-04-06 10:58:40 +02:00
Linus Groh
bf62625001 Base: Add trigonometry demo webpage 2020-04-06 10:58:16 +02:00
Brendan Coles
ddb8597c0c IRCClient: Allow CTCP replies to be user configurable in IRCClient.ini 2020-04-05 15:29:48 +02:00
AnotherTest
3e8cf79efa Servers: Add a new DHCP client
This adds a DHCPClient...Server that leases IPv4s.
2020-04-05 09:50:48 +02:00
Brendan Coles
55b25b3c9b IRCClient: Add icons for channel list, channel invite, channel topic 2020-04-05 09:37:19 +02:00
M
8399b7bc11
Base: Add la-latin1 keyboard layout (#1597) 2020-04-04 10:34:06 +02:00
Andreas Kling
56ca91b9f8 LibWeb: Implement <script src> support for synchronous scripts
Scripts loaded in this way will block the parser until they finish
executing. This means that they see the DOM before the whole document
has been fully parsed. This is all normal, of course.

To make this work, I changed the way we notify DOM nodes about tree
insertion. The inserted_into() callbacks are now incrementally invoked
during parse, as each node is appended to its parent.

To accomodate inline scripts and inline style sheets, we now also have
a children_changed() callback which is invoked on any parent when it
has children added/removed.
2020-04-03 23:06:09 +02:00
Andreas Kling
9ae3cced76 Revert "Kernel & Userland: Allow to mount image files formatted with Ext2FS"
This reverts commit a60ea79a41.

Reverting these changes since they broke things.
Fixes #1608.
2020-04-03 21:28:57 +02:00
Andreas Kling
a2b0cc8f08 LibWeb: Add "navigator" object and expose navigator.userAgent
A lot of web content looks for this property. We'll probably have to
tweak this as we go, but at least now we have it. :^)
2020-04-03 18:12:20 +02:00
Liav A
a60ea79a41 Kernel & Userland: Allow to mount image files formatted with Ext2FS 2020-04-02 12:03:08 +02:00
Linus Groh
021d78f8f7 Browser: Add error page
Add a simple HTML error page that gets loaded into the HtmlView when
loading the page fails.

Closes #1210 and #1516
2020-04-01 18:49:48 +02:00
Andreas Kling
839beb52f3 Base: Tweak the canvas demo page to stop using fractional RGB values
This is a hack to workaround missing support for fractional values in
"rgb(r,g,b)" color parsing.
2020-03-31 19:10:08 +02:00
Brendan Coles
e8b17c42bb Base: Change root user home directory from / to /root 2020-03-31 11:43:46 +02:00
Linus Groh
d4e3688f4f LibJS: Start implementing Date :^)
This adds:

- A global Date object (with `length` property and `now` function)
- The Date constructor (no arguments yet)
- The Date prototype (with `get*` functions)
2020-03-30 14:11:54 +02:00
Tibor Nagy
c7f3d72a6a HackStudio: Add an upscaled 32x32 icon to the About dialog 2020-03-30 13:03:53 +02:00
Andreas Kling
06aec9667e LibWeb: Support more advanced selectors in document.querySelectorAll()
I made some mistakes in the selector parsing code. It's now able to
parse selectors composed of multiple complex selectors, instead of just
one complex selector.
2020-03-30 11:35:39 +02:00
Andreas Kling
0f7bcd4111 LibWeb: Add naive support for document.querySelectorAll()
This currently returns a JS::Array of elements matching a selector.
The more correct behavior would be to return a static NodeList, but as
we don't have NodeLists right now, that'll be a task for the future.
2020-03-30 11:35:39 +02:00
Hüseyin ASLITÜRK
db692a807b Base: Add icons for color-chooser 2020-03-29 19:36:37 +02:00
Hüseyin ASLITÜRK
38dd8f28bd Base: Add tile wallpaper 2020-03-29 19:36:37 +02:00
Hüseyin ASLITÜRK
48a7d7c72d Base: Add monitor.png 2020-03-29 19:36:37 +02:00
Emanuel Sprung
c9059c12dc Browser: Let the user add/remove bookmarks to the bookmarks bar
This patchset adds a Button to the toolbar (right next to the location field)
with a star icon. The star is white if the currently visited url is not yet
bookmarked and yellow if a bookmark for the url exists.

After adding or removing a bookmark, the bookmark json file is synced to disk.
Therefore, some new pledge/unveil's have been added.
2020-03-27 14:12:18 +01:00
Emanuel Sprung
337ade9e4c Browser: Add bookmarks bar
This patchset adds a bookmark bar that is backed by a json file backend.
The json file is loaded and checked for the format. According to the
format, the bookmarks bar is populated with the bookmark items.

If the bookmarks do not fit into one line, an expader button is shown
that brings up a menu containing the missing bookmark items.

There is currently no way to add or remove bookmarks. A hover over a
bookmark is also not yet showing the url in the statusbar.
2020-03-27 14:12:18 +01:00
Sergey Bugaev
db4da68618 Base: Add a man page for js(1)
This also changes --ast-dump to --dump-ast, because I like it better
and that is what the variable is actually called.
2020-03-26 08:18:08 +01:00
Elisée Maurer
d01b97b50a
Base: Replace <!DOCTYPE> with <!DOCTYPE html> in a few files (#1511)
<!DOCTYPE> by itself is not a valid document type declaration.
2020-03-26 07:37:12 +01:00
Andreas Kling
68b04d5c78 LibWeb: Implement getting and setting element.innerHTML
Getting the innerHTML property will recurse through the subtree inside
the element and serialize it into a string as it goes.

Setting it will parse the set value as an HTML fragment. It will then
remove all current children of the element and replace them with all
the children inside the parsed fragment.

Setting element.innerHTML will currently force a complete rebuild of
the document's layout tree.

This is pretty neat! :^)
2020-03-25 18:53:20 +01:00
redoste
30649ed93f Keymap: Add FR keymap layout
This adds the standard French "AZERTY" keyboard layout. Some keys are unmapped
because some characters are not supported : ²éèçà°€¨£¤ùµ§
2020-03-25 16:24:38 +01:00
Andreas Kling
faddf3a1db LibJS: Implement "throw"
You can now throw an expression to the nearest catcher! :^)

To support throwing arbitrary values, I added an Exception class that
sits as a wrapper around whatever is thrown. In the future it will be
a logical place to store a call stack.
2020-03-24 22:21:58 +01:00
Andreas Kling
343e224aa8 LibJS: Implement basic exception throwing
You can now throw exceptions by calling Interpreter::throw_exception().
Anyone who calls ASTNode::execute() needs to check afterwards if the
Interpreter now has an exception(), and if so, stop what they're doing
and simply return.

When catching an exception, we'll first execute the CatchClause node
if present. After that, we'll execute the finalizer block if present.

This is unlikely to be completely correct, but it's a start! :^)
2020-03-24 16:14:10 +01:00
Andreas Kling
c33d4aefc3 LibJS: Parse "try", "catch" and "finally"
This is the first step towards support exceptions. :^)
2020-03-24 16:14:10 +01:00
myphs
f42f300ba3 LibWeb: CSS: Add "position: absolute" with top and left
This momentarily handles the CSS property "position: absolute;" in
combination with the properties "top" and "left", so that elements can
be placed anywhere on the page independently from their parents.

Statically positioned elements ignore absolute positioned elements when
calculating their position as they don't take up space.
2020-03-23 20:17:29 +01:00
Andreas Kling
39045bfde8 LibWeb: Add basic support for requestAnimationFrame()
We now support rAF, driven by GUI::DisplayLink callbacks. It's a bit
strange how we keep registering new callbacks over and over.
That's something we can definitely optimize.

This allows you to update animations/whatever without doing it more
often than the browser can display.
2020-03-22 21:18:03 +01:00
Andreas Kling
065db26d7c Base: Add a demo web page for canvas+setInterval+randomness
Click somewhere in the black area and drag for colorful effect! :^)
2020-03-21 19:07:21 +01:00
Andreas Kling
a7d458f76a Base: Tidy up the events.html test page a little bit 2020-03-21 14:53:13 +01:00
Andreas Kling
2106dafd62 LibJS: Delete fully-empty HeapBlocks after garbage collection
We now deallocate GC blocks when they are found to have no live cells
inside them.
2020-03-21 11:46:47 +01:00
0xtechnobabble
bc002f807a LibJS: Parse object expressions 2020-03-21 10:08:58 +01:00
Andreas Kling
bceabd7c4b LibJS: Add ArrayPrototype and implement Array.prototype.push()
This function is ultimately supposed to be generic and allow any |this|
that has a length property, but for now it only works on our own Array
object type.
2020-03-20 21:56:40 +01:00
Andreas Kling
8f7d4f67a4 LibJS: Support reading/writing elements in an Array via Object get/put
I'm not completely thrilled about Object::get() and Object::put() doing
special-case stuff for arrays, and we should probably come up with a
better abstraction for it.

But at least it works for now, which is really nice. :^)
2020-03-20 21:56:40 +01:00
Andreas Kling
a82f64d3d6 LibJS: Parse ArrayExpression and start implementing Array objects
Note that property lookup is not functional yet.
2020-03-20 21:56:40 +01:00
myphs
0891f860f7 LibWeb: Add CSS property 'border'
This makes it possible to write shorter CSS. Instead of writing
.foo {
        border-width: 3px;
        border-style: solid;
        border-color: blue;
}
it is now possible to write
.foo {
        border: 3px solid blue;
}
while the order of values is irrelevant.
Currently only the basic values are supported. More values should be
added in the future.

Three more value specific parse functions were added:
parse_line_width, parse_color, and parse_line_style

Additionally a few test cases were added to borders.html.
2020-03-20 21:40:55 +01:00
rhin123
a0bc6a8f37 Base: Add Calendar.af 2020-03-19 22:54:30 +01:00
rhin123
8bc412c80b Calendar: Add a 16x16 app icon 2020-03-19 22:54:30 +01:00
Andreas Kling
a37c29e353 LibWeb: Add <canvas> element and start fleshing out CRC2D
This patch adds HTMLCanvasElement along with a LayoutCanvas object.
The DOM and layout parts are very similar to <img> elements.

The <canvas> element holds a Gfx::Bitmap which is sized according to
the "width" and "height" attributes on the element.

Calling .getContext("2d") on a <canvas> element gives you a context
object that draws into the underlying Gfx::Bitmap of the <canvas>.
The context weakly points to the <canvas> which allows it to outlive
the canvas element if needed.

This is really quite cool. :^)
2020-03-19 19:07:56 +01:00
Andreas Kling
73d28a0551 LibJS: Prefer FunctionDeclaration if a statement begins with "function" 2020-03-19 18:07:07 +01:00
Andreas Kling
e265058768 LibWeb: Fire "mousedown" and "mousemove" events in the DOM :^) 2020-03-18 17:13:22 +01:00
Andreas Kling
f39e5352f0 LibWeb: Start working on DOM event support
This patch adds the EventTarget class and makes Node inherit from it.

You can register event listeners on an EventTarget, and when you call
dispatch_event() on it, the event listeners will get invoked.

An event listener is basically a wrapper around a JS::Function*.

This is pretty far from how DOM events should eventually work, but it's
a place to start and we'll build more on top of this. :^)
2020-03-18 17:13:22 +01:00
Itamar
bd9f14e27e SystemServer: Add WorkingDirectory support
Services can now have their initial working directory
configured via `SystemServer.ini`.

This commit also configures Terminal's working directory
to be /home/anon
2020-03-18 08:23:31 +01:00
Conrad Pankoff
46a897b59b LibJS: Implement typeof operator 2020-03-17 21:28:02 +01:00
marprok
666f84b933 Base: Add Joi theme 2020-03-17 09:41:15 +01:00
Andreas Kling
086f68e878 LibJS: Replace the global print() function with console.log() :^) 2020-03-16 14:58:20 +01:00
0xtechnobabble
6780d70fb1 js: Fix simple scopes example
Weirdly enough, the "simple-scopes" test doesn't return undefined
anymore, at first I thought the scoping was somehow broken, turns out
the interpreter doesn't consider the returned y as the last evaluated
value anymore, possibly because it's undefined (?).
2020-03-16 13:42:13 +01:00
0xtechnobabble
dfbaa8e543 LibJS: Implement abstract equality and inequality 2020-03-16 13:42:13 +01:00
Oriko
2b162ef794 LibGUI: Use themes for syntax highlighting 2020-03-16 13:39:34 +01:00
Přemysl Janouch
66794d51ef Keymap: Add a US Dvorak keyboard layout
It is yet undecided how to name regional variants.
2020-03-16 07:42:19 +01:00
Andreas Kling
23b1d97b0d LibJS: Add ObjectPrototype and implement hasOwnProperty()
All Objects will now have ObjectPrototype as their prototype, unless
overridden.
2020-03-15 15:25:43 +01:00
Andreas Kling
2c5b9fb8f9 LibJS: Add StringPrototype and make it the prototype of StringObject
This patch adds String.prototype.charAt() to demonstrate that prototype
property lookup works, and that you can call a prototype function on an
object, and it will do what you expect. :^)
2020-03-15 15:02:49 +01:00
myphs
57646e362f Keymap: Add DE keymap layout
This makes it easier to work with the german keyboard layout.

Some keys are left unset because their corresponding letters
aren't supported yet.
2020-03-15 11:49:59 +01:00
Stephan Unverwerth
3389021291 LibJS: Unescape strings in Token::string_value() 2020-03-14 16:00:28 +01:00
Andreas Kling
b5a22fc408 LibWeb: Implement Document.getElementById()
This was pleasantly simple! We don't have an ElementWrapper yet, so it
just returns a NodeWrapper, but it still basically works. :^)
2020-03-14 13:25:40 +01:00
Andreas Kling
1c406294fc LibWeb: Start implementing basic JavaScript DOM bindings
This patch introduces the Wrapper and Wrappable classes.

Node now inherits from Wrappable, and can be wrapped in a GC-allocated
Bindings::NodeWrapper object. The only property we expose right now is
the very simple nodeName property.

When a Document's JS::Interpreter is first instantiated, we add a
"document" property with a DocumentWrapper object to the global object.

This is pretty cool! :^)
2020-03-14 13:25:40 +01:00
Andreas Kling
9c9d3f0904 LibWeb: Parse <script> elements and run any JavaScript found inside
This patch begins integrating LibJS into LibWeb. Document holds the
JS::Interpreter for now, and it is created on demand when you first
call Document::interpreter().

We also add a simple "alert()" function to the global object.
2020-03-14 13:25:38 +01:00
Stephan Unverwerth
c0e6234219 LibJS: Lex single quote strings, escaped chars and unterminated strings 2020-03-14 12:13:53 +01:00
Stephan Unverwerth
15d5b2d29e LibJS: Add operator precedence parsing
Obey precedence and associativity rules when parsing expressions
with chained operators.
2020-03-14 00:11:24 +01:00
Oriko
8285102b6d HackStudio: Add Javascript projects 2020-03-13 20:19:01 +01:00
Till Mayer
62422eecdc Solitaire: Add about dialog and 32x32 icon 2020-03-13 10:40:45 +01:00
Andreas Kling
d1d136b4e5 LibJS: Replace $gc() hack with a NativeFunction on the global object
To make this work, also start passing Interpreter& to native functions.
2020-03-12 20:04:54 +01:00
Andreas Kling
7912f33ea0 LibJS: Add NativeFunction, a callable wrapper around a C++ lambda
This can be used to implement arbitrary functionality, callable from
JavaScript.

To make this work, I had to change the way CallExpression passes
arguments to the callee. Instead of a HashMap<String, Value>, we now
pass an ordered list of Argument { String name; Value value; }.

This patch includes a native "print(argument)" function. :^)
2020-03-12 19:54:47 +01:00
Conrad Pankoff
023d121e05 Meta: Add for-loop JavaScript test program 2020-03-12 13:42:23 +01:00
howar6hill
9f3f0d9983 LibJS: Add test for function with arguments 2020-03-12 13:27:28 +01:00
Andreas Kling
f405cb6a77 LibJS: Implement basic MemberExpression parsing
At last we can parse "hello friends".length :^)
2020-03-12 13:05:57 +01:00
Andreas Kling
4d942cc1d0 js: Take the script file as a command-line argument
Now that we have the beginnings of a parser, let's take the script to
run as a command-line argument and move all the test scripts into
/home/anon/js :^)

To run a script, simply use "js":

$ js my-script.js

To get an AST dump before execution, you can use "js -A"
2020-03-12 10:52:47 +01:00
Till Mayer
fe5cc7ce68 Games: Added solitaire
Added a solitaire game. Currently there are graphics missing on some
of the cards, but the game is fully functional.

Press F12 to show the game-over animation manually.
2020-03-09 21:36:59 +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
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
87582d5e63
Keymap: Add ABNT2 keymap (#1347) 2020-03-05 17:37:06 +01:00
BenJilks
91f5555eed Keymap: Add GB keymap layout
Replaced GBP with a hash symbol, as unicode is not supported
2020-03-05 16:36:14 +01:00
Andreas Kling
37c71bad8a Inspector: Add special icon for timer objects 2020-03-05 11:27:03 +01:00
Andreas Kling
6bcda1875e Inspector: Add a special icon for layout classes 2020-03-05 11:13:44 +01:00
Andreas Kling
71e96ee728 Base: Add anon user to the phys group
This allows anon to shut down and reboot the system.

Fixes #775.
2020-03-03 16:39:06 +01:00
Mathias Danielsen
88e12f7632 Keymaps: Added keymap for norwegian keyboards 2020-03-01 10:53:15 +01:00
Andreas Kling
e705e4e083 About: Adopt Buggie :^)
Simon Struthers drew a SerenityOS ladybug and since it's so cute,
I figured we could adopt it!
2020-02-29 15:12:58 +01:00
Andreas Kling
f72e5bbb17 Kernel+LibC: Rename shared buffer syscalls to use a prefix
This feels a lot more consistent and Unixy:

    create_shared_buffer()   => shbuf_create()
    share_buffer_with()      => shbuf_allow_pid()
    share_buffer_globally()  => shbuf_allow_all()
    get_shared_buffer()      => shbuf_get()
    release_shared_buffer()  => shbuf_release()
    seal_shared_buffer()     => shbuf_seal()
    get_shared_buffer_size() => shbuf_get_size()

Also, "shared_buffer_id" is shortened to "shbuf_id" all around.
2020-02-28 12:55:58 +01:00
thatlittlegit
30556a0a93 SystemMenu: Move SystemDialog into SystemMenu and remove INI config
I probably would've done INI config removal in another commit, but it
fit well here because I didn't want to pledge wpath for SystemMenu if I
didn't need to.

Frankly, that's something that I think should be done: allow ConfigFile
to be used read-only.
2020-02-23 22:03:03 +01:00
thatlittlegit
9784ab99d2 SystemDialog+Base: Add icon for SystemDialog 2020-02-23 22:03:03 +01:00
thatlittlegit
efc4861786 SystemDialog: Revamp to be more Win95-like
Only thing I don't like right now is the fact that we rely on the shell.
2020-02-23 22:03:03 +01:00
howar6hill
7ff256aab6 Base: Add a man page for lspci 2020-02-20 15:13:42 +01:00
howar6hill
83668299a6
host: Use ArgsParser to parse arguments, and add man page (#1252)
Fixes #1246.
2020-02-20 15:12:55 +01:00
Tibor Nagy
6e2a16c8a8 LibGfx+LibGUI: Allow theming the focus outline of AbstractButton 2020-02-20 14:19:30 +01:00
Tibor Nagy
c8bc53e987 LibGfx+LibGUI: Allow theming the text cursor 2020-02-20 14:19:30 +01:00
howar6hill
940de40f28
Userland: Add userdel program (#1217) 2020-02-19 12:59:09 +01:00
Tibor Nagy
e1da7ca979 Base: Add ruler colors to system themes 2020-02-19 12:24:39 +01:00
howar6hill
94ed183774 Man: Use ArgsParser to parse arguments 2020-02-18 12:23:15 +01:00
Andreas Kling
b711f1eab5 SystemMenu: Finish the implementation and start this at boot :^)
Fixes #1231.
2020-02-17 20:20:32 +01:00
Andreas Kling
7afd9039d1 Base: Add a Minesweeper app icon that's actually 16x16
The one we were using was actually 15x15 which tripped up an assertion
when loading it into a menu using the GUI::Action code path.
2020-02-17 19:58:33 +01:00
Andreas Kling
9f54ea9bcd NotificationServer: Add a system service for desktop notifications
This patch adds NotificationServer, which runs as the "notify" user
and provides an IPC API for desktop notifications.

LibGUI gains the GUI::Notification class for showing notifications.

NotificationServer is spawned on demand and will unspawn after
dimissing all visible notifications. :^)

Finally, this also comes with a small /bin/notify utility.
2020-02-16 21:58:17 +01:00
Andreas Kling
9794e18a20 Base: Run WindowServer as a separate "window" user
This was actually rather painless and straightforward. WindowServer now
runs as the "window" user. Users in the "window" group can connect to
it via the socket in /tmp/portal/window as usual.
2020-02-16 21:58:17 +01:00
Andreas Kling
0415db30c6 WindowServer: Move configuration file into /etc/WindowServer
This is in preparation for running WindowServer as a separate user.
2020-02-16 21:58:17 +01:00
Tibor Nagy
fc24b2b57d LibGUI: Make ResizeCorner theme-aware 2020-02-16 08:01:20 +01:00
thatlittlegit
d5617fc855 Welcome: 'Welcome to Serenity' -> 'Welcome to SerenityOS' 2020-02-15 20:46:10 +01:00
thatlittlegit
7a3bdf3563 Welcome: Add icons to welcome entries 2020-02-15 20:46:10 +01:00
thatlittlegit
bc28e55d61 Base: Add documentation for the welcome.txt format 2020-02-15 20:46:10 +01:00
thatlittlegit
ba27b56200 Welcome: Add some more pages for Development and Multimedia 2020-02-15 20:46:10 +01:00
thatlittlegit
a55b96a1ea Welcome: Separate text from source code by parsing
This allows modification at runtime, as well as easier editing than C++
structures.
2020-02-15 20:46:10 +01:00
Tibor Nagy
e455af8d33 Base: Add inactive selection colors to the system themes 2020-02-15 18:42:13 +01:00
asliturk
077ef556a7 WindowServer: Move applet code from MenuManager to AppletManager.
Move applet logic to the own class. Remove applet code from MenuManager.
With new AppletManager applet order is configurable via WindowManager.ini file.
2020-02-10 18:33:28 +01:00
Andreas Kling
6c752c15a2 WebServer: Implement a very basic HTTP server :^)
This server listens on port 8000 and serves HTML files from /www.
It's very simple and quite naive, but I think we can start here and
build our way to something pretty neat.

Work towards #792.
2020-02-09 14:15:55 +01:00
Hüseyin ASLITÜRK
9b5e0b6247 WindowServer: Remove username from MenuManager.
Now, we have UserName applet.
2020-02-09 10:37:35 +01:00
Andreas Kling
d34ad44f90 Base: Add man page for posix_openpt(3) 2020-02-07 22:37:27 +01:00
Jesse Buhagiar
f9609fe08a Userland: useradd utility
This commit implements the `useradd` utility that is found on most,
if not all *NIX systems. It allows the root user to add new users
to the password file found in `/etc/passwd`, thereby making
it easier to manipulate the file.
2020-02-02 10:58:45 +01:00
Andreas Kling
9ce4ef2dd3 Base: Remove two unused icons 2020-01-29 12:27:37 +01:00
Andreas Kling
c26560ec26 LookupServer: Rename setting "DNS/IPAddress" => "DNS/Nameserver" 2020-01-26 15:44:51 +01:00
Andreas Kling
95504b5850 Base: Note in pledge(2) man page which promises are extensions
Also add a little "History" section noting that pledge() is an original
OpenBSD invention and that our implementation differs in many ways.
2020-01-23 10:41:07 +01:00
Atilla Lonny
24f2596345 Base: Add Nord theme
Nord (specifically Polar Night) is a popular soft dark blue/grey theme.

Personally, I find it to be a very nice middle-ground between the contrast of the
dark and light (default) theme.

![Preview](https://i.imgur.com/6sVnT4i.png)
2020-01-21 11:25:44 +01:00
Sergey Bugaev
3e1ed38d4b Kernel: Do not return ENOENT for unresolved symbols
ENOENT means "no such file or directory", not "no such symbol". Return EINVAL
instead, as we already do in other cases.
2020-01-18 23:51:22 +01:00
Andreas Kling
26a31c7efb Kernel: Add "accept" pledge promise for accepting incoming connections
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.
2020-01-17 11:19:06 +01:00
Brian Gianforcaro
b553a86048 man: Fix minor inconsistencies in pledge(2) man page
- tty promise was listed twice.

- Fix a few typos
2020-01-14 08:00:35 +01:00
Andreas Kling
fd64e97c8a LibDraw+LibHTML: Make link colors themeable
Add "Link", "ActiveLink" and "VisitedLink" colors to the system theme
definition, and implement support for them in LibHTML.

Note that <body link="foo" alink="bar" vlink="baz"> takes precedence
over the system colors. Author style also takes precedence, since we
only fetch the system color in case the CSS color is -libhtml-link.
2020-01-13 20:33:15 +01:00
Sergey Bugaev
9513f54932 Base: Document new chroot abilities 2020-01-12 20:02:11 +01:00
Sergey Bugaev
fee6d0a3a6 Kernel+Base: Mount root as nodev,nosuid
Then bind-mount /dev and /bin while adding back the appropriate permissions :^)
2020-01-12 20:02:11 +01:00
Andreas Kling
198cd77307 Base: Tweak language in pledge(2) man page 2020-01-12 19:08:42 +01:00
Andreas Kling
f3eb06a46f Base: Add a man page about pledge(2) 2020-01-12 16:11:12 +01:00
Sergey Bugaev
b37bd28053 Base: Document mount(2) and mount(8) 2020-01-11 18:57:53 +01:00
Sergey Bugaev
71f1d3f819 Base: Apply some filesystem flags by default
Notably, /tmp is now mounted nodev,nosuid :^)
2020-01-11 18:57:53 +01:00
Andreas Kling
d0a708fda4 Base: Run ProtocolServer as a separate "protocol" user
This is probably not the final design we'll want for this, but for now
let's run the HTTP client code as a separate user to reduce exposure
for the standard "anon" user account.

Note that "protocol" is also added to the "lookup" group, in order to
allow ProtocolServer to contact LookupServer for DNS requests.
2020-01-11 13:07:32 +01:00
Andreas Kling
3f9e4cd24e chroot: Add a little chroot program
This program changes the current filesystem root and spawns a shell.
2020-01-10 23:23:20 +01:00
Sergey Bugaev
7bc8fa884a FileManager: Add a columns view
This new view, backed by a GColumnsView, joins the existing table and icon
views :^) Even though it displays a file tree, its data is provided by the very
same GFileSystemModel that the other two views use.

This commit also includes my attempt at making an icon for the new mode.
2020-01-10 17:45:59 +01:00
Andreas Kling
f5d9f11e52 Base: Add a "lookup" user+group that runs LookupServer
LookupServer now runs as lookup:lookup, allowing connections from other
members of the "lookup" group.

This is enforced through file system permissions by having the service
socket (/tmp/portal/lookup) be mode 0660.

Now the LookupServer program can't overwrite other people's files if it
starts misbehaving. That's pretty cool :^)
2020-01-09 21:36:17 +01:00
Andreas Kling
7dd03b46ee SystemServer: Allow specifying per-service socket file permissions 2020-01-09 21:35:33 +01:00
0xtechnobabble
123dcada05 Themes: Support rubberband selection theming 2020-01-07 11:02:43 +01:00
Jami Kettunen
08c7b5068e Base: Space out some names in app files 2020-01-04 22:29:21 +01:00
Andreas Kling
f558c8e36a Base: Add an "audio" group that gets to write to /dev/audio 2020-01-04 13:25:13 +01:00
Andreas Kling
498659773c Base: Add a "phys" group for users with physical access
Only users in this group can access the screen, mouse and keyboard.
2020-01-04 13:21:33 +01:00
Andreas Kling
9bd4bf41fb SystemServer: Explicitly open /dev/null for services without StdIO
Spawning services with nothing open at all on the standard I/O fds is
way too harsh. We now open /dev/null for them instead.
2020-01-04 13:15:01 +01:00
Andreas Kling
c2b7c43f3c SystemServer: Fetch any extra GIDs and call setgroups() before spawn
We now pick up all the user's extra GIDs from /etc/group and make
sure those are set before exec'ing a service.

This means we finally get to enjoy being in more than one group. :^)
2020-01-04 13:11:43 +01:00
Andreas Kling
20ac4e44d1 Base: Add "tty" group and make /dev/tty* be root:tty mode 610
This fixes an issue where anyone could snoop on the virtual consoles.
2020-01-04 12:46:09 +01:00
Tibor Nagy
790eaab6f5 Keymap+Base: Keycode fixes, remove workaround
Add missing keymap entries for the dollar sign and escape key and reformat
the Hungarian keymap.

Remove the workaround for "0x08", replace it with '\b'.

Fix the octal/hex mixup in the value of escape key. (033 != 0x33, 033 == 0x1B)
2020-01-03 01:20:47 +01:00
Andreas Kling
7f843ef3b2 Kernel: Make the purge() syscall superuser-only
I don't think we need to give unprivileged users access to what is
essentially a kernel testing mechanism.
2020-01-02 13:39:49 +01:00
Andreas Kling
4fa7146da1 Base: Move the modload and modunload command documentation to man8
These are system administration commands, not intended for use by
all users. These tend to go in section 8.
2020-01-02 12:37:19 +01:00
Andreas Kling
05b004ec64 Base: Remove "idle" priority note from SystemServer(5)
The "idle" priority was never meant to be exposed to userspace, as it's
only used by the kernel's internal idle thread.
2020-01-02 12:36:15 +01:00
Andreas Kling
0c22646e2b Base: Document EPERM error in module_load(2) and module_unload(2)
Only the superuser can use these system calls.
2020-01-02 12:35:19 +01:00
Andreas Kling
38f93ef13b Kernel: Disable x86 RDTSC instruction in userspace
It's still possible to read the TSC via the read_tsc() syscall, but we
will now clear some of the bottom bits for unprivileged users.
2020-01-01 18:22:20 +01:00
Andreas Kling
f598bbbb1d Kernel: Prevent executing I/O instructions in userspace
All threads were running with iomapbase=0 in their TSS, which the CPU
interprets as "there's an I/O permission bitmap starting at offset 0
into my TSS".

Because of that, any bits that were 1 inside the TSS would allow the
thread to execute I/O instructions on the port with that bit index.

Fix this by always setting the iomapbase to sizeof(TSS32), and also
setting the TSS descriptor's limit to sizeof(TSS32), effectively making
the I/O permissions bitmap zero-length.

This should make it no longer possible to do I/O from userspace. :^)
2020-01-01 17:31:41 +01:00
Andreas Kling
9c0836ce97 Kernel: Enable x86 UMIP (User Mode Instruction Prevention) if supported
This prevents code running outside of kernel mode from using the
following instructions:

* SGDT - Store Global Descriptor Table
* SIDT - Store Interrupt Descriptor Table
* SLDT - Store Local Descriptor Table
* SMSW - Store Machine Status Word
* STR - Store Task Register

There's no need for userspace to be able to use these instructions so
let's just disable them to prevent information leakage.
2020-01-01 13:21:15 +01:00
Jami Kettunen
6af301edec Base: Update Finnish keymap with proper AltGr support 2019-12-31 19:46:40 +01:00
Tibor Nagy
d8ddf803e2 Base: Add Hungarian keymap 2019-12-31 19:31:42 +01:00
Shannon Booth
d0f9906c17 Crash: Add a "Test All Crash Types" option
Add an option "-A", that will run all of the crash types in the crash
program. In this mode, all crash tests are run in a child process so
that the crash program does not crash.

Crash uses the return status of the child process to ascertain whether
the crash happened as expected.
2019-12-31 02:14:36 +01:00
Andreas Kling
b0bbdc53e9 Base: Remove misplaced backtick in syscall(1) 2019-12-30 14:15:18 +01:00
Tibor Nagy
a7040078e5 Base: Add glyph spacing fields to fonts 2019-12-30 14:02:12 +01:00
Jami Kettunen
edba444aa9 Base: Add man page for keymap(1) 2019-12-30 14:02:00 +01:00
Jami Kettunen
107612209d Base: Add ASCII-friendly fi.json 2019-12-30 14:02:00 +01:00
Andreas Kling
e0ec4f89b2 Base: Add man page for purge(8) 2019-12-29 13:23:21 +01:00
Tibor Nagy
ac0b8caa42 Base: Add 2x upscaled Liza fonts 2019-12-28 21:06:02 +01:00