Commit Graph

6993 Commits

Author SHA1 Message Date
=
aadcc9c34e CPUGraph.MenuApplet: Add window title. 2020-02-10 18:33:28 +01:00
=
afb37b66cc Clock.MenuApplet: Add window title. 2020-02-10 18:33:28 +01:00
=
fcee5075e9 UserName.MenuApplet: Add window title. 2020-02-10 18:33:28 +01:00
Andreas Kling
3713d31750 LibCore: TCP and UDP servers should parent Notifiers to themselves
This makes things look a little more neat in Inspector. :^)
2020-02-10 14:15:56 +01:00
William McPherson
aa149b9330 LibAudio/Piano: Replace floats with doubles
We should default to double-precision so that clients can make the
choice to use float or double.
2020-02-10 14:04:27 +01:00
William McPherson
d55d2b2794 LibAudio/aplay: Handle WAV header errors properly
We shouldn't just ASSERT() if the header parse fails. This was crashing
Piano completely.
2020-02-10 14:04:27 +01:00
William McPherson
4ad96df0d4 Piano: Draw stereo waves
Draw two waves in different colors.
2020-02-10 14:04:27 +01:00
William McPherson
93903c8064 Piano: Try to be more stereo-oriented 2020-02-10 14:04:27 +01:00
William McPherson
255edcb525 Piano: Add nice scale factor to WaveWidget 2020-02-10 14:04:27 +01:00
William McPherson
2a66878148 Piano: Ensure WaveWidget paints in-bounds
Letting GUI::Frame::paint_event() cover up your mistakes is tacky :P
2020-02-10 14:04:27 +01:00
William McPherson
60fdc6c9ab Piano: Put reset() with other setters 2020-02-10 14:04:27 +01:00
William McPherson
9997b0dbf5 Piano: Add sampler
This commit adds basic support for importing, viewing and playing WAV
samples at different pitches.

Naming issues:
- We are using the Sample struct from Music.h, but also the Sample
  struct from LibAudio (Audio::Sample). This is a little confusing.

set_recorded_sample() finds the peak sample and then divides all the
samples by that peak to get a guaranteed min/max of -1/1. This is nice
because our other waves are also bound between these values and we can
just do the same stuff. This is why we're using Audio::Sample, because
it uses floats, whereas Music.h's Sample uses i16s. It's a little
annoying that we have to use a mixture of floats and doubles though.

For playback at lower frequencies, we're calculating in-between samples,
rather than just playing samples multiple times. Basically, you get the
current sample and add the difference between the current sample and the
next sample multiplied by the distance from the current sample. This is
like drawing the hypotenuse of a right-angled triangle.
2020-02-10 14:04:27 +01:00
Jesse Buhagiar
591870c7b4 Ports: Disable JACK for SDL2 in configopts
This is causing build errors for myself and a few other people.
This config option disables the SDL2 port from trying to compile
with the JACK audio server (which we don't need).
2020-02-10 13:10:51 +01:00
Andreas Kling
ccfee3e573 Kernel: Remove more <LibBareMetal/Output/kstdio.h> includes 2020-02-10 12:07:48 +01:00
Andreas Kling
6cbd72f54f AK: Remove bitrotted Traits::dump() mechanism
This was only used by HashTable::dump() which I used when doing the
first HashTable implementation. Removing this allows us to also remove
most includes of <AK/kstdio.h>.
2020-02-10 11:55:34 +01:00
William McPherson
c8eaae3eaf Userland: Fix segfault in chown
chown takes 2 arguments, not 1.
2020-02-10 11:11:29 +01:00
Shannon Booth
084e67f267 Meta: Integrate Shellcheck into Travis
lint-shell-scripts searches over the repository looking for shell
scripts. On those found, shellcheck is run against them. If any linting
fails print those warnings and exit with a non-zero exit code.

Run this script automatically in Travis.
2020-02-10 10:46:25 +01:00
Shannon Booth
fe668db999 Meta: Fix shellcheck warnings in various scripts
Warnings fixed:
 * SC2086: Double quote to prevent globbing and word splitting.
 * SC2006: Use $(...) notation instead of legacy backticked `...`
 * SC2039: In POSIX sh, echo flags are undefined
 * SC2209: Use var=$(command) to assign output (or quote to assign string)
 * SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails
 * SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
 * SC2034: i appears unused. Verify use (or export if used externally)
 * SC2046: Quote this to prevent word splitting.
 * SC2236: Use -z instead of ! -n.

There are still a lot of warnings in Kernel/run about:
 - SC2086: Double quote to prevent globbing and word splitting.

However, splitting on space is intentional in this case, and not trivial to
change. Therefore ignore the warning for now - but we should fix this in
the future.
2020-02-10 10:46:25 +01:00
joshua stein
e9be8669d2 Build: clean .d files based on SUFFIXED_OBJS and EXTRA_OBJS
Fixes #1198
2020-02-10 10:18:30 +01:00
Liav A
99ea80695e Kernel: Use VirtualAddress & PhysicalAddress classes from LibBareMetal 2020-02-09 19:38:17 +01:00
Liav A
7c4dd0c8cf LibELF: Use VirtualAddress class from LibBareMetal 2020-02-09 19:38:17 +01:00
Liav A
de3637d85f LibBareMetal: Add Memory definitions
Add classes of VirtualAddress & PhysicalAddress.
2020-02-09 19:38:17 +01:00
Liav A
2a699cec98 LibC: Apply a change for the Bootstrapper environment 2020-02-09 19:38:17 +01:00
Liav A
1266c9ab88 Build Environment: Add a definition for the Bootstrapper environment 2020-02-09 19:38:17 +01:00
Liav A
8bdb08c354 AK: Apply changes for the Bootstrapper environment 2020-02-09 19:38:17 +01:00
Liav A
88cf46dc98 Userland: Use IO helpers from LibBareMetal 2020-02-09 19:38:17 +01:00
Liav A
e559af2008 Kernel: Apply changes to use LibBareMetal definitions 2020-02-09 19:38:17 +01:00
Liav A
7c507c27bf LibBareMetal: Creating a new library for freestanding environments 2020-02-09 19:38:17 +01:00
Andreas Kling
c45a5ff840 WebServer: Add missing space to HTTP error responses
Fixes #1200.
2020-02-09 17:05:29 +01:00
Andreas Kling
db2ede9427 Net: Short-circuit routing to the IPv4 address of a local adapter
This makes it possible to open http://localhost:8000/ in Browser. :^)
2020-02-09 14:15:55 +01:00
Andreas Kling
80703ef7d9 WebServer: Send the HTTP response headers in a single packet
This makes it easier to observe the protocol in packet logs.
2020-02-09 14:15:55 +01:00
Andreas Kling
efb694ecad WebServer: Tighten things up with pledge() and unveil() 2020-02-09 14:15:55 +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
Andreas Kling
271bc4b2f2 Net: When routing to loopback, use the loopback adapter's MAC address
Otherwise the routing decision gets interpreted as "host unreachable."
2020-02-09 14:15:55 +01:00
Andreas Kling
d8a30e2ad2 Net: Give the LoopbackAdapter a MAC address
Since the routing code currently interprets an all-zero MAC address as
an invalid next hop, let's give the loopback adapter an address.
2020-02-09 14:15:55 +01:00
Andreas Kling
67ccdbe384 LibCore: Add File::is_directory() helpers 2020-02-09 14:15:55 +01:00
Andreas Kling
80b1af2352 AK: Make StringBuilder::to_string() non-destructive
This was an artifact of an earlier design of StringBuilder where I had
attempted to preserve the same allocation from build to final String.
2020-02-09 14:15:55 +01:00
Andreas Kling
3a7e49fe07 LibCore: Allow constructing a Core::HttpRequest from a raw HTTP request
This patch adds a very simple HTTP request parser that can be useful
for implementing say.. a web server. :^)
2020-02-09 14:15:55 +01:00
Conrad Pankoff
a189285658 Kernel: Support reading/writing PATADiskDevices directly via /dev/hdX 2020-02-09 12:58:45 +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
asliturk
57edcb54c2 MenuApplets: Add UserName applet.
Move code from WindowServer.WSMenuManager to the applet.
2020-02-09 10:37:35 +01:00
Andreas Kling
fc85d17322 TelnetServer: Protect the Client object during drain_socket()
If parsing a command causes us to disconnect the client, we have to
defer deletion of the Client object until we're done with the socket.
2020-02-08 19:12:52 +01:00
Andreas Kling
deb154be61 Kernel: Send SIGPIPE to the current thread on write to a broken pipe 2020-02-08 19:12:06 +01:00
Andreas Kling
70c9a89707 IPv4: Put some TCP close handshake debug spam behind TCP_SOCKET_DEBUG 2020-02-08 16:04:58 +01:00
Andreas Kling
3891e6d739 IPv4: Sockets should say can_read() after reading is shut down
This allows clients to get their EOF after shutting down reading.
2020-02-08 16:04:31 +01:00
Andreas Kling
228a1e9099 IPv4: Basic implementation of TCP socket shutdown
We can now participate in the TCP connection closing handshake. :^)
This implementation is definitely not complete and needs to handle a
bunch of other cases. But it's a huge improvement over not being able
to close connections at all.

Note that we hold on to pending-close sockets indefinitely, until they
are moved into the Closed state. This should also have a timeout but
that's still a FIXME. :^)

Fixes #428.
2020-02-08 16:04:27 +01:00
Andreas Kling
8325662186 more: Read keystrokes from stdout instead of trying to re-open it
If we're running more on a TTY that we don't have filesystem access to,
we can't rely on open(ttyname(STDOUT_FILENO)). Since all the stdio fd's
are opened read/write anyway, we can just read from stdout, even if it
feels a bit weird. :^)
2020-02-08 15:50:00 +01:00
Andreas Kling
1037a1d2ba IPv4: Don't ACK empty TCP packets
Wireshark was complaining about duplicate ACK's and this was why.
2020-02-08 14:09:02 +01:00
Andreas Kling
48f13f2a81 IPv4: Split IPv4Socket::recvfrom() into packet/byte buffered functions
This code was really hard to follow since it handles two separate modes
of buffering the data.
2020-02-08 13:09:37 +01:00
Andreas Kling
00d8ec3ead Kernel: The inode fault handler should grab the VMObject lock earlier
It doesn't look healthy to create raw references into an array before
a temporary unlock. In fact, that temporary unlock looks generally
unhealthy, but it's a different problem.
2020-02-08 12:55:21 +01:00