Editing Stage0

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 7: Line 7:
 
== Design ==
 
== Design ==
 
Stage0 starts with only 2 things:
 
Stage0 starts with only 2 things:
 
 
1) A trusted binary that implements the VM Spec [http://git.savannah.nongnu.org/cgit/stage0.git/tree/ISA_HEX_Map.org]
 
1) A trusted binary that implements the VM Spec [http://git.savannah.nongnu.org/cgit/stage0.git/tree/ISA_HEX_Map.org]
 
 
2) A sub 300byte hex monitor [How you create it is up to you; I like toggling it in manually myself]
 
2) A sub 300byte hex monitor [How you create it is up to you; I like toggling it in manually myself]
  
Line 108: Line 106:
 
and supports all of the syntax support of Hex2 to allow
 
and supports all of the syntax support of Hex2 to allow
 
sample taken from [http://git.savannah.nongnu.org/cgit/stage0.git/tree/stage1/CAT.s CAT.s]
 
sample taken from [http://git.savannah.nongnu.org/cgit/stage0.git/tree/stage1/CAT.s CAT.s]
 
== Variations ==
 
The most common variation is to extend hex2 with additional functionality, such as extending the standard set to include
 
 
* ! - 8 bit relative address (short jumps for 8086 or small immediate values)
 
* @ - 16 bit relative address (ironically not really used in x86)
 
* $ - 16 bit absolute address (rare use in x86)
 
* % - 32 bit relative address (long jumps for x86)
 
* & - 32 bit absolute address (for pointers)
 
 
more exotic mixes may replace hex with octal (for x86 but not AMD64) because it is a better match for the underlying opcode space.
 
 
== Common mistakes ==
 
Trying to bootstrap a bigger language than M0/M1 assembly tends to devolve into a growing cycle of more and more work with little return.
 
Simply bootstrap the stage0 VM and be done with that madness.
 

Please note that all contributions to bootstrapping are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) (see bootstrapping:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)