Commit Graph

19 Commits

Author SHA1 Message Date
Kartik Agaram aa6c342af9 4343
Let's minimize the alignment requirements of each segment's offset.
It'll make binaries take less room later. Otherwise we may need to pad
lots of 0s for segments after the first.

Generated ELF binaries continue to work natively (except ex4, but that
was already not working).
2018-07-14 10:43:34 -07:00
Kartik Agaram 6f812e6ea1 4342 2018-07-11 07:45:45 -07:00
Kartik Agaram 262f6ea81b 4341 2018-07-10 22:39:46 -07:00
Kartik Agaram 1a48f95a87 4338 - preliminary support for data segments 2018-07-10 20:27:21 -07:00
Kartik Agaram 1f4d0aaf08 4334
Fix CI.
2018-07-10 07:18:36 -07:00
Kartik Agaram 1ce67ba21b 4332
Minimize memory footprint while running subx ELF binaries. We don't use
memory before address 0x08048000, so we don't need to allocate space for
it.
2018-07-09 22:43:40 -07:00
Kartik Agaram 43b170ea03 4330 - start allocating data/stack/heap segments
ex4 now writes to the (global) data segment, rather than trying to write
to the code segment.

We still need to specify the other segments in the generated ELF,
though.
2018-07-08 22:57:50 -07:00
Kartik Agaram 665a4d7040 4327
Encapsulate RAM management.
2018-07-08 22:33:15 -07:00
Kartik Agaram 486413fdde 4318
Simpler.

Now it's clear that what commit 4291 got wrong was an
alignment-violating address for both the entrypoint and the start of the
segment.
2018-07-06 23:38:33 -07:00
Kartik Agaram 517a471bc0 4316
Second attempt at commit 4291. We'll now not copy the headers into
memory, but we'll still allocate space for them. Still some security
benefits, and I'm gaining confidence that I understand the ELF format.
2018-07-06 23:33:42 -07:00
Kartik Agaram c110018250 4311 - subx running binaries with global variables
Learning to use the data segment.

Currently, subx can only run the teensy files generated from flat
assembler:
  test4
  test5
  test7

This is not a priority to fix. These files are just useful references to
have around.
2018-07-03 16:36:37 -07:00
Kartik Agaram 0defd18cfc 4308
Undo 4291; turns out the generated ELF binary was no longer running
natively on 32-bit Linux. Even with p_align set to 0.

Agh, not worth my time.
2018-07-03 14:57:39 -07:00
Kartik Agaram 7c71860b87 4307
Undo 4306.
2018-07-03 10:06:07 -07:00
Kartik Agaram c07651f8ec 4306 - architecture sketch
Doesn't compile.
I'm still not sure how to represent types and global variables.
Types won't be in the final binary.
But globals will. Perhaps I should first figure out what that looks like.
2018-07-02 22:16:22 -07:00
Kartik Agaram 7b686a02ca 4300 - get set up to unit test translator 2018-06-30 23:05:40 -07:00
Kartik Agaram b20d9ad303 4298 - framework for translating SubX programs 2018-06-30 22:46:32 -07:00
Kartik Agaram 672e0a7e5f 4291 - stop copying the ELF header into memory
No need for it once the program's loaded. And we keep programs from
running the header as code.

This also simplifies the header computation in the translator.
2018-06-30 21:32:52 -07:00
Kartik Agaram 3e0c2b7c13 4290
Clarify a few happy accidents.
2018-06-30 10:47:01 -07:00
Kartik Agaram b141a448ce 4289 - beginnings of a translator to ELF
The source 'language' is still entirely open. We'll see how it evolves
as I write programs in machine code.
2018-06-30 09:41:22 -07:00