Commit graph

10868 commits

Author SHA1 Message Date
Tom
038dd9f30e AK: Serialize entire log statements
Prior to this, we wrote to the log every time the << operator
was used, which meant that only these parts of the log statement
were serialized. If the thread was preempted, or especially with
multiple CPUs the debug output was hard to decipher. Instead, we
buffer up the log statements. To avoid allocations we'll attempt
to use stack space, which covers most log statements.
2020-07-03 19:32:34 +02:00
Tom
57b61b2dde Kernel: Split initialization of Processor structure
We need to very early on initialize the Processor structure so
that we can use RecursiveSpinLock early on.
2020-07-03 19:32:34 +02:00
Tom
137e1dc7bd AK: Fixes for atomic pointers 2020-07-03 19:32:34 +02:00
Matthew Olsson
6af3fff0c2 LibJS: Reformat run-tests.sh output
- Use emojis instead of the pass/fail text
- Fix the new version of the script to run inside Serenity
- Don't print erroneous output after 'Output:'; start on a newline
instead
- Skip 'run-tests.sh' while testing
2020-07-03 19:30:13 +02:00
Matthew Olsson
d5beaa497f Base: Add green check mark and red X emojis 2020-07-03 19:30:13 +02:00
Matthew Olsson
97634d0678 LibJS: Hide interpreter exception debug output behind a flag 2020-07-03 19:30:13 +02:00
Matthew Olsson
6cb6e47779 cut: Accept input from stdin if no files are given 2020-07-03 19:30:13 +02:00
Matthew Olsson
4c48c9d69d LibJS: Reorganize tests into subfolders 2020-07-03 19:30:13 +02:00
Matthew Olsson
21064a1883 LibJS: Use correct MarkedValueList append method 2020-07-03 19:30:13 +02:00
Matthew Olsson
02debd8a6d LibJS: Remove extra colon in run-tests.sh output 2020-07-03 19:30:13 +02:00
Sahan Fernando
0ba9651e6e LibC: Replace Berkley's qsort() with AK::dual_pivot_quick_sort() wrapper 2020-07-03 19:29:36 +02:00
Andreas Kling
80d800e6d4 LibIPC: Don't assert on short writes in IPC::ClientConnection
This stops servers from crashing when a client's socket buffer becomes
full and we can't post any more messages to it. Normally this means the
client process is hanged/spinning, but I suppose this could also happen
under severe system load.

It's unclear to me what a better solution here would be. We can't keep
buffering messages indefinitely if the client is just never going to
receive them anyway. At some point we have to cut our losses, and it
seems pretty reasonable to let the kernel socket buffer be the cutoff.

It will be the responsibility of the individual server implementations
to avoid sending messages to clients that may be unable to handle them.
2020-07-03 14:05:09 +02:00
Andreas Kling
a98712035c Kernel: Fix non-blocking write() blocking instead of short-writing
If a partial write succeeded, we could then be in an unexpected state
where the file description was non-blocking, but we could no longer
write to it.

Previously, the kernel would block in that state, but instead we now
handle this as a proper short write and return the number of bytes
we were able to write.

Fixes #2645.
2020-07-03 13:54:18 +02:00
Maciej Zygmanowski
fc79fefb5e WindowServer: Don't crash when invalid resolution requested 2020-07-03 12:31:40 +02:00
Linus Groh
1bc326f63b FileManager: Add "Open Terminal here..." action to menu and toolbar
Currently it's only available in the context menu, which isn't quite
obvious.
2020-07-03 12:29:18 +02:00
Linus Groh
33ca151eb0 FilePicker: Add folder icon to location box
It looks good in FileManager so it will also look good here :^)

FileManager commit: b8a50e9
2020-07-03 12:28:12 +02:00
Linus Groh
f8fa495d67 FilePicker: Make the location box 2px taller
This mimics a recent change to the FileManager's location box.

FileManager commit: 3d5233a
2020-07-03 12:28:12 +02:00
Andreas Kling
47f5b24cc8 Kernel: Remove no-longer-used GDT selector from Thread
Now that we use software context switching, each thread no longer has
its own GDT entry (yay!) so we can get rid of this Thread member. :^)
2020-07-02 21:50:42 +02:00
Andreas Kling
e7393bfb7b Profiler: Turn the "choose a process" functionality into a GUI::Dialog
This feels a bit nicer and make it possible to reuse this in other
places as well. :^)
2020-07-02 20:46:59 +02:00
Nico Weber
526ca68786 SystemMonitor: Correctly check error of posix_spawn()
posix_spawn() has a bit of a whacky API in that it doens't return
0 on success and -1 on failure while writing the error code to
errno -- it instead returns 0 on success and the error code on
error.

So assign the return value to errno so that perror() does the
right thing.
2020-07-02 20:34:06 +02:00
Andreas Kling
f5d920eb2e Profiler: Make the RunningProcessesModel actually sortable
GUI::TableView looks at data(Model::Role::Sort) to know which order
things should be in.
2020-07-02 07:35:11 +02:00
Andreas Kling
a44e52cc14 SystemMonitor: Add "profile process" menu action :^)
You can now start profiling a process directly from SystemMonitor!
This is really neat.
2020-07-01 21:08:16 +02:00
Andreas Kling
d4c92bd1b7 Profiler: Allow specifying a PID to profile with --pid 2020-07-01 21:07:53 +02:00
Andreas Kling
8d52e200ee Profiler: If run without arguments, let user select process from a list
We now show a list of running processes that the user can choose from.
After choosing one, we start profiling it and show a timer with a stop
button that the user has to press to stop profiling.
2020-07-01 20:49:51 +02:00
Andreas Kling
c6193af269 LibGUI: Make Application::exec() return instead of calling exit()
We were calling exit() here because we didn't want to deal with object
teardown in the long-long-ago before Core::Object was ref-counted.
2020-07-01 20:49:00 +02:00
Andreas Kling
8661af9b72 Profiler: Rename from ProfileViewer :^) 2020-07-01 19:43:17 +02:00
Andreas Kling
392b055806 LibWeb: Use the StackingContext tree for hit testing
This makes it possible to click links that are above other content due
to stacking context order (e.g via CSS z-index.)
2020-07-01 19:10:58 +02:00
Andreas Kling
f7a900367f LibWeb: StackingContext was sorting the wrong list of children
Oops, we're supposed to sort the *parent's* children, not our own.
2020-07-01 18:35:50 +02:00
Emanuele Torre
6f8042d8e5 Meta: make Meta/run.sh qgrub work. 2020-07-01 12:53:39 +02:00
Emanuele Torre
8f071137d1 Meta: Give SERENITY_ROOT a default value in CLion/run.sh 2020-07-01 12:53:39 +02:00
Emanuele Torre
e62475d6e7 Meta: run.sh: fix usage comments 2020-07-01 12:53:39 +02:00
Emanuele Torre
1d9791bcdf Meta: Allow running run.sh from any where by setting SERENITY_BUILD
If SERENITY_BUILD is not set or empty, SERENITY_BUILD is treated as if
it was set to '.'.

`run.sh` will cd to SERENITY_BUILD before running the emulator.

Also, export SERENITY_BUILD in `Meta/CLion/run.sh` since we are using it
in `Meta/run.sh`.

Also, allow using a different bochs configuration file by setting the
SERENITY_BOCHSRC variable.
2020-07-01 12:53:39 +02:00
Emanuele Torre
aabb482d5c Meta: move Kernel/.bochsrc => Meta/bochsrc
The run script is not in Kernel/ anymore, let's move `.bochsrc` in Meta/
so that it can be used with the new build system.

Also make bochs use `grub_disk_image` instead of `_disk_image`
2020-07-01 12:53:39 +02:00
Emanuele Torre
86685623a2 Meta: CLion/run.sh should be executable 2020-07-01 12:53:39 +02:00
Emanuele Torre
8233ab197f Meta: make CLion/run.sh use run.sh
We don't need to copy `run.sh` and modify it: we can just set
environment variables.

Now, we don't have to modify two files everytime we make a change to the
run.sh script.

Also make SERENITY_BUILD overridable with environment variables,why not?
2020-07-01 12:53:39 +02:00
Emanuele Torre
f7f1c3d748 Meta: use "better" syntax to set SERENITY_KERNEL_CMDLINE in run.sh :^)
This removes some FIXMEs.

In bash, we could avoid `shift`:
    SERENITY_KERNEL_CMDLINE="${@:2}"

But let's stick to POSIX sh for now.
2020-07-01 12:53:39 +02:00
Emanuele Torre
0cee39355c Meta: quote variables in run.sh where it makes sense 2020-07-01 12:53:39 +02:00
Tom
5674a77bd6 PATA: Ignore interrupts that weren't generated by the disk 2020-07-01 12:07:01 +02:00
Tom
a2fd824dff PATA: LBA48 uses 16 bit features register 2020-07-01 12:07:01 +02:00
Tom
96109e9776 Kernel: Boot all APS all the way into their own idle loop 2020-07-01 12:07:01 +02:00
Tom
691d767fba Kernel: Block initializing the Scheduler on the APs until the BSP initialized global data 2020-07-01 12:07:01 +02:00
Tom
2a38cc9a12 Kernel: Add a quickmap region for each processor
Threads need to be able to concurrently quickmap things.
2020-07-01 12:07:01 +02:00
Tom
d249b5df8f Kernel: Protect Console with SpinLock 2020-07-01 12:07:01 +02:00
Tom
16783bd14d Kernel: Turn Thread::current and Process::current into functions
This allows us to query the current thread and process on a
per processor basis
2020-07-01 12:07:01 +02:00
Tom
cdc78515b6 SystemMonitor: Add a utilization graph for each processor 2020-07-01 12:07:01 +02:00
Tom
d99901660d Kernel/LibCore: Expose processor id where a thread last ran 2020-07-01 12:07:01 +02:00
Tom
d98edb3171 Kernel: List all CPUs in /proc/cpuinfo 2020-07-01 12:07:01 +02:00
Tom
fb41d89384 Kernel: Implement software context switching and Processor structure
Moving certain globals into a new Processor structure for
each CPU allows us to eventually run an instance of the
scheduler on each CPU.
2020-07-01 12:07:01 +02:00
Tom
10407061d2 PATA: Avoid double-preparing for irq 2020-07-01 12:07:01 +02:00
Tom
3ac6d31b45 Kernel: Serialize debug output 2020-07-01 12:07:01 +02:00