Commit Graph

979 Commits

Author SHA1 Message Date
Robin Burchell
0d77aa841a Kernel/Process: Use auto to avoid incompatible types, causing a signedness warning in the ASSERT 2019-05-17 16:06:26 +02:00
Robin Burchell
1cefb4a3b4 Kernel/RTC: Mark some intentional fallthroughs to suppress compiler warnings 2019-05-17 16:06:26 +02:00
Robin Burchell
77dfd419e9 LibCore: Move AK/ArgsParser to LibCore/CArgsParser
Also rename the classes to match LibCore naming style.
This means that it's no longer incorrectly linked into LibC and Kernel.
2019-05-17 15:49:37 +02:00
Andreas Kling
cde47089d2 Kernel: Remove some unnecessary massaging of region base/size pairs.
These will be appropriately rounded by the allocate_range(), so call sites
can stop worrying about it.
2019-05-17 04:47:06 +02:00
Andreas Kling
6957825444 Kernel: Factor out range allocation from Process::allocate_region*().
These functions were doing exactly the same thing for range allocation, so
share that code in an allocate_range() helper.

Region allocation will now also fail if range allocation fails, which means
that mmap() can actually fail without falling apart. Exciting times!
2019-05-17 04:39:22 +02:00
Andreas Kling
87b54a82c7 Kernel: Let Region keep a Range internally. 2019-05-17 04:32:08 +02:00
Andreas Kling
4a6fcfbacf Kernel: Use a RangeAllocator for kernel-only virtual space allocation too. 2019-05-17 04:02:29 +02:00
Andreas Kling
b1bb737704 Kernel: Remove Process::m_next_address.
This isn't needed now that we have RangeAllocator. :^)
2019-05-17 03:47:00 +02:00
Andreas Kling
45ff3a7e6a Kernel: Make Thread::kernel_stack_base() work for kernel processes. 2019-05-17 03:43:51 +02:00
Andreas Kling
c414e65498 Kernel: Implement a simple virtual address range allocator.
This replaces the previous virtual address allocator which was basically
just "m_next_address += size;"

With this in place, virtual addresses can get reused, which cuts down on
the number of page tables created. When we implement ASLR some day, we'll
probably have to do page table deallocation, but for now page tables are
only deallocated once the process dies.
2019-05-17 03:40:15 +02:00
Andreas Kling
c56e3ebee1 Always dump QEMU CPU state on CPU reset. 2019-05-17 00:06:23 +02:00
Andreas Kling
4e88872c8e Kernel: Always dump_backtrace() on process crash. 2019-05-16 19:49:48 +02:00
Andreas Kling
174639b7f0 Kernel: Symbolicate userspace backtraces using ELFLoader.
Stash away the ELFLoader used to load an executable in Process so we can use
it for symbolicating userspace addresses later on. This will make debugging
userspace programs a lot nicer. :^)
2019-05-16 17:18:25 +02:00
Robin Burchell
f1f3cd58b0 FileSystem: fix errno on lseek() beyond the bounds of a file
These are all EINVAL. Also remove bogus assert on metadata.size.
2019-05-16 16:05:08 +02:00
Andreas Kling
c5434e0cfa Kernel: Simplify ELF loader by removing the allocator indirections. 2019-05-16 14:16:08 +02:00
Andreas Kling
2f4e7edee5 Kernel: Simplify dump_backtrace() API for clients.
It makes no sense that clients had to worry about whether or not KSyms
were loaded.
2019-05-16 13:41:16 +02:00
Andreas Kling
7a2da54c07 Only the kernel needs to build with default includes disabled. 2019-05-16 13:40:43 +02:00
Andreas Kling
176f683f66 Kernel: Move Inode to its own files. 2019-05-16 03:02:37 +02:00
Andreas Kling
3cba2a8a78 Kernel: Add a beep() syscall that beeps the PC speaker.
Hook this up in Terminal so that the '\a' character generates a beep.
Finally emit an '\a' character in the shell line editing code when
backspacing at the start of the line.
2019-05-15 21:40:41 +02:00
Robin Burchell
ac2a3b65bb makeall: Use set -e to exit on failure
And pretty the building/installing up a little, rather than a huge chain of &&
2019-05-15 21:14:09 +02:00
Robin Burchell
c6bc23a748 makeall: Like BuildIt, respect MAKEJOBS 2019-05-15 21:14:09 +02:00
Andreas Kling
01ffcdfa31 Kernel: Encapsulate the Region's COW map a bit better. 2019-05-14 17:31:57 +02:00
Andreas Kling
7c10a93d48 Kernel: Make allocate_kernel_region() commit the region automatically.
This means that kernel regions will eagerly get physical pages allocated.
It would be nice to zero-fill these on demand instead, but that would
require a bunch of MemoryManager changes.
2019-05-14 15:38:00 +02:00
Andreas Kling
9e2116ff6b Kernel: Signal stacks are lazily allocated so don't crash in getter. 2019-05-14 12:17:59 +02:00
Andreas Kling
486c675850 Kernel: Allocate kernel signal stacks using the region allocator as well. 2019-05-14 12:06:09 +02:00
Andreas Kling
c8a216b107 Kernel: Allocate kernel stacks for threads using the region allocator.
This patch moves away from using kmalloc memory for thread kernel stacks.
This reduces pressure on kmalloc (16 KB per thread adds up fast) and
prevents kernel stack overflow from scribbling all over random unrelated
kernel memory.
2019-05-14 11:51:00 +02:00
Andreas Kling
8c3ad802d8 Kernel: Have Lock dump backtrace on lock-while-interrupts-disabled error. 2019-05-14 11:50:15 +02:00
Andreas Kling
dae8eb6454 Kernel: Add support for the PS/2 mouse wheel if detected. 2019-05-13 19:48:14 +02:00
GuillaumeGas
801d6f572a Feature/pidof (#31)
* Added killall command

* Fixed feedbacks of awesomekling

* Implemented pidof program and helper to parse arguments called ArgsParser.

* Fixed feedbacks in pidof implem.

Fixes #26
2019-05-13 14:31:23 +02:00
Andreas Kling
b7166385de RetroFetch: Add a silly neofetch-like program.
The idea is to print out various system info suitable for screenshots. :^)
2019-05-13 04:54:48 +02:00
Andreas Kling
090e14d42c IPv4: Default initialize IPv4Address to 0.0.0.0.
IPv4Address() didn't initialize which made for some confusing debugging.
2019-05-10 18:18:54 +02:00
Andreas Kling
99aead4857 Kernel: Add a writev() syscall for writing multiple buffers in one go.
We then use this immediately in the WindowServer/LibGUI communication in
order to send both message + optional "extra data" with a single syscall.
2019-05-10 03:19:25 +02:00
Andreas Kling
bd5c79aff2 LibGUI: Start working on a file picker dialog (GFilePicker).
Have LibGUI adopt GDirectoryModel from FileManager since it fits perfectly
for the needs of a file picker.
2019-05-09 01:24:37 +02:00
Andreas Kling
b5b44a29bb Replace various copies of parse_uint(String) with String::to_uint(). 2019-05-08 19:21:51 +02:00
Andreas Kling
3ae9fc5d88 Move VisualBuilder into a new DevTools directory. 2019-05-08 13:53:34 +02:00
Andreas Kling
eaf03d4ddb HelloWorld: Add a simple "Hello World!" app showing the basics.
This also introduces a Demos/ directory where I hope to add cool things.
2019-05-08 01:18:36 +02:00
Andreas Kling
ba7364b43b Shell: Move line editing to a separate class.
To be clear, there isn't really any line editing yet. But there is
going to be, so let's have it in its own class.
2019-05-07 01:39:41 +02:00
Andreas Kling
fe73543d41 Shell: Move the Shell to a separate directory and let's call it "Shell" :^) 2019-05-07 01:12:08 +02:00
Andreas Kling
72cbcd8e98 Kernel: Dump backtrace on exit() syscall.
This makes assertion failures a lot more pleasant to investigate.
2019-05-06 21:48:48 +02:00
Andreas Kling
6228503c16 Kernel: Add a bit of logging in VMObject::inode_size_changed(). 2019-05-04 21:15:59 +02:00
Andreas Kling
932836e3c7 Kernel: Computing the boot timestamp was a bit broken. 2019-05-04 17:05:42 +02:00
Andreas Kling
5e938868a2 IPv4: Rename source/destination in socket classes to local/peer.
It was way too ambiguous who's the source and who's the destination, and it
didn't really follow a logical pattern. "Local port" vs "Peer port" is super
obvious, so let's call it that.
2019-05-04 16:40:34 +02:00
Andreas Kling
780d2a08c4 IPv4: Save the source address/port together with incoming packet payloads.
We need the address/port to fill in the out-params in recvfrom().
It should now be more or less possible to create a UDP server. :^)
2019-05-04 03:27:50 +02:00
Andreas Kling
c4bb9a3ccb sync.sh: Add "-f" option to forcibly regenerate _fs_contents from scratch.
This might be useful e.g if something goes wrong with the filesystem.
2019-05-04 02:56:21 +02:00
Andreas Kling
f137881147 run: Make it easy to override which qemu executable is used.
Patch contributed by "pd"
2019-05-04 02:52:51 +02:00
Andreas Kling
7aba0058ae sync.sh: Don't regenerate _fs_contents from /dev/zero every time.
This makes sync.sh run a lot faster, especially on slower machines.

Patch contributed by "pd"
2019-05-04 02:50:10 +02:00
Andreas Kling
8b249bd09b Kernel+Userland: Implement mknod() syscall and add a /bin/mknod program. 2019-05-03 22:59:58 +02:00
Andreas Kling
abb5c890e0 IPv4: Implement bind() for TCP and UDP sockets.
We can't accept connections just yet, but this patch makes it possible to
bind() to a given source address/port.
2019-05-03 21:51:40 +02:00
Andreas Kling
2470fdcd9b Kernel: Make Socket inherit from File. 2019-05-03 20:42:43 +02:00
Andreas Kling
03da7046bd Kernel: Prepare Socket for becoming a File.
Make the Socket functions take a FileDescriptor& rather than a socket role
throughout the code. Also change threads to block on a FileDescriptor,
rather than either an fd index or a Socket.
2019-05-03 20:15:54 +02:00