HACKING 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. -*-mode:org-*-
  2. ## Copyright (C) 2017 Jeremiah Orians
  3. ## This file is part of mescc-tools.
  4. ##
  5. ## mescc-tools is free software: you can redistribute it and/or modify
  6. ## it under the terms of the GNU General Public License as published by
  7. ## the Free Software Foundation, either version 3 of the License, or
  8. ## (at your option) any later version.
  9. ##
  10. ## mescc-tools is distributed in the hope that it will be useful,
  11. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ## GNU General Public License for more details.
  14. ##
  15. ## You should have received a copy of the GNU General Public License
  16. ## along with mescc-tools. If not, see <http://www.gnu.org/licenses/>.
  17. mescc-tools being based on the goal of absolute minimal platform bootstrap.
  18. If your hardware doesn't have some crazy engineering decisions, mescc-tools can
  19. and likely will be trivially ported to it.
  20. * SETUP
  21. The most obvious way to setup for mescc-tools development is to install any C
  22. compiler and make clone of your choice.
  23. * BUILD
  24. The standard C based approach to building mescc-tools is simply running:
  25. make
  26. Should you wish to verify that mescc-tools was built correctly run:
  27. make test
  28. * ADDING an ARCHITECTURE
  29. The process is simple:
  30. 1) add an architecture flag for your architecture to hex2_linker.c
  31. 2) Then make sure byte and then bit order are correct
  32. 3) Tweak to make sure immediate prefixes are the correct size for your architecture
  33. 4) Then make sure relative displacements are calculated correctly
  34. 5) Then make sure absolute displacements are calculated correctly
  35. 6) add an architecture flag for your architecture to M1-Macro.c
  36. 7) Then make sure byte and then bit order are correct
  37. 8) Tweak to make sure immediate prefixes are the correct size for your architecture
  38. 9) If you require unusual string padding, please add that now
  39. 10) Write your architecture.def or architecture.M1 file to include instruction
  40. and register encodings that map to the required encoding.
  41. * ROADMAP
  42. The current outstanding work for mescc-tools is several architecture specific
  43. bootstrap ports, that unfortunately share C level code but require significant
  44. manual labor to implement.
  45. * DEBUG
  46. The default build process will generate debuggable binaries.
  47. as blood-elf will generate the segments and text section required for proper debugging
  48. * Bugs
  49. mescc-tools is the most unforgiving assembly development environment possible.
  50. Things such as manual padding requirements, arbitrary instruction encoding and
  51. other features of these tools, make for rapid bootstrapping but horrific
  52. development environments.
  53. Please only use these tools to bootstrap your system from zero; otherwise cross-
  54. compile with gcc and save yourself the pain.