Commit graph

2792 commits

Author SHA1 Message Date
Sergey Bugaev
629501049f Kernel: Fix resolving symlinks in the middle of a path.
If a symlink is not the last part of a path, the remaining part
of the path has to be further resolved against the symlink target.

With this, a path containing a symlink always resolves to the target
of the first (leftmost) symlink in it, for example any path of form
/proc/self/... resolves to the corresponding /proc/pid directory.
2019-06-12 16:14:29 +02:00
Sergey Bugaev
75df45d709 Kernel: Fix comparing StringViews with strcmp().
StringView character buffer is not guaranteed to be null-terminated;
in particular it will not be null-terminated when making a substring.
This means that the buffer can not be used with C functions that expect
a null-terminated string. Instead, StringView provides a convinient
operator == for comparing it with Strings and C stirngs, so use that.

This fixes /proc/self/... resolution failures in ProcFS, since the name
("self") passed to ProcFSInode::lookup() would not be null-terminated.
2019-06-12 16:14:29 +02:00
Conrad Pankoff
b29a83d554 Kernel: Wrap around to region start if necessary in take_free_page 2019-06-12 15:38:17 +02:00
Conrad Pankoff
aee9317d86 Kernel: Refactor MemoryManager to use a Bitmap rather than a Vector
This significantly reduces the pressure on the kernel heap when
allocating a lot of pages.

Previously at about 250MB allocated, the free page list would outgrow
the kernel's heap. Given that there is no longer a page list, this does
not happen.

The next barrier will be the kernel memory used by the page records for
in-use memory. This kicks in at about 1GB.
2019-06-12 15:38:17 +02:00
Conrad Pankoff
1a77dfed23 Kernel: Add some comparison operators to PhysicalAddress 2019-06-12 15:38:17 +02:00
Conrad Pankoff
8df44b476d Kernel: Use an environment variable to set the memory size in the run script 2019-06-12 15:38:17 +02:00
Conrad Pankoff
f0ce0910ab Userland: Add test program for stressing memory allocation 2019-06-12 15:38:17 +02:00
Conrad Pankoff
f7dce4765c AK: Add find_first_{set,unset} and grow methods to Bitmap 2019-06-12 15:38:17 +02:00
Larkin Nickle
fa204aeb77 build-root-filesystem.sh: Create /dev/null, /dev/random, /dev/zero, and /dev/full with proper permissions. 2019-06-12 09:43:58 +02:00
Andreas Kling
e673bb921e AK: Delete the Badge copy and move constructors. 2019-06-11 23:47:51 -07:00
Andreas Kling
c4d24bb4e9 PaintBrush: Start fleshing out a toolbox widget. 2019-06-12 05:58:31 +02:00
Andreas Kling
d7756fc09f LibGUI: Add an "exclusive" property to GAbstractButtons.
This makes checkable buttons exclusive with other checkable buttons in the
same parent widget. Basically like radio buttons. This should probably be
used to implement GRadioButton once it's a bit more mature.
2019-06-12 05:57:26 +02:00
Andreas Kling
cadc65a82d PaintBrush: Let's use Color::MidGray for the outside-the-bitmap area. 2019-06-11 20:39:32 +02:00
Andreas Kling
70564a78b2 PaintBrush: Tidy up the UI a bit. Add some more colors. 2019-06-11 20:37:58 +02:00
Andreas Kling
1372f10dda Terminal: Add support for REP ('b' final)
Patch contributed by "pd"
2019-06-11 07:32:53 +02:00
Andreas Kling
58a2b9336a Color: Add inverted().
Patch contributed by "pd"
2019-06-11 07:28:59 +02:00
Andreas Kling
6ef45bc0ef PaintBrush: Add some placeholder menus so it looks proper. 2019-06-10 21:05:20 +02:00
Andreas Kling
ba2d0ab19a PaintBrush: Include in makeall.sh 2019-06-10 20:26:54 +02:00
Andreas Kling
1f756378e8 PaintBrush: Make it possible to switch colors using the PaletteWidget. 2019-06-10 20:07:26 +02:00
Andreas Kling
f86b1bdca1 PaintBrush: Add a PaletteWidget to allow color selection.
Also use different colors for left/right mouse button. :^)
2019-06-10 19:54:09 +02:00
Andreas Kling
642c82fbff PaintBrush: Use draw_line() when drawing continuously. 2019-06-10 19:35:24 +02:00
Andreas Kling
6aa4cb6740 GraphicsBitmap: Add a fill(Color) helper.
This only works for RGB32 and RGBA32 bitmaps at the moment, since it's not
obvious what should happen in an Indexed8 bitmap.
2019-06-10 19:29:50 +02:00
Andreas Kling
d599544890 PaintBrush: Start working on a simple painting application. 2019-06-10 19:29:33 +02:00
Andreas Kling
63f029ef9b Kernel: Use NetworkOrdered<T> in ARPPacket. 2019-06-10 00:59:19 -07:00
Andreas Kling
487909dd7b FileSystem: Don't perform path resolution twice for open() with O_CREAT. 2019-06-09 19:52:03 +02:00
Andreas Kling
51d70996ba Ext2FS: The block numbers returned by allocate_blocks() should be 1-based.
e2fsck complained about two inodes sharing the same block, and this was why.
2019-06-09 14:59:46 +02:00
Andreas Kling
7562c0b7bf Ext2FS: Fix wrong file mode being passed from create_inode() to add_child(). 2019-06-09 12:48:34 +02:00
Andreas Kling
6873e7d016 Ext2FS: Move directory writing logic into Ext2FSInode. 2019-06-09 12:46:23 +02:00
Andreas Kling
3bc699a336 Ports: Add 'figlet' port.
This was the first piece of 3rd party software I got running on Serenity,
so having it as a port feels like some kind of milestone. I think :^)
2019-06-09 12:20:43 +02:00
Andreas Kling
9da62f52a1 Kernel: Use the Multiboot memory map info to inform our paging setup.
This makes it possible to run Serenity with more than 64 MB of RAM.
Because each physical page is represented by a PhysicalPage object, and such
objects are allocated using kmalloc_eternal(), more RAM means more pressure
on kmalloc_eternal(), so we're gonna need a better strategy for this.

But for now, let's just celebrate that we can use the 128 MB of RAM we've
been telling QEMU to run with. :^)
2019-06-09 11:48:58 +02:00
Andreas Kling
8258b699db Kernel: Use StringView more in Inode and subclasses. 2019-06-09 10:25:19 +02:00
Andreas Kling
cdb44be703 StringView: Store a StringImpl* rather than a String*. 2019-06-08 23:55:13 +02:00
Andreas Kling
6a51093ab1 AK: Add String::operator==(const char*).
Without this function, comparing a String to a const char* will instantiate
a temporary String which is obviously not great.

Also add some missing null checks to StringView::operator==(const char*).
2019-06-08 18:32:09 +02:00
Conrad Pankoff
8b1154f5f2 Kernel: Implement serial port driver
This implements a basic 8250 UART serial port driver. It does not
currently handle (or enable) interrupts, nor any runtime configuration.
2019-06-08 18:12:20 +02:00
Conrad Pankoff
7b04c7dc48 Userland: Implement -c [characters] option for head 2019-06-08 18:01:06 +02:00
Conrad Pankoff
842bf96e2c Kernel: Fix booting from "inactive" MBR partitions
Apparently you can boot from any MBR partition, not just the one labeled
as "bootable" or "active". The only ones you don't want to boot from are
the ones that don't exist.
2019-06-08 17:59:17 +02:00
Andreas Kling
de65c960e9 Kernel: Tweak some String&& => const String&.
String&& is just not very practical. Also return const String& when the
returned string is a member variable. The call site is free to make a copy
if he wants, but otherwise we can avoid the retain count churn.
2019-06-07 20:58:12 +02:00
Andreas Kling
736092a087 Kernel: Move i386.{cpp,h} => Arch/i386/CPU.{cpp,h}
There's a ton of work that would need to be done before we could spin up on
another architecture, but let's at least try to separate things out a bit.
2019-06-07 20:02:01 +02:00
Andreas Kling
5bce004d84 Kernel: The kernel will never call mmx_memcpy() so prune it. 2019-06-07 19:32:12 +02:00
Andreas Kling
891d4c4834 Kernel: Qualify a bunch of #include statements. 2019-06-07 19:29:34 +02:00
Andreas Kling
de9edb0169 StringView: operator==(const char*) needs to stop when the view ends.
We were comparing past the end of the view, which was clearly not correct.
2019-06-07 19:22:58 +02:00
Andreas Kling
f90d75e5b9 Meta: Time for a new screenshot to keep things fresh. :^) 2019-06-07 18:14:13 +02:00
Andreas Kling
191112e457 Meta: Tweak ReadMe. 2019-06-07 17:57:03 +02:00
Andreas Kling
a0bde822ee AK: Add IterationDecision.h. 2019-06-07 17:14:16 +02:00
Andreas Kling
39d1a9ae66 Meta: Tweak .clang-format to not wrap braces after enums. 2019-06-07 17:13:23 +02:00
Andreas Kling
9145917bf0 ELF: Run clang-format on everything. 2019-06-07 17:12:30 +02:00
Andreas Kling
e42c3b4fd7 Kernel: Rename LinearAddress => VirtualAddress. 2019-06-07 12:56:50 +02:00
Andreas Kling
0ed89440f1 ProcessManager+top: Rename "linear" size to "virtual" size.
I originally called it "linear" because that's how the Intel manual names
virtual addresses in many cases. I'm ready to accept that most people know
this as "virtual" so let's just call it that.
2019-06-07 12:44:29 +02:00
Andreas Kling
54448b5d24 Kernel: Syscall header should forward-declare timeval with C linkage. 2019-06-07 11:52:27 +02:00
Andreas Kling
2c70ae0418 Demos: Run clang-format on everything. 2019-06-07 11:50:05 +02:00