Age | Commit message (Collapse) | Author |
|
We can now return from a CALL! :^)
|
|
Since we have the ELF executable handy, we can actually symbolicate the
disassembly trace output really easily. Very cool! :^)
|
|
|
|
|
|
|
|
|
|
When the Destination and Source of an op_foo were types of different
sizes, the generated assembly was not filling up the "source" register
fully in some cases. This led to incorrect results.
|
|
|
|
This patch adds a basic ELF program loader to the UserspaceEmulator and
creates MMU regions for each PT_LOAD header. (Note that we don't yet
respect the R/W/X flags etc.)
We also turn the SoftCPU into an X86::InstructionStream and give it an
EIP register so we can actually execute code by fetching memory through
our MMU abstraction.
|
|
|
|
|
|
|
|
It's quite nice having these as compartmentalized free functions.
|
|
More inline assembly. I'm still figuring out how to combine templates
and inline assembly, but it's turning out pretty cool. :^)
|
|
There are 16 conditions and they're all based on a combination of the
CPU flags.
|
|
|
|
|
|
These are identical to SUB, except they don't store the result (they
only upate the arithmetic flags.)
|
|
|
|
|
|
Let's try doing this with some inline assembly. We know we're running
on an x86 target anyway. :^)
|
|
|
|
And they're all generic, which will make it easy to support more ops.
|
|
|
|
|
|
Let's use C++ templates to implement the generic parts of instructions.
There are tons of them with the same set of inputs, just different
behavior. Templates are perfect for this.
|
|
Some things will flow better if we're able to index into a table of our
segment registers.
|
|
|
|
Clang didn't like default construction of PartAddressableRegister,
so let's just use memset() then.
|
|
This patch adds a PartAddressableRegister type, which divides a 32-bit
value into separate parts needed for the EAX/AX/AL/AH register splits.
Clean up the code around register access to make it a little less
cumbersome to use.
|
|
Programs now start out with a 64 KB stack at 0x10000000. :^)
|
|
This Emulator sub-object will keep track of all active memory regions
and handle memory read/write operations from the CPU.
A memory region is currently represented by a virtual Region object
that can implement arbitrary behavior by overriding read/write ops.
|
|
This is one step closer to the real thing. :^)
|
|
Note that this is a partial implementation since we don't have support
for memory r/m variants yet.
|
|
|
|
Until we learn more instructions, we'll have to exit somewhere, so let
us exit when we hit a RET instruction for now.
|
|
This introduces a new X86 CPU emulator for running SerenityOS userspace
programs in a virtualized interpreter environment.
The main goal is to be able to instrument memory accesses and catch
interesting bugs that are very hard to find otherwise. But before we
can do fancy things like that, we have to build a competent emulator
able to actually run programs.
This initial version is able to run a very small program that makes
some tiny syscalls, but nothing more.
|
|
In keeping with the slightly-higher-contrast theme.
|
|
Use the new API to avoid duplicating code in the RunningProcessesModel.
|
|
During app teardown, the Application object may be destroyed before
something else, and so having Application::the() return a reference was
obscuring the truth about its lifetime.
This patch makes the API more honest by returning a pointer. While
this makes call sites look a bit more sketchy, do note that the global
Application pointer only becomes null during app teardown.
|
|
Having this on the stack makes whole-program teardown iffy. Turning it
into a Core::Object allows anyone who needs it to extends its lifetime.
|
|
This feels a bit nicer and make it possible to reuse this in other
places as well. :^)
|
|
GUI::TableView looks at data(Model::Role::Sort) to know which order
things should be in.
|
|
|
|
We now show a list of running processes that the user can choose from.
After choosing one, we start profiling it and show a timer with a stop
button that the user has to press to stop profiling.
|
|
|
|
This allows the inspector to show arbitrary json structures.
|
|
It's less code, and it's potentially more efficient once
posix_spawn is a real syscall.
|
|
Also simplify the way we change the background color a little bit.
|
|
- Parsing invalid JSON no longer asserts
Instead of asserting when coming across malformed JSON,
JsonParser::parse now returns an Optional<JsonValue>.
- Disallow trailing commas in JSON objects and arrays
- No longer parse 'undefined', as that is a purely JS thing
- No longer allow non-whitespace after anything consumed by the initial
parse() call. Examples of things that were valid and no longer are:
- undefineddfz
- {"foo": 1}abcd
- [1,2,3]4
- JsonObject.for_each_member now iterates in original insertion order
|