Commit graph

2174 commits

Author SHA1 Message Date
VAN BOSSUYT Nicolas
8ac813135a Meta: forgot to gitignore Toolchain/Local 2019-04-29 13:12:20 +02:00
VAN BOSSUYT Nicolas
be1100497d Toolchain: GCC and binutils are now configure correctly 2019-04-29 13:12:20 +02:00
VAN BOSSUYT Nicolas
4b05ec9549 Toolchain: Added build script (wip) 2019-04-29 13:12:20 +02:00
Andreas Kling
0a0d739e98 Kernel: Make FIFO inherit from File. 2019-04-29 04:55:54 +02:00
Andreas Kling
f254a84d17 Launcher: Add icons for VisualBuilder and IRCClient. 2019-04-29 04:07:36 +02:00
Andreas Kling
475a17fa4b VFS: Also respect the sticky bit of the new parent in rename().
Obviously we should not allow overwriting someone else's files in a sticky
directory either.
2019-04-28 23:34:33 +02:00
Andreas Kling
e4eca17848 VFS: Implement sticky bit behavior for rename() and unlink().
Removing entries from a sticky directory is only allowed when you are either
the owner of the entry, or the superuser. :^)
2019-04-28 22:54:30 +02:00
Andreas Kling
a104d7cc93 Kernel: Make SharedMemory inherit from File. 2019-04-28 22:31:31 +02:00
Andreas Kling
a6d407fec5 Ext2FS: Put some debug spam behind EXT2_DEBUG. 2019-04-28 22:14:37 +02:00
Andreas Kling
899f6a5de2 Ext2FS: Support shrinking inode to a smaller size.
Factor out inode resizing into a separate Ext2FSInode::resize() function.
This is then called both from write_bytes() and truncate().
This patch finally implements freeing of blocks when an inode shrinks.
2019-04-28 22:07:25 +02:00
Andreas Kling
89df887e1f Kernel: Dump backtrace on user process page fault. 2019-04-28 22:05:13 +02:00
Andreas Kling
5dee5c325e GEventLoop: Don't call process_unprocessed_messages() from itself.
This could be tail-call-optimized but it's not, so we end up overflowing the
stack space if we recurse too many times. This was causing crashes when
resizing Minesweeper.
2019-04-28 22:03:18 +02:00
Andreas Kling
c91b0d6b5f FileDescriptor: Let TTY handle its own absolute_path(). 2019-04-28 15:09:23 +02:00
Andreas Kling
e886337a67 Kernel: Make ProcessTracer inherit from File. 2019-04-28 15:02:55 +02:00
Andreas Kling
7ec1f6ab3c Kernel: Add File, a base class for anything that a FileDescriptor can wrap.
FileDescriptor is getting out of control, and the layering isn't quite right
so let's make a File class that everything can inherit from. Then we can
stop worrying about all kinds of specifics in FileDescriptor.
2019-04-28 14:53:50 +02:00
Andreas Kling
75734aa003 Minesweeper: Add considering feature, where middle clicking marks with '?'
This is useful in the harder modes, for trying out different possibilities.
2019-04-28 13:55:41 +02:00
Andreas Kling
ed957ca2e1 WindowServer: Add 1280x720 resolution to the system menu. 2019-04-28 05:24:52 +02:00
Andreas Kling
d32d85e133 Kernel: Fix rename() sometimes failing to move within the same directory.
It was wrong to do a reverse name lookup on the old inode after adding
a new name for it, since we might very well get the new inode instead of
the old one, depending on hash table layouts.
2019-04-27 22:38:51 +02:00
Andreas Kling
95ddca8a52 LibC: Make the malloc()/free() scrubbing runtime optional (default on.)
Memory returned by malloc() is normally memset with 0x85.
Memory passed to free() is normally memset with 0x82.

These behaviors can now be disabled by setting one or both of
LIBC_NOSCRUB_MALLOC and LIBC_NOSCRUB_FREE in your environment. :^)
2019-04-27 21:19:56 +02:00
Andreas Kling
f80244399d LibC: Add dummy pthread.h for GCC build. 2019-04-27 21:19:18 +02:00
Andreas Kling
d3fb0a56ed LibC: Make fwrite() buffered.
This is a really naive implementation that makes fwrite() call fputc()
internally, but it still performs a lot better due to avoiding the write()
syscall every time.
2019-04-27 17:32:47 +02:00
Andreas Kling
52139a2392 DiskBackedFS: Flush write cache if it reaches 32 entries before sync.
This is just to avoid chewing through all of the kernel memory. There is a
lot of room for improvement here, and 32 is just a number from the place
where numbers come from.
2019-04-27 17:30:32 +02:00
Andreas Kling
dde8d90747 Ext2FS: Fix accidental zero-fill when appending to a file.
We were using the old file size, rather than the new file size, to determine
how much to zero-fill in the last block of a file.
2019-04-27 17:14:27 +02:00
Andreas Kling
100cb2a237 LibC: Various stdio correctness fixes. 2019-04-27 16:19:11 +02:00
Andreas Kling
679ac386eb Kernel: "Succeed" quietly for zero-length read() and write(). 2019-04-27 16:17:24 +02:00
Andreas Kling
8bce4b3f42 GTableView: Ignore double-clicks that hit the header section. 2019-04-26 23:13:05 +02:00
Andreas Kling
8f81a3f9dd LibGUI+WindowServer: Make it possible to have checkable GActions.
They show up as checkable GButtons in GToolBar, and with (or without) check
marks in menus.

There are a bunch of places to make use of this. This patch only takes
advantage of it in the FileManager for the view type actions.
2019-04-26 21:09:56 +02:00
Andreas Kling
9ff36afeaa GWindow: Fix crash when calling set_rect() repeatedly.
We throw away the backing store if the window rect changes size. Since the
resizing happens asynchronously at the mercy of the WindowServer, we might
end up in set_rect() again before gaining a new backing store. So there are
no guarantees that the back/front bitmaps exist here.
2019-04-26 20:08:30 +02:00
Andreas Kling
146aedc32c Minesweeper: Implement some feature requests.
Someone was playing this game and suggested a number of improvements so here
we go trying to address them:

- Add "chording" support, where you can click a numbered square using both
  mouse buttons simultaneously to sweep all non-flagged adjacent squares.

- Mis-flagged squares are now revealed as such on game over, with a special
  "bad flag" icon.

- The game timer now shows tenths of seconds. It also doesn't start until
  you click the first square.

- Add the three difficulty modes from the classic Windows version.
2019-04-26 19:54:31 +02:00
Andreas Kling
e90b501b31 GraphicsBitmap: munmap() pixels on destruction of self-allocating bitmaps. 2019-04-26 18:25:05 +02:00
Andreas Kling
d93c278d29 GWindow: Add resize(width, height) and resize(size). 2019-04-26 17:33:20 +02:00
Andreas Kling
b204b77b29 sh: Remove debug spam during command launch. 2019-04-26 17:33:06 +02:00
Andreas Kling
08bc5d44e7 Games: Use Makefile.common here too. 2019-04-26 15:14:28 +02:00
Andreas Kling
104af4a5dc LibGUI: Allow subclassing of GLabel. 2019-04-26 14:16:17 +02:00
Andreas Kling
ba2e97aa52 LibGUI: Track double-clicking per individual mouse button.
Clicking two separate buttons in quick succession shouldn't be interpreted
as a double click.
2019-04-26 14:15:11 +02:00
Andreas Kling
d4a8e2930e sh: Add a simple "export" command for setting environment variables. 2019-04-26 03:23:27 +02:00
Andreas Kling
490e89e240 LibC: Add execvpe() and make execvp()'ed children inherit environment. 2019-04-26 03:16:26 +02:00
Andreas Kling
0a68e0046f LibCore: Make it possible to create a CFile for an existing file descriptor. 2019-04-26 02:22:21 +02:00
Andreas Kling
c392c0d799 Userland: Add a simple /bin/tr program. 2019-04-26 00:57:37 +02:00
Andreas Kling
671dee9afa Userland: Add a simple /bin/sort program. 2019-04-26 00:53:57 +02:00
Andreas Kling
b5a1ee1d3e Userland: Add a simple /bin/head program. 2019-04-26 00:47:30 +02:00
Andreas Kling
8effdc807a LibC: Update stdio stream error state in more places. 2019-04-26 00:41:37 +02:00
Andreas Kling
1163e0a030 Kernel: Don't count kfree(nullptr) as a call to kfree().
This was causing the kmalloc/kfree call delta to accumulate errors.
2019-04-25 23:18:11 +02:00
Andreas Kling
96d4b701e6 sh: Make "cd" jump to the home directory. And also let's set $HOME.
Nobody else is setting $HOME right now, so we might as well do it here.
This should eventually be done by some sort of "login" program.
2019-04-25 23:09:21 +02:00
Andreas Kling
89e9aafbb5 sh: Support erasing a whole word with WERASE (^W). 2019-04-25 23:05:10 +02:00
Andreas Kling
71770e000b GTextEditor: Add very basic automatic indentation.
This is off by default, but enabled by TextEditor. It simply inserts the
same number of leading spaces as the previous line when hitting Enter. :^)
2019-04-25 22:56:09 +02:00
Andreas Kling
8a3d00ac02 GTableView: Double-click should only activate/edit valid indices. 2019-04-25 22:55:44 +02:00
Andreas Kling
e2e2c78332 GTextEditor: Double-clicking on a word should select that word. 2019-04-25 22:29:25 +02:00
Andreas Kling
44673c4f3b Kernel: Add a write cache to DiskBackedFS.
This way you can spam small write()s on a file without the kernel writing
to disk every single time. Flushes are included in the FS::sync() operation
and will get triggered regularly by syncd. :^)
2019-04-25 22:05:53 +02:00
Andreas Kling
e0cdc5db0d Ext2FS: Reduce debug spam in block allocation. 2019-04-25 22:05:32 +02:00