Commit graph

2688 commits

Author SHA1 Message Date
Conrad Pankoff 042895317d AK: Add AKString::split_limit to split strings with a limit
This is a small change to the existing split() functionality to support
the case of splitting a string and stopping at a certain number of
tokens. This is useful for parsing e.g. key/value pairs, where the value
may contain the delimiter you're splitting on.
2019-06-04 10:16:45 +02:00
Andreas Kling ccc6e69a29 LibC: Implement popen() and pclose().
I feel reasonably confident that I might have gotten these right. :^)
2019-06-03 21:17:58 +02:00
Christopher Dumas e92fe52031 Terminal: Use Vectors and OwnPtrs for Terminal lines. Adjust scroll
region behavior
2019-06-03 20:48:34 +02:00
Christopher Dumas ce15a4021d Terminal: Implement scroll region termcodes 2019-06-03 20:48:34 +02:00
Robin Burchell ab004f73bf Painter: Reduce the number of draw_text overloads to only involve StringView
No more char + int sequences, as that's literally what StringView is for.
2019-06-03 20:27:05 +02:00
Robin Burchell 1024dfa81a StringViewize a bunch of things -- mostly LibGUI 2019-06-03 20:27:05 +02:00
Robin Burchell f9ba7adae2 StringView: Make construction of String from a StringView containing a String cheaper
... at the cost of an additional pointer per view.
2019-06-03 20:27:05 +02:00
Christopher Dumas 8fecc0eaee Userland: Implement recursive rm 2019-06-03 20:16:00 +02:00
Andreas Kling 8af495495b LibC: Implement dirfd(). 2019-06-03 18:42:40 +02:00
Andreas Kling 3fa0b6cd92 WindowServer: Always update the maximize button icon when we should.
We were only updating it in the WSButton callback, not when changing the
maximized state by calling WSWindow::set_maximized().

Fixes #119.
2019-06-02 15:35:00 +02:00
Andreas Kling ae4ac524ad CIODevice: Update m_error if a write() fails. 2019-06-02 15:18:27 +02:00
Conrad Pankoff c02b8b715d Kernel: Implement MBR partition loader (#168)
This implements a basic MBR partition loader, which removes the reliance
on a hard-coded filesystem offset in the stage2 init.
2019-06-02 14:57:44 +02:00
Robin Burchell 466a817950 sync: Make this work for Fedora
Fedora has grub2-install (rather than grub-install), and it expects
grub.cfg to be placed in boot/grub2/ rather than boot/grub/.
2019-06-02 14:46:59 +02:00
Robin Burchell 7bce096afd Take StringView in more places
We should work towards a pattern where we take StringView as function
arguments, and store String as member, to push the String construction
to the last possible moment.
2019-06-02 12:55:51 +02:00
Robin Burchell b55b6cd7fc AK: Add implicit String -> StringView conversion
And tidy up existing view() users.
2019-06-02 12:55:51 +02:00
Robin Burchell decf1afbaa Userland: Use CFile in dmesg 2019-06-02 12:55:51 +02:00
Robin Burchell 7de861bdd9 Userland: Use CFile in mm 2019-06-02 12:55:51 +02:00
Robin Burchell 9a4ec2e92a Userland: Use CFile in ps 2019-06-02 12:55:51 +02:00
Robin Burchell e74b5975e4 Userland: Use CFile inside sysctl
Also add a StringView overload to CIODevice::write
2019-06-02 12:55:51 +02:00
Andreas Kling 092f06a719 Boot: Let's start GRUB with no timeout. 2019-06-02 12:52:40 +02:00
Andreas Kling a53c922f8a FileSystem: Rename VFS::fchmod() -> chmod(). 2019-06-02 12:52:21 +02:00
Andreas Kling e67bfdb7f6 FileSystem: Route chown() and fchown() through VFS for access control. 2019-06-02 12:52:21 +02:00
Andreas Kling aa35c08633 FileSystem: Only retrieve inode metadata once in VFS::chown(). 2019-06-02 12:52:21 +02:00
vger92 1876606973 Userland: Add tee command (#166) 2019-06-02 12:45:17 +02:00
Conrad Pankoff 32d78a8526 Kernel: Rename OffsetDiskDevice to DiskPartition 2019-06-02 12:37:29 +02:00
Conrad Pankoff 8eb492aa11 Kernel: Rename offset parameter of OffsetDiskDevice to block_offset 2019-06-02 12:37:29 +02:00
Conrad Pankoff b094fe3f2f Kernel: Add DISK_SIZE option to sync.sh 2019-06-02 12:37:29 +02:00
Conrad Pankoff 6f43f81fb4 Kernel: Implement OffsetDiskDevice to prepare for partition support
This implements a passthrough disk driver that translates the read/write
block addresses by a fixed offset. This could form the basis of MBR
partition support if we were to parse the MBR table at boot and create that
OffsetDiskDevice dynamically, rather than seeking to a fixed offset.

This also introduces a dependency in the form of grub. You'll need to have
32-bit grub binaries installed to build the project now.

As a bonus, divorcing Serenity from qemu's kernel loading means we can now
*technically* boot on real hardware. It just... doesn't get very far yet.
If you write the `_disk_image` file to an IDE hard drive and boot it in a
machine that supports all the basic PC hardware, it *will* start loading
the kernel.
2019-06-02 12:37:29 +02:00
Andreas Kling 5e1c7cb32c Kernel: Memory-mapped files now have the absolute path as their name.
It's generated when the mapping is first created, so it won't update if
the file moves. Maybe that's something we should support, too.
2019-06-02 10:14:28 +02:00
Andreas Kling 4320c5fd58 Kernel: Make better use of the multiboot info.
Define the multiboot info struct properly so we don't have to grab at byte
offsets in the memory access checker code. Also print kernel command line
in init().
2019-06-02 09:53:42 +02:00
Andreas Kling 8454d3e184 Kernel: Add comment block about File, taking some from Device. 2019-06-02 09:23:37 +02:00
Andreas Kling e24f18dd83 AK: Add a comment to String about the relationship with StringImpl. 2019-06-02 08:37:01 +02:00
Andreas Kling 93d3d1ede1 Kernel: Add fchown() syscall. 2019-06-01 20:31:36 +02:00
Andreas Kling 51581c21fc WindowServer+LibGUI: Add a way to bring a window to the front.
GWindow::move_to_front() can now be used to move a window to the top of
the window stack.

We use this in Terminal to bring the settings window to the front if it
already exists when it's requested, in case it's hiding behind something.
2019-06-01 20:10:37 +02:00
Andreas Kling 8d7fbbe1fb WindowServer: Don't reach the end of mode_to_enum() without returning. 2019-06-01 20:02:05 +02:00
Andreas Kling 2dd9ef6863 Kernel: Make File::absolute_path() const. 2019-06-01 18:56:56 +02:00
Andreas Kling 00de8b9fc4 FileSystem: Don't create a temporary FileDescriptor every time we stat().
Instead, move the stat buffer population into InodeMetadata so we can call
it directly from VFS::stat() once we have an Inode.
2019-06-01 18:46:39 +02:00
Andreas Kling bba2c062fe FileSystem: Make Inode::lookup() take a StringView.
This avoids a lot of String allocation during path resolution.
2019-06-01 18:01:28 +02:00
Andreas Kling 49768524d4 VM: Get rid of KernelPagingScope.
Every page directory inherits the kernel page directory, so there's no need
to explicitly enter the kernel's paging scope anymore.
2019-06-01 17:51:48 +02:00
Andreas Kling 00f291b090 Kernel: Set the absolute path as name for executable regions. 2019-06-01 17:50:43 +02:00
Andreas Kling 2e14e5891c FileSystem: Remove now-unused Inode::parent() and Inode::reverse_lookup().
These were only used to implement the old path resolution algorithm.
2019-06-01 17:46:37 +02:00
Andreas Kling 02e21de20a VM: Always flush TLB for kernel page directory changes.
Since the kernel page directory is inherited by all other page directories,
we should always flush the TLB when it's updated.
2019-06-01 17:25:36 +02:00
Andreas Kling 6956d161c4 PNGLoader: Annotate the decompression buffer mmap with a name. 2019-06-01 17:06:35 +02:00
Andreas Kling ba58b4617d VM: Don't remap each Region page twice in page_in().
page_in_from_inode() will map the page after reading it from disk, so we
don't need to remap it once again.
2019-06-01 15:45:50 +02:00
Conrad Pankoff 6cabd34b93 Userland: Improve head program
* allow specifying files as arguments, e.g. `head a b c`
* support multiple files
* print a filename header when multiple files are being printed
* allow suppression or forcing of filename header via flags

This change drops support for the legacy `-123` syntax in favour of the
more widely-supported `-n 123` form.

fixes #105
2019-06-01 14:48:03 +02:00
Andreas Kling b8e705da0e LibCore: CObjects without is<T> specialization shouldn't LARP as others. 2019-06-01 14:11:31 +02:00
Mustafa a4726b846c ls: Show user name and group name if available. (#151)
Fixes #150
2019-06-01 13:23:35 +02:00
Conrad Pankoff 51a74fb3bb Userland: Add a /bin/yes program (fixes #110) 2019-06-01 12:16:55 +02:00
Andreas Kling 473d0e83ad Terminal: Fix insufficient repaint after visual bell clears.
Also make the bell time a little shorter, 500ms kinda wears on you. :^)
2019-06-01 00:36:56 +02:00
Andreas Kling 40ca3b019f VisualBuilder: Add GRadioButton to the widget repertoire. 2019-06-01 00:23:31 +02:00