malxau / yori

Yori is a CMD replacement shell that supports backquotes, job control, and improves tab completion, file matching, aliases, command history, and more.
http://www.malsmith.net/yori/
MIT License
1.24k stars 31 forks source link

add support for PowerPC in Makefile #111

Closed tenox7 closed 1 year ago

malxau commented 1 year ago

I don't mind taking this as-is, since it's a good standalone first step. If you're looking for complete PowerPC support:

  1. Add something at https://github.com/malxau/yori/blob/master/pkg/bld.ys1#L20 to generate -ppc .cab files
  2. Add something at https://github.com/malxau/yori/blob/master/pkg/bld.ys1#L28 to set FDI=1 for ppc. This is because there won't be a PowerPC cabinet.dll so the only way to decompress .cab files is via statically linking the decompressor. This is available in the NT 4 SDK.
  3. In theory, the code to consume -pcc .cab files already exists but it's never been used before (https://github.com/malxau/yori/blob/master/pkglib/remote.c#L1190)
  4. It looks like sdir can display the architecture of executable files (with -dar) but doesn't know ppc (https://github.com/malxau/yori/blob/master/sdir/callbacks.c#L255)
  5. Update the memory alignment requirement for the debug build memory allocator. I assume for any RISC system this should be sizeof(DWORD) (https://github.com/malxau/yori/blob/master/lib/malloc.c#L193)
  6. The most painful part is the debugger logic. When Yori executes a .cmd script, it runs CMD under a mini-debugger to capture the environment from the CMD process when it dies. "Real" debuggers are very CPU-specific. This one just hits behavioral quirks. As far as I can tell, x86 issues a breakpoint to the debugger and on continuation moves to the next instruction; MIPS had to be told to move to the next instruction (see https://github.com/malxau/yori/blob/master/sh/wait.c#L495 ) and I have no idea what PPC would do. It also wouldn't shock me if the memory alignment needs updating, since this code is really trying to find the environment block in CMD's memory so if any structure layout is different for PPC it might look in the wrong place.
tenox7 commented 1 year ago

ok, please take this as is for now and I will work on the other items at another time

tenox7 commented 1 year ago

Also how do you want the built artifacts? I emailed you a zip file, but I can upload it somewhere.