Commit graph

4827 commits

Author SHA1 Message Date
Andreas Kling
9963da9005 Start refactoring graphics system to have per-window backing stores.
It was fun for everyone to share a single framebuffer but it was also
kinda really awful. Let's move towards having a "GraphicsBitmap" as the
backing store for each Window.

This is going to need a lot of refactoring so let's get started.
2019-01-09 02:06:04 +01:00
Andreas Kling
2735b7e50d Add PhysicalAddress::offset(). 2019-01-08 22:29:34 +01:00
Andreas Kling
c088529cd8 Fix broken "make clean" in Userland. 2019-01-08 22:28:58 +01:00
Andreas Kling
355201f34d Vector<String>() -> { } 2019-01-08 22:28:11 +01:00
Andreas Kling
ba91ab1038 Don't omit frame pointers. Duh. This fixes /proc/PID/stack listings. 2019-01-04 19:02:21 +01:00
Andreas Kling
bad2fe33ad Fix crash when doing "ls -l" in the /proc/PID directory for a kernel process. 2019-01-04 18:50:16 +01:00
Andreas Kling
0d36281162 Refactor FS::find_parent_of_inode() into Inode::parent().
This way, Ext2FSInode can cache its parent inode index. This makes absolute
path lookups dramatically faster.
SynthFSInode is also simplified greatly.
2019-01-04 18:37:58 +01:00
Andreas Kling
7731aef7b2 Let the "reaped unparented process" messages go straight to the debugger. 2019-01-01 03:56:39 +01:00
Andreas Kling
eb78238032 Ext2FS: Don't worry about updating lookup caches in write_ext2_inode().
Instead, have Ext2FSInode worry about that when flushing.
Also tidy up in the inode bitmap accessors at the same time for some reason.
2019-01-01 03:55:43 +01:00
Andreas Kling
8f9542174f Ext2FS: Don't cache a full Ext2FSInode object for non-existent inodes.
This was a bit silly. We were always creating Ext2FSInode objects when
Ext2FSInode::get_inode() was called. They'd then sit and fatten up the
inode cache forever, despite not representing allocated inodes.

This patch consults the inode bitmap and if get_inode() is called with
an unallocated inode index, we simply cache a nullptr to represent the
fact that this index is unused.

This could be a lot better optimized, it will currently hit the disk for
every new inode index encountered.
2019-01-01 03:37:27 +01:00
Andreas Kling
d07b08a287 FS: Don't default to having a full InodeMetadata in every Inode.
This allows Ext2FS to keep its own ext2_inode around instead.
2019-01-01 03:16:36 +01:00
Andreas Kling
0cb074dc73 Ext2FS: On second thought, let's not uncache the Ext2FSInodes today.. 2019-01-01 02:52:21 +01:00
Andreas Kling
741349502f Ext2FS: Free Ext2FSInodes when the last user releases them.
The inode cache was keeping these alive forever. Added a cute little magic
trick to Retainable that calls T::one_retain_left() when the retain count
is decremented to 1.
2019-01-01 02:38:09 +01:00
Andreas Kling
42d9f18cae Remove the cheesy block cache from DiskBackedFS.
This should be reimplemented with proper paging support. This approach was
mostly just chewing kmalloc memory.
2019-01-01 02:27:05 +01:00
Andreas Kling
4b6a8f8a08 Unbreak ksym loading and make reading /proc/PID/stack not crash. 2019-01-01 02:20:01 +01:00
Andreas Kling
683185e4aa MM: Allocate page tables from a separate set of physical pages.
The old approach only worked because of an overpermissive accident.
There's now a concept of supervisor physical pages that can be allocated.
They all sit in the low 4 MB of physical memory and are identity mapped,
shared between all processes, and only ring 0 can access them.
2019-01-01 02:09:43 +01:00
Andreas Kling
a5ffa2eec7 Add a PageDirectory::flush() that does nothing if another PD is active.
This way callers can just flush() every time after making any modification
and the PageDirectory itself will decide if TLB invalidation is necessary.
2018-12-31 20:52:59 +01:00
Andreas Kling
cc30407b8c Oops, errno codes need to be negative in the kernel. 2018-12-31 20:38:25 +01:00
Andreas Kling
9eca2ffd41 Make PhysicalPage eternally allocated. 2018-12-31 20:25:42 +01:00
Andreas Kling
3e37a1f5c3 Optimize PageDirectory destruction.
Remove an extra hash lookup and only iterate over the actually-used
PhysicalPages that we need to clean up.
2018-12-31 15:18:02 +01:00
Andreas Kling
edac1d6748 Make PageDirectory store physical pages in a HashMap.
This container is really just there to keep a retain on the individual
PhysicalPages for each page table. A HashMap does the job with far greater
space efficiency.
2018-12-31 15:10:12 +01:00
Andreas Kling
193ead94f8 Let PageDirectory have a PhysicalPage for the PDB instead of being the PDB.
This is more efficient than using the wasteful kmalloc_aligned() approach
to allocation. It also allows much tighter encapsulation of the class.
2018-12-31 14:58:03 +01:00
Andreas Kling
2239ab96e7 Tweak /bin/id output slightly. 2018-12-29 03:44:37 +01:00
Andreas Kling
eed6031064 Fix EXT2_DEBUG build. 2018-12-29 03:36:22 +01:00
Andreas Kling
0dd5279eb1 MM: Fix bug when mapping a region with a VMO with non-zero offset. 2018-12-29 03:35:48 +01:00
Andreas Kling
46ce47a984 Use the entry point address from the ELF header instead of looking up _start.
I love these kind of dumb gotcha moments. Turns out you can find the entry
address right there in the header. :^)
2018-12-29 03:28:55 +01:00
Andreas Kling
ab72666f48 Plug leaks in SynthFS::remove_file().
The process spawn stress test can now run forever. :^)
2018-12-28 03:09:45 +01:00
Andreas Kling
3f3535213b Fix some issues uncovered by the spawn stress test. 2018-12-26 22:02:24 +01:00
Andreas Kling
f6179ad9f9 Add slightly better kmalloc_aligned() and kfree_aligned().
Process page directories can now actually be freed. This could definitely
be implemented in a nicer, less wasteful way, but this works for now.

The spawn stress test can now run for a lot longer but eventually dies
due to kmalloc running out of memory.
2018-12-26 21:47:15 +01:00
Andreas Kling
55c722096d Process::create_user_process() shouldn't leak a process if exec() fails. 2018-12-26 21:04:27 +01:00
Andreas Kling
2f010e941c Unbreak the spawn stress test. 2018-12-26 20:57:51 +01:00
Andreas Kling
079889050e Merge lookup_ext2_inode() into Ext2FS::get_inode(). 2018-12-25 00:32:57 +01:00
Andreas Kling
6451b98ad4 Refactor FS::add_inode_to_directory() into Inode::add_child(). 2018-12-25 00:27:39 +01:00
Andreas Kling
4f142b86ec Refactor FS::write_inode() into Inode::write(). 2018-12-25 00:10:32 +01:00
Andreas Kling
b0db0e5de0 Get rid of Ext2FS::modify_link_count() in favor of Inode accessors. 2018-12-24 23:58:00 +01:00
Andreas Kling
673870563d Convert some FS methods to return RetainPtr<Inode>. 2018-12-24 23:45:09 +01:00
Andreas Kling
1e07ead119 Get rid of Ext2FS::is_directory_inode().
This was only used for assertions and will be factored out in favor of
Inode metadata checks eventually.
2018-12-24 23:38:15 +01:00
Andreas Kling
12a6963a5d Fix bug where Vnode kept its Inode alive indefinitely. 2018-12-24 23:24:49 +01:00
Andreas Kling
033a42b580 The syncd loop can just be a lambda. 2018-12-24 23:10:48 +01:00
Andreas Kling
503e32552c Move kernel symbolication code out of init.cpp and into its own KSym files.
Also use a simple array of { dword, const char* } for the KSyms and put the
whole shebang in kmalloc_eternal() memory. This was a fugly source of
kmalloc perma-frag.
2018-12-24 23:01:09 +01:00
Andreas Kling
6a9fa3e41a Let sys$sigaction() fail if called with SIGKILL or SIGSTOP. 2018-12-24 22:22:35 +01:00
Andreas Kling
7bc41532be Remove FS::read_entire_inode() in favor of Inode::read_entire(). 2018-12-21 17:45:42 +01:00
Andreas Kling
04ee693925 Get rid of FS::inode_metadata() since we use Inode::metadata() everywhere. 2018-12-21 17:32:18 +01:00
Andreas Kling
8a71303827 Get rid of FS::read_inode_bytes() and use Inode::read_bytes() everywhere. 2018-12-21 17:28:16 +01:00
Andreas Kling
951ed6692b Remove InodeIdentifier::metadata(). 2018-12-21 17:16:53 +01:00
Andreas Kling
3a0a8848fb Make syscall invocations look pleasant.
Old: Syscall::invoke(Syscall::SC_foo, (dword)arg1, (dword)arg2)
New: syscall(SC_foo, arg1, arg2)
2018-12-21 03:02:06 +01:00
Andreas Kling
36bd53b36a Add a simple /bin/more. 2018-12-21 02:42:30 +01:00
Andreas Kling
4dd50b1f6d Get rid of three test utilities that I no longer need. 2018-12-21 02:22:21 +01:00
Andreas Kling
a9f256a745 Make the Widgets/ directory build again. 2018-12-21 02:18:16 +01:00
Andreas Kling
ec1c487dcd Yet another pass of style fixes. 2018-12-21 02:10:45 +01:00