about summary refs log tree commit diff stats
path: root/subx/012elf.cc
Commit message (Collapse)AuthorAgeFilesLines
* 5188Kartik Agaram2019-05-181-9/+7
| | | | Clean up some unused constants.
* start using the new carry flagKartik Agaram2019-05-131-13/+10
| | | | | Skimping on tests; the code changes seem pretty trivial. Will this fix CI?!
* 5157Kartik Agaram2019-05-111-1/+3
| | | | | Support allocating more than 0x01000000 bytes (8MB) to a segment in the VM.
* 5155 - check for overflow in mmap segmentsKartik Agaram2019-05-111-1/+7
|
* 5152 - check for stack underflow/overflow in VMKartik Agaram2019-05-111-0/+1
|
* 5151 - use mmap everywhere we need a heapKartik Agaram2019-05-101-5/+12
| | | | | All tests passing now. Things are very explicit; before a program can `allocate` memory, it has to first obtain a segment from the OS using `new-segment`.
* 5149Kartik Agaram2019-05-101-3/+8
| | | | Tests still broken.
* 5148Kartik Agaram2019-05-091-9/+7
| | | | | Snapshot of incomplete work to have the memory allocator use `mmap` rather than `brk`. C tests pass, but the SubX layers are still broken.
* 4996 - back on pack.subxKartik Agaram2019-03-081-3/+3
| | | | | | | | | Yet another redrawing of responsibilities between convert and its helpers. In the process I discovered a bug in `write-stream-buffered` which ended up taking me through a detour to extract `browse_trace` into its own tool. It turns out just having long buffers is enough to need browse_trace. Simple operations like clearing a stream swamp a flat view of the trace.
* 4987 - support `browse_trace` tool in SubXKartik Agaram2019-02-251-6/+7
| | | | | | | | | | | | | | | | | | I've extracted it into a separate binary, independent of my Mu prototype. I also cleaned up my tracing layer to be a little nicer. Major improvements: - Realized that incremental tracing really ought to be the default. And to minimize printing traces to screen. - Finally figured out how to combine layers and call stack frames in a single dimension of depth. The answer: optimize for the experience of `browse_trace`. Instructions occupy a range of depths based on their call stack frame, and minor details of an instruction lie one level deeper in each case. Other than that, I spent some time adjusting levels everywhere to make `browse_trace` useful.
* 4986 - spending some time improving SubX tracesKartik Agaram2019-02-231-4/+7
| | | | | | Now that our test runs are getting longer, debugging is again becoming a bottleneck. Time to start using trace depths along with `mu browse-trace` from the top-level.
* 4898Kartik Agaram2018-12-301-1/+1
|
* 4883 - rudimentary memory allocatorKartik Agaram2018-12-281-1/+1
|
* 4878Kartik Agaram2018-12-271-1/+1
|
* 4868Kartik Agaram2018-12-161-1/+1
|
* 4761Kartik Agaram2018-11-231-4/+4
| | | | | Bugfix: I forgot about ELF segment offsets when implementing VMAs. Eventually segments grew large enough that I started seeing overlaps.
* 4723Kartik Agaram2018-10-241-0/+9
| | | | Fix CI.
* 4720Kartik Agaram2018-10-241-2/+2
| | | | Raise an error when we fall off the end of the code segment.
* 4661Kartik Agaram2018-10-041-12/+10
| | | | | Make segment management a little more consistent between initial segments and add-on segments (using `mmap`).
* 4632Kartik Agaram2018-10-011-3/+10
| | | | Detect overlapping segments when loading ELF binaries.
* 4614 - redo simulated RAMKartik Agaram2018-09-291-19/+20
| | | | | | | | | | | Now simulated 'Memory' isn't just a single flat array. Instead it knows about segments and VMAs. The code segment will always be first, and the data/heap segment will always be second. The brk() syscall knows about the data segment. One nice side-effect is that I no longer need to mess with Memory initialization regardless of where I place my segments.
* 4565Kartik Agaram2018-09-211-2/+3
|
* 4537Kartik Agaram2018-09-071-1/+0
| | | | | | | | | | | | | | | Streamline the factorial function; we don't need to save a stack variable into a register before operating on it. All instructions can take a stack variable directly. In the process we found two bugs: a) Opcode f7 was not implemented correctly. It was internally consistent but I'd never validated it against a natively running program. Turns out it encodes multiple instructions, not just 'not'. b) The way we look up imm32 operands was sometimes reading them before disp8/disp32 operands.
* 4528 - commandline arguments working nativelyKartik Agaram2018-08-311-14/+5
| | | | | | | | | | | | | | Turns out I had totally the wrong idea. The stack at the start of the program doesn't contain 2 words, one for argc and a second for argv that must then be dereferenced to get to its contents (each a pointer to a string). It contains a word for argc, one for argv[0], another for argv[1], and so on. Many thanks to Jeremiah Orians and the #bootstrappable channel on freenode for showing me https://github.com/oriansj/mescc-tools/blob/master/test/test5/exec_enable_amd64.M1 which set me straight. I could just pop the args like that example does, but it seems slightly more elegant, given the current calling convention, to assume the imaginary caller handles the popping.
* 4527 - reading commandline argumentsKartik Agaram2018-08-301-4/+36
| | | | | | | | | | | The new example ex9 doesn't yet work natively. In the process I've emulated the kernel's role in providing args, implemented a couple of instructions acting on 8-bit operands (useful for ASCII string operations), and begun the start of the standard library (ascii_length is the same as strlen). At the level of SubX we're just only going to support ASCII.
* 4519Kartik Agaram2018-08-131-5/+5
|
* 4469Kartik Agaram2018-08-031-0/+143