summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2019-12-30Keymap: Add ability to load keymap files by nameJami Kettunen
2019-12-30Keymap: Clean up source a bitJami Kettunen
2019-12-29Kernel: Add a mode flag to sys$purge and allow purging clean inodesAndreas Kling
2019-12-28Build: build Userland binaries separatelyjoshua stein
Touching one source file shouldn't require relinking all binaries, consider each one separate. Also fix building library dependencies.
2019-12-27LibC+ping: Let's use the traditional timersub() et al prototypesAndreas Kling
This also fixes the build, since ping.cpp already had a timersub().
2019-12-27gron: Implement a simplified variant of @tomnomnom's "gron"Andreas Kling
This program takes JSON input and turns it into JavaScript statements that construct the same data step by step. This format is much more greppable than what "jp" gives us. :^)
2019-12-26munch: Add a simple userland program for chewing up lots of memoryAndreas Kling
2019-12-25crash: Add "-X" option for attempting to execute non-executable memoryAndreas Kling
2019-12-25Build: support library and generator dependenciesjoshua stein
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-24Userland: Add syscall -l option and man pageMauri de Souza Nunes
2019-12-24Userland: Add support for printing multiple columns to the cal commandAndrés Vieira
Now cal is able to print the entire year when only that is passed as an argument. For example: `cal 1992`. However this meant breaking the highlighted day escape sequence as it messed up the layout and the character count for each of the rows :( Now the current day is specified like 17* (for example for day 17).
2019-12-20Build: clean up build system, use one shared Makefilejoshua stein
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-11Kernel: Implement a simple process time profilerAndreas Kling
The kernel now supports basic profiling of all the threads in a process by calling profiling_enable(pid_t). You finish the profiling by calling profiling_disable(pid_t). This all works by recording thread stacks when the timer interrupt fires and the current thread is in a process being profiled. Note that symbolication is deferred until profiling_disable() to avoid adding more noise than necessary to the profile. A simple "/bin/profile" command is included here that can be used to start/stop profiling like so: $ profile 10 on ... wait ... $ profile 10 off After a profile has been recorded, it can be fetched in /proc/profile There are various limits (or "bugs") on this mechanism at the moment: - Only one process can be profiled at a time. - We allocate 8MB for the samples, if you use more space, things will not work, and probably break a bit. - Things will probably fall apart if the profiled process dies during profiling, or while extracing /proc/profile
2019-12-09LibGUI: Make GMenu inherit from CObjectAndreas Kling
This is primarily to make it possible to pass a GMenu* where a CObject* is expected.
2019-12-09purge: Add a small command-line utility for purging all volatile memoryAndreas Kling
2019-12-09AK: Use size_t for the length of stringsAndreas Kling
Using int was a mistake. This patch changes String, StringImpl, StringView and StringBuilder to use size_t instead of int for lengths. Obviously a lot of code needs to change as a result of this.
2019-12-02Kernel: Crash on memory access in non-readable regionsAndreas Kling
This patch makes it possible to make memory regions non-readable. This is enforced using the "present" bit in the page tables. A process that hits an not-present page fault in a non-readable region will be crashed.
2019-12-02Userland: Add the cal command (#838)Andrés Vieira
This is a very simple implementation of the cal command to display a calendar into the command line. For now this only prints the current month highlighting the current day.
2019-11-29modunload: Take the module-to-unload as a command-line argumentAndreas Kling
2019-11-29jp: Print double-quotes around string values in outputAndreas Kling
2019-11-29modload: Take the module-to-load as a command-line argumentAndreas Kling
Instead of hard-coding /mod/TestModule.o :^)
2019-11-29Kernel: Disallow syscalls from writeable memoryAndreas Kling
Processes will now crash with SIGSEGV if they attempt making a syscall from PROT_WRITE memory. This neat idea comes from OpenBSD. :^)
2019-11-28Kernel: Implement basic module unloading :^)Andreas Kling
Kernel modules can now be unloaded via a syscall. They get a chance to run some code of course. Before deallocating them, we call their "module_fini" symbol.
2019-11-28Kernel: Implement very simple kernel module loadingAndreas Kling
It's now possible to load a .o file into the kernel via a syscall. The kernel will perform all the necessary ELF relocations, and then call the "module_init" symbol in the loaded module.
2019-11-28Kernel+ifconfig: Add an MTU value to NetworkAdapterAndreas Kling
This defaults to 1500 for all adapters, but LoopbackAdapter increases it to 65536 on construction. If an IPv4 packet is larger than the MTU, we'll need to break it into smaller fragments before transmitting it. This part is a FIXME. :^)
2019-11-26Kernel: Make syscall counters and page fault counters per-threadAndreas Kling
Now that we show individual threads in SystemMonitor and "top", it's also very nice to have individual counters for the threads. :^)
2019-11-26Kernel: Expose per-thread information in /proc/allAndreas Kling
Previously it was not possible to see what each thread in a process was up to, or how much CPU it was consuming. This patch fixes that. SystemMonitor and "top" now show threads instead of just processes. "ps" is gonna need some more fixing, but it at least builds for now. Fixes #66.
2019-11-26ps: Show "/dev/pts/0" as "pts/0" instead of "0"Andreas Kling
Also tweak the alignment of the output a bit.
2019-11-25Userland: Add keymap program.Hüseyin ASLITÜRK
2019-11-24LibProtocol: Add a Download object so users don't have to manage ID'sAndreas Kling
LibProtocol::Client::start_download() now gives you a Download object with convenient hooks (on_finish & on_progress). Also, the IPC handshake is snuck into the Client constructor, so you don't need to perform it after instantiating a Client. This makes using LibProtocol much more pleasant. :^)
2019-11-23pro: Take the URL to download as a command-line argumentAndreas Kling
Also, don't print anything other than the download payload to stdout. This gives us a very simple HTTP download utility :^)
2019-11-23ProtocolServer: Send the download payload to clients as a shared bufferAndreas Kling
The DownloadFinished message from the server now includes a buffer ID that can be mapped into the client program. To avoid prematurely destroying the buffer, the server will hang on to it until the client lets it know that they're all good. That's what the ProtocolServer::DisownSharedBuffer message is about. In the future it would be nice if the kernel had a mechanism to allow passing ownership of a shared buffer along with an IPC message somehow.
2019-11-23pro: Add a little userland utility for testing ProtocolServerAndreas Kling
2019-11-22AudioServer: Allow muting the system audioAndreas Kling
This patch adds muting to ASMixer, which works by substituting what we would normally send to the sound card with zero-filled memory instead. We do it this way to ensure that the queued sample buffers keep getting played (silently.) This is obviously not the perfect way of doing this, and in the future we should improve on this, and also find a way to utilize any hardware mixing functions in the sound card.
2019-11-18Kernel+LibPthread: pthread_create handles pthread_attr_tAndrew Kaster
Add an initial implementation of pthread attributes for: * detach state (joinable, detached) * schedule params (just priority) * guard page size (as skeleton) (requires kernel support maybe?) * stack size and user-provided stack location (4 or 8 MB only, must be aligned) Add some tests too, to the thread test program. Also, LibC: Move pthread declarations to sys/types.h, where they belong.
2019-11-17Kernel+LibC: Remove the isatty() syscallAndreas Kling
This can be implemented entirely in userspace by calling tcgetattr(). To avoid screwing up the syscall indexes, this patch also adds a mechanism for removing a syscall without shifting the index of other syscalls. Note that ports will still have to be rebuilt after this change, as their LibC code will try to make the isatty() syscall on startup.
2019-11-17Kernel: Implement some basic stack pointer validationAndreas Kling
VM regions can now be marked as stack regions, which is then validated on syscall, and on page fault. If a thread is caught with its stack pointer pointing into anything that's *not* a Region with its stack bit set, we'll crash the whole process with SIGSTKFLT. Userspace must now allocate custom stacks by using mmap() with the new MAP_STACK flag. This mechanism was first introduced in OpenBSD, and now we have it too, yay! :^)
2019-11-16LibPthread: Implement a basic first pthread mutexAndreas Kling
This patch adds these API's: - pthread_mutex_init() - pthread_mutex_lock() - pthread_mutex_unlock() No mutex attributes are supported yet, so we only do the simplest mutex wihout recursive locking.
2019-11-14Kernel+LibPthread: Implement pthread_join()Andreas Kling
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-06LibHTML: Rename parse_html() => parse_html_document()Andreas Kling
2019-11-06Revert "LibHTML: Rename parse_html() => parse_html_document()"Andreas Kling
This reverts commit f6439789db9c02216baabb197017c7a79a63ba04. Oops, I committed unrelated changes here, let me clean that up..
2019-11-06LibHTML: Rename parse_html() => parse_html_document()Andreas Kling
2019-11-05disk_benchmark: Add a -c flag to enable use of disk cachesAndreas Kling
By default, disk_benchmark will now use the O_DIRECT flag, causing it to bypass the kernel's disk caches. This gives you "disk performance" numbers rather than "disk cache performance" numbers. You can use "disk_benchmark -c" to enable the caches. Fixes #703.
2019-11-04Userland: Add syscall programMauri de Souza Nunes
The Plan9 OS has this program that can test a system call with the given arguments. For the most basic system calls it can be very helpful and aid with testing or just to play with a given syscall without writing a dedicated program. Some examples: syscall write 1 hello 5 syscall -o read 0 buf 5 syscall mkdir /tmp/my-dir syscall exit 2 ...
2019-11-04Userland: Add the utility "nl" (number line) (#693)balatt
I wrote a version of nl for Serenity with a lot but not all of the options in POSIX nl. It includes line count type (-b), increment (-i), delimiter (-s), start number (-v), and width (-w).
2019-11-04wc: Rewritten with added features (#690)balatt
Now gets a true byte count by using the file size. * When giving a single-line string without a trailing newline, the line count should not go up ('printf "test" | wc -l' should output '0') * Doesn't hang up when using two or more switch options in a row. (It would hang if I did 'wc -lw test.frm'). While mine works with multiple args like that, they don't switch anything, you have to do wc -l -w etc but I think that is an issue with CArgsParser. * It can now take standard input without needing a "-". * When encountering a file that doesn't exist, it doesn't exit. It prints the counts for each file that does, and prints an error to stderr for each file that doesn't. * Has slight buffering between counts to be closer to GNU and BSD wc.
2019-11-03cat: Use a 32 KB I/O buffer here to improve "cat a > b" scenarioAndreas Kling
This is roughly twice as fast as the old 4 KB buffer size. We still don't go nearly as fast as "cp", since we don't ftruncate() up front like "cp" does.
2019-11-02cp: Fail immediately if there's not enough space for the destinationAndreas Kling
Instead of writing until we run out of space, just fail immediately.
2019-11-02cp: Read/write 32 KB at a time to go faster :^)Andreas Kling
This is a huge speed-up (3x) when copying large files. Ideally this would be optimized by the kernel somehow, but we're not there yet.
2019-11-02disk_benchmark: Use 64-bit values for bytes-per-second valuesAndreas Kling
Let's dress for the job we want, and prepare for faster speeds. :^)