Commit Graph

995 Commits

Author SHA1 Message Date
Andreas Kling
1fffc0ae60 Kernel: stat(), fstat() and lstat() didn't return some error codes. 2019-02-03 06:27:16 +01:00
Andreas Kling
0c9a2b1430 Kernel: Oops, I mixed up st_dev and st_rdev in struct stat. 2019-02-03 06:23:10 +01:00
Andreas Kling
e895d6c48e Kernel: Add /proc/self, a symlink to the /proc/$PID.
This will be useful for implementing things like /dev/stdin.
2019-02-03 04:54:52 +01:00
Andreas Kling
c2adfd0e2d LibC: Implement various things to get GNU bc building and running.
Looks like that's all we needed, and bc now runs. :^)
2019-02-03 04:32:31 +01:00
Andreas Kling
3a9c01619f Ext2FS: Avoid a kmallocation every time we fetch an inode from disk. 2019-02-03 04:05:30 +01:00
Andreas Kling
db2422d0d3 Terminal: Constrain the cursor inside the terminal rect. 2019-02-03 04:04:42 +01:00
Andreas Kling
333aa1646c Kernel: Increase default userspace stack size to 64 kilobytes. 2019-02-03 03:56:08 +01:00
Andreas Kling
2a093ada33 WindowServer: Add some stripes to the window titles.
I like the look of this right now. Maybe later I'll feel differently.
2019-02-03 03:38:44 +01:00
Andreas Kling
3198639730 SharedGraphics: Add missing clipping in draw_line(). 2019-02-03 03:37:55 +01:00
Andreas Kling
dd931f136e guitest2: Stop showing the font test window by default. 2019-02-03 03:36:10 +01:00
Andreas Kling
663aad4036 FontEditor: Add text box for editing the font name. 2019-02-03 03:06:58 +01:00
Andreas Kling
5877feab1b Liza8x10: Tweak some glyphs. 2019-02-03 03:06:43 +01:00
Andreas Kling
2d17fe58bc Kernel: Remove unnecessary assertion in page_in_from_inode().
Turns out I had confused myself about the situation. Just because a page
has been paged in by another process doesn't mean that the *current*
process's page directory has the present bit set! D'oh. :^)
2019-02-03 03:04:40 +01:00
Andreas Kling
3eeff0dd14 Kernel: Improve crash info if page_in_from_inode() is called redundantly. 2019-02-03 02:49:59 +01:00
Andreas Kling
c63d476da2 Kernel: Let's have cli() and sti() clobber memory.
I don't like the idea of the compiler reordering anything around either
cli() or sti(), so let's make sure it doesn't.
2019-02-03 02:47:55 +01:00
Andreas Kling
e2f27aa7b5 Userland: Make /bin/date pretty-print the date, too. 2019-02-03 02:47:37 +01:00
Andreas Kling
7e4376d469 Kernel: When entering page_in_from_inode(), assert that !physical_page.
It would be really weird to enter here with a physical page already present
in the VMObject's page slot. Let's assert that this doesn't happen.
2019-02-03 02:33:47 +01:00
Andreas Kling
d8a172609c FontEditor: Add a grid to the glyph editor widget. 2019-02-03 02:20:30 +01:00
Andreas Kling
e97fea3169 Liza8x10: Tweak some glyphs. 2019-02-03 02:20:12 +01:00
Andreas Kling
10fde0d707 Userland: Pretty-print modification times in /bin/ls. 2019-02-03 02:14:41 +01:00
Andreas Kling
5751063c63 Load the default font from disk in the kernel as well. 2019-02-03 01:44:08 +01:00
Andreas Kling
abe3f515b1 Make font loading use mmap().
This exposed a serious race condition in page_in_from_inode().
Reordered the logic and added a paging lock to VMObject.
Now, only one process can page in from a VMObject at a time.
There are definitely ways to optimize this, for instance by making
the locking be per-page instead. It's not something that I'm going
to worry about right now though.
2019-02-03 01:36:25 +01:00
Andreas Kling
7f91aec25c Support font files.
This only works with the userspace build of SharedGraphics so far.
It's also very slow at loading fonts, but that's easy to fix.

Let's put fonts in /res/fonts/.
2019-02-02 23:13:12 +01:00
Andreas Kling
655753c557 SharedGraphics: Fix Font.cpp kernel build. 2019-02-02 17:42:16 +01:00
Andreas Kling
6fc3c38324 Start working on a simple graphical font editor.
Editing fonts by editing text files is really slow and boring.
A simple font editor seems like a good way to take LibGUI for a spin.
2019-02-02 08:07:06 +01:00
Andreas Kling
5e0b7f1a56 Add basic automatic dependency management to Makefiles. 2019-02-02 04:41:59 +01:00
Andreas Kling
7e64154d3f Remove Editor/ since I wasn't maintaining or trying to develop it. 2019-02-02 04:28:45 +01:00
Andreas Kling
76f53b40f4 LibC: Add some things needed to build GNU bc.
This patch adds vprintf(), sig_atomic_t, random() and strdup().
bc doesn't build yet, but it will.
2019-02-01 16:03:21 +01:00
Andreas Kling
feed67ede2 Kernel: VFS::open/create should take base Inode& instead of InodeIdentifier. 2019-02-01 15:36:45 +01:00
Andreas Kling
6618411fba Kernel: mkdir() should use the containing directory's FS for inode creation. 2019-02-01 15:29:11 +01:00
Andreas Kling
33e7df5955 Kernel: mkdir() should fail if the pathname is empty. 2019-02-01 15:29:05 +01:00
Andreas Kling
240b5fe677 Terminal: Draw the cursor by reversing foreground/background color.
This makes the cursor pleasantly see-through.
2019-02-01 05:40:27 +01:00
Andreas Kling
b7967d1292 SharedGraphics: Make Painter::fill_rect() respect the current DrawOp. 2019-02-01 05:23:05 +01:00
Andreas Kling
95c3442d59 Implement event loop timers.
GObjects can now register a timer with the GEventLoop. This will eventually
cause GTimerEvents to be dispatched to the GObject.

This needed a few supporting changes in the kernel:

- The PIT now ticks 1000 times/sec.
- select() now supports an arbitrary timeout.
- gettimeofday() now returns something in the tv_usec field.

With these changes, the clock window in guitest2 finally ticks on its own.
2019-02-01 03:50:06 +01:00
Andreas Kling
9153666e72 Userland: /bin/ls shouldn't display inode numbers by default.
Added the -i option to ls which turns on inode number display.
2019-01-31 17:34:24 +01:00
Andreas Kling
ffab6897aa Big, possibly complete sweep of naming changes. 2019-01-31 17:31:23 +01:00
Andreas Kling
27fa09aee4 LibC: Add mktime(). 2019-01-31 16:51:27 +01:00
Andreas Kling
e04ba0a83c Add a simple clock window to guitest2.
This is driven by mousedown events right now, since there are no timers.
2019-01-31 16:37:43 +01:00
Andreas Kling
2dc9c86bad Kernel: Make Process a Weakable class.
Use this to fix a use-after-free in ~GraphicsBitmap(). We'd hit this when
the WindowServer was doing a deferred destruction of a WSWindow whose
backing store referred to a now-reaped Process.
2019-01-31 07:02:40 +01:00
Andreas Kling
fc0b63ca3c Kernel: Include absolute paths of mount points in /proc/mounts 2019-01-31 06:13:55 +01:00
Andreas Kling
34e745b0b4 Add uid and gid to CharacterDevices.
The vast majority of them will be owned by 0:0 (the default.)
However, PTY pairs will now be owned by the uid:gid of the opening process.
2019-01-31 05:55:30 +01:00
Andreas Kling
c4fce9b3f9 Make stat() work on device files again.
FileDescriptor will now keep a pointer to the original inode even after
opening it resolves to a character device.

Fixed up /bin/ls to display major and minor device numbers instead of size
for device files.
2019-01-31 05:05:57 +01:00
Andreas Kling
c3cc318028 Ext2FS: Remove an unnecessary heap allocation in create_inode(). 2019-01-31 04:17:16 +01:00
Andreas Kling
0932efe72e Kernel: Actually zero-fill eagerly committed regions.
Previously, calling Region::commit() would make sure to allocate any missing
physical pages, but they would contain uninitialized data. This was very
obvious when allocating GraphicsBitmaps as they would have garbage pixels
rather than being filled with black.

The MM quickmap mechanism didn't work when operating on a non-active page
directory (which happens when we're in the middle of exec, for example.)
This patch changes quickmap to reside in the shared kernel page directory.

Also added some missing clobber lists to inline asm that I stumbled on.
2019-01-31 04:03:05 +01:00
Andreas Kling
6b88025dda Remove the last remaining #ifndef SERENITY blocks. 2019-01-31 02:56:54 +01:00
Andreas Kling
2c6a3f1907 Terminal: Oops, escape sequences for the left and right keys were swapped. 2019-01-30 21:20:44 +01:00
Andreas Kling
56b6fb198a Add support for keyboard arrow keys.
Also have them send the appropriate escape sequences in Terminal.
Basic history browsing now works in bash. How nice! :^)
2019-01-30 21:18:13 +01:00
Andreas Kling
f176af7cd1 Terminal: Implement 'J' escape "clear from cursor to end of screen." 2019-01-30 21:04:49 +01:00
Andreas Kling
d1b805172d Rename the default user to "anon" and give him a home directory. 2019-01-30 20:40:41 +01:00
Andreas Kling
2a7af0eacf Kernel: Don't try to dump invalid code memory in page fault handler. 2019-01-30 20:18:50 +01:00