Commit graph

89 commits

Author SHA1 Message Date
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 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 9ac94d393e LibGfx: Rename from LibDraw :^) 2020-02-06 12:04:00 +01:00
joshua stein a1fd2eb237 Build: Userland: no need for duplicate .cpp->.o rule 2020-01-01 22:21:50 +01:00
joshua stein d622e4d224 Build: build Userland binaries separately
Touching one source file shouldn't require relinking all binaries,
consider each one separate.  Also fix building library dependencies.
2019-12-28 21:09:33 +01:00
joshua stein c127d16326 Build: support library and generator dependencies
Instead of directly manipulating LDFLAGS, set LIB_DEPS in each
subdirectory Makefile listing the libraries needed for
building/linking such as "LIB_DEPS = Core GUI Draw IPC Core".

This adds each library as an -L and -l argument in LDFLAGS, but
also adds the library.a file as a link dependency on the current
$(PROGRAM).  This causes the given library to be (re)built before
linking the current $(PROGRAM), but will also re-link any binaries
depending on that library when it is modified, when running make
from the root directory.

Also turn generator tools like IPCCompiler into dependencies on the
files they generate, so they are built on-demand when a particular
directory needs them.

This all allows the root Makefile to just list directories and not
care about the order, as all of the dependency tracking will figure
it out.
2019-12-25 10:11:09 +01:00
joshua stein ac25438d54 Build: clean up build system, use one shared Makefile
Allow everything to be built from the top level directory with just
'make', cleaned with 'make clean', and installed with 'make
install'.  Also support these in any particular subdirectory.

Specifying 'make VERBOSE=1' will print each ld/g++/etc. command as
it runs.

Kernel and early host tools (IPCCompiler, etc.) are built as
object.host.o so that they don't conflict with other things built
with the cross-compiler.
2019-12-20 20:20:54 +01:00
Andreas Kling 88c5126fa7 pro: Add a little userland utility for testing ProtocolServer 2019-11-23 21:50:36 +01:00
Andreas Kling 69efa3f630 Kernel+LibPthread: Implement pthread_join()
It's now possible to block until another thread in the same process has
exited. We can also retrieve its exit value, which is whatever value it
passed to pthread_exit(). :^)
2019-11-14 20:58:23 +01:00
Sergey Bugaev 6ec625d6f3 Userland+LibHTML: Add the html command
This is a simple command that can be used to display HTML from a given
file, or from the standard input, in an HtmlView. It replaces the `tho`
(test HTML output) command.
2019-09-28 18:29:42 +02:00
Sergey Bugaev 2e80b2b32f Libraries: Add LibMarkdown 2019-09-28 18:29:42 +02:00
Sergey Bugaev e1a6f8a27d LibThread: Introduce a new threading library
This library is meant to provide C++-style wrappers over lower
level APIs such as syscalls and pthread_* functions, as well as
utilities for easily running pieces of logic on different
threads.
2019-08-26 11:31:14 +02:00
Conrad Pankoff ecde025375 Libraries: Add LibPCIDB for reading PCI device information from pci.ids 2019-08-14 13:12:54 +02:00
Andreas Kling 8e684f0959 AudioServer: Port to the new generated IPC mechanism
Fork the IPC Connection classes into Server:: and Client::ConnectionNG.
The new IPC messages are serialized very snugly instead of using the
same generic data structure for all messages.

Remove ASAPI.h since we now generate all of it from AudioServer.ipc :^)
2019-08-03 19:49:19 +02:00
Andreas Kling 1c0669f010 LibDraw: Introduce (formerly known as SharedGraphics.)
Instead of LibGUI and WindowServer building their own copies of the drawing
and graphics code, let's it in a separate LibDraw library.

This avoids building the code twice, and will encourage better separation
of concerns. :^)
2019-07-18 10:18:16 +02:00
Robin Burchell 2df6f0e87f Work on AudioServer
The center of this is now an ABuffer class in LibAudio.
ABuffer contains ASample, which has two channels (left/right) in
floating point for mixing purposes, in 44100hz.

This means that the loaders (AWavLoader in this case) needs to do some
manipulation to get things in the right format, but that we don't need
to care after format loading is done.

While we're at it, do some correctness fixes. PCM data is unsigned if
it's 8 bit, but 16 bit is signed. And /dev/audio also wants signed 16
bit audio, so give it what it wants.

On top of this, AudioServer now accepts requests to play a buffer.
The IPC mechanism here is pretty much a 1:1 copy-paste from
LibGUI/WindowServer. It can be generalized more in the future, but for
now I want to get AudioServer working decently first :)

Additionally, add a little "aplay" tool to load and play a WAV file. It
will break with large WAVs (run out of memory, heh...) but it's a start.

Future work needs to make AudioServer block buffer submission from
clients until it has played the buffer they are requesting to play.
2019-07-17 09:39:31 +02:00
Andreas Kling 57da00b731 Include Makefile.common in all other Makefiles. 2019-04-21 04:09:39 +02:00
Andreas Kling 301a269ca0 Get rid of SERENITY macro since the compiler already defines __serenity__
This makes it a bit easier to use AK templates out-of-tree.
2019-04-20 12:58:49 +02:00
Andreas Kling adc91d92a3 Userland: Oops, that merge broke the build, just needed a few tweaks. :^) 2019-04-14 20:32:44 +02:00
Nicolas Van Bossuyt 40e710da3d
Userland: Maybe find is overkill 2019-04-14 20:15:29 +02:00
Nicolas Van Bossuyt dfeeaff237
Userland: making the makefile smarter 2019-04-14 19:58:25 +02:00
Andreas Kling c0fe48635b Kernel: Add /proc/uptime file (number of seconds since boot.)
Also added a simple /bin/uptime to pretty-print this information. :^)
2019-04-14 15:19:45 +02:00
Andreas Kling 5e0577a042 Introduce LibCore and move GElapsedTimer => CElapsedTimer.
I need a layer somewhere between AK (usable both by userspace and kernel)
and LibGUI (usable by userspace except WindowServer.) So here's LibCore.
2019-04-10 16:14:44 +02:00
Andreas Kling 37ae00a4dd Kernel+Userland: Add the rename() syscall along with a basic /bin/mv. 2019-04-07 23:35:26 +02:00
Andreas Kling 23bb276fcd LibC: Run constructors on process startup.
Cooperate with the compiler to generate and execute the _init_array list
of constructor functions on userspace program statup. This took two days
to get working, my goodness. :^)
2019-03-27 12:48:21 +01:00
Andreas Kling e4dfd5a3a4 WindowServer: Support PNG wallpapers.
Fix up /bin/pape so it tells the WindowServer which wallpaper file to use.
2019-03-21 15:54:19 +01:00
Andreas Kling 42755e98cf SharedGraphics: Implement a simple PNG decoder.
This is extremely unoptimized, but it does successfully load "folder32.png"
so it must be at least somewhat correct. :^)
2019-03-21 03:57:42 +01:00
Andreas Kling 0e4a1936ca LibC: Implement gethostbyname() by talking to the DNSLookupServer.
We now talk to the lookup server over a local socket and it does the lookup
on our behalf. Including some retry logic, which is nice, because it seems
like DNS requests disappear in the ether pretty damn often where I am.
2019-03-20 01:15:22 +01:00
Andreas Kling 7aba68d51c Userland+LibC: Add a new little "tc" program for testing TCP.
Also added send() and recv() to LibC in support of this. They are just
wrappers around sendto() and recvfrom().
2019-03-13 17:33:40 +01:00
Andreas Kling ea6a537b70 Userland: Add a simple utility for UDP testing. 2019-03-13 15:00:02 +01:00
Andreas Kling a017a77442 Kernel+LibC+Userland: Start working on an IPv4 socket backend.
The first userland networking program will be "ping" :^)
2019-03-12 15:51:42 +01:00
Andreas Kling dda9b9ab1b Userland: Add a simple /bin/stat program. 2019-02-27 21:45:06 +01:00
Andreas Kling 1d2529b4a1 Add chown() syscall and a simple /bin/chown program. 2019-02-27 12:32:53 +01:00
Andreas Kling 3f29a12d90 More compat work. Rename libraries from LibFoo.a => libfoo.a
This makes it more straightforward to build a cross-compiler toolchain.
Also move math stuff from LibC to LibM.
2019-02-26 13:30:57 +01:00
Andreas Kling d7753c7c8d Move over to building all of userspace with i686-pc-serenity-g++. 2019-02-22 14:45:14 +01:00
Andreas Kling 75b100673f Switch over to building everything with i686-elf-g++. 2019-02-22 10:45:32 +01:00
Andreas Kling 6d3e12899b Kernel: Pass process arguments directly on the stack.
Get rid of the convoluted get_arguments and get_environment syscalls.
This patch also adds a simple /bin/env that just prints its environment.
2019-02-22 01:55:22 +01:00
Andreas Kling 920e8e58ed Kernel+Userland: Implement setuid() and setgid() and add /bin/su
Also show setuid and setgid bits in "ls -l" output. :^)
2019-02-21 23:38:10 +01:00
Andreas Kling 43075e5878 Add a simple /bin/df which gathers its info from /proc/df. 2019-02-21 14:48:00 +01:00
Andreas Kling 7d288aafb2 Kernel: Add link() syscall to create hard links.
This accidentally grew into a little bit of VFS cleanup as well.

Also add a simple /bin/ln implementation to exercise it.
2019-02-21 13:26:40 +01:00
Andreas Kling 8eedbbc9ca Prune compiler flags a bit. Let's go with -march=i686 for now. 2019-02-17 15:17:21 +01:00
Andreas Kling df6aaaeeef Enable -Wimplicit-fallthrough. 2019-02-15 12:39:16 +01:00
Andreas Kling f529b845ec WindowServer: Convert entire API to be message-based.
One big step towards userspace WindowServer. :^)
2019-02-14 01:21:32 +01:00
Andreas Kling e1be5a468d Userland: Add a /bin/pape helper program to switch the desktop wallpaper. 2019-02-08 16:22:54 +01:00
Andreas Kling 5158bee08c Don't use -mregparm=3 in userspace.
It's pretty comfy having arguments in registers in the kernel for now though.
2019-02-08 01:24:52 +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 c0cffe1134 Add a /bin/top program for process table monitoring.
It automagically computes %CPU usage based on the number of times a process
has been scheduled between samples. The colonel task is used as idle timer.
This is pretty cool. :^)
2019-02-04 10:28:12 +01:00
Andreas Kling 5e0b7f1a56 Add basic automatic dependency management to Makefiles. 2019-02-02 04:41:59 +01:00
Andreas Kling c30e2c8d44 Implement basic chmod() syscall and /bin/chmod helper.
Only raw octal modes are supported right now.
This patch also changes mode_t from 32-bit to 16-bit to match the on-disk
type used by Ext2FS.

I also ran into EPERM being errno=0 which was confusing, so I inserted an
ESUCCESS in its place.
2019-01-29 04:55:08 +01:00
Andreas Kling 7455f5ea42 Expose the kernel log buffer through /proc/dmesg.
Also add a /bin/dmesg program for convenience.
2019-01-28 22:40:55 +01:00